diff --git a/.gitbook/core-modules/token-factory.md b/.gitbook/core-modules/token-factory.md index 0c8ffb4fb..c7ef2f8c6 100644 --- a/.gitbook/core-modules/token-factory.md +++ b/.gitbook/core-modules/token-factory.md @@ -19,31 +19,29 @@ Creates a denom of `factory/{creator address}/{subdenom}` given the denom creato Keep in mind that that the `admin` of the token can change the supply (mint or burn new tokens). Its recommended that the `admin` is unset using the `MsgChangeAdmin`, as explained below. ```ts -import { - MsgCreateDenom, -} from "@injectivelabs/sdk-ts"; -import { BigNumberInBase } from "@injectivelabs/utils"; -import { Network } from "@injectivelabs/networks"; +import { MsgCreateDenom } from '@injectivelabs/sdk-ts' +import { BigNumberInBase } from '@injectivelabs/utils' +import { Network } from '@injectivelabs/networks' -const injectiveAddress = "inj1..."; -const privateKey = "0x..."; -const subdenom = "inj-test"; +const injectiveAddress = 'inj1...' +const privateKey = '0x...' +const subdenom = 'inj-test' const msg = MsgCreateDenom.fromJSON({ subdenom, symbol: 'InjTest', name: 'Inj Testing', sender: injectiveAddress, -}); +}) const txHash = await new MsgBroadcasterWithPk({ privateKey, - network: Network.Testnet + network: Network.Testnet, }).broadcast({ - msgs: msg -}); + msgs: msg, +}) -console.log(txHash); +console.log(txHash) ``` #### MsgMint @@ -51,33 +49,31 @@ console.log(txHash); Minting of a specific denom is only allowed for the current admin. Note, the current admin is defaulted to the creator of the denom. ```ts -import { - MsgMint, -} from "@injectivelabs/sdk-ts"; -import { BigNumberInBase } from "@injectivelabs/utils"; -import { Network } from "@injectivelabs/networks"; +import { MsgMint } from '@injectivelabs/sdk-ts' +import { BigNumberInBase } from '@injectivelabs/utils' +import { Network } from '@injectivelabs/networks' -const injectiveAddress = "inj1..."; -const privateKey = "0x..."; -const subdenom = "inj-test"; +const injectiveAddress = 'inj1...' +const privateKey = '0x...' +const subdenom = 'inj-test' const amountToMint = 1_000_000_000 const msg = MsgMint.fromJSON({ sender: injectiveAddress, amount: { denom: `factory/${injectiveAddress}/${subdenom}`, - amount: amountToMint - } -}); + amount: amountToMint, + }, +}) const txHash = await new MsgBroadcasterWithPk({ privateKey, - network: Network.Testnet + network: Network.Testnet, }).broadcast({ - msgs: msg -}); + msgs: msg, +}) -console.log(txHash); +console.log(txHash) ``` #### MsgBurn @@ -85,33 +81,31 @@ console.log(txHash); Burning of a specific denom is only allowed for the current admin. Note, the current admin is defaulted to the creator of the denom. ```ts -import { - MsgBurn, -} from "@injectivelabs/sdk-ts"; -import { BigNumberInBase } from "@injectivelabs/utils"; -import { Network } from "@injectivelabs/networks"; +import { MsgBurn } from '@injectivelabs/sdk-ts' +import { BigNumberInBase } from '@injectivelabs/utils' +import { Network } from '@injectivelabs/networks' -const injectiveAddress = "inj1..."; -const privateKey = "0x..."; -const subdenom = "inj-test"; +const injectiveAddress = 'inj1...' +const privateKey = '0x...' +const subdenom = 'inj-test' const amountToBurn = 1_000_000_000 const msg = MsgBurn.fromJSON({ sender: injectiveAddress, amount: { denom: `factory/${injectiveAddress}/${subdenom}`, - amount: amountToBurn - } -}); + amount: amountToBurn, + }, +}) const txHash = await new MsgBroadcasterWithPk({ privateKey, - network: Network.Testnet + network: Network.Testnet, }).broadcast({ - msgs: msg -}); + msgs: msg, +}) -console.log(txHash); +console.log(txHash) ``` #### MsgSetDenomMetadata @@ -159,7 +153,8 @@ const msg = MsgSetDenomMetadata.fromJSON({ name: '', /** the name of your token */ symbol: '', /** the symbol of your token */ uri: '' /** the logo of your token, should be hosted on IPFS and should be a small webp image */ - denomUnits: denomUnitsIfTokenHas6Decimals /** choose if you want to have 6 or 0 decimals for the token */ + denomUnits: denomUnitsIfTokenHas6Decimals /** choose if you want to have 6 or 0 decimals for the token */, + decimals: 6 /** choose if you want to have 6 or 0 decimals for the token */ } }); @@ -190,7 +185,8 @@ const denom = `factory/${injectiveAddress}/${subdenom}` const msg = MsgChangeAdmin.fromJSON({ denom, sender: injectiveAddress, - newAdmin: 'inj1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqe2hm49' /** SET TO ZERO ADDRESS */, + newAdmin: + 'inj1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqe2hm49' /** SET TO ZERO ADDRESS */, }) const txHash = await new MsgBroadcasterWithPk({ diff --git a/.gitbook/core-modules/tokenfactory.md b/.gitbook/core-modules/tokenfactory.md index 0fe6124cd..c30d1e1cc 100644 --- a/.gitbook/core-modules/tokenfactory.md +++ b/.gitbook/core-modules/tokenfactory.md @@ -147,7 +147,8 @@ const msg = MsgSetDenomMetadata.fromJSON({ name: '', /** the name of your token */, symbol: '' /** the symbol of your token */, uri: '' /** the logo of your token, should be hosted on IPFS and should be a small webp image */ - denomUnits: denomUnitsIfTokenHas6Decimals /** choose if you want to have 6 or 0 decimals for the token */ + denomUnits: denomUnitsIfTokenHas6Decimals /** choose if you want to have 6 or 0 decimals for the token */, + decimals: 6 /** choose if you want to have 6 or 0 decimals for the token */ } }); diff --git a/.github/workflows/canary.yml b/.github/workflows/canary.yml index d986c9065..75e07a732 100644 --- a/.github/workflows/canary.yml +++ b/.github/workflows/canary.yml @@ -9,6 +9,7 @@ on: jobs: publish-canary: runs-on: ubuntu-latest + permissions: write-all if: contains(github.ref_name, 'canary') steps: - name: 'Checkout' # Download code from the repository @@ -16,10 +17,10 @@ jobs: with: fetch-depth: 0 # Checkout all branches and tags - - name: 'Use NodeJS 16' # Setup node using version 14 + - name: 'Use NodeJS 18' # Setup node using version 14 uses: actions/setup-node@v2 # Public action with: - node-version: '16.18.1' + node-version: '18.17.0' - name: 'Setup lerna@6.6.1' run: yarn global add lerna@6.6.1 --ignore-engines @@ -31,6 +32,7 @@ jobs: - name: Build dependencies run: | + lerna clean --yes node etc/bootstrapEnv yarn install --ignore-engines yarn build @@ -44,8 +46,8 @@ jobs: env: GH_TOKEN: ${{ secrets.GH_TOKEN }} run: | - lerna version prerelease --preid dev --force-git-tag --no-changelog --yes - lerna publish from-git --force-git-tag --dist-tag dev --yes --summary-file + lerna version prerelease --preid alpha --force-git-tag --no-changelog --yes + lerna publish from-git --force-git-tag --dist-tag alpha --yes --summary-file - name: 'Broadcast published versions on Slack' run: node etc/slack --api=$SLACK_API --actor=$GIT_ACTOR --commit-message=$GIT_LATEST_COMMIT_MESSAGE diff --git a/jest.config.js b/jest.config.js index 9225d7dee..a34aeaa4a 100644 --- a/jest.config.js +++ b/jest.config.js @@ -151,7 +151,7 @@ module.exports = { testMatch: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[tj]s?(x)'], // An array of regexp pattern strings that are matched against all test paths, matched tests are skipped - testPathIgnorePatterns: ['/node_modules/'], + testPathIgnorePatterns: ['/node_modules/', '/deprecated/'], // The regexp pattern or array of patterns that Jest uses to detect test files // testRegex: [], diff --git a/packages/sdk-ts/package.json b/packages/sdk-ts/package.json index 9b91f3078..f940f36fd 100644 --- a/packages/sdk-ts/package.json +++ b/packages/sdk-ts/package.json @@ -37,13 +37,13 @@ "@cosmjs/proto-signing": "^0.32.3", "@cosmjs/stargate": "^0.32.3", "@ethersproject/bytes": "^5.7.0", - "@injectivelabs/core-proto-ts": "^0.0.21", + "@injectivelabs/core-proto-ts": "0.0.28", "@injectivelabs/dmm-proto-ts": "1.0.20", "@injectivelabs/exceptions": "^1.14.14-beta.2", "@injectivelabs/grpc-web": "^0.0.1", "@injectivelabs/grpc-web-node-http-transport": "^0.0.2", "@injectivelabs/grpc-web-react-native-transport": "^0.0.2", - "@injectivelabs/indexer-proto-ts": "1.11.42", + "@injectivelabs/indexer-proto-ts": "1.11.44", "@injectivelabs/mito-proto-ts": "1.0.65", "@injectivelabs/networks": "^1.14.14-beta.2", "@injectivelabs/test-utils": "^1.14.14-beta.0", diff --git a/packages/sdk-ts/src/client/chain/grpc/ChainGrpcDistributionApi.ts b/packages/sdk-ts/src/client/chain/grpc/ChainGrpcDistributionApi.ts index c7dd1cfc7..95dcef0ea 100644 --- a/packages/sdk-ts/src/client/chain/grpc/ChainGrpcDistributionApi.ts +++ b/packages/sdk-ts/src/client/chain/grpc/ChainGrpcDistributionApi.ts @@ -115,7 +115,10 @@ export class ChainGrpcDistributionApi extends BaseGrpcConsumer { response, ) } catch (e: any) { - if (e.message.includes('does not exist')) { + if ( + e.message.includes('does not exist') || + e.message.includes('no delegation for (address, validator) tuple') + ) { return [] as Coin[] } diff --git a/packages/sdk-ts/src/client/chain/transformers/ChainGrpcExchangeTransformer.ts b/packages/sdk-ts/src/client/chain/transformers/ChainGrpcExchangeTransformer.ts index f550ee950..d2c014073 100644 --- a/packages/sdk-ts/src/client/chain/transformers/ChainGrpcExchangeTransformer.ts +++ b/packages/sdk-ts/src/client/chain/transformers/ChainGrpcExchangeTransformer.ts @@ -1,4 +1,5 @@ import { InjectiveExchangeV1Beta1Query } from '@injectivelabs/core-proto-ts' +import { AtomicMarketOrderAccessLevel } from '@injectivelabs/core-proto-ts/cjs/injective/exchange/v1beta1/exchange' import { IsOptedOutOfRewards, FeeDiscountSchedule, @@ -65,6 +66,29 @@ export class ChainGrpcExchangeTransformer { params.tradingRewardsVestingDuration, 10, ), + liquidatorRewardShareRate: params.liquidatorRewardShareRate, + binaryOptionsMarketInstantListingFee: + params.binaryOptionsMarketInstantListingFee + ? { + amount: params.binaryOptionsMarketInstantListingFee.amount, + denom: params.binaryOptionsMarketInstantListingFee.denom, + } + : undefined, + atomicMarketOrderAccessLevel: + AtomicMarketOrderAccessLevel[params.atomicMarketOrderAccessLevel], + spotAtomicMarketOrderFeeMultiplier: + params.spotAtomicMarketOrderFeeMultiplier, + derivativeAtomicMarketOrderFeeMultiplier: + params.derivativeAtomicMarketOrderFeeMultiplier, + binaryOptionsAtomicMarketOrderFeeMultiplier: + params.binaryOptionsAtomicMarketOrderFeeMultiplier, + minimalProtocolFeeRate: params.minimalProtocolFeeRate, + isInstantDerivativeMarketLaunchEnabled: + params.isInstantDerivativeMarketLaunchEnabled, + postOnlyModeHeightThreshold: params.postOnlyModeHeightThreshold, + marginDecreasePriceTimestampThresholdSeconds: + params.marginDecreasePriceTimestampThresholdSeconds, + exchangeAdmins: params.exchangeAdmins, } } diff --git a/packages/sdk-ts/src/client/chain/types/exchange.ts b/packages/sdk-ts/src/client/chain/types/exchange.ts index ef9b8efff..dc229f157 100644 --- a/packages/sdk-ts/src/client/chain/types/exchange.ts +++ b/packages/sdk-ts/src/client/chain/types/exchange.ts @@ -89,6 +89,17 @@ export interface ExchangeParams { maxDerivativeOrderSideCount: number injRewardStakedRequirementThreshold: string tradingRewardsVestingDuration: number + liquidatorRewardShareRate: string + binaryOptionsMarketInstantListingFee?: Coin + atomicMarketOrderAccessLevel: string + spotAtomicMarketOrderFeeMultiplier: string + derivativeAtomicMarketOrderFeeMultiplier: string + binaryOptionsAtomicMarketOrderFeeMultiplier: string + minimalProtocolFeeRate: string + isInstantDerivativeMarketLaunchEnabled: boolean + postOnlyModeHeightThreshold: string + marginDecreasePriceTimestampThresholdSeconds: string + exchangeAdmins: string[] } export interface ExchangeModuleParams extends ExchangeParams { diff --git a/packages/sdk-ts/src/client/indexer/grpc/IndexerGrpcArchiverApi.ts b/packages/sdk-ts/src/client/indexer/grpc/IndexerGrpcArchiverApi.ts index cad0c872f..156d4231a 100644 --- a/packages/sdk-ts/src/client/indexer/grpc/IndexerGrpcArchiverApi.ts +++ b/packages/sdk-ts/src/client/indexer/grpc/IndexerGrpcArchiverApi.ts @@ -2,7 +2,7 @@ import { UnspecifiedErrorCode, GrpcUnaryRequestException, } from '@injectivelabs/exceptions' -import { InjectiveArchiverRPC } from '@injectivelabs/indexer-proto-ts' +import { InjectiveArchiverRpc } from '@injectivelabs/indexer-proto-ts' import BaseGrpcConsumer from '../../base/BaseIndexerGrpcConsumer' import { IndexerModule } from '../types' import { IndexerGrpcArchiverTransformer } from '../transformers' @@ -13,12 +13,12 @@ import { IndexerGrpcArchiverTransformer } from '../transformers' export class IndexerGrpcArchiverApi extends BaseGrpcConsumer { protected module: string = IndexerModule.Archiver - protected client: InjectiveArchiverRPC.InjectiveArchiverRPCClientImpl + protected client: InjectiveArchiverRpc.InjectiveArchiverRPCClientImpl constructor(endpoint: string) { super(endpoint) - this.client = new InjectiveArchiverRPC.InjectiveArchiverRPCClientImpl( + this.client = new InjectiveArchiverRpc.InjectiveArchiverRPCClientImpl( this.getGrpcWebImpl(endpoint), ) } @@ -30,13 +30,13 @@ export class IndexerGrpcArchiverApi extends BaseGrpcConsumer { account: string resolution: string }) { - const request = InjectiveArchiverRPC.BalanceRequest.create() + const request = InjectiveArchiverRpc.BalanceRequest.create() request.account = account request.resolution = resolution try { - const response = await this.retry( + const response = await this.retry( () => this.client.Balance(request), ) @@ -44,7 +44,7 @@ export class IndexerGrpcArchiverApi extends BaseGrpcConsumer { response, ) } catch (e: unknown) { - if (e instanceof InjectiveArchiverRPC.GrpcWebError) { + if (e instanceof InjectiveArchiverRpc.GrpcWebError) { throw new GrpcUnaryRequestException(new Error(e.toString()), { code: e.code, context: 'Historical Balance', @@ -67,13 +67,13 @@ export class IndexerGrpcArchiverApi extends BaseGrpcConsumer { account: string resolution: string }) { - const request = InjectiveArchiverRPC.RpnlRequest.create() + const request = InjectiveArchiverRpc.RpnlRequest.create() request.account = account request.resolution = resolution try { - const response = await this.retry(() => + const response = await this.retry(() => this.client.Rpnl(request), ) @@ -81,7 +81,7 @@ export class IndexerGrpcArchiverApi extends BaseGrpcConsumer { response, ) } catch (e: unknown) { - if (e instanceof InjectiveArchiverRPC.GrpcWebError) { + if (e instanceof InjectiveArchiverRpc.GrpcWebError) { throw new GrpcUnaryRequestException(new Error(e.toString()), { code: e.code, context: 'Historical Rpnl', @@ -104,13 +104,13 @@ export class IndexerGrpcArchiverApi extends BaseGrpcConsumer { account: string resolution: string }) { - const request = InjectiveArchiverRPC.VolumesRequest.create() + const request = InjectiveArchiverRpc.VolumesRequest.create() request.account = account request.resolution = resolution try { - const response = await this.retry( + const response = await this.retry( () => this.client.Volumes(request), ) @@ -118,7 +118,7 @@ export class IndexerGrpcArchiverApi extends BaseGrpcConsumer { response, ) } catch (e: unknown) { - if (e instanceof InjectiveArchiverRPC.GrpcWebError) { + if (e instanceof InjectiveArchiverRpc.GrpcWebError) { throw new GrpcUnaryRequestException(new Error(e.toString()), { code: e.code, context: 'Historical Volumes', diff --git a/packages/sdk-ts/src/client/indexer/transformers/IndexerGrpcArchiverTransformer.ts b/packages/sdk-ts/src/client/indexer/transformers/IndexerGrpcArchiverTransformer.ts index dfbecc95c..6a78d5f99 100644 --- a/packages/sdk-ts/src/client/indexer/transformers/IndexerGrpcArchiverTransformer.ts +++ b/packages/sdk-ts/src/client/indexer/transformers/IndexerGrpcArchiverTransformer.ts @@ -3,14 +3,14 @@ import { HistoricalBalance, HistoricalVolumes, } from '../types/archiver' -import { InjectiveArchiverRPC } from '@injectivelabs/indexer-proto-ts' +import { InjectiveArchiverRpc } from '@injectivelabs/indexer-proto-ts' /** * @category Indexer Grpc Transformer */ export class IndexerGrpcArchiverTransformer { static grpcHistoricalBalanceToHistoricalBalance( - historicalBalance: InjectiveArchiverRPC.HistoricalBalance, + historicalBalance: InjectiveArchiverRpc.HistoricalBalance, ): HistoricalBalance { return { t: historicalBalance.t, @@ -19,7 +19,7 @@ export class IndexerGrpcArchiverTransformer { } static grpcHistoricalRPNLToHistoricalRPNL( - historicalRPNL: InjectiveArchiverRPC.HistoricalRPNL, + historicalRPNL: InjectiveArchiverRpc.HistoricalRPNL, ): HistoricalRPNL { return { t: historicalRPNL.t, @@ -28,7 +28,7 @@ export class IndexerGrpcArchiverTransformer { } static grpcHistoricalVolumesToHistoricalVolumes( - historicalVolumes: InjectiveArchiverRPC.HistoricalVolumes, + historicalVolumes: InjectiveArchiverRpc.HistoricalVolumes, ): HistoricalVolumes { return { t: historicalVolumes.t, @@ -37,7 +37,7 @@ export class IndexerGrpcArchiverTransformer { } static grpcHistoricalBalanceResponseToHistoricalBalances( - response: InjectiveArchiverRPC.BalanceResponse, + response: InjectiveArchiverRpc.BalanceResponse, ): HistoricalBalance { if (!response.historicalBalance) { return { t: [], v: [] } @@ -49,7 +49,7 @@ export class IndexerGrpcArchiverTransformer { } static grpcHistoricalRPNLResponseToHistoricalRPNL( - response: InjectiveArchiverRPC.RpnlResponse, + response: InjectiveArchiverRpc.RpnlResponse, ): HistoricalRPNL { if (!response.historicalRpnl) { return { t: [], v: [] } @@ -61,7 +61,7 @@ export class IndexerGrpcArchiverTransformer { } static grpcHistoricalVolumesResponseToHistoricalVolumes( - response: InjectiveArchiverRPC.VolumesResponse, + response: InjectiveArchiverRpc.VolumesResponse, ): HistoricalVolumes { if (!response.historicalVolumes) { return { t: [], v: [] } diff --git a/packages/sdk-ts/src/client/indexer/transformers/IndexerGrpcDerivativeTransformer.ts b/packages/sdk-ts/src/client/indexer/transformers/IndexerGrpcDerivativeTransformer.ts index 8fcbf19ff..65c6d65c9 100644 --- a/packages/sdk-ts/src/client/indexer/transformers/IndexerGrpcDerivativeTransformer.ts +++ b/packages/sdk-ts/src/client/indexer/transformers/IndexerGrpcDerivativeTransformer.ts @@ -338,8 +338,9 @@ export class IndexerGrpcDerivativeTransformer { makerFeeRate: market.makerFeeRate, takerFeeRate: market.takerFeeRate, serviceProviderFee: market.serviceProviderFee, - minPriceTickSize: market.minPriceTickSize, - minQuantityTickSize: market.minQuantityTickSize, + minPriceTickSize: new BigNumber(market.minPriceTickSize).toNumber(), + minQuantityTickSize: new BigNumber(market.minQuantityTickSize).toNumber(), + minNotional: new BigNumber(market.minNotional).toNumber(), settlementPrice: market.settlementPrice, } } @@ -375,6 +376,7 @@ export class IndexerGrpcDerivativeTransformer { serviceProviderFee: market.serviceProviderFee, minPriceTickSize: new BigNumber(market.minPriceTickSize).toNumber(), minQuantityTickSize: new BigNumber(market.minQuantityTickSize).toNumber(), + minNotional: new BigNumber(market.minNotional).toNumber(), perpetualMarketInfo: IndexerGrpcDerivativeTransformer.grpcPerpetualMarketInfoToPerpetualMarketInfo( market.perpetualMarketInfo, diff --git a/packages/sdk-ts/src/client/indexer/transformers/IndexerGrpcSpotTransformer.ts b/packages/sdk-ts/src/client/indexer/transformers/IndexerGrpcSpotTransformer.ts index 830cd9254..46cbb4d99 100644 --- a/packages/sdk-ts/src/client/indexer/transformers/IndexerGrpcSpotTransformer.ts +++ b/packages/sdk-ts/src/client/indexer/transformers/IndexerGrpcSpotTransformer.ts @@ -171,6 +171,7 @@ export class IndexerGrpcSpotTransformer { serviceProviderFee: market.serviceProviderFee, minPriceTickSize: new BigNumber(market.minPriceTickSize).toNumber(), minQuantityTickSize: new BigNumber(market.minQuantityTickSize).toNumber(), + minNotional: new BigNumber(market.minNotional).toNumber(), } } diff --git a/packages/sdk-ts/src/client/indexer/types/archiver.ts b/packages/sdk-ts/src/client/indexer/types/archiver.ts index 77a9f1c83..c8db28bf6 100644 --- a/packages/sdk-ts/src/client/indexer/types/archiver.ts +++ b/packages/sdk-ts/src/client/indexer/types/archiver.ts @@ -1,4 +1,4 @@ -import { InjectiveArchiverRPC } from '@injectivelabs/indexer-proto-ts' +import { InjectiveArchiverRpc } from '@injectivelabs/indexer-proto-ts' export interface HistoricalBalance { t: number[] @@ -15,6 +15,6 @@ export interface HistoricalVolumes { v: number[] } -export type GrpcHistoricalRPNL = InjectiveArchiverRPC.HistoricalRPNL -export type GrpcHistoricalBalance = InjectiveArchiverRPC.HistoricalBalance -export type GrpcHistoricalVolumes = InjectiveArchiverRPC.HistoricalVolumes +export type GrpcHistoricalRPNL = InjectiveArchiverRpc.HistoricalRPNL +export type GrpcHistoricalBalance = InjectiveArchiverRpc.HistoricalBalance +export type GrpcHistoricalVolumes = InjectiveArchiverRpc.HistoricalVolumes diff --git a/packages/sdk-ts/src/client/indexer/types/derivatives.ts b/packages/sdk-ts/src/client/indexer/types/derivatives.ts index 3d1411f31..2354d2e7f 100644 --- a/packages/sdk-ts/src/client/indexer/types/derivatives.ts +++ b/packages/sdk-ts/src/client/indexer/types/derivatives.ts @@ -63,8 +63,9 @@ export interface BaseDerivativeMarket { quoteToken: TokenMeta | undefined takerFeeRate: string serviceProviderFee: string - minPriceTickSize: number | string - minQuantityTickSize: number | string + minPriceTickSize: number + minQuantityTickSize: number + minNotional: number } export interface PerpetualMarket extends BaseDerivativeMarket { @@ -99,8 +100,9 @@ export interface BinaryOptionsMarket expirationTimestamp: number settlementTimestamp: number serviceProviderFee: string - minPriceTickSize: string - minQuantityTickSize: string + minPriceTickSize: number + minQuantityTickSize: number + minNotional: number settlementPrice: string } diff --git a/packages/sdk-ts/src/client/indexer/types/spot.ts b/packages/sdk-ts/src/client/indexer/types/spot.ts index 523cd3b06..4b74e8727 100644 --- a/packages/sdk-ts/src/client/indexer/types/spot.ts +++ b/packages/sdk-ts/src/client/indexer/types/spot.ts @@ -24,6 +24,7 @@ export interface SpotMarket { serviceProviderFee: string minPriceTickSize: number minQuantityTickSize: number + minNotional: number } export interface SpotLimitOrder { diff --git a/packages/sdk-ts/src/client/indexer/types/token b/packages/sdk-ts/src/client/indexer/types/token deleted file mode 100644 index e69de29bb..000000000 diff --git a/packages/sdk-ts/src/core/modules/auction/msgs/MsgBid.ts b/packages/sdk-ts/src/core/modules/auction/msgs/MsgBid.ts index 839a3a17e..6b119f32e 100644 --- a/packages/sdk-ts/src/core/modules/auction/msgs/MsgBid.ts +++ b/packages/sdk-ts/src/core/modules/auction/msgs/MsgBid.ts @@ -10,8 +10,8 @@ export declare namespace MsgBid { round: number injectiveAddress: string amount: { - amount: string denom: string + amount: string } } @@ -30,13 +30,15 @@ export default class MsgBid extends MsgBase { const { params } = this const amountCoin = CosmosBaseV1Beta1Coin.Coin.create() - amountCoin.amount = params.amount.amount + amountCoin.denom = params.amount.denom + amountCoin.amount = params.amount.amount const message = InjectiveAuctionV1Beta1Tx.MsgBid.create() + message.sender = params.injectiveAddress - message.round = params.round.toString() message.bidAmount = amountCoin + message.round = params.round.toString() return InjectiveAuctionV1Beta1Tx.MsgBid.fromPartial(message) } diff --git a/packages/sdk-ts/src/core/modules/authz/msgs/MsgExec.ts b/packages/sdk-ts/src/core/modules/authz/msgs/MsgExec.ts index 74eb89002..94b0f9215 100644 --- a/packages/sdk-ts/src/core/modules/authz/msgs/MsgExec.ts +++ b/packages/sdk-ts/src/core/modules/authz/msgs/MsgExec.ts @@ -1,4 +1,3 @@ -import snakecaseKeys from 'snakecase-keys' import { MsgBase } from '../../MsgBase' import type { Msgs } from '../../msgs' import { @@ -44,6 +43,7 @@ export default class MsgExec extends MsgBase< const actualMsgs = msgs.map((msg) => { const msgValue = GoogleProtobufAny.Any.create() + msgValue.typeUrl = msg.toDirectSign().type msgValue.value = msg.toBinary() @@ -65,15 +65,17 @@ export default class MsgExec extends MsgBase< } public toAmino() { - const proto = this.toProto() - const message = { - ...snakecaseKeys(proto), - msgs: proto.msgs, - } + const { params } = this + const msgs = Array.isArray(params.msgs) ? params.msgs : [params.msgs] return { type: 'cosmos-sdk/MsgExec', - value: message as unknown as MsgExec.Object, + value: { + grantee: params.grantee, + msgs: msgs.map((msg) => { + return msg.toEip712() + }), + }, } } diff --git a/packages/sdk-ts/src/core/modules/authz/msgs/MsgGrant.ts b/packages/sdk-ts/src/core/modules/authz/msgs/MsgGrant.ts index 2e4b2a472..8d1c247ce 100644 --- a/packages/sdk-ts/src/core/modules/authz/msgs/MsgGrant.ts +++ b/packages/sdk-ts/src/core/modules/authz/msgs/MsgGrant.ts @@ -61,8 +61,9 @@ export default class MsgGrant extends MsgBase { grant.expiration = new Date(Number(timestamp.seconds) * 1000) const message = CosmosAuthzV1Beta1Tx.MsgGrant.create() - message.grantee = params.grantee + message.granter = params.granter + message.grantee = params.grantee message.grant = grant return CosmosAuthzV1Beta1Tx.MsgGrant.fromJSON(message) @@ -110,7 +111,6 @@ export default class MsgGrant extends MsgBase { const messageWithAuthorizationType = snakecaseKeys({ ...message, grant: { - ...message.grant, authorization: { type: 'cosmos-sdk/GenericAuthorization', value: { msg: genericAuthorization.msg }, @@ -200,6 +200,7 @@ export default class MsgGrant extends MsgBase { ) const timestamp = GoogleProtobufTimestamp.Timestamp.create() + const timestampInSeconds = ( expiration.getTime() / 1000 + (params.expiryInSeconds || 0) diff --git a/packages/sdk-ts/src/core/modules/authz/msgs/MsgRevoke.ts b/packages/sdk-ts/src/core/modules/authz/msgs/MsgRevoke.ts index 30e48bfdc..4c708b2f2 100644 --- a/packages/sdk-ts/src/core/modules/authz/msgs/MsgRevoke.ts +++ b/packages/sdk-ts/src/core/modules/authz/msgs/MsgRevoke.ts @@ -27,8 +27,8 @@ export default class MsgRevoke extends MsgBase< const { params } = this const message = CosmosAuthzV1Beta1Tx.MsgRevoke.create() - message.grantee = params.grantee message.granter = params.granter + message.grantee = params.grantee message.msgTypeUrl = params.messageType return CosmosAuthzV1Beta1Tx.MsgRevoke.fromPartial(message) diff --git a/packages/sdk-ts/src/core/modules/bank/msgs/MsgMultiSend.ts b/packages/sdk-ts/src/core/modules/bank/msgs/MsgMultiSend.ts index 050ee36ec..9dfe6a91c 100644 --- a/packages/sdk-ts/src/core/modules/bank/msgs/MsgMultiSend.ts +++ b/packages/sdk-ts/src/core/modules/bank/msgs/MsgMultiSend.ts @@ -42,8 +42,8 @@ export default class MsgMultiSend extends MsgBase< input.coins = i.coins.map((c) => { const coin = CosmosBaseV1Beta1Coin.Coin.create() - coin.amount = c.amount coin.denom = c.denom + coin.amount = c.amount return coin }) @@ -58,8 +58,8 @@ export default class MsgMultiSend extends MsgBase< output.coins = o.coins.map((c) => { const coin = CosmosBaseV1Beta1Coin.Coin.create() - coin.amount = c.amount coin.denom = c.denom + coin.amount = c.amount return coin }) @@ -68,6 +68,7 @@ export default class MsgMultiSend extends MsgBase< }) const message = CosmosBankV1Beta1Tx.MsgMultiSend.create() + message.inputs = inputs message.outputs = outputs diff --git a/packages/sdk-ts/src/core/modules/bank/msgs/MsgSend.ts b/packages/sdk-ts/src/core/modules/bank/msgs/MsgSend.ts index 163cf53ec..9c10bebb1 100644 --- a/packages/sdk-ts/src/core/modules/bank/msgs/MsgSend.ts +++ b/packages/sdk-ts/src/core/modules/bank/msgs/MsgSend.ts @@ -39,13 +39,15 @@ export default class MsgSend extends MsgBase { : [params.amount] const amountsToSend = amounts.map((amount) => { const amountToSend = CosmosBaseV1Beta1Coin.Coin.create() - amountToSend.amount = amount.amount + amountToSend.denom = amount.denom + amountToSend.amount = amount.amount return amountToSend }) const message = CosmosBankV1Beta1Tx.MsgSend.create() + message.fromAddress = params.srcInjectiveAddress message.toAddress = params.dstInjectiveAddress message.amount = amountsToSend diff --git a/packages/sdk-ts/src/core/modules/distribution/msgs/MsgWithdrawDelegatorReward.ts b/packages/sdk-ts/src/core/modules/distribution/msgs/MsgWithdrawDelegatorReward.ts index 5389d4025..cdb93f4e6 100644 --- a/packages/sdk-ts/src/core/modules/distribution/msgs/MsgWithdrawDelegatorReward.ts +++ b/packages/sdk-ts/src/core/modules/distribution/msgs/MsgWithdrawDelegatorReward.ts @@ -29,6 +29,7 @@ export default class MsgWithdrawDelegatorReward extends MsgBase< const message = CosmosDistributionV1Beta1Tx.MsgWithdrawDelegatorReward.create() + message.delegatorAddress = params.delegatorAddress message.validatorAddress = params.validatorAddress diff --git a/packages/sdk-ts/src/core/modules/distribution/msgs/MsgWithdrawValidatorCommission.ts b/packages/sdk-ts/src/core/modules/distribution/msgs/MsgWithdrawValidatorCommission.ts index 4e91e6fc5..1c2150634 100644 --- a/packages/sdk-ts/src/core/modules/distribution/msgs/MsgWithdrawValidatorCommission.ts +++ b/packages/sdk-ts/src/core/modules/distribution/msgs/MsgWithdrawValidatorCommission.ts @@ -28,6 +28,7 @@ export default class MsgWithdrawValidatorCommission extends MsgBase< const message = CosmosDistributionV1Beta1Tx.MsgWithdrawValidatorCommission.create() + message.validatorAddress = params.validatorAddress return message diff --git a/packages/sdk-ts/src/core/modules/exchange/msgs/MsgAdminUpdateBinaryOptionsMarket.ts b/packages/sdk-ts/src/core/modules/exchange/msgs/MsgAdminUpdateBinaryOptionsMarket.ts index 351107a3a..b8dad42b1 100644 --- a/packages/sdk-ts/src/core/modules/exchange/msgs/MsgAdminUpdateBinaryOptionsMarket.ts +++ b/packages/sdk-ts/src/core/modules/exchange/msgs/MsgAdminUpdateBinaryOptionsMarket.ts @@ -35,11 +35,12 @@ export default class MsgAdminUpdateBinaryOptionsMarket extends MsgBase< const message = InjectiveExchangeV1Beta1Tx.MsgAdminUpdateBinaryOptionsMarket.create() + message.sender = params.sender message.marketId = params.marketId message.settlementPrice = params.settlementPrice - message.settlementTimestamp = params.settlementTimestamp message.expirationTimestamp = params.expirationTimestamp + message.settlementTimestamp = params.settlementTimestamp message.status = params.status return InjectiveExchangeV1Beta1Tx.MsgAdminUpdateBinaryOptionsMarket.fromPartial( diff --git a/packages/sdk-ts/src/core/modules/exchange/msgs/MsgBatchCancelBinaryOptionsOrders.ts b/packages/sdk-ts/src/core/modules/exchange/msgs/MsgBatchCancelBinaryOptionsOrders.ts index 3322946ce..65445259f 100644 --- a/packages/sdk-ts/src/core/modules/exchange/msgs/MsgBatchCancelBinaryOptionsOrders.ts +++ b/packages/sdk-ts/src/core/modules/exchange/msgs/MsgBatchCancelBinaryOptionsOrders.ts @@ -39,6 +39,7 @@ export default class MsgBatchCancelBinaryOptionsOrders extends MsgBase< const orderDataList = params.orders.map((order) => { const orderData = InjectiveExchangeV1Beta1Tx.OrderData.create() + orderData.marketId = order.marketId orderData.subaccountId = order.subaccountId @@ -46,13 +47,13 @@ export default class MsgBatchCancelBinaryOptionsOrders extends MsgBase< orderData.orderHash = order.orderHash } + // TODO: Send order.orderMask instead when chain handles order mask properly. + orderData.orderMask = InjectiveExchangeV1Beta1Exchange.OrderMask.ANY + if (order.cid) { orderData.cid = order.cid } - // TODO: Send order.orderMask instead when chain handles order mask properly. - orderData.orderMask = InjectiveExchangeV1Beta1Exchange.OrderMask.ANY - return orderData }) diff --git a/packages/sdk-ts/src/core/modules/exchange/msgs/MsgBatchCancelDerivativeOrders.ts b/packages/sdk-ts/src/core/modules/exchange/msgs/MsgBatchCancelDerivativeOrders.ts index 92fc887f2..9fe2bfcda 100644 --- a/packages/sdk-ts/src/core/modules/exchange/msgs/MsgBatchCancelDerivativeOrders.ts +++ b/packages/sdk-ts/src/core/modules/exchange/msgs/MsgBatchCancelDerivativeOrders.ts @@ -38,13 +38,10 @@ export default class MsgBatchCancelDerivativeOrders extends MsgBase< const orderDataList = params.orders.map((order) => { const orderData = InjectiveExchangeV1Beta1Tx.OrderData.create() + orderData.marketId = order.marketId orderData.subaccountId = order.subaccountId - if (order.cid) { - orderData.cid = order.cid - } - if (order.orderHash) { orderData.orderHash = order.orderHash } @@ -52,11 +49,16 @@ export default class MsgBatchCancelDerivativeOrders extends MsgBase< // TODO: Send order.orderMask instead when chain handles order mask properly. orderData.orderMask = InjectiveExchangeV1Beta1Exchange.OrderMask.ANY + if (order.cid) { + orderData.cid = order.cid + } + return orderData }) const message = InjectiveExchangeV1Beta1Tx.MsgBatchCancelDerivativeOrders.create() + message.sender = params.injectiveAddress message.data = orderDataList.map((o) => o) diff --git a/packages/sdk-ts/src/core/modules/exchange/msgs/MsgBatchCancelSpotOrders.ts b/packages/sdk-ts/src/core/modules/exchange/msgs/MsgBatchCancelSpotOrders.ts index 1f8e6756e..78fb0f16a 100644 --- a/packages/sdk-ts/src/core/modules/exchange/msgs/MsgBatchCancelSpotOrders.ts +++ b/packages/sdk-ts/src/core/modules/exchange/msgs/MsgBatchCancelSpotOrders.ts @@ -38,6 +38,7 @@ export default class MsgBatchCancelSpotOrders extends MsgBase< const orderDataList = params.orders.map((order) => { const orderData = InjectiveExchangeV1Beta1Tx.OrderData.create() + orderData.marketId = order.marketId orderData.subaccountId = order.subaccountId @@ -45,17 +46,18 @@ export default class MsgBatchCancelSpotOrders extends MsgBase< orderData.orderHash = order.orderHash } + // TODO: Send order.orderMask instead when chain handles order mask properly. + orderData.orderMask = InjectiveExchangeV1Beta1Exchange.OrderMask.ANY + if (order.cid) { orderData.cid = order.cid } - // TODO: Send order.orderMask instead when chain handles order mask properly. - orderData.orderMask = InjectiveExchangeV1Beta1Exchange.OrderMask.ANY - return orderData }) const message = InjectiveExchangeV1Beta1Tx.MsgBatchCancelSpotOrders.create() + message.sender = params.injectiveAddress message.data = orderDataList.map((o) => o) diff --git a/packages/sdk-ts/src/core/modules/exchange/msgs/MsgBatchUpdateOrders.ts b/packages/sdk-ts/src/core/modules/exchange/msgs/MsgBatchUpdateOrders.ts index ba7f43caa..726462310 100644 --- a/packages/sdk-ts/src/core/modules/exchange/msgs/MsgBatchUpdateOrders.ts +++ b/packages/sdk-ts/src/core/modules/exchange/msgs/MsgBatchUpdateOrders.ts @@ -335,6 +335,42 @@ export default class MsgBatchUpdateOrders extends MsgBase< message.derivativeOrdersToCreate = orderData } + + if ( + params.binaryOptionsOrdersToCancel && + params.binaryOptionsOrdersToCancel.length > 0 + ) { + const orderData = params.binaryOptionsOrdersToCancel.map( + ({ marketId, subaccountId, orderHash, cid }) => { + const orderData = InjectiveExchangeV1Beta1Tx.OrderData.create() + + orderData.marketId = marketId + orderData.subaccountId = subaccountId + + if (orderHash) { + orderData.orderHash = orderHash + } + + if (cid) { + orderData.cid = cid + } + + return orderData + }, + ) + + message.derivativeOrdersToCancel = orderData + } + + if ( + params.binaryOptionsMarketIdsToCancelAll && + params.binaryOptionsMarketIdsToCancelAll.length > 0 + ) { + message.subaccountId = params.subaccountId + message.binaryOptionsMarketIdsToCancelAll = + params.binaryOptionsMarketIdsToCancelAll + } + if ( params.binaryOptionsOrdersToCreate && params.binaryOptionsOrdersToCreate.length > 0 diff --git a/packages/sdk-ts/src/core/modules/exchange/msgs/MsgCancelBinaryOptionsOrder.ts b/packages/sdk-ts/src/core/modules/exchange/msgs/MsgCancelBinaryOptionsOrder.ts index 9fade4ca3..80d2d6d19 100644 --- a/packages/sdk-ts/src/core/modules/exchange/msgs/MsgCancelBinaryOptionsOrder.ts +++ b/packages/sdk-ts/src/core/modules/exchange/msgs/MsgCancelBinaryOptionsOrder.ts @@ -36,6 +36,7 @@ export default class MsgCancelBinaryOptionsOrder extends MsgBase< const message = InjectiveExchangeV1Beta1Tx.MsgCancelBinaryOptionsOrder.create() + message.sender = params.injectiveAddress message.marketId = params.marketId message.subaccountId = params.subaccountId @@ -44,13 +45,13 @@ export default class MsgCancelBinaryOptionsOrder extends MsgBase< message.orderHash = params.orderHash } + // TODO: Send order.orderMask instead when chain handles order mask properly. + message.orderMask = InjectiveExchangeV1Beta1Exchange.OrderMask.ANY + if (params.cid) { message.cid = params.cid } - // TODO: Send order.orderMask instead when chain handles order mask properly. - message.orderMask = InjectiveExchangeV1Beta1Exchange.OrderMask.ANY - return message } diff --git a/packages/sdk-ts/src/core/modules/exchange/msgs/MsgCancelDerivativeOrder.ts b/packages/sdk-ts/src/core/modules/exchange/msgs/MsgCancelDerivativeOrder.ts index 502e90359..d649bf9cb 100644 --- a/packages/sdk-ts/src/core/modules/exchange/msgs/MsgCancelDerivativeOrder.ts +++ b/packages/sdk-ts/src/core/modules/exchange/msgs/MsgCancelDerivativeOrder.ts @@ -32,22 +32,22 @@ export default class MsgCancelDerivativeOrder extends MsgBase< const { params } = this const message = InjectiveExchangeV1Beta1Tx.MsgCancelDerivativeOrder.create() + message.sender = params.injectiveAddress message.marketId = params.marketId - message.subaccountId = params.subaccountId if (params.orderHash) { message.orderHash = params.orderHash } + // TODO: Send order.orderMask instead when chain handles order mask properly. + message.orderMask = InjectiveExchangeV1Beta1Exchange.OrderMask.ANY + if (params.cid) { message.cid = params.cid } - // TODO: Send order.orderMask instead when chain handles order mask properly. - message.orderMask = InjectiveExchangeV1Beta1Exchange.OrderMask.ANY - return InjectiveExchangeV1Beta1Tx.MsgCancelDerivativeOrder.fromPartial( message, ) diff --git a/packages/sdk-ts/src/core/modules/exchange/msgs/MsgCancelSpotOrder.ts b/packages/sdk-ts/src/core/modules/exchange/msgs/MsgCancelSpotOrder.ts index 8de03e919..dfea97a1e 100644 --- a/packages/sdk-ts/src/core/modules/exchange/msgs/MsgCancelSpotOrder.ts +++ b/packages/sdk-ts/src/core/modules/exchange/msgs/MsgCancelSpotOrder.ts @@ -29,6 +29,7 @@ export default class MsgCancelSpotOrder extends MsgBase< const { params } = this const message = InjectiveExchangeV1Beta1Tx.MsgCancelSpotOrder.create() + message.sender = params.injectiveAddress message.marketId = params.marketId message.subaccountId = params.subaccountId diff --git a/packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateBinaryOptionsLimitOrder.ts b/packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateBinaryOptionsLimitOrder.ts index 883a35e46..c0a15b9d9 100644 --- a/packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateBinaryOptionsLimitOrder.ts +++ b/packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateBinaryOptionsLimitOrder.ts @@ -26,6 +26,7 @@ export declare namespace MsgCreateBinaryOptionsLimitOrder { const createLimitOrder = (params: MsgCreateBinaryOptionsLimitOrder.Params) => { const orderInfo = InjectiveExchangeV1Beta1Exchange.OrderInfo.create() + orderInfo.subaccountId = params.subaccountId orderInfo.feeRecipient = params.feeRecipient orderInfo.price = params.price @@ -37,15 +38,17 @@ const createLimitOrder = (params: MsgCreateBinaryOptionsLimitOrder.Params) => { const derivativeOrder = InjectiveExchangeV1Beta1Exchange.DerivativeOrder.create() + derivativeOrder.marketId = params.marketId - derivativeOrder.orderType = params.orderType derivativeOrder.orderInfo = orderInfo + derivativeOrder.orderType = params.orderType derivativeOrder.margin = params.margin derivativeOrder.triggerPrice = params.triggerPrice || '0' const message = InjectiveExchangeV1Beta1Tx.MsgCreateBinaryOptionsLimitOrder.create() + message.sender = params.injectiveAddress message.order = derivativeOrder diff --git a/packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateBinaryOptionsMarketOrder.ts b/packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateBinaryOptionsMarketOrder.ts index d01581ae7..b40d1377c 100644 --- a/packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateBinaryOptionsMarketOrder.ts +++ b/packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateBinaryOptionsMarketOrder.ts @@ -28,6 +28,7 @@ const createMarketOrder = ( params: MsgCreateBinaryOptionsMarketOrder.Params, ) => { const orderInfo = InjectiveExchangeV1Beta1Exchange.OrderInfo.create() + orderInfo.subaccountId = params.subaccountId orderInfo.feeRecipient = params.feeRecipient orderInfo.price = params.price @@ -39,15 +40,16 @@ const createMarketOrder = ( const derivativeOrder = InjectiveExchangeV1Beta1Exchange.DerivativeOrder.create() + derivativeOrder.marketId = params.marketId - derivativeOrder.orderType = params.orderType derivativeOrder.orderInfo = orderInfo + derivativeOrder.orderType = params.orderType derivativeOrder.margin = params.margin - derivativeOrder.triggerPrice = params.triggerPrice || '0' const message = InjectiveExchangeV1Beta1Tx.MsgCreateBinaryOptionsMarketOrder.create() + message.sender = params.injectiveAddress message.order = derivativeOrder diff --git a/packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateDerivativeLimitOrder.ts b/packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateDerivativeLimitOrder.ts index a077d26de..224f886e1 100644 --- a/packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateDerivativeLimitOrder.ts +++ b/packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateDerivativeLimitOrder.ts @@ -25,6 +25,7 @@ export declare namespace MsgCreateDerivativeLimitOrder { const createLimitOrder = (params: MsgCreateDerivativeLimitOrder.Params) => { const orderInfo = InjectiveExchangeV1Beta1Exchange.OrderInfo.create() + orderInfo.subaccountId = params.subaccountId orderInfo.feeRecipient = params.feeRecipient orderInfo.price = params.price @@ -36,15 +37,16 @@ const createLimitOrder = (params: MsgCreateDerivativeLimitOrder.Params) => { const derivativeOrder = InjectiveExchangeV1Beta1Exchange.DerivativeOrder.create() + derivativeOrder.marketId = params.marketId - derivativeOrder.orderType = params.orderType derivativeOrder.orderInfo = orderInfo + derivativeOrder.orderType = params.orderType derivativeOrder.margin = params.margin - derivativeOrder.triggerPrice = params.triggerPrice || '0' const message = InjectiveExchangeV1Beta1Tx.MsgCreateDerivativeLimitOrder.create() + message.sender = params.injectiveAddress message.order = derivativeOrder diff --git a/packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateDerivativeMarketOrder.ts b/packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateDerivativeMarketOrder.ts index 90595d4a6..057da5beb 100644 --- a/packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateDerivativeMarketOrder.ts +++ b/packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateDerivativeMarketOrder.ts @@ -25,26 +25,28 @@ export declare namespace MsgCreateDerivativeMarketOrder { const createMarketOrder = (params: MsgCreateDerivativeMarketOrder.Params) => { const orderInfo = InjectiveExchangeV1Beta1Exchange.OrderInfo.create() + orderInfo.subaccountId = params.subaccountId orderInfo.feeRecipient = params.feeRecipient orderInfo.price = params.price orderInfo.quantity = params.quantity - if (params.cid) { - orderInfo.cid = params.cid - } + if (params.cid) { + orderInfo.cid = params.cid + } const derivativeOrder = InjectiveExchangeV1Beta1Exchange.DerivativeOrder.create() + derivativeOrder.marketId = params.marketId - derivativeOrder.orderType = params.orderType derivativeOrder.orderInfo = orderInfo + derivativeOrder.orderType = params.orderType derivativeOrder.margin = params.margin - derivativeOrder.triggerPrice = params.triggerPrice || '0' const message = InjectiveExchangeV1Beta1Tx.MsgCreateDerivativeMarketOrder.create() + message.sender = params.injectiveAddress message.order = derivativeOrder diff --git a/packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateSpotLimitOrder.ts b/packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateSpotLimitOrder.ts index ce1a6303e..a521cae40 100644 --- a/packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateSpotLimitOrder.ts +++ b/packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateSpotLimitOrder.ts @@ -24,23 +24,25 @@ export declare namespace MsgCreateSpotLimitOrder { const createLimitOrder = (params: MsgCreateSpotLimitOrder.Params) => { const orderInfo = InjectiveExchangeV1Beta1Exchange.OrderInfo.create() + orderInfo.subaccountId = params.subaccountId orderInfo.feeRecipient = params.feeRecipient orderInfo.price = params.price orderInfo.quantity = params.quantity - if (params.cid) { - orderInfo.cid = params.cid - } + if (params.cid) { + orderInfo.cid = params.cid + } const spotOrder = InjectiveExchangeV1Beta1Exchange.SpotOrder.create() + spotOrder.marketId = params.marketId - spotOrder.orderType = params.orderType spotOrder.orderInfo = orderInfo - + spotOrder.orderType = params.orderType spotOrder.triggerPrice = params.triggerPrice || '0' const message = InjectiveExchangeV1Beta1Tx.MsgCreateSpotLimitOrder.create() + message.sender = params.injectiveAddress message.order = spotOrder diff --git a/packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateSpotMarketOrder.ts b/packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateSpotMarketOrder.ts index 1efd0d499..561e56437 100644 --- a/packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateSpotMarketOrder.ts +++ b/packages/sdk-ts/src/core/modules/exchange/msgs/MsgCreateSpotMarketOrder.ts @@ -24,23 +24,25 @@ export declare namespace MsgCreateSpotMarketOrder { const createMarketOrder = (params: MsgCreateSpotMarketOrder.Params) => { const orderInfo = InjectiveExchangeV1Beta1Exchange.OrderInfo.create() + orderInfo.subaccountId = params.subaccountId orderInfo.feeRecipient = params.feeRecipient orderInfo.price = params.price orderInfo.quantity = params.quantity - if (params.cid) { - orderInfo.cid = params.cid - } + if (params.cid) { + orderInfo.cid = params.cid + } const spotOrder = InjectiveExchangeV1Beta1Exchange.SpotOrder.create() + spotOrder.marketId = params.marketId - spotOrder.orderType = params.orderType spotOrder.orderInfo = orderInfo - + spotOrder.orderType = params.orderType spotOrder.triggerPrice = params.triggerPrice || '0' const message = InjectiveExchangeV1Beta1Tx.MsgCreateSpotMarketOrder.create() + message.sender = params.injectiveAddress message.order = spotOrder diff --git a/packages/sdk-ts/src/core/modules/exchange/msgs/MsgDeposit.ts b/packages/sdk-ts/src/core/modules/exchange/msgs/MsgDeposit.ts index d2632f0c3..f58a11fed 100644 --- a/packages/sdk-ts/src/core/modules/exchange/msgs/MsgDeposit.ts +++ b/packages/sdk-ts/src/core/modules/exchange/msgs/MsgDeposit.ts @@ -33,10 +33,12 @@ export default class MsgDeposit extends MsgBase< const { params } = this const amountCoin = CosmosBaseV1Beta1Coin.Coin.create() - amountCoin.amount = params.amount.amount + amountCoin.denom = params.amount.denom + amountCoin.amount = params.amount.amount const message = InjectiveExchangeV1Beta1Tx.MsgDeposit.create() + message.sender = params.injectiveAddress message.subaccountId = params.subaccountId message.amount = amountCoin diff --git a/packages/sdk-ts/src/core/modules/exchange/msgs/MsgExternalTransfer.ts b/packages/sdk-ts/src/core/modules/exchange/msgs/MsgExternalTransfer.ts index 00face3ee..e47a5eb94 100644 --- a/packages/sdk-ts/src/core/modules/exchange/msgs/MsgExternalTransfer.ts +++ b/packages/sdk-ts/src/core/modules/exchange/msgs/MsgExternalTransfer.ts @@ -34,10 +34,12 @@ export default class MsgExternalTransfer extends MsgBase< const { params } = this const amountCoin = CosmosBaseV1Beta1Coin.Coin.create() - amountCoin.amount = params.amount.amount + amountCoin.denom = params.amount.denom + amountCoin.amount = params.amount.amount const message = InjectiveExchangeV1Beta1Tx.MsgExternalTransfer.create() + message.sender = params.injectiveAddress message.sourceSubaccountId = params.srcSubaccountId message.destinationSubaccountId = params.dstSubaccountId diff --git a/packages/sdk-ts/src/core/modules/exchange/msgs/MsgIncreasePositionMargin.ts b/packages/sdk-ts/src/core/modules/exchange/msgs/MsgIncreasePositionMargin.ts index ecde2d126..e7ce3dfb6 100644 --- a/packages/sdk-ts/src/core/modules/exchange/msgs/MsgIncreasePositionMargin.ts +++ b/packages/sdk-ts/src/core/modules/exchange/msgs/MsgIncreasePositionMargin.ts @@ -19,10 +19,10 @@ const createMessage = (params: MsgIncreasePositionMargin.Params) => { const message = InjectiveExchangeV1Beta1Tx.MsgIncreasePositionMargin.create() message.sender = params.injectiveAddress - message.amount = params.amount - message.marketId = params.marketId message.sourceSubaccountId = params.srcSubaccountId message.destinationSubaccountId = params.dstSubaccountId + message.marketId = params.marketId + message.amount = params.amount return InjectiveExchangeV1Beta1Tx.MsgIncreasePositionMargin.fromPartial( message, diff --git a/packages/sdk-ts/src/core/modules/exchange/msgs/MsgInstantBinaryOptionsMarketLaunch.ts b/packages/sdk-ts/src/core/modules/exchange/msgs/MsgInstantBinaryOptionsMarketLaunch.ts index d7ad2744c..844ec830b 100644 --- a/packages/sdk-ts/src/core/modules/exchange/msgs/MsgInstantBinaryOptionsMarketLaunch.ts +++ b/packages/sdk-ts/src/core/modules/exchange/msgs/MsgInstantBinaryOptionsMarketLaunch.ts @@ -23,6 +23,7 @@ export declare namespace MsgInstantBinaryOptionsMarketLaunch { settlementTimestamp: number minPriceTickSize: string minQuantityTickSize: string + minNotional: string } } @@ -48,6 +49,7 @@ const createMessage = (params: MsgInstantBinaryOptionsMarketLaunch.Params) => { message.quoteDenom = params.market.quoteDenom message.minPriceTickSize = params.market.minPriceTickSize message.minQuantityTickSize = params.market.minQuantityTickSize + message.minNotional = params.market.minNotional return InjectiveExchangeV1Beta1Tx.MsgInstantBinaryOptionsMarketLaunch.fromPartial( message, @@ -86,6 +88,9 @@ export default class MsgInstantBinaryOptionsMarketLaunch extends MsgBase< minQuantityTickSize: amountToCosmosSdkDecAmount( initialParams.market.minQuantityTickSize, ).toFixed(), + minNotional: amountToCosmosSdkDecAmount( + initialParams.market.minNotional, + ).toFixed(), }, } as MsgInstantBinaryOptionsMarketLaunch.Params diff --git a/packages/sdk-ts/src/core/modules/exchange/msgs/MsgInstantSpotMarketLaunch.spec.ts b/packages/sdk-ts/src/core/modules/exchange/msgs/MsgInstantSpotMarketLaunch.spec.ts index 42d35780d..79606d94c 100644 --- a/packages/sdk-ts/src/core/modules/exchange/msgs/MsgInstantSpotMarketLaunch.spec.ts +++ b/packages/sdk-ts/src/core/modules/exchange/msgs/MsgInstantSpotMarketLaunch.spec.ts @@ -12,6 +12,7 @@ const params: MsgInstantSpotMarketLaunch['params'] = { baseDenom: market.baseDenom, quoteDenom: market.quoteDenom, minPriceTickSize: market.minPriceTickSize, + minNotional: '1', minQuantityTickSize: market.minQuantityTickSize, }, } @@ -66,6 +67,7 @@ describe('MsgInstantSpotMarketLaunch', () => { { name: 'quote_denom', type: 'string' }, { name: 'min_price_tick_size', type: 'string' }, { name: 'min_quantity_tick_size', type: 'string' }, + { name: 'min_notional', type: 'string' }, ], }) }) diff --git a/packages/sdk-ts/src/core/modules/exchange/msgs/MsgInstantSpotMarketLaunch.ts b/packages/sdk-ts/src/core/modules/exchange/msgs/MsgInstantSpotMarketLaunch.ts index 7cc94a81d..9f92155d9 100644 --- a/packages/sdk-ts/src/core/modules/exchange/msgs/MsgInstantSpotMarketLaunch.ts +++ b/packages/sdk-ts/src/core/modules/exchange/msgs/MsgInstantSpotMarketLaunch.ts @@ -11,6 +11,7 @@ export declare namespace MsgInstantSpotMarketLaunch { ticker: string baseDenom: string quoteDenom: string + minNotional: string minPriceTickSize: string minQuantityTickSize: string } @@ -23,11 +24,12 @@ const createMessage = (params: MsgInstantSpotMarketLaunch.Params) => { const message = InjectiveExchangeV1Beta1Tx.MsgInstantSpotMarketLaunch.create() message.sender = params.proposer - message.quoteDenom = params.market.quoteDenom message.ticker = params.market.ticker message.baseDenom = params.market.baseDenom + message.quoteDenom = params.market.quoteDenom message.minPriceTickSize = params.market.minPriceTickSize message.minQuantityTickSize = params.market.minQuantityTickSize + message.minNotional = params.market.minNotional return InjectiveExchangeV1Beta1Tx.MsgInstantSpotMarketLaunch.fromPartial( message, @@ -60,6 +62,9 @@ export default class MsgInstantSpotMarketLaunch extends MsgBase< minQuantityTickSize: amountToCosmosSdkDecAmount( initialParams.market.minQuantityTickSize, ).toFixed(), + minNotional: amountToCosmosSdkDecAmount( + initialParams.market.minNotional, + ).toFixed(), }, } as MsgInstantSpotMarketLaunch.Params diff --git a/packages/sdk-ts/src/core/modules/exchange/msgs/MsgLiquidatePosition.ts b/packages/sdk-ts/src/core/modules/exchange/msgs/MsgLiquidatePosition.ts index 8820d9fb6..0f24ec377 100644 --- a/packages/sdk-ts/src/core/modules/exchange/msgs/MsgLiquidatePosition.ts +++ b/packages/sdk-ts/src/core/modules/exchange/msgs/MsgLiquidatePosition.ts @@ -43,12 +43,14 @@ export default class MsgLiquidatePosition extends MsgBase< const { params } = this const message = InjectiveExchangeV1Beta1Tx.MsgLiquidatePosition.create() + message.sender = params.injectiveAddress message.subaccountId = params.subaccountId message.marketId = params.marketId if (params.order) { const orderInfo = InjectiveExchangeV1Beta1Exchange.OrderInfo.create() + orderInfo.subaccountId = params.order.subaccountId orderInfo.feeRecipient = params.order.feeRecipient orderInfo.price = params.order.price @@ -62,6 +64,8 @@ export default class MsgLiquidatePosition extends MsgBase< order.marketId = params.order.marketId order.margin = params.order.margin + order.orderInfo = orderInfo + order.orderType = params.order.orderType order.triggerPrice = params.order.triggerPrice || '0' } diff --git a/packages/sdk-ts/src/core/modules/exchange/msgs/MsgReclaimLockedFunds.ts b/packages/sdk-ts/src/core/modules/exchange/msgs/MsgReclaimLockedFunds.ts index c8c272936..74f551385 100644 --- a/packages/sdk-ts/src/core/modules/exchange/msgs/MsgReclaimLockedFunds.ts +++ b/packages/sdk-ts/src/core/modules/exchange/msgs/MsgReclaimLockedFunds.ts @@ -27,6 +27,7 @@ export default class MsgReclaimLockedFunds extends MsgBase< const { params } = this const message = InjectiveExchangeV1Beta1Tx.MsgReclaimLockedFunds.create() + message.sender = params.sender message.lockedAccountPubKey = Buffer.from( params.lockedAccountPubKey, diff --git a/packages/sdk-ts/src/core/modules/exchange/msgs/MsgRewardsOptOut.ts b/packages/sdk-ts/src/core/modules/exchange/msgs/MsgRewardsOptOut.ts index e985e622c..c3e9e1f7b 100644 --- a/packages/sdk-ts/src/core/modules/exchange/msgs/MsgRewardsOptOut.ts +++ b/packages/sdk-ts/src/core/modules/exchange/msgs/MsgRewardsOptOut.ts @@ -25,6 +25,7 @@ export default class MsgRewardsOptOut extends MsgBase< const { params } = this const message = InjectiveExchangeV1Beta1Tx.MsgRewardsOptOut.create() + message.sender = params.sender return InjectiveExchangeV1Beta1Tx.MsgRewardsOptOut.fromPartial(message) diff --git a/packages/sdk-ts/src/core/modules/exchange/msgs/MsgWithdraw.ts b/packages/sdk-ts/src/core/modules/exchange/msgs/MsgWithdraw.ts index 519e257c3..3ac1bc666 100644 --- a/packages/sdk-ts/src/core/modules/exchange/msgs/MsgWithdraw.ts +++ b/packages/sdk-ts/src/core/modules/exchange/msgs/MsgWithdraw.ts @@ -33,10 +33,12 @@ export default class MsgWithdraw extends MsgBase< const { params } = this const amountCoin = CosmosBaseV1Beta1Coin.Coin.create() - amountCoin.amount = params.amount.amount + amountCoin.denom = params.amount.denom + amountCoin.amount = params.amount.amount const message = InjectiveExchangeV1Beta1Tx.MsgWithdraw.create() + message.sender = params.injectiveAddress message.subaccountId = params.subaccountId message.amount = amountCoin diff --git a/packages/sdk-ts/src/core/modules/feegrant/msgs/MsgGrantAllowance.ts b/packages/sdk-ts/src/core/modules/feegrant/msgs/MsgGrantAllowance.ts index f00d40760..c2ef36a77 100644 --- a/packages/sdk-ts/src/core/modules/feegrant/msgs/MsgGrantAllowance.ts +++ b/packages/sdk-ts/src/core/modules/feegrant/msgs/MsgGrantAllowance.ts @@ -1,10 +1,11 @@ import snakecaseKeys from 'snakecase-keys' import { MsgBase } from '../../MsgBase' import { + GoogleProtobufAny, + CosmosBaseV1Beta1Coin, CosmosFeegrantV1Beta1Tx, - CosmosFeegrantV1Beta1Feegrant, GoogleProtobufTimestamp, - GoogleProtobufAny, + CosmosFeegrantV1Beta1Feegrant, } from '@injectivelabs/core-proto-ts' import { Coin } from '@injectivelabs/ts-types' @@ -45,10 +46,21 @@ export default class MsgGrantAllowance extends MsgBase< const timestamp = this.getTimestamp() const basicAllowance = CosmosFeegrantV1Beta1Feegrant.BasicAllowance.create() - basicAllowance.spendLimit = params.allowance.spendLimit + + basicAllowance.spendLimit = params.allowance.spendLimit.map( + ({ denom, amount }) => { + const coin = CosmosBaseV1Beta1Coin.Coin.create() + + coin.denom = denom + coin.amount = amount + + return coin + }, + ) basicAllowance.expiration = new Date(Number(timestamp.seconds) * 1000) const allowance = GoogleProtobufAny.Any.create() + allowance.typeUrl = basicAllowanceType allowance.value = Buffer.from( CosmosFeegrantV1Beta1Feegrant.BasicAllowance.encode( @@ -57,8 +69,9 @@ export default class MsgGrantAllowance extends MsgBase< ) const message = CosmosFeegrantV1Beta1Tx.MsgGrantAllowance.create() - message.grantee = params.grantee + message.granter = params.granter + message.grantee = params.grantee message.allowance = allowance return CosmosFeegrantV1Beta1Tx.MsgGrantAllowance.fromJSON(message) @@ -85,7 +98,10 @@ export default class MsgGrantAllowance extends MsgBase< allowance: { type: 'cosmos-sdk/BasicAllowance', value: { - spendLimit: params.allowance.spendLimit, + spendLimit: params.allowance.spendLimit.map(({ denom, amount }) => ({ + denom, + amount, + })), expiration: new Date(Number(timestamp.seconds) * 1000), }, }, @@ -116,7 +132,10 @@ export default class MsgGrantAllowance extends MsgBase< grantee: amino.value.grantee, allowance: { '@type': basicAllowanceType, - spendLimit: params.allowance.spendLimit, + spendLimit: params.allowance.spendLimit.map(({ denom, amount }) => ({ + denom, + amount, + })), expiration: new Date(Number(timestamp.seconds) * 1000), }, } diff --git a/packages/sdk-ts/src/core/modules/feegrant/msgs/MsgRevokeAllowance.ts b/packages/sdk-ts/src/core/modules/feegrant/msgs/MsgRevokeAllowance.ts index 1dd2599dd..1813bec5a 100644 --- a/packages/sdk-ts/src/core/modules/feegrant/msgs/MsgRevokeAllowance.ts +++ b/packages/sdk-ts/src/core/modules/feegrant/msgs/MsgRevokeAllowance.ts @@ -26,8 +26,9 @@ export default class MsgRevokeAllowance extends MsgBase< const { params } = this const message = CosmosFeegrantV1Beta1Tx.MsgRevokeAllowance.create() - message.grantee = params.grantee + message.granter = params.granter + message.grantee = params.grantee return CosmosFeegrantV1Beta1Tx.MsgRevokeAllowance.fromPartial(message) } diff --git a/packages/sdk-ts/src/core/modules/gov/msgs/MsgDeposit.ts b/packages/sdk-ts/src/core/modules/gov/msgs/MsgDeposit.ts index 3de6d541e..2a4fb09ad 100644 --- a/packages/sdk-ts/src/core/modules/gov/msgs/MsgDeposit.ts +++ b/packages/sdk-ts/src/core/modules/gov/msgs/MsgDeposit.ts @@ -33,12 +33,14 @@ export default class MsgDeposit extends MsgBase< const { params } = this const deposit = CosmosBaseV1Beta1Coin.Coin.create() - deposit.amount = params.amount.amount + deposit.denom = params.amount.denom + deposit.amount = params.amount.amount const message = CosmosGovV1Tx.MsgDeposit.create() - message.depositor = params.depositor + message.proposalId = params.proposalId.toString() + message.depositor = params.depositor message.amount = [deposit] return CosmosGovV1Tx.MsgDeposit.fromPartial(message) diff --git a/packages/sdk-ts/src/core/modules/gov/msgs/MsgSubmitProposalExpiryFuturesMarketLaunch.ts b/packages/sdk-ts/src/core/modules/gov/msgs/MsgSubmitProposalExpiryFuturesMarketLaunch.ts index 214c7343d..8a2892daf 100644 --- a/packages/sdk-ts/src/core/modules/gov/msgs/MsgSubmitProposalExpiryFuturesMarketLaunch.ts +++ b/packages/sdk-ts/src/core/modules/gov/msgs/MsgSubmitProposalExpiryFuturesMarketLaunch.ts @@ -14,19 +14,20 @@ const createProposalExpiryFuturesMarketLaunch = ( ) => { const content = InjectiveExchangeV1Beta1Proposal.ExpiryFuturesMarketLaunchProposal.create() + content.title = params.market.title content.description = params.market.description - content.quoteDenom = params.market.quoteDenom content.ticker = params.market.ticker - content.initialMarginRatio = params.market.initialMarginRatio - content.maintenanceMarginRatio = params.market.maintenanceMarginRatio - content.makerFeeRate = params.market.makerFeeRate - content.takerFeeRate = params.market.takerFeeRate + content.quoteDenom = params.market.quoteDenom content.oracleBase = params.market.oracleBase content.oracleQuote = params.market.oracleQuote content.oracleScaleFactor = params.market.oracleScaleFactor content.oracleType = params.market.oracleType content.expiry = params.market.expiry.toString() + content.initialMarginRatio = params.market.initialMarginRatio + content.maintenanceMarginRatio = params.market.maintenanceMarginRatio + content.makerFeeRate = params.market.makerFeeRate + content.takerFeeRate = params.market.takerFeeRate content.minPriceTickSize = params.market.minPriceTickSize content.minQuantityTickSize = params.market.minQuantityTickSize @@ -115,14 +116,16 @@ export default class MsgSubmitProposalExpiryFuturesMarketLaunch extends MsgBase< }) const contentAny = GoogleProtobufAny.Any.create() + + contentAny.typeUrl = + '/injective.exchange.v1beta1.ExpiryFuturesMarketLaunchProposal' contentAny.value = InjectiveExchangeV1Beta1Proposal.ExpiryFuturesMarketLaunchProposal.encode( content, ).finish() - contentAny.typeUrl = - '/injective.exchange.v1beta1.ExpiryFuturesMarketLaunchProposal' const message = CosmosGovV1Beta1Tx.MsgSubmitProposal.create() + message.content = contentAny message.proposer = params.proposer message.initialDeposit = [depositParams] @@ -143,6 +146,10 @@ export default class MsgSubmitProposalExpiryFuturesMarketLaunch extends MsgBase< const { params } = this const messageWithProposalType = snakecaseKeys({ + content: { + type: 'exchange/ExpiryFuturesMarketLaunchProposal', + value: this.getContent(), + }, proposer: params.proposer, initialDeposit: [ { @@ -150,10 +157,6 @@ export default class MsgSubmitProposalExpiryFuturesMarketLaunch extends MsgBase< amount: params.deposit.amount, }, ], - content: { - type_url: 'exchange/ExpiryFuturesMarketLaunchProposal', - value: this.getContent(), - }, }) return { @@ -167,6 +170,11 @@ export default class MsgSubmitProposalExpiryFuturesMarketLaunch extends MsgBase< const { params } = this const messageWithProposalType = { + content: { + '@type': + '/injective.exchange.v1beta1.ExpiryFuturesMarketLaunchProposal', + ...this.getContent(), + }, proposer: params.proposer, initialDeposit: [ { @@ -174,11 +182,6 @@ export default class MsgSubmitProposalExpiryFuturesMarketLaunch extends MsgBase< amount: params.deposit.amount, }, ], - content: { - '@type': - '/injective.exchange.v1beta1.ExpiryFuturesMarketLaunchProposal', - ...this.getContent(), - }, } return { diff --git a/packages/sdk-ts/src/core/modules/gov/msgs/MsgSubmitProposalPerpetualMarketLaunch.ts b/packages/sdk-ts/src/core/modules/gov/msgs/MsgSubmitProposalPerpetualMarketLaunch.ts index 3f4eb62fc..5c6403211 100644 --- a/packages/sdk-ts/src/core/modules/gov/msgs/MsgSubmitProposalPerpetualMarketLaunch.ts +++ b/packages/sdk-ts/src/core/modules/gov/msgs/MsgSubmitProposalPerpetualMarketLaunch.ts @@ -1,4 +1,4 @@ -import snakecaseKeys from 'snakecase-keys' +import snakecaseKeys, { SnakeCaseKeys } from 'snakecase-keys' import { GoogleProtobufAny, CosmosGovV1Beta1Tx, @@ -26,6 +26,7 @@ export declare namespace MsgSubmitProposalPerpetualMarketLaunch { takerFeeRate: string minPriceTickSize: string minQuantityTickSize: string + minNotional: string } proposer: string deposit: { @@ -52,18 +53,19 @@ const createPerpetualMarketLaunch = ( content.title = params.market.title content.description = params.market.description - content.quoteDenom = params.market.quoteDenom content.ticker = params.market.ticker - content.initialMarginRatio = params.market.initialMarginRatio - content.maintenanceMarginRatio = params.market.maintenanceMarginRatio - content.makerFeeRate = params.market.makerFeeRate - content.takerFeeRate = params.market.takerFeeRate + content.quoteDenom = params.market.quoteDenom content.oracleBase = params.market.oracleBase content.oracleQuote = params.market.oracleQuote content.oracleScaleFactor = params.market.oracleScaleFactor content.oracleType = params.market.oracleType + content.initialMarginRatio = params.market.initialMarginRatio + content.maintenanceMarginRatio = params.market.maintenanceMarginRatio + content.makerFeeRate = params.market.makerFeeRate + content.takerFeeRate = params.market.takerFeeRate content.minPriceTickSize = params.market.minPriceTickSize content.minQuantityTickSize = params.market.minQuantityTickSize + content.minNotional = params.market.minNotional return InjectiveExchangeV1Beta1Proposal.PerpetualMarketLaunchProposal.fromPartial( content, @@ -88,6 +90,7 @@ export default class MsgSubmitProposalPerpetualMarketLaunch extends MsgBase< const { params } = this const depositParams = CosmosBaseV1Beta1Coin.Coin.create() + depositParams.denom = params.deposit.denom depositParams.amount = params.deposit.amount @@ -110,21 +113,26 @@ export default class MsgSubmitProposalPerpetualMarketLaunch extends MsgBase< minQuantityTickSize: amountToCosmosSdkDecAmount( params.market.minQuantityTickSize, ).toFixed(), + minNotional: amountToCosmosSdkDecAmount( + params.market.minNotional, + ).toFixed(), }, }) const contentAny = GoogleProtobufAny.Any.create() + + contentAny.typeUrl = + '/injective.exchange.v1beta1.PerpetualMarketLaunchProposal' contentAny.value = InjectiveExchangeV1Beta1Proposal.PerpetualMarketLaunchProposal.encode( content, ).finish() - contentAny.typeUrl = - '/injective.exchange.v1beta1.PerpetualMarketLaunchProposal' const message = CosmosGovV1Beta1Tx.MsgSubmitProposal.create() + message.content = contentAny - message.proposer = params.proposer message.initialDeposit = [depositParams] + message.proposer = params.proposer return CosmosGovV1Beta1Tx.MsgSubmitProposal.fromPartial(message) } @@ -141,47 +149,54 @@ export default class MsgSubmitProposalPerpetualMarketLaunch extends MsgBase< public toAmino() { const { params } = this - const messageWithProposalType = { + const content = this.getContent() + + const message = { + content, proposer: params.proposer, + } + + const messageWithProposalType = snakecaseKeys({ + content: { + type: 'exchange/PerpetualMarketLaunchProposal', + value: message.content, + }, initialDeposit: [ { denom: params.deposit.denom, amount: params.deposit.amount, }, ], - content: { - type_url: 'exchange/PerpetualMarketLaunchProposal', - value: this.getContent(), - }, - } + proposer: params.proposer, + }) return { type: 'cosmos-sdk/MsgSubmitProposal', value: - messageWithProposalType as unknown as MsgSubmitProposalPerpetualMarketLaunch.Object, + messageWithProposalType as unknown as SnakeCaseKeys, } } public toWeb3() { const { params } = this - const messageWithProposalType = snakecaseKeys({ - proposer: params.proposer, + const messageWithProposalType = { + content: { + '@type': '/injective.exchange.v1beta1.PerpetualMarketLaunchProposal', + ...this.getContent(), + }, initialDeposit: [ { denom: params.deposit.denom, amount: params.deposit.amount, }, ], - content: { - '@type': '/injective.exchange.v1beta1.PerpetualMarketLaunchProposal', - ...this.getContent(), - }, - }) + proposer: params.proposer, + } return { '@type': '/cosmos.gov.v1beta1.MsgSubmitProposal', - ...(messageWithProposalType as unknown as MsgSubmitProposalPerpetualMarketLaunch.Object), + ...(messageWithProposalType as unknown as SnakeCaseKeys), } } diff --git a/packages/sdk-ts/src/core/modules/gov/msgs/MsgSubmitProposalSpotMarketLaunch.ts b/packages/sdk-ts/src/core/modules/gov/msgs/MsgSubmitProposalSpotMarketLaunch.ts index 99260ad5a..f14ea111a 100644 --- a/packages/sdk-ts/src/core/modules/gov/msgs/MsgSubmitProposalSpotMarketLaunch.ts +++ b/packages/sdk-ts/src/core/modules/gov/msgs/MsgSubmitProposalSpotMarketLaunch.ts @@ -20,6 +20,7 @@ export declare namespace MsgSubmitProposalSpotMarketLaunch { minQuantityTickSize: string makerFeeRate: string takerFeeRate: string + minNotional: string } proposer: string deposit: { @@ -41,17 +42,19 @@ export declare namespace MsgSubmitProposalSpotMarketLaunch { const createSpotMarketLaunchContent = ( params: MsgSubmitProposalSpotMarketLaunch.Params, ) => { - const content = InjectiveExchangeV1Beta1Proposal.SpotMarketLaunchProposal.create() + const content = + InjectiveExchangeV1Beta1Proposal.SpotMarketLaunchProposal.create() content.title = params.market.title content.description = params.market.description - content.quoteDenom = params.market.quoteDenom content.ticker = params.market.ticker content.baseDenom = params.market.baseDenom + content.quoteDenom = params.market.quoteDenom content.minPriceTickSize = params.market.minPriceTickSize content.minQuantityTickSize = params.market.minQuantityTickSize content.makerFeeRate = params.market.makerFeeRate - content.takerFeeRate = params.market.makerFeeRate + content.takerFeeRate = params.market.takerFeeRate + content.minNotional = params.market.minNotional return InjectiveExchangeV1Beta1Proposal.SpotMarketLaunchProposal.fromPartial( content, @@ -76,6 +79,7 @@ export default class MsgSubmitProposalSpotMarketLaunch extends MsgBase< const { params } = this const depositParams = CosmosBaseV1Beta1Coin.Coin.create() + depositParams.denom = params.deposit.denom depositParams.amount = params.deposit.amount @@ -93,23 +97,28 @@ export default class MsgSubmitProposalSpotMarketLaunch extends MsgBase< params.market.makerFeeRate, ).toFixed(), takerFeeRate: amountToCosmosSdkDecAmount( - params.market.makerFeeRate, + params.market.takerFeeRate, + ).toFixed(), + minNotional: amountToCosmosSdkDecAmount( + params.market.minNotional, ).toFixed(), }, }) const proposalType = '/injective.exchange.v1beta1.SpotMarketLaunchProposal' const contentAny = GoogleProtobufAny.Any.create() + + contentAny.typeUrl = proposalType contentAny.value = InjectiveExchangeV1Beta1Proposal.SpotMarketLaunchProposal.encode( content, ).finish() - contentAny.typeUrl = proposalType const message = CosmosGovV1Beta1Tx.MsgSubmitProposal.create() + message.content = contentAny - message.proposer = params.proposer message.initialDeposit = [depositParams] + message.proposer = params.proposer return CosmosGovV1Beta1Tx.MsgSubmitProposal.fromPartial(message) } @@ -125,6 +134,7 @@ export default class MsgSubmitProposalSpotMarketLaunch extends MsgBase< public toAmino() { const { params } = this + const content = this.getContent() const message = { @@ -133,17 +143,17 @@ export default class MsgSubmitProposalSpotMarketLaunch extends MsgBase< } const messageWithProposalType = snakecaseKeys({ - proposer: params.proposer, + content: { + type: 'exchange/SpotMarketLaunchProposal', + value: message.content, + }, initialDeposit: [ { denom: params.deposit.denom, amount: params.deposit.amount, }, ], - content: { - value: message.content, - type_url: 'exchange/SpotMarketLaunchProposal', - }, + proposer: params.proposer, }) return { @@ -157,17 +167,17 @@ export default class MsgSubmitProposalSpotMarketLaunch extends MsgBase< const { params } = this const messageWithProposalType = { - proposer: params.proposer, + content: { + '@type': '/injective.exchange.v1beta1.SpotMarketLaunchProposal', + ...this.getContent(), + }, initialDeposit: [ { denom: params.deposit.denom, amount: params.deposit.amount, }, ], - content: { - '@type': '/injective.exchange.v1beta1.SpotMarketLaunchProposal', - ...this.getContent(), - }, + proposer: params.proposer, } return { diff --git a/packages/sdk-ts/src/core/modules/gov/msgs/MsgSubmitProposalSpotMarketParamUpdate.ts b/packages/sdk-ts/src/core/modules/gov/msgs/MsgSubmitProposalSpotMarketParamUpdate.ts index 8cd37d9ec..5c6e0f4da 100644 --- a/packages/sdk-ts/src/core/modules/gov/msgs/MsgSubmitProposalSpotMarketParamUpdate.ts +++ b/packages/sdk-ts/src/core/modules/gov/msgs/MsgSubmitProposalSpotMarketParamUpdate.ts @@ -14,15 +14,17 @@ const createSpotMarketParamUpdate = ( ) => { const content = InjectiveExchangeV1Beta1Proposal.SpotMarketParamUpdateProposal.create() + content.title = params.market.title content.description = params.market.description + content.marketId = params.market.marketId content.makerFeeRate = params.market.makerFeeRate content.takerFeeRate = params.market.takerFeeRate content.relayerFeeShareRate = params.market.relayerFeeShareRate - content.marketId = params.market.marketId - content.status = params.market.status content.minPriceTickSize = params.market.minPriceTickSize content.minQuantityTickSize = params.market.minQuantityTickSize + content.status = params.market.status + content.ticker = params.market.ticker return InjectiveExchangeV1Beta1Proposal.SpotMarketParamUpdateProposal.fromPartial( content, @@ -40,6 +42,7 @@ export declare namespace MsgSubmitProposalSpotMarketParamUpdate { relayerFeeShareRate: string minPriceTickSize: string minQuantityTickSize: string + ticker: string status: InjectiveExchangeV1Beta1Exchange.MarketStatus } proposer: string @@ -77,6 +80,7 @@ export default class MsgSubmitProposalSpotMarketParamUpdate extends MsgBase< const { params } = this const depositParams = CosmosBaseV1Beta1Coin.Coin.create() + depositParams.denom = params.deposit.denom depositParams.amount = params.deposit.amount @@ -100,17 +104,19 @@ export default class MsgSubmitProposalSpotMarketParamUpdate extends MsgBase< }) const contentAny = GoogleProtobufAny.Any.create() + + contentAny.typeUrl = + '/injective.exchange.v1beta1.SpotMarketParamUpdateProposal' contentAny.value = InjectiveExchangeV1Beta1Proposal.SpotMarketParamUpdateProposal.encode( content, ).finish() - contentAny.typeUrl = - '/injective.exchange.v1beta1.SpotMarketParamUpdateProposal' const message = CosmosGovV1Beta1Tx.MsgSubmitProposal.create() + message.content = contentAny - message.proposer = params.proposer message.initialDeposit = [depositParams] + message.proposer = params.proposer return CosmosGovV1Beta1Tx.MsgSubmitProposal.fromPartial(message) } @@ -128,17 +134,17 @@ export default class MsgSubmitProposalSpotMarketParamUpdate extends MsgBase< const { params } = this const messageWithProposalType = snakecaseKeys({ - proposer: params.proposer, + content: { + type: 'exchange/SpotMarketParamUpdateProposal', + value: this.getContent(), + }, initialDeposit: [ { denom: params.deposit.denom, amount: params.deposit.amount, }, ], - content: { - type_url: 'exchange/SpotMarketParamUpdateProposal', - value: this.getContent(), - }, + proposer: params.proposer, }) return { @@ -152,17 +158,17 @@ export default class MsgSubmitProposalSpotMarketParamUpdate extends MsgBase< const { params } = this const messageWithProposalType = { - proposer: params.proposer, + content: { + '@type': '/injective.exchange.v1beta1.SpotMarketParamUpdateProposal', + ...this.getContent(), + }, initialDeposit: [ { denom: params.deposit.denom, amount: params.deposit.amount, }, ], - content: { - '@type': '/injective.exchange.v1beta1.SpotMarketParamUpdateProposal', - ...this.getContent(), - }, + proposer: params.proposer, } return { diff --git a/packages/sdk-ts/src/core/modules/gov/msgs/MsgSubmitTextProposal.ts b/packages/sdk-ts/src/core/modules/gov/msgs/MsgSubmitTextProposal.ts index 013896053..4798b96f5 100644 --- a/packages/sdk-ts/src/core/modules/gov/msgs/MsgSubmitTextProposal.ts +++ b/packages/sdk-ts/src/core/modules/gov/msgs/MsgSubmitTextProposal.ts @@ -44,6 +44,7 @@ export default class MsgSubmitTextProposal extends MsgBase< const { params } = this const depositParams = CosmosBaseV1Beta1Coin.Coin.create() + depositParams.denom = params.deposit.denom depositParams.amount = params.deposit.amount @@ -51,13 +52,15 @@ export default class MsgSubmitTextProposal extends MsgBase< const proposalType = '/cosmos.gov.v1beta1.TextProposal' const contentAny = GoogleProtobufAny.Any.create() - contentAny.value = CosmosGovV1Beta1Gov.TextProposal.encode(content).finish() + contentAny.typeUrl = proposalType + contentAny.value = CosmosGovV1Beta1Gov.TextProposal.encode(content).finish() const message = CosmosGovV1Beta1Tx.MsgSubmitProposal.create() + message.content = contentAny - message.proposer = params.proposer message.initialDeposit = [depositParams] + message.proposer = params.proposer return CosmosGovV1Beta1Tx.MsgSubmitProposal.fromPartial(message) } @@ -75,17 +78,17 @@ export default class MsgSubmitTextProposal extends MsgBase< const { params } = this const messageWithProposalType = snakecaseKeys({ - proposer: params.proposer, + content: { + type: 'cosmos-sdk/TextProposal', + value: this.getContent(), + }, initialDeposit: [ { denom: params.deposit.denom, amount: params.deposit.amount, }, ], - content: { - type_url: 'cosmos-sdk/TextProposal', - value: this.getContent(), - }, + proposer: params.proposer, }) return { @@ -99,17 +102,17 @@ export default class MsgSubmitTextProposal extends MsgBase< const { params } = this const messageWithProposalType = { - proposer: params.proposer, + content: { + '@type': '/cosmos.gov.v1beta1.TextProposal', + ...this.getContent(), + }, initialDeposit: [ { denom: params.deposit.denom, amount: params.deposit.amount, }, ], - content: { - '@type': '/cosmos.gov.v1beta1.TextProposal', - ...this.getContent(), - }, + proposer: params.proposer, } return { @@ -135,6 +138,7 @@ export default class MsgSubmitTextProposal extends MsgBase< const { params } = this const content = CosmosGovV1Beta1Gov.TextProposal.create() + content.title = params.title content.description = params.description diff --git a/packages/sdk-ts/src/core/modules/gov/msgs/MsgVote.ts b/packages/sdk-ts/src/core/modules/gov/msgs/MsgVote.ts index e80827760..4a5983125 100644 --- a/packages/sdk-ts/src/core/modules/gov/msgs/MsgVote.ts +++ b/packages/sdk-ts/src/core/modules/gov/msgs/MsgVote.ts @@ -25,10 +25,11 @@ export default class MsgVote extends MsgBase { const { params } = this const message = CosmosGovV1Tx.MsgVote.create() - message.option = params.vote + message.proposalId = params.proposalId.toString() - message.metadata = params.metadata message.voter = params.voter + message.option = params.vote + // message.metadata = params.metadata message.metadata = params.proposalId.toString() return message diff --git a/packages/sdk-ts/src/core/modules/ibc/msgs/MsgTransfer.ts b/packages/sdk-ts/src/core/modules/ibc/msgs/MsgTransfer.ts index 397254809..e7734f83a 100644 --- a/packages/sdk-ts/src/core/modules/ibc/msgs/MsgTransfer.ts +++ b/packages/sdk-ts/src/core/modules/ibc/msgs/MsgTransfer.ts @@ -46,16 +46,18 @@ export default class MsgTransfer extends MsgBase< token.amount = params.amount.amount const message = IbcApplicationsTransferV1Tx.MsgTransfer.create() - message.receiver = params.receiver - message.sender = params.sender - message.sourceChannel = params.channelId + message.sourcePort = params.port + message.sourceChannel = params.channelId message.token = token + message.sender = params.sender + message.receiver = params.receiver if (params.height) { const timeoutHeight = IbcCoreClientV1Client.Height.create() - timeoutHeight.revisionHeight = params.height.revisionHeight.toString() + timeoutHeight.revisionNumber = params.height.revisionNumber.toString() + timeoutHeight.revisionHeight = params.height.revisionHeight.toString() message.timeoutHeight = timeoutHeight } diff --git a/packages/sdk-ts/src/core/modules/ibc/msgs/MsgTransferCosmjs.ts b/packages/sdk-ts/src/core/modules/ibc/msgs/MsgTransferCosmjs.ts index 5242211fb..6cd2d9aba 100644 --- a/packages/sdk-ts/src/core/modules/ibc/msgs/MsgTransferCosmjs.ts +++ b/packages/sdk-ts/src/core/modules/ibc/msgs/MsgTransferCosmjs.ts @@ -49,11 +49,12 @@ export default class MsgTransferCosmjs { token.amount = params.amount.amount const message = IbcApplicationsTransferV1Tx.MsgTransfer.create() - message.receiver = params.receiver - message.sender = params.sender - message.sourceChannel = params.channelId + message.sourcePort = params.port + message.sourceChannel = params.channelId message.token = token + message.sender = params.sender + message.receiver = params.receiver if (params.height) { const timeoutHeight = IbcCoreClientV1Client.Height.create() diff --git a/packages/sdk-ts/src/core/modules/insurance/msgs/MsgCreateInsuranceFund.ts b/packages/sdk-ts/src/core/modules/insurance/msgs/MsgCreateInsuranceFund.ts index 6aa941e18..c32fcb7f1 100644 --- a/packages/sdk-ts/src/core/modules/insurance/msgs/MsgCreateInsuranceFund.ts +++ b/packages/sdk-ts/src/core/modules/insurance/msgs/MsgCreateInsuranceFund.ts @@ -42,19 +42,21 @@ export default class MsgCreateInsuranceFund extends MsgBase< public toProto() { const { params } = this - const amountCoin = CosmosBaseV1Beta1Coin.Coin.create() - amountCoin.amount = params.deposit.amount - amountCoin.denom = params.deposit.denom + const coin = CosmosBaseV1Beta1Coin.Coin.create() + + coin.denom = params.deposit.denom + coin.amount = params.deposit.amount const message = InjectiveInsuranceV1Beta1Tx.MsgCreateInsuranceFund.create() + + message.sender = params.injectiveAddress message.ticker = params.fund.ticker message.quoteDenom = params.fund.quoteDenom message.oracleBase = params.fund.oracleBase message.oracleQuote = params.fund.oracleQuote message.oracleType = params.fund.oracleType - message.sender = params.injectiveAddress - message.initialDeposit = amountCoin message.expiry = (params.fund.expiry ? params.fund.expiry : -1).toString() + message.initialDeposit = coin return InjectiveInsuranceV1Beta1Tx.MsgCreateInsuranceFund.fromPartial( message, diff --git a/packages/sdk-ts/src/core/modules/insurance/msgs/MsgRequestRedemption.ts b/packages/sdk-ts/src/core/modules/insurance/msgs/MsgRequestRedemption.ts index 283ef07b9..7e94875b4 100644 --- a/packages/sdk-ts/src/core/modules/insurance/msgs/MsgRequestRedemption.ts +++ b/packages/sdk-ts/src/core/modules/insurance/msgs/MsgRequestRedemption.ts @@ -33,13 +33,15 @@ export default class MsgRequestRedemption extends MsgBase< const { params } = this const amountCoin = CosmosBaseV1Beta1Coin.Coin.create() - amountCoin.amount = params.amount.amount + amountCoin.denom = params.amount.denom + amountCoin.amount = params.amount.amount const message = InjectiveInsuranceV1Beta1Tx.MsgRequestRedemption.create() - message.amount = amountCoin - message.marketId = params.marketId + message.sender = params.injectiveAddress + message.marketId = params.marketId + message.amount = amountCoin return InjectiveInsuranceV1Beta1Tx.MsgRequestRedemption.fromJSON(message) } diff --git a/packages/sdk-ts/src/core/modules/insurance/msgs/MsgUnderwrite.ts b/packages/sdk-ts/src/core/modules/insurance/msgs/MsgUnderwrite.ts index 3543997f2..23cb5df60 100644 --- a/packages/sdk-ts/src/core/modules/insurance/msgs/MsgUnderwrite.ts +++ b/packages/sdk-ts/src/core/modules/insurance/msgs/MsgUnderwrite.ts @@ -33,13 +33,15 @@ export default class MsgUnderwrite extends MsgBase< const { params } = this const amountCoin = CosmosBaseV1Beta1Coin.Coin.create() - amountCoin.amount = params.amount.amount + amountCoin.denom = params.amount.denom + amountCoin.amount = params.amount.amount const message = InjectiveInsuranceV1Beta1Tx.MsgUnderwrite.create() - message.deposit = amountCoin - message.marketId = params.marketId + message.sender = params.injectiveAddress + message.marketId = params.marketId + message.deposit = amountCoin return message } diff --git a/packages/sdk-ts/src/core/modules/peggy/msgs/MsgSendToEth.ts b/packages/sdk-ts/src/core/modules/peggy/msgs/MsgSendToEth.ts index 75707dc95..221dcb289 100644 --- a/packages/sdk-ts/src/core/modules/peggy/msgs/MsgSendToEth.ts +++ b/packages/sdk-ts/src/core/modules/peggy/msgs/MsgSendToEth.ts @@ -41,10 +41,12 @@ export default class MsgSendToEth extends MsgBase< const { params } = this const coinAmount = CosmosBaseV1Beta1Coin.Coin.create() + coinAmount.denom = params.amount.denom coinAmount.amount = params.amount.amount const bridgeFee = CosmosBaseV1Beta1Coin.Coin.create() + bridgeFee.denom = params.bridgeFee ? params.bridgeFee.denom : DEFAULT_BRIDGE_FEE_DENOM @@ -54,9 +56,10 @@ export default class MsgSendToEth extends MsgBase< : DEFAULT_BRIDGE_FEE_AMOUNT const message = InjectivePeggyV1Beta1Msgs.MsgSendToEth.create() - message.amount = coinAmount + message.sender = params.injectiveAddress message.ethDest = params.address + message.amount = coinAmount message.bridgeFee = bridgeFee return InjectivePeggyV1Beta1Msgs.MsgSendToEth.fromPartial(message) diff --git a/packages/sdk-ts/src/core/modules/staking/msgs/MsgBeginRedelegate.ts b/packages/sdk-ts/src/core/modules/staking/msgs/MsgBeginRedelegate.ts index 486ca45c6..8dab286ca 100644 --- a/packages/sdk-ts/src/core/modules/staking/msgs/MsgBeginRedelegate.ts +++ b/packages/sdk-ts/src/core/modules/staking/msgs/MsgBeginRedelegate.ts @@ -34,14 +34,16 @@ export default class MsgBeginRedelegate extends MsgBase< const { params } = this const coinAmount = CosmosBaseV1Beta1Coin.Coin.create() + coinAmount.denom = params.amount.denom coinAmount.amount = params.amount.amount const message = CosmosStakingV1Beta1Tx.MsgBeginRedelegate.create() - message.amount = coinAmount + message.delegatorAddress = params.injectiveAddress message.validatorSrcAddress = params.srcValidatorAddress message.validatorDstAddress = params.dstValidatorAddress + message.amount = coinAmount return CosmosStakingV1Beta1Tx.MsgBeginRedelegate.fromPartial(message) } diff --git a/packages/sdk-ts/src/core/modules/staking/msgs/MsgCancelUnbondingDelegation.ts b/packages/sdk-ts/src/core/modules/staking/msgs/MsgCancelUnbondingDelegation.ts index eabe49cec..955bd732d 100644 --- a/packages/sdk-ts/src/core/modules/staking/msgs/MsgCancelUnbondingDelegation.ts +++ b/packages/sdk-ts/src/core/modules/staking/msgs/MsgCancelUnbondingDelegation.ts @@ -36,13 +36,15 @@ export default class MsgCancelUnbondingDelegation extends MsgBase< const { params } = this const coinAmount = CosmosBaseV1Beta1Coin.Coin.create() + coinAmount.denom = params.amount.denom coinAmount.amount = params.amount.amount const message = CosmosStakingV1Beta1Tx.MsgCancelUnbondingDelegation.create() - message.amount = coinAmount + message.delegatorAddress = params.delegatorAddress message.validatorAddress = params.validatorAddress + message.amount = coinAmount message.creationHeight = params.creationHeight return CosmosStakingV1Beta1Tx.MsgCancelUnbondingDelegation.fromPartial( diff --git a/packages/sdk-ts/src/core/modules/staking/msgs/MsgCreateValidator.ts b/packages/sdk-ts/src/core/modules/staking/msgs/MsgCreateValidator.ts index 5b7a08042..19f52aab6 100644 --- a/packages/sdk-ts/src/core/modules/staking/msgs/MsgCreateValidator.ts +++ b/packages/sdk-ts/src/core/modules/staking/msgs/MsgCreateValidator.ts @@ -61,21 +61,6 @@ export default class MsgCreateValidator extends MsgBase< const message = CosmosStakingV1Beta1Tx.MsgCreateValidator.create() - message.delegatorAddress = params.delegatorAddress - message.validatorAddress = params.validatorAddress - - if (params.commission) { - const commissionRate = - CosmosStakingV1Beta1Staking.CommissionRates.create() - commissionRate.maxChangeRate = commissionRate.maxChangeRate - commissionRate.rate = commissionRate.rate - commissionRate.maxRate = commissionRate.maxRate - } - - if (params.minSelfDelegation) { - message.minSelfDelegation = params.minSelfDelegation - } - if (params.description) { const description = CosmosStakingV1Beta1Staking.Description.create() @@ -102,6 +87,20 @@ export default class MsgCreateValidator extends MsgBase< message.description = description } + if (params.commission) { + const commissionRate = + CosmosStakingV1Beta1Staking.CommissionRates.create() + + commissionRate.rate = commissionRate.rate + commissionRate.maxRate = commissionRate.maxRate + commissionRate.maxChangeRate = commissionRate.maxChangeRate + } + + if (params.minSelfDelegation) { + message.minSelfDelegation = params.minSelfDelegation + } + + message.delegatorAddress = params.delegatorAddress message.validatorAddress = params.validatorAddress if (params.pubKey) { @@ -114,11 +113,12 @@ export default class MsgCreateValidator extends MsgBase< } if (params.value) { - const value = CosmosBaseV1Beta1Coin.Coin.create() - value.denom = params.value.denom - value.amount = params.value.amount + const coin = CosmosBaseV1Beta1Coin.Coin.create() + + coin.denom = params.value.denom + coin.amount = params.value.amount - message.value = value + message.value = coin } return CosmosStakingV1Beta1Tx.MsgCreateValidator.fromPartial(message) diff --git a/packages/sdk-ts/src/core/modules/staking/msgs/MsgDelegate.ts b/packages/sdk-ts/src/core/modules/staking/msgs/MsgDelegate.ts index 034ffc24b..95d308681 100644 --- a/packages/sdk-ts/src/core/modules/staking/msgs/MsgDelegate.ts +++ b/packages/sdk-ts/src/core/modules/staking/msgs/MsgDelegate.ts @@ -33,13 +33,15 @@ export default class MsgDelegate extends MsgBase< const { params } = this const coinAmount = CosmosBaseV1Beta1Coin.Coin.create() + coinAmount.denom = params.amount.denom coinAmount.amount = params.amount.amount const message = CosmosStakingV1Beta1Tx.MsgDelegate.create() - message.amount = coinAmount + message.delegatorAddress = params.injectiveAddress message.validatorAddress = params.validatorAddress + message.amount = coinAmount return CosmosStakingV1Beta1Tx.MsgDelegate.fromPartial(message) } diff --git a/packages/sdk-ts/src/core/modules/staking/msgs/MsgEditValidator.ts b/packages/sdk-ts/src/core/modules/staking/msgs/MsgEditValidator.ts index 5d65c7794..599ff2252 100644 --- a/packages/sdk-ts/src/core/modules/staking/msgs/MsgEditValidator.ts +++ b/packages/sdk-ts/src/core/modules/staking/msgs/MsgEditValidator.ts @@ -38,14 +38,6 @@ export default class MsgEditValidator extends MsgBase< const message = CosmosStakingV1Beta1Tx.MsgEditValidator.create() - if (params.commissionRate) { - message.commissionRate = params.commissionRate - } - - if (params.minSelfDelegation) { - message.minSelfDelegation = params.minSelfDelegation - } - if (params.description) { const description = CosmosStakingV1Beta1Staking.Description.create() @@ -74,6 +66,14 @@ export default class MsgEditValidator extends MsgBase< message.validatorAddress = params.validatorAddress + if (params.commissionRate) { + message.commissionRate = params.commissionRate + } + + if (params.minSelfDelegation) { + message.minSelfDelegation = params.minSelfDelegation + } + return CosmosStakingV1Beta1Tx.MsgEditValidator.fromPartial(message) } diff --git a/packages/sdk-ts/src/core/modules/staking/msgs/MsgUndelegate.ts b/packages/sdk-ts/src/core/modules/staking/msgs/MsgUndelegate.ts index 21cee919b..006ccb45a 100644 --- a/packages/sdk-ts/src/core/modules/staking/msgs/MsgUndelegate.ts +++ b/packages/sdk-ts/src/core/modules/staking/msgs/MsgUndelegate.ts @@ -33,13 +33,15 @@ export default class MsgUndelegate extends MsgBase< const { params } = this const coinAmount = CosmosBaseV1Beta1Coin.Coin.create() + coinAmount.denom = params.amount.denom coinAmount.amount = params.amount.amount const message = CosmosStakingV1Beta1Tx.MsgUndelegate.create() - message.amount = coinAmount + message.delegatorAddress = params.injectiveAddress message.validatorAddress = params.validatorAddress + message.amount = coinAmount return CosmosStakingV1Beta1Tx.MsgUndelegate.fromPartial(message) } diff --git a/packages/sdk-ts/src/core/modules/tokenfactory/msgs/MsgBurn.ts b/packages/sdk-ts/src/core/modules/tokenfactory/msgs/MsgBurn.ts index e41b735be..3eee6e843 100644 --- a/packages/sdk-ts/src/core/modules/tokenfactory/msgs/MsgBurn.ts +++ b/packages/sdk-ts/src/core/modules/tokenfactory/msgs/MsgBurn.ts @@ -1,6 +1,9 @@ import { MsgBase } from '../../MsgBase' import snakecaseKeys from 'snakecase-keys' -import { InjectiveTokenFactoryV1Beta1Tx } from '@injectivelabs/core-proto-ts' +import { + CosmosBaseV1Beta1Coin, + InjectiveTokenFactoryV1Beta1Tx, +} from '@injectivelabs/core-proto-ts' export declare namespace MsgBurn { export interface Params { @@ -25,9 +28,15 @@ export default class MsgBurn extends MsgBase { public toProto() { const { params } = this + const coin = CosmosBaseV1Beta1Coin.Coin.create() + + coin.denom = params.amount.denom + coin.amount = params.amount.amount + const message = InjectiveTokenFactoryV1Beta1Tx.MsgBurn.create() + message.sender = params.sender - message.amount = params.amount + message.amount = coin return InjectiveTokenFactoryV1Beta1Tx.MsgBurn.fromPartial(message) } diff --git a/packages/sdk-ts/src/core/modules/tokenfactory/msgs/MsgChangeAdmin.ts b/packages/sdk-ts/src/core/modules/tokenfactory/msgs/MsgChangeAdmin.ts index b32f125bc..f361751fd 100644 --- a/packages/sdk-ts/src/core/modules/tokenfactory/msgs/MsgChangeAdmin.ts +++ b/packages/sdk-ts/src/core/modules/tokenfactory/msgs/MsgChangeAdmin.ts @@ -27,6 +27,7 @@ export default class MsgChangeAdmin extends MsgBase< const { params } = this const message = InjectiveTokenFactoryV1Beta1Tx.MsgChangeAdmin.create() + message.sender = params.sender message.denom = params.denom message.newAdmin = params.newAdmin diff --git a/packages/sdk-ts/src/core/modules/tokenfactory/msgs/MsgCreateDenom.ts b/packages/sdk-ts/src/core/modules/tokenfactory/msgs/MsgCreateDenom.ts index 098daf805..0c23551e1 100644 --- a/packages/sdk-ts/src/core/modules/tokenfactory/msgs/MsgCreateDenom.ts +++ b/packages/sdk-ts/src/core/modules/tokenfactory/msgs/MsgCreateDenom.ts @@ -28,6 +28,7 @@ export default class MsgCreateDenom extends MsgBase< const { params } = this const message = InjectiveTokenFactoryV1Beta1Tx.MsgCreateDenom.create() + message.sender = params.sender message.subdenom = params.subdenom message.name = params.name || '' diff --git a/packages/sdk-ts/src/core/modules/tokenfactory/msgs/MsgMint.ts b/packages/sdk-ts/src/core/modules/tokenfactory/msgs/MsgMint.ts index e87f03d55..1647180cd 100644 --- a/packages/sdk-ts/src/core/modules/tokenfactory/msgs/MsgMint.ts +++ b/packages/sdk-ts/src/core/modules/tokenfactory/msgs/MsgMint.ts @@ -1,6 +1,9 @@ import { MsgBase } from '../../MsgBase' import snakecaseKeys from 'snakecase-keys' -import { InjectiveTokenFactoryV1Beta1Tx } from '@injectivelabs/core-proto-ts' +import { + CosmosBaseV1Beta1Coin, + InjectiveTokenFactoryV1Beta1Tx, +} from '@injectivelabs/core-proto-ts' export declare namespace MsgMint { export interface Params { @@ -25,9 +28,15 @@ export default class MsgMint extends MsgBase { public toProto() { const { params } = this + const coin = CosmosBaseV1Beta1Coin.Coin.create() + + coin.denom = params.amount.denom + coin.amount = params.amount.amount + const message = InjectiveTokenFactoryV1Beta1Tx.MsgMint.create() + message.sender = params.sender - message.amount = params.amount + message.amount = coin return InjectiveTokenFactoryV1Beta1Tx.MsgMint.fromPartial(message) } diff --git a/packages/sdk-ts/src/core/modules/tokenfactory/msgs/MsgSetDenomMetadata.ts b/packages/sdk-ts/src/core/modules/tokenfactory/msgs/MsgSetDenomMetadata.ts index 2dd27aaa6..e6b1bb5c2 100644 --- a/packages/sdk-ts/src/core/modules/tokenfactory/msgs/MsgSetDenomMetadata.ts +++ b/packages/sdk-ts/src/core/modules/tokenfactory/msgs/MsgSetDenomMetadata.ts @@ -1,7 +1,9 @@ import { MsgBase } from '../../MsgBase' import snakecaseKeys from 'snakecase-keys' -import { InjectiveTokenFactoryV1Beta1Tx } from '@injectivelabs/core-proto-ts' -import { CosmosBankV1Beta1Bank } from '@injectivelabs/core-proto-ts' +import { + CosmosBankV1Beta1Bank, + InjectiveTokenFactoryV1Beta1Tx, +} from '@injectivelabs/core-proto-ts' export declare namespace MsgSetDenomMetadata { export interface Params { @@ -26,9 +28,30 @@ export default class MsgSetDenomMetadata extends MsgBase< public toProto() { const { params } = this + const metadata = CosmosBankV1Beta1Bank.Metadata.create() + + metadata.description = params.metadata.description + metadata.denomUnits = params.metadata.denomUnits.map((value) => { + const denomUnit = CosmosBankV1Beta1Bank.DenomUnit.create() + + denomUnit.denom = value.denom + denomUnit.exponent = value.exponent + denomUnit.aliases = value.aliases + + return denomUnit + }) + metadata.base = params.metadata.base + metadata.display = params.metadata.display + metadata.name = params.metadata.name + metadata.symbol = params.metadata.symbol + metadata.uri = params.metadata.uri + metadata.uriHash = params.metadata.uriHash + metadata.decimals = params.metadata.decimals + const message = InjectiveTokenFactoryV1Beta1Tx.MsgSetDenomMetadata.create() + message.sender = params.sender - message.metadata = params.metadata + message.metadata = metadata return InjectiveTokenFactoryV1Beta1Tx.MsgSetDenomMetadata.fromPartial( message, diff --git a/packages/sdk-ts/src/core/modules/tx/types/tx-rest-client.ts b/packages/sdk-ts/src/core/modules/tx/types/tx-rest-client.ts index 5ffdad9cc..713247569 100644 --- a/packages/sdk-ts/src/core/modules/tx/types/tx-rest-client.ts +++ b/packages/sdk-ts/src/core/modules/tx/types/tx-rest-client.ts @@ -1,11 +1,11 @@ import { CosmosTxV1Beta1Tx, - TendermintCryptoKeys, + CometCryptoV1Keys, } from '@injectivelabs/core-proto-ts' /* eslint-disable camelcase */ export interface RestSignerInfo { - public_key: TendermintCryptoKeys.PublicKey | null + public_key: CometCryptoV1Keys.PublicKey | null mode_info: CosmosTxV1Beta1Tx.ModeInfo sequence: string } diff --git a/packages/sdk-ts/src/core/modules/wasm/msgs/MsgExecuteContract.ts b/packages/sdk-ts/src/core/modules/wasm/msgs/MsgExecuteContract.ts index fefedcf86..9b8973718 100644 --- a/packages/sdk-ts/src/core/modules/wasm/msgs/MsgExecuteContract.ts +++ b/packages/sdk-ts/src/core/modules/wasm/msgs/MsgExecuteContract.ts @@ -62,9 +62,9 @@ export default class MsgExecuteContract extends MsgBase< const message = CosmwasmWasmV1Tx.MsgExecuteContract.create() const msg = this.getMsgObject() - message.msg = fromUtf8(JSON.stringify(msg)) message.sender = params.sender message.contract = params.contractAddress + message.msg = fromUtf8(JSON.stringify(msg)) if (params.funds) { const fundsToArray = Array.isArray(params.funds) @@ -74,8 +74,8 @@ export default class MsgExecuteContract extends MsgBase< const funds = fundsToArray.map((coin) => { const funds = CosmosBaseV1Beta1Coin.Coin.create() - funds.amount = coin.amount funds.denom = coin.denom + funds.amount = coin.amount return funds }) diff --git a/packages/sdk-ts/src/core/modules/wasm/msgs/MsgExecuteContractCompat.ts b/packages/sdk-ts/src/core/modules/wasm/msgs/MsgExecuteContractCompat.ts index e2208e6fa..26aa23b7f 100644 --- a/packages/sdk-ts/src/core/modules/wasm/msgs/MsgExecuteContractCompat.ts +++ b/packages/sdk-ts/src/core/modules/wasm/msgs/MsgExecuteContractCompat.ts @@ -82,9 +82,9 @@ export default class MsgExecuteContractCompat extends MsgBase< const message = InjectiveWasmxV1Beta1Tx.MsgExecuteContractCompat.create() const msg = this.getMsgObject() - message.msg = JSON.stringify(msg) message.sender = params.sender message.contract = params.contractAddress + message.msg = JSON.stringify(msg) if (params.funds) { const fundsToArray = Array.isArray(params.funds) diff --git a/packages/sdk-ts/src/core/modules/wasm/msgs/MsgMigrateContract.ts b/packages/sdk-ts/src/core/modules/wasm/msgs/MsgMigrateContract.ts index 772a34243..13ef79ea4 100644 --- a/packages/sdk-ts/src/core/modules/wasm/msgs/MsgMigrateContract.ts +++ b/packages/sdk-ts/src/core/modules/wasm/msgs/MsgMigrateContract.ts @@ -34,9 +34,10 @@ export default class MsgMigrateContract extends MsgBase< const { params } = this const message = CosmwasmWasmV1Tx.MsgMigrateContract.create() - message.codeId = params.codeId.toString() - message.contract = params.contract + message.sender = params.sender + message.contract = params.contract + message.codeId = params.codeId.toString() message.msg = fromUtf8(JSON.stringify(params.msg)) return CosmwasmWasmV1Tx.MsgMigrateContract.fromPartial(message) diff --git a/packages/ts-types/src/enums.ts b/packages/ts-types/src/enums.ts index 5f729b5bb..e26d60608 100644 --- a/packages/ts-types/src/enums.ts +++ b/packages/ts-types/src/enums.ts @@ -97,6 +97,8 @@ export enum MsgType { MsgMint = 'injective.tokenfactory.v1beta1.MsgMint', MsgCreateDenom = 'injective.tokenfactory.v1beta1.MsgCreateDenom', MsgExecuteContractCompat = 'injective.wasmx.v1.MsgExecuteContractCompat', + MsgPrivilegedExecuteContract = 'injective.exchange.v1beta1.MsgPrivilegedExecuteContract', + MsgMultiSend = 'cosmos.bank.v1beta1.MsgMultiSend', } export enum MsgStatus { diff --git a/packages/wallet-ts/src/broadcaster/MsgBroadcaster.ts b/packages/wallet-ts/src/broadcaster/MsgBroadcaster.ts index 787b7b5ec..ac4e0d0d1 100644 --- a/packages/wallet-ts/src/broadcaster/MsgBroadcaster.ts +++ b/packages/wallet-ts/src/broadcaster/MsgBroadcaster.ts @@ -306,6 +306,7 @@ export class MsgBroadcaster { JSON.stringify(eip712TypedData), tx.ethereumAddress, ) + const pubKeyOrSignatureDerivedPubKey = getEthereumWalletPubKey({ pubKey: baseAccount.pubKey?.key, eip712TypedData, @@ -417,13 +418,13 @@ export class MsgBroadcaster { JSON.stringify(eip712TypedData), tx.ethereumAddress, ) + const pubKeyOrSignatureDerivedPubKey = getEthereumWalletPubKey({ pubKey: baseAccount.pubKey?.key, eip712TypedData, signature, }) - /** Preparing the transaction for client broadcasting */ const { txRaw } = createTransaction({ message: msgs, memo: tx.memo, diff --git a/packages/wallet-ts/src/strategies/wallet-strategy/strategies/Ledger/Base.ts b/packages/wallet-ts/src/strategies/wallet-strategy/strategies/Ledger/Base.ts index 4c6395441..69b8d7e34 100644 --- a/packages/wallet-ts/src/strategies/wallet-strategy/strategies/Ledger/Base.ts +++ b/packages/wallet-ts/src/strategies/wallet-strategy/strategies/Ledger/Base.ts @@ -1,8 +1,5 @@ /* eslint-disable class-methods-use-this */ -import { - AccountAddress, - EthereumChainId, -} from '@injectivelabs/ts-types' +import { AccountAddress, EthereumChainId } from '@injectivelabs/ts-types' import { bufferToHex, addHexPrefix } from 'ethereumjs-util' import { Common, Chain, Hardfork } from '@ethereumjs/common' import { FeeMarketEIP1559Transaction } from '@ethereumjs/tx' @@ -410,7 +407,7 @@ export default class LedgerBase network: ethereumChainId === EthereumChainId.Mainnet ? AlchemyNetwork.ETH_MAINNET - : AlchemyNetwork.ETH_GOERLI, + : AlchemyNetwork.ETH_SEPOLIA, }) return this.alchemy diff --git a/packages/wallet-ts/src/strategies/wallet-strategy/strategies/Trezor/index.ts b/packages/wallet-ts/src/strategies/wallet-strategy/strategies/Trezor/index.ts index 91df0e9c7..2634d7a1f 100644 --- a/packages/wallet-ts/src/strategies/wallet-strategy/strategies/Trezor/index.ts +++ b/packages/wallet-ts/src/strategies/wallet-strategy/strategies/Trezor/index.ts @@ -1,9 +1,6 @@ /* eslint-disable camelcase */ /* eslint-disable class-methods-use-this */ -import { - AccountAddress, - EthereumChainId, -} from '@injectivelabs/ts-types' +import { AccountAddress, EthereumChainId } from '@injectivelabs/ts-types' import { Alchemy, Network as AlchemyNetwork } from 'alchemy-sdk' import { addHexPrefix } from 'ethereumjs-util' import { FeeMarketEIP1559Transaction } from '@ethereumjs/tx' @@ -64,7 +61,10 @@ const getNetworkFromChainId = (chainId: EthereumChainId): Chain => { return Chain.Mainnet } -export default class Trezor extends BaseConcreteStrategy implements ConcreteWalletStrategy { +export default class Trezor + extends BaseConcreteStrategy + implements ConcreteWalletStrategy +{ private trezor: TrezorHW private ethereumOptions: WalletStrategyEthereumOptions @@ -433,7 +433,7 @@ export default class Trezor extends BaseConcreteStrategy implements ConcreteWall network: ethereumChainId === EthereumChainId.Mainnet ? AlchemyNetwork.ETH_MAINNET - : AlchemyNetwork.ETH_GOERLI, + : AlchemyNetwork.ETH_SEPOLIA, }) return this.alchemy diff --git a/yarn.lock b/yarn.lock index 809593340..ad74d09e3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2174,10 +2174,10 @@ resolved "https://registry.npmjs.org/@hutson/parse-repository-url/-/parse-repository-url-3.0.2.tgz#98c23c950a3d9b6c8f0daed06da6c3af06981340" integrity sha512-H9XAx3hc0BQHY6l+IFSWHDySypcXsvsuLhgYLUGywmJ5pswRVQJUHpOsobnLYp2ZUaUlKiKDrgWWhosOwAEM8Q== -"@injectivelabs/core-proto-ts@^0.0.21": - version "0.0.21" - resolved "https://registry.npmjs.org/@injectivelabs/core-proto-ts/-/core-proto-ts-0.0.21.tgz#b52d4bee7556ce57c7c7e2c1ec7f6b920b4c2ffd" - integrity sha512-RBxSkRBCty60R/l55/D1jsSW0Aof5dyGFhCFdN3A010KjMv/SzZGGr+6DZPY/hflyFeaJzDv/VTopCymKNRBvQ== +"@injectivelabs/core-proto-ts@0.0.28": + version "0.0.28" + resolved "https://registry.yarnpkg.com/@injectivelabs/core-proto-ts/-/core-proto-ts-0.0.28.tgz#87dde07027c0839fc27a29c19e54275c68538738" + integrity sha512-AHzRa8Us48HjciHS9KmZEgLuMBByeujZSyZv8xHOZku97pYapO7grIaLtLH41iMSD0bOAWqfV1SBgywYkOrDug== dependencies: "@injectivelabs/grpc-web" "^0.0.1" google-protobuf "^3.14.0" @@ -2194,6 +2194,17 @@ protobufjs "^7.0.0" rxjs "^7.4.0" +"@injectivelabs/exceptions@^1.14.12", "@injectivelabs/exceptions@^1.14.12-beta.0": + version "1.14.12" + resolved "https://registry.yarnpkg.com/@injectivelabs/exceptions/-/exceptions-1.14.12.tgz#bd1a7ebe07d044bf8d5265e4481770cf694be0f4" + integrity sha512-aZaGRIFVQIuOcPsbZcwEiWvDtO7yUWBplmPqBhPGt2h6YGaree8DbHJQnc/youIB61NpbGH6Qev4EJYDx9rIxA== + dependencies: + "@injectivelabs/grpc-web" "^0.0.1" + "@injectivelabs/ts-types" "^1.14.12" + http-status-codes "^2.2.0" + link-module-alias "^1.2.0" + shx "^0.3.2" + "@injectivelabs/grpc-web-node-http-transport@^0.0.2": version "0.0.2" resolved "https://registry.yarnpkg.com/@injectivelabs/grpc-web-node-http-transport/-/grpc-web-node-http-transport-0.0.2.tgz#87c9bbd4db1f70cf18d6a55b54b2cf17d3cf30c0" @@ -2211,10 +2222,10 @@ dependencies: browser-headers "^0.4.1" -"@injectivelabs/indexer-proto-ts@1.11.42": - version "1.11.42" - resolved "https://registry.yarnpkg.com/@injectivelabs/indexer-proto-ts/-/indexer-proto-ts-1.11.42.tgz#6923e286ad12e87d276c6bca1397ba0a013ee82d" - integrity sha512-6ejCpcWZWOSsELFIfUf2+xuJPOH+YdiJtwtB3d9x2H7dnrCBjXMxlPCSxoKEUbDH6w/lY2mO6TJm65rNy9piew== +"@injectivelabs/indexer-proto-ts@1.11.44": + version "1.11.44" + resolved "https://registry.yarnpkg.com/@injectivelabs/indexer-proto-ts/-/indexer-proto-ts-1.11.44.tgz#f3d48c421d835d9362d4cc604215295cb14164d7" + integrity sha512-D8/y6BE9h2mvMPlPz0GIwEr/0Ge0LdqBnYP9iwvI+4B3XUoE6sCFliE+Q0+4moj7kodsS3lpZ5qm0Q3s9Nun4g== dependencies: "@injectivelabs/grpc-web" "^0.0.1" google-protobuf "^3.14.0" @@ -2231,6 +2242,52 @@ protobufjs "^7.0.0" rxjs "^7.4.0" +"@injectivelabs/networks@^1.14.12-beta.0": + version "1.14.12" + resolved "https://registry.yarnpkg.com/@injectivelabs/networks/-/networks-1.14.12.tgz#4d6f6849d5329f3f2a06d3455c04a38216ca08e3" + integrity sha512-YlUyL5Q8W12xXS7Z4Wp/7WQvIxII3TLXq+muxHHwaH5vpMIS/06IFhhVl2RFtPyvVwUqHRowB8VnCeK22eCgYw== + dependencies: + "@injectivelabs/exceptions" "^1.14.12" + "@injectivelabs/ts-types" "^1.14.12" + "@injectivelabs/utils" "^1.14.12" + link-module-alias "^1.2.0" + shx "^0.3.2" + +"@injectivelabs/test-utils@^1.14.13-beta.0": + version "1.14.13" + resolved "https://registry.yarnpkg.com/@injectivelabs/test-utils/-/test-utils-1.14.13.tgz#b63636e5c780e86b2dda948ee0b16199d96a42c4" + integrity sha512-wa5TQcWLvORRm36mw4Hee+XF7lBlArVK3DM1ebC0uBvVcUgrmm3g/nh1pV/NzLN16WtrLLsvnTsE5uiNEcgYdw== + dependencies: + axios "^1.6.4" + bignumber.js "^9.0.1" + link-module-alias "^1.2.0" + shx "^0.3.2" + snakecase-keys "^5.1.2" + store2 "^2.12.0" + +"@injectivelabs/ts-types@^1.14.12", "@injectivelabs/ts-types@^1.14.12-beta.0": + version "1.14.12" + resolved "https://registry.yarnpkg.com/@injectivelabs/ts-types/-/ts-types-1.14.12.tgz#6a3b9882665d0e6899cdf1b3cc290ca1fd2cfa53" + integrity sha512-jDyBQQLbdeOSaMjdkeJhvwCRzAM/cixPLuyg9acxYvlwaRZgF4iZKt9nS/N/uWQxxE6pAy2c8hl4YHHbV/N9Ew== + dependencies: + link-module-alias "^1.2.0" + shx "^0.3.2" + +"@injectivelabs/utils@^1.14.12", "@injectivelabs/utils@^1.14.12-beta.0": + version "1.14.12" + resolved "https://registry.yarnpkg.com/@injectivelabs/utils/-/utils-1.14.12.tgz#4f002f3923971e9a694a3ae30de049098750dfeb" + integrity sha512-4W38Mb6no+UH0pQsK9vhS6q6y5kFUTCVqFtxYs03Ra8AXqODyIS1nDBK9LT78WnJtjIPnbgKOlXgiZxyIVKJqQ== + dependencies: + "@injectivelabs/exceptions" "^1.14.12" + "@injectivelabs/ts-types" "^1.14.12" + axios "^1.6.4" + bignumber.js "^9.0.1" + http-status-codes "^2.2.0" + link-module-alias "^1.2.0" + shx "^0.3.2" + snakecase-keys "^5.1.2" + store2 "^2.12.0" + "@ioredis/commands@^1.1.1": version "1.2.0" resolved "https://registry.npmjs.org/@ioredis/commands/-/commands-1.2.0.tgz#6d61b3097470af1fdbbe622795b8921d42018e11"