diff --git a/api/src/db/networkRevenueProvider.ts b/api/src/db/networkRevenueProvider.ts index 773cf367a..33240b502 100644 --- a/api/src/db/networkRevenueProvider.ts +++ b/api/src/db/networkRevenueProvider.ts @@ -12,7 +12,7 @@ export const getWeb3IndexRevenue = async (debug?: boolean) => { date: r.date.getTime() / 1000, revenue: round(r.usd, 2), revenueUAkt: r.uakt, - revenueUUsdc: r.uusdc,// TODO: Include in web3index? Maybe should only include akt spending + revenueUUsdc: r.uusdc, aktPrice: r.aktPrice, dateStr: r.date })); @@ -61,34 +61,41 @@ export const getWeb3IndexRevenue = async (debug?: boolean) => { if (date <= sixtyDaysAgo) { sixtyDaysAgoRevenue += b.revenue; sixtyDaysAgoRevenueUAkt += b.revenueUAkt; + sixtyDaysAgoRevenueUUsdc += b.revenueUUsdc; } if (date <= thirtyDaysAgo) { thirtyDaysAgoRevenue += b.revenue; thirtyDaysAgoRevenueUAkt += b.revenueUAkt; + thirtyDaysAgoRevenueUUsdc += b.revenueUUsdc; } if (date <= twoWeeksAgo) { twoWeeksAgoRevenue += b.revenue; twoWeeksAgoRevenueUAkt += b.revenueUAkt; + twoWeeksAgoRevenueUUsdc += b.revenueUUsdc; } if (date <= oneWeekAgo) { oneWeekAgoRevenue += b.revenue; oneWeekAgoRevenueUAkt += b.revenueUAkt; + oneWeekAgoRevenueUUsdc += b.revenueUUsdc; } if (date <= twoDaysAgo) { twoDaysAgoRevenue += b.revenue; twoDaysAgoRevenueUAkt += b.revenueUAkt; + twoDaysAgoRevenueUUsdc += b.revenueUUsdc; } if (date <= oneDayAgo) { oneDayAgoRevenue += b.revenue; oneDayAgoRevenueUAkt += b.revenueUAkt; + oneDayAgoRevenueUUsdc += b.revenueUUsdc; } totalRevenue += b.revenue; totalRevenueUAkt += b.revenueUAkt; + totalRevenueUUsdc += b.revenueUUsdc; }, 0); if (!debug) { - days = days.map(({ dateStr, revenueUAkt, aktPrice, ...others }) => others) as any; + days = days.map(({ dateStr, revenueUAkt, revenueUUsdc, aktPrice, ...others }) => others) as any; } let revenueStats = { @@ -112,7 +119,15 @@ export const getWeb3IndexRevenue = async (debug?: boolean) => { twoWeeksAgAkt: uaktToAKT(twoWeeksAgoRevenueUAkt, 6), thirtyDaysAgoAkt: uaktToAKT(thirtyDaysAgoRevenueUAkt, 6), sixtyDaysAgoAkt: uaktToAKT(sixtyDaysAgoRevenueUAkt, 6), - ninetyDaysAgoAkt: uaktToAKT(ninetyDaysAgoRevenueUAkt, 6) + ninetyDaysAgoAkt: uaktToAKT(ninetyDaysAgoRevenueUAkt, 6), + nowUsdc: udenomToDenom(totalRevenueUUsdc, 6), + oneDayAgoUsdc: udenomToDenom(oneDayAgoRevenueUUsdc, 6), + twoDaysAgoUsdc: udenomToDenom(twoDaysAgoRevenueUUsdc, 6), + oneWeekAgoUsdc: udenomToDenom(oneWeekAgoRevenueUUsdc, 6), + twoWeeksAgUsdc: udenomToDenom(twoWeeksAgoRevenueUUsdc, 6), + thirtyDaysAgoUsdc: udenomToDenom(thirtyDaysAgoRevenueUUsdc, 6), + sixtyDaysAgoUsdc: udenomToDenom(sixtyDaysAgoRevenueUUsdc, 6), + ninetyDaysAgoUsdc: udenomToDenom(ninetyDaysAgoRevenueUUsdc, 6) } as any; } @@ -163,9 +178,8 @@ export async function getDailyRevenue() { date: x.date, uakt: x.uakt, akt: uaktToAKT(x.uakt, 6), - aktInUsd: uaktToAKT(x.uakt, 6) * x.aktPrice, uusdc: x.uusdc, - usdc: udenomToDenom(x.uusdc), + usdc: udenomToDenom(x.uusdc, 6), usd: uaktToAKT(x.uakt, 6) * x.aktPrice + udenomToDenom(x.uusdc), aktPrice: x.aktPrice })); diff --git a/deploy-web/src/pages/graph/[snapshot].tsx b/deploy-web/src/pages/graph/[snapshot].tsx index 281b3ee3d..e7a07d3e0 100644 --- a/deploy-web/src/pages/graph/[snapshot].tsx +++ b/deploy-web/src/pages/graph/[snapshot].tsx @@ -185,6 +185,8 @@ const getSnapshotMetadata = (snapshot: Snapshots): { unitFn: (number) => ISnapsh case Snapshots.totalUAktSpent: case Snapshots.dailyUUsdcSpent: case Snapshots.totalUUsdcSpent: + case Snapshots.dailyUUsdSpent: + case Snapshots.totalUUsdSpent: return { unitFn: x => ({ value: udenomToDenom(x) }) }; case Snapshots.activeCPU: return { @@ -223,6 +225,8 @@ const getTitle = (snapshot: Snapshots): string => { return "Total AKT spent"; case Snapshots.totalUUsdcSpent: return "Total USDC spent"; + case Snapshots.totalUUsdSpent: + return "Total USD spent"; case Snapshots.totalLeaseCount: return "All-time lease count"; case Snapshots.activeCPU: @@ -237,6 +241,8 @@ const getTitle = (snapshot: Snapshots): string => { return "Daily AKT spent"; case Snapshots.dailyUUsdcSpent: return "Daily USDC spent"; + case Snapshots.dailyUUsdSpent: + return "Daily USD spent"; case Snapshots.dailyLeaseCount: return "Daily new leases"; diff --git a/deploy-web/src/types/snapshots.ts b/deploy-web/src/types/snapshots.ts index ee000ac30..a08657c1b 100644 --- a/deploy-web/src/types/snapshots.ts +++ b/deploy-web/src/types/snapshots.ts @@ -2,7 +2,7 @@ export enum Snapshots { activeLeaseCount = "activeLeaseCount", totalUAktSpent = "totalUAktSpent", totalUUsdcSpent = "totalUUsdcSpent", - totalUsdSpent = "totalUUsdSpent", + totalUUsdSpent = "totalUUsdSpent", totalLeaseCount = "totalLeaseCount", activeCPU = "activeCPU", activeGPU = "activeGPU", diff --git a/deploy-web/src/utils/snapshotsUrlHelpers.ts b/deploy-web/src/utils/snapshotsUrlHelpers.ts index d40d91817..e5321acc3 100644 --- a/deploy-web/src/utils/snapshotsUrlHelpers.ts +++ b/deploy-web/src/utils/snapshotsUrlHelpers.ts @@ -12,8 +12,10 @@ export const urlParamToSnapshot = (snapshotsUrlParam: SnapshotsUrlParam) => { [SnapshotsUrlParam.storage]: Snapshots.activeStorage, [SnapshotsUrlParam.totalAKTSpent]: Snapshots.totalUAktSpent, [SnapshotsUrlParam.totalUSDCSpent]: Snapshots.totalUUsdcSpent, + [SnapshotsUrlParam.totalUSDSpent]: Snapshots.totalUUsdSpent, [SnapshotsUrlParam.dailyAktSpent]: Snapshots.dailyUAktSpent, [SnapshotsUrlParam.dailyUsdcSpent]: Snapshots.dailyUUsdcSpent, + [SnapshotsUrlParam.dailyUsdSpent]: Snapshots.dailyUUsdSpent, [SnapshotsUrlParam.dailyDeploymentCount]: Snapshots.dailyLeaseCount }; diff --git a/indexer/package-lock.json b/indexer/package-lock.json index 1e7fd18b5..b3aad07a6 100644 --- a/indexer/package-lock.json +++ b/indexer/package-lock.json @@ -10,11 +10,11 @@ "license": "Apache-2.0", "dependencies": { "@akashnetwork/akashjs": "0.4.11", - "@cosmjs/crypto": "^0.29.5", - "@cosmjs/encoding": "^0.29.5", - "@cosmjs/math": "^0.29.5", - "@cosmjs/proto-signing": "^0.29.5", - "@cosmjs/stargate": "^0.29.5", + "@cosmjs/crypto": "^0.31.1", + "@cosmjs/encoding": "^0.31.1", + "@cosmjs/math": "^0.31.1", + "@cosmjs/proto-signing": "^0.31.1", + "@cosmjs/stargate": "^0.31.1", "@sentry/node": "^7.52.0", "async": "^3.2.4", "axios": "^0.27.2", @@ -2764,28 +2764,28 @@ } }, "node_modules/@cosmjs/crypto": { - "version": "0.29.5", - "resolved": "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.29.5.tgz", - "integrity": "sha512-2bKkaLGictaNL0UipQCL6C1afaisv6k8Wr/GCLx9FqiyFkh9ZgRHDyetD64ZsjnWV/N/D44s/esI+k6oPREaiQ==", + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.31.1.tgz", + "integrity": "sha512-4R/SqdzdVzd4E5dpyEh1IKm5GbTqwDogutyIyyb1bcOXiX/x3CrvPI9Tb4WSIMDLvlb5TVzu2YnUV51Q1+6mMA==", "dependencies": { - "@cosmjs/encoding": "^0.29.5", - "@cosmjs/math": "^0.29.5", - "@cosmjs/utils": "^0.29.5", + "@cosmjs/encoding": "^0.31.1", + "@cosmjs/math": "^0.31.1", + "@cosmjs/utils": "^0.31.1", "@noble/hashes": "^1", "bn.js": "^5.2.0", "elliptic": "^6.5.4", - "libsodium-wrappers": "^0.7.6" + "libsodium-wrappers-sumo": "^0.7.11" } }, "node_modules/@cosmjs/crypto/node_modules/@cosmjs/utils": { - "version": "0.29.5", - "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.29.5.tgz", - "integrity": "sha512-m7h+RXDUxOzEOGt4P+3OVPX7PuakZT3GBmaM/Y2u+abN3xZkziykD/NvedYFvvCCdQo714XcGl33bwifS9FZPQ==" + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.31.1.tgz", + "integrity": "sha512-n4Se1wu4GnKwztQHNFfJvUeWcpvx3o8cWhSbNs9JQShEuB3nv3R5lqFBtDCgHZF/emFQAP+ZjF8bTfCs9UBGhA==" }, "node_modules/@cosmjs/encoding": { - "version": "0.29.5", - "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.29.5.tgz", - "integrity": "sha512-G4rGl/Jg4dMCw5u6PEZHZcoHnUBlukZODHbm/wcL4Uu91fkn5jVo5cXXZcvs4VCkArVGrEj/52eUgTZCmOBGWQ==", + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.31.1.tgz", + "integrity": "sha512-IuxP6ewwX6vg9sUJ8ocJD92pkerI4lyG8J5ynAM3NaX3q+n+uMoPRSQXNeL9bnlrv01FF1kIm8if/f5F7ZPtkA==", "dependencies": { "base64-js": "^1.3.0", "bech32": "^1.1.4", @@ -2937,51 +2937,42 @@ } }, "node_modules/@cosmjs/math": { - "version": "0.29.5", - "resolved": "https://registry.npmjs.org/@cosmjs/math/-/math-0.29.5.tgz", - "integrity": "sha512-2GjKcv+A9f86MAWYLUkjhw1/WpRl2R1BTb3m9qPG7lzMA7ioYff9jY5SPCfafKdxM4TIQGxXQlYGewQL16O68Q==", + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/math/-/math-0.31.1.tgz", + "integrity": "sha512-kiuHV6m6DSB8/4UV1qpFhlc4ul8SgLXTGRlYkYiIIP4l0YNeJ+OpPYaOlEgx4Unk2mW3/O2FWYj7Jc93+BWXng==", "dependencies": { "bn.js": "^5.2.0" } }, "node_modules/@cosmjs/proto-signing": { - "version": "0.29.5", - "resolved": "https://registry.npmjs.org/@cosmjs/proto-signing/-/proto-signing-0.29.5.tgz", - "integrity": "sha512-QRrS7CiKaoETdgIqvi/7JC2qCwCR7lnWaUsTzh/XfRy3McLkEd+cXbKAW3cygykv7IN0VAEIhZd2lyIfT8KwNA==", - "dependencies": { - "@cosmjs/amino": "^0.29.5", - "@cosmjs/crypto": "^0.29.5", - "@cosmjs/encoding": "^0.29.5", - "@cosmjs/math": "^0.29.5", - "@cosmjs/utils": "^0.29.5", - "cosmjs-types": "^0.5.2", + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/proto-signing/-/proto-signing-0.31.1.tgz", + "integrity": "sha512-hipbBVrssPu+jnmRzQRP5hhS/mbz2nU7RvxG/B1ZcdNhr1AtZC5DN09OTUoEpMSRgyQvScXmk/NTbyf+xmCgYg==", + "dependencies": { + "@cosmjs/amino": "^0.31.1", + "@cosmjs/crypto": "^0.31.1", + "@cosmjs/encoding": "^0.31.1", + "@cosmjs/math": "^0.31.1", + "@cosmjs/utils": "^0.31.1", + "cosmjs-types": "^0.8.0", "long": "^4.0.0" } }, "node_modules/@cosmjs/proto-signing/node_modules/@cosmjs/amino": { - "version": "0.29.5", - "resolved": "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.29.5.tgz", - "integrity": "sha512-Qo8jpC0BiziTSUqpkNatBcwtKNhCovUnFul9SlT/74JUCdLYaeG5hxr3q1cssQt++l4LvlcpF+OUXL48XjNjLw==", + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.31.1.tgz", + "integrity": "sha512-kkB9IAkNEUFtjp/uwHv95TgM8VGJ4VWfZwrTyLNqBDD1EpSX2dsNrmUe7k8OMPzKlZUFcKmD4iA0qGvIwzjbGA==", "dependencies": { - "@cosmjs/crypto": "^0.29.5", - "@cosmjs/encoding": "^0.29.5", - "@cosmjs/math": "^0.29.5", - "@cosmjs/utils": "^0.29.5" + "@cosmjs/crypto": "^0.31.1", + "@cosmjs/encoding": "^0.31.1", + "@cosmjs/math": "^0.31.1", + "@cosmjs/utils": "^0.31.1" } }, "node_modules/@cosmjs/proto-signing/node_modules/@cosmjs/utils": { - "version": "0.29.5", - "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.29.5.tgz", - "integrity": "sha512-m7h+RXDUxOzEOGt4P+3OVPX7PuakZT3GBmaM/Y2u+abN3xZkziykD/NvedYFvvCCdQo714XcGl33bwifS9FZPQ==" - }, - "node_modules/@cosmjs/proto-signing/node_modules/cosmjs-types": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/cosmjs-types/-/cosmjs-types-0.5.2.tgz", - "integrity": "sha512-zxCtIJj8v3Di7s39uN4LNcN3HIE1z0B9Z0SPE8ZNQR0oSzsuSe1ACgxoFkvhkS7WBasCAFcglS11G2hyfd5tPg==", - "dependencies": { - "long": "^4.0.0", - "protobufjs": "~6.11.2" - } + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.31.1.tgz", + "integrity": "sha512-n4Se1wu4GnKwztQHNFfJvUeWcpvx3o8cWhSbNs9JQShEuB3nv3R5lqFBtDCgHZF/emFQAP+ZjF8bTfCs9UBGhA==" }, "node_modules/@cosmjs/socket": { "version": "0.28.13", @@ -2995,84 +2986,84 @@ } }, "node_modules/@cosmjs/stargate": { - "version": "0.29.5", - "resolved": "https://registry.npmjs.org/@cosmjs/stargate/-/stargate-0.29.5.tgz", - "integrity": "sha512-hjEv8UUlJruLrYGJcUZXM/CziaINOKwfVm2BoSdUnNTMxGvY/jC1ABHKeZUYt9oXHxEJ1n9+pDqzbKc8pT0nBw==", + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/stargate/-/stargate-0.31.1.tgz", + "integrity": "sha512-TqOJZYOH5W3sZIjR6949GfjhGXO3kSHQ3/KmE+SuKyMMmQ5fFZ45beawiRtVF0/CJg5RyPFyFGJKhb1Xxv3Lcg==", "dependencies": { "@confio/ics23": "^0.6.8", - "@cosmjs/amino": "^0.29.5", - "@cosmjs/encoding": "^0.29.5", - "@cosmjs/math": "^0.29.5", - "@cosmjs/proto-signing": "^0.29.5", - "@cosmjs/stream": "^0.29.5", - "@cosmjs/tendermint-rpc": "^0.29.5", - "@cosmjs/utils": "^0.29.5", - "cosmjs-types": "^0.5.2", + "@cosmjs/amino": "^0.31.1", + "@cosmjs/encoding": "^0.31.1", + "@cosmjs/math": "^0.31.1", + "@cosmjs/proto-signing": "^0.31.1", + "@cosmjs/stream": "^0.31.1", + "@cosmjs/tendermint-rpc": "^0.31.1", + "@cosmjs/utils": "^0.31.1", + "cosmjs-types": "^0.8.0", "long": "^4.0.0", "protobufjs": "~6.11.3", "xstream": "^11.14.0" } }, "node_modules/@cosmjs/stargate/node_modules/@cosmjs/amino": { - "version": "0.29.5", - "resolved": "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.29.5.tgz", - "integrity": "sha512-Qo8jpC0BiziTSUqpkNatBcwtKNhCovUnFul9SlT/74JUCdLYaeG5hxr3q1cssQt++l4LvlcpF+OUXL48XjNjLw==", + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.31.1.tgz", + "integrity": "sha512-kkB9IAkNEUFtjp/uwHv95TgM8VGJ4VWfZwrTyLNqBDD1EpSX2dsNrmUe7k8OMPzKlZUFcKmD4iA0qGvIwzjbGA==", "dependencies": { - "@cosmjs/crypto": "^0.29.5", - "@cosmjs/encoding": "^0.29.5", - "@cosmjs/math": "^0.29.5", - "@cosmjs/utils": "^0.29.5" + "@cosmjs/crypto": "^0.31.1", + "@cosmjs/encoding": "^0.31.1", + "@cosmjs/math": "^0.31.1", + "@cosmjs/utils": "^0.31.1" } }, "node_modules/@cosmjs/stargate/node_modules/@cosmjs/json-rpc": { - "version": "0.29.5", - "resolved": "https://registry.npmjs.org/@cosmjs/json-rpc/-/json-rpc-0.29.5.tgz", - "integrity": "sha512-C78+X06l+r9xwdM1yFWIpGl03LhB9NdM1xvZpQHwgCOl0Ir/WV8pw48y3Ez2awAoUBRfTeejPe4KvrE6NoIi/w==", + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/json-rpc/-/json-rpc-0.31.1.tgz", + "integrity": "sha512-gIkCj2mUDHAxvmJnHtybXtMLZDeXrkDZlujjzhvJlWsIuj1kpZbKtYqh+eNlfwhMkMMAlQa/y4422jDmizW+ng==", "dependencies": { - "@cosmjs/stream": "^0.29.5", + "@cosmjs/stream": "^0.31.1", "xstream": "^11.14.0" } }, "node_modules/@cosmjs/stargate/node_modules/@cosmjs/socket": { - "version": "0.29.5", - "resolved": "https://registry.npmjs.org/@cosmjs/socket/-/socket-0.29.5.tgz", - "integrity": "sha512-5VYDupIWbIXq3ftPV1LkS5Ya/T7Ol/AzWVhNxZ79hPe/mBfv1bGau/LqIYOm2zxGlgm9hBHOTmWGqNYDwr9LNQ==", + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/socket/-/socket-0.31.1.tgz", + "integrity": "sha512-XTtEr+x3WGbqkzoGX0sCkwVqf5n+bBqDwqNgb+DWaBABQxHVRuuainrTVp0Yc91D3Iy2twLQzeBA9OrRxDSerw==", "dependencies": { - "@cosmjs/stream": "^0.29.5", + "@cosmjs/stream": "^0.31.1", "isomorphic-ws": "^4.0.1", "ws": "^7", "xstream": "^11.14.0" } }, "node_modules/@cosmjs/stargate/node_modules/@cosmjs/stream": { - "version": "0.29.5", - "resolved": "https://registry.npmjs.org/@cosmjs/stream/-/stream-0.29.5.tgz", - "integrity": "sha512-TToTDWyH1p05GBtF0Y8jFw2C+4783ueDCmDyxOMM6EU82IqpmIbfwcdMOCAm0JhnyMh+ocdebbFvnX/sGKzRAA==", + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/stream/-/stream-0.31.1.tgz", + "integrity": "sha512-xsIGD9bpBvYYZASajCyOevh1H5pDdbOWmvb4UwGZ78doGVz3IC3Kb9BZKJHIX2fjq9CMdGVJHmlM+Zp5aM8yZA==", "dependencies": { "xstream": "^11.14.0" } }, "node_modules/@cosmjs/stargate/node_modules/@cosmjs/tendermint-rpc": { - "version": "0.29.5", - "resolved": "https://registry.npmjs.org/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.29.5.tgz", - "integrity": "sha512-ar80twieuAxsy0x2za/aO3kBr2DFPAXDmk2ikDbmkda+qqfXgl35l9CVAAjKRqd9d+cRvbQyb5M4wy6XQpEV6w==", - "dependencies": { - "@cosmjs/crypto": "^0.29.5", - "@cosmjs/encoding": "^0.29.5", - "@cosmjs/json-rpc": "^0.29.5", - "@cosmjs/math": "^0.29.5", - "@cosmjs/socket": "^0.29.5", - "@cosmjs/stream": "^0.29.5", - "@cosmjs/utils": "^0.29.5", + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.31.1.tgz", + "integrity": "sha512-KX+wwi725sSePqIxfMPPOqg+xTETV8BHGOBhRhCZXEl5Fq48UlXXq3/yG1sn7K67ADC0kqHqcCF41Wn1GxNNPA==", + "dependencies": { + "@cosmjs/crypto": "^0.31.1", + "@cosmjs/encoding": "^0.31.1", + "@cosmjs/json-rpc": "^0.31.1", + "@cosmjs/math": "^0.31.1", + "@cosmjs/socket": "^0.31.1", + "@cosmjs/stream": "^0.31.1", + "@cosmjs/utils": "^0.31.1", "axios": "^0.21.2", "readonly-date": "^1.0.0", "xstream": "^11.14.0" } }, "node_modules/@cosmjs/stargate/node_modules/@cosmjs/utils": { - "version": "0.29.5", - "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.29.5.tgz", - "integrity": "sha512-m7h+RXDUxOzEOGt4P+3OVPX7PuakZT3GBmaM/Y2u+abN3xZkziykD/NvedYFvvCCdQo714XcGl33bwifS9FZPQ==" + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.31.1.tgz", + "integrity": "sha512-n4Se1wu4GnKwztQHNFfJvUeWcpvx3o8cWhSbNs9JQShEuB3nv3R5lqFBtDCgHZF/emFQAP+ZjF8bTfCs9UBGhA==" }, "node_modules/@cosmjs/stargate/node_modules/axios": { "version": "0.21.4", @@ -3082,15 +3073,6 @@ "follow-redirects": "^1.14.0" } }, - "node_modules/@cosmjs/stargate/node_modules/cosmjs-types": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/cosmjs-types/-/cosmjs-types-0.5.2.tgz", - "integrity": "sha512-zxCtIJj8v3Di7s39uN4LNcN3HIE1z0B9Z0SPE8ZNQR0oSzsuSe1ACgxoFkvhkS7WBasCAFcglS11G2hyfd5tPg==", - "dependencies": { - "long": "^4.0.0", - "protobufjs": "~6.11.2" - } - }, "node_modules/@cosmjs/stream": { "version": "0.28.13", "resolved": "https://registry.npmjs.org/@cosmjs/stream/-/stream-0.28.13.tgz", @@ -11916,6 +11898,11 @@ "resolved": "https://registry.npmjs.org/libsodium/-/libsodium-0.7.10.tgz", "integrity": "sha512-eY+z7hDrDKxkAK+QKZVNv92A5KYkxfvIshtBJkmg5TSiCnYqZP3i9OO9whE79Pwgm4jGaoHgkM4ao/b9Cyu4zQ==" }, + "node_modules/libsodium-sumo": { + "version": "0.7.11", + "resolved": "https://registry.npmjs.org/libsodium-sumo/-/libsodium-sumo-0.7.11.tgz", + "integrity": "sha512-bY+7ph7xpk51Ez2GbE10lXAQ5sJma6NghcIDaSPbM/G9elfrjLa0COHl/7P6Wb/JizQzl5UQontOOP1z0VwbLA==" + }, "node_modules/libsodium-wrappers": { "version": "0.7.10", "resolved": "https://registry.npmjs.org/libsodium-wrappers/-/libsodium-wrappers-0.7.10.tgz", @@ -11924,6 +11911,14 @@ "libsodium": "^0.7.0" } }, + "node_modules/libsodium-wrappers-sumo": { + "version": "0.7.11", + "resolved": "https://registry.npmjs.org/libsodium-wrappers-sumo/-/libsodium-wrappers-sumo-0.7.11.tgz", + "integrity": "sha512-DGypHOmJbB1nZn89KIfGOAkDgfv5N6SBGC3Qvmy/On0P0WD1JQvNRS/e3UL3aFF+xC0m+MYz5M+MnRnK2HMrKQ==", + "dependencies": { + "libsodium-sumo": "^0.7.11" + } + }, "node_modules/loader-runner": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.2.0.tgz", @@ -17976,30 +17971,30 @@ } }, "@cosmjs/crypto": { - "version": "0.29.5", - "resolved": "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.29.5.tgz", - "integrity": "sha512-2bKkaLGictaNL0UipQCL6C1afaisv6k8Wr/GCLx9FqiyFkh9ZgRHDyetD64ZsjnWV/N/D44s/esI+k6oPREaiQ==", + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.31.1.tgz", + "integrity": "sha512-4R/SqdzdVzd4E5dpyEh1IKm5GbTqwDogutyIyyb1bcOXiX/x3CrvPI9Tb4WSIMDLvlb5TVzu2YnUV51Q1+6mMA==", "requires": { - "@cosmjs/encoding": "^0.29.5", - "@cosmjs/math": "^0.29.5", - "@cosmjs/utils": "^0.29.5", + "@cosmjs/encoding": "^0.31.1", + "@cosmjs/math": "^0.31.1", + "@cosmjs/utils": "^0.31.1", "@noble/hashes": "^1", "bn.js": "^5.2.0", "elliptic": "^6.5.4", - "libsodium-wrappers": "^0.7.6" + "libsodium-wrappers-sumo": "^0.7.11" }, "dependencies": { "@cosmjs/utils": { - "version": "0.29.5", - "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.29.5.tgz", - "integrity": "sha512-m7h+RXDUxOzEOGt4P+3OVPX7PuakZT3GBmaM/Y2u+abN3xZkziykD/NvedYFvvCCdQo714XcGl33bwifS9FZPQ==" + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.31.1.tgz", + "integrity": "sha512-n4Se1wu4GnKwztQHNFfJvUeWcpvx3o8cWhSbNs9JQShEuB3nv3R5lqFBtDCgHZF/emFQAP+ZjF8bTfCs9UBGhA==" } } }, "@cosmjs/encoding": { - "version": "0.29.5", - "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.29.5.tgz", - "integrity": "sha512-G4rGl/Jg4dMCw5u6PEZHZcoHnUBlukZODHbm/wcL4Uu91fkn5jVo5cXXZcvs4VCkArVGrEj/52eUgTZCmOBGWQ==", + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.31.1.tgz", + "integrity": "sha512-IuxP6ewwX6vg9sUJ8ocJD92pkerI4lyG8J5ynAM3NaX3q+n+uMoPRSQXNeL9bnlrv01FF1kIm8if/f5F7ZPtkA==", "requires": { "base64-js": "^1.3.0", "bech32": "^1.1.4", @@ -18157,51 +18152,42 @@ } }, "@cosmjs/math": { - "version": "0.29.5", - "resolved": "https://registry.npmjs.org/@cosmjs/math/-/math-0.29.5.tgz", - "integrity": "sha512-2GjKcv+A9f86MAWYLUkjhw1/WpRl2R1BTb3m9qPG7lzMA7ioYff9jY5SPCfafKdxM4TIQGxXQlYGewQL16O68Q==", + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/math/-/math-0.31.1.tgz", + "integrity": "sha512-kiuHV6m6DSB8/4UV1qpFhlc4ul8SgLXTGRlYkYiIIP4l0YNeJ+OpPYaOlEgx4Unk2mW3/O2FWYj7Jc93+BWXng==", "requires": { "bn.js": "^5.2.0" } }, "@cosmjs/proto-signing": { - "version": "0.29.5", - "resolved": "https://registry.npmjs.org/@cosmjs/proto-signing/-/proto-signing-0.29.5.tgz", - "integrity": "sha512-QRrS7CiKaoETdgIqvi/7JC2qCwCR7lnWaUsTzh/XfRy3McLkEd+cXbKAW3cygykv7IN0VAEIhZd2lyIfT8KwNA==", - "requires": { - "@cosmjs/amino": "^0.29.5", - "@cosmjs/crypto": "^0.29.5", - "@cosmjs/encoding": "^0.29.5", - "@cosmjs/math": "^0.29.5", - "@cosmjs/utils": "^0.29.5", - "cosmjs-types": "^0.5.2", + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/proto-signing/-/proto-signing-0.31.1.tgz", + "integrity": "sha512-hipbBVrssPu+jnmRzQRP5hhS/mbz2nU7RvxG/B1ZcdNhr1AtZC5DN09OTUoEpMSRgyQvScXmk/NTbyf+xmCgYg==", + "requires": { + "@cosmjs/amino": "^0.31.1", + "@cosmjs/crypto": "^0.31.1", + "@cosmjs/encoding": "^0.31.1", + "@cosmjs/math": "^0.31.1", + "@cosmjs/utils": "^0.31.1", + "cosmjs-types": "^0.8.0", "long": "^4.0.0" }, "dependencies": { "@cosmjs/amino": { - "version": "0.29.5", - "resolved": "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.29.5.tgz", - "integrity": "sha512-Qo8jpC0BiziTSUqpkNatBcwtKNhCovUnFul9SlT/74JUCdLYaeG5hxr3q1cssQt++l4LvlcpF+OUXL48XjNjLw==", + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.31.1.tgz", + "integrity": "sha512-kkB9IAkNEUFtjp/uwHv95TgM8VGJ4VWfZwrTyLNqBDD1EpSX2dsNrmUe7k8OMPzKlZUFcKmD4iA0qGvIwzjbGA==", "requires": { - "@cosmjs/crypto": "^0.29.5", - "@cosmjs/encoding": "^0.29.5", - "@cosmjs/math": "^0.29.5", - "@cosmjs/utils": "^0.29.5" + "@cosmjs/crypto": "^0.31.1", + "@cosmjs/encoding": "^0.31.1", + "@cosmjs/math": "^0.31.1", + "@cosmjs/utils": "^0.31.1" } }, "@cosmjs/utils": { - "version": "0.29.5", - "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.29.5.tgz", - "integrity": "sha512-m7h+RXDUxOzEOGt4P+3OVPX7PuakZT3GBmaM/Y2u+abN3xZkziykD/NvedYFvvCCdQo714XcGl33bwifS9FZPQ==" - }, - "cosmjs-types": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/cosmjs-types/-/cosmjs-types-0.5.2.tgz", - "integrity": "sha512-zxCtIJj8v3Di7s39uN4LNcN3HIE1z0B9Z0SPE8ZNQR0oSzsuSe1ACgxoFkvhkS7WBasCAFcglS11G2hyfd5tPg==", - "requires": { - "long": "^4.0.0", - "protobufjs": "~6.11.2" - } + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.31.1.tgz", + "integrity": "sha512-n4Se1wu4GnKwztQHNFfJvUeWcpvx3o8cWhSbNs9JQShEuB3nv3R5lqFBtDCgHZF/emFQAP+ZjF8bTfCs9UBGhA==" } } }, @@ -18217,84 +18203,84 @@ } }, "@cosmjs/stargate": { - "version": "0.29.5", - "resolved": "https://registry.npmjs.org/@cosmjs/stargate/-/stargate-0.29.5.tgz", - "integrity": "sha512-hjEv8UUlJruLrYGJcUZXM/CziaINOKwfVm2BoSdUnNTMxGvY/jC1ABHKeZUYt9oXHxEJ1n9+pDqzbKc8pT0nBw==", + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/stargate/-/stargate-0.31.1.tgz", + "integrity": "sha512-TqOJZYOH5W3sZIjR6949GfjhGXO3kSHQ3/KmE+SuKyMMmQ5fFZ45beawiRtVF0/CJg5RyPFyFGJKhb1Xxv3Lcg==", "requires": { "@confio/ics23": "^0.6.8", - "@cosmjs/amino": "^0.29.5", - "@cosmjs/encoding": "^0.29.5", - "@cosmjs/math": "^0.29.5", - "@cosmjs/proto-signing": "^0.29.5", - "@cosmjs/stream": "^0.29.5", - "@cosmjs/tendermint-rpc": "^0.29.5", - "@cosmjs/utils": "^0.29.5", - "cosmjs-types": "^0.5.2", + "@cosmjs/amino": "^0.31.1", + "@cosmjs/encoding": "^0.31.1", + "@cosmjs/math": "^0.31.1", + "@cosmjs/proto-signing": "^0.31.1", + "@cosmjs/stream": "^0.31.1", + "@cosmjs/tendermint-rpc": "^0.31.1", + "@cosmjs/utils": "^0.31.1", + "cosmjs-types": "^0.8.0", "long": "^4.0.0", "protobufjs": "~6.11.3", "xstream": "^11.14.0" }, "dependencies": { "@cosmjs/amino": { - "version": "0.29.5", - "resolved": "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.29.5.tgz", - "integrity": "sha512-Qo8jpC0BiziTSUqpkNatBcwtKNhCovUnFul9SlT/74JUCdLYaeG5hxr3q1cssQt++l4LvlcpF+OUXL48XjNjLw==", + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.31.1.tgz", + "integrity": "sha512-kkB9IAkNEUFtjp/uwHv95TgM8VGJ4VWfZwrTyLNqBDD1EpSX2dsNrmUe7k8OMPzKlZUFcKmD4iA0qGvIwzjbGA==", "requires": { - "@cosmjs/crypto": "^0.29.5", - "@cosmjs/encoding": "^0.29.5", - "@cosmjs/math": "^0.29.5", - "@cosmjs/utils": "^0.29.5" + "@cosmjs/crypto": "^0.31.1", + "@cosmjs/encoding": "^0.31.1", + "@cosmjs/math": "^0.31.1", + "@cosmjs/utils": "^0.31.1" } }, "@cosmjs/json-rpc": { - "version": "0.29.5", - "resolved": "https://registry.npmjs.org/@cosmjs/json-rpc/-/json-rpc-0.29.5.tgz", - "integrity": "sha512-C78+X06l+r9xwdM1yFWIpGl03LhB9NdM1xvZpQHwgCOl0Ir/WV8pw48y3Ez2awAoUBRfTeejPe4KvrE6NoIi/w==", + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/json-rpc/-/json-rpc-0.31.1.tgz", + "integrity": "sha512-gIkCj2mUDHAxvmJnHtybXtMLZDeXrkDZlujjzhvJlWsIuj1kpZbKtYqh+eNlfwhMkMMAlQa/y4422jDmizW+ng==", "requires": { - "@cosmjs/stream": "^0.29.5", + "@cosmjs/stream": "^0.31.1", "xstream": "^11.14.0" } }, "@cosmjs/socket": { - "version": "0.29.5", - "resolved": "https://registry.npmjs.org/@cosmjs/socket/-/socket-0.29.5.tgz", - "integrity": "sha512-5VYDupIWbIXq3ftPV1LkS5Ya/T7Ol/AzWVhNxZ79hPe/mBfv1bGau/LqIYOm2zxGlgm9hBHOTmWGqNYDwr9LNQ==", + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/socket/-/socket-0.31.1.tgz", + "integrity": "sha512-XTtEr+x3WGbqkzoGX0sCkwVqf5n+bBqDwqNgb+DWaBABQxHVRuuainrTVp0Yc91D3Iy2twLQzeBA9OrRxDSerw==", "requires": { - "@cosmjs/stream": "^0.29.5", + "@cosmjs/stream": "^0.31.1", "isomorphic-ws": "^4.0.1", "ws": "^7", "xstream": "^11.14.0" } }, "@cosmjs/stream": { - "version": "0.29.5", - "resolved": "https://registry.npmjs.org/@cosmjs/stream/-/stream-0.29.5.tgz", - "integrity": "sha512-TToTDWyH1p05GBtF0Y8jFw2C+4783ueDCmDyxOMM6EU82IqpmIbfwcdMOCAm0JhnyMh+ocdebbFvnX/sGKzRAA==", + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/stream/-/stream-0.31.1.tgz", + "integrity": "sha512-xsIGD9bpBvYYZASajCyOevh1H5pDdbOWmvb4UwGZ78doGVz3IC3Kb9BZKJHIX2fjq9CMdGVJHmlM+Zp5aM8yZA==", "requires": { "xstream": "^11.14.0" } }, "@cosmjs/tendermint-rpc": { - "version": "0.29.5", - "resolved": "https://registry.npmjs.org/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.29.5.tgz", - "integrity": "sha512-ar80twieuAxsy0x2za/aO3kBr2DFPAXDmk2ikDbmkda+qqfXgl35l9CVAAjKRqd9d+cRvbQyb5M4wy6XQpEV6w==", - "requires": { - "@cosmjs/crypto": "^0.29.5", - "@cosmjs/encoding": "^0.29.5", - "@cosmjs/json-rpc": "^0.29.5", - "@cosmjs/math": "^0.29.5", - "@cosmjs/socket": "^0.29.5", - "@cosmjs/stream": "^0.29.5", - "@cosmjs/utils": "^0.29.5", + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.31.1.tgz", + "integrity": "sha512-KX+wwi725sSePqIxfMPPOqg+xTETV8BHGOBhRhCZXEl5Fq48UlXXq3/yG1sn7K67ADC0kqHqcCF41Wn1GxNNPA==", + "requires": { + "@cosmjs/crypto": "^0.31.1", + "@cosmjs/encoding": "^0.31.1", + "@cosmjs/json-rpc": "^0.31.1", + "@cosmjs/math": "^0.31.1", + "@cosmjs/socket": "^0.31.1", + "@cosmjs/stream": "^0.31.1", + "@cosmjs/utils": "^0.31.1", "axios": "^0.21.2", "readonly-date": "^1.0.0", "xstream": "^11.14.0" } }, "@cosmjs/utils": { - "version": "0.29.5", - "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.29.5.tgz", - "integrity": "sha512-m7h+RXDUxOzEOGt4P+3OVPX7PuakZT3GBmaM/Y2u+abN3xZkziykD/NvedYFvvCCdQo714XcGl33bwifS9FZPQ==" + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.31.1.tgz", + "integrity": "sha512-n4Se1wu4GnKwztQHNFfJvUeWcpvx3o8cWhSbNs9JQShEuB3nv3R5lqFBtDCgHZF/emFQAP+ZjF8bTfCs9UBGhA==" }, "axios": { "version": "0.21.4", @@ -18303,15 +18289,6 @@ "requires": { "follow-redirects": "^1.14.0" } - }, - "cosmjs-types": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/cosmjs-types/-/cosmjs-types-0.5.2.tgz", - "integrity": "sha512-zxCtIJj8v3Di7s39uN4LNcN3HIE1z0B9Z0SPE8ZNQR0oSzsuSe1ACgxoFkvhkS7WBasCAFcglS11G2hyfd5tPg==", - "requires": { - "long": "^4.0.0", - "protobufjs": "~6.11.2" - } } } }, @@ -25357,6 +25334,11 @@ "resolved": "https://registry.npmjs.org/libsodium/-/libsodium-0.7.10.tgz", "integrity": "sha512-eY+z7hDrDKxkAK+QKZVNv92A5KYkxfvIshtBJkmg5TSiCnYqZP3i9OO9whE79Pwgm4jGaoHgkM4ao/b9Cyu4zQ==" }, + "libsodium-sumo": { + "version": "0.7.11", + "resolved": "https://registry.npmjs.org/libsodium-sumo/-/libsodium-sumo-0.7.11.tgz", + "integrity": "sha512-bY+7ph7xpk51Ez2GbE10lXAQ5sJma6NghcIDaSPbM/G9elfrjLa0COHl/7P6Wb/JizQzl5UQontOOP1z0VwbLA==" + }, "libsodium-wrappers": { "version": "0.7.10", "resolved": "https://registry.npmjs.org/libsodium-wrappers/-/libsodium-wrappers-0.7.10.tgz", @@ -25365,6 +25347,14 @@ "libsodium": "^0.7.0" } }, + "libsodium-wrappers-sumo": { + "version": "0.7.11", + "resolved": "https://registry.npmjs.org/libsodium-wrappers-sumo/-/libsodium-wrappers-sumo-0.7.11.tgz", + "integrity": "sha512-DGypHOmJbB1nZn89KIfGOAkDgfv5N6SBGC3Qvmy/On0P0WD1JQvNRS/e3UL3aFF+xC0m+MYz5M+MnRnK2HMrKQ==", + "requires": { + "libsodium-sumo": "^0.7.11" + } + }, "loader-runner": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.2.0.tgz", diff --git a/indexer/package.json b/indexer/package.json index 350a87cab..4cd935cfe 100644 --- a/indexer/package.json +++ b/indexer/package.json @@ -20,11 +20,11 @@ "homepage": "https://github.com/akash-network/cloudmos", "dependencies": { "@akashnetwork/akashjs": "0.4.11", - "@cosmjs/crypto": "^0.29.5", - "@cosmjs/encoding": "^0.29.5", - "@cosmjs/math": "^0.29.5", - "@cosmjs/proto-signing": "^0.29.5", - "@cosmjs/stargate": "^0.29.5", + "@cosmjs/crypto": "^0.31.1", + "@cosmjs/encoding": "^0.31.1", + "@cosmjs/math": "^0.31.1", + "@cosmjs/proto-signing": "^0.31.1", + "@cosmjs/stargate": "^0.31.1", "@sentry/node": "^7.52.0", "async": "^3.2.4", "axios": "^0.27.2", diff --git a/indexer/src/db/priceHistoryProvider.ts b/indexer/src/db/priceHistoryProvider.ts index 14887ff81..54f89415c 100644 --- a/indexer/src/db/priceHistoryProvider.ts +++ b/indexer/src/db/priceHistoryProvider.ts @@ -28,14 +28,9 @@ export const syncPriceHistory = async () => { console.log(`There are ${apiPrices.length} prices to update.`); - const days = await Day.findAll({ - where: { - aktPrice: null - } - }); + const days = await Day.findAll(); for (const day of days) { - console.log("Checking day " + day.date); const priceData = apiPrices.find((x) => isSameDay(new Date(x.date), day.date)); if (priceData && priceData.price != day.aktPrice) { diff --git a/indexer/src/index.ts b/indexer/src/index.ts index dcf41267e..0398d61a8 100644 --- a/indexer/src/index.ts +++ b/indexer/src/index.ts @@ -72,7 +72,7 @@ app.get("/status", async (req, res) => { app.get("/nodes", async (req, res) => { try { - const nodeStatus = await nodeAccessor.getNodeStatus(); + const nodeStatus = nodeAccessor.getNodeStatus(); res.send(nodeStatus); } catch (err) { Sentry.captureException(err); @@ -112,7 +112,7 @@ function startScheduler() { } /** - * Intizialize database schema + * Initialize database schema * Populate db * Create backups per version * Load from backup if exists for current version diff --git a/indexer/src/shared/utils/protobuf.ts b/indexer/src/shared/utils/protobuf.ts index e2dd9f81c..aa5dd4b98 100644 --- a/indexer/src/shared/utils/protobuf.ts +++ b/indexer/src/shared/utils/protobuf.ts @@ -28,22 +28,6 @@ export function decodeMsg(type: string, msg: Uint8Array) { return msgType.decode(msg); } -export function msgToJSON(type: string, msg) { - const myRegistry = new Registry([...defaultRegistryTypes, ...akashTypes, ...missingTypes]); - - const msgType = myRegistry.lookupType(type); - - if (!msgType) { - throw new Error("Type not found: " + type); - } - - if (!isTsProtoGeneratedType(msgType)) { - throw new Error("Type is not generated by ts-protobuf: " + type); - } - - return msgType.toJSON(msgType.decode(msg)); -} - export function uint8arrayToString(arr: Uint8Array) { return new TextDecoder().decode(arr); }