@injectivelabs/sdk-ts 1.16.13-alpha.0 → 1.16.13-alpha.1
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/base/BaseGrpcWebConsumer.js +1 -1
- package/dist/cjs/client/chain/transformers/ChainGrpcInsuranceFundTransformer.d.ts +1 -1
- package/dist/cjs/client/indexer/transformers/IndexerGrpcExplorerTransformer.js +3 -3
- package/dist/cjs/client/indexer/transformers/IndexerGrpcReferralTransformer.js +2 -2
- package/dist/cjs/client/indexer/transformers/IndexerRestExplorerTransformer.js +3 -3
- package/dist/cjs/client/indexer/types/account.d.ts +1 -1
- package/dist/cjs/client/indexer/types/explorer.d.ts +6 -6
- package/dist/cjs/client/indexer/types/referral.d.ts +3 -3
- package/dist/cjs/client/indexer/types/trading.d.ts +1 -1
- package/dist/cjs/client/wasm/neptune/queries/QueryLendingRates.js +6 -2
- package/dist/cjs/client/wasm/neptune/service.js +1 -1
- package/dist/cjs/core/accounts/PrivateKey.js +1 -1
- package/dist/cjs/core/modules/authz/types.d.ts +1 -1
- package/dist/cjs/core/modules/feegrant/utils/allowance.d.ts +1 -1
- package/dist/cjs/core/modules/wasm/types.d.ts +2 -2
- package/dist/cjs/core/stargate/SigningStargateClient.js +1 -1
- package/dist/cjs/core/tx/api/TxGrpcApi.js +1 -1
- package/dist/cjs/core/tx/api/TxRestApi.js +2 -2
- package/dist/cjs/core/tx/api/utils.js +1 -1
- package/dist/cjs/core/tx/broadcaster/MsgBroadcasterWithPk.js +4 -6
- package/dist/cjs/core/tx/eip712/utils.js +2 -2
- package/dist/cjs/core/tx/tx.js +1 -1
- package/dist/cjs/core/tx/types/tx-rest-client.d.ts +2 -2
- package/dist/cjs/core/tx/types/tx.d.ts +1 -1
- package/dist/cjs/json/ofac.js +46 -46
- package/dist/cjs/types/cosmos.d.ts +1 -1
- package/dist/cjs/types/exchange.d.ts +3 -3
- package/dist/cjs/types/token.d.ts +3 -3
- package/dist/cjs/utils/msgs.js +8 -12
- package/dist/esm/client/base/BaseGrpcWebConsumer.js +1 -1
- package/dist/esm/client/chain/transformers/ChainGrpcInsuranceFundTransformer.d.ts +1 -1
- package/dist/esm/client/chain/types/insurance.js +1 -1
- package/dist/esm/client/chain/types/wasm.js +1 -1
- package/dist/esm/client/indexer/transformers/IndexerGrpcExplorerTransformer.js +4 -4
- package/dist/esm/client/indexer/transformers/IndexerGrpcReferralTransformer.js +3 -3
- package/dist/esm/client/indexer/transformers/IndexerRestExplorerTransformer.js +4 -4
- package/dist/esm/client/indexer/types/account.d.ts +1 -1
- package/dist/esm/client/indexer/types/explorer.d.ts +6 -6
- package/dist/esm/client/indexer/types/referral.d.ts +3 -3
- package/dist/esm/client/indexer/types/trading.d.ts +1 -1
- package/dist/esm/client/wasm/neptune/queries/QueryLendingRates.js +6 -2
- package/dist/esm/client/wasm/neptune/service.js +1 -1
- package/dist/esm/core/accounts/PrivateKey.js +1 -1
- package/dist/esm/core/modules/authz/msgs/authorizations/GenericAuthorization.js +1 -1
- package/dist/esm/core/modules/authz/types.d.ts +1 -1
- package/dist/esm/core/modules/exchange/msgs/MsgAdminUpdateBinaryOptionsMarket.js +1 -1
- package/dist/esm/core/modules/exchange/msgs/MsgCreateBinaryOptionsLimitOrder.js +1 -1
- package/dist/esm/core/modules/exchange/msgs/MsgCreateDerivativeLimitOrder.js +1 -1
- package/dist/esm/core/modules/exchange/msgs/MsgCreateSpotLimitOrder.js +1 -1
- package/dist/esm/core/modules/exchange/msgs/MsgIncreasePositionMargin.js +1 -1
- package/dist/esm/core/modules/exchange/msgs/MsgInstantBinaryOptionsMarketLaunch.js +1 -1
- package/dist/esm/core/modules/exchange/msgs/MsgInstantSpotMarketLaunch.js +1 -1
- package/dist/esm/core/modules/exchange/msgs/MsgLiquidatePosition.js +1 -1
- package/dist/esm/core/modules/feegrant/utils/allowance.d.ts +1 -1
- package/dist/esm/core/modules/gov/msgs/MsgSubmitProposalExpiryFuturesMarketLaunch.js +1 -1
- package/dist/esm/core/modules/gov/msgs/MsgSubmitProposalPerpetualMarketLaunch.js +1 -1
- package/dist/esm/core/modules/gov/msgs/MsgSubmitProposalPerpetualMarketLaunchV2.js +1 -1
- package/dist/esm/core/modules/gov/msgs/MsgSubmitProposalSpotMarketLaunch.js +1 -1
- package/dist/esm/core/modules/gov/msgs/MsgSubmitProposalSpotMarketParamUpdate.js +1 -1
- package/dist/esm/core/modules/staking/msgs/MsgEditValidator.js +1 -1
- package/dist/esm/core/modules/wasm/exec-priv-args/ExecPrivilegedArgOffChainVaultRedeem.js +1 -1
- package/dist/esm/core/modules/wasm/exec-priv-args/ExecPrivilegedArgOffChainVaultSubscribe.js +1 -1
- package/dist/esm/core/modules/wasm/exec-priv-args/ExecPrivilegedArgVaultRedeem.js +1 -1
- package/dist/esm/core/modules/wasm/exec-priv-args/ExecPrivilegedArgVaultSubscribe.js +1 -1
- package/dist/esm/core/modules/wasm/types.d.ts +2 -2
- package/dist/esm/core/stargate/SigningStargateClient.js +2 -2
- package/dist/esm/core/tx/api/TxGrpcApi.js +2 -2
- package/dist/esm/core/tx/api/TxRestApi.js +3 -3
- package/dist/esm/core/tx/api/utils.js +2 -2
- package/dist/esm/core/tx/broadcaster/MsgBroadcasterWithPk.js +6 -8
- package/dist/esm/core/tx/eip712/MsgDecoder.js +2 -2
- package/dist/esm/core/tx/eip712/utils.js +3 -3
- package/dist/esm/core/tx/tx.js +2 -2
- package/dist/esm/core/tx/types/tx-rest-client.d.ts +2 -2
- package/dist/esm/core/tx/types/tx.d.ts +1 -1
- package/dist/esm/core/tx/utils/helpers.js +1 -1
- package/dist/esm/core/tx/utils/tx.js +1 -1
- package/dist/esm/json/ofac.js +46 -46
- package/dist/esm/service/TokenFactoryStatic.js +1 -1
- package/dist/esm/service/TokenStaticFactory.js +1 -1
- package/dist/esm/types/cosmos.d.ts +1 -1
- package/dist/esm/types/exchange.d.ts +3 -3
- package/dist/esm/types/token.d.ts +3 -3
- package/dist/esm/utils/msgs.js +9 -13
- package/package.json +6 -6
|
@@ -10,7 +10,7 @@ class BaseGrpcWebConsumer extends GrpcWebImpl_js_1.GrpcWebImpl {
|
|
|
10
10
|
constructor(endpoint) {
|
|
11
11
|
super(endpoint, {
|
|
12
12
|
transport: (0, grpc_js_1.getGrpcTransport)(),
|
|
13
|
-
setCookieMetadata: true
|
|
13
|
+
setCookieMetadata: true,
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
16
|
static getGrpcWebImpl = (endpoint) => new BaseGrpcWebConsumer(endpoint);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { GrpcInsuranceFund } from '../types/insurance.js';
|
|
2
|
-
import type { InsuranceFund, InsuranceModuleParams } from '../types/insurance.js';
|
|
3
2
|
import type { InjectiveInsuranceV1Beta1Query } from '@injectivelabs/core-proto-ts';
|
|
3
|
+
import type { InsuranceFund, InsuranceModuleParams } from '../types/insurance.js';
|
|
4
4
|
/**
|
|
5
5
|
* @category Chain Grpc Transformer
|
|
6
6
|
*/
|
|
@@ -4,7 +4,7 @@ exports.IndexerGrpcExplorerTransformer = void 0;
|
|
|
4
4
|
const utils_1 = require("@injectivelabs/utils");
|
|
5
5
|
const helpers_js_1 = require("../../../utils/helpers.js");
|
|
6
6
|
const index_js_1 = require("../../../utils/index.js");
|
|
7
|
-
const ZERO_IN_BASE =
|
|
7
|
+
const ZERO_IN_BASE = (0, utils_1.toBigNumber)(0);
|
|
8
8
|
const getContractTransactionV2Amount = (ApiTransaction) => {
|
|
9
9
|
const messages = JSON.parse(Buffer.from(ApiTransaction.messages).toString('utf8'));
|
|
10
10
|
const { type, value } = messages[0];
|
|
@@ -19,7 +19,7 @@ const getContractTransactionV2Amount = (ApiTransaction) => {
|
|
|
19
19
|
if (!msgObj.transfer) {
|
|
20
20
|
return ZERO_IN_BASE;
|
|
21
21
|
}
|
|
22
|
-
return
|
|
22
|
+
return (0, utils_1.toHumanReadable)(msgObj.transfer.amount);
|
|
23
23
|
};
|
|
24
24
|
const parseStringToObjectLikeNoThrow = (object, defaultValue = []) => {
|
|
25
25
|
if (!object) {
|
|
@@ -462,7 +462,7 @@ class IndexerGrpcExplorerTransformer {
|
|
|
462
462
|
amount: getContractTransactionV2Amount(tx),
|
|
463
463
|
logs: JSON.parse(Buffer.from(tx.logs).toString('utf8')),
|
|
464
464
|
data: '/' + Buffer.from(tx.data).toString('utf8').split('/').pop(),
|
|
465
|
-
fee:
|
|
465
|
+
fee: (0, utils_1.toHumanReadable)(tx.gasFee?.amount[0]?.amount || '0'),
|
|
466
466
|
signatures: tx.signatures.map((signature) => ({
|
|
467
467
|
address: signature.address,
|
|
468
468
|
pubkey: signature.pubkey,
|
|
@@ -8,8 +8,8 @@ class IndexerGrpcReferralTransformer {
|
|
|
8
8
|
referrerAddress: address,
|
|
9
9
|
invitees: response.invitees,
|
|
10
10
|
referrerCode: response.referrerCode,
|
|
11
|
-
totalCommission:
|
|
12
|
-
totalTradingVolume:
|
|
11
|
+
totalCommission: (0, utils_1.toBigNumber)(response.totalCommission),
|
|
12
|
+
totalTradingVolume: (0, utils_1.toBigNumber)(response.totalTradingVolume),
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
15
|
static inviteeDetailsResponseToInviteeDetails(response) {
|
|
@@ -4,7 +4,7 @@ exports.IndexerRestExplorerTransformer = void 0;
|
|
|
4
4
|
const utils_1 = require("@injectivelabs/utils");
|
|
5
5
|
const helpers_js_1 = require("../../../utils/helpers.js");
|
|
6
6
|
const token_js_1 = require("../../../types/token.js");
|
|
7
|
-
const ZERO_IN_BASE =
|
|
7
|
+
const ZERO_IN_BASE = (0, utils_1.toBigNumber)(0);
|
|
8
8
|
const getContractTransactionAmount = (ApiTransaction) => {
|
|
9
9
|
const { type, value: { msg }, } = ApiTransaction.messages[0];
|
|
10
10
|
if (!type.includes('MsgExecuteContract')) {
|
|
@@ -17,7 +17,7 @@ const getContractTransactionAmount = (ApiTransaction) => {
|
|
|
17
17
|
if (!msgObj.transfer) {
|
|
18
18
|
return ZERO_IN_BASE;
|
|
19
19
|
}
|
|
20
|
-
return
|
|
20
|
+
return (0, utils_1.toHumanReadable)(msgObj.transfer.amount);
|
|
21
21
|
};
|
|
22
22
|
const parseCW20Message = (jsonObject) => {
|
|
23
23
|
if (!jsonObject) {
|
|
@@ -168,7 +168,7 @@ class IndexerRestExplorerTransformer {
|
|
|
168
168
|
message: message.value,
|
|
169
169
|
})),
|
|
170
170
|
fee: transaction.gas_fee.amount
|
|
171
|
-
?
|
|
171
|
+
? (0, utils_1.toHumanReadable)(transaction.gas_fee.amount[0].amount)
|
|
172
172
|
: ZERO_IN_BASE,
|
|
173
173
|
amount: getContractTransactionAmount(transaction),
|
|
174
174
|
};
|
|
@@ -6,7 +6,7 @@ export declare const TransferType: {
|
|
|
6
6
|
readonly Withdraw: "withdraw";
|
|
7
7
|
readonly Deposit: "deposit";
|
|
8
8
|
};
|
|
9
|
-
export type TransferType = typeof TransferType[keyof typeof TransferType];
|
|
9
|
+
export type TransferType = (typeof TransferType)[keyof typeof TransferType];
|
|
10
10
|
export interface SubaccountTransfer {
|
|
11
11
|
transferType: TransferType;
|
|
12
12
|
srcSubaccountId: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Coin } from '@injectivelabs/ts-types';
|
|
2
|
+
import type { BigNumber } from '@injectivelabs/utils';
|
|
2
3
|
import type { TokenStatic } from '../../../types/token.js';
|
|
3
|
-
import type { BigNumberInBase } from '@injectivelabs/utils';
|
|
4
4
|
import type { InjectiveExplorerRpc } from '@injectivelabs/indexer-proto-ts';
|
|
5
5
|
export declare const AccessTypeCode: {
|
|
6
6
|
readonly AccessTypeUnspecified: 0;
|
|
@@ -9,7 +9,7 @@ export declare const AccessTypeCode: {
|
|
|
9
9
|
readonly AccessTypeEverybody: 3;
|
|
10
10
|
readonly AccessTypeAnyOfAddresses: 4;
|
|
11
11
|
};
|
|
12
|
-
export type AccessTypeCode = typeof AccessTypeCode[keyof typeof AccessTypeCode];
|
|
12
|
+
export type AccessTypeCode = (typeof AccessTypeCode)[keyof typeof AccessTypeCode];
|
|
13
13
|
export declare const AccessType: {
|
|
14
14
|
readonly AccessTypeUnspecified: "Unspecified";
|
|
15
15
|
readonly AccessTypeNobody: "Nobody";
|
|
@@ -17,13 +17,13 @@ export declare const AccessType: {
|
|
|
17
17
|
readonly AccessTypeEverybody: "Everybody";
|
|
18
18
|
readonly AccessTypeAnyOfAddresses: "Any of Addresses";
|
|
19
19
|
};
|
|
20
|
-
export type AccessType = typeof AccessType[keyof typeof AccessType];
|
|
20
|
+
export type AccessType = (typeof AccessType)[keyof typeof AccessType];
|
|
21
21
|
export declare const ValidatorUptimeStatus: {
|
|
22
22
|
readonly Proposed: "proposed";
|
|
23
23
|
readonly Signed: "signed";
|
|
24
24
|
readonly Missed: "missed";
|
|
25
25
|
};
|
|
26
|
-
export type ValidatorUptimeStatus = typeof ValidatorUptimeStatus[keyof typeof ValidatorUptimeStatus];
|
|
26
|
+
export type ValidatorUptimeStatus = (typeof ValidatorUptimeStatus)[keyof typeof ValidatorUptimeStatus];
|
|
27
27
|
export interface Paging {
|
|
28
28
|
from: number;
|
|
29
29
|
to: number;
|
|
@@ -312,8 +312,8 @@ export interface ContractTransaction {
|
|
|
312
312
|
type: string;
|
|
313
313
|
code: number;
|
|
314
314
|
messages: Message[];
|
|
315
|
-
amount:
|
|
316
|
-
fee:
|
|
315
|
+
amount: BigNumber;
|
|
316
|
+
fee: BigNumber;
|
|
317
317
|
height: number;
|
|
318
318
|
time: number;
|
|
319
319
|
data: string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { BigNumber } from '@injectivelabs/utils';
|
|
2
2
|
import type { InjectiveReferralRpc } from '@injectivelabs/indexer-proto-ts';
|
|
3
3
|
export interface ReferralDetails {
|
|
4
4
|
referrerCode: string;
|
|
5
5
|
referrerAddress: string;
|
|
6
|
-
totalCommission:
|
|
7
|
-
totalTradingVolume:
|
|
6
|
+
totalCommission: BigNumber;
|
|
7
|
+
totalTradingVolume: BigNumber;
|
|
8
8
|
invitees: InjectiveReferralRpc.ReferralInvitee[];
|
|
9
9
|
}
|
|
@@ -5,7 +5,7 @@ export declare const MarketType: {
|
|
|
5
5
|
readonly Spot: "spot";
|
|
6
6
|
readonly Derivative: "derivative";
|
|
7
7
|
};
|
|
8
|
-
export type MarketType = typeof MarketType[keyof typeof MarketType];
|
|
8
|
+
export type MarketType = (typeof MarketType)[keyof typeof MarketType];
|
|
9
9
|
export type GridStrategyType = 'geometric' | 'arithmetic' | 'perpetual';
|
|
10
10
|
export declare const GridStrategyType: {
|
|
11
11
|
readonly Geometric: "geometric";
|
|
@@ -7,8 +7,12 @@ class QueryGetAllLendingRates extends BaseWasmQuery_js_1.BaseWasmQuery {
|
|
|
7
7
|
toPayload() {
|
|
8
8
|
const payload = {
|
|
9
9
|
get_all_lending_rates: {
|
|
10
|
-
...(this.params.limit !== undefined
|
|
11
|
-
|
|
10
|
+
...(this.params.limit !== undefined
|
|
11
|
+
? { limit: this.params.limit }
|
|
12
|
+
: {}),
|
|
13
|
+
...(this.params.startAfter
|
|
14
|
+
? { start_after: this.params.startAfter }
|
|
15
|
+
: {}),
|
|
12
16
|
},
|
|
13
17
|
};
|
|
14
18
|
return (0, index_js_1.toBase64)(payload);
|
|
@@ -9,8 +9,8 @@ const networks_1 = require("@injectivelabs/networks");
|
|
|
9
9
|
const helper_js_1 = require("./helper.js");
|
|
10
10
|
const index_js_1 = require("./index.js");
|
|
11
11
|
const index_js_2 = require("../../chain/index.js");
|
|
12
|
-
const transformer_js_1 = require("./transformer.js");
|
|
13
12
|
const types_js_1 = require("./types.js");
|
|
13
|
+
const transformer_js_1 = require("./transformer.js");
|
|
14
14
|
const index_js_3 = require("./queries/index.js");
|
|
15
15
|
const ExecArgNeptuneDeposit_js_1 = __importDefault(require("../../../core/modules/wasm/exec-args/ExecArgNeptuneDeposit.js"));
|
|
16
16
|
const MsgExecuteContractCompat_js_1 = __importDefault(require("../../../core/modules/wasm/msgs/MsgExecuteContractCompat.js"));
|
|
@@ -9,8 +9,8 @@ const bip39_1 = require("bip39");
|
|
|
9
9
|
const viem_1 = require("viem");
|
|
10
10
|
const exceptions_1 = require("@injectivelabs/exceptions");
|
|
11
11
|
const ts_types_1 = require("@injectivelabs/ts-types");
|
|
12
|
-
const ethers_1 = require("ethers");
|
|
13
12
|
const core_proto_ts_1 = require("@injectivelabs/core-proto-ts");
|
|
13
|
+
const ethers_1 = require("ethers");
|
|
14
14
|
const Address_js_1 = require("./Address.js");
|
|
15
15
|
const PublicKey_js_1 = require("./PublicKey.js");
|
|
16
16
|
const tx_js_1 = require("../tx/utils/tx.js");
|
|
@@ -2,4 +2,4 @@ export declare const GrantAuthorizationType: {
|
|
|
2
2
|
readonly GenericAuthorization: "GenericAuthorization";
|
|
3
3
|
readonly ContractExecutionAuthorization: "ContractExecutionAuthorization";
|
|
4
4
|
};
|
|
5
|
-
export type GrantAuthorizationType = typeof GrantAuthorizationType[keyof typeof GrantAuthorizationType];
|
|
5
|
+
export type GrantAuthorizationType = (typeof GrantAuthorizationType)[keyof typeof GrantAuthorizationType];
|
|
@@ -9,5 +9,5 @@ export declare const AllowanceTypes: {
|
|
|
9
9
|
readonly PeriodicAllowance: "periodSpendLimit";
|
|
10
10
|
readonly AllowedMsgAllowance: "allowedMessages";
|
|
11
11
|
};
|
|
12
|
-
export type AllowanceTypes = typeof AllowanceTypes[keyof typeof AllowanceTypes];
|
|
12
|
+
export type AllowanceTypes = (typeof AllowanceTypes)[keyof typeof AllowanceTypes];
|
|
13
13
|
export declare function encodeAllowance(allowance: Allowance): GoogleProtobufAny.Any | undefined;
|
|
@@ -3,13 +3,13 @@ export declare const ExitType: {
|
|
|
3
3
|
readonly Quote: "quote";
|
|
4
4
|
readonly Base: "base";
|
|
5
5
|
};
|
|
6
|
-
export type ExitType = typeof ExitType[keyof typeof ExitType];
|
|
6
|
+
export type ExitType = (typeof ExitType)[keyof typeof ExitType];
|
|
7
7
|
export declare const StrategyType: {
|
|
8
8
|
readonly Arithmetic: "arithmetic";
|
|
9
9
|
readonly ArithmeticLP: "trailing_arithmetic_lp";
|
|
10
10
|
readonly Geometric: "geometric";
|
|
11
11
|
};
|
|
12
|
-
export type StrategyType = typeof StrategyType[keyof typeof StrategyType];
|
|
12
|
+
export type StrategyType = (typeof StrategyType)[keyof typeof StrategyType];
|
|
13
13
|
export type TrailingArithmetic = {
|
|
14
14
|
trailing_arithmetic: {
|
|
15
15
|
lower_trailing_bound: string;
|
|
@@ -7,8 +7,8 @@ const stargate_1 = require("@cosmjs/stargate");
|
|
|
7
7
|
const stargate_2 = require("@cosmjs/stargate");
|
|
8
8
|
const utils_1 = require("@cosmjs/utils");
|
|
9
9
|
const stargate_3 = require("@cosmjs/stargate");
|
|
10
|
-
const tx_js_1 = require("cosmjs-types/cosmos/tx/v1beta1/tx.js");
|
|
11
10
|
const tendermint_rpc_1 = require("@cosmjs/tendermint-rpc");
|
|
11
|
+
const tx_js_1 = require("cosmjs-types/cosmos/tx/v1beta1/tx.js");
|
|
12
12
|
const signing_js_1 = require("cosmjs-types/cosmos/tx/signing/v1beta1/signing.js");
|
|
13
13
|
const tx_js_2 = require("cosmjs-types/ibc/applications/transfer/v1/tx.js");
|
|
14
14
|
const amino_1 = require("@cosmjs/amino");
|
|
@@ -130,7 +130,7 @@ class TxGrpcApi {
|
|
|
130
130
|
const { txService } = this;
|
|
131
131
|
const mode = options?.mode || core_proto_ts_1.CosmosTxV1Beta1Service.BroadcastMode.BROADCAST_MODE_SYNC;
|
|
132
132
|
const timeout = options?.timeout ||
|
|
133
|
-
|
|
133
|
+
(0, utils_1.toBigNumber)(options?.txTimeout || utils_1.DEFAULT_BLOCK_TIMEOUT_HEIGHT)
|
|
134
134
|
.times(utils_1.DEFAULT_BLOCK_TIME_IN_SECONDS * 1000)
|
|
135
135
|
.toNumber();
|
|
136
136
|
const broadcastTxRequest = core_proto_ts_1.CosmosTxV1Beta1Service.BroadcastTxRequest.create();
|
|
@@ -10,8 +10,8 @@ const core_proto_ts_1 = require("@injectivelabs/core-proto-ts");
|
|
|
10
10
|
const exceptions_1 = require("@injectivelabs/exceptions");
|
|
11
11
|
const utils_1 = require("@injectivelabs/utils");
|
|
12
12
|
const TxClient_js_1 = require("../utils/classes/TxClient.js");
|
|
13
|
-
const helpers_js_1 = require("../../../utils/helpers.js");
|
|
14
13
|
const tx_rest_client_js_1 = require("../types/tx-rest-client.js");
|
|
14
|
+
const helpers_js_1 = require("../../../utils/helpers.js");
|
|
15
15
|
/**
|
|
16
16
|
* It is recommended to use TxGrpcClient instead of TxRestApi
|
|
17
17
|
*/
|
|
@@ -116,7 +116,7 @@ class TxRestApi {
|
|
|
116
116
|
}
|
|
117
117
|
async broadcast(tx, options) {
|
|
118
118
|
const timeout = options?.timeout ||
|
|
119
|
-
|
|
119
|
+
(0, utils_1.toBigNumber)(options?.txTimeout || utils_1.DEFAULT_BLOCK_TIMEOUT_HEIGHT)
|
|
120
120
|
.times(utils_1.DEFAULT_BLOCK_TIME_IN_SECONDS * 1000)
|
|
121
121
|
.toNumber();
|
|
122
122
|
try {
|
|
@@ -5,7 +5,7 @@ const utils_1 = require("@injectivelabs/utils");
|
|
|
5
5
|
const TxGrpcApi_js_1 = require("./TxGrpcApi.js");
|
|
6
6
|
const TxRestApi_js_1 = require("./TxRestApi.js");
|
|
7
7
|
const waitTxBroadcasted = (txHash, options) => {
|
|
8
|
-
const timeout =
|
|
8
|
+
const timeout = (0, utils_1.toBigNumber)(options?.txTimeout || utils_1.DEFAULT_BLOCK_TIMEOUT_HEIGHT)
|
|
9
9
|
.times(utils_1.DEFAULT_BLOCK_TIME_IN_SECONDS * 1000)
|
|
10
10
|
.toNumber();
|
|
11
11
|
return options.endpoints.grpc
|
|
@@ -90,9 +90,7 @@ class MsgBroadcasterWithPk {
|
|
|
90
90
|
if (txTimeoutOnFeeDelegation) {
|
|
91
91
|
const latestBlock = await new index_js_4.ChainGrpcTendermintApi(endpoints.grpc).fetchLatestBlock();
|
|
92
92
|
const latestHeight = latestBlock.header.height;
|
|
93
|
-
timeoutHeight =
|
|
94
|
-
.plus(txTimeout)
|
|
95
|
-
.toNumber();
|
|
93
|
+
timeoutHeight = (0, utils_1.toBigNumber)(latestHeight).plus(txTimeout).toNumber();
|
|
96
94
|
}
|
|
97
95
|
const transactionApi = new index_js_3.IndexerGrpcWeb3GwApi(endpoints.web3gw || endpoints.indexer);
|
|
98
96
|
const txResponse = await transactionApi.prepareTxRequest({
|
|
@@ -172,7 +170,7 @@ class MsgBroadcasterWithPk {
|
|
|
172
170
|
}
|
|
173
171
|
const stdGasFee = (0, utils_1.getStdFee)({
|
|
174
172
|
...args.fee,
|
|
175
|
-
gas:
|
|
173
|
+
gas: (0, utils_1.toBigNumber)(result.gasInfo.gasUsed)
|
|
176
174
|
.times(gasBufferCoefficient)
|
|
177
175
|
.toFixed(),
|
|
178
176
|
});
|
|
@@ -267,11 +265,11 @@ class MsgBroadcasterWithPk {
|
|
|
267
265
|
if (useRest) {
|
|
268
266
|
const latestBlock = await new index_js_5.ChainRestTendermintApi(endpoints.grpc).fetchLatestBlock();
|
|
269
267
|
const latestHeight = latestBlock.header.height;
|
|
270
|
-
return
|
|
268
|
+
return (0, utils_1.toBigNumber)(latestHeight).plus(txTimeout);
|
|
271
269
|
}
|
|
272
270
|
const latestBlock = await new index_js_4.ChainGrpcTendermintApi(endpoints.grpc).fetchLatestBlock();
|
|
273
271
|
const latestHeight = latestBlock.header.height;
|
|
274
|
-
return
|
|
272
|
+
return (0, utils_1.toBigNumber)(latestHeight).plus(txTimeout);
|
|
275
273
|
}
|
|
276
274
|
async broadcastTxRaw(txRaw) {
|
|
277
275
|
const { endpoints, txTimeout } = this;
|
|
@@ -7,7 +7,7 @@ const getEip712Domain = (evmChainId) => {
|
|
|
7
7
|
domain: {
|
|
8
8
|
name: 'Injective Web3',
|
|
9
9
|
version: '1.0.0',
|
|
10
|
-
chainId: '0x' +
|
|
10
|
+
chainId: '0x' + (0, utils_1.toBigNumber)(evmChainId).toString(16),
|
|
11
11
|
salt: '0',
|
|
12
12
|
verifyingContract: 'cosmos',
|
|
13
13
|
},
|
|
@@ -19,7 +19,7 @@ const getEip712DomainV2 = (evmChainId) => {
|
|
|
19
19
|
domain: {
|
|
20
20
|
name: 'Injective Web3',
|
|
21
21
|
version: '1.0.0',
|
|
22
|
-
chainId: '0x' +
|
|
22
|
+
chainId: '0x' + (0, utils_1.toBigNumber)(evmChainId).toString(16),
|
|
23
23
|
verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC',
|
|
24
24
|
salt: '0',
|
|
25
25
|
},
|
package/dist/cjs/core/tx/tx.js
CHANGED
|
@@ -168,7 +168,7 @@ const createTransactionForAddressAndMsg = async (params) => {
|
|
|
168
168
|
/** Block Details */
|
|
169
169
|
const latestBlock = await tendermintRestApi.fetchLatestBlock();
|
|
170
170
|
const latestHeight = latestBlock.header.height;
|
|
171
|
-
const timeoutHeight =
|
|
171
|
+
const timeoutHeight = (0, utils_1.toBigNumber)(latestHeight).plus(utils_3.DEFAULT_BLOCK_TIMEOUT_HEIGHT);
|
|
172
172
|
const pubKey = params.pubKey || baseAccount.pubKey.key;
|
|
173
173
|
if (!pubKey) {
|
|
174
174
|
throw new exceptions_1.GeneralException(new Error(`The pubKey for ${params.address} is missing.`));
|
|
@@ -62,13 +62,13 @@ export declare const BroadcastMode: {
|
|
|
62
62
|
readonly Async: "BROADCAST_MODE_ASYNC";
|
|
63
63
|
readonly Block: "BROADCAST_MODE_BLOCK";
|
|
64
64
|
};
|
|
65
|
-
export type BroadcastMode = typeof BroadcastMode[keyof typeof BroadcastMode];
|
|
65
|
+
export type BroadcastMode = (typeof BroadcastMode)[keyof typeof BroadcastMode];
|
|
66
66
|
export declare const BroadcastModeKeplr: {
|
|
67
67
|
readonly Sync: "sync";
|
|
68
68
|
readonly Async: "async";
|
|
69
69
|
readonly Block: "block";
|
|
70
70
|
};
|
|
71
|
-
export type BroadcastModeKeplr = typeof BroadcastModeKeplr[keyof typeof BroadcastModeKeplr];
|
|
71
|
+
export type BroadcastModeKeplr = (typeof BroadcastModeKeplr)[keyof typeof BroadcastModeKeplr];
|
|
72
72
|
export interface TxResultResponse {
|
|
73
73
|
tx: RestTx;
|
|
74
74
|
tx_response: TxInfoResponse;
|
|
@@ -42,7 +42,7 @@ export declare const TxClientMode: {
|
|
|
42
42
|
readonly gRpc: "grpc";
|
|
43
43
|
readonly rest: "rest";
|
|
44
44
|
};
|
|
45
|
-
export type TxClientMode = typeof TxClientMode[keyof typeof TxClientMode];
|
|
45
|
+
export type TxClientMode = (typeof TxClientMode)[keyof typeof TxClientMode];
|
|
46
46
|
export type MsgArg = {
|
|
47
47
|
type: string;
|
|
48
48
|
message: any;
|
package/dist/cjs/json/ofac.js
CHANGED
|
@@ -2,50 +2,50 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ofacWallets = void 0;
|
|
4
4
|
exports.ofacWallets = [
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
5
|
+
'0x179f48c78f57a3a78f0608cc9197b8972921d1d2',
|
|
6
|
+
'0x1967d8af5bd86a497fb3dd7899a020e47560daaf',
|
|
7
|
+
'0x19aa5fe80d33a56d56c78e82ea5e50e5d80b4dff',
|
|
8
|
+
'0x19aa5fe80d33a56d56c78e82ea5e50e5d80b4dff',
|
|
9
|
+
'0x1da5821544e25c636c1417ba96ade4cf6d2f9b5a',
|
|
10
|
+
'0x2f389ce8bd8ff92de3402ffce4691d17fc4f6535',
|
|
11
|
+
'0x2f389ce8bd8ff92de3402ffce4691d17fc4f6535',
|
|
12
|
+
'0x2f50508a8a3d323b91336fa3ea6ae50e55f32185',
|
|
13
|
+
'0x308ed4b7b49797e1a98d3818bff6fe5385410370',
|
|
14
|
+
'0x3cbded43efdaf0fc77b9c55f6fc9988fcc9b757d',
|
|
15
|
+
'0x3efa30704d2b8bbac821307230376556cf8cc39e',
|
|
16
|
+
'0x48549a34ae37b12f6a30566245176994e17c6b4a',
|
|
17
|
+
'0x4f47bc496083c727c5fbe3ce9cdf2b0f6496270c',
|
|
18
|
+
'0x4f47bc496083c727c5fbe3ce9cdf2b0f6496270c',
|
|
19
|
+
'0x4f47bc496083c727c5fbe3ce9cdf2b0f6496270c',
|
|
20
|
+
'0x530a64c0ce595026a4a556b703644228179e2d57',
|
|
21
|
+
'0x5512d943ed1f7c8a43f3435c85f7ab68b30121b0',
|
|
22
|
+
'0x5a7a51bfb49f190e5a6060a5bc6052ac14a3b59f',
|
|
23
|
+
'0x5f48c2a71b2cc96e3f0ccae4e39318ff0dc375b2',
|
|
24
|
+
'0x6be0ae71e6c41f2f9d0d1a3b8d0f75e6f6a0b46e',
|
|
25
|
+
'0x6f1ca141a28907f78ebaa64fb83a9088b02a8352',
|
|
26
|
+
'0x746aebc06d2ae31b71ac51429a19d54e797878e9',
|
|
27
|
+
'0x77777feddddffc19ff86db637967013e6c6a116c',
|
|
28
|
+
'0x797d7ae72ebddcdea2a346c1834e04d1f8df102b',
|
|
29
|
+
'0x8576acc5c05d6ce88f4e49bf65bdf0c62f91353c',
|
|
30
|
+
'0x901bb9583b24d97e995513c6778dc6888ab6870e',
|
|
31
|
+
'0x961c5be54a2ffc17cf4cb021d863c42dacd47fc1',
|
|
32
|
+
'0x97b1043abd9e6fc31681635166d430a458d14f9c',
|
|
33
|
+
'0x9c2bc757b66f24d60f016b6237f8cdd414a879fa',
|
|
34
|
+
'0x9f4cda013e354b8fc285bf4b9a60460cee7f7ea9',
|
|
35
|
+
'0xa7e5d5a720f06526557c513402f2e6b5fa20b008',
|
|
36
|
+
'0xb6f5ec1a0a9cd1526536d3f0426c429529471f40',
|
|
37
|
+
'0xb6f5ec1a0a9cd1526536d3f0426c429529471f40',
|
|
38
|
+
'0xb6f5ec1a0a9cd1526536d3f0426c429529471f40',
|
|
39
|
+
'0xc455f7fd3e0e12afd51fba5c106909934d8a0e4a',
|
|
40
|
+
'0xca0840578f57fe71599d29375e16783424023357',
|
|
41
|
+
'0xd0975b32cea532eadddfc9c60481976e39db3472',
|
|
42
|
+
'0xd882cfc20f52f2599d84b8e8d58c7fb62cfe344b',
|
|
43
|
+
'0xd882cfc20f52f2599d84b8e8d58c7fb62cfe344b',
|
|
44
|
+
'0xe1d865c3d669dcc8c57c8d023140cb204e672ee4',
|
|
45
|
+
'0xe7aa314c77f4233c18c6cc84384a9247c0cf367b',
|
|
46
|
+
'0xed6e0a7e4ac94d976eebfb82ccf777a3c6bad921',
|
|
47
|
+
'0xf3701f445b6bdafedbca97d1e477357839e4120d',
|
|
48
|
+
'0xfac583c0cf07ea434052c49115a4682172ab6b4f',
|
|
49
|
+
'0xfec8a60023265364d066a1212fde3930f6ae8da7',
|
|
50
|
+
'0xffbac21a641dcfe4552920138d90f3638b3c9fba',
|
|
51
51
|
];
|
|
@@ -12,7 +12,7 @@ export declare const StreamOperation: {
|
|
|
12
12
|
readonly Update: "update";
|
|
13
13
|
readonly Invalidate: "invalidate";
|
|
14
14
|
};
|
|
15
|
-
export type StreamOperation = typeof StreamOperation[keyof typeof StreamOperation];
|
|
15
|
+
export type StreamOperation = (typeof StreamOperation)[keyof typeof StreamOperation];
|
|
16
16
|
export type GrpcCoin = CosmosBaseV1Beta1Coin.Coin;
|
|
17
17
|
export type TxRaw = CosmosTxV1Beta1Tx.TxRaw;
|
|
18
18
|
export type SignDoc = CosmosTxV1Beta1Tx.SignDoc;
|
|
@@ -5,18 +5,18 @@ export declare const TradeExecutionType: {
|
|
|
5
5
|
readonly LimitMatchRestingOrder: "limitMatchRestingOrder";
|
|
6
6
|
readonly LimitMatchNewOrder: "limitMatchNewOrder";
|
|
7
7
|
};
|
|
8
|
-
export type TradeExecutionType = typeof TradeExecutionType[keyof typeof TradeExecutionType];
|
|
8
|
+
export type TradeExecutionType = (typeof TradeExecutionType)[keyof typeof TradeExecutionType];
|
|
9
9
|
export declare const TradeExecutionSide: {
|
|
10
10
|
readonly Maker: "maker";
|
|
11
11
|
readonly Taker: "taker";
|
|
12
12
|
};
|
|
13
|
-
export type TradeExecutionSide = typeof TradeExecutionSide[keyof typeof TradeExecutionSide];
|
|
13
|
+
export type TradeExecutionSide = (typeof TradeExecutionSide)[keyof typeof TradeExecutionSide];
|
|
14
14
|
export declare const TradeDirection: {
|
|
15
15
|
readonly Buy: "buy";
|
|
16
16
|
readonly Sell: "sell";
|
|
17
17
|
readonly Long: "long";
|
|
18
18
|
readonly Short: "short";
|
|
19
19
|
};
|
|
20
|
-
export type TradeDirection = typeof TradeDirection[keyof typeof TradeDirection];
|
|
20
|
+
export type TradeDirection = (typeof TradeDirection)[keyof typeof TradeDirection];
|
|
21
21
|
export type OrderMask = InjectiveExchangeV1Beta1Exchange.OrderMask;
|
|
22
22
|
export declare const OrderMaskMap: typeof InjectiveExchangeV1Beta1Exchange.OrderMask;
|
|
@@ -11,7 +11,7 @@ export declare const TokenType: {
|
|
|
11
11
|
readonly InsuranceFund: "insuranceFund";
|
|
12
12
|
readonly Unknown: "unknown";
|
|
13
13
|
};
|
|
14
|
-
export type TokenType = typeof TokenType[keyof typeof TokenType];
|
|
14
|
+
export type TokenType = (typeof TokenType)[keyof typeof TokenType];
|
|
15
15
|
export declare const TokenVerification: {
|
|
16
16
|
readonly Verified: "verified";
|
|
17
17
|
readonly Submitted: "submitted";
|
|
@@ -19,7 +19,7 @@ export declare const TokenVerification: {
|
|
|
19
19
|
readonly External: "external";
|
|
20
20
|
readonly Unverified: "unverified";
|
|
21
21
|
};
|
|
22
|
-
export type TokenVerification = typeof TokenVerification[keyof typeof TokenVerification];
|
|
22
|
+
export type TokenVerification = (typeof TokenVerification)[keyof typeof TokenVerification];
|
|
23
23
|
export declare const TokenSource: {
|
|
24
24
|
readonly Aptos: "aptos";
|
|
25
25
|
readonly Solana: "solana";
|
|
@@ -34,7 +34,7 @@ export declare const TokenSource: {
|
|
|
34
34
|
readonly BinanceSmartChain: "binance-smart-chain";
|
|
35
35
|
readonly Axelar: "axelar";
|
|
36
36
|
};
|
|
37
|
-
export type TokenSource = typeof TokenSource[keyof typeof TokenSource];
|
|
37
|
+
export type TokenSource = (typeof TokenSource)[keyof typeof TokenSource];
|
|
38
38
|
export interface TokenStatic {
|
|
39
39
|
name: string;
|
|
40
40
|
logo: string;
|
package/dist/cjs/utils/msgs.js
CHANGED
|
@@ -6,34 +6,34 @@ const getGasPriceBasedOnMessage = (msgs) => {
|
|
|
6
6
|
const messages = Array.isArray(msgs) ? msgs : [msgs];
|
|
7
7
|
const messageType = messages[0].toDirectSign().type;
|
|
8
8
|
if (messageType.includes('MsgPrivilegedExecuteContract')) {
|
|
9
|
-
return
|
|
9
|
+
return (0, utils_1.toBigNumber)(utils_1.DEFAULT_GAS_LIMIT)
|
|
10
10
|
.times(6)
|
|
11
11
|
.times(messages.length)
|
|
12
12
|
.decimalPlaces(0)
|
|
13
13
|
.toNumber();
|
|
14
14
|
}
|
|
15
15
|
if (messageType.includes('MsgExecuteContract')) {
|
|
16
|
-
return
|
|
16
|
+
return (0, utils_1.toBigNumber)(utils_1.DEFAULT_GAS_LIMIT)
|
|
17
17
|
.times(3)
|
|
18
18
|
.times(messages.length)
|
|
19
19
|
.decimalPlaces(0)
|
|
20
20
|
.toNumber();
|
|
21
21
|
}
|
|
22
22
|
if (messageType.includes('exchange')) {
|
|
23
|
-
return
|
|
23
|
+
return (0, utils_1.toBigNumber)(utils_1.DEFAULT_EXCHANGE_LIMIT)
|
|
24
24
|
.times(messages.length)
|
|
25
25
|
.decimalPlaces(0)
|
|
26
26
|
.toNumber();
|
|
27
27
|
}
|
|
28
28
|
if (messageType.includes('wasm')) {
|
|
29
|
-
return
|
|
29
|
+
return (0, utils_1.toBigNumber)(utils_1.DEFAULT_GAS_LIMIT)
|
|
30
30
|
.times(1.5)
|
|
31
31
|
.times(messages.length)
|
|
32
32
|
.decimalPlaces(0)
|
|
33
33
|
.toNumber();
|
|
34
34
|
}
|
|
35
35
|
if (messageType.includes('authz')) {
|
|
36
|
-
return
|
|
36
|
+
return (0, utils_1.toBigNumber)(utils_1.DEFAULT_EXCHANGE_LIMIT)
|
|
37
37
|
.times(messages.length)
|
|
38
38
|
.decimalPlaces(0)
|
|
39
39
|
.toNumber();
|
|
@@ -41,19 +41,15 @@ const getGasPriceBasedOnMessage = (msgs) => {
|
|
|
41
41
|
if (messageType.includes('gov') &&
|
|
42
42
|
(messageType.includes('MsgDeposit') ||
|
|
43
43
|
messageType.includes('MsgSubmitProposal'))) {
|
|
44
|
-
return
|
|
44
|
+
return (0, utils_1.toBigNumber)(utils_1.DEFAULT_GAS_LIMIT)
|
|
45
45
|
.times(15)
|
|
46
46
|
.times(messages.length)
|
|
47
47
|
.decimalPlaces(0)
|
|
48
48
|
.toNumber();
|
|
49
49
|
}
|
|
50
50
|
if (messageType.includes('MsgTransfer')) {
|
|
51
|
-
return
|
|
52
|
-
.times(messages.length)
|
|
53
|
-
.toNumber();
|
|
51
|
+
return (0, utils_1.toBigNumber)(utils_1.DEFAULT_IBC_GAS_LIMIT).times(messages.length).toNumber();
|
|
54
52
|
}
|
|
55
|
-
return
|
|
56
|
-
.times(messages.length)
|
|
57
|
-
.toNumber();
|
|
53
|
+
return (0, utils_1.toBigNumber)(utils_1.DEFAULT_GAS_LIMIT).times(messages.length).toNumber();
|
|
58
54
|
};
|
|
59
55
|
exports.getGasPriceBasedOnMessage = getGasPriceBasedOnMessage;
|
|
@@ -8,7 +8,7 @@ export default class BaseGrpcWebConsumer extends GrpcWebImpl {
|
|
|
8
8
|
constructor(endpoint) {
|
|
9
9
|
super(endpoint, {
|
|
10
10
|
transport: getGrpcTransport(),
|
|
11
|
-
setCookieMetadata: true
|
|
11
|
+
setCookieMetadata: true,
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
14
|
static getGrpcWebImpl = (endpoint) => new BaseGrpcWebConsumer(endpoint);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { GrpcInsuranceFund } from '../types/insurance.js';
|
|
2
|
-
import type { InsuranceFund, InsuranceModuleParams } from '../types/insurance.js';
|
|
3
2
|
import type { InjectiveInsuranceV1Beta1Query } from '@injectivelabs/core-proto-ts';
|
|
3
|
+
import type { InsuranceFund, InsuranceModuleParams } from '../types/insurance.js';
|
|
4
4
|
/**
|
|
5
5
|
* @category Chain Grpc Transformer
|
|
6
6
|
*/
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { InjectiveOracleV1Beta1Oracle
|
|
1
|
+
import { InjectiveOracleV1Beta1Oracle } from '@injectivelabs/core-proto-ts';
|
|
2
2
|
export const OracleTypeMap = InjectiveOracleV1Beta1Oracle.OracleType;
|