Skip to content

Commit

Permalink
PRO-2862 - Coingecko Changes (#161)
Browse files Browse the repository at this point in the history
* coingecko database addition

* ft: adding cron jobs to increase cache hit ratio for oracle data (#157)

* ft: adding cron jobs to increase cache hit ratio for oracle data

* update version

* changes to make native oracle calls only for chainlink

* Fix/arb token (#158)

* fix for arb token in multi token paymaster

* update cron expression for erc20 oracle update cron

* comment and version update

* Pro 2857 (#153) (#159)

* Pro 2857 (#153)

* ft: adding support for verifying paymaster

* update: package.json version

* fix: changing names for mode, minor fix for entry point error message

* changes: common whitelist endpoints for v1/v2, removed v2 endpoints for whitelist

* adding changelog for backend

* chnages: version change, minor response changes for metadata and add stake routes

* coingecko database addition

* merge bug fixes

* updated version

* added required env vars to demo env

* changed to pro key

* changes done as requested

* changes to retain v2 endpoints, minor changes for change log

* updated changelog

---------

Co-authored-by: Nikhil Kumar <[email protected]>
Co-authored-by: nikhil kumar <[email protected]>
  • Loading branch information
3 people committed Jan 24, 2025
1 parent 8142feb commit 87414a0
Show file tree
Hide file tree
Showing 19 changed files with 1,576 additions and 470 deletions.
12 changes: 10 additions & 2 deletions backend/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
# Changelog
## [1.8.0] - 2024-12-25
## [2.0.1] - 2025-01-08
### New
- added `/whitelist/v2`, `/removeWhitelist/v2` and `/checkWhitelist/v2` endpoints back.
- `/whitelist`, `/removeWhitelist`, `checkWhitelist`, `/deposit/v2`, `/` endpoints accept `useVp` param which when set to true uses VerifyingPaymaster contract instead of EtherspotPaymaster.
- added coingecko support for token prices alone
- Added fetching of api_key data from db and for hosted setup only private key gets fetched from aws
- added `metadata/v2` api for ep7 config


## [2.0.0] - 2024-12-25
### Breaking changes
- removed `/whitelist/v1`, `/removeWhitelist/v1`, `/checkWhitelist/v1` endpoints.
- removed `/whitelist/v2`, `/removeWhitelist/v2`, `/checkWhitelist/v2` endpoints.

### New
Expand Down
6 changes: 5 additions & 1 deletion backend/demo.env
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,8 @@ MULTI_TOKEN_MARKUP=1150000
ETHERSCAN_GAS_ORACLES=
DEFAULT_API_KEY=
WEBHOOK_URL=
MTP_VGL_MARKUP=30000
MTP_VGL_MARKUP=30000

# coingecko
COINGECKO_URL=
COINGECKO_API_KEY=
55 changes: 55 additions & 0 deletions backend/migrations/2024123000001-create-coingecko-tokens.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
const { Sequelize } = require('sequelize')

async function up({ context: queryInterface }) {
await queryInterface.createTable('coingecko_tokens', {
"ID": {
type: Sequelize.INTEGER,
primaryKey: true,
autoIncrement: true,
allowNull: false
},
"TOKEN": {
allowNull: false,
primaryKey: false,
type: Sequelize.TEXT
},
"ADDRESS": {
type: Sequelize.STRING,
allowNull: false
},
"CHAIN_ID": {
type: Sequelize.BIGINT,
allowNull: false
},
"COIN_ID": {
type: Sequelize.STRING,
allowNull: false,
primaryKey: true
},
"DECIMALS": {
type: Sequelize.INTEGER,
allowNull: false,
},
"CREATED_AT": {
type: Sequelize.DATE,
allowNull: false,
defaultValue: Sequelize.NOW
},
"UPDATED_AT": {
type: Sequelize.DATE,
allowNull: false,
defaultValue: Sequelize.NOW
}
}, {
schema: process.env.DATABASE_SCHEMA_NAME
});
}

async function down({ context: queryInterface }) {
await queryInterface.dropTable({
tableName: 'coingecko_tokens',
schema: process.env.DATABASE_SCHEMA_NAME
});
}

module.exports = { up, down }
76 changes: 76 additions & 0 deletions backend/migrations/20241231000001-default_coingecko_tokens.cjs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
require('dotenv').config();

const vp7Contracts = JSON.stringify({
31: "0x805650ce74561C85baA44a8Bd13E19633Fd0F79d",
50: "0xABA00E929d66119A4A7F4B2E27150fC387ee801c",
51: "0x2b7cBFA523E0D0546C6d1F706b79dB7B6d910bdA",
97: "0xD9A97785a91086FDeF17980eDC2f9D290d71153F",
114: "0x5952653F151e844346825050d7157A9a6b46A23A",
123: "0xf6E4486156cc2F982eceC15a90B23047F396EcBE",
5003: "0x42963C58DE382D34CB5a7f77b703e645FcE6DD26",
80002: "0x9ddB9DC20E904206823184577e9C571c713d2c57",
84532: "0xD9A97785a91086FDeF17980eDC2f9D290d71153F",
421614: "0x5FD81CfCAa69F44B6d105795961b3E484ac9e7dB",
534351: "0xD9A97785a91086FDeF17980eDC2f9D290d71153F",
11155111: "0x8B57f6b24C7cd85007068Bf0587382804B225DB6",
11155420: "0x51a62e2B1E295CAe7Db5b91886735f9Ce335AcFB",
28122024: "0xc95A2Fb019445C9B3459c2C59e7cd6Ad2c8FBb1E"
});

async function up({ context: queryInterface }) {
await queryInterface.sequelize.query(
`UPDATE ${process.env.DATABASE_SCHEMA_NAME}."api_keys" SET "VERIFYING_PAYMASTERS_V2"='${vp7Contracts}' WHERE "API_KEY"='arka_public_key'`
);
}

async function down({ context: queryInterface }) {
await queryInterface.sequelize.query(
`UPDATE ${process.env.DATABASE_SCHEMA_NAME}."api_keys" SET "VERIFYING_PAYMASTERS_V2"=${null} WHERE "API_KEYS"='arka_public_key'`
);
}

module.exports = {up, down};
2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "arka",
"version": "2.0.1",
"version": "2.1.0",
"description": "ARKA - (Albanian for Cashier's case) is the first open source Paymaster as a service software",
"type": "module",
"directories": {
Expand Down
Loading

0 comments on commit 87414a0

Please sign in to comment.