@injectivelabs/sdk-ts 1.15.43 → 1.16.1-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/client/chain/grpc/ChainGrpcPeggyApi.d.ts +2 -2
- package/dist/cjs/client/chain/grpc/ChainGrpcPeggyApi.js +3 -3
- package/dist/cjs/client/chain/grpc/ChainGrpcTendermintApi.d.ts +2 -2
- package/dist/cjs/client/chain/grpc/ChainGrpcWasmXApi.d.ts +3 -3
- package/dist/cjs/client/chain/grpc/ChainGrpcWasmXApi.js +5 -5
- package/dist/cjs/client/chain/transformers/ChainGrpcPeggyTransformer.d.ts +2 -2
- package/dist/cjs/core/modules/authz/msgs/authorizations/ContractExecutionCompatAuthorization.d.ts +2 -2
- package/dist/cjs/core/modules/authz/msgs/authorizations/ContractExecutionCompatAuthorization.js +3 -3
- package/dist/cjs/core/modules/gov/index.d.ts +3 -2
- package/dist/cjs/core/modules/gov/index.js +3 -1
- package/dist/cjs/core/modules/gov/msgs/MsgSubmitProposalPerpetualMarketLaunchV2.d.ts +88 -0
- package/dist/cjs/core/modules/gov/msgs/MsgSubmitProposalPerpetualMarketLaunchV2.js +174 -0
- package/dist/cjs/core/modules/peggy/msgs/MsgSendToEth.d.ts +4 -4
- package/dist/cjs/core/modules/peggy/msgs/MsgSendToEth.js +3 -3
- package/dist/cjs/core/modules/wasm/msgs/MsgExecuteContractCompat.d.ts +5 -5
- package/dist/cjs/core/modules/wasm/msgs/MsgExecuteContractCompat.js +3 -3
- package/dist/cjs/core/tx/api/TxGrpcApi.d.ts +2 -2
- package/dist/cjs/core/tx/broadcaster/MsgBroadcasterWithPk.d.ts +2 -2
- package/dist/esm/client/chain/grpc/ChainGrpcPeggyApi.d.ts +2 -2
- package/dist/esm/client/chain/grpc/ChainGrpcPeggyApi.js +4 -4
- package/dist/esm/client/chain/grpc/ChainGrpcTendermintApi.d.ts +2 -2
- package/dist/esm/client/chain/grpc/ChainGrpcWasmXApi.d.ts +3 -3
- package/dist/esm/client/chain/grpc/ChainGrpcWasmXApi.js +6 -6
- package/dist/esm/client/chain/transformers/ChainGrpcPeggyTransformer.d.ts +2 -2
- package/dist/esm/core/modules/authz/msgs/authorizations/ContractExecutionCompatAuthorization.d.ts +2 -2
- package/dist/esm/core/modules/authz/msgs/authorizations/ContractExecutionCompatAuthorization.js +4 -4
- package/dist/esm/core/modules/gov/index.d.ts +3 -2
- package/dist/esm/core/modules/gov/index.js +2 -1
- package/dist/esm/core/modules/gov/msgs/MsgSubmitProposalPerpetualMarketLaunchV2.d.ts +88 -0
- package/dist/esm/core/modules/gov/msgs/MsgSubmitProposalPerpetualMarketLaunchV2.js +168 -0
- package/dist/esm/core/modules/peggy/msgs/MsgSendToEth.d.ts +4 -4
- package/dist/esm/core/modules/peggy/msgs/MsgSendToEth.js +4 -4
- package/dist/esm/core/modules/wasm/msgs/MsgExecuteContractCompat.d.ts +5 -5
- package/dist/esm/core/modules/wasm/msgs/MsgExecuteContractCompat.js +4 -4
- package/dist/esm/core/tx/api/TxGrpcApi.d.ts +2 -2
- package/dist/esm/core/tx/broadcaster/MsgBroadcasterWithPk.d.ts +2 -2
- package/package.json +7 -7
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { InjectiveWasmxV1Query } from '@injectivelabs/core-proto-ts';
|
|
2
2
|
import BaseGrpcConsumer from '../../base/BaseGrpcConsumer.js';
|
|
3
3
|
/**
|
|
4
4
|
* @category Chain Grpc API
|
|
5
5
|
*/
|
|
6
6
|
export declare class ChainGrpcWasmXApi extends BaseGrpcConsumer {
|
|
7
7
|
protected module: string;
|
|
8
|
-
protected client:
|
|
8
|
+
protected client: InjectiveWasmxV1Query.QueryClientImpl;
|
|
9
9
|
constructor(endpoint: string);
|
|
10
|
-
fetchModuleParams(): Promise<
|
|
10
|
+
fetchModuleParams(): Promise<InjectiveWasmxV1Query.QueryWasmxParamsResponse>;
|
|
11
11
|
fetchModuleState(): Promise<import("@injectivelabs/core-proto-ts/cjs/injective/wasmx/v1/genesis.js").GenesisState | undefined>;
|
|
12
12
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UnspecifiedErrorCode, grpcErrorCodeToErrorCode, GrpcUnaryRequestException, } from '@injectivelabs/exceptions';
|
|
2
|
-
import {
|
|
2
|
+
import { InjectiveWasmxV1Query } from '@injectivelabs/core-proto-ts';
|
|
3
3
|
import BaseGrpcConsumer from '../../base/BaseGrpcConsumer.js';
|
|
4
4
|
import { ChainModule } from '../types/index.js';
|
|
5
5
|
/**
|
|
@@ -10,16 +10,16 @@ export class ChainGrpcWasmXApi extends BaseGrpcConsumer {
|
|
|
10
10
|
client;
|
|
11
11
|
constructor(endpoint) {
|
|
12
12
|
super(endpoint);
|
|
13
|
-
this.client = new
|
|
13
|
+
this.client = new InjectiveWasmxV1Query.QueryClientImpl(this.getGrpcWebImpl(endpoint));
|
|
14
14
|
}
|
|
15
15
|
async fetchModuleParams() {
|
|
16
|
-
const request =
|
|
16
|
+
const request = InjectiveWasmxV1Query.QueryWasmxParamsRequest.create();
|
|
17
17
|
try {
|
|
18
18
|
const response = await this.retry(() => this.client.WasmxParams(request, this.metadata));
|
|
19
19
|
return response;
|
|
20
20
|
}
|
|
21
21
|
catch (e) {
|
|
22
|
-
if (e instanceof
|
|
22
|
+
if (e instanceof InjectiveWasmxV1Query.GrpcWebError) {
|
|
23
23
|
throw new GrpcUnaryRequestException(new Error(e.toString()), {
|
|
24
24
|
code: grpcErrorCodeToErrorCode(e.code),
|
|
25
25
|
context: 'WasmxParams',
|
|
@@ -34,13 +34,13 @@ export class ChainGrpcWasmXApi extends BaseGrpcConsumer {
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
async fetchModuleState() {
|
|
37
|
-
const request =
|
|
37
|
+
const request = InjectiveWasmxV1Query.QueryModuleStateRequest.create();
|
|
38
38
|
try {
|
|
39
39
|
const response = await this.retry(() => this.client.WasmxModuleState(request, this.metadata));
|
|
40
40
|
return response.state; /* TODO */
|
|
41
41
|
}
|
|
42
42
|
catch (e) {
|
|
43
|
-
if (e instanceof
|
|
43
|
+
if (e instanceof InjectiveWasmxV1Query.GrpcWebError) {
|
|
44
44
|
throw new GrpcUnaryRequestException(new Error(e.toString()), {
|
|
45
45
|
code: grpcErrorCodeToErrorCode(e.code),
|
|
46
46
|
context: 'WasmxModuleState',
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { PeggyModuleParams } from '../types/peggy.js';
|
|
2
|
-
import {
|
|
2
|
+
import { InjectivePeggyV1Query } from '@injectivelabs/core-proto-ts';
|
|
3
3
|
/**
|
|
4
4
|
* @category Chain Grpc Transformer
|
|
5
5
|
*/
|
|
6
6
|
export declare class ChainGrpcPeggyTransformer {
|
|
7
|
-
static moduleParamsResponseToModuleParams(response:
|
|
7
|
+
static moduleParamsResponseToModuleParams(response: InjectivePeggyV1Query.QueryParamsResponse): PeggyModuleParams;
|
|
8
8
|
}
|
package/dist/esm/core/modules/authz/msgs/authorizations/ContractExecutionCompatAuthorization.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Coin } from '@injectivelabs/ts-types';
|
|
2
|
-
import { GoogleProtobufAny,
|
|
2
|
+
import { GoogleProtobufAny, InjectiveWasmxV1Authz } from '@injectivelabs/core-proto-ts';
|
|
3
3
|
import { BaseAuthorization } from './Base.js';
|
|
4
4
|
export declare namespace ContractExecutionCompatAuthorization {
|
|
5
5
|
interface Params {
|
|
@@ -13,7 +13,7 @@ export declare namespace ContractExecutionCompatAuthorization {
|
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
15
|
type Any = GoogleProtobufAny.Any;
|
|
16
|
-
type Proto =
|
|
16
|
+
type Proto = InjectiveWasmxV1Authz.ContractExecutionCompatAuthorization;
|
|
17
17
|
type Amino = Object;
|
|
18
18
|
}
|
|
19
19
|
/**
|
package/dist/esm/core/modules/authz/msgs/authorizations/ContractExecutionCompatAuthorization.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GoogleProtobufAny, CosmwasmWasmV1Authz,
|
|
1
|
+
import { GoogleProtobufAny, CosmwasmWasmV1Authz, InjectiveWasmxV1Authz, } from '@injectivelabs/core-proto-ts';
|
|
2
2
|
import { BaseAuthorization } from './Base.js';
|
|
3
3
|
/**
|
|
4
4
|
* @category Contract Exec Arguments
|
|
@@ -9,7 +9,7 @@ export default class ContractExecutionCompatAuthorization extends BaseAuthorizat
|
|
|
9
9
|
}
|
|
10
10
|
toAny() {
|
|
11
11
|
const { params } = this;
|
|
12
|
-
const authorization =
|
|
12
|
+
const authorization = InjectiveWasmxV1Authz.ContractExecutionCompatAuthorization.create();
|
|
13
13
|
const grant = CosmwasmWasmV1Authz.ContractGrant.create();
|
|
14
14
|
grant.contract = params.contract;
|
|
15
15
|
if (params.limit) {
|
|
@@ -60,11 +60,11 @@ export default class ContractExecutionCompatAuthorization extends BaseAuthorizat
|
|
|
60
60
|
const any = GoogleProtobufAny.Any.create();
|
|
61
61
|
any.typeUrl = '/injective.wasmx.v1.ContractExecutionCompatAuthorization';
|
|
62
62
|
any.value =
|
|
63
|
-
|
|
63
|
+
InjectiveWasmxV1Authz.ContractExecutionCompatAuthorization.encode(authorization).finish();
|
|
64
64
|
return any;
|
|
65
65
|
}
|
|
66
66
|
toProto() {
|
|
67
|
-
const authorization =
|
|
67
|
+
const authorization = InjectiveWasmxV1Authz.ContractExecutionCompatAuthorization.decode(this.toAny().value);
|
|
68
68
|
return authorization;
|
|
69
69
|
}
|
|
70
70
|
toAmino() {
|
|
@@ -6,7 +6,8 @@ import MsgSubmitProposalSpotMarketLaunch from './msgs/MsgSubmitProposalSpotMarke
|
|
|
6
6
|
import MsgSubmitProposalPerpetualMarketLaunch from './msgs/MsgSubmitProposalPerpetualMarketLaunch.js';
|
|
7
7
|
import MsgSubmitProposalSpotMarketParamUpdate from './msgs/MsgSubmitProposalSpotMarketParamUpdate.js';
|
|
8
8
|
import MsgSubmitProposalExpiryFuturesMarketLaunch from './msgs/MsgSubmitProposalExpiryFuturesMarketLaunch.js';
|
|
9
|
-
|
|
10
|
-
export
|
|
9
|
+
import MsgSubmitProposalPerpetualMarketLaunchV2 from './msgs/MsgSubmitProposalPerpetualMarketLaunchV2.js';
|
|
10
|
+
export type MsgSubmitProposal = MsgSubmitTextProposal | MsgSubmitGenericProposal | MsgSubmitProposalSpotMarketLaunch | MsgSubmitProposalPerpetualMarketLaunch | MsgSubmitProposalSpotMarketParamUpdate | MsgSubmitProposalPerpetualMarketLaunchV2 | MsgSubmitProposalExpiryFuturesMarketLaunch;
|
|
11
|
+
export { MsgSubmitTextProposal, MsgSubmitGenericProposal, MsgSubmitProposalSpotMarketLaunch, MsgSubmitProposalPerpetualMarketLaunch, MsgSubmitProposalSpotMarketParamUpdate, MsgSubmitProposalPerpetualMarketLaunchV2, MsgSubmitProposalExpiryFuturesMarketLaunch, };
|
|
11
12
|
export * from './ProposalContentDecomposer.js';
|
|
12
13
|
export { MsgVote, MsgGovDeposit };
|
|
@@ -6,6 +6,7 @@ import MsgSubmitProposalSpotMarketLaunch from './msgs/MsgSubmitProposalSpotMarke
|
|
|
6
6
|
import MsgSubmitProposalPerpetualMarketLaunch from './msgs/MsgSubmitProposalPerpetualMarketLaunch.js';
|
|
7
7
|
import MsgSubmitProposalSpotMarketParamUpdate from './msgs/MsgSubmitProposalSpotMarketParamUpdate.js';
|
|
8
8
|
import MsgSubmitProposalExpiryFuturesMarketLaunch from './msgs/MsgSubmitProposalExpiryFuturesMarketLaunch.js';
|
|
9
|
-
|
|
9
|
+
import MsgSubmitProposalPerpetualMarketLaunchV2 from './msgs/MsgSubmitProposalPerpetualMarketLaunchV2.js';
|
|
10
|
+
export { MsgSubmitTextProposal, MsgSubmitGenericProposal, MsgSubmitProposalSpotMarketLaunch, MsgSubmitProposalPerpetualMarketLaunch, MsgSubmitProposalSpotMarketParamUpdate, MsgSubmitProposalPerpetualMarketLaunchV2, MsgSubmitProposalExpiryFuturesMarketLaunch, };
|
|
10
11
|
export * from './ProposalContentDecomposer.js';
|
|
11
12
|
export { MsgVote, MsgGovDeposit };
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { GoogleProtobufAny, CosmosGovV1Beta1Tx, CosmosBaseV1Beta1Coin, InjectiveOracleV1Beta1Oracle } from '@injectivelabs/core-proto-ts';
|
|
2
|
+
import { SnakeCaseKeys } from 'snakecase-keys';
|
|
3
|
+
import { MsgBase } from '../../MsgBase.js';
|
|
4
|
+
export declare namespace MsgSubmitProposalPerpetualMarketLaunchV2 {
|
|
5
|
+
interface Params {
|
|
6
|
+
market: {
|
|
7
|
+
title: string;
|
|
8
|
+
description: string;
|
|
9
|
+
ticker: string;
|
|
10
|
+
quoteDenom: string;
|
|
11
|
+
oracleBase: string;
|
|
12
|
+
oracleQuote: string;
|
|
13
|
+
oracleScaleFactor: number;
|
|
14
|
+
oracleType: InjectiveOracleV1Beta1Oracle.OracleType;
|
|
15
|
+
initialMarginRatio: string;
|
|
16
|
+
maintenanceMarginRatio: string;
|
|
17
|
+
makerFeeRate: string;
|
|
18
|
+
takerFeeRate: string;
|
|
19
|
+
minPriceTickSize: string;
|
|
20
|
+
minQuantityTickSize: string;
|
|
21
|
+
minNotional: string;
|
|
22
|
+
reduceMarginRatio: string;
|
|
23
|
+
adminInfo?: {
|
|
24
|
+
admin: string;
|
|
25
|
+
adminPermissions: number;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
proposer: string;
|
|
29
|
+
deposit: {
|
|
30
|
+
amount: string;
|
|
31
|
+
denom: string;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
type Proto = CosmosGovV1Beta1Tx.MsgSubmitProposal;
|
|
35
|
+
type Object = Omit<CosmosGovV1Beta1Tx.MsgSubmitProposal, 'content'> & {
|
|
36
|
+
content: {
|
|
37
|
+
type_url: string;
|
|
38
|
+
value: any;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* @category Messages
|
|
44
|
+
*/
|
|
45
|
+
export default class MsgSubmitProposalPerpetualMarketLaunchV2 extends MsgBase<MsgSubmitProposalPerpetualMarketLaunchV2.Params, MsgSubmitProposalPerpetualMarketLaunchV2.Proto, MsgSubmitProposalPerpetualMarketLaunchV2.Object> {
|
|
46
|
+
static fromJSON(params: MsgSubmitProposalPerpetualMarketLaunchV2.Params): MsgSubmitProposalPerpetualMarketLaunchV2;
|
|
47
|
+
toProto(): CosmosGovV1Beta1Tx.MsgSubmitProposal;
|
|
48
|
+
toData(): {
|
|
49
|
+
content: GoogleProtobufAny.Any | undefined;
|
|
50
|
+
initialDeposit: CosmosBaseV1Beta1Coin.Coin[];
|
|
51
|
+
proposer: string;
|
|
52
|
+
'@type': string;
|
|
53
|
+
};
|
|
54
|
+
toAmino(): {
|
|
55
|
+
type: string;
|
|
56
|
+
value: SnakeCaseKeys<MsgSubmitProposalPerpetualMarketLaunchV2.Object>;
|
|
57
|
+
};
|
|
58
|
+
toWeb3Gw(): {
|
|
59
|
+
initial_deposit: {
|
|
60
|
+
denom: string;
|
|
61
|
+
amount: string;
|
|
62
|
+
}[];
|
|
63
|
+
proposer: string;
|
|
64
|
+
content: {
|
|
65
|
+
type_url: string;
|
|
66
|
+
value: any;
|
|
67
|
+
};
|
|
68
|
+
'@type': string;
|
|
69
|
+
};
|
|
70
|
+
toEip712(): {
|
|
71
|
+
type: string;
|
|
72
|
+
value: SnakeCaseKeys<MsgSubmitProposalPerpetualMarketLaunchV2.Object>;
|
|
73
|
+
};
|
|
74
|
+
toEip712V2(): {
|
|
75
|
+
content: any;
|
|
76
|
+
initial_deposit: {
|
|
77
|
+
denom: string;
|
|
78
|
+
amount: string;
|
|
79
|
+
}[];
|
|
80
|
+
proposer: string;
|
|
81
|
+
'@type': string;
|
|
82
|
+
};
|
|
83
|
+
toDirectSign(): {
|
|
84
|
+
type: string;
|
|
85
|
+
message: CosmosGovV1Beta1Tx.MsgSubmitProposal;
|
|
86
|
+
};
|
|
87
|
+
toBinary(): Uint8Array;
|
|
88
|
+
}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { GoogleProtobufAny, CosmosGovV1Beta1Tx, CosmosBaseV1Beta1Coin, InjectiveExchangeV2Proposal, InjectiveOracleV1Beta1Oracle, } from '@injectivelabs/core-proto-ts';
|
|
2
|
+
import snakecaseKeys from 'snakecase-keys';
|
|
3
|
+
import { MsgBase } from '../../MsgBase.js';
|
|
4
|
+
import { amountToCosmosSdkDecAmount, numberToCosmosSdkDecString, } from '../../../../utils/numbers.js';
|
|
5
|
+
const createPerpetualMarketLaunch = (params) => {
|
|
6
|
+
const content = InjectiveExchangeV2Proposal.PerpetualMarketLaunchProposal.create();
|
|
7
|
+
content.title = params.market.title;
|
|
8
|
+
content.description = params.market.description;
|
|
9
|
+
content.ticker = params.market.ticker;
|
|
10
|
+
content.quoteDenom = params.market.quoteDenom;
|
|
11
|
+
content.oracleBase = params.market.oracleBase;
|
|
12
|
+
content.oracleQuote = params.market.oracleQuote;
|
|
13
|
+
content.oracleScaleFactor = params.market.oracleScaleFactor;
|
|
14
|
+
content.oracleType = params.market.oracleType;
|
|
15
|
+
content.initialMarginRatio = params.market.initialMarginRatio;
|
|
16
|
+
content.maintenanceMarginRatio = params.market.maintenanceMarginRatio;
|
|
17
|
+
content.makerFeeRate = params.market.makerFeeRate;
|
|
18
|
+
content.takerFeeRate = params.market.takerFeeRate;
|
|
19
|
+
content.minPriceTickSize = params.market.minPriceTickSize;
|
|
20
|
+
content.minQuantityTickSize = params.market.minQuantityTickSize;
|
|
21
|
+
content.minNotional = params.market.minNotional;
|
|
22
|
+
content.reduceMarginRatio = params.market.reduceMarginRatio;
|
|
23
|
+
if (params.market.adminInfo) {
|
|
24
|
+
const adminInfo = InjectiveExchangeV2Proposal.AdminInfo.create();
|
|
25
|
+
adminInfo.admin = params.market.adminInfo.admin;
|
|
26
|
+
adminInfo.adminPermissions = params.market.adminInfo.adminPermissions;
|
|
27
|
+
content.adminInfo = adminInfo;
|
|
28
|
+
}
|
|
29
|
+
return InjectiveExchangeV2Proposal.PerpetualMarketLaunchProposal.fromPartial(content);
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* @category Messages
|
|
33
|
+
*/
|
|
34
|
+
export default class MsgSubmitProposalPerpetualMarketLaunchV2 extends MsgBase {
|
|
35
|
+
static fromJSON(params) {
|
|
36
|
+
return new MsgSubmitProposalPerpetualMarketLaunchV2(params);
|
|
37
|
+
}
|
|
38
|
+
toProto() {
|
|
39
|
+
const { params: initialParams } = this;
|
|
40
|
+
const params = {
|
|
41
|
+
...initialParams,
|
|
42
|
+
market: {
|
|
43
|
+
...initialParams.market,
|
|
44
|
+
initialMarginRatio: amountToCosmosSdkDecAmount(initialParams.market.initialMarginRatio).toFixed(),
|
|
45
|
+
maintenanceMarginRatio: amountToCosmosSdkDecAmount(initialParams.market.maintenanceMarginRatio).toFixed(),
|
|
46
|
+
makerFeeRate: amountToCosmosSdkDecAmount(initialParams.market.makerFeeRate).toFixed(),
|
|
47
|
+
takerFeeRate: amountToCosmosSdkDecAmount(initialParams.market.takerFeeRate).toFixed(),
|
|
48
|
+
minQuantityTickSize: amountToCosmosSdkDecAmount(initialParams.market.minQuantityTickSize).toFixed(),
|
|
49
|
+
minNotional: amountToCosmosSdkDecAmount(initialParams.market.minNotional).toFixed(),
|
|
50
|
+
reduceMarginRatio: amountToCosmosSdkDecAmount(initialParams.market.reduceMarginRatio).toFixed(),
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
const depositParams = CosmosBaseV1Beta1Coin.Coin.create();
|
|
54
|
+
depositParams.denom = params.deposit.denom;
|
|
55
|
+
depositParams.amount = params.deposit.amount;
|
|
56
|
+
const contentAny = GoogleProtobufAny.Any.create();
|
|
57
|
+
contentAny.typeUrl =
|
|
58
|
+
'/injective.exchange.v1beta1.PerpetualMarketLaunchProposal';
|
|
59
|
+
contentAny.value =
|
|
60
|
+
InjectiveExchangeV2Proposal.PerpetualMarketLaunchProposal.encode(createPerpetualMarketLaunch(params)).finish();
|
|
61
|
+
const message = CosmosGovV1Beta1Tx.MsgSubmitProposal.create();
|
|
62
|
+
message.content = contentAny;
|
|
63
|
+
message.initialDeposit = [depositParams];
|
|
64
|
+
message.proposer = params.proposer;
|
|
65
|
+
return CosmosGovV1Beta1Tx.MsgSubmitProposal.fromPartial(message);
|
|
66
|
+
}
|
|
67
|
+
toData() {
|
|
68
|
+
const proto = this.toProto();
|
|
69
|
+
return {
|
|
70
|
+
'@type': '/cosmos.gov.v1beta1.MsgSubmitProposal',
|
|
71
|
+
...proto,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
toAmino() {
|
|
75
|
+
const { params } = this;
|
|
76
|
+
const content = createPerpetualMarketLaunch(params);
|
|
77
|
+
const messageWithProposalType = snakecaseKeys({
|
|
78
|
+
content: {
|
|
79
|
+
type: 'exchange/PerpetualMarketLaunchProposal',
|
|
80
|
+
value: content,
|
|
81
|
+
},
|
|
82
|
+
initial_deposit: [
|
|
83
|
+
{
|
|
84
|
+
denom: params.deposit.denom,
|
|
85
|
+
amount: params.deposit.amount,
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
proposer: params.proposer,
|
|
89
|
+
});
|
|
90
|
+
return {
|
|
91
|
+
type: 'cosmos-sdk/MsgSubmitProposal',
|
|
92
|
+
value: messageWithProposalType,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
toWeb3Gw() {
|
|
96
|
+
const amino = this.toAmino();
|
|
97
|
+
const { value } = amino;
|
|
98
|
+
const messageWithProposalType = {
|
|
99
|
+
...value,
|
|
100
|
+
content: {
|
|
101
|
+
'@type': '/injective.exchange.v1beta1.PerpetualMarketLaunchProposal',
|
|
102
|
+
...value.content.value,
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
return {
|
|
106
|
+
'@type': '/cosmos.gov.v1beta1.MsgSubmitProposal',
|
|
107
|
+
...messageWithProposalType,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
toEip712() {
|
|
111
|
+
const { params } = this;
|
|
112
|
+
const amino = this.toAmino();
|
|
113
|
+
const { value, type } = amino;
|
|
114
|
+
const messageAdjusted = {
|
|
115
|
+
...value,
|
|
116
|
+
content: {
|
|
117
|
+
type: 'exchange/PerpetualMarketLaunchProposal',
|
|
118
|
+
value: {
|
|
119
|
+
...value.content.value,
|
|
120
|
+
initial_margin_ratio: amountToCosmosSdkDecAmount(params.market.initialMarginRatio).toFixed(),
|
|
121
|
+
maintenance_margin_ratio: amountToCosmosSdkDecAmount(params.market.maintenanceMarginRatio).toFixed(),
|
|
122
|
+
maker_fee_rate: amountToCosmosSdkDecAmount(params.market.makerFeeRate).toFixed(),
|
|
123
|
+
taker_fee_rate: amountToCosmosSdkDecAmount(params.market.takerFeeRate).toFixed(),
|
|
124
|
+
min_price_tick_size: amountToCosmosSdkDecAmount(params.market.minPriceTickSize).toFixed(),
|
|
125
|
+
min_notional: amountToCosmosSdkDecAmount(params.market.minNotional).toFixed(),
|
|
126
|
+
min_quantity_tick_size: amountToCosmosSdkDecAmount(params.market.minQuantityTickSize).toFixed(),
|
|
127
|
+
reduce_margin_ratio: amountToCosmosSdkDecAmount(params.market.reduceMarginRatio).toFixed(),
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
};
|
|
131
|
+
return {
|
|
132
|
+
type,
|
|
133
|
+
value: messageAdjusted,
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
toEip712V2() {
|
|
137
|
+
const { params } = this;
|
|
138
|
+
const web3gw = this.toWeb3Gw();
|
|
139
|
+
const content = web3gw.content;
|
|
140
|
+
const messageAdjusted = {
|
|
141
|
+
...web3gw,
|
|
142
|
+
content: {
|
|
143
|
+
...content,
|
|
144
|
+
oracle_type: InjectiveOracleV1Beta1Oracle.oracleTypeToJSON(content.oracle_type),
|
|
145
|
+
initial_margin_ratio: numberToCosmosSdkDecString(params.market.initialMarginRatio),
|
|
146
|
+
maintenance_margin_ratio: numberToCosmosSdkDecString(params.market.maintenanceMarginRatio),
|
|
147
|
+
maker_fee_rate: numberToCosmosSdkDecString(params.market.makerFeeRate),
|
|
148
|
+
taker_fee_rate: numberToCosmosSdkDecString(params.market.takerFeeRate),
|
|
149
|
+
min_price_tick_size: numberToCosmosSdkDecString(params.market.minPriceTickSize),
|
|
150
|
+
min_notional: numberToCosmosSdkDecString(params.market.minNotional),
|
|
151
|
+
min_quantity_tick_size: numberToCosmosSdkDecString(params.market.minQuantityTickSize),
|
|
152
|
+
admin_info: content.admin_info || null,
|
|
153
|
+
reduce_margin_ratio: numberToCosmosSdkDecString(params.market.reduceMarginRatio),
|
|
154
|
+
},
|
|
155
|
+
};
|
|
156
|
+
return messageAdjusted;
|
|
157
|
+
}
|
|
158
|
+
toDirectSign() {
|
|
159
|
+
const proto = this.toProto();
|
|
160
|
+
return {
|
|
161
|
+
type: '/cosmos.gov.v1beta1.MsgSubmitProposal',
|
|
162
|
+
message: proto,
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
toBinary() {
|
|
166
|
+
return CosmosGovV1Beta1Tx.MsgSubmitProposal.encode(this.toProto()).finish();
|
|
167
|
+
}
|
|
168
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MsgBase } from '../../MsgBase.js';
|
|
2
|
-
import {
|
|
2
|
+
import { InjectivePeggyV1Msgs, CosmosBaseV1Beta1Coin } from '@injectivelabs/core-proto-ts';
|
|
3
3
|
export declare namespace MsgSendToEth {
|
|
4
4
|
interface Params {
|
|
5
5
|
amount: {
|
|
@@ -13,14 +13,14 @@ export declare namespace MsgSendToEth {
|
|
|
13
13
|
address: string;
|
|
14
14
|
injectiveAddress: string;
|
|
15
15
|
}
|
|
16
|
-
type Proto =
|
|
16
|
+
type Proto = InjectivePeggyV1Msgs.MsgSendToEth;
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
19
|
* @category Messages
|
|
20
20
|
*/
|
|
21
21
|
export default class MsgSendToEth extends MsgBase<MsgSendToEth.Params, MsgSendToEth.Proto> {
|
|
22
22
|
static fromJSON(params: MsgSendToEth.Params): MsgSendToEth;
|
|
23
|
-
toProto():
|
|
23
|
+
toProto(): InjectivePeggyV1Msgs.MsgSendToEth;
|
|
24
24
|
toData(): {
|
|
25
25
|
sender: string;
|
|
26
26
|
ethDest: string;
|
|
@@ -46,7 +46,7 @@ export default class MsgSendToEth extends MsgBase<MsgSendToEth.Params, MsgSendTo
|
|
|
46
46
|
};
|
|
47
47
|
toDirectSign(): {
|
|
48
48
|
type: string;
|
|
49
|
-
message:
|
|
49
|
+
message: InjectivePeggyV1Msgs.MsgSendToEth;
|
|
50
50
|
};
|
|
51
51
|
toBinary(): Uint8Array;
|
|
52
52
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MsgBase } from '../../MsgBase.js';
|
|
2
2
|
import { DEFAULT_BRIDGE_FEE_AMOUNT, DEFAULT_BRIDGE_FEE_DENOM, } from '@injectivelabs/utils';
|
|
3
3
|
import snakecaseKeys from 'snakecase-keys';
|
|
4
|
-
import {
|
|
4
|
+
import { InjectivePeggyV1Msgs, CosmosBaseV1Beta1Coin, } from '@injectivelabs/core-proto-ts';
|
|
5
5
|
/**
|
|
6
6
|
* @category Messages
|
|
7
7
|
*/
|
|
@@ -21,12 +21,12 @@ export default class MsgSendToEth extends MsgBase {
|
|
|
21
21
|
bridgeFee.amount = params.bridgeFee
|
|
22
22
|
? params.bridgeFee.amount
|
|
23
23
|
: DEFAULT_BRIDGE_FEE_AMOUNT;
|
|
24
|
-
const message =
|
|
24
|
+
const message = InjectivePeggyV1Msgs.MsgSendToEth.create();
|
|
25
25
|
message.sender = params.injectiveAddress;
|
|
26
26
|
message.ethDest = params.address;
|
|
27
27
|
message.amount = coinAmount;
|
|
28
28
|
message.bridgeFee = bridgeFee;
|
|
29
|
-
return
|
|
29
|
+
return InjectivePeggyV1Msgs.MsgSendToEth.fromPartial(message);
|
|
30
30
|
}
|
|
31
31
|
toData() {
|
|
32
32
|
const proto = this.toProto();
|
|
@@ -61,6 +61,6 @@ export default class MsgSendToEth extends MsgBase {
|
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
63
|
toBinary() {
|
|
64
|
-
return
|
|
64
|
+
return InjectivePeggyV1Msgs.MsgSendToEth.encode(this.toProto()).finish();
|
|
65
65
|
}
|
|
66
66
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ExecArgs } from '../exec-args.js';
|
|
2
2
|
import { MsgBase } from '../../MsgBase.js';
|
|
3
|
-
import {
|
|
3
|
+
import { InjectiveWasmxV1Tx } from '@injectivelabs/core-proto-ts';
|
|
4
4
|
export declare namespace MsgExecuteContractCompat {
|
|
5
5
|
interface Params {
|
|
6
6
|
funds?: {
|
|
@@ -30,8 +30,8 @@ export declare namespace MsgExecuteContractCompat {
|
|
|
30
30
|
*/
|
|
31
31
|
msg?: Record<string, any>;
|
|
32
32
|
}
|
|
33
|
-
type Proto =
|
|
34
|
-
type Object = Omit<
|
|
33
|
+
type Proto = InjectiveWasmxV1Tx.MsgExecuteContractCompat;
|
|
34
|
+
type Object = Omit<InjectiveWasmxV1Tx.MsgExecuteContractCompat, 'msg'> & {
|
|
35
35
|
msg: string;
|
|
36
36
|
};
|
|
37
37
|
}
|
|
@@ -40,7 +40,7 @@ export declare namespace MsgExecuteContractCompat {
|
|
|
40
40
|
*/
|
|
41
41
|
export default class MsgExecuteContractCompat extends MsgBase<MsgExecuteContractCompat.Params, MsgExecuteContractCompat.Proto, MsgExecuteContractCompat.Object> {
|
|
42
42
|
static fromJSON(params: MsgExecuteContractCompat.Params): MsgExecuteContractCompat;
|
|
43
|
-
toProto():
|
|
43
|
+
toProto(): InjectiveWasmxV1Tx.MsgExecuteContractCompat;
|
|
44
44
|
toData(): {
|
|
45
45
|
sender: string;
|
|
46
46
|
contract: string;
|
|
@@ -66,7 +66,7 @@ export default class MsgExecuteContractCompat extends MsgBase<MsgExecuteContract
|
|
|
66
66
|
};
|
|
67
67
|
toDirectSign(): {
|
|
68
68
|
type: string;
|
|
69
|
-
message:
|
|
69
|
+
message: InjectiveWasmxV1Tx.MsgExecuteContractCompat;
|
|
70
70
|
};
|
|
71
71
|
toBinary(): Uint8Array;
|
|
72
72
|
private getMsgObject;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import snakecaseKeys from 'snakecase-keys';
|
|
2
2
|
import { MsgBase } from '../../MsgBase.js';
|
|
3
3
|
import { GeneralException } from '@injectivelabs/exceptions';
|
|
4
|
-
import {
|
|
4
|
+
import { InjectiveWasmxV1Tx } from '@injectivelabs/core-proto-ts';
|
|
5
5
|
/**
|
|
6
6
|
* @category Messages
|
|
7
7
|
*/
|
|
@@ -11,7 +11,7 @@ export default class MsgExecuteContractCompat extends MsgBase {
|
|
|
11
11
|
}
|
|
12
12
|
toProto() {
|
|
13
13
|
const { params } = this;
|
|
14
|
-
const message =
|
|
14
|
+
const message = InjectiveWasmxV1Tx.MsgExecuteContractCompat.create();
|
|
15
15
|
const msg = this.getMsgObject();
|
|
16
16
|
message.sender = params.sender;
|
|
17
17
|
message.contract = params.contractAddress;
|
|
@@ -28,7 +28,7 @@ export default class MsgExecuteContractCompat extends MsgBase {
|
|
|
28
28
|
else {
|
|
29
29
|
message.funds = '0';
|
|
30
30
|
}
|
|
31
|
-
return
|
|
31
|
+
return InjectiveWasmxV1Tx.MsgExecuteContractCompat.fromPartial(message);
|
|
32
32
|
}
|
|
33
33
|
toData() {
|
|
34
34
|
const proto = this.toProto();
|
|
@@ -66,7 +66,7 @@ export default class MsgExecuteContractCompat extends MsgBase {
|
|
|
66
66
|
};
|
|
67
67
|
}
|
|
68
68
|
toBinary() {
|
|
69
|
-
return
|
|
69
|
+
return InjectiveWasmxV1Tx.MsgExecuteContractCompat.encode(this.toProto()).finish();
|
|
70
70
|
}
|
|
71
71
|
getMsgObject() {
|
|
72
72
|
const { params } = this;
|
|
@@ -15,8 +15,8 @@ export declare class TxGrpcApi implements TxConcreteApi {
|
|
|
15
15
|
result: {
|
|
16
16
|
data: string | Uint8Array<ArrayBufferLike>;
|
|
17
17
|
log: string;
|
|
18
|
-
eventsList: import("@injectivelabs/core-proto-ts/cjs/
|
|
19
|
-
events?: import("@injectivelabs/core-proto-ts/cjs/
|
|
18
|
+
eventsList: import("@injectivelabs/core-proto-ts/cjs/cometbft/abci/v1/types.js").Event[];
|
|
19
|
+
events?: import("@injectivelabs/core-proto-ts/cjs/cometbft/abci/v1/types.js").Event[] | undefined;
|
|
20
20
|
msgResponses?: import("@injectivelabs/core-proto-ts/cjs/google/protobuf/any.js").Any[] | undefined;
|
|
21
21
|
};
|
|
22
22
|
gasInfo: {
|
|
@@ -77,8 +77,8 @@ export declare class MsgBroadcasterWithPk {
|
|
|
77
77
|
result: {
|
|
78
78
|
data: string | Uint8Array<ArrayBufferLike>;
|
|
79
79
|
log: string;
|
|
80
|
-
eventsList: import("@injectivelabs/core-proto-ts/cjs/
|
|
81
|
-
events?: import("@injectivelabs/core-proto-ts/cjs/
|
|
80
|
+
eventsList: import("@injectivelabs/core-proto-ts/cjs/cometbft/abci/v1/types.js").Event[];
|
|
81
|
+
events?: import("@injectivelabs/core-proto-ts/cjs/cometbft/abci/v1/types.js").Event[] | undefined;
|
|
82
82
|
msgResponses?: import("@injectivelabs/core-proto-ts/cjs/google/protobuf/any.js").Any[] | undefined;
|
|
83
83
|
};
|
|
84
84
|
gasInfo: {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@injectivelabs/sdk-ts",
|
|
3
3
|
"description": "SDK in TypeScript for building Injective applications in a browser, node, and react native environment.",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.16.1-alpha.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"author": {
|
|
@@ -122,17 +122,17 @@
|
|
|
122
122
|
"@cosmjs/proto-signing": "^0.33.0",
|
|
123
123
|
"@cosmjs/stargate": "^0.33.0",
|
|
124
124
|
"@injectivelabs/abacus-proto-ts": "1.14.0",
|
|
125
|
-
"@injectivelabs/core-proto-ts": "1.
|
|
126
|
-
"@injectivelabs/exceptions": "^1.
|
|
125
|
+
"@injectivelabs/core-proto-ts": "1.16.0",
|
|
126
|
+
"@injectivelabs/exceptions": "^1.16.1-alpha.0",
|
|
127
127
|
"@injectivelabs/grpc-web": "^0.0.1",
|
|
128
128
|
"@injectivelabs/grpc-web-node-http-transport": "^0.0.2",
|
|
129
129
|
"@injectivelabs/grpc-web-react-native-transport": "^0.0.2",
|
|
130
130
|
"@injectivelabs/indexer-proto-ts": "1.13.14",
|
|
131
131
|
"@injectivelabs/mito-proto-ts": "1.13.2",
|
|
132
|
-
"@injectivelabs/networks": "^1.
|
|
132
|
+
"@injectivelabs/networks": "^1.16.1-alpha.0",
|
|
133
133
|
"@injectivelabs/olp-proto-ts": "1.13.4",
|
|
134
|
-
"@injectivelabs/ts-types": "^1.
|
|
135
|
-
"@injectivelabs/utils": "^1.
|
|
134
|
+
"@injectivelabs/ts-types": "^1.16.1-alpha.0",
|
|
135
|
+
"@injectivelabs/utils": "^1.16.1-alpha.0",
|
|
136
136
|
"@metamask/eth-sig-util": "^8.2.0",
|
|
137
137
|
"@noble/curves": "^1.8.1",
|
|
138
138
|
"@noble/hashes": "^1.7.1",
|
|
@@ -151,7 +151,7 @@
|
|
|
151
151
|
"shx": "^0.3.4",
|
|
152
152
|
"snakecase-keys": "^5.4.1"
|
|
153
153
|
},
|
|
154
|
-
"gitHead": "
|
|
154
|
+
"gitHead": "d1057b0601f494f41172b8a4e8440da25ffc3d28",
|
|
155
155
|
"typedoc": {
|
|
156
156
|
"entryPoint": "./src/index.ts",
|
|
157
157
|
"readmeFile": "./README.md",
|