diff --git a/packages/crons/yarn.deploy.lock b/packages/crons/yarn.deploy.lock index dc7734046..b777ac5e2 100644 --- a/packages/crons/yarn.deploy.lock +++ b/packages/crons/yarn.deploy.lock @@ -233,10 +233,12 @@ __metadata: cors: ^2.8.5 dotenv: ^16.0.3 fastify: ^4.13.0 + fastify-cron: ^1.3.1 git-format-staged: ^2.1.3 ky: ^0.31.4 nodemon: ^2.0.20 pg: ^8.9.0 + prom-client: ^15.0.0 sequelize: ^6.28.0 ts-loader: ^9.2.3 ts-node: ^10.9.1 @@ -635,6 +637,13 @@ __metadata: languageName: node linkType: hard +"@opentelemetry/api@npm:^1.4.0": + version: 1.7.0 + resolution: "@opentelemetry/api@npm:1.7.0" + checksum: 2398cbe65f199c3a7050125b3ad9c835f789bb0a616665e9c7f4475a29ac8334b6a3c15f38db48d345b522180c41c00b04cc174cd0eeffba98eb4874a565fa7e + languageName: node + linkType: hard + "@pkgjs/parseargs@npm:^0.11.0": version: 0.11.0 resolution: "@pkgjs/parseargs@npm:0.11.0" @@ -826,6 +835,15 @@ __metadata: languageName: node linkType: hard +"@types/cron@npm:^2.0.0": + version: 2.4.0 + resolution: "@types/cron@npm:2.4.0" + dependencies: + cron: "npm:*" + checksum: c763e99a757ea76aee435948c25e0bdaf32ec44c69603088c73e8832df6b121e87932709925fe3e94777833ca30845c31df1167be54c330cf458d348059b9ffc + languageName: node + linkType: hard + "@types/crypto-js@npm:^4.1.1": version: 4.1.1 resolution: "@types/crypto-js@npm:4.1.1" @@ -880,6 +898,13 @@ __metadata: languageName: node linkType: hard +"@types/luxon@npm:~3.3.0": + version: 3.3.2 + resolution: "@types/luxon@npm:3.3.2" + checksum: b9111132720eae0269538872a5a496b29587ecfc8edc3b0ff7d269aa93a5ff00a131b23d1e9d1f12ec39f2c779ad21bd8d9f90b122c85a182771aabde7f676b8 + languageName: node + linkType: hard + "@types/mime@npm:*": version: 3.0.1 resolution: "@types/mime@npm:3.0.1" @@ -1312,6 +1337,13 @@ __metadata: languageName: node linkType: hard +"bintrees@npm:1.0.2": + version: 1.0.2 + resolution: "bintrees@npm:1.0.2" + checksum: 56a52b7d3634e30002b1eda740d2517a22fa8e9e2eb088e919f37c030a0ed86e364ab59e472fc770fc8751308054bb1c892979d150e11d9e11ac33bcc1b5d16e + languageName: node + linkType: hard + "bn.js@npm:^5.1.0, bn.js@npm:^5.1.2, bn.js@npm:^5.2.0, bn.js@npm:^5.2.1": version: 5.2.1 resolution: "bn.js@npm:5.2.1" @@ -1591,6 +1623,16 @@ __metadata: languageName: node linkType: hard +"cron@npm:*, cron@npm:^2.0.0": + version: 2.4.3 + resolution: "cron@npm:2.4.3" + dependencies: + "@types/luxon": "npm:~3.3.0" + luxon: "npm:~3.3.0" + checksum: cb0ad49653b37ba125f8670ca92150ce515493512b1b8a5e08086d22bec9c54dc6d8926fcdb49ea5783f6699862ca5fdc532a440ce33c3228f9b3d565010db2f + languageName: node + linkType: hard + "cross-fetch@npm:^3.1.5": version: 3.1.8 resolution: "cross-fetch@npm:3.1.8" @@ -1889,6 +1931,26 @@ __metadata: languageName: node linkType: hard +"fastify-cron@npm:^1.3.1": + version: 1.3.1 + resolution: "fastify-cron@npm:1.3.1" + dependencies: + "@types/cron": "npm:^2.0.0" + cron: "npm:^2.0.0" + fastify-plugin: "npm:^3.0.0" + peerDependencies: + fastify: ^4.1.0 + checksum: 152cc6bfe9ebd347747d922533e49b9ee0528d1c22677858046615a7bbae07166af7fd4f126c00f0c6d380aca33da6fa91f572c24cb586107753b03ab16392f9 + languageName: node + linkType: hard + +"fastify-plugin@npm:^3.0.0": + version: 3.0.1 + resolution: "fastify-plugin@npm:3.0.1" + checksum: 131ba0a388f777829c3fb0fd5b75cf057688ce6d0ca354fb1ebf829767a8c853b0825762b9185b5200097454df0ede2f3095da2efe1aa1b3736d07f194e6d374 + languageName: node + linkType: hard + "fastify-plugin@npm:^4.0.0": version: 4.5.1 resolution: "fastify-plugin@npm:4.5.1" @@ -2562,6 +2624,13 @@ __metadata: languageName: node linkType: hard +"luxon@npm:~3.3.0": + version: 3.3.0 + resolution: "luxon@npm:3.3.0" + checksum: 50cf17a0dc155c3dcacbeae8c0b7e80db425e0ba97b9cbdf12a7fc142d841ff1ab1560919f033af46240ed44e2f70c49f76e3422524c7fc8bb8d81ca47c66187 + languageName: node + linkType: hard + "make-error@npm:^1.1.1": version: 1.3.6 resolution: "make-error@npm:1.3.6" @@ -3223,6 +3292,16 @@ __metadata: languageName: node linkType: hard +"prom-client@npm:^15.0.0": + version: 15.0.0 + resolution: "prom-client@npm:15.0.0" + dependencies: + "@opentelemetry/api": ^1.4.0 + tdigest: ^0.1.1 + checksum: a447cc4c7d87e610f9ed9c018dcbe759f06d32b6c3d401d90cafa6b15feee54e0ec5d0ee1d4925db905ea35c6e894be842de25e6bc0b5d415147a0b714c248f8 + languageName: node + linkType: hard + "promise-retry@npm:^2.0.1": version: 2.0.1 resolution: "promise-retry@npm:2.0.1" @@ -3759,6 +3838,15 @@ __metadata: languageName: node linkType: hard +"tdigest@npm:^0.1.1": + version: 0.1.2 + resolution: "tdigest@npm:0.1.2" + dependencies: + bintrees: "npm:1.0.2" + checksum: 44de8246752b6f8c2924685f969fd3d94c36949f22b0907e99bef2b2220726dd8467f4730ea96b06040b9aa2587c0866049640039d1b956952dfa962bc2075a3 + languageName: node + linkType: hard + "text-encoding-utf-8@npm:^1.0.2": version: 1.0.2 resolution: "text-encoding-utf-8@npm:1.0.2" diff --git a/packages/distributor-oracle/package.json b/packages/distributor-oracle/package.json index 49bb2d662..a67d4e1a1 100644 --- a/packages/distributor-oracle/package.json +++ b/packages/distributor-oracle/package.json @@ -54,8 +54,10 @@ "cors": "^2.8.5", "dotenv": "^16.0.3", "fastify": "^4.13.0", + "fastify-cron": "^1.3.1", "ky": "^0.31.4", "pg": "^8.9.0", + "prom-client": "^15.0.0", "sequelize": "^6.28.0", "typescript-collections": "^1.3.3" }, diff --git a/packages/distributor-oracle/src/metrics.ts b/packages/distributor-oracle/src/metrics.ts new file mode 100644 index 000000000..e825b3e5c --- /dev/null +++ b/packages/distributor-oracle/src/metrics.ts @@ -0,0 +1,9 @@ +import client from "prom-client"; + +export const register = new client.Registry(); +export const totalRewardsGauge = new client.Gauge({ + name: "total_rewards", + help: "Total number of rewards", + labelNames: ["dnt_mint"], +}); +register.registerMetric(totalRewardsGauge); diff --git a/packages/distributor-oracle/src/server.ts b/packages/distributor-oracle/src/server.ts index f270baa5c..7bb33d350 100644 --- a/packages/distributor-oracle/src/server.ts +++ b/packages/distributor-oracle/src/server.ts @@ -1,5 +1,5 @@ import dotenv from "dotenv"; -import bs58 from "bs58"; +import fastifyCron from "fastify-cron"; dotenv.config(); // @ts-ignore import { @@ -9,7 +9,7 @@ import { getProvider, Instruction, Program, - setProvider + setProvider, } from "@coral-xyz/anchor"; import { decodeEntityKey, @@ -19,23 +19,34 @@ import { keyToAssetForAsset, } from "@helium/helium-entity-manager-sdk"; import { daoKey } from "@helium/helium-sub-daos-sdk"; -import { - HeliumEntityManager, -} from "@helium/idls/lib/types/helium_entity_manager"; +import { HeliumEntityManager } from "@helium/idls/lib/types/helium_entity_manager"; import { LazyDistributor } from "@helium/idls/lib/types/lazy_distributor"; -import { init as initLazy, lazyDistributorKey, PROGRAM_ID as LD_PID } from "@helium/lazy-distributor-sdk"; -import { init as initRewards, PROGRAM_ID as RO_PID} from "@helium/rewards-oracle-sdk"; -import { Asset, getAsset, HNT_MINT, IOT_MINT } from "@helium/spl-utils"; +import { + init as initLazy, + lazyDistributorKey, + PROGRAM_ID as LD_PID, +} from "@helium/lazy-distributor-sdk"; +import { + init as initRewards, + PROGRAM_ID as RO_PID, +} from "@helium/rewards-oracle-sdk"; +import { + Asset, + getAsset, + HNT_MINT, + IOT_MINT, + toNumber, +} from "@helium/spl-utils"; import { AccountFetchCache } from "@helium/account-fetch-cache"; import { Keypair, PublicKey, Transaction, - TransactionInstruction + TransactionInstruction, } from "@solana/web3.js"; import { Op } from "sequelize"; import fs from "fs"; -import { Reward } from "./model"; +import { Reward, sequelize } from "./model"; import Fastify, { FastifyInstance, FastifyRequest, @@ -44,19 +55,25 @@ import Fastify, { import cors from "@fastify/cors"; import { getLeafAssetId } from "@metaplex-foundation/mpl-bubblegum"; import { RewardsOracle } from "@helium/idls/lib/types/rewards_oracle"; - -const HNT = process.env.HNT_MINT ? new PublicKey(process.env.HNT_MINT) : HNT_MINT; +import { register, totalRewardsGauge } from "./metrics"; + +const HNT = process.env.HNT_MINT + ? new PublicKey(process.env.HNT_MINT) + : HNT_MINT; +const DNT = process.env.DNT_MINT + ? new PublicKey(process.env.DNT_MINT) + : IOT_MINT; const DAO = daoKey(HNT)[0]; const ENTITY_CREATOR = entityCreatorKey(DAO)[0]; export interface Database { + getTotalRewards(): Promise; getCurrentRewardsByEntity: (entityKey: string) => Promise; getCurrentRewards: (asset: PublicKey) => Promise; getBulkRewards: (entityKeys: string[]) => Promise>; getActiveDevices(): Promise; } - export class PgDatabase implements Database { constructor( readonly issuanceProgram: Program, @@ -66,6 +83,17 @@ export class PgDatabase implements Database { ) => Promise = getAsset ) {} + async getTotalRewards(): Promise { + const totalRewards = ( + await Reward.findAll({ + attributes: [ + [sequelize.fn("SUM", sequelize.col("rewards")), "rewards"], + ], + }) + )[0].rewards; + return totalRewards; + } + getActiveDevices(): Promise { return Reward.count({ where: { @@ -167,6 +195,24 @@ export class OracleServer { server.get("/health", async () => { return { ok: true }; }); + server.register(fastifyCron, { + jobs: [ + { + cronTime: "0 * * * *", + runOnInit: true, + onTick: async () => { + console.log("Updating total rewards"); + const rewards = toNumber(new BN(await db.getTotalRewards()), 6); + totalRewardsGauge + .labels(DNT.toBase58()) + .set(Number(rewards)); + }, + }, + ], + }); + server.get("/metrics", async (request, reply) => { + return register.metrics(); + }); this.app = server; this.addRoutes(); @@ -187,10 +233,13 @@ export class OracleServer { private addRoutes() { this.app.get("/active-devices", this.getActiveDevicesHandler.bind(this)); this.app.post("/bulk-rewards", this.getAllRewardsHandler.bind(this)); - this.app.get<{ Querystring: { assetId?: string; entityKey?: string, keySerialization?: BufferEncoding | "b58" } }>( - "/", - this.getCurrentRewardsHandler.bind(this) - ); + this.app.get<{ + Querystring: { + assetId?: string; + entityKey?: string; + keySerialization?: BufferEncoding | "b58"; + }; + }>("/", this.getCurrentRewardsHandler.bind(this)); this.app.post("/", this.signTransactionHandler.bind(this)); this.app.post("/bulk-sign", this.signBulkTransactionsHandler.bind(this)); } @@ -232,8 +281,12 @@ export class OracleServer { } if (entityKey) { - const [key] = await keyToAssetKey(this.dao, entityKey as string, keySerialization); - console.log(key.toBase58()) + const [key] = await keyToAssetKey( + this.dao, + entityKey as string, + keySerialization + ); + console.log(key.toBase58()); const keyToAsset = await this.hemProgram.account.keyToAssetV0.fetch(key); assetId = keyToAsset.asset.toBase58(); } @@ -432,10 +485,15 @@ export class OracleServer { keyToAssetK = ix.keys[wrapperKeyToAssetIdx].pubkey; //@ts-ignore proposedCurrentRewards = decoded.data.args.currentRewards; - entityKey = (await this.hemProgram.account.keyToAssetV0.fetch(keyToAssetK)).entityKey; + entityKey = ( + await this.hemProgram.account.keyToAssetV0.fetch(keyToAssetK) + ).entityKey; // A sneaky RPC could return incorrect data. Verify that the entity key is correct for the key to asset if (!keyToAssetKey(this.dao, entityKey)[0].equals(keyToAssetK)) { - return { success: false, message: "RPC lied about the entity key for this asset." }; + return { + success: false, + message: "RPC lied about the entity key for this asset.", + }; } } else if ( ix.keys[oracleKeyIdx].pubkey.equals(this.oracle.publicKey) && @@ -467,14 +525,13 @@ export class OracleServer { } mint = recipientAcc.asset; } - let keySerialization: any = { b58: {} } + let keySerialization: any = { b58: {} }; if (keyToAssetK) { const keyToAsset = await this.hemProgram.account.keyToAssetV0.fetch( keyToAssetK ); keySerialization = keyToAsset.keySerialization; } - // @ts-ignore const currentRewards = entityKey @@ -483,7 +540,10 @@ export class OracleServer { ) : await this.db.getCurrentRewards(mint); if (proposedCurrentRewards.gt(new BN(currentRewards))) { - return { success: false, message: `Invalid amount, ${proposedCurrentRewards} is greater than actual rewards ${currentRewards}` }; + return { + success: false, + message: `Invalid amount, ${proposedCurrentRewards} is greater than actual rewards ${currentRewards}`, + }; } } @@ -527,13 +587,11 @@ export class OracleServer { const errIdx = results.findIndex((x) => !x.success); if (errIdx > -1) { - res - .status(400) - .send({ - error: results[errIdx].message - ? `${results[errIdx].message}\n\nTransaction index: ${errIdx}` - : `Error signing transaction index: ${errIdx}`, - }); + res.status(400).send({ + error: results[errIdx].message + ? `${results[errIdx].message}\n\nTransaction index: ${errIdx}` + : `Error signing transaction index: ${errIdx}`, + }); return; } @@ -583,9 +641,7 @@ export class OracleServer { const ldProgram = await initLazy(provider); const roProgram = await initRewards(provider); const hemProgram = await initHeliumEntityManager(provider); - const DNT = process.env.DNT_MINT - ? new PublicKey(process.env.DNT_MINT) - : IOT_MINT; + const LAZY_DISTRIBUTOR = lazyDistributorKey(DNT)[0]; const server = new OracleServer( ldProgram, @@ -593,7 +649,7 @@ export class OracleServer { hemProgram, oracleKeypair, new PgDatabase(hemProgram), - LAZY_DISTRIBUTOR, + LAZY_DISTRIBUTOR ); // For performance new AccountFetchCache({ diff --git a/packages/distributor-oracle/yarn.deploy.lock b/packages/distributor-oracle/yarn.deploy.lock index 35d9ed56f..da1216a28 100644 --- a/packages/distributor-oracle/yarn.deploy.lock +++ b/packages/distributor-oracle/yarn.deploy.lock @@ -194,10 +194,12 @@ __metadata: cors: ^2.8.5 dotenv: ^16.0.3 fastify: ^4.13.0 + fastify-cron: ^1.3.1 git-format-staged: ^2.1.3 ky: ^0.31.4 nodemon: ^2.0.20 pg: ^8.9.0 + prom-client: ^15.0.0 sequelize: ^6.28.0 ts-loader: ^9.2.3 ts-node: ^10.9.1 @@ -503,6 +505,13 @@ __metadata: languageName: node linkType: hard +"@opentelemetry/api@npm:^1.4.0": + version: 1.7.0 + resolution: "@opentelemetry/api@npm:1.7.0" + checksum: 2398cbe65f199c3a7050125b3ad9c835f789bb0a616665e9c7f4475a29ac8334b6a3c15f38db48d345b522180c41c00b04cc174cd0eeffba98eb4874a565fa7e + languageName: node + linkType: hard + "@pkgjs/parseargs@npm:^0.11.0": version: 0.11.0 resolution: "@pkgjs/parseargs@npm:0.11.0" @@ -685,6 +694,15 @@ __metadata: languageName: node linkType: hard +"@types/cron@npm:^2.0.0": + version: 2.4.0 + resolution: "@types/cron@npm:2.4.0" + dependencies: + cron: "npm:*" + checksum: c763e99a757ea76aee435948c25e0bdaf32ec44c69603088c73e8832df6b121e87932709925fe3e94777833ca30845c31df1167be54c330cf458d348059b9ffc + languageName: node + linkType: hard + "@types/crypto-js@npm:^4.1.1": version: 4.1.1 resolution: "@types/crypto-js@npm:4.1.1" @@ -739,6 +757,13 @@ __metadata: languageName: node linkType: hard +"@types/luxon@npm:~3.3.0": + version: 3.3.2 + resolution: "@types/luxon@npm:3.3.2" + checksum: b9111132720eae0269538872a5a496b29587ecfc8edc3b0ff7d269aa93a5ff00a131b23d1e9d1f12ec39f2c779ad21bd8d9f90b122c85a182771aabde7f676b8 + languageName: node + linkType: hard + "@types/mime@npm:*": version: 3.0.1 resolution: "@types/mime@npm:3.0.1" @@ -1155,6 +1180,13 @@ __metadata: languageName: node linkType: hard +"bintrees@npm:1.0.2": + version: 1.0.2 + resolution: "bintrees@npm:1.0.2" + checksum: 56a52b7d3634e30002b1eda740d2517a22fa8e9e2eb088e919f37c030a0ed86e364ab59e472fc770fc8751308054bb1c892979d150e11d9e11ac33bcc1b5d16e + languageName: node + linkType: hard + "bn.js@npm:^5.1.0, bn.js@npm:^5.1.2, bn.js@npm:^5.2.0, bn.js@npm:^5.2.1": version: 5.2.1 resolution: "bn.js@npm:5.2.1" @@ -1423,6 +1455,16 @@ __metadata: languageName: node linkType: hard +"cron@npm:*, cron@npm:^2.0.0": + version: 2.4.3 + resolution: "cron@npm:2.4.3" + dependencies: + "@types/luxon": "npm:~3.3.0" + luxon: "npm:~3.3.0" + checksum: cb0ad49653b37ba125f8670ca92150ce515493512b1b8a5e08086d22bec9c54dc6d8926fcdb49ea5783f6699862ca5fdc532a440ce33c3228f9b3d565010db2f + languageName: node + linkType: hard + "cross-fetch@npm:^3.1.5": version: 3.1.8 resolution: "cross-fetch@npm:3.1.8" @@ -1714,6 +1756,26 @@ __metadata: languageName: node linkType: hard +"fastify-cron@npm:^1.3.1": + version: 1.3.1 + resolution: "fastify-cron@npm:1.3.1" + dependencies: + "@types/cron": "npm:^2.0.0" + cron: "npm:^2.0.0" + fastify-plugin: "npm:^3.0.0" + peerDependencies: + fastify: ^4.1.0 + checksum: 152cc6bfe9ebd347747d922533e49b9ee0528d1c22677858046615a7bbae07166af7fd4f126c00f0c6d380aca33da6fa91f572c24cb586107753b03ab16392f9 + languageName: node + linkType: hard + +"fastify-plugin@npm:^3.0.0": + version: 3.0.1 + resolution: "fastify-plugin@npm:3.0.1" + checksum: 131ba0a388f777829c3fb0fd5b75cf057688ce6d0ca354fb1ebf829767a8c853b0825762b9185b5200097454df0ede2f3095da2efe1aa1b3736d07f194e6d374 + languageName: node + linkType: hard + "fastify-plugin@npm:^4.0.0": version: 4.5.1 resolution: "fastify-plugin@npm:4.5.1" @@ -2380,6 +2442,13 @@ __metadata: languageName: node linkType: hard +"luxon@npm:~3.3.0": + version: 3.3.0 + resolution: "luxon@npm:3.3.0" + checksum: 50cf17a0dc155c3dcacbeae8c0b7e80db425e0ba97b9cbdf12a7fc142d841ff1ab1560919f033af46240ed44e2f70c49f76e3422524c7fc8bb8d81ca47c66187 + languageName: node + linkType: hard + "make-error@npm:^1.1.1": version: 1.3.6 resolution: "make-error@npm:1.3.6" @@ -3032,6 +3101,16 @@ __metadata: languageName: node linkType: hard +"prom-client@npm:^15.0.0": + version: 15.0.0 + resolution: "prom-client@npm:15.0.0" + dependencies: + "@opentelemetry/api": ^1.4.0 + tdigest: ^0.1.1 + checksum: a447cc4c7d87e610f9ed9c018dcbe759f06d32b6c3d401d90cafa6b15feee54e0ec5d0ee1d4925db905ea35c6e894be842de25e6bc0b5d415147a0b714c248f8 + languageName: node + linkType: hard + "promise-retry@npm:^2.0.1": version: 2.0.1 resolution: "promise-retry@npm:2.0.1" @@ -3561,6 +3640,15 @@ __metadata: languageName: node linkType: hard +"tdigest@npm:^0.1.1": + version: 0.1.2 + resolution: "tdigest@npm:0.1.2" + dependencies: + bintrees: "npm:1.0.2" + checksum: 44de8246752b6f8c2924685f969fd3d94c36949f22b0907e99bef2b2220726dd8467f4730ea96b06040b9aa2587c0866049640039d1b956952dfa962bc2075a3 + languageName: node + linkType: hard + "text-encoding-utf-8@npm:^1.0.2": version: 1.0.2 resolution: "text-encoding-utf-8@npm:1.0.2" diff --git a/packages/helium-admin-cli/yarn.deploy.lock b/packages/helium-admin-cli/yarn.deploy.lock index 3e7332397..00738b2d8 100644 --- a/packages/helium-admin-cli/yarn.deploy.lock +++ b/packages/helium-admin-cli/yarn.deploy.lock @@ -260,10 +260,12 @@ __metadata: cors: ^2.8.5 dotenv: ^16.0.3 fastify: ^4.13.0 + fastify-cron: ^1.3.1 git-format-staged: ^2.1.3 ky: ^0.31.4 nodemon: ^2.0.20 pg: ^8.9.0 + prom-client: ^15.0.0 sequelize: ^6.28.0 ts-loader: ^9.2.3 ts-node: ^10.9.1 @@ -655,6 +657,13 @@ __metadata: languageName: node linkType: hard +"@opentelemetry/api@npm:^1.4.0": + version: 1.7.0 + resolution: "@opentelemetry/api@npm:1.7.0" + checksum: 2398cbe65f199c3a7050125b3ad9c835f789bb0a616665e9c7f4475a29ac8334b6a3c15f38db48d345b522180c41c00b04cc174cd0eeffba98eb4874a565fa7e + languageName: node + linkType: hard + "@pkgjs/parseargs@npm:^0.11.0": version: 0.11.0 resolution: "@pkgjs/parseargs@npm:0.11.0" @@ -872,6 +881,15 @@ __metadata: languageName: node linkType: hard +"@types/cron@npm:^2.0.0": + version: 2.4.0 + resolution: "@types/cron@npm:2.4.0" + dependencies: + cron: "npm:*" + checksum: c763e99a757ea76aee435948c25e0bdaf32ec44c69603088c73e8832df6b121e87932709925fe3e94777833ca30845c31df1167be54c330cf458d348059b9ffc + languageName: node + linkType: hard + "@types/crypto-js@npm:^4.1.1": version: 4.1.1 resolution: "@types/crypto-js@npm:4.1.1" @@ -926,6 +944,13 @@ __metadata: languageName: node linkType: hard +"@types/luxon@npm:~3.3.0": + version: 3.3.2 + resolution: "@types/luxon@npm:3.3.2" + checksum: b9111132720eae0269538872a5a496b29587ecfc8edc3b0ff7d269aa93a5ff00a131b23d1e9d1f12ec39f2c779ad21bd8d9f90b122c85a182771aabde7f676b8 + languageName: node + linkType: hard + "@types/mime@npm:*": version: 3.0.1 resolution: "@types/mime@npm:3.0.1" @@ -1358,6 +1383,13 @@ __metadata: languageName: node linkType: hard +"bintrees@npm:1.0.2": + version: 1.0.2 + resolution: "bintrees@npm:1.0.2" + checksum: 56a52b7d3634e30002b1eda740d2517a22fa8e9e2eb088e919f37c030a0ed86e364ab59e472fc770fc8751308054bb1c892979d150e11d9e11ac33bcc1b5d16e + languageName: node + linkType: hard + "bn.js@npm:^5.0.0, bn.js@npm:^5.1.0, bn.js@npm:^5.1.2, bn.js@npm:^5.1.3, bn.js@npm:^5.2.0, bn.js@npm:^5.2.1": version: 5.2.1 resolution: "bn.js@npm:5.2.1" @@ -1672,6 +1704,16 @@ __metadata: languageName: node linkType: hard +"cron@npm:*, cron@npm:^2.0.0": + version: 2.4.3 + resolution: "cron@npm:2.4.3" + dependencies: + "@types/luxon": "npm:~3.3.0" + luxon: "npm:~3.3.0" + checksum: cb0ad49653b37ba125f8670ca92150ce515493512b1b8a5e08086d22bec9c54dc6d8926fcdb49ea5783f6699862ca5fdc532a440ce33c3228f9b3d565010db2f + languageName: node + linkType: hard + "cross-fetch@npm:^3.1.5": version: 3.1.8 resolution: "cross-fetch@npm:3.1.8" @@ -1970,6 +2012,26 @@ __metadata: languageName: node linkType: hard +"fastify-cron@npm:^1.3.1": + version: 1.3.1 + resolution: "fastify-cron@npm:1.3.1" + dependencies: + "@types/cron": "npm:^2.0.0" + cron: "npm:^2.0.0" + fastify-plugin: "npm:^3.0.0" + peerDependencies: + fastify: ^4.1.0 + checksum: 152cc6bfe9ebd347747d922533e49b9ee0528d1c22677858046615a7bbae07166af7fd4f126c00f0c6d380aca33da6fa91f572c24cb586107753b03ab16392f9 + languageName: node + linkType: hard + +"fastify-plugin@npm:^3.0.0": + version: 3.0.1 + resolution: "fastify-plugin@npm:3.0.1" + checksum: 131ba0a388f777829c3fb0fd5b75cf057688ce6d0ca354fb1ebf829767a8c853b0825762b9185b5200097454df0ede2f3095da2efe1aa1b3736d07f194e6d374 + languageName: node + linkType: hard + "fastify-plugin@npm:^4.0.0": version: 4.5.1 resolution: "fastify-plugin@npm:4.5.1" @@ -2670,6 +2732,13 @@ __metadata: languageName: node linkType: hard +"luxon@npm:~3.3.0": + version: 3.3.0 + resolution: "luxon@npm:3.3.0" + checksum: 50cf17a0dc155c3dcacbeae8c0b7e80db425e0ba97b9cbdf12a7fc142d841ff1ab1560919f033af46240ed44e2f70c49f76e3422524c7fc8bb8d81ca47c66187 + languageName: node + linkType: hard + "make-error@npm:^1.1.1": version: 1.3.6 resolution: "make-error@npm:1.3.6" @@ -3333,6 +3402,16 @@ __metadata: languageName: node linkType: hard +"prom-client@npm:^15.0.0": + version: 15.0.0 + resolution: "prom-client@npm:15.0.0" + dependencies: + "@opentelemetry/api": ^1.4.0 + tdigest: ^0.1.1 + checksum: a447cc4c7d87e610f9ed9c018dcbe759f06d32b6c3d401d90cafa6b15feee54e0ec5d0ee1d4925db905ea35c6e894be842de25e6bc0b5d415147a0b714c248f8 + languageName: node + linkType: hard + "promise-retry@npm:^2.0.1": version: 2.0.1 resolution: "promise-retry@npm:2.0.1" @@ -3891,6 +3970,15 @@ __metadata: languageName: node linkType: hard +"tdigest@npm:^0.1.1": + version: 0.1.2 + resolution: "tdigest@npm:0.1.2" + dependencies: + bintrees: "npm:1.0.2" + checksum: 44de8246752b6f8c2924685f969fd3d94c36949f22b0907e99bef2b2220726dd8467f4730ea96b06040b9aa2587c0866049640039d1b956952dfa962bc2075a3 + languageName: node + linkType: hard + "text-encoding-utf-8@npm:^1.0.2": version: 1.0.2 resolution: "text-encoding-utf-8@npm:1.0.2" diff --git a/packages/migration-service/yarn.deploy.lock b/packages/migration-service/yarn.deploy.lock index be1077390..95a146ae1 100644 --- a/packages/migration-service/yarn.deploy.lock +++ b/packages/migration-service/yarn.deploy.lock @@ -270,10 +270,12 @@ __metadata: cors: ^2.8.5 dotenv: ^16.0.3 fastify: ^4.13.0 + fastify-cron: ^1.3.1 git-format-staged: ^2.1.3 ky: ^0.31.4 nodemon: ^2.0.20 pg: ^8.9.0 + prom-client: ^15.0.0 sequelize: ^6.28.0 ts-loader: ^9.2.3 ts-node: ^10.9.1 @@ -645,6 +647,13 @@ __metadata: languageName: node linkType: hard +"@opentelemetry/api@npm:^1.4.0": + version: 1.7.0 + resolution: "@opentelemetry/api@npm:1.7.0" + checksum: 2398cbe65f199c3a7050125b3ad9c835f789bb0a616665e9c7f4475a29ac8334b6a3c15f38db48d345b522180c41c00b04cc174cd0eeffba98eb4874a565fa7e + languageName: node + linkType: hard + "@pkgjs/parseargs@npm:^0.11.0": version: 0.11.0 resolution: "@pkgjs/parseargs@npm:0.11.0" @@ -857,6 +866,15 @@ __metadata: languageName: node linkType: hard +"@types/cron@npm:^2.0.0": + version: 2.4.0 + resolution: "@types/cron@npm:2.4.0" + dependencies: + cron: "npm:*" + checksum: c763e99a757ea76aee435948c25e0bdaf32ec44c69603088c73e8832df6b121e87932709925fe3e94777833ca30845c31df1167be54c330cf458d348059b9ffc + languageName: node + linkType: hard + "@types/crypto-js@npm:^4.1.1": version: 4.1.1 resolution: "@types/crypto-js@npm:4.1.1" @@ -920,6 +938,13 @@ __metadata: languageName: node linkType: hard +"@types/luxon@npm:~3.3.0": + version: 3.3.2 + resolution: "@types/luxon@npm:3.3.2" + checksum: b9111132720eae0269538872a5a496b29587ecfc8edc3b0ff7d269aa93a5ff00a131b23d1e9d1f12ec39f2c779ad21bd8d9f90b122c85a182771aabde7f676b8 + languageName: node + linkType: hard + "@types/mime@npm:*": version: 3.0.1 resolution: "@types/mime@npm:3.0.1" @@ -1373,6 +1398,13 @@ __metadata: languageName: node linkType: hard +"bintrees@npm:1.0.2": + version: 1.0.2 + resolution: "bintrees@npm:1.0.2" + checksum: 56a52b7d3634e30002b1eda740d2517a22fa8e9e2eb088e919f37c030a0ed86e364ab59e472fc770fc8751308054bb1c892979d150e11d9e11ac33bcc1b5d16e + languageName: node + linkType: hard + "bn.js@npm:^5.1.0, bn.js@npm:^5.1.2, bn.js@npm:^5.2.0, bn.js@npm:^5.2.1": version: 5.2.1 resolution: "bn.js@npm:5.2.1" @@ -1691,6 +1723,16 @@ __metadata: languageName: node linkType: hard +"cron@npm:*, cron@npm:^2.0.0": + version: 2.4.3 + resolution: "cron@npm:2.4.3" + dependencies: + "@types/luxon": "npm:~3.3.0" + luxon: "npm:~3.3.0" + checksum: cb0ad49653b37ba125f8670ca92150ce515493512b1b8a5e08086d22bec9c54dc6d8926fcdb49ea5783f6699862ca5fdc532a440ce33c3228f9b3d565010db2f + languageName: node + linkType: hard + "cross-fetch@npm:^3.1.5": version: 3.1.8 resolution: "cross-fetch@npm:3.1.8" @@ -1998,6 +2040,26 @@ __metadata: languageName: node linkType: hard +"fastify-cron@npm:^1.3.1": + version: 1.3.1 + resolution: "fastify-cron@npm:1.3.1" + dependencies: + "@types/cron": "npm:^2.0.0" + cron: "npm:^2.0.0" + fastify-plugin: "npm:^3.0.0" + peerDependencies: + fastify: ^4.1.0 + checksum: 152cc6bfe9ebd347747d922533e49b9ee0528d1c22677858046615a7bbae07166af7fd4f126c00f0c6d380aca33da6fa91f572c24cb586107753b03ab16392f9 + languageName: node + linkType: hard + +"fastify-plugin@npm:^3.0.0": + version: 3.0.1 + resolution: "fastify-plugin@npm:3.0.1" + checksum: 131ba0a388f777829c3fb0fd5b75cf057688ce6d0ca354fb1ebf829767a8c853b0825762b9185b5200097454df0ede2f3095da2efe1aa1b3736d07f194e6d374 + languageName: node + linkType: hard + "fastify-plugin@npm:^4.0.0": version: 4.5.1 resolution: "fastify-plugin@npm:4.5.1" @@ -2707,6 +2769,13 @@ __metadata: languageName: node linkType: hard +"luxon@npm:~3.3.0": + version: 3.3.0 + resolution: "luxon@npm:3.3.0" + checksum: 50cf17a0dc155c3dcacbeae8c0b7e80db425e0ba97b9cbdf12a7fc142d841ff1ab1560919f033af46240ed44e2f70c49f76e3422524c7fc8bb8d81ca47c66187 + languageName: node + linkType: hard + "make-error@npm:^1.1.1": version: 1.3.6 resolution: "make-error@npm:1.3.6" @@ -3391,6 +3460,16 @@ __metadata: languageName: node linkType: hard +"prom-client@npm:^15.0.0": + version: 15.0.0 + resolution: "prom-client@npm:15.0.0" + dependencies: + "@opentelemetry/api": ^1.4.0 + tdigest: ^0.1.1 + checksum: a447cc4c7d87e610f9ed9c018dcbe759f06d32b6c3d401d90cafa6b15feee54e0ec5d0ee1d4925db905ea35c6e894be842de25e6bc0b5d415147a0b714c248f8 + languageName: node + linkType: hard + "promise-retry@npm:^2.0.1": version: 2.0.1 resolution: "promise-retry@npm:2.0.1" @@ -4024,6 +4103,15 @@ __metadata: languageName: node linkType: hard +"tdigest@npm:^0.1.1": + version: 0.1.2 + resolution: "tdigest@npm:0.1.2" + dependencies: + bintrees: "npm:1.0.2" + checksum: 44de8246752b6f8c2924685f969fd3d94c36949f22b0907e99bef2b2220726dd8467f4730ea96b06040b9aa2587c0866049640039d1b956952dfa962bc2075a3 + languageName: node + linkType: hard + "text-encoding-utf-8@npm:^1.0.2": version: 1.0.2 resolution: "text-encoding-utf-8@npm:1.0.2" diff --git a/packages/monitor-service/.gitignore b/packages/monitor-service/.gitignore index 445f244bc..72ecddef0 100644 --- a/packages/monitor-service/.gitignore +++ b/packages/monitor-service/.gitignore @@ -1,4 +1,5 @@ npm-debug.log dist/ tmp/ -./node_modules \ No newline at end of file +./node_modules +.env diff --git a/packages/monitor-service/package.json b/packages/monitor-service/package.json index c2a7193cf..68d394d03 100644 --- a/packages/monitor-service/package.json +++ b/packages/monitor-service/package.json @@ -39,19 +39,26 @@ "@helium/helium-entity-manager-sdk": "^0.6.5", "@helium/helium-sub-daos-sdk": "^0.6.5", "@helium/idls": "^0.6.5", + "@helium/lazy-distributor-sdk": "^0.6.5", "@helium/lazy-transactions-sdk": "^0.6.5", "@helium/spl-utils": "^0.6.5", + "@metaplex-foundation/mpl-bubblegum": "^3.0.0", "@metaplex-foundation/mpl-token-metadata": "^2.10.0", "@solana/spl-account-compression": "^0.1.7", "@solana/spl-token": "^0.3.8", "@solana/web3.js": "^1.78.4", + "@types/pg": "^8.10.9", + "aws-sdk": "^2.1516.0", "axios": "^1.3.6", "bn.js": "^5.2.0", "bs58": "^4.0.1", "cli-progress": "^3.12.0", + "dotenv": "^16.3.1", "fastify": "^4.13.0", "inflection": "^2.0.1", + "pg": "^8.11.3", "prom-client": "^14.2.0", + "sequelize": "^6.35.2", "ts-node": "^10.9.1", "ts-node-dev": "^2.0.0" }, diff --git a/packages/monitor-service/src/env.ts b/packages/monitor-service/src/env.ts index 36d2ecd4b..9684ffc3b 100644 --- a/packages/monitor-service/src/env.ts +++ b/packages/monitor-service/src/env.ts @@ -2,6 +2,9 @@ import { PublicKey } from "@solana/web3.js"; import os from "os"; +import dotenv from "dotenv"; + +dotenv.config(); process.env.ANCHOR_WALLET = process.env.ANCHOR_WALLET || os.homedir() + "/.config/solana/id.json"; diff --git a/packages/monitor-service/src/index.ts b/packages/monitor-service/src/index.ts index 2600c8ebb..8be1b0e69 100644 --- a/packages/monitor-service/src/index.ts +++ b/packages/monitor-service/src/index.ts @@ -14,7 +14,7 @@ import { HeliumEntityManager } from '@helium/idls/lib/types/helium_entity_manage import * as anchor from '@coral-xyz/anchor'; import fastify from 'fastify'; import { HNT_MINT, MOBILE_MINT, IOT_MINT } from './env'; -import { register } from './metrics'; +import { register, totalRewardsGauge } from './metrics'; import { monitiorAssociatedTokenBalance, monitorSolBalance, @@ -29,6 +29,11 @@ import { provider } from './solana'; import { PublicKey } from '@solana/web3.js'; import { lazySignerKey } from '@helium/lazy-transactions-sdk'; import { underscore } from 'inflection'; +import { Recipient, sequelize } from './model'; +import { lazyDistributorKey } from '@helium/lazy-distributor-sdk'; +import { BN } from 'bn.js'; +import { toNumber } from '@helium/spl-utils'; +import { monitorVehnt } from './monitors/vehnt'; let hemProgram: anchor.Program; let hsdProgram: anchor.Program; @@ -39,6 +44,32 @@ server.get('/metrics', async (request, reply) => { return register.metrics(); }); +function debounce(func: any, wait: number = 10000) { + let timeout: any; + return function executedFunction(...args: any[]) { + const later = () => { + clearTimeout(timeout); + func(...args); + }; + clearTimeout(timeout); + timeout = setTimeout(later, wait); + }; +} + +async function setTotalRewards(mint: PublicKey) { + const lazyDistributor = lazyDistributorKey(mint)[0].toBase58(); + const sum = (await Recipient.findAll({ + where: { + lazyDistributor, + }, + attributes: [ + [sequelize.fn("SUM", sequelize.col("total_rewards")), "totalRewards"], + ], + }))[0].totalRewards; + const sumActual = toNumber(new BN(sum), 6) + totalRewardsGauge.labels(mint.toBase58()).set(sumActual) +} + async function run() { hemProgram = await hemInit(provider); hsdProgram = await hsdInit(provider); @@ -60,6 +91,9 @@ async function run() { const mobileMint = mobile.dntMint; const mobileTreasury = mobile.treasury; const mobileRewardsEscrow = mobile.rewardsEscrow; + + await Recipient.sync() + await monitorVehnt() await monitorSupply(hntMint, 'hnt'); await monitorSupply(dcMint, 'dc'); @@ -72,8 +106,16 @@ async function run() { await monitorTokenBalance(iotTreasury, 'iot_treasury'); await monitorTokenBalance(mobileTreasury, 'mobile_treasury'); - await monitorTokenBalance(iotRewardsEscrow, 'iot_rewards_escrow'); - await monitorTokenBalance(mobileRewardsEscrow, 'mobile_rewards_escrow'); + await setTotalRewards(IOT_MINT) + await setTotalRewards(MOBILE_MINT) + const resetMobileTotal = debounce(() => setTotalRewards(MOBILE_MINT)); + const resetIotTotal = debounce(() => setTotalRewards(IOT_MINT)); + await monitorTokenBalance(iotRewardsEscrow, 'iot_rewards_escrow', false, async () => { + resetIotTotal(); + }); + await monitorTokenBalance(mobileRewardsEscrow, 'mobile_rewards_escrow', false, async () => { + resetMobileTotal(); + }); await monitorTokenBalance( getAssociatedTokenAddressSync(dao.dcMint, iot.activeDeviceAuthority), "iot_active_device_oracle_dc" diff --git a/packages/monitor-service/src/metrics.ts b/packages/monitor-service/src/metrics.ts index 4fdd11819..0f2400413 100644 --- a/packages/monitor-service/src/metrics.ts +++ b/packages/monitor-service/src/metrics.ts @@ -35,3 +35,46 @@ export const circuitBreakerLevel = new client.Gauge({ labelNames: ["name"], }); register.registerMetric(circuitBreakerLevel); + +export const totalRewardsGauge = new client.Gauge({ + name: 'recipient_total_rewards', + help: 'The total rewards claimed in all recipients', + labelNames: ['dnt_mint'] +}) +register.registerMetric(totalRewardsGauge); + +export const realVeTokensGauge = new client.Gauge({ + name: "real_delegated_ve_tokens", + help: "The total ve tokens for this mint in sql", + labelNames: ["dnt_mint"], +}); +register.registerMetric(realVeTokensGauge); + +export const approxVeTokensGauge = new client.Gauge({ + name: "approx_delegated_ve_tokens", + help: "The total ve tokens for this mint on-chain", + labelNames: ["dnt_mint"], +}); +register.registerMetric(approxVeTokensGauge); + +export const realFallRateGauge = new client.Gauge({ + name: "real_delegated_fall_rate", + help: "The total ve tokens fall rate for this mint in sql", + labelNames: ["dnt_mint"], +}); +register.registerMetric(realFallRateGauge); + +export const approxFallRateGauge = new client.Gauge({ + name: "approx_delegated_fall_rate", + help: "The total ve tokens fall rate for this mint on-chain", + labelNames: ["dnt_mint"], +}); +register.registerMetric(approxFallRateGauge); + +export const delegationsGauge = new client.Gauge({ + name: "delegations", + help: "The total number of delegations", + labelNames: ["dnt_mint"], +}); +register.registerMetric(delegationsGauge); + diff --git a/packages/monitor-service/src/model.ts b/packages/monitor-service/src/model.ts new file mode 100644 index 000000000..bb521b1b6 --- /dev/null +++ b/packages/monitor-service/src/model.ts @@ -0,0 +1,75 @@ +import AWS from "aws-sdk"; +import * as pg from "pg"; +import { DataTypes, Model, STRING, Sequelize } from "sequelize"; + +const host = process.env.PGHOST || "localhost"; +const port = Number(process.env.PGPORT) || 5432; +export const sequelize = new Sequelize({ + host: host, + dialect: "postgres", + port: port, + logging: false, + dialectModule: pg, + username: process.env.PGUSER, + database: process.env.PGDATABASE, + pool: { + max: 5, + min: 0, + acquire: 30000, + idle: 10000, + }, + hooks: { + beforeConnect: async (config: any) => { + const isRds = host.includes("rds.amazonaws.com"); + + let password = process.env.PGPASSWORD; + if (isRds && !password) { + const signer = new AWS.RDS.Signer({ + region: process.env.AWS_REGION, + hostname: process.env.PGHOST, + port, + username: process.env.PGUSER, + }); + password = await new Promise((resolve, reject) => + signer.getAuthToken({}, (err, token) => { + if (err) { + return reject(err); + } + resolve(token); + }) + ); + config.dialectOptions = { + ssl: { + require: false, + rejectUnauthorized: false, + }, + }; + } + config.password = password; + }, + }, +}); + +export class Recipient extends Model { + declare address: string; + declare lazyDistributor: string; + declare totalRewards: string; +} + +Recipient.init( + { + address: { + type: STRING, + primaryKey: true, + }, + lazyDistributor: STRING, + totalRewards: DataTypes.DECIMAL.UNSIGNED, + }, + { + sequelize, + modelName: "recipient", + tableName: "recipients", + underscored: true, + timestamps: false, + } +); \ No newline at end of file diff --git a/packages/monitor-service/src/monitors/balance.ts b/packages/monitor-service/src/monitors/balance.ts index bc6022949..68045446c 100644 --- a/packages/monitor-service/src/monitors/balance.ts +++ b/packages/monitor-service/src/monitors/balance.ts @@ -1,6 +1,7 @@ import { toNumber } from "@helium/spl-utils"; import { AccountLayout, + RawAccount, getAccount, getAssociatedTokenAddress, getMint, @@ -14,7 +15,8 @@ import { watch } from "./watch"; export async function monitorTokenBalance( account: PublicKey, label: string, - isMaker = false + isMaker = false, + extraFn: (acc: RawAccount) => void = () => {} ) { const acc = await getAccount(provider.connection, account); const mint = await getMint(provider.connection, acc.mint); @@ -29,6 +31,7 @@ export async function monitorTokenBalance( }, toNumber(new BN(rawAccount.amount.toString()), mint.decimals) ); + extraFn(rawAccount); }); } diff --git a/packages/monitor-service/src/monitors/vehnt.ts b/packages/monitor-service/src/monitors/vehnt.ts new file mode 100644 index 000000000..4a9a82907 --- /dev/null +++ b/packages/monitor-service/src/monitors/vehnt.ts @@ -0,0 +1,159 @@ +import BN from "bn.js"; +import { + approxFallRateGauge, + approxVeTokensGauge, + realFallRateGauge, + realVeTokensGauge, + delegationsGauge, +} from "../metrics"; +import { sequelize } from "../model"; +import { toNumber } from "@helium/spl-utils"; + +export async function monitorVehnt() { + await monitorVehntOnce() + // Check once a minute + setInterval(monitorVehntOnce, 60 * 1000) +} + +async function monitorVehntOnce() { + const result = await sequelize.query(` + +WITH + readable_positions AS ( + SELECT p.*, + r.realm_governing_token_mint, + cast(r.voting_mints[p.voting_mint_config_idx + 1]->>'lockupSaturationSecs' as numeric) as lockup_saturation_seconds, + cast(r.voting_mints[p.voting_mint_config_idx + 1]->>'maxExtraLockupVoteWeightScaledFactor' as numeric) / 1000000000 as max_extra_lockup_vote_weight_scaled_factor, + CASE WHEN p.genesis_end > current_ts THEN cast(r.voting_mints[p.voting_mint_config_idx + 1]->>'genesisVotePowerMultiplier' as numeric) ELSE 1 END as genesis_multiplier, + GREATEST( + cast( + p.end_ts - + CASE WHEN lockup_kind = 'constant' THEN start_ts ELSE current_ts END + as numeric + ), + 0 + ) + as seconds_remaining + FROM ( + SELECT *, + lockup->>'kind' as lockup_kind, + cast(lockup->>'endTs' as numeric) as end_ts, + cast(lockup->>'startTs' as numeric) as start_ts, + -- 1683727980 as current_ts + FLOOR(EXTRACT(EPOCH FROM CURRENT_TIMESTAMP)) as current_ts + FROM positions + ) p + JOIN registrars r on p.registrar = r.address + ), + positions_with_vehnt AS ( + SELECT realm_governing_token_mint as mint, + address, + genesis_end, + num_active_votes, + lockup_kind, + registrar, + refreshed_at, + created_at, + amount_deposited_native, + ve_tokens, + initial_ve_tokens, + CASE WHEN lockup_kind = 'constant' THEN + 0 + ELSE + CASE WHEN current_ts < genesis_end THEN + -- genesis + (ve_tokens - ( + amount_deposited_native * ( + LEAST( + (end_ts - genesis_end) / lockup_saturation_seconds, + 1 + ) * ( + max_extra_lockup_vote_weight_scaled_factor + ) * genesis_multiplier + ) + ) + ) / (genesis_end - current_ts) + ELSE + -- normal + ve_tokens / (end_ts - current_ts) + END + END as fall_rate, + start_ts, + end_ts, + current_ts, + seconds_remaining + FROM ( + SELECT *, + amount_deposited_native * ( + ( + max_extra_lockup_vote_weight_scaled_factor + ) * genesis_multiplier * LEAST( + seconds_remaining / lockup_saturation_seconds, + 1 + ) + ) as ve_tokens, + amount_deposited_native * ( + ( + max_extra_lockup_vote_weight_scaled_factor + ) * genesis_multiplier * LEAST( + (end_ts - start_ts) / lockup_saturation_seconds, + 1 + ) + ) as initial_ve_tokens + FROM readable_positions + ) a + ), + subdao_delegations AS ( + SELECT + count(*) as delegations, + min(current_ts) as current_ts, + sum(p.fall_rate) as real_fall_rate, + s.vehnt_fall_rate / 1000000000000 as approx_fall_rate, + s.dnt_mint as mint, + SUM(ve_tokens) as real_ve_tokens, + ( + s.vehnt_delegated - ( + (min(current_ts) - s.vehnt_last_calculated_ts) + * s.vehnt_fall_rate + ) + ) / 1000000000000 as approx_ve_tokens, + s.vehnt_delegated as vehnt_delegated_snapshot, + s.vehnt_last_calculated_ts as vehnt_last_calculated_ts + FROM positions_with_vehnt p + JOIN delegated_positions d on d.position = p.address + JOIN sub_daos s on s.address = d.sub_dao + -- Remove positions getting purged this epoch + WHERE (lockup_kind = 'constant' or end_ts > (floor(current_ts / (60 * 60 * 24)) * (60 * 60 * 24)) + 60 * 60 * 24) + GROUP BY s.dnt_mint, s.vehnt_fall_rate, s.vehnt_delegated, s.vehnt_last_calculated_ts, s.vehnt_last_calculated_ts + ) +SELECT + mint, + delegations, + real_ve_tokens as real_ve_tokens, + approx_ve_tokens as approx_ve_tokens, + real_fall_rate as real_fall_rate, + approx_fall_rate as approx_fall_rate +FROM subdao_delegations; + `); + result[0].forEach((result) => { + const { + real_ve_tokens, + approx_ve_tokens, + real_fall_rate, + approx_fall_rate, + mint, + delegations, + } = result as any; + realVeTokensGauge.labels(mint).set(toNumber(new BN(real_ve_tokens.split(".")[0]), 8)); + approxVeTokensGauge + .labels(mint) + .set(toNumber(new BN(approx_ve_tokens.split(".")[0]), 8)); + realFallRateGauge + .labels(mint) + .set(toNumber(new BN(real_fall_rate.split(".")[0]), 8)); + approxFallRateGauge + .labels(mint) + .set(toNumber(new BN(approx_fall_rate.split(".")[0]), 8)); + delegationsGauge.labels(mint).set(Number(delegations)); + }); +} \ No newline at end of file diff --git a/packages/monitor-service/tsconfig.json b/packages/monitor-service/tsconfig.json index f09759c3f..cca417519 100644 --- a/packages/monitor-service/tsconfig.json +++ b/packages/monitor-service/tsconfig.json @@ -7,6 +7,12 @@ { "path": "../circuit-breaker-sdk" }, + { + "path": "../lazy-transactions-sdk" + }, + { + "path": "../lazy-distributor-sdk" + }, { "path": "../helium-sub-daos-sdk" }, diff --git a/packages/monitor-service/yarn.deploy.lock b/packages/monitor-service/yarn.deploy.lock index 0eafb6238..00790f469 100644 --- a/packages/monitor-service/yarn.deploy.lock +++ b/packages/monitor-service/yarn.deploy.lock @@ -58,6 +58,26 @@ __metadata: languageName: node linkType: hard +"@ethereumjs/rlp@npm:^4.0.1": + version: 4.0.1 + resolution: "@ethereumjs/rlp@npm:4.0.1" + bin: + rlp: bin/rlp + checksum: 30db19c78faa2b6ff27275ab767646929207bb207f903f09eb3e4c273ce2738b45f3c82169ddacd67468b4f063d8d96035f2bf36f02b6b7e4d928eefe2e3ecbc + languageName: node + linkType: hard + +"@ethereumjs/util@npm:^8.1.0": + version: 8.1.0 + resolution: "@ethereumjs/util@npm:8.1.0" + dependencies: + "@ethereumjs/rlp": "npm:^4.0.1" + ethereum-cryptography: "npm:^2.0.0" + micro-ftch: "npm:^0.3.1" + checksum: 9ae5dee8f12b0faf81cd83f06a41560e79b0ba96a48262771d897a510ecae605eb6d84f687da001ab8ccffd50f612ae50f988ef76e6312c752897f462f3ac08d + languageName: node + linkType: hard + "@fastify/ajv-compiler@npm:^3.5.0": version: 3.5.0 resolution: "@fastify/ajv-compiler@npm:3.5.0" @@ -244,6 +264,22 @@ __metadata: languageName: node linkType: hard +"@helium/lazy-distributor-sdk@^0.6.5": + version: 0.0.0-use.local + resolution: "@helium/lazy-distributor-sdk@workspace:packages/lazy-distributor-sdk" + dependencies: + "@coral-xyz/anchor": ^0.28.0 + "@helium/anchor-resolvers": ^0.6.5 + "@helium/circuit-breaker-sdk": ^0.6.5 + bn.js: ^5.2.0 + bs58: ^4.0.1 + git-format-staged: ^2.1.3 + ts-loader: ^9.2.3 + ts-node: ^10.9.1 + typescript: ^5.2.2 + languageName: unknown + linkType: soft + "@helium/lazy-transactions-sdk@^0.6.5": version: 0.0.0-use.local resolution: "@helium/lazy-transactions-sdk@workspace:packages/lazy-transactions-sdk" @@ -273,21 +309,28 @@ __metadata: "@helium/helium-entity-manager-sdk": ^0.6.5 "@helium/helium-sub-daos-sdk": ^0.6.5 "@helium/idls": ^0.6.5 + "@helium/lazy-distributor-sdk": ^0.6.5 "@helium/lazy-transactions-sdk": ^0.6.5 "@helium/spl-utils": ^0.6.5 + "@metaplex-foundation/mpl-bubblegum": ^3.0.0 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-account-compression": ^0.1.7 "@solana/spl-token": ^0.3.8 "@solana/web3.js": ^1.78.4 "@types/bn.js": ^5.1.1 + "@types/pg": ^8.10.9 + aws-sdk: ^2.1516.0 axios: ^1.3.6 bn.js: ^5.2.0 bs58: ^4.0.1 cli-progress: ^3.12.0 + dotenv: ^16.3.1 fastify: ^4.13.0 git-format-staged: ^2.1.3 inflection: ^2.0.1 + pg: ^8.11.3 prom-client: ^14.2.0 + sequelize: ^6.35.2 ts-loader: ^9.2.3 ts-node: ^10.9.1 ts-node-dev: ^2.0.0 @@ -436,6 +479,41 @@ __metadata: languageName: node linkType: hard +"@metaplex-foundation/digital-asset-standard-api@npm:^1.0.0-alpha.0": + version: 1.0.0 + resolution: "@metaplex-foundation/digital-asset-standard-api@npm:1.0.0" + peerDependencies: + "@metaplex-foundation/umi": ^0.8.2 + checksum: f881c38145aad093efffea011b06b1fc68495dfe8bf10299811a6d3a15bac74e24af396a248f3307ff93d644cc1a64d4ee05bc933a30cc402b37dccbbacde43f + languageName: node + linkType: hard + +"@metaplex-foundation/mpl-bubblegum@npm:^3.0.0": + version: 3.0.0 + resolution: "@metaplex-foundation/mpl-bubblegum@npm:3.0.0" + dependencies: + "@metaplex-foundation/digital-asset-standard-api": ^1.0.0-alpha.0 + "@metaplex-foundation/mpl-token-metadata": 3.0.0-alpha.27 + "@metaplex-foundation/mpl-toolbox": ^0.9.0 + "@noble/hashes": ^1.3.1 + merkletreejs: ^0.3.9 + peerDependencies: + "@metaplex-foundation/umi": ^0.8.9 + checksum: 61ed8366608b11939bf6f4c701d1c3de0025ba71328700ad5187bea558c9ca5ba818b58a76728f9b473ea93552b2480f14ac7b7d68b934e36c56d88ce888f659 + languageName: node + linkType: hard + +"@metaplex-foundation/mpl-token-metadata@npm:3.0.0-alpha.27": + version: 3.0.0-alpha.27 + resolution: "@metaplex-foundation/mpl-token-metadata@npm:3.0.0-alpha.27" + dependencies: + "@metaplex-foundation/mpl-toolbox": ^0.9.0 + peerDependencies: + "@metaplex-foundation/umi": ^0.8.2 + checksum: ec79071615b418a4efcfac50616dc6a873f6a827589a5c83990e68e8aa3617813893f8574268cdd53d0cb0330997a979913494ee2e1a722b7716f5536dd579a4 + languageName: node + linkType: hard + "@metaplex-foundation/mpl-token-metadata@npm:^2.10.0": version: 2.13.0 resolution: "@metaplex-foundation/mpl-token-metadata@npm:2.13.0" @@ -451,6 +529,24 @@ __metadata: languageName: node linkType: hard +"@metaplex-foundation/mpl-toolbox@npm:^0.9.0": + version: 0.9.1 + resolution: "@metaplex-foundation/mpl-toolbox@npm:0.9.1" + peerDependencies: + "@metaplex-foundation/umi": ^0.8.2 + checksum: d2bb9bed47fdba70f9a16b18113f3e4dbe7d7a52a36926bd55511c9c3f4c10d5847620dfd48c20c64e7904f187073e381e78d03bf1001ae13c1204693236129d + languageName: node + linkType: hard + +"@noble/curves@npm:1.1.0, @noble/curves@npm:~1.1.0": + version: 1.1.0 + resolution: "@noble/curves@npm:1.1.0" + dependencies: + "@noble/hashes": "npm:1.3.1" + checksum: 2658cdd3f84f71079b4e3516c47559d22cf4b55c23ac8ee9d2b1f8e5b72916d9689e59820e0f9d9cb4a46a8423af5b56dc6bb7782405c88be06a015180508db5 + languageName: node + linkType: hard + "@noble/curves@npm:^1.0.0": version: 1.2.0 resolution: "@noble/curves@npm:1.2.0" @@ -460,7 +556,14 @@ __metadata: languageName: node linkType: hard -"@noble/hashes@npm:1.3.2, @noble/hashes@npm:^1.3.1": +"@noble/hashes@npm:1.3.1": + version: 1.3.1 + resolution: "@noble/hashes@npm:1.3.1" + checksum: 7fdefc0f7a0c1ec27acc6ff88841793e3f93ec4ce6b8a6a12bfc0dd70ae6b7c4c82fe305fdfeda1735d5ad4a9eebe761e6693b3d355689c559e91242f4bc95b1 + languageName: node + linkType: hard + +"@noble/hashes@npm:1.3.2, @noble/hashes@npm:^1.3.1, @noble/hashes@npm:~1.3.0, @noble/hashes@npm:~1.3.1": version: 1.3.2 resolution: "@noble/hashes@npm:1.3.2" checksum: fe23536b436539d13f90e4b9be843cc63b1b17666a07634a2b1259dded6f490be3d050249e6af98076ea8f2ea0d56f578773c2197f2aa0eeaa5fba5bc18ba474 @@ -483,6 +586,34 @@ __metadata: languageName: node linkType: hard +"@scure/base@npm:~1.1.0": + version: 1.1.2 + resolution: "@scure/base@npm:1.1.2" + checksum: f666b09dbd62ecb5fe6d0e7a629c8a86a972a47dc4f4555ebbbd7b09782b10a5f894fed9c3b8c74fd683b1588c064df079a44e9f695c075ccd98c30a8d3e91f7 + languageName: node + linkType: hard + +"@scure/bip32@npm:1.3.1": + version: 1.3.1 + resolution: "@scure/bip32@npm:1.3.1" + dependencies: + "@noble/curves": "npm:~1.1.0" + "@noble/hashes": "npm:~1.3.1" + "@scure/base": "npm:~1.1.0" + checksum: 394d65f77a40651eba21a5096da0f4233c3b50d422864751d373fcf142eeedb94a1149f9ab1dbb078086dab2d0bc27e2b1afec8321bf22d4403c7df2fea5bfe2 + languageName: node + linkType: hard + +"@scure/bip39@npm:1.2.1": + version: 1.2.1 + resolution: "@scure/bip39@npm:1.2.1" + dependencies: + "@noble/hashes": "npm:~1.3.0" + "@scure/base": "npm:~1.1.0" + checksum: c5bd6f1328fdbeae2dcdd891825b1610225310e5e62a4942714db51066866e4f7bef242c7b06a1b9dcc8043a4a13412cf5c5df76d3b10aa9e36b82e9b6e3eeaa + languageName: node + linkType: hard + "@solana/buffer-layout-utils@npm:^0.2.0": version: 0.2.0 resolution: "@solana/buffer-layout-utils@npm:0.2.0" @@ -616,6 +747,22 @@ __metadata: languageName: node linkType: hard +"@types/debug@npm:^4.1.8": + version: 4.1.8 + resolution: "@types/debug@npm:4.1.8" + dependencies: + "@types/ms": "npm:*" + checksum: a9a9bb40a199e9724aa944e139a7659173a9b274798ea7efbc277cb084bc37d32fc4c00877c3496fac4fed70a23243d284adb75c00b5fdabb38a22154d18e5df + languageName: node + linkType: hard + +"@types/ms@npm:*": + version: 0.7.31 + resolution: "@types/ms@npm:0.7.31" + checksum: daadd354aedde024cce6f5aa873fefe7b71b22cd0e28632a69e8b677aeb48ae8caa1c60e5919bb781df040d116b01cb4316335167a3fc0ef6a63fa3614c0f6da + languageName: node + linkType: hard + "@types/node@npm:*": version: 20.5.7 resolution: "@types/node@npm:20.5.7" @@ -630,6 +777,17 @@ __metadata: languageName: node linkType: hard +"@types/pg@npm:^8.10.9": + version: 8.10.9 + resolution: "@types/pg@npm:8.10.9" + dependencies: + "@types/node": "*" + pg-protocol: "*" + pg-types: ^4.0.1 + checksum: c0c750af1f0945fe31c2793931da33bf596476ec8b52babfdb20f61006570c1c6c7f62f2dedd0cb9aefd2cddab238f2ed279337d3b2aa734ddd1ee8958e2355e + languageName: node + linkType: hard + "@types/strip-bom@npm:^3.0.0": version: 3.0.0 resolution: "@types/strip-bom@npm:3.0.0" @@ -644,6 +802,13 @@ __metadata: languageName: node linkType: hard +"@types/validator@npm:^13.7.17": + version: 13.11.1 + resolution: "@types/validator@npm:13.11.1" + checksum: 49e8b611e0b9a0cd645534fd5eeacc64c14ac2f11d7e91d3d8b891f7cf730bccb8a4b7466ac67f4c11e16531bc211a547b97314ca977dd5e58468a77bd0da735 + languageName: node + linkType: hard + "@types/ws@npm:^7.4.4": version: 7.4.7 resolution: "@types/ws@npm:7.4.7" @@ -850,6 +1015,13 @@ __metadata: languageName: node linkType: hard +"available-typed-arrays@npm:^1.0.5": + version: 1.0.5 + resolution: "available-typed-arrays@npm:1.0.5" + checksum: 20eb47b3cefd7db027b9bbb993c658abd36d4edd3fe1060e83699a03ee275b0c9b216cc076ff3f2db29073225fb70e7613987af14269ac1fe2a19803ccc97f1a + languageName: node + linkType: hard + "avvio@npm:^8.2.1": version: 8.2.1 resolution: "avvio@npm:8.2.1" @@ -861,6 +1033,24 @@ __metadata: languageName: node linkType: hard +"aws-sdk@npm:^2.1516.0": + version: 2.1516.0 + resolution: "aws-sdk@npm:2.1516.0" + dependencies: + buffer: 4.9.2 + events: 1.1.1 + ieee754: 1.1.13 + jmespath: 0.16.0 + querystring: 0.2.0 + sax: 1.2.1 + url: 0.10.3 + util: ^0.12.4 + uuid: 8.0.0 + xml2js: 0.5.0 + checksum: 394b20e19c13fc579cf9b75cc1b640d7668196f292fc548863050ca9912ad241b3ef4c39d29c58a65add36b330233677c14e2d8261e78b4afcefca5108180f49 + languageName: node + linkType: hard + "axios@npm:^1.3.6, axios@npm:^1.5.0": version: 1.5.0 resolution: "axios@npm:1.5.0" @@ -895,7 +1085,7 @@ __metadata: languageName: node linkType: hard -"base64-js@npm:^1.3.1, base64-js@npm:^1.5.1": +"base64-js@npm:^1.0.2, base64-js@npm:^1.3.1, base64-js@npm:^1.5.1": version: 1.5.1 resolution: "base64-js@npm:1.5.1" checksum: 669632eb3745404c2f822a18fc3a0122d2f9a7a13f7fb8b5823ee19d1d2ff9ee5b52c53367176ea4ad093c332fd5ab4bd0ebae5a8e27917a4105a4cfc86b1005 @@ -942,6 +1132,13 @@ __metadata: languageName: node linkType: hard +"bn.js@npm:4.11.6": + version: 4.11.6 + resolution: "bn.js@npm:4.11.6" + checksum: db23047bf06fdf9cf74401c8e76bca9f55313c81df382247d2c753868b368562e69171716b81b7038ada8860af18346fd4bcd1cf9d4963f923fe8e54e61cb58a + languageName: node + linkType: hard + "bn.js@npm:^5.1.2, bn.js@npm:^5.2.0, bn.js@npm:^5.2.1": version: 5.2.1 resolution: "bn.js@npm:5.2.1" @@ -1020,6 +1217,31 @@ __metadata: languageName: node linkType: hard +"buffer-reverse@npm:^1.0.1": + version: 1.0.1 + resolution: "buffer-reverse@npm:1.0.1" + checksum: e350872a89b17af0a7e1bd7a73239a535164f3f010b0800add44f2e52bd0511548dc5b96c20309effba969868c385023d2d02a0add6155f6a76da7b3073b77bd + languageName: node + linkType: hard + +"buffer-writer@npm:2.0.0": + version: 2.0.0 + resolution: "buffer-writer@npm:2.0.0" + checksum: 11736b48bb75106c52ca8ec9f025e7c1b3b25ce31875f469d7210eabd5c576c329e34f6b805d4a8d605ff3f0db1e16342328802c4c963e9c826b0e43a4e631c2 + languageName: node + linkType: hard + +"buffer@npm:4.9.2": + version: 4.9.2 + resolution: "buffer@npm:4.9.2" + dependencies: + base64-js: "npm:^1.0.2" + ieee754: "npm:^1.1.4" + isarray: "npm:^1.0.0" + checksum: 8801bc1ba08539f3be70eee307a8b9db3d40f6afbfd3cf623ab7ef41dffff1d0a31de0addbe1e66e0ca5f7193eeb667bfb1ecad3647f8f1b0750de07c13295c3 + languageName: node + linkType: hard + "buffer@npm:6.0.3, buffer@npm:^6.0.3, buffer@npm:~6.0.3": version: 6.0.3 resolution: "buffer@npm:6.0.3" @@ -1060,6 +1282,16 @@ __metadata: languageName: node linkType: hard +"call-bind@npm:^1.0.2": + version: 1.0.2 + resolution: "call-bind@npm:1.0.2" + dependencies: + function-bind: "npm:^1.1.1" + get-intrinsic: "npm:^1.0.2" + checksum: f8e31de9d19988a4b80f3e704788c4a2d6b6f3d17cfec4f57dc29ced450c53a49270dc66bf0fbd693329ee948dd33e6c90a329519aef17474a4d961e8d6426b0 + languageName: node + linkType: hard + "camelcase@npm:^6.3.0": version: 6.3.0 resolution: "camelcase@npm:6.3.0" @@ -1222,6 +1454,13 @@ __metadata: languageName: node linkType: hard +"crypto-js@npm:^4.2.0": + version: 4.2.0 + resolution: "crypto-js@npm:4.2.0" + checksum: f051666dbc077c8324777f44fbd3aaea2986f198fe85092535130d17026c7c2ccf2d23ee5b29b36f7a4a07312db2fae23c9094b644cc35f7858b1b4fcaf27774 + languageName: node + linkType: hard + "debug@npm:4, debug@npm:^4.0.0, debug@npm:^4.3.3, debug@npm:^4.3.4": version: 4.3.4 resolution: "debug@npm:4.3.4" @@ -1272,6 +1511,20 @@ __metadata: languageName: node linkType: hard +"dotenv@npm:^16.3.1": + version: 16.3.1 + resolution: "dotenv@npm:16.3.1" + checksum: 15d75e7279018f4bafd0ee9706593dd14455ddb71b3bcba9c52574460b7ccaf67d5cf8b2c08a5af1a9da6db36c956a04a1192b101ee102a3e0cf8817bbcf3dfd + languageName: node + linkType: hard + +"dottie@npm:^2.0.6": + version: 2.0.6 + resolution: "dottie@npm:2.0.6" + checksum: 4c778df9dc631a1108a32ef390916836814999a7411d10883f4151bd49c9c6934dc329b3f50fc7692849aa75ba87dba880fd54be501a3b39a6b9c23d6f772a09 + languageName: node + linkType: hard + "dynamic-dedupe@npm:^0.3.0": version: 0.3.0 resolution: "dynamic-dedupe@npm:0.3.0" @@ -1351,6 +1604,37 @@ __metadata: languageName: node linkType: hard +"ethereum-bloom-filters@npm:^1.0.6": + version: 1.0.10 + resolution: "ethereum-bloom-filters@npm:1.0.10" + dependencies: + js-sha3: "npm:^0.8.0" + checksum: 4019cc6f9274ae271a52959194a72f6e9b013366f168f922dc3b349319faf7426bf1010125ee0676b4f75714fe4a440edd4e7e62342c121a046409f4cd4c0af9 + languageName: node + linkType: hard + +"ethereum-cryptography@npm:^2.0.0, ethereum-cryptography@npm:^2.1.2": + version: 2.1.2 + resolution: "ethereum-cryptography@npm:2.1.2" + dependencies: + "@noble/curves": "npm:1.1.0" + "@noble/hashes": "npm:1.3.1" + "@scure/bip32": "npm:1.3.1" + "@scure/bip39": "npm:1.2.1" + checksum: 2e8f7b8cc90232ae838ab6a8167708e8362621404d26e79b5d9e762c7b53d699f7520aff358d9254de658fcd54d2d0af168ff909943259ed27dc4cef2736410c + languageName: node + linkType: hard + +"ethjs-unit@npm:0.1.6": + version: 0.1.6 + resolution: "ethjs-unit@npm:0.1.6" + dependencies: + bn.js: "npm:4.11.6" + number-to-bn: "npm:1.7.0" + checksum: df6b4752ff7461a59a20219f4b1684c631ea601241c39660e3f6c6bd63c950189723841c22b3c6c0ebeb3c9fc99e0e803e3c613101206132603705fcbcf4def5 + languageName: node + linkType: hard + "event-target-shim@npm:^5.0.0": version: 5.0.1 resolution: "event-target-shim@npm:5.0.1" @@ -1365,6 +1649,13 @@ __metadata: languageName: node linkType: hard +"events@npm:1.1.1": + version: 1.1.1 + resolution: "events@npm:1.1.1" + checksum: 40431eb005cc4c57861b93d44c2981a49e7feb99df84cf551baed299ceea4444edf7744733f6a6667e942af687359b1f4a87ec1ec4f21d5127dac48a782039b9 + languageName: node + linkType: hard + "events@npm:^3.3.0": version: 3.3.0 resolution: "events@npm:3.3.0" @@ -1521,6 +1812,15 @@ __metadata: languageName: node linkType: hard +"for-each@npm:^0.3.3": + version: 0.3.3 + resolution: "for-each@npm:0.3.3" + dependencies: + is-callable: "npm:^1.1.3" + checksum: 6c48ff2bc63362319c65e2edca4a8e1e3483a2fabc72fbe7feaf8c73db94fc7861bd53bc02c8a66a0c1dd709da6b04eec42e0abdd6b40ce47305ae92a25e5d28 + languageName: node + linkType: hard + "foreground-child@npm:^3.1.0": version: 3.1.1 resolution: "foreground-child@npm:3.1.1" @@ -1616,6 +1916,18 @@ __metadata: languageName: node linkType: hard +"get-intrinsic@npm:^1.0.2, get-intrinsic@npm:^1.1.3": + version: 1.2.1 + resolution: "get-intrinsic@npm:1.2.1" + dependencies: + function-bind: "npm:^1.1.1" + has: "npm:^1.0.3" + has-proto: "npm:^1.0.1" + has-symbols: "npm:^1.0.3" + checksum: 5b61d88552c24b0cf6fa2d1b3bc5459d7306f699de060d76442cce49a4721f52b8c560a33ab392cf5575b7810277d54ded9d4d39a1ea61855619ebc005aa7e5f + languageName: node + linkType: hard + "git-format-staged@npm:^2.1.3": version: 2.1.3 resolution: "git-format-staged@npm:2.1.3" @@ -1663,6 +1975,15 @@ __metadata: languageName: node linkType: hard +"gopd@npm:^1.0.1": + version: 1.0.1 + resolution: "gopd@npm:1.0.1" + dependencies: + get-intrinsic: "npm:^1.1.3" + checksum: a5ccfb8806e0917a94e0b3de2af2ea4979c1da920bc381667c260e00e7cafdbe844e2cb9c5bcfef4e5412e8bf73bab837285bc35c7ba73aaaf0134d4583393a6 + languageName: node + linkType: hard + "graceful-fs@npm:^4.2.4, graceful-fs@npm:^4.2.6": version: 4.2.11 resolution: "graceful-fs@npm:4.2.11" @@ -1677,6 +1998,29 @@ __metadata: languageName: node linkType: hard +"has-proto@npm:^1.0.1": + version: 1.0.1 + resolution: "has-proto@npm:1.0.1" + checksum: febc5b5b531de8022806ad7407935e2135f1cc9e64636c3916c6842bd7995994ca3b29871ecd7954bd35f9e2986c17b3b227880484d22259e2f8e6ce63fd383e + languageName: node + linkType: hard + +"has-symbols@npm:^1.0.2, has-symbols@npm:^1.0.3": + version: 1.0.3 + resolution: "has-symbols@npm:1.0.3" + checksum: a054c40c631c0d5741a8285010a0777ea0c068f99ed43e5d6eb12972da223f8af553a455132fdb0801bdcfa0e0f443c0c03a68d8555aa529b3144b446c3f2410 + languageName: node + linkType: hard + +"has-tostringtag@npm:^1.0.0": + version: 1.0.0 + resolution: "has-tostringtag@npm:1.0.0" + dependencies: + has-symbols: "npm:^1.0.2" + checksum: cc12eb28cb6ae22369ebaad3a8ab0799ed61270991be88f208d508076a1e99abe4198c965935ce85ea90b60c94ddda73693b0920b58e7ead048b4a391b502c1c + languageName: node + linkType: hard + "has-unicode@npm:^2.0.1": version: 2.0.1 resolution: "has-unicode@npm:2.0.1" @@ -1739,7 +2083,14 @@ __metadata: languageName: node linkType: hard -"ieee754@npm:^1.2.1": +"ieee754@npm:1.1.13": + version: 1.1.13 + resolution: "ieee754@npm:1.1.13" + checksum: 102df1ba662e316e6160f7ce29c7c7fa3e04f2014c288336c5a9ff40bbcc2a27d209fa2a81ebfb33f28b1941021343d30e9ad8ee85a2d61f79f5936c35edc33d + languageName: node + linkType: hard + +"ieee754@npm:^1.1.4, ieee754@npm:^1.2.1": version: 1.2.1 resolution: "ieee754@npm:1.2.1" checksum: 5144c0c9815e54ada181d80a0b810221a253562422e7c6c3a60b1901154184f49326ec239d618c416c1c5945a2e197107aee8d986a3dd836b53dffefd99b5e7e @@ -1760,6 +2111,13 @@ __metadata: languageName: node linkType: hard +"inflection@npm:^1.13.4": + version: 1.13.4 + resolution: "inflection@npm:1.13.4" + checksum: 6744feede9998ad8abd2b1db4af79f494a166e656a0aa949d90c8f4a945c1d07038a3756bf7af78c8f6fce368ba213a7ebf35da3edeffd39f1da0ff465eed6eb + languageName: node + linkType: hard + "inflection@npm:^2.0.1": version: 2.0.1 resolution: "inflection@npm:2.0.1" @@ -1798,6 +2156,16 @@ __metadata: languageName: node linkType: hard +"is-arguments@npm:^1.0.4": + version: 1.1.1 + resolution: "is-arguments@npm:1.1.1" + dependencies: + call-bind: "npm:^1.0.2" + has-tostringtag: "npm:^1.0.0" + checksum: 7f02700ec2171b691ef3e4d0e3e6c0ba408e8434368504bb593d0d7c891c0dbfda6d19d30808b904a6cb1929bca648c061ba438c39f296c2a8ca083229c49f27 + languageName: node + linkType: hard + "is-binary-path@npm:~2.1.0": version: 2.1.0 resolution: "is-binary-path@npm:2.1.0" @@ -1807,6 +2175,13 @@ __metadata: languageName: node linkType: hard +"is-callable@npm:^1.1.3": + version: 1.2.7 + resolution: "is-callable@npm:1.2.7" + checksum: 61fd57d03b0d984e2ed3720fb1c7a897827ea174bd44402878e059542ea8c4aeedee0ea0985998aa5cc2736b2fa6e271c08587addb5b3959ac52cf665173d1ac + languageName: node + linkType: hard + "is-core-module@npm:^2.13.0": version: 2.13.0 resolution: "is-core-module@npm:2.13.0" @@ -1830,6 +2205,15 @@ __metadata: languageName: node linkType: hard +"is-generator-function@npm:^1.0.7": + version: 1.0.10 + resolution: "is-generator-function@npm:1.0.10" + dependencies: + has-tostringtag: "npm:^1.0.0" + checksum: d54644e7dbaccef15ceb1e5d91d680eb5068c9ee9f9eb0a9e04173eb5542c9b51b5ab52c5537f5703e48d5fddfd376817c1ca07a84a407b7115b769d4bdde72b + languageName: node + linkType: hard + "is-glob@npm:^4.0.1, is-glob@npm:~4.0.1": version: 4.0.3 resolution: "is-glob@npm:4.0.3" @@ -1839,6 +2223,13 @@ __metadata: languageName: node linkType: hard +"is-hex-prefixed@npm:1.0.0": + version: 1.0.0 + resolution: "is-hex-prefixed@npm:1.0.0" + checksum: 5ac58e6e528fb029cc43140f6eeb380fad23d0041cc23154b87f7c9a1b728bcf05909974e47248fd0b7fcc11ba33cf7e58d64804883056fabd23e2b898be41de + languageName: node + linkType: hard + "is-lambda@npm:^1.0.1": version: 1.0.1 resolution: "is-lambda@npm:1.0.1" @@ -1853,6 +2244,22 @@ __metadata: languageName: node linkType: hard +"is-typed-array@npm:^1.1.3": + version: 1.1.12 + resolution: "is-typed-array@npm:1.1.12" + dependencies: + which-typed-array: "npm:^1.1.11" + checksum: 4c89c4a3be07186caddadf92197b17fda663a9d259ea0d44a85f171558270d36059d1c386d34a12cba22dfade5aba497ce22778e866adc9406098c8fc4771796 + languageName: node + linkType: hard + +"isarray@npm:^1.0.0": + version: 1.0.0 + resolution: "isarray@npm:1.0.0" + checksum: f032df8e02dce8ec565cf2eb605ea939bdccea528dbcf565cdf92bfa2da9110461159d86a537388ef1acef8815a330642d7885b29010e8f7eac967c9993b65ab + languageName: node + linkType: hard + "isexe@npm:^2.0.0": version: 2.0.0 resolution: "isexe@npm:2.0.0" @@ -1904,6 +2311,13 @@ __metadata: languageName: node linkType: hard +"jmespath@npm:0.16.0": + version: 0.16.0 + resolution: "jmespath@npm:0.16.0" + checksum: 2d602493a1e4addfd1350ac8c9d54b1b03ed09e305fd863bab84a4ee1f52868cf939dd1a08c5cdea29ce9ba8f86875ebb458b6ed45dab3e1c3f2694503fb2fd9 + languageName: node + linkType: hard + "js-sha256@npm:^0.9.0": version: 0.9.0 resolution: "js-sha256@npm:0.9.0" @@ -1950,6 +2364,13 @@ __metadata: languageName: node linkType: hard +"lodash@npm:^4.17.21": + version: 4.17.21 + resolution: "lodash@npm:4.17.21" + checksum: eb835a2e51d381e561e508ce932ea50a8e5a68f4ebdd771ea240d3048244a8d13658acbd502cd4829768c56f2e16bdd4340b9ea141297d472517b83868e677f7 + languageName: node + linkType: hard + "lower-case@npm:^2.0.2": version: 2.0.2 resolution: "lower-case@npm:2.0.2" @@ -2012,6 +2433,26 @@ __metadata: languageName: node linkType: hard +"merkletreejs@npm:^0.3.9": + version: 0.3.11 + resolution: "merkletreejs@npm:0.3.11" + dependencies: + bignumber.js: ^9.0.1 + buffer-reverse: ^1.0.1 + crypto-js: ^4.2.0 + treeify: ^1.1.0 + web3-utils: ^1.3.4 + checksum: 93edb8ec66aa6c9f59aa0902e675590e3791692893bb3e8c1018f758367ded1bf7d6b1057ccde3729b283ca946a316838a631a922960b76889b3be528c43ef4e + languageName: node + linkType: hard + +"micro-ftch@npm:^0.3.1": + version: 0.3.1 + resolution: "micro-ftch@npm:0.3.1" + checksum: 0e496547253a36e98a83fb00c628c53c3fb540fa5aaeaf718438873785afd193244988c09d219bb1802984ff227d04938d9571ef90fe82b48bd282262586aaff + languageName: node + linkType: hard + "micromatch@npm:^4.0.0": version: 4.0.5 resolution: "micromatch@npm:4.0.5" @@ -2156,6 +2597,22 @@ __metadata: languageName: node linkType: hard +"moment-timezone@npm:^0.5.43": + version: 0.5.43 + resolution: "moment-timezone@npm:0.5.43" + dependencies: + moment: "npm:^2.29.4" + checksum: 8075c897ed8a044f992ef26fe8cdbcad80caf974251db424cae157473cca03be2830de8c74d99341b76edae59f148c9d9d19c1c1d9363259085688ec1cf508d0 + languageName: node + linkType: hard + +"moment@npm:^2.29.4": + version: 2.29.4 + resolution: "moment@npm:2.29.4" + checksum: 0ec3f9c2bcba38dc2451b1daed5daded747f17610b92427bebe1d08d48d8b7bdd8d9197500b072d14e326dd0ccf3e326b9e3d07c5895d3d49e39b6803b76e80e + languageName: node + linkType: hard + "ms@npm:2.1.2": version: 2.1.2 resolution: "ms@npm:2.1.2" @@ -2270,6 +2727,23 @@ __metadata: languageName: node linkType: hard +"number-to-bn@npm:1.7.0": + version: 1.7.0 + resolution: "number-to-bn@npm:1.7.0" + dependencies: + bn.js: "npm:4.11.6" + strip-hex-prefix: "npm:1.0.0" + checksum: 5b8c9dbe7b49dc7a069e5f0ba4e197257c89db11463478cb002fee7a34dc8868636952bd9f6310e5fdf22b266e0e6dffb5f9537c741734718107e90ae59b3de4 + languageName: node + linkType: hard + +"obuf@npm:~1.1.2": + version: 1.1.2 + resolution: "obuf@npm:1.1.2" + checksum: 41a2ba310e7b6f6c3b905af82c275bf8854896e2e4c5752966d64cbcd2f599cfffd5932006bcf3b8b419dfdacebb3a3912d5d94e10f1d0acab59876c8757f27f + languageName: node + linkType: hard + "on-exit-leak-free@npm:^2.1.0": version: 2.1.0 resolution: "on-exit-leak-free@npm:2.1.0" @@ -2295,6 +2769,13 @@ __metadata: languageName: node linkType: hard +"packet-reader@npm:1.0.0": + version: 1.0.0 + resolution: "packet-reader@npm:1.0.0" + checksum: 0b7516f0cbf3e322aad591bed29ba544220088c53943145c0d9121a6f59182ad811f7fd6785a8979a34356aca69d97653689029964c5998dc02645633d88ffd7 + languageName: node + linkType: hard + "pako@npm:^2.0.3": version: 2.1.0 resolution: "pako@npm:2.1.0" @@ -2333,6 +2814,111 @@ __metadata: languageName: node linkType: hard +"pg-cloudflare@npm:^1.1.1": + version: 1.1.1 + resolution: "pg-cloudflare@npm:1.1.1" + checksum: 32aac06b5dc4588bbf78801b6267781bc7e13be672009df949d08e9627ba9fdc26924916665d4de99d47f9b0495301930547488dad889d826856976c7b3f3731 + languageName: node + linkType: hard + +"pg-connection-string@npm:^2.6.1, pg-connection-string@npm:^2.6.2": + version: 2.6.2 + resolution: "pg-connection-string@npm:2.6.2" + checksum: 22265882c3b6f2320785378d0760b051294a684989163d5a1cde4009e64e84448d7bf67d9a7b9e7f69440c3ee9e2212f9aa10dd17ad6773f6143c6020cebbcb5 + languageName: node + linkType: hard + +"pg-int8@npm:1.0.1": + version: 1.0.1 + resolution: "pg-int8@npm:1.0.1" + checksum: a1e3a05a69005ddb73e5f324b6b4e689868a447c5fa280b44cd4d04e6916a344ac289e0b8d2695d66e8e89a7fba023affb9e0e94778770ada5df43f003d664c9 + languageName: node + linkType: hard + +"pg-numeric@npm:1.0.2": + version: 1.0.2 + resolution: "pg-numeric@npm:1.0.2" + checksum: 8899f8200caa1744439a8778a9eb3ceefb599d893e40a09eef84ee0d4c151319fd416634a6c0fc7b7db4ac268710042da5be700b80ef0de716fe089b8652c84f + languageName: node + linkType: hard + +"pg-pool@npm:^3.6.1": + version: 3.6.1 + resolution: "pg-pool@npm:3.6.1" + peerDependencies: + pg: ">=8.0" + checksum: 8a6513e6f74a794708c9dd16d2ccda0debadc56435ec2582de2b2e35b01315550c5dab8a0a9a2a16f4adce45523228f5739940fb7687ec7e9c300f284eb08fd1 + languageName: node + linkType: hard + +"pg-protocol@npm:*, pg-protocol@npm:^1.6.0": + version: 1.6.0 + resolution: "pg-protocol@npm:1.6.0" + checksum: e12662d2de2011e0c3a03f6a09f435beb1025acdc860f181f18a600a5495dc38a69d753bbde1ace279c8c442536af9c1a7c11e1d0fe3fad3aa1348b28d9d2683 + languageName: node + linkType: hard + +"pg-types@npm:^2.1.0": + version: 2.2.0 + resolution: "pg-types@npm:2.2.0" + dependencies: + pg-int8: "npm:1.0.1" + postgres-array: "npm:~2.0.0" + postgres-bytea: "npm:~1.0.0" + postgres-date: "npm:~1.0.4" + postgres-interval: "npm:^1.1.0" + checksum: bf4ec3f594743442857fb3a8dfe5d2478a04c98f96a0a47365014557cbc0b4b0cee01462c79adca863b93befbf88f876299b75b72c665b5fb84a2c94fbd10316 + languageName: node + linkType: hard + +"pg-types@npm:^4.0.1": + version: 4.0.1 + resolution: "pg-types@npm:4.0.1" + dependencies: + pg-int8: "npm:1.0.1" + pg-numeric: "npm:1.0.2" + postgres-array: "npm:~3.0.1" + postgres-bytea: "npm:~3.0.0" + postgres-date: "npm:~2.0.1" + postgres-interval: "npm:^3.0.0" + postgres-range: "npm:^1.1.1" + checksum: 05258ef2f27a75f1bf4e243f36bb749f85148339d3be818147bcc4aebe019ad7589a6869150713140250d81e5a46ec25dc6e0a031ea77e23db5ca232a0d7a3dc + languageName: node + linkType: hard + +"pg@npm:^8.11.3": + version: 8.11.3 + resolution: "pg@npm:8.11.3" + dependencies: + buffer-writer: "npm:2.0.0" + packet-reader: "npm:1.0.0" + pg-cloudflare: "npm:^1.1.1" + pg-connection-string: "npm:^2.6.2" + pg-pool: "npm:^3.6.1" + pg-protocol: "npm:^1.6.0" + pg-types: "npm:^2.1.0" + pgpass: "npm:1.x" + peerDependencies: + pg-native: ">=3.0.1" + dependenciesMeta: + pg-cloudflare: + optional: true + peerDependenciesMeta: + pg-native: + optional: true + checksum: 8af9468b8969fa0d73a6b349216c8cbc953d938fcae5594f2d24043060e9226a072c8085fc4230172b5576fcab4c39c8563c655f271dc2a9209b6ad5370cafe5 + languageName: node + linkType: hard + +"pgpass@npm:1.x": + version: 1.0.5 + resolution: "pgpass@npm:1.0.5" + dependencies: + split2: "npm:^4.1.0" + checksum: 947ac096c031eebdf08d989de2e9f6f156b8133d6858c7c2c06c041e1e71dda6f5f3bad3c0ec1e96a09497bbc6ef89e762eefe703b5ef9cb2804392ec52ec400 + languageName: node + linkType: hard + "picomatch@npm:^2.0.4, picomatch@npm:^2.2.1, picomatch@npm:^2.3.1": version: 2.3.1 resolution: "picomatch@npm:2.3.1" @@ -2378,6 +2964,73 @@ __metadata: languageName: node linkType: hard +"postgres-array@npm:~2.0.0": + version: 2.0.0 + resolution: "postgres-array@npm:2.0.0" + checksum: 0e1e659888147c5de579d229a2d95c0d83ebdbffc2b9396d890a123557708c3b758a0a97ed305ce7f58edfa961fa9f0bbcd1ea9f08b6e5df73322e683883c464 + languageName: node + linkType: hard + +"postgres-array@npm:~3.0.1": + version: 3.0.2 + resolution: "postgres-array@npm:3.0.2" + checksum: 5955f9dffeb6fa960c1a0b04fd4b2ba16813ddb636934ad26f902e4d76a91c0b743dcc6edc4cffc52deba7d547505e0020adea027c1d50a774f989cf955420d1 + languageName: node + linkType: hard + +"postgres-bytea@npm:~1.0.0": + version: 1.0.0 + resolution: "postgres-bytea@npm:1.0.0" + checksum: d844ae4ca7a941b70e45cac1261a73ee8ed39d72d3d74ab1d645248185a1b7f0ac91a3c63d6159441020f4e1f7fe64689ac56536a307b31cef361e5187335090 + languageName: node + linkType: hard + +"postgres-bytea@npm:~3.0.0": + version: 3.0.0 + resolution: "postgres-bytea@npm:3.0.0" + dependencies: + obuf: "npm:~1.1.2" + checksum: 5f917a003fcaa0df7f285e1c37108ad474ce91193466b9bd4bcaecef2cdea98ca069c00aa6a8dbe6d2e7192336cadc3c9b36ae48d1555a299521918e00e2936b + languageName: node + linkType: hard + +"postgres-date@npm:~1.0.4": + version: 1.0.7 + resolution: "postgres-date@npm:1.0.7" + checksum: 5745001d47e51cd767e46bcb1710649cd705d91a24d42fa661c454b6dcbb7353c066a5047983c90a626cd3bbfea9e626cc6fa84a35ec57e5bbb28b49f78e13ed + languageName: node + linkType: hard + +"postgres-date@npm:~2.0.1": + version: 2.0.1 + resolution: "postgres-date@npm:2.0.1" + checksum: 0304bf8641a01412e4f5c3a374604e2e3dbc9dbee71d30df12fe60b32560c5674f887c2d15bafa2996f3b618b617398e7605f0e3669db43f31e614dfe69f8de7 + languageName: node + linkType: hard + +"postgres-interval@npm:^1.1.0": + version: 1.2.0 + resolution: "postgres-interval@npm:1.2.0" + dependencies: + xtend: "npm:^4.0.0" + checksum: 746b71f93805ae33b03528e429dc624706d1f9b20ee81bf743263efb6a0cd79ae02a642a8a480dbc0f09547b4315ab7df6ce5ec0be77ed700bac42730f5c76b2 + languageName: node + linkType: hard + +"postgres-interval@npm:^3.0.0": + version: 3.0.0 + resolution: "postgres-interval@npm:3.0.0" + checksum: c7a1cf006de97de663b6b8c4d2b167aa9909a238c4866a94b15d303762f5ac884ff4796cd6e2111b7f0a91302b83c570453aa8506fd005b5a5d5dfa87441bebc + languageName: node + linkType: hard + +"postgres-range@npm:^1.1.1": + version: 1.1.3 + resolution: "postgres-range@npm:1.1.3" + checksum: bf7e194a18c490d02bda0bd02035a8da454d8fd2b22c55d3d03f185c038b2a6f52d0804417d8090864afefc2b7ed664b2d12c2454a4a0f545dcbbb86488fbdf1 + languageName: node + linkType: hard + "process-warning@npm:^2.0.0, process-warning@npm:^2.2.0": version: 2.2.0 resolution: "process-warning@npm:2.2.0" @@ -2428,6 +3081,13 @@ __metadata: languageName: node linkType: hard +"punycode@npm:1.3.2": + version: 1.3.2 + resolution: "punycode@npm:1.3.2" + checksum: b8807fd594b1db33335692d1f03e8beeddde6fda7fbb4a2e32925d88d20a3aa4cd8dcc0c109ccaccbd2ba761c208dfaaada83007087ea8bfb0129c9ef1b99ed6 + languageName: node + linkType: hard + "punycode@npm:^2.1.0": version: 2.3.0 resolution: "punycode@npm:2.3.0" @@ -2435,6 +3095,13 @@ __metadata: languageName: node linkType: hard +"querystring@npm:0.2.0": + version: 0.2.0 + resolution: "querystring@npm:0.2.0" + checksum: 8258d6734f19be27e93f601758858c299bdebe71147909e367101ba459b95446fbe5b975bf9beb76390156a592b6f4ac3a68b6087cea165c259705b8b4e56a69 + languageName: node + linkType: hard + "quick-format-unescaped@npm:^4.0.3": version: 4.0.4 resolution: "quick-format-unescaped@npm:4.0.4" @@ -2442,6 +3109,15 @@ __metadata: languageName: node linkType: hard +"randombytes@npm:^2.1.0": + version: 2.1.0 + resolution: "randombytes@npm:2.1.0" + dependencies: + safe-buffer: "npm:^5.1.0" + checksum: d779499376bd4cbb435ef3ab9a957006c8682f343f14089ed5f27764e4645114196e75b7f6abf1cbd84fd247c0cb0651698444df8c9bf30e62120fbbc52269d6 + languageName: node + linkType: hard + "readable-stream@npm:^3.6.0": version: 3.6.2 resolution: "readable-stream@npm:3.6.2" @@ -2529,6 +3205,13 @@ __metadata: languageName: node linkType: hard +"retry-as-promised@npm:^7.0.4": + version: 7.0.4 + resolution: "retry-as-promised@npm:7.0.4" + checksum: 2b0dcddb06649d42b1384ec1f933c7cb4461939c28004460b0c4be0c8ae16cabaed2411aa5d46e734a320f33f4a1d480078a19b97c743c754bd32e896b3f8ea2 + languageName: node + linkType: hard + "retry@npm:^0.12.0": version: 0.12.0 resolution: "retry@npm:0.12.0" @@ -2591,7 +3274,7 @@ __metadata: languageName: node linkType: hard -"safe-buffer@npm:^5.0.1, safe-buffer@npm:~5.2.0": +"safe-buffer@npm:^5.0.1, safe-buffer@npm:^5.1.0, safe-buffer@npm:~5.2.0": version: 5.2.1 resolution: "safe-buffer@npm:5.2.1" checksum: b99c4b41fdd67a6aaf280fcd05e9ffb0813654894223afb78a31f14a19ad220bba8aba1cb14eddce1fcfb037155fe6de4e861784eb434f7d11ed58d1e70dd491 @@ -2621,6 +3304,20 @@ __metadata: languageName: node linkType: hard +"sax@npm:1.2.1": + version: 1.2.1 + resolution: "sax@npm:1.2.1" + checksum: 8dca7d5e1cd7d612f98ac50bdf0b9f63fbc964b85f0c4e2eb271f8b9b47fd3bf344c4d6a592e69ecf726d1485ca62cd8a52e603bbc332d18a66af25a9a1045ad + languageName: node + linkType: hard + +"sax@npm:>=0.6.0": + version: 1.2.4 + resolution: "sax@npm:1.2.4" + checksum: d3df7d32b897a2c2f28e941f732c71ba90e27c24f62ee918bd4d9a8cfb3553f2f81e5493c7f0be94a11c1911b643a9108f231dd6f60df3fa9586b5d2e3e9e1fe + languageName: node + linkType: hard + "secure-json-parse@npm:^2.5.0": version: 2.7.0 resolution: "secure-json-parse@npm:2.7.0" @@ -2628,7 +3325,7 @@ __metadata: languageName: node linkType: hard -"semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.5.0": +"semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.5.0, semver@npm:^7.5.4": version: 7.5.4 resolution: "semver@npm:7.5.4" dependencies: @@ -2639,6 +3336,56 @@ __metadata: languageName: node linkType: hard +"sequelize-pool@npm:^7.1.0": + version: 7.1.0 + resolution: "sequelize-pool@npm:7.1.0" + checksum: b11d06d02de9e8fc428ba3020b86f05fe7adad764e57f23c5901f924e31867901a5e7a090180337dc3b90de3934b64f34ae552fde37b0f3d37b09c0c8ecbddc7 + languageName: node + linkType: hard + +"sequelize@npm:^6.35.2": + version: 6.35.2 + resolution: "sequelize@npm:6.35.2" + dependencies: + "@types/debug": ^4.1.8 + "@types/validator": ^13.7.17 + debug: ^4.3.4 + dottie: ^2.0.6 + inflection: ^1.13.4 + lodash: ^4.17.21 + moment: ^2.29.4 + moment-timezone: ^0.5.43 + pg-connection-string: ^2.6.1 + retry-as-promised: ^7.0.4 + semver: ^7.5.4 + sequelize-pool: ^7.1.0 + toposort-class: ^1.0.1 + uuid: ^8.3.2 + validator: ^13.9.0 + wkx: ^0.5.0 + peerDependenciesMeta: + ibm_db: + optional: true + mariadb: + optional: true + mysql2: + optional: true + oracledb: + optional: true + pg: + optional: true + pg-hstore: + optional: true + snowflake-sdk: + optional: true + sqlite3: + optional: true + tedious: + optional: true + checksum: 9d0842a08725d5db538b02f549e4962301d35715bb1f45d2909b273299510d9071ba26d190381e307887ec0f4648ec32239ad6d6005e90ce562585b7bc23a159 + languageName: node + linkType: hard + "set-blocking@npm:^2.0.0": version: 2.0.0 resolution: "set-blocking@npm:2.0.0" @@ -2747,7 +3494,7 @@ __metadata: languageName: node linkType: hard -"split2@npm:^4.0.0": +"split2@npm:^4.0.0, split2@npm:^4.1.0": version: 4.2.0 resolution: "split2@npm:4.2.0" checksum: 05d54102546549fe4d2455900699056580cca006c0275c334611420f854da30ac999230857a85fdd9914dc2109ae50f80fda43d2a445f2aa86eccdc1dfce779d @@ -2819,6 +3566,15 @@ __metadata: languageName: node linkType: hard +"strip-hex-prefix@npm:1.0.0": + version: 1.0.0 + resolution: "strip-hex-prefix@npm:1.0.0" + dependencies: + is-hex-prefixed: "npm:1.0.0" + checksum: 4cafe7caee1d281d3694d14920fd5d3c11adf09371cef7e2ccedd5b83efd9e9bd2219b5d6ce6e809df6e0f437dc9d30db1192116580875698aad164a6d6b285b + languageName: node + linkType: hard + "strip-json-comments@npm:^2.0.0": version: 2.0.1 resolution: "strip-json-comments@npm:2.0.1" @@ -2932,6 +3688,13 @@ __metadata: languageName: node linkType: hard +"toposort-class@npm:^1.0.1": + version: 1.0.1 + resolution: "toposort-class@npm:1.0.1" + checksum: c5e3229d4899b23350b09ed26cfb7a28aadd0889550625f1bcadc0da266cdf2790fb0ccc3e92be93ba6ad64f57bc2fd1ab94446cb4ae83054dab263753157f5f + languageName: node + linkType: hard + "tr46@npm:~0.0.3": version: 0.0.3 resolution: "tr46@npm:0.0.3" @@ -2948,6 +3711,13 @@ __metadata: languageName: node linkType: hard +"treeify@npm:^1.1.0": + version: 1.1.0 + resolution: "treeify@npm:1.1.0" + checksum: aa00dded220c1dd052573bd6fc2c52862f09870851a284f0d3650d72bf913ba9b4f6b824f4f1ab81899bae29375f4266b07fe47cbf82343a1efa13cc09ce87af + languageName: node + linkType: hard + "ts-loader@npm:^9.2.3": version: 9.4.4 resolution: "ts-loader@npm:9.4.4" @@ -3101,6 +3871,16 @@ __metadata: languageName: node linkType: hard +"url@npm:0.10.3": + version: 0.10.3 + resolution: "url@npm:0.10.3" + dependencies: + punycode: "npm:1.3.2" + querystring: "npm:0.2.0" + checksum: 7b83ddb106c27bf9bde8629ccbe8d26e9db789c8cda5aa7db72ca2c6f9b8a88a5adf206f3e10db78e6e2d042b327c45db34c7010c1bf0d9908936a17a2b57d05 + languageName: node + linkType: hard + "utf-8-validate@npm:^5.0.2": version: 5.0.10 resolution: "utf-8-validate@npm:5.0.10" @@ -3111,6 +3891,13 @@ __metadata: languageName: node linkType: hard +"utf8@npm:3.0.0": + version: 3.0.0 + resolution: "utf8@npm:3.0.0" + checksum: cb89a69ad9ab393e3eae9b25305b3ff08bebca9adc839191a34f90777eb2942f86a96369d2839925fea58f8f722f7e27031d697f10f5f39690f8c5047303e62d + languageName: node + linkType: hard + "util-deprecate@npm:^1.0.1": version: 1.0.2 resolution: "util-deprecate@npm:1.0.2" @@ -3118,6 +3905,28 @@ __metadata: languageName: node linkType: hard +"util@npm:^0.12.4": + version: 0.12.5 + resolution: "util@npm:0.12.5" + dependencies: + inherits: "npm:^2.0.3" + is-arguments: "npm:^1.0.4" + is-generator-function: "npm:^1.0.7" + is-typed-array: "npm:^1.1.3" + which-typed-array: "npm:^1.1.2" + checksum: 705e51f0de5b446f4edec10739752ac25856541e0254ea1e7e45e5b9f9b0cb105bc4bd415736a6210edc68245a7f903bf085ffb08dd7deb8a0e847f60538a38a + languageName: node + linkType: hard + +"uuid@npm:8.0.0": + version: 8.0.0 + resolution: "uuid@npm:8.0.0" + bin: + uuid: dist/bin/uuid + checksum: 56d4e23aa7ac26fa2db6bd1778db34cb8c9f5a10df1770a27167874bf6705fc8f14a4ac414af58a0d96c7653b2bd4848510b29d1c2ef8c91ccb17429c1872b5e + languageName: node + linkType: hard + "uuid@npm:^8.3.2": version: 8.3.2 resolution: "uuid@npm:8.3.2" @@ -3134,6 +3943,29 @@ __metadata: languageName: node linkType: hard +"validator@npm:^13.9.0": + version: 13.11.0 + resolution: "validator@npm:13.11.0" + checksum: d1e0c27022681420756da25bc03eb08d5f0c66fb008f8ff02ebc95812b77c6be6e03d3bd05cf80ca702e23eeb73dadd66b4b3683173ea2a0bc7cc72820bee131 + languageName: node + linkType: hard + +"web3-utils@npm:^1.3.4": + version: 1.10.2 + resolution: "web3-utils@npm:1.10.2" + dependencies: + "@ethereumjs/util": "npm:^8.1.0" + bn.js: "npm:^5.2.1" + ethereum-bloom-filters: "npm:^1.0.6" + ethereum-cryptography: "npm:^2.1.2" + ethjs-unit: "npm:0.1.6" + number-to-bn: "npm:1.7.0" + randombytes: "npm:^2.1.0" + utf8: "npm:3.0.0" + checksum: a5f8db69603fdd5e984aa6407f47f7a4e0dab83af42e10de25a6d9eeaf2e7d4d18fe665b569e364b2e916233fb73b26cc70ff0d730e7909720118c4790dfb043 + languageName: node + linkType: hard + "webidl-conversions@npm:^3.0.0": version: 3.0.1 resolution: "webidl-conversions@npm:3.0.1" @@ -3151,6 +3983,19 @@ __metadata: languageName: node linkType: hard +"which-typed-array@npm:^1.1.11, which-typed-array@npm:^1.1.2": + version: 1.1.11 + resolution: "which-typed-array@npm:1.1.11" + dependencies: + available-typed-arrays: "npm:^1.0.5" + call-bind: "npm:^1.0.2" + for-each: "npm:^0.3.3" + gopd: "npm:^1.0.1" + has-tostringtag: "npm:^1.0.0" + checksum: 711ffc8ef891ca6597b19539075ec3e08bb9b4c2ca1f78887e3c07a977ab91ac1421940505a197758fb5939aa9524976d0a5bbcac34d07ed6faa75cedbb17206 + languageName: node + linkType: hard + "which@npm:^2.0.1, which@npm:^2.0.2": version: 2.0.2 resolution: "which@npm:2.0.2" @@ -3171,6 +4016,15 @@ __metadata: languageName: node linkType: hard +"wkx@npm:^0.5.0": + version: 0.5.0 + resolution: "wkx@npm:0.5.0" + dependencies: + "@types/node": "npm:*" + checksum: 47b27387de81fbd077528c1c11be996bf5a6dbeb94858ea0e2fa6619c2af626aa2f127f6fee1b4b57057a7cbef8a810b39a67815f2eb54ed33b1790e29db86ee + languageName: node + linkType: hard + "wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": version: 7.0.0 resolution: "wrap-ansi@npm:7.0.0" @@ -3230,6 +4084,23 @@ __metadata: languageName: node linkType: hard +"xml2js@npm:0.5.0": + version: 0.5.0 + resolution: "xml2js@npm:0.5.0" + dependencies: + sax: "npm:>=0.6.0" + xmlbuilder: "npm:~11.0.0" + checksum: 1aa71d62e5bc2d89138e3929b9ea46459157727759cbc62ef99484b778641c0cd21fb637696c052d901a22f82d092a3e740a16b4ce218e81ac59b933535124ea + languageName: node + linkType: hard + +"xmlbuilder@npm:~11.0.0": + version: 11.0.1 + resolution: "xmlbuilder@npm:11.0.1" + checksum: 7152695e16f1a9976658215abab27e55d08b1b97bca901d58b048d2b6e106b5af31efccbdecf9b07af37c8377d8e7e821b494af10b3a68b0ff4ae60331b415b0 + languageName: node + linkType: hard + "xtend@npm:^4.0.0": version: 4.0.2 resolution: "xtend@npm:4.0.2" diff --git a/packages/xnft-hotspot/yarn.deploy.lock b/packages/xnft-hotspot/yarn.deploy.lock index 49a6e5a97..2d67f942d 100644 --- a/packages/xnft-hotspot/yarn.deploy.lock +++ b/packages/xnft-hotspot/yarn.deploy.lock @@ -404,10 +404,12 @@ __metadata: cors: ^2.8.5 dotenv: ^16.0.3 fastify: ^4.13.0 + fastify-cron: ^1.3.1 git-format-staged: ^2.1.3 ky: ^0.31.4 nodemon: ^2.0.20 pg: ^8.9.0 + prom-client: ^15.0.0 sequelize: ^6.28.0 ts-loader: ^9.2.3 ts-node: ^10.9.1 @@ -1058,6 +1060,13 @@ __metadata: languageName: node linkType: hard +"@opentelemetry/api@npm:^1.4.0": + version: 1.7.0 + resolution: "@opentelemetry/api@npm:1.7.0" + checksum: 2398cbe65f199c3a7050125b3ad9c835f789bb0a616665e9c7f4475a29ac8334b6a3c15f38db48d345b522180c41c00b04cc174cd0eeffba98eb4874a565fa7e + languageName: node + linkType: hard + "@parcel/bundler-default@npm:2.9.3": version: 2.9.3 resolution: "@parcel/bundler-default@npm:2.9.3" @@ -2413,6 +2422,15 @@ __metadata: languageName: node linkType: hard +"@types/cron@npm:^2.0.0": + version: 2.4.0 + resolution: "@types/cron@npm:2.4.0" + dependencies: + cron: "npm:*" + checksum: c763e99a757ea76aee435948c25e0bdaf32ec44c69603088c73e8832df6b121e87932709925fe3e94777833ca30845c31df1167be54c330cf458d348059b9ffc + languageName: node + linkType: hard + "@types/crypto-js@npm:^4.1.1": version: 4.1.1 resolution: "@types/crypto-js@npm:4.1.1" @@ -2476,6 +2494,13 @@ __metadata: languageName: node linkType: hard +"@types/luxon@npm:~3.3.0": + version: 3.3.2 + resolution: "@types/luxon@npm:3.3.2" + checksum: b9111132720eae0269538872a5a496b29587ecfc8edc3b0ff7d269aa93a5ff00a131b23d1e9d1f12ec39f2c779ad21bd8d9f90b122c85a182771aabde7f676b8 + languageName: node + linkType: hard + "@types/mime@npm:*": version: 3.0.1 resolution: "@types/mime@npm:3.0.1" @@ -3039,6 +3064,13 @@ __metadata: languageName: node linkType: hard +"bintrees@npm:1.0.2": + version: 1.0.2 + resolution: "bintrees@npm:1.0.2" + checksum: 56a52b7d3634e30002b1eda740d2517a22fa8e9e2eb088e919f37c030a0ed86e364ab59e472fc770fc8751308054bb1c892979d150e11d9e11ac33bcc1b5d16e + languageName: node + linkType: hard + "bl@npm:^1.0.0": version: 1.2.3 resolution: "bl@npm:1.2.3" @@ -3584,6 +3616,16 @@ __metadata: languageName: node linkType: hard +"cron@npm:*, cron@npm:^2.0.0": + version: 2.4.3 + resolution: "cron@npm:2.4.3" + dependencies: + "@types/luxon": "npm:~3.3.0" + luxon: "npm:~3.3.0" + checksum: cb0ad49653b37ba125f8670ca92150ce515493512b1b8a5e08086d22bec9c54dc6d8926fcdb49ea5783f6699862ca5fdc532a440ce33c3228f9b3d565010db2f + languageName: node + linkType: hard + "cross-fetch@npm:3.0.6": version: 3.0.6 resolution: "cross-fetch@npm:3.0.6" @@ -4533,6 +4575,26 @@ __metadata: languageName: node linkType: hard +"fastify-cron@npm:^1.3.1": + version: 1.3.1 + resolution: "fastify-cron@npm:1.3.1" + dependencies: + "@types/cron": "npm:^2.0.0" + cron: "npm:^2.0.0" + fastify-plugin: "npm:^3.0.0" + peerDependencies: + fastify: ^4.1.0 + checksum: 152cc6bfe9ebd347747d922533e49b9ee0528d1c22677858046615a7bbae07166af7fd4f126c00f0c6d380aca33da6fa91f572c24cb586107753b03ab16392f9 + languageName: node + linkType: hard + +"fastify-plugin@npm:^3.0.0": + version: 3.0.1 + resolution: "fastify-plugin@npm:3.0.1" + checksum: 131ba0a388f777829c3fb0fd5b75cf057688ce6d0ca354fb1ebf829767a8c853b0825762b9185b5200097454df0ede2f3095da2efe1aa1b3736d07f194e6d374 + languageName: node + linkType: hard + "fastify-plugin@npm:^4.0.0": version: 4.5.1 resolution: "fastify-plugin@npm:4.5.1" @@ -5915,6 +5977,13 @@ __metadata: languageName: node linkType: hard +"luxon@npm:~3.3.0": + version: 3.3.0 + resolution: "luxon@npm:3.3.0" + checksum: 50cf17a0dc155c3dcacbeae8c0b7e80db425e0ba97b9cbdf12a7fc142d841ff1ab1560919f033af46240ed44e2f70c49f76e3422524c7fc8bb8d81ca47c66187 + languageName: node + linkType: hard + "make-dir@npm:^1.0.0, make-dir@npm:^1.2.0": version: 1.3.0 resolution: "make-dir@npm:1.3.0" @@ -7005,6 +7074,16 @@ __metadata: languageName: node linkType: hard +"prom-client@npm:^15.0.0": + version: 15.0.0 + resolution: "prom-client@npm:15.0.0" + dependencies: + "@opentelemetry/api": ^1.4.0 + tdigest: ^0.1.1 + checksum: a447cc4c7d87e610f9ed9c018dcbe759f06d32b6c3d401d90cafa6b15feee54e0ec5d0ee1d4925db905ea35c6e894be842de25e6bc0b5d415147a0b714c248f8 + languageName: node + linkType: hard + "promise-retry@npm:^2.0.1": version: 2.0.1 resolution: "promise-retry@npm:2.0.1" @@ -7926,6 +8005,15 @@ __metadata: languageName: node linkType: hard +"tdigest@npm:^0.1.1": + version: 0.1.2 + resolution: "tdigest@npm:0.1.2" + dependencies: + bintrees: "npm:1.0.2" + checksum: 44de8246752b6f8c2924685f969fd3d94c36949f22b0907e99bef2b2220726dd8467f4730ea96b06040b9aa2587c0866049640039d1b956952dfa962bc2075a3 + languageName: node + linkType: hard + "term-size@npm:^2.2.1": version: 2.2.1 resolution: "term-size@npm:2.2.1" diff --git a/tests/distributor-oracle.ts b/tests/distributor-oracle.ts index 8223c5ccd..67f543e89 100644 --- a/tests/distributor-oracle.ts +++ b/tests/distributor-oracle.ts @@ -97,6 +97,10 @@ export class DatabaseMock implements Database { }; } + async getTotalRewards() { + return "0" + } + async getCurrentRewardsByEntity(entityKey: string): Promise { const pubkey = Address.fromB58(entityKey); return Math.floor( diff --git a/yarn.lock b/yarn.lock index 894b768d6..6b1a24f42 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1179,10 +1179,12 @@ __metadata: cors: ^2.8.5 dotenv: ^16.0.3 fastify: ^4.13.0 + fastify-cron: ^1.3.1 git-format-staged: ^2.1.3 ky: ^0.31.4 nodemon: ^2.0.20 pg: ^8.9.0 + prom-client: ^15.0.0 sequelize: ^6.28.0 ts-loader: ^9.2.3 ts-node: ^10.9.1 @@ -1638,21 +1640,28 @@ __metadata: "@helium/helium-entity-manager-sdk": ^0.6.5 "@helium/helium-sub-daos-sdk": ^0.6.5 "@helium/idls": ^0.6.5 + "@helium/lazy-distributor-sdk": ^0.6.5 "@helium/lazy-transactions-sdk": ^0.6.5 "@helium/spl-utils": ^0.6.5 + "@metaplex-foundation/mpl-bubblegum": ^3.0.0 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-account-compression": ^0.1.7 "@solana/spl-token": ^0.3.8 "@solana/web3.js": ^1.78.4 "@types/bn.js": ^5.1.1 + "@types/pg": ^8.10.9 + aws-sdk: ^2.1516.0 axios: ^1.3.6 bn.js: ^5.2.0 bs58: ^4.0.1 cli-progress: ^3.12.0 + dotenv: ^16.3.1 fastify: ^4.13.0 git-format-staged: ^2.1.3 inflection: ^2.0.1 + pg: ^8.11.3 prom-client: ^14.2.0 + sequelize: ^6.35.2 ts-loader: ^9.2.3 ts-node: ^10.9.1 ts-node-dev: ^2.0.0 @@ -2939,6 +2948,15 @@ __metadata: languageName: node linkType: hard +"@metaplex-foundation/digital-asset-standard-api@npm:^1.0.0-alpha.0": + version: 1.0.0 + resolution: "@metaplex-foundation/digital-asset-standard-api@npm:1.0.0" + peerDependencies: + "@metaplex-foundation/umi": ^0.8.2 + checksum: f881c38145aad093efffea011b06b1fc68495dfe8bf10299811a6d3a15bac74e24af396a248f3307ff93d644cc1a64d4ee05bc933a30cc402b37dccbbacde43f + languageName: node + linkType: hard + "@metaplex-foundation/js@npm:^0.19.4": version: 0.19.4 resolution: "@metaplex-foundation/js@npm:0.19.4" @@ -3018,6 +3036,21 @@ __metadata: languageName: node linkType: hard +"@metaplex-foundation/mpl-bubblegum@npm:^3.0.0": + version: 3.0.0 + resolution: "@metaplex-foundation/mpl-bubblegum@npm:3.0.0" + dependencies: + "@metaplex-foundation/digital-asset-standard-api": ^1.0.0-alpha.0 + "@metaplex-foundation/mpl-token-metadata": 3.0.0-alpha.27 + "@metaplex-foundation/mpl-toolbox": ^0.9.0 + "@noble/hashes": ^1.3.1 + merkletreejs: ^0.3.9 + peerDependencies: + "@metaplex-foundation/umi": ^0.8.9 + checksum: 61ed8366608b11939bf6f4c701d1c3de0025ba71328700ad5187bea558c9ca5ba818b58a76728f9b473ea93552b2480f14ac7b7d68b934e36c56d88ce888f659 + languageName: node + linkType: hard + "@metaplex-foundation/mpl-candy-guard@npm:^0.3.0": version: 0.3.2 resolution: "@metaplex-foundation/mpl-candy-guard@npm:0.3.2" @@ -3057,6 +3090,17 @@ __metadata: languageName: node linkType: hard +"@metaplex-foundation/mpl-token-metadata@npm:3.0.0-alpha.27": + version: 3.0.0-alpha.27 + resolution: "@metaplex-foundation/mpl-token-metadata@npm:3.0.0-alpha.27" + dependencies: + "@metaplex-foundation/mpl-toolbox": ^0.9.0 + peerDependencies: + "@metaplex-foundation/umi": ^0.8.2 + checksum: ec79071615b418a4efcfac50616dc6a873f6a827589a5c83990e68e8aa3617813893f8574268cdd53d0cb0330997a979913494ee2e1a722b7716f5536dd579a4 + languageName: node + linkType: hard + "@metaplex-foundation/mpl-token-metadata@npm:^2.10.0, @metaplex-foundation/mpl-token-metadata@npm:^2.11.0, @metaplex-foundation/mpl-token-metadata@npm:^2.5.2": version: 2.13.0 resolution: "@metaplex-foundation/mpl-token-metadata@npm:2.13.0" @@ -3072,6 +3116,15 @@ __metadata: languageName: node linkType: hard +"@metaplex-foundation/mpl-toolbox@npm:^0.9.0": + version: 0.9.1 + resolution: "@metaplex-foundation/mpl-toolbox@npm:0.9.1" + peerDependencies: + "@metaplex-foundation/umi": ^0.8.2 + checksum: d2bb9bed47fdba70f9a16b18113f3e4dbe7d7a52a36926bd55511c9c3f4c10d5847620dfd48c20c64e7904f187073e381e78d03bf1001ae13c1204693236129d + languageName: node + linkType: hard + "@mischnic/json-sourcemap@npm:^0.1.0": version: 0.1.0 resolution: "@mischnic/json-sourcemap@npm:0.1.0" @@ -3800,6 +3853,13 @@ __metadata: languageName: node linkType: hard +"@opentelemetry/api@npm:^1.4.0": + version: 1.7.0 + resolution: "@opentelemetry/api@npm:1.7.0" + checksum: 2398cbe65f199c3a7050125b3ad9c835f789bb0a616665e9c7f4475a29ac8334b6a3c15f38db48d345b522180c41c00b04cc174cd0eeffba98eb4874a565fa7e + languageName: node + linkType: hard + "@parcel/bundler-default@npm:2.9.3": version: 2.9.3 resolution: "@parcel/bundler-default@npm:2.9.3" @@ -5604,6 +5664,17 @@ __metadata: languageName: node linkType: hard +"@types/pg@npm:^8.10.9": + version: 8.10.9 + resolution: "@types/pg@npm:8.10.9" + dependencies: + "@types/node": "*" + pg-protocol: "*" + pg-types: ^4.0.1 + checksum: c0c750af1f0945fe31c2793931da33bf596476ec8b52babfdb20f61006570c1c6c7f62f2dedd0cb9aefd2cddab238f2ed279337d3b2aa734ddd1ee8958e2355e + languageName: node + linkType: hard + "@types/pg@npm:^8.6.6": version: 8.10.2 resolution: "@types/pg@npm:8.10.2" @@ -6395,6 +6466,24 @@ __metadata: languageName: node linkType: hard +"aws-sdk@npm:^2.1516.0": + version: 2.1516.0 + resolution: "aws-sdk@npm:2.1516.0" + dependencies: + buffer: 4.9.2 + events: 1.1.1 + ieee754: 1.1.13 + jmespath: 0.16.0 + querystring: 0.2.0 + sax: 1.2.1 + url: 0.10.3 + util: ^0.12.4 + uuid: 8.0.0 + xml2js: 0.5.0 + checksum: 394b20e19c13fc579cf9b75cc1b640d7668196f292fc548863050ca9912ad241b3ef4c39d29c58a65add36b330233677c14e2d8261e78b4afcefca5108180f49 + languageName: node + linkType: hard + "axios-retry@npm:^3.8.0": version: 3.8.0 resolution: "axios-retry@npm:3.8.0" @@ -7723,6 +7812,13 @@ __metadata: languageName: node linkType: hard +"crypto-js@npm:^4.2.0": + version: 4.2.0 + resolution: "crypto-js@npm:4.2.0" + checksum: f051666dbc077c8324777f44fbd3aaea2986f198fe85092535130d17026c7c2ccf2d23ee5b29b36f7a4a07312db2fae23c9094b644cc35f7858b1b4fcaf27774 + languageName: node + linkType: hard + "css-select@npm:^4.1.3": version: 4.3.0 resolution: "css-select@npm:4.3.0" @@ -11824,6 +11920,19 @@ __metadata: languageName: node linkType: hard +"merkletreejs@npm:^0.3.9": + version: 0.3.11 + resolution: "merkletreejs@npm:0.3.11" + dependencies: + bignumber.js: ^9.0.1 + buffer-reverse: ^1.0.1 + crypto-js: ^4.2.0 + treeify: ^1.1.0 + web3-utils: ^1.3.4 + checksum: 93edb8ec66aa6c9f59aa0902e675590e3791692893bb3e8c1018f758367ded1bf7d6b1057ccde3729b283ca946a316838a631a922960b76889b3be528c43ef4e + languageName: node + linkType: hard + "methods@npm:^1.1.2, methods@npm:~1.1.2": version: 1.1.2 resolution: "methods@npm:1.1.2" @@ -13784,6 +13893,16 @@ __metadata: languageName: node linkType: hard +"prom-client@npm:^15.0.0": + version: 15.0.0 + resolution: "prom-client@npm:15.0.0" + dependencies: + "@opentelemetry/api": ^1.4.0 + tdigest: ^0.1.1 + checksum: a447cc4c7d87e610f9ed9c018dcbe759f06d32b6c3d401d90cafa6b15feee54e0ec5d0ee1d4925db905ea35c6e894be842de25e6bc0b5d415147a0b714c248f8 + languageName: node + linkType: hard + "promise-all-reject-late@npm:^1.0.0": version: 1.0.1 resolution: "promise-all-reject-late@npm:1.0.1" @@ -14788,6 +14907,49 @@ __metadata: languageName: node linkType: hard +"sequelize@npm:^6.35.2": + version: 6.35.2 + resolution: "sequelize@npm:6.35.2" + dependencies: + "@types/debug": ^4.1.8 + "@types/validator": ^13.7.17 + debug: ^4.3.4 + dottie: ^2.0.6 + inflection: ^1.13.4 + lodash: ^4.17.21 + moment: ^2.29.4 + moment-timezone: ^0.5.43 + pg-connection-string: ^2.6.1 + retry-as-promised: ^7.0.4 + semver: ^7.5.4 + sequelize-pool: ^7.1.0 + toposort-class: ^1.0.1 + uuid: ^8.3.2 + validator: ^13.9.0 + wkx: ^0.5.0 + peerDependenciesMeta: + ibm_db: + optional: true + mariadb: + optional: true + mysql2: + optional: true + oracledb: + optional: true + pg: + optional: true + pg-hstore: + optional: true + snowflake-sdk: + optional: true + sqlite3: + optional: true + tedious: + optional: true + checksum: 9d0842a08725d5db538b02f549e4962301d35715bb1f45d2909b273299510d9071ba26d190381e307887ec0f4648ec32239ad6d6005e90ce562585b7bc23a159 + languageName: node + linkType: hard + "serialize-javascript@npm:6.0.0": version: 6.0.0 resolution: "serialize-javascript@npm:6.0.0"