From aac6147b796a03f7402479c68e201859b0a61d59 Mon Sep 17 00:00:00 2001 From: Yaroslav Grishajev Date: Fri, 20 Dec 2024 12:00:00 +0100 Subject: [PATCH] feat: ensures tests pass on api with some sdk-47 changes --- apps/api/env/.env.functional.test | 11 +- apps/api/env/.env.local.sample | 3 - apps/api/env/.env.mainnet | 1 + apps/api/env/.env.sample | 2 - apps/api/env/.env.sandbox | 1 + apps/api/env/.env.testnet | 3 + apps/api/env/.env.unit.test | 4 +- apps/api/package.json | 4 +- .../sign-and-broadcast-tx.router.ts | 10 +- .../managed-signer/managed-signer.service.ts | 25 +- .../rpc-message.service.ts | 13 +- .../trial-validation.service.ts | 6 +- apps/api/src/chain/config/env.config.ts | 7 + .../chain-config/chain-config.service.ts | 11 + apps/api/src/core/config/env.config.ts | 2 +- .../core-config/core-config.service.ts | 11 + apps/api/src/db/dbConnection.ts | 57 +- ...p-up-custodial-deployments.service.spec.ts | 4 +- ...top-up-managed-deployments.service.spec.ts | 3 +- apps/api/src/utils/constants.ts | 12 +- apps/api/src/utils/env.ts | 4 - apps/api/src/utils/protobuf.ts | 18 +- .../test/functional/create-deployment.spec.ts | 40 +- apps/api/test/functional/nodes-v1.spec.ts | 2 - .../functional/sign-and-broadcast-tx.spec.ts | 6 +- .../stale-anonymous-users-cleanup.spec.ts | 35 +- apps/api/test/functional/start-trial.spec.ts | 2 +- package-lock.json | 1134 ++--------------- package.json | 2 + .../src/allowance/allowance-http.service.ts | 8 +- 30 files changed, 307 insertions(+), 1134 deletions(-) create mode 100644 apps/api/env/.env.testnet create mode 100644 apps/api/src/chain/config/env.config.ts create mode 100644 apps/api/src/chain/services/chain-config/chain-config.service.ts create mode 100644 apps/api/src/core/services/core-config/core-config.service.ts diff --git a/apps/api/env/.env.functional.test b/apps/api/env/.env.functional.test index a68f879b7..453de4127 100644 --- a/apps/api/env/.env.functional.test +++ b/apps/api/env/.env.functional.test @@ -1,11 +1,12 @@ -AKASH_SANDBOX_DATABASE_CS=postgres://postgres:password@localhost:5432/console-akash-sandbox -USER_DATABASE_CS=postgres://postgres:password@localhost:5432/console-users POSTGRES_DB_URI=postgres://postgres:password@localhost:5432/console-users +CHAIN_INDEXER_POSTGRES_DB_URI=postgres://postgres:password@localhost:5432/console-akash-sandbox MASTER_WALLET_MNEMONIC="motion isolate mother convince snack twenty tumble boost elbow bundle modify balcony" UAKT_TOP_UP_MASTER_WALLET_MNEMONIC="since bread kind field rookie stairs elephant tent horror rice gain tongue collect goose rural garment cover client biology toe ability boat afford mind" USDC_TOP_UP_MASTER_WALLET_MNEMONIC="leaf brush weapon puppy depart hockey walnut hospital orphan require unfair hunt ribbon toe cereal eagle hour door awesome dress mouse when phone return" NETWORK=sandbox -RPC_NODE_ENDPOINT=https://rpc.sandbox-01.aksh.pw:443 +#RPC_NODE_ENDPOINT=https://rpc.sandbox-01.aksh.pw:443 +RPC_NODE_ENDPOINT=https://testnetrpc.akashnet.net:443 +API_NODE_ENDPOINT=http://api.dev.akash.pub:1317 TRIAL_DEPLOYMENT_ALLOWANCE_AMOUNT=20000000 DEPLOYMENT_ALLOWANCE_REFILL_AMOUNT=20000000 DEPLOYMENT_ALLOWANCE_REFILL_THRESHOLD=2000000 @@ -20,4 +21,6 @@ STRIPE_SECRET_KEY=STRIPE_SECRET_KEY STRIPE_PRODUCT_ID=STRIPE_PRODUCT_ID STRIPE_WEBHOOK_SECRET=STRIPE_WEBHOOK_SECRET ALLOWED_CHECKOUT_REFERRERS=["http://localhost:3000"] -STRIPE_CHECKOUT_REDIRECT_URL=http://localhost:3000 \ No newline at end of file +STRIPE_CHECKOUT_REDIRECT_URL=http://localhost:3000 +STD_OUT_LOG_FORMAT=pretty +SQL_LOG_FORMAT=pretty \ No newline at end of file diff --git a/apps/api/env/.env.local.sample b/apps/api/env/.env.local.sample index 1de6f9abf..d7d00ca75 100644 --- a/apps/api/env/.env.local.sample +++ b/apps/api/env/.env.local.sample @@ -1,8 +1,5 @@ NETWORK=sandbox DB_HOST_WITH_DEFAULT=${DB_HOST:-localhost} -AKASH_DATABASE_CS=postgres://postgres:password@${DB_HOST_WITH_DEFAULT}:5432/console-akash-sandbox -AKASH_SANDBOX_DATABASE_CS=postgres://postgres:password@${DB_HOST_WITH_DEFAULT}:5432/console-akash-sandbox -USER_DATABASE_CS=postgres://postgres:password@${DB_HOST_WITH_DEFAULT}:5432/console-users POSTGRES_DB_URI=postgres://postgres:password@${DB_HOST_WITH_DEFAULT}:5432/console-users ANONYMOUS_USER_TOKEN_SECRET=ANONYMOUS_USER_TOKEN_SECRET MASTER_WALLET_MNEMONIC=MASTER_WALLET_MNEMONIC diff --git a/apps/api/env/.env.mainnet b/apps/api/env/.env.mainnet index c32a117bb..bbf74eae9 100644 --- a/apps/api/env/.env.mainnet +++ b/apps/api/env/.env.mainnet @@ -1,2 +1,3 @@ RPC_NODE_ENDPOINT=https://consolerpc.akashnet.net +API_NODE_ENDPOINT=https://api.akashnet.net:443 DEPLOYMENT_GRANT_DENOM=ibc/170C677610AC31DF0904FFE09CD3B5C657492170E7E52372E48756B71E56F2F1 diff --git a/apps/api/env/.env.sample b/apps/api/env/.env.sample index 1715742cf..b68c633e1 100644 --- a/apps/api/env/.env.sample +++ b/apps/api/env/.env.sample @@ -1,5 +1,4 @@ # Secrets -AKASH_DATABASE_CS= GITHUB_PAT= ANONYMOUS_USER_TOKEN_SECRET= HealthChecks_SyncAKTMarketData= @@ -9,7 +8,6 @@ SECRET_TOKEN= SENTRY_DSN= STRIPE_SECRET_KEY= STRIPE_PRODUCT_ID= -USER_DATABASE_CS= # Configuration CORS_WEBSITE_URLS= diff --git a/apps/api/env/.env.sandbox b/apps/api/env/.env.sandbox index e56fa4aff..48f923584 100644 --- a/apps/api/env/.env.sandbox +++ b/apps/api/env/.env.sandbox @@ -1,2 +1,3 @@ RPC_NODE_ENDPOINT=https://rpc.sandbox-01.aksh.pw:443 +API_NODE_ENDPOINT=https://api.sandbox-01.aksh.pw DEPLOYMENT_GRANT_DENOM=ibc/12C6A0C374171B595A0A9E18B83FA09D295FB1F2D8C6DAA3AC28683471752D84 \ No newline at end of file diff --git a/apps/api/env/.env.testnet b/apps/api/env/.env.testnet new file mode 100644 index 000000000..1e4d97b5a --- /dev/null +++ b/apps/api/env/.env.testnet @@ -0,0 +1,3 @@ +API_NODE_ENDPOINT=http://api.dev.akash.pub:1317 +RPC_NODE_ENDPOINT=https://testnetrpc.akashnet.net:443 +DEPLOYMENT_GRANT_DENOM=ibc/12C6A0C374171B595A0A9E18B83FA09D295FB1F2D8C6DAA3AC28683471752D84 \ No newline at end of file diff --git a/apps/api/env/.env.unit.test b/apps/api/env/.env.unit.test index 1abebe90f..1c5ff807f 100644 --- a/apps/api/env/.env.unit.test +++ b/apps/api/env/.env.unit.test @@ -1,10 +1,10 @@ -AKASH_SANDBOX_DATABASE_CS=postgres://postgres:password@localhost:5432/console-akash-sandbox -USER_DATABASE_CS=postgres://postgres:password@localhost:5432/console-users POSTGRES_DB_URI=postgres://postgres:password@localhost:5432/console-users +CHAIN_INDEXER_POSTGRES_DB_URI=postgres://postgres:password@localhost:5432/console-akash-sandbox MASTER_WALLET_MNEMONIC="motion isolate mother convince snack twenty tumble boost elbow bundle modify balcony" UAKT_TOP_UP_MASTER_WALLET_MNEMONIC="since bread kind field rookie stairs elephant tent horror rice gain tongue collect goose rural garment cover client biology toe ability boat afford mind" USDC_TOP_UP_MASTER_WALLET_MNEMONIC="leaf brush weapon puppy depart hockey walnut hospital orphan require unfair hunt ribbon toe cereal eagle hour door awesome dress mouse when phone return" NETWORK=sandbox +API_NODE_ENDPOINT=https://api.sandbox-01.aksh.pw:443 RPC_NODE_ENDPOINT=https://rpc.sandbox-01.aksh.pw:443 TRIAL_DEPLOYMENT_ALLOWANCE_AMOUNT=20000000 DEPLOYMENT_ALLOWANCE_REFILL_AMOUNT=20000000 diff --git a/apps/api/package.json b/apps/api/package.json index a47cb5343..7ee52b0dd 100644 --- a/apps/api/package.json +++ b/apps/api/package.json @@ -34,8 +34,8 @@ "test:watch": "jest --selectProjects unit functional --watch" }, "dependencies": { - "@akashnetwork/akash-api": "^1.3.0", - "@akashnetwork/akashjs": "^0.10.0", + "@akashnetwork/akash-api": "file:../../../../go-projects/akash-api/ts", + "@akashnetwork/akashjs": "file:../../../akashjs", "@akashnetwork/database": "*", "@akashnetwork/env-loader": "*", "@akashnetwork/http-sdk": "*", diff --git a/apps/api/src/billing/routes/sign-and-broadcast-tx/sign-and-broadcast-tx.router.ts b/apps/api/src/billing/routes/sign-and-broadcast-tx/sign-and-broadcast-tx.router.ts index 96e72fe5c..75e1af886 100644 --- a/apps/api/src/billing/routes/sign-and-broadcast-tx/sign-and-broadcast-tx.router.ts +++ b/apps/api/src/billing/routes/sign-and-broadcast-tx/sign-and-broadcast-tx.router.ts @@ -12,12 +12,12 @@ export const SignTxRequestInputSchema = z.object({ .array( z.object({ typeUrl: z.enum([ - "/akash.deployment.v1beta3.MsgCreateDeployment", - "/akash.cert.v1beta3.MsgCreateCertificate", + "/akash.deployment.v1beta4.MsgCreateDeployment", + "/akash.cert.v1.MsgCreateCertificate", "/akash.market.v1beta4.MsgCreateLease", - "/akash.deployment.v1beta3.MsgUpdateDeployment", - "/akash.deployment.v1beta3.MsgCloseDeployment", - "/akash.deployment.v1beta3.MsgDepositDeployment" + "/akash.deployment.v1beta4.MsgUpdateDeployment", + "/akash.deployment.v1beta4.MsgCloseDeployment", + "/akash.deployment.v1beta4.MsgDepositDeployment" ]), value: z.string() }) diff --git a/apps/api/src/billing/services/managed-signer/managed-signer.service.ts b/apps/api/src/billing/services/managed-signer/managed-signer.service.ts index 4ea226231..79754ed92 100644 --- a/apps/api/src/billing/services/managed-signer/managed-signer.service.ts +++ b/apps/api/src/billing/services/managed-signer/managed-signer.service.ts @@ -56,20 +56,25 @@ export class ManagedSignerService { throw this.chainErrorService.toAppError(error, decodedMessages); } - const tx = await this.executeManagedTx(userWallet.id, decodedMessages); + try { + const tx = await this.executeManagedTx(userWallet.id, decodedMessages); - await this.balancesService.refreshUserWalletLimits(userWallet); + await this.balancesService.refreshUserWalletLimits(userWallet); - const result = pick(tx, ["code", "hash", "transactionHash", "rawLog"]); + const result = pick(tx, ["code", "hash", "transactionHash", "rawLog"]); - if (result.hash) { - return { - ...result, - transactionHash: result.hash - }; - } + if (result.hash) { + return { + ...result, + transactionHash: result.hash + }; + } - return result; + return result; + } catch (error) { + console.log("DEBUG error", error); + throw error; + } } private decodeMessages(messages: StringifiedEncodeObject[]): EncodeObject[] { diff --git a/apps/api/src/billing/services/rpc-message-service/rpc-message.service.ts b/apps/api/src/billing/services/rpc-message-service/rpc-message.service.ts index d16baa45a..740a998eb 100644 --- a/apps/api/src/billing/services/rpc-message-service/rpc-message.service.ts +++ b/apps/api/src/billing/services/rpc-message-service/rpc-message.service.ts @@ -1,4 +1,5 @@ -import { DepositDeploymentAuthorization, MsgCloseDeployment, MsgDepositDeployment } from "@akashnetwork/akash-api/v1beta3"; +import { DepositAuthorization, MsgDepositDeployment } from "@akashnetwork/akash-api/v1"; +import { MsgCloseDeployment } from "@akashnetwork/akash-api/v1beta4"; import { MsgExec, MsgRevoke } from "cosmjs-types/cosmos/authz/v1beta1/tx"; import { BasicAllowance } from "cosmjs-types/cosmos/feegrant/v1beta1/feegrant"; import { MsgGrantAllowance } from "cosmjs-types/cosmos/feegrant/v1beta1/tx"; @@ -68,9 +69,9 @@ export class RpcMessageService { grantee, grant: { authorization: { - typeUrl: `/${DepositDeploymentAuthorization.$type}`, - value: DepositDeploymentAuthorization.encode( - DepositDeploymentAuthorization.fromPartial({ + typeUrl: `/${DepositAuthorization.$type}`, + value: DepositAuthorization.encode( + DepositAuthorization.fromPartial({ spendLimit: { denom, amount: limit.toString() @@ -106,7 +107,7 @@ export class RpcMessageService { value: MsgRevoke.fromPartial({ granter: granter, grantee: grantee, - msgTypeUrl: "/akash.deployment.v1beta3.MsgDepositDeployment" + msgTypeUrl: `/${MsgDepositDeployment.$type}` }) }; } @@ -125,7 +126,7 @@ export class RpcMessageService { getDepositDeploymentMsg({ owner, dseq, amount, denom, depositor }: DepositDeploymentMsgOptions) { return { - typeUrl: "/akash.deployment.v1beta3.MsgDepositDeployment", + typeUrl: `/${MsgDepositDeployment.$type}`, value: { id: { owner, diff --git a/apps/api/src/billing/services/trial-validation/trial-validation.service.ts b/apps/api/src/billing/services/trial-validation/trial-validation.service.ts index 0330ec043..5032f3be4 100644 --- a/apps/api/src/billing/services/trial-validation/trial-validation.service.ts +++ b/apps/api/src/billing/services/trial-validation/trial-validation.service.ts @@ -1,4 +1,4 @@ -import * as v1beta3 from "@akashnetwork/akash-api/v1beta3"; +import { MsgCreateDeployment } from "@akashnetwork/akash-api/v1beta4"; import { EncodeObject } from "@cosmjs/proto-signing"; import { singleton } from "tsyringe"; @@ -8,8 +8,8 @@ import { AUDITOR, TRIAL_ATTRIBUTE } from "@src/deployment/config/provider.config @singleton() export class TrialValidationService { async validateLeaseProviders(decoded: EncodeObject, userWallet: UserWalletOutput) { - if (userWallet.isTrialing && decoded.typeUrl === "/akash.deployment.v1beta3.MsgCreateDeployment") { - const value = decoded.value as v1beta3.MsgCreateDeployment; + if (userWallet.isTrialing && decoded.typeUrl === "/akash.deployment.v1beta4.MsgCreateDeployment") { + const value = decoded.value as MsgCreateDeployment; value.groups.forEach(group => { const hasTrial = group.requirements.attributes.some(attribute => { diff --git a/apps/api/src/chain/config/env.config.ts b/apps/api/src/chain/config/env.config.ts new file mode 100644 index 000000000..5b79a00e9 --- /dev/null +++ b/apps/api/src/chain/config/env.config.ts @@ -0,0 +1,7 @@ +import { z } from "zod"; + +export const envSchema = z.object({ + API_NODE_ENDPOINT: z.string(), + RPC_NODE_ENDPOINT: z.string(), + CHAIN_INDEXER_POSTGRES_DB_URI: z.string() +}); diff --git a/apps/api/src/chain/services/chain-config/chain-config.service.ts b/apps/api/src/chain/services/chain-config/chain-config.service.ts new file mode 100644 index 000000000..fd5bc7763 --- /dev/null +++ b/apps/api/src/chain/services/chain-config/chain-config.service.ts @@ -0,0 +1,11 @@ +import { singleton } from "tsyringe"; + +import { envSchema } from "@src/chain/config/env.config"; +import { ConfigService } from "@src/core/services/config/config.service"; + +@singleton() +export class ChainConfigService extends ConfigService { + constructor() { + super({ envSchema }); + } +} diff --git a/apps/api/src/core/config/env.config.ts b/apps/api/src/core/config/env.config.ts index 58d3b8395..0ea37a5bc 100644 --- a/apps/api/src/core/config/env.config.ts +++ b/apps/api/src/core/config/env.config.ts @@ -1,6 +1,6 @@ import { z } from "zod"; -const envSchema = z.object({ +export const envSchema = z.object({ LOG_LEVEL: z.enum(["fatal", "error", "warn", "info", "debug", "trace"]).optional().default("info"), STD_OUT_LOG_FORMAT: z.enum(["json", "pretty"]).optional().default("json"), SQL_LOG_FORMAT: z.enum(["raw", "pretty"]).optional().default("raw"), diff --git a/apps/api/src/core/services/core-config/core-config.service.ts b/apps/api/src/core/services/core-config/core-config.service.ts new file mode 100644 index 000000000..21b5adb42 --- /dev/null +++ b/apps/api/src/core/services/core-config/core-config.service.ts @@ -0,0 +1,11 @@ +import { singleton } from "tsyringe"; + +import { envSchema } from "@src/core/config/env.config"; +import { ConfigService } from "@src/core/services/config/config.service"; + +@singleton() +export class CoreConfigService extends ConfigService { + constructor() { + super({ envSchema }); + } +} diff --git a/apps/api/src/db/dbConnection.ts b/apps/api/src/db/dbConnection.ts index be9581578..aa6b5de5b 100644 --- a/apps/api/src/db/dbConnection.ts +++ b/apps/api/src/db/dbConnection.ts @@ -1,37 +1,23 @@ -import { chainDefinitions } from "@akashnetwork/database/chainDefinitions"; -import { chainModels, getChainModels, userModels } from "@akashnetwork/database/dbSchemas"; +import { chainModels, userModels } from "@akashnetwork/database/dbSchemas"; import { Template, TemplateFavorite, UserSetting } from "@akashnetwork/database/dbSchemas/user"; import pg from "pg"; import { Transaction as DbTransaction } from "sequelize"; import { Sequelize } from "sequelize-typescript"; +import { container } from "tsyringe"; -import { config } from "@src/core/config"; +import { ChainConfigService } from "@src/chain/services/chain-config/chain-config.service"; +import { CoreConfigService } from "@src/core/services/core-config/core-config.service"; import { PostgresLoggerService } from "@src/core/services/postgres-logger/postgres-logger.service"; -import { env } from "@src/utils/env"; -function isValidNetwork(network: string): network is keyof typeof csMap { - return network in csMap; -} - -const csMap = { - mainnet: env.AKASH_DATABASE_CS, - testnet: env.AKASH_TESTNET_DATABASE_CS, - sandbox: env.AKASH_SANDBOX_DATABASE_CS -}; - -if (!isValidNetwork(env.NETWORK)) { - throw new Error(`Invalid network: ${env.NETWORK}`); -} +const indexerDbUri = container.resolve(ChainConfigService).get("CHAIN_INDEXER_POSTGRES_DB_URI"); +const coreConfig = container.resolve(CoreConfigService); +const dbUri = coreConfig.get("POSTGRES_DB_URI"); -if (!csMap[env.NETWORK]) { - throw new Error(`Missing connection string for network: ${env.NETWORK}`); -} - -const logger = new PostgresLoggerService({ orm: "sequelize", useFormat: config.SQL_LOG_FORMAT === "pretty" }); +const logger = new PostgresLoggerService({ orm: "sequelize", useFormat: coreConfig.get("SQL_LOG_FORMAT") === "pretty" }); const logging = (msg: string) => logger.write(msg); pg.defaults.parseInt8 = true; -export const chainDb = new Sequelize(csMap[env.NETWORK], { +export const chainDb = new Sequelize(indexerDbUri, { dialectModule: pg, logging, logQueryParameters: true, @@ -43,28 +29,7 @@ export const chainDb = new Sequelize(csMap[env.NETWORK], { models: chainModels }); -export const chainDbs: { [key: string]: Sequelize } = Object.keys(chainDefinitions) - .filter(x => chainDefinitions[x].connectionString) - .reduce( - (obj, chain) => ({ - ...obj, - [chain]: new Sequelize(chainDefinitions[chain].connectionString, { - dialectModule: pg, - logging, - logQueryParameters: true, - repositoryMode: true, - transactionType: DbTransaction.TYPES.IMMEDIATE, - define: { - timestamps: false, - freezeTableName: true - }, - models: getChainModels(chain) - }) - }), - {} - ); - -export const userDb = new Sequelize(env.USER_DATABASE_CS, { +export const userDb = new Sequelize(dbUri, { dialectModule: pg, logging, logQueryParameters: true, @@ -81,5 +46,3 @@ export async function syncUserSchema() { await Template.sync(); await TemplateFavorite.sync(); } - -export const closeConnections = async () => await Promise.all([chainDb.close(), userDb.close(), ...Object.values(chainDbs).map(db => db.close())]); diff --git a/apps/api/src/deployment/services/top-up-custodial-deployments/top-up-custodial-deployments.service.spec.ts b/apps/api/src/deployment/services/top-up-custodial-deployments/top-up-custodial-deployments.service.spec.ts index 4dc858489..86b2e7cf1 100644 --- a/apps/api/src/deployment/services/top-up-custodial-deployments/top-up-custodial-deployments.service.spec.ts +++ b/apps/api/src/deployment/services/top-up-custodial-deployments/top-up-custodial-deployments.service.spec.ts @@ -230,8 +230,8 @@ describe(TopUpCustodialDeploymentsService.name, () => { grantee: grant.grantee, msgs: [ { - typeUrl: "/akash.deployment.v1beta3.MsgDepositDeployment", - value: expect.any(Buffer) + typeUrl: "/akash.deployment.v1.MsgDepositDeployment", + value: expect.any(Uint8Array) } ] } diff --git a/apps/api/src/deployment/services/top-up-managed-deployments/top-up-managed-deployments.service.spec.ts b/apps/api/src/deployment/services/top-up-managed-deployments/top-up-managed-deployments.service.spec.ts index 055d0a35b..a3455ccca 100644 --- a/apps/api/src/deployment/services/top-up-managed-deployments/top-up-managed-deployments.service.spec.ts +++ b/apps/api/src/deployment/services/top-up-managed-deployments/top-up-managed-deployments.service.spec.ts @@ -1,5 +1,6 @@ import "@test/mocks/logger-service.mock"; +import { MsgDepositDeployment } from "@akashnetwork/akash-api/v1"; import { faker } from "@faker-js/faker"; import { BillingConfig } from "@src/billing/providers"; @@ -107,7 +108,7 @@ describe(TopUpManagedDeploymentsService.name, () => { if (isExpectedToTopUp) { expect(managedSignerService.executeManagedTx).toHaveBeenCalledWith(wallet.id, [ { - typeUrl: "/akash.deployment.v1beta3.MsgDepositDeployment", + typeUrl: `/${MsgDepositDeployment.$type}`, value: { id: { owner: wallet.address, diff --git a/apps/api/src/utils/constants.ts b/apps/api/src/utils/constants.ts index 86f73975a..081499a72 100644 --- a/apps/api/src/utils/constants.ts +++ b/apps/api/src/utils/constants.ts @@ -1,4 +1,6 @@ -import { env } from "./env"; +import { container } from "tsyringe"; + +import { ChainConfigService } from "@src/chain/services/chain-config/chain-config.service"; export const averageBlockTime = 6.174; export const averageDaysInMonth = 30.437; @@ -14,12 +16,6 @@ export const openApiExampleProviderAddress = "akash18ga02jzaq8cw52anyhzkwta5wygu export const openApiExampleTransactionHash = "A19F1950D97E576F0D7B591D71A8D0366AA8BA0A7F3DA76F44769188644BE9EB"; export const openApiExampleValidatorAddress = "akashvaloper14mt78hz73d9tdwpdvkd59ne9509kxw8yj7qy8f"; -export const defaultNodeUrlMapping: { [key: string]: string } = { - mainnet: "https://api.akashnet.net:443", - sandbox: "https://api.sandbox-01.aksh.pw", - testnet: "https://api.testnet-02.aksh.pw" -}; - -export const apiNodeUrl = env.REST_API_NODE_URL ?? defaultNodeUrlMapping[env.NETWORK] ?? defaultNodeUrlMapping.mainnet; +export const apiNodeUrl = container.resolve(ChainConfigService).get("API_NODE_ENDPOINT"); export const betaTypeVersion = "v1beta3"; export const betaTypeVersionMarket = "v1beta4"; diff --git a/apps/api/src/utils/env.ts b/apps/api/src/utils/env.ts index e9f7dca0d..cd469326f 100644 --- a/apps/api/src/utils/env.ts +++ b/apps/api/src/utils/env.ts @@ -5,10 +5,6 @@ export const env = z CORS_WEBSITE_URLS: z.string().optional(), NODE_ENV: z.string().optional(), HEALTHCHECKS_ENABLED: z.string().optional(), - AKASH_DATABASE_CS: z.string().optional(), - AKASH_TESTNET_DATABASE_CS: z.string().optional(), - AKASH_SANDBOX_DATABASE_CS: z.string().optional(), - USER_DATABASE_CS: z.string().optional(), NETWORK: z.string().default("mainnet"), REST_API_NODE_URL: z.string().optional(), SERVER_ORIGIN: z.string().optional().default("http://localhost:3080"), diff --git a/apps/api/src/utils/protobuf.ts b/apps/api/src/utils/protobuf.ts index 315c72901..cd30cd1a9 100644 --- a/apps/api/src/utils/protobuf.ts +++ b/apps/api/src/utils/protobuf.ts @@ -1,5 +1,4 @@ -import * as v1beta1 from "@akashnetwork/akash-api/v1beta1"; -import * as v1beta2 from "@akashnetwork/akash-api/v1beta2"; +import * as v1 from "@akashnetwork/akash-api/v1"; import * as v1beta3 from "@akashnetwork/akash-api/v1beta3"; import * as v1beta4 from "@akashnetwork/akash-api/v1beta4"; import { GeneratedType, isTsProtoGeneratedType, Registry } from "@cosmjs/proto-signing"; @@ -7,12 +6,15 @@ import { defaultRegistryTypes } from "@cosmjs/stargate"; import { MsgUnjail } from "cosmjs-types/cosmos/slashing/v1beta1/tx"; import omit from "lodash/omit"; -const akashTypes: ReadonlyArray<[string, GeneratedType]> = [ - ...Object.values(v1beta1), - ...Object.values(omit(v1beta2, "Storage")), - ...Object.values(omit(v1beta3, ["DepositDeploymentAuthorization", "GPU"])), - ...Object.values(v1beta4) -].map(x => ["/" + x.$type, x]); +const akashTypes: ReadonlyArray<[string, GeneratedType]> = [...Object.values(v1), ...Object.values(omit(v1beta3, ["GPU"])), ...Object.values(v1beta4)].reduce( + (acc, akashType) => { + if ("$type" in akashType) { + acc.push(["/" + akashType.$type, akashType]); + } + return acc; + }, + [] +); const missingTypes: ReadonlyArray<[string, GeneratedType]> = [["/cosmos.slashing.v1beta1.MsgUnjail", MsgUnjail]]; export function decodeMsg(type: string, msg: Uint8Array) { diff --git a/apps/api/test/functional/create-deployment.spec.ts b/apps/api/test/functional/create-deployment.spec.ts index c2c3d7a06..90e2aeefa 100644 --- a/apps/api/test/functional/create-deployment.spec.ts +++ b/apps/api/test/functional/create-deployment.spec.ts @@ -1,7 +1,9 @@ +import { MsgCreateDeployment } from "@akashnetwork/akash-api/akash/deployment/v1beta4"; import { certificateManager } from "@akashnetwork/akashjs/build/certificates/certificate-manager"; import { SDL } from "@akashnetwork/akashjs/build/sdl"; import type { Registry } from "@cosmjs/proto-signing"; -import axios from "axios"; +import { faker } from "@faker-js/faker"; +import Long from "long"; import * as fs from "node:fs"; import * as path from "node:path"; import { container } from "tsyringe"; @@ -16,7 +18,6 @@ import { DbTestingService } from "@test/services/db-testing.service"; import { WalletTestingService } from "@test/services/wallet-testing.service"; jest.setTimeout(30000); - const yml = fs.readFileSync(path.resolve(__dirname, "../mocks/hello-world-sdl.yml"), "utf8"); // TODO: finish this test to create a lease and then close the deployment @@ -49,40 +50,35 @@ describe("Tx Sign", () => { const { cert, publicKey } = certificateManager.generatePEM(address); const sdl = SDL.fromString(yml, "beta3", "sandbox"); + const { $type, ...message } = MsgCreateDeployment.fromPartial({ + id: { + owner: address, + dseq: Long.fromString(faker.number.int({ min: 0, max: 999999 }).toString(), true) + }, + hash: await sdl.manifestVersion(), + groups: sdl.groups(), + deposit: { denom: config.DEPLOYMENT_GRANT_DENOM, amount: "5000000" }, + depositor: await masterWallet.getFirstAddress() + }); return JSON.stringify({ data: { userId: userId, messages: [ { - typeUrl: "/akash.cert.v1beta3.MsgCreateCertificate", + typeUrl: "/akash.cert.v1.MsgCreateCertificate", value: { owner: address, - cert: Buffer.from(cert).toString("base64"), - pubkey: Buffer.from(publicKey).toString("base64") + cert: Buffer.from(cert), + pubkey: Buffer.from(publicKey) } }, { - typeUrl: "/akash.deployment.v1beta3.MsgCreateDeployment", - value: { - id: { - owner: address, - dseq: await getCurrentHeight() - }, - groups: sdl.groups(), - version: await sdl.manifestVersion(), - deposit: { denom: config.DEPLOYMENT_GRANT_DENOM, amount: "5000000" }, - depositor: await masterWallet.getFirstAddress() - } + typeUrl: `/${$type}`, + value: message } ].map(message => ({ typeUrl: message.typeUrl, value: Buffer.from(registry.encode(message)).toString("base64") })) } }); } - - async function getCurrentHeight() { - // TODO: extract this base url to env var - const response = await axios.get(`https://api.sandbox-01.aksh.pw/blocks/latest`); - return response.data.block.header.height; - } }); diff --git a/apps/api/test/functional/nodes-v1.spec.ts b/apps/api/test/functional/nodes-v1.spec.ts index 711c29874..d81e89ecf 100644 --- a/apps/api/test/functional/nodes-v1.spec.ts +++ b/apps/api/test/functional/nodes-v1.spec.ts @@ -3,7 +3,6 @@ import mcache from "memory-cache"; import nock from "nock"; import { app, initDb } from "@src/app"; -import { closeConnections } from "@src/db/dbConnection"; import { env } from "@src/utils/env"; import { NodeSeeder } from "@test/seeders/node.seeder"; @@ -16,7 +15,6 @@ describe("Nodes API", () => { }); afterAll(async () => { - await closeConnections(); mcache.clear(); }); diff --git a/apps/api/test/functional/sign-and-broadcast-tx.spec.ts b/apps/api/test/functional/sign-and-broadcast-tx.spec.ts index 4ee68d78f..19040ce44 100644 --- a/apps/api/test/functional/sign-and-broadcast-tx.spec.ts +++ b/apps/api/test/functional/sign-and-broadcast-tx.spec.ts @@ -66,11 +66,11 @@ describe("Tx Sign", () => { const { cert, publicKey } = certificateManager.generatePEM(address); const message = { - typeUrl: "/akash.cert.v1beta3.MsgCreateCertificate", + typeUrl: "/akash.cert.v1.MsgCreateCertificate", value: { owner: address, - cert: Buffer.from(cert).toString("base64"), - pubkey: Buffer.from(publicKey).toString("base64") + cert: Buffer.from(cert), + pubkey: Buffer.from(publicKey) } }; diff --git a/apps/api/test/functional/stale-anonymous-users-cleanup.spec.ts b/apps/api/test/functional/stale-anonymous-users-cleanup.spec.ts index ce63b2147..e9f84b9e5 100644 --- a/apps/api/test/functional/stale-anonymous-users-cleanup.spec.ts +++ b/apps/api/test/functional/stale-anonymous-users-cleanup.spec.ts @@ -42,7 +42,8 @@ describe("Users", () => { walletService.createUser() ]); - const staleParams = { lastActiveAt: subDays(new Date(), 91) }; + console.log("DEBUG stale", stale.user.id); + const staleParams = { lastActiveAt: subDays(new Date(), 100) }; await Promise.all([ userRepository.updateById(stale.user.id, staleParams), userRepository.updateById(staleNoWallet.user.id, staleParams), @@ -57,6 +58,38 @@ describe("Users", () => { await controller.cleanUpStaleAnonymousUsers({ dryRun: false }); const [users, wallets] = await Promise.all([userRepository.find(), userWalletRepository.find()]); + console.log( + "DEBUG users", + JSON.stringify( + users.map(user => { + if (user.id === stale.user.id) { + return "stale"; + } + + if (user.id === reactivated.user.id) { + return "reactivated"; + } + + if (user.id === recent.user.id) { + return "recent"; + } + + if (user.id === invalidAddress.user.id) { + return "invalidAddress"; + } + + if (user.id === staleNoWallet.user.id) { + return "staleNoWallet"; + } + + if (user.id === recentNoWallet.user.id) { + return "recentNoWallet"; + } + }), + null, + 2 + ) + ); expect(users).toHaveLength(4); expect(wallets).toHaveLength(3); diff --git a/apps/api/test/functional/start-trial.spec.ts b/apps/api/test/functional/start-trial.spec.ts index 2eae5a324..1888ee1dd 100644 --- a/apps/api/test/functional/start-trial.spec.ts +++ b/apps/api/test/functional/start-trial.spec.ts @@ -82,7 +82,7 @@ describe("start trial", () => { granter: expect.any(String), grantee: userWallet.address, authorization: { - "@type": "/akash.deployment.v1beta3.DepositDeploymentAuthorization", + "@type": "/akash.deployment.v1.DepositAuthorization", spend_limit: { denom: config.DEPLOYMENT_GRANT_DENOM, amount: String(config.TRIAL_DEPLOYMENT_ALLOWANCE_AMOUNT) } }, expiration: expect.any(String) diff --git a/package-lock.json b/package-lock.json index b77413f29..e2d8c03e2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,8 @@ "./apps/*" ], "dependencies": { + "@akashnetwork/console-api": "^2.41.1", + "@bufbuild/protobuf": "^2.0.0", "drizzle-orm": "^0.31.2", "pg": "^8.11.6" }, @@ -29,13 +31,120 @@ "npm": "10.7.0" } }, + "../../go-projects/akash-api/ts": { + "name": "@akashnetwork/akash-api", + "version": "0.0.0", + "license": "Apache-2.0", + "dependencies": { + "rxjs": "^7.8.1" + }, + "devDependencies": { + "@semantic-release/commit-analyzer": "^12.0.0", + "@semantic-release/github": "^10.0.3", + "@semantic-release/release-notes-generator": "^13.0.0", + "@types/jest": "^29.5.12", + "@typescript-eslint/eslint-plugin": "^7.2.0", + "conventional-changelog-conventionalcommits": "^7.0.2", + "eslint": "^8.57.0", + "eslint-plugin-prettier": "^5.1.3", + "eslint-plugin-simple-import-sort": "^12.0.0", + "jest": "^29.7.0", + "lint-staged": "^15.2.2", + "prettier": "^3.2.5", + "rimraf": "^5.0.5", + "semantic-release-commit-filter": "^1.0.2", + "sort-json": "^2.0.1", + "ts-jest": "^29.1.2", + "ts-proto": "^2.2.0", + "typescript": "^5.4.2" + }, + "peerDependencies": { + "@grpc/grpc-js": "^1.10.6" + } + }, + "../akashjs": { + "name": "@akashnetwork/akashjs", + "version": "0.10.1", + "license": "Apache-2.0", + "dependencies": { + "@akashnetwork/akash-api": "file:../../go-projects/akash-api/ts", + "@bufbuild/protobuf": "2.0.0", + "@cosmjs/amino": "^0.32.4", + "@cosmjs/launchpad": "^0.27.1", + "@cosmjs/proto-signing": "^0.32.4", + "@cosmjs/stargate": "^0.32.4", + "@cosmjs/tendermint-rpc": "^0.32.4", + "asn1js": "^2.1.1", + "atob": "^2.1.2", + "axios": "^0.24.0", + "console-browserify": "^1.2.0", + "js-yaml": "^4.1.0", + "json-stable-stringify": "^1.0.2", + "jsrsasign": "^11.1.0", + "keytar": "^7.7.0", + "lodash": "^4.17.21", + "node-fetch": "2", + "pkijs": "^3.0.0", + "process": "^0.11.10", + "pvutils": "^1.0.17", + "simple-jsonrpc-js": "^1.2.0", + "sort-json": "^2.0.1" + }, + "devDependencies": { + "@commitlint/cli": "^19.2.2", + "@commitlint/config-conventional": "^19.2.2", + "@faker-js/faker": "^8.4.1", + "@semantic-release/changelog": "^6.0.3", + "@semantic-release/commit-analyzer": "^12.0.0", + "@semantic-release/git": "^10.0.1", + "@semantic-release/github": "^10.0.3", + "@semantic-release/release-notes-generator": "^13.0.0", + "@types/atob": "^2.1.2", + "@types/dot-object": "^2.1.6", + "@types/jest": "^29.5.12", + "@types/js-yaml": "^4.0.5", + "@types/json-stable-stringify": "^1.0.34", + "@types/lodash": "^4.17.1", + "@types/node-fetch": "2", + "@types/sinon": "^10.0.11", + "@types/tap": "^15.0.5", + "@typescript-eslint/eslint-plugin": "^7.2.0", + "commitlint": "^19.2.2", + "conventional-changelog-conventionalcommits": "^7.0.2", + "dot-object": "^2.1.5", + "husky": "^9.0.11", + "immutability-helper": "^3.1.1", + "jest": "^29.7.0", + "lint-staged": "^15.2.2", + "node-polyfill-webpack-plugin": "^1.1.4", + "prettier": "^3.2.5", + "rimraf": "^5.0.1", + "sinon": "^13.0.1", + "tap": "^15.1.6", + "ts-jest": "^29.1.2", + "ts-loader": "^9.2.3", + "ts-node": "^10.0.0", + "ts-proto": "^1.104.0", + "tsconfig-paths": "^4.2.0", + "typescript": "^4.7.4", + "webpack": "^5.41.1", + "webpack-cli": "^4.7.2" + }, + "engines": { + "node": ">18.0.0" + } + }, + "akashjs": { + "extraneous": true + }, + "apps/akashjs": {}, "apps/api": { "name": "@akashnetwork/console-api", - "version": "2.39.0", + "version": "2.41.1", "license": "Apache-2.0", "dependencies": { - "@akashnetwork/akash-api": "^1.3.0", - "@akashnetwork/akashjs": "^0.10.0", + "@akashnetwork/akash-api": "file:../../../../go-projects/akash-api/ts", + "@akashnetwork/akashjs": "file:../../../akashjs", "@akashnetwork/database": "*", "@akashnetwork/env-loader": "*", "@akashnetwork/http-sdk": "*", @@ -133,6 +242,14 @@ "webpack-node-externals": "^3.0.0" } }, + "apps/api/node_modules/@akashnetwork/akash-api": { + "resolved": "../../go-projects/akash-api/ts", + "link": true + }, + "apps/api/node_modules/@akashnetwork/akashjs": { + "resolved": "apps/akashjs", + "link": true + }, "apps/api/node_modules/@cosmjs/crypto": { "version": "0.32.4", "resolved": "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.32.4.tgz", @@ -230,8 +347,8 @@ "version": "2.25.4", "license": "Apache-2.0", "dependencies": { - "@akashnetwork/akash-api": "^1.3.0", - "@akashnetwork/akashjs": "^0.10.0", + "@akashnetwork/akash-api": "file:../../../../go-projects/akash-api/ts", + "@akashnetwork/akashjs": "file:../../../akashjs", "@akashnetwork/env-loader": "*", "@akashnetwork/http-sdk": "*", "@akashnetwork/logging": "*", @@ -358,6 +475,10 @@ "typescript": "5.1.3" } }, + "apps/deploy-web/node_modules/@akashnetwork/akash-api": { + "resolved": "../../go-projects/akash-api/ts", + "link": true + }, "apps/deploy-web/node_modules/@cosmjs/encoding": { "version": "0.32.4", "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.32.4.tgz", @@ -746,6 +867,9 @@ "url": "https://github.com/sponsors/kossnocorp" } }, + "go-projects/akash-api/ts": { + "extraneous": true + }, "node_modules/@akashnetwork/akash-api": { "version": "1.4.0", "license": "Apache-2.0", @@ -757,127 +881,8 @@ } }, "node_modules/@akashnetwork/akashjs": { - "version": "0.10.0", - "license": "Apache-2.0", - "dependencies": { - "@akashnetwork/akash-api": "^1.4.0", - "@cosmjs/launchpad": "^0.27.0", - "@cosmjs/proto-signing": "^0.28.11", - "@cosmjs/stargate": "^0.28.0", - "@cosmjs/tendermint-rpc": "^0.28.11", - "asn1js": "^2.1.1", - "atob": "^2.1.2", - "axios": "^0.24.0", - "console-browserify": "^1.2.0", - "cosmwasm": "^1.1.1", - "js-yaml": "^4.1.0", - "json-stable-stringify": "^1.0.2", - "jsrsasign": "^11.1.0", - "keytar": "^7.7.0", - "node-fetch": "2", - "pkijs": "^3.0.0", - "process": "^0.11.10", - "pvutils": "^1.0.17", - "simple-jsonrpc-js": "^1.2.0", - "sort-json": "^2.0.1" - }, - "engines": { - "node": ">18.0.0" - } - }, - "node_modules/@akashnetwork/akashjs/node_modules/@cosmjs/amino": { - "version": "0.28.13", - "license": "Apache-2.0", - "dependencies": { - "@cosmjs/crypto": "0.28.13", - "@cosmjs/encoding": "0.28.13", - "@cosmjs/math": "0.28.13", - "@cosmjs/utils": "0.28.13" - } - }, - "node_modules/@akashnetwork/akashjs/node_modules/@cosmjs/json-rpc": { - "version": "0.28.13", - "license": "Apache-2.0", - "dependencies": { - "@cosmjs/stream": "0.28.13", - "xstream": "^11.14.0" - } - }, - "node_modules/@akashnetwork/akashjs/node_modules/@cosmjs/proto-signing": { - "version": "0.28.13", - "license": "Apache-2.0", - "dependencies": { - "@cosmjs/amino": "0.28.13", - "@cosmjs/crypto": "0.28.13", - "@cosmjs/encoding": "0.28.13", - "@cosmjs/math": "0.28.13", - "@cosmjs/utils": "0.28.13", - "cosmjs-types": "^0.4.0", - "long": "^4.0.0" - } - }, - "node_modules/@akashnetwork/akashjs/node_modules/@cosmjs/socket": { - "version": "0.28.13", - "license": "Apache-2.0", - "dependencies": { - "@cosmjs/stream": "0.28.13", - "isomorphic-ws": "^4.0.1", - "ws": "^7", - "xstream": "^11.14.0" - } - }, - "node_modules/@akashnetwork/akashjs/node_modules/@cosmjs/stream": { - "version": "0.28.13", - "license": "Apache-2.0", - "dependencies": { - "xstream": "^11.14.0" - } - }, - "node_modules/@akashnetwork/akashjs/node_modules/@cosmjs/tendermint-rpc": { - "version": "0.28.13", - "license": "Apache-2.0", - "dependencies": { - "@cosmjs/crypto": "0.28.13", - "@cosmjs/encoding": "0.28.13", - "@cosmjs/json-rpc": "0.28.13", - "@cosmjs/math": "0.28.13", - "@cosmjs/socket": "0.28.13", - "@cosmjs/stream": "0.28.13", - "@cosmjs/utils": "0.28.13", - "axios": "^0.21.2", - "readonly-date": "^1.0.0", - "xstream": "^11.14.0" - } - }, - "node_modules/@akashnetwork/akashjs/node_modules/@cosmjs/tendermint-rpc/node_modules/axios": { - "version": "0.21.4", - "license": "MIT", - "dependencies": { - "follow-redirects": "^1.14.0" - } - }, - "node_modules/@akashnetwork/akashjs/node_modules/@cosmjs/utils": { - "version": "0.28.13", - "license": "Apache-2.0" - }, - "node_modules/@akashnetwork/akashjs/node_modules/axios": { - "version": "0.24.0", - "license": "MIT", - "dependencies": { - "follow-redirects": "^1.14.4" - } - }, - "node_modules/@akashnetwork/akashjs/node_modules/cosmjs-types": { - "version": "0.4.1", - "license": "Apache-2.0", - "dependencies": { - "long": "^4.0.0", - "protobufjs": "~6.11.2" - } - }, - "node_modules/@akashnetwork/akashjs/node_modules/long": { - "version": "4.0.0", - "license": "Apache-2.0" + "resolved": "../akashjs", + "link": true }, "node_modules/@akashnetwork/console-api": { "resolved": "apps/api", @@ -2837,6 +2842,11 @@ "version": "0.2.3", "license": "MIT" }, + "node_modules/@bufbuild/protobuf": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@bufbuild/protobuf/-/protobuf-2.0.0.tgz", + "integrity": "sha512-sw2JhwJyvyL0zlhG61aDzOVryEfJg2PDZFSV7i7IdC7nAE41WuXCru3QWLGiP87At0BMzKOoKO/FqEGoKygGZQ==" + }, "node_modules/@casl/ability": { "version": "6.7.2", "resolved": "https://registry.npmjs.org/@casl/ability/-/ability-6.7.2.tgz", @@ -3397,249 +3407,6 @@ "bn.js": "^5.2.0" } }, - "node_modules/@cosmjs/cli": { - "version": "0.28.13", - "license": "Apache-2.0", - "dependencies": { - "@cosmjs/amino": "0.28.13", - "@cosmjs/cosmwasm-stargate": "0.28.13", - "@cosmjs/crypto": "0.28.13", - "@cosmjs/encoding": "0.28.13", - "@cosmjs/faucet-client": "0.28.13", - "@cosmjs/math": "0.28.13", - "@cosmjs/proto-signing": "0.28.13", - "@cosmjs/stargate": "0.28.13", - "@cosmjs/tendermint-rpc": "0.28.13", - "@cosmjs/utils": "0.28.13", - "axios": "^0.21.2", - "babylon": "^6.18.0", - "chalk": "^4", - "cosmjs-types": "^0.4.0", - "diff": "^4", - "recast": "^0.20", - "ts-node": "^8", - "typescript": "~4.4", - "yargs": "^15.3.1" - }, - "bin": { - "cosmjs-cli": "bin/cosmjs-cli" - } - }, - "node_modules/@cosmjs/cli/node_modules/@cosmjs/amino": { - "version": "0.28.13", - "license": "Apache-2.0", - "dependencies": { - "@cosmjs/crypto": "0.28.13", - "@cosmjs/encoding": "0.28.13", - "@cosmjs/math": "0.28.13", - "@cosmjs/utils": "0.28.13" - } - }, - "node_modules/@cosmjs/cli/node_modules/@cosmjs/cosmwasm-stargate": { - "version": "0.28.13", - "license": "Apache-2.0", - "dependencies": { - "@cosmjs/amino": "0.28.13", - "@cosmjs/crypto": "0.28.13", - "@cosmjs/encoding": "0.28.13", - "@cosmjs/math": "0.28.13", - "@cosmjs/proto-signing": "0.28.13", - "@cosmjs/stargate": "0.28.13", - "@cosmjs/tendermint-rpc": "0.28.13", - "@cosmjs/utils": "0.28.13", - "cosmjs-types": "^0.4.0", - "long": "^4.0.0", - "pako": "^2.0.2" - } - }, - "node_modules/@cosmjs/cli/node_modules/@cosmjs/json-rpc": { - "version": "0.28.13", - "license": "Apache-2.0", - "dependencies": { - "@cosmjs/stream": "0.28.13", - "xstream": "^11.14.0" - } - }, - "node_modules/@cosmjs/cli/node_modules/@cosmjs/proto-signing": { - "version": "0.28.13", - "license": "Apache-2.0", - "dependencies": { - "@cosmjs/amino": "0.28.13", - "@cosmjs/crypto": "0.28.13", - "@cosmjs/encoding": "0.28.13", - "@cosmjs/math": "0.28.13", - "@cosmjs/utils": "0.28.13", - "cosmjs-types": "^0.4.0", - "long": "^4.0.0" - } - }, - "node_modules/@cosmjs/cli/node_modules/@cosmjs/socket": { - "version": "0.28.13", - "license": "Apache-2.0", - "dependencies": { - "@cosmjs/stream": "0.28.13", - "isomorphic-ws": "^4.0.1", - "ws": "^7", - "xstream": "^11.14.0" - } - }, - "node_modules/@cosmjs/cli/node_modules/@cosmjs/stream": { - "version": "0.28.13", - "license": "Apache-2.0", - "dependencies": { - "xstream": "^11.14.0" - } - }, - "node_modules/@cosmjs/cli/node_modules/@cosmjs/tendermint-rpc": { - "version": "0.28.13", - "license": "Apache-2.0", - "dependencies": { - "@cosmjs/crypto": "0.28.13", - "@cosmjs/encoding": "0.28.13", - "@cosmjs/json-rpc": "0.28.13", - "@cosmjs/math": "0.28.13", - "@cosmjs/socket": "0.28.13", - "@cosmjs/stream": "0.28.13", - "@cosmjs/utils": "0.28.13", - "axios": "^0.21.2", - "readonly-date": "^1.0.0", - "xstream": "^11.14.0" - } - }, - "node_modules/@cosmjs/cli/node_modules/@cosmjs/utils": { - "version": "0.28.13", - "license": "Apache-2.0" - }, - "node_modules/@cosmjs/cli/node_modules/axios": { - "version": "0.21.4", - "license": "MIT", - "dependencies": { - "follow-redirects": "^1.14.0" - } - }, - "node_modules/@cosmjs/cli/node_modules/cliui": { - "version": "6.0.0", - "license": "ISC", - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^6.2.0" - } - }, - "node_modules/@cosmjs/cli/node_modules/cosmjs-types": { - "version": "0.4.1", - "license": "Apache-2.0", - "dependencies": { - "long": "^4.0.0", - "protobufjs": "~6.11.2" - } - }, - "node_modules/@cosmjs/cli/node_modules/find-up": { - "version": "4.1.0", - "license": "MIT", - "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@cosmjs/cli/node_modules/locate-path": { - "version": "5.0.0", - "license": "MIT", - "dependencies": { - "p-locate": "^4.1.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@cosmjs/cli/node_modules/long": { - "version": "4.0.0", - "license": "Apache-2.0" - }, - "node_modules/@cosmjs/cli/node_modules/p-limit": { - "version": "2.3.0", - "license": "MIT", - "dependencies": { - "p-try": "^2.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@cosmjs/cli/node_modules/p-locate": { - "version": "4.1.0", - "license": "MIT", - "dependencies": { - "p-limit": "^2.2.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@cosmjs/cli/node_modules/typescript": { - "version": "4.4.4", - "license": "Apache-2.0", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=4.2.0" - } - }, - "node_modules/@cosmjs/cli/node_modules/wrap-ansi": { - "version": "6.2.0", - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@cosmjs/cli/node_modules/y18n": { - "version": "4.0.3", - "license": "ISC" - }, - "node_modules/@cosmjs/cli/node_modules/yargs": { - "version": "15.4.1", - "license": "MIT", - "dependencies": { - "cliui": "^6.0.0", - "decamelize": "^1.2.0", - "find-up": "^4.1.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^4.2.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^18.1.2" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@cosmjs/cli/node_modules/yargs-parser": { - "version": "18.1.3", - "license": "ISC", - "dependencies": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/@cosmjs/cosmwasm-stargate": { "version": "0.32.4", "resolved": "https://registry.npmjs.org/@cosmjs/cosmwasm-stargate/-/cosmwasm-stargate-0.32.4.tgz", @@ -3706,46 +3473,6 @@ "xstream": "^11.14.0" } }, - "node_modules/@cosmjs/crypto": { - "version": "0.28.13", - "license": "Apache-2.0", - "dependencies": { - "@cosmjs/encoding": "0.28.13", - "@cosmjs/math": "0.28.13", - "@cosmjs/utils": "0.28.13", - "@noble/hashes": "^1", - "bn.js": "^5.2.0", - "elliptic": "^6.5.3", - "libsodium-wrappers": "^0.7.6" - } - }, - "node_modules/@cosmjs/crypto/node_modules/@cosmjs/utils": { - "version": "0.28.13", - "license": "Apache-2.0" - }, - "node_modules/@cosmjs/encoding": { - "version": "0.28.13", - "license": "Apache-2.0", - "dependencies": { - "base64-js": "^1.3.0", - "bech32": "^1.1.4", - "readonly-date": "^1.0.0" - } - }, - "node_modules/@cosmjs/faucet-client": { - "version": "0.28.13", - "license": "Apache-2.0", - "dependencies": { - "axios": "^0.21.2" - } - }, - "node_modules/@cosmjs/faucet-client/node_modules/axios": { - "version": "0.21.4", - "license": "MIT", - "dependencies": { - "follow-redirects": "^1.14.0" - } - }, "node_modules/@cosmjs/json-rpc": { "version": "0.32.4", "license": "Apache-2.0", @@ -3754,106 +3481,6 @@ "xstream": "^11.14.0" } }, - "node_modules/@cosmjs/launchpad": { - "version": "0.27.1", - "license": "Apache-2.0", - "dependencies": { - "@cosmjs/amino": "0.27.1", - "@cosmjs/crypto": "0.27.1", - "@cosmjs/encoding": "0.27.1", - "@cosmjs/math": "0.27.1", - "@cosmjs/utils": "0.27.1", - "axios": "^0.21.2", - "fast-deep-equal": "^3.1.3" - } - }, - "node_modules/@cosmjs/launchpad/node_modules/@cosmjs/amino": { - "version": "0.27.1", - "license": "Apache-2.0", - "dependencies": { - "@cosmjs/crypto": "0.27.1", - "@cosmjs/encoding": "0.27.1", - "@cosmjs/math": "0.27.1", - "@cosmjs/utils": "0.27.1" - } - }, - "node_modules/@cosmjs/launchpad/node_modules/@cosmjs/crypto": { - "version": "0.27.1", - "license": "Apache-2.0", - "dependencies": { - "@cosmjs/encoding": "0.27.1", - "@cosmjs/math": "0.27.1", - "@cosmjs/utils": "0.27.1", - "bip39": "^3.0.2", - "bn.js": "^5.2.0", - "elliptic": "^6.5.3", - "js-sha3": "^0.8.0", - "libsodium-wrappers": "^0.7.6", - "ripemd160": "^2.0.2", - "sha.js": "^2.4.11" - } - }, - "node_modules/@cosmjs/launchpad/node_modules/@cosmjs/encoding": { - "version": "0.27.1", - "license": "Apache-2.0", - "dependencies": { - "base64-js": "^1.3.0", - "bech32": "^1.1.4", - "readonly-date": "^1.0.0" - } - }, - "node_modules/@cosmjs/launchpad/node_modules/@cosmjs/math": { - "version": "0.27.1", - "license": "Apache-2.0", - "dependencies": { - "bn.js": "^5.2.0" - } - }, - "node_modules/@cosmjs/launchpad/node_modules/@cosmjs/utils": { - "version": "0.27.1", - "license": "Apache-2.0" - }, - "node_modules/@cosmjs/launchpad/node_modules/axios": { - "version": "0.21.4", - "license": "MIT", - "dependencies": { - "follow-redirects": "^1.14.0" - } - }, - "node_modules/@cosmjs/ledger-amino": { - "version": "0.28.13", - "license": "Apache-2.0", - "dependencies": { - "@cosmjs/amino": "0.28.13", - "@cosmjs/crypto": "0.28.13", - "@cosmjs/encoding": "0.28.13", - "@cosmjs/math": "0.28.13", - "@cosmjs/utils": "0.28.13", - "ledger-cosmos-js": "^2.1.8", - "semver": "^7.3.2" - } - }, - "node_modules/@cosmjs/ledger-amino/node_modules/@cosmjs/amino": { - "version": "0.28.13", - "license": "Apache-2.0", - "dependencies": { - "@cosmjs/crypto": "0.28.13", - "@cosmjs/encoding": "0.28.13", - "@cosmjs/math": "0.28.13", - "@cosmjs/utils": "0.28.13" - } - }, - "node_modules/@cosmjs/ledger-amino/node_modules/@cosmjs/utils": { - "version": "0.28.13", - "license": "Apache-2.0" - }, - "node_modules/@cosmjs/math": { - "version": "0.28.13", - "license": "Apache-2.0", - "dependencies": { - "bn.js": "^5.2.0" - } - }, "node_modules/@cosmjs/proto-signing": { "version": "0.32.4", "license": "Apache-2.0", @@ -3905,111 +3532,6 @@ "xstream": "^11.14.0" } }, - "node_modules/@cosmjs/stargate": { - "version": "0.28.13", - "license": "Apache-2.0", - "dependencies": { - "@confio/ics23": "^0.6.8", - "@cosmjs/amino": "0.28.13", - "@cosmjs/encoding": "0.28.13", - "@cosmjs/math": "0.28.13", - "@cosmjs/proto-signing": "0.28.13", - "@cosmjs/stream": "0.28.13", - "@cosmjs/tendermint-rpc": "0.28.13", - "@cosmjs/utils": "0.28.13", - "cosmjs-types": "^0.4.0", - "long": "^4.0.0", - "protobufjs": "~6.11.3", - "xstream": "^11.14.0" - } - }, - "node_modules/@cosmjs/stargate/node_modules/@cosmjs/amino": { - "version": "0.28.13", - "license": "Apache-2.0", - "dependencies": { - "@cosmjs/crypto": "0.28.13", - "@cosmjs/encoding": "0.28.13", - "@cosmjs/math": "0.28.13", - "@cosmjs/utils": "0.28.13" - } - }, - "node_modules/@cosmjs/stargate/node_modules/@cosmjs/json-rpc": { - "version": "0.28.13", - "license": "Apache-2.0", - "dependencies": { - "@cosmjs/stream": "0.28.13", - "xstream": "^11.14.0" - } - }, - "node_modules/@cosmjs/stargate/node_modules/@cosmjs/proto-signing": { - "version": "0.28.13", - "license": "Apache-2.0", - "dependencies": { - "@cosmjs/amino": "0.28.13", - "@cosmjs/crypto": "0.28.13", - "@cosmjs/encoding": "0.28.13", - "@cosmjs/math": "0.28.13", - "@cosmjs/utils": "0.28.13", - "cosmjs-types": "^0.4.0", - "long": "^4.0.0" - } - }, - "node_modules/@cosmjs/stargate/node_modules/@cosmjs/socket": { - "version": "0.28.13", - "license": "Apache-2.0", - "dependencies": { - "@cosmjs/stream": "0.28.13", - "isomorphic-ws": "^4.0.1", - "ws": "^7", - "xstream": "^11.14.0" - } - }, - "node_modules/@cosmjs/stargate/node_modules/@cosmjs/stream": { - "version": "0.28.13", - "license": "Apache-2.0", - "dependencies": { - "xstream": "^11.14.0" - } - }, - "node_modules/@cosmjs/stargate/node_modules/@cosmjs/tendermint-rpc": { - "version": "0.28.13", - "license": "Apache-2.0", - "dependencies": { - "@cosmjs/crypto": "0.28.13", - "@cosmjs/encoding": "0.28.13", - "@cosmjs/json-rpc": "0.28.13", - "@cosmjs/math": "0.28.13", - "@cosmjs/socket": "0.28.13", - "@cosmjs/stream": "0.28.13", - "@cosmjs/utils": "0.28.13", - "axios": "^0.21.2", - "readonly-date": "^1.0.0", - "xstream": "^11.14.0" - } - }, - "node_modules/@cosmjs/stargate/node_modules/@cosmjs/utils": { - "version": "0.28.13", - "license": "Apache-2.0" - }, - "node_modules/@cosmjs/stargate/node_modules/axios": { - "version": "0.21.4", - "license": "MIT", - "dependencies": { - "follow-redirects": "^1.14.0" - } - }, - "node_modules/@cosmjs/stargate/node_modules/cosmjs-types": { - "version": "0.4.1", - "license": "Apache-2.0", - "dependencies": { - "long": "^4.0.0", - "protobufjs": "~6.11.2" - } - }, - "node_modules/@cosmjs/stargate/node_modules/long": { - "version": "4.0.0", - "license": "Apache-2.0" - }, "node_modules/@cosmjs/stream": { "version": "0.32.4", "license": "Apache-2.0", @@ -7391,47 +6913,6 @@ "long": "^5.2.3" } }, - "node_modules/@ledgerhq/devices": { - "version": "5.51.1", - "license": "Apache-2.0", - "dependencies": { - "@ledgerhq/errors": "^5.50.0", - "@ledgerhq/logs": "^5.50.0", - "rxjs": "6", - "semver": "^7.3.5" - } - }, - "node_modules/@ledgerhq/devices/node_modules/rxjs": { - "version": "6.6.7", - "license": "Apache-2.0", - "dependencies": { - "tslib": "^1.9.0" - }, - "engines": { - "npm": ">=2.0.0" - } - }, - "node_modules/@ledgerhq/devices/node_modules/tslib": { - "version": "1.14.1", - "license": "0BSD" - }, - "node_modules/@ledgerhq/errors": { - "version": "5.50.0", - "license": "Apache-2.0" - }, - "node_modules/@ledgerhq/hw-transport": { - "version": "5.51.1", - "license": "Apache-2.0", - "dependencies": { - "@ledgerhq/devices": "^5.51.1", - "@ledgerhq/errors": "^5.50.0", - "events": "^3.3.0" - } - }, - "node_modules/@ledgerhq/logs": { - "version": "5.50.0", - "license": "Apache-2.0" - }, "node_modules/@metamask/object-multiplex": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/@metamask/object-multiplex/-/object-multiplex-1.3.0.tgz", @@ -16769,16 +16250,6 @@ "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==", "dev": true }, - "node_modules/asn1js": { - "version": "2.4.0", - "license": "BSD-3-Clause", - "dependencies": { - "pvutils": "^1.1.3" - }, - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/assign-symbols": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", @@ -16788,16 +16259,6 @@ "node": ">=0.10.0" } }, - "node_modules/ast-types": { - "version": "0.14.2", - "license": "MIT", - "dependencies": { - "tslib": "^2.0.1" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/ast-types-flow": { "version": "0.0.8", "license": "MIT" @@ -16834,6 +16295,7 @@ }, "node_modules/atob": { "version": "2.1.2", + "dev": true, "license": "(MIT OR Apache-2.0)", "bin": { "atob": "bin/atob.js" @@ -17178,13 +16640,6 @@ "@babel/core": "^7.0.0" } }, - "node_modules/babylon": { - "version": "6.18.0", - "license": "MIT", - "bin": { - "babylon": "bin/babylon.js" - } - }, "node_modules/bail": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.2.tgz", @@ -17764,13 +17219,6 @@ "node": ">= 0.8" } }, - "node_modules/bytestreamjs": { - "version": "2.0.1", - "license": "BSD-3-Clause", - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/cache-base": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", @@ -18666,9 +18114,6 @@ "node": "^14.18.0 || >=16.10.0" } }, - "node_modules/console-browserify": { - "version": "1.2.0" - }, "node_modules/console-indexer": { "resolved": "apps/indexer", "link": true @@ -19089,130 +18534,6 @@ "version": "0.9.0", "license": "Apache-2.0" }, - "node_modules/cosmwasm": { - "version": "1.1.1", - "license": "Apache-2.0", - "dependencies": { - "@cosmjs/amino": "^0.28.3", - "@cosmjs/cli": "^0.28.3", - "@cosmjs/cosmwasm-stargate": "^0.28.3", - "@cosmjs/crypto": "^0.28.3", - "@cosmjs/encoding": "^0.28.3", - "@cosmjs/faucet-client": "^0.28.3", - "@cosmjs/ledger-amino": "^0.28.3", - "@cosmjs/math": "^0.28.3", - "@cosmjs/proto-signing": "^0.28.3", - "@cosmjs/stargate": "^0.28.3", - "@cosmjs/utils": "^0.28.3" - }, - "bin": { - "cosmwasm": "src/cli/bin/cli" - } - }, - "node_modules/cosmwasm/node_modules/@cosmjs/amino": { - "version": "0.28.13", - "license": "Apache-2.0", - "dependencies": { - "@cosmjs/crypto": "0.28.13", - "@cosmjs/encoding": "0.28.13", - "@cosmjs/math": "0.28.13", - "@cosmjs/utils": "0.28.13" - } - }, - "node_modules/cosmwasm/node_modules/@cosmjs/cosmwasm-stargate": { - "version": "0.28.13", - "license": "Apache-2.0", - "dependencies": { - "@cosmjs/amino": "0.28.13", - "@cosmjs/crypto": "0.28.13", - "@cosmjs/encoding": "0.28.13", - "@cosmjs/math": "0.28.13", - "@cosmjs/proto-signing": "0.28.13", - "@cosmjs/stargate": "0.28.13", - "@cosmjs/tendermint-rpc": "0.28.13", - "@cosmjs/utils": "0.28.13", - "cosmjs-types": "^0.4.0", - "long": "^4.0.0", - "pako": "^2.0.2" - } - }, - "node_modules/cosmwasm/node_modules/@cosmjs/json-rpc": { - "version": "0.28.13", - "license": "Apache-2.0", - "dependencies": { - "@cosmjs/stream": "0.28.13", - "xstream": "^11.14.0" - } - }, - "node_modules/cosmwasm/node_modules/@cosmjs/proto-signing": { - "version": "0.28.13", - "license": "Apache-2.0", - "dependencies": { - "@cosmjs/amino": "0.28.13", - "@cosmjs/crypto": "0.28.13", - "@cosmjs/encoding": "0.28.13", - "@cosmjs/math": "0.28.13", - "@cosmjs/utils": "0.28.13", - "cosmjs-types": "^0.4.0", - "long": "^4.0.0" - } - }, - "node_modules/cosmwasm/node_modules/@cosmjs/socket": { - "version": "0.28.13", - "license": "Apache-2.0", - "dependencies": { - "@cosmjs/stream": "0.28.13", - "isomorphic-ws": "^4.0.1", - "ws": "^7", - "xstream": "^11.14.0" - } - }, - "node_modules/cosmwasm/node_modules/@cosmjs/stream": { - "version": "0.28.13", - "license": "Apache-2.0", - "dependencies": { - "xstream": "^11.14.0" - } - }, - "node_modules/cosmwasm/node_modules/@cosmjs/tendermint-rpc": { - "version": "0.28.13", - "license": "Apache-2.0", - "dependencies": { - "@cosmjs/crypto": "0.28.13", - "@cosmjs/encoding": "0.28.13", - "@cosmjs/json-rpc": "0.28.13", - "@cosmjs/math": "0.28.13", - "@cosmjs/socket": "0.28.13", - "@cosmjs/stream": "0.28.13", - "@cosmjs/utils": "0.28.13", - "axios": "^0.21.2", - "readonly-date": "^1.0.0", - "xstream": "^11.14.0" - } - }, - "node_modules/cosmwasm/node_modules/@cosmjs/utils": { - "version": "0.28.13", - "license": "Apache-2.0" - }, - "node_modules/cosmwasm/node_modules/axios": { - "version": "0.21.4", - "license": "MIT", - "dependencies": { - "follow-redirects": "^1.14.0" - } - }, - "node_modules/cosmwasm/node_modules/cosmjs-types": { - "version": "0.4.1", - "license": "Apache-2.0", - "dependencies": { - "long": "^4.0.0", - "protobufjs": "~6.11.2" - } - }, - "node_modules/cosmwasm/node_modules/long": { - "version": "4.0.0", - "license": "Apache-2.0" - }, "node_modules/create-hash": { "version": "1.2.0", "license": "MIT", @@ -20198,13 +19519,6 @@ "integrity": "sha512-53rsFbGdwMwlF7qvCt0ypLM5V5/Mbl0szB7GPN8y9NCcbknYOeVVXdrXEq+90IwAfrrzt6Hd+u2E2ntakICU8w==", "license": "MIT" }, - "node_modules/detect-indent": { - "version": "5.0.0", - "license": "MIT", - "engines": { - "node": ">=4" - } - }, "node_modules/detect-libc": { "version": "2.0.3", "license": "Apache-2.0", @@ -20257,6 +19571,8 @@ "node_modules/diff": { "version": "4.0.2", "license": "BSD-3-Clause", + "optional": true, + "peer": true, "engines": { "node": ">=0.3.1" } @@ -26024,13 +25340,6 @@ "npm": ">=6" } }, - "node_modules/jsrsasign": { - "version": "11.1.0", - "license": "MIT", - "funding": { - "url": "https://github.com/kjur/jsrsasign#donations" - } - }, "node_modules/jsx-ast-utils": { "version": "3.3.5", "license": "MIT", @@ -26095,15 +25404,6 @@ "node": ">=18" } }, - "node_modules/keytar": { - "version": "7.9.0", - "hasInstallScript": true, - "license": "MIT", - "dependencies": { - "node-addon-api": "^4.3.0", - "prebuild-install": "^7.0.1" - } - }, "node_modules/keyv": { "version": "4.5.4", "license": "MIT", @@ -26281,16 +25581,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/ledger-cosmos-js": { - "version": "2.1.8", - "license": "Apache-2.0", - "dependencies": { - "@babel/runtime": "^7.11.2", - "@ledgerhq/hw-transport": "^5.25.0", - "bech32": "^1.1.4", - "ripemd160": "^2.0.2" - } - }, "node_modules/level": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/level/-/level-8.0.1.tgz", @@ -26346,21 +25636,10 @@ "node": ">= 0.8.0" } }, - "node_modules/libsodium": { - "version": "0.7.13", - "license": "ISC" - }, "node_modules/libsodium-sumo": { "version": "0.7.13", "license": "ISC" }, - "node_modules/libsodium-wrappers": { - "version": "0.7.13", - "license": "ISC", - "dependencies": { - "libsodium": "^0.7.13" - } - }, "node_modules/libsodium-wrappers-sumo": { "version": "0.7.13", "license": "ISC", @@ -29378,10 +28657,6 @@ "node": ">=10" } }, - "node_modules/node-addon-api": { - "version": "4.3.0", - "license": "MIT" - }, "node_modules/node-appwrite": { "version": "14.1.0", "resolved": "https://registry.npmjs.org/node-appwrite/-/node-appwrite-14.1.0.tgz", @@ -31053,32 +30328,6 @@ "pathe": "^1.1.2" } }, - "node_modules/pkijs": { - "version": "3.1.0", - "license": "BSD-3-Clause", - "dependencies": { - "asn1js": "^3.0.5", - "bytestreamjs": "^2.0.0", - "pvtsutils": "^1.3.2", - "pvutils": "^1.1.3", - "tslib": "^2.4.0" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/pkijs/node_modules/asn1js": { - "version": "3.0.5", - "license": "BSD-3-Clause", - "dependencies": { - "pvtsutils": "^1.3.2", - "pvutils": "^1.1.3", - "tslib": "^2.4.0" - }, - "engines": { - "node": ">=12.0.0" - } - }, "node_modules/playwright": { "version": "1.46.1", "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.46.1.tgz", @@ -31765,20 +31014,6 @@ ], "license": "MIT" }, - "node_modules/pvtsutils": { - "version": "1.3.5", - "license": "MIT", - "dependencies": { - "tslib": "^2.6.1" - } - }, - "node_modules/pvutils": { - "version": "1.1.3", - "license": "MIT", - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/qrcode": { "version": "1.5.4", "resolved": "https://registry.npmjs.org/qrcode/-/qrcode-1.5.4.tgz", @@ -32708,26 +31943,6 @@ "node": ">= 12.13.0" } }, - "node_modules/recast": { - "version": "0.20.5", - "license": "MIT", - "dependencies": { - "ast-types": "0.14.2", - "esprima": "~4.0.0", - "source-map": "~0.6.1", - "tslib": "^2.0.1" - }, - "engines": { - "node": ">= 4" - } - }, - "node_modules/recast/node_modules/source-map": { - "version": "0.6.1", - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/recharts": { "version": "2.13.0", "resolved": "https://registry.npmjs.org/recharts/-/recharts-2.13.0.tgz", @@ -34819,10 +34034,6 @@ "simple-concat": "^1.0.0" } }, - "node_modules/simple-jsonrpc-js": { - "version": "1.2.0", - "license": "MIT" - }, "node_modules/simple-swizzle": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", @@ -35072,25 +34283,6 @@ "atomic-sleep": "^1.0.0" } }, - "node_modules/sort-json": { - "version": "2.0.1", - "license": "MIT", - "dependencies": { - "detect-indent": "^5.0.0", - "detect-newline": "^2.1.0", - "minimist": "^1.2.0" - }, - "bin": { - "sort-json": "app/cmd.js" - } - }, - "node_modules/sort-json/node_modules/detect-newline": { - "version": "2.1.0", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/source-list-map": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz", @@ -36809,52 +36001,6 @@ "license": "MIT", "peer": true }, - "node_modules/ts-node": { - "version": "8.10.2", - "license": "MIT", - "dependencies": { - "arg": "^4.1.0", - "diff": "^4.0.1", - "make-error": "^1.1.1", - "source-map-support": "^0.5.17", - "yn": "3.1.1" - }, - "bin": { - "ts-node": "dist/bin.js", - "ts-node-script": "dist/bin-script.js", - "ts-node-transpile-only": "dist/bin-transpile.js", - "ts-script": "dist/bin-script-deprecated.js" - }, - "engines": { - "node": ">=6.0.0" - }, - "peerDependencies": { - "typescript": ">=2.7" - } - }, - "node_modules/ts-node/node_modules/arg": { - "version": "4.1.3", - "license": "MIT" - }, - "node_modules/ts-node/node_modules/buffer-from": { - "version": "1.1.2", - "license": "MIT" - }, - "node_modules/ts-node/node_modules/source-map": { - "version": "0.6.1", - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ts-node/node_modules/source-map-support": { - "version": "0.5.21", - "license": "MIT", - "dependencies": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - }, "node_modules/tsconfig-paths": { "version": "3.15.0", "license": "MIT", @@ -39111,6 +38257,8 @@ "node_modules/yn": { "version": "3.1.1", "license": "MIT", + "optional": true, + "peer": true, "engines": { "node": ">=6" } diff --git a/package.json b/package.json index 6f1b4235b..fa01dc39a 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,8 @@ "dc": "dc" }, "dependencies": { + "@akashnetwork/console-api": "^2.41.1", + "@bufbuild/protobuf": "^2.0.0", "drizzle-orm": "^0.31.2", "pg": "^8.11.6" }, diff --git a/packages/http-sdk/src/allowance/allowance-http.service.ts b/packages/http-sdk/src/allowance/allowance-http.service.ts index cd2b7d066..694ea76a1 100644 --- a/packages/http-sdk/src/allowance/allowance-http.service.ts +++ b/packages/http-sdk/src/allowance/allowance-http.service.ts @@ -20,7 +20,7 @@ export interface FeeAllowance { export interface ExactDeploymentAllowance { authorization: { - "@type": "/akash.deployment.v1beta3.DepositDeploymentAuthorization"; + "@type": "/akash.deployment.v1.DepositAuthorization"; spend_limit: SpendLimit; }; expiration: string; @@ -71,7 +71,7 @@ export class AllowanceHttpService extends HttpService { async getDeploymentAllowancesForGrantee(address: string) { const allowances = this.extractData(await this.get(`cosmos/authz/v1beta1/grants/grantee/${address}`)); - return allowances.grants.filter(grant => grant.authorization["@type"] === "/akash.deployment.v1beta3.DepositDeploymentAuthorization"); + return allowances.grants.filter(grant => grant.authorization["@type"] === "/akash.deployment.v1.DepositAuthorization"); } async getDeploymentGrantsForGranterAndGrantee(granter: string, grantee: string) { @@ -83,7 +83,7 @@ export class AllowanceHttpService extends HttpService { } }) ); - return allowances.grants.find(grant => grant.authorization["@type"] === "/akash.deployment.v1beta3.DepositDeploymentAuthorization"); + return allowances.grants.find(grant => grant.authorization["@type"] === "/akash.deployment.v1.DepositAuthorization"); } async hasFeeAllowance(granter: string, grantee: string) { @@ -117,7 +117,7 @@ export class AllowanceHttpService extends HttpService { ); nextPageKey = response.pagination.next_key; - await cb(response.grants.filter(grant => grant.authorization["@type"] === "/akash.deployment.v1beta3.DepositDeploymentAuthorization")); + await cb(response.grants.filter(grant => grant.authorization["@type"] === "/akash.deployment.v1.DepositAuthorization")); } while (nextPageKey); } }