@firmachain/firma-js 0.2.64 → 0.3.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/README.md +1 -1
- package/dist/sdk/FirmaAuthzService.d.ts +8 -8
- package/dist/sdk/FirmaAuthzService.js +12 -6
- package/dist/sdk/FirmaBankService.d.ts +4 -4
- package/dist/sdk/FirmaContractService.d.ts +4 -4
- package/dist/sdk/FirmaCosmWasmCw20.d.ts +14 -14
- package/dist/sdk/FirmaCosmWasmCw721.d.ts +14 -14
- package/dist/sdk/FirmaCosmWasmCwBridge.d.ts +9 -9
- package/dist/sdk/FirmaCosmWasmCwMarketplace.d.ts +8 -8
- package/dist/sdk/FirmaCosmWasmService.d.ts +8 -8
- package/dist/sdk/FirmaCosmWasmService.js +2 -3
- package/dist/sdk/FirmaDistributionService.d.ts +6 -6
- package/dist/sdk/FirmaFeeGrantService.d.ts +4 -4
- package/dist/sdk/FirmaGovService.d.ts +27 -16
- package/dist/sdk/FirmaGovService.js +305 -195
- package/dist/sdk/FirmaIbcService.d.ts +3 -4
- package/dist/sdk/FirmaIbcService.js +5 -2
- package/dist/sdk/FirmaNftService.d.ts +5 -5
- package/dist/sdk/FirmaStakingService.d.ts +6 -6
- package/dist/sdk/FirmaTokenService.d.ts +5 -5
- package/dist/sdk/FirmaUtil.d.ts +1 -1
- package/dist/sdk/FirmaUtil.js +12 -14
- package/dist/sdk/firmachain/amino/addresses.js +1 -1
- package/dist/sdk/firmachain/amino/aminomsgs.d.ts +10 -0
- package/dist/sdk/firmachain/amino/aminomsgs.js +5 -1
- package/dist/sdk/firmachain/amino/aminotypes.js +27 -10
- package/dist/sdk/firmachain/amino/coins.d.ts +14 -2
- package/dist/sdk/firmachain/amino/coins.js +26 -5
- package/dist/sdk/firmachain/amino/encoding.d.ts +10 -1
- package/dist/sdk/firmachain/amino/encoding.js +21 -3
- package/dist/sdk/firmachain/amino/signdoc.d.ts +21 -3
- package/dist/sdk/firmachain/amino/signdoc.js +37 -11
- package/dist/sdk/firmachain/amino/signer.d.ts +2 -1
- package/dist/sdk/firmachain/authz/AuthzTxTypes.d.ts +7 -6
- package/dist/sdk/firmachain/authz/AuthzTxTypes.js +7 -6
- package/dist/sdk/firmachain/bank/BankQueryClient.js +1 -1
- package/dist/sdk/firmachain/common/CommonTxClient.js +11 -9
- package/dist/sdk/firmachain/common/ITxClient.d.ts +6 -6
- package/dist/sdk/firmachain/common/ITxClient.js +82 -24
- package/dist/sdk/firmachain/common/LedgerSigningStargateClient.d.ts +4 -9
- package/dist/sdk/firmachain/common/LedgerSigningStargateClient.js +37 -32
- package/dist/sdk/firmachain/common/LedgerWallet.js +4 -8
- package/dist/sdk/firmachain/common/TxCommon.d.ts +1 -2
- package/dist/sdk/firmachain/common/accounts.d.ts +7 -3
- package/dist/sdk/firmachain/common/accounts.js +28 -33
- package/dist/sdk/firmachain/common/aminotypes.d.ts +19 -0
- package/dist/sdk/firmachain/common/aminotypes.js +74 -0
- package/dist/sdk/firmachain/common/events.d.ts +32 -0
- package/dist/sdk/firmachain/common/events.js +18 -0
- package/dist/sdk/firmachain/common/fee.d.ts +26 -0
- package/dist/sdk/firmachain/common/fee.js +83 -0
- package/dist/sdk/firmachain/common/index.d.ts +1 -0
- package/dist/sdk/firmachain/common/index.js +3 -0
- package/dist/sdk/firmachain/common/modules/auth/queries.d.ts +15 -0
- package/dist/sdk/firmachain/common/modules/auth/queries.js +64 -0
- package/dist/sdk/firmachain/common/modules/authz/aminomessages.d.ts +2 -0
- package/dist/sdk/firmachain/common/modules/authz/aminomessages.js +15 -0
- package/dist/sdk/firmachain/common/modules/authz/messages.d.ts +2 -0
- package/dist/sdk/firmachain/common/modules/authz/messages.js +9 -0
- package/dist/sdk/firmachain/common/modules/authz/queries.d.ts +10 -0
- package/dist/sdk/firmachain/common/modules/authz/queries.js +88 -0
- package/dist/sdk/firmachain/common/modules/bank/aminomessages.d.ts +35 -0
- package/dist/sdk/firmachain/common/modules/bank/aminomessages.js +85 -0
- package/dist/sdk/firmachain/common/modules/bank/messages.d.ts +8 -0
- package/dist/sdk/firmachain/common/modules/bank/messages.js +12 -0
- package/dist/sdk/firmachain/common/modules/bank/queries.d.ts +15 -0
- package/dist/sdk/firmachain/common/modules/bank/queries.js +128 -0
- package/dist/sdk/firmachain/common/modules/crisis/aminomessages.d.ts +14 -0
- package/dist/sdk/firmachain/common/modules/crisis/aminomessages.js +11 -0
- package/dist/sdk/firmachain/common/modules/distribution/aminomessages.d.ts +44 -0
- package/dist/sdk/firmachain/common/modules/distribution/aminomessages.js +113 -0
- package/dist/sdk/firmachain/common/modules/distribution/messages.d.ts +8 -0
- package/dist/sdk/firmachain/common/modules/distribution/messages.js +15 -0
- package/dist/sdk/firmachain/common/modules/distribution/queries.d.ts +16 -0
- package/dist/sdk/firmachain/common/modules/distribution/queries.js +171 -0
- package/dist/sdk/firmachain/common/modules/evidence/aminomessages.d.ts +18 -0
- package/dist/sdk/firmachain/common/modules/evidence/aminomessages.js +11 -0
- package/dist/sdk/firmachain/common/modules/feegrant/aminomessages.d.ts +2 -0
- package/dist/sdk/firmachain/common/modules/feegrant/aminomessages.js +14 -0
- package/dist/sdk/firmachain/common/modules/feegrant/messages.d.ts +2 -0
- package/dist/sdk/firmachain/common/modules/feegrant/messages.js +8 -0
- package/dist/sdk/firmachain/common/modules/feegrant/queries.d.ts +9 -0
- package/dist/sdk/firmachain/common/modules/feegrant/queries.js +81 -0
- package/dist/sdk/firmachain/common/modules/gov/aminomessages.d.ts +79 -0
- package/dist/sdk/firmachain/common/modules/gov/aminomessages.js +152 -0
- package/dist/sdk/firmachain/common/modules/gov/messages.d.ts +29 -0
- package/dist/sdk/firmachain/common/modules/gov/messages.js +38 -0
- package/dist/sdk/firmachain/common/modules/gov/queries.d.ts +19 -0
- package/dist/sdk/firmachain/common/modules/gov/queries.js +160 -0
- package/dist/sdk/firmachain/common/modules/group/aminomessages.d.ts +2 -0
- package/dist/sdk/firmachain/common/modules/group/aminomessages.js +8 -0
- package/dist/sdk/firmachain/common/modules/group/messages.d.ts +2 -0
- package/dist/sdk/firmachain/common/modules/group/messages.js +28 -0
- package/dist/sdk/firmachain/common/modules/ibc/aminomessages.d.ts +38 -0
- package/dist/sdk/firmachain/common/modules/ibc/aminomessages.js +55 -0
- package/dist/sdk/firmachain/common/modules/ibc/messages.d.ts +8 -0
- package/dist/sdk/firmachain/common/modules/ibc/messages.js +32 -0
- package/dist/sdk/firmachain/common/modules/ibc/queries.d.ts +58 -0
- package/dist/sdk/firmachain/common/modules/ibc/queries.js +576 -0
- package/dist/sdk/firmachain/common/modules/index.d.ts +32 -0
- package/dist/sdk/firmachain/common/modules/index.js +101 -0
- package/dist/sdk/firmachain/common/modules/mint/queries.d.ts +21 -0
- package/dist/sdk/firmachain/common/modules/mint/queries.js +95 -0
- package/dist/sdk/firmachain/common/modules/slashing/aminomessages.d.ts +12 -0
- package/dist/sdk/firmachain/common/modules/slashing/aminomessages.js +11 -0
- package/dist/sdk/firmachain/common/modules/slashing/queries.d.ts +10 -0
- package/dist/sdk/firmachain/common/modules/slashing/queries.js +88 -0
- package/dist/sdk/firmachain/common/modules/staking/aminomessages.d.ts +112 -0
- package/dist/sdk/firmachain/common/modules/staking/aminomessages.js +234 -0
- package/dist/sdk/firmachain/common/modules/staking/messages.d.ts +33 -0
- package/dist/sdk/firmachain/common/modules/staking/messages.js +37 -0
- package/dist/sdk/firmachain/common/modules/staking/queries.d.ts +23 -0
- package/dist/sdk/firmachain/common/modules/staking/queries.js +242 -0
- package/dist/sdk/firmachain/common/modules/tx/queries.d.ts +11 -0
- package/dist/sdk/firmachain/common/modules/tx/queries.js +103 -0
- package/dist/sdk/firmachain/common/modules/vesting/aminomessages.d.ts +16 -0
- package/dist/sdk/firmachain/common/modules/vesting/aminomessages.js +56 -0
- package/dist/sdk/firmachain/common/modules/vesting/messages.d.ts +2 -0
- package/dist/sdk/firmachain/common/modules/vesting/messages.js +7 -0
- package/dist/sdk/firmachain/common/queryclient/index.d.ts +2 -0
- package/dist/sdk/firmachain/common/queryclient/index.js +10 -0
- package/dist/sdk/firmachain/common/queryclient/queryclient.d.ts +75 -0
- package/dist/sdk/firmachain/common/queryclient/queryclient.js +157 -0
- package/dist/sdk/firmachain/common/queryclient/utils.d.ts +33 -0
- package/dist/sdk/firmachain/common/queryclient/utils.js +101 -0
- package/dist/sdk/firmachain/common/search.d.ts +10 -0
- package/dist/sdk/firmachain/common/search.js +7 -0
- package/dist/sdk/firmachain/common/signing.d.ts +8 -3
- package/dist/sdk/firmachain/common/signing.js +24 -12
- package/dist/sdk/firmachain/common/signingstargateclient.d.ts +107 -30
- package/dist/sdk/firmachain/common/signingstargateclient.js +445 -128
- package/dist/sdk/firmachain/common/stargateclient.d.ts +184 -20
- package/dist/sdk/firmachain/common/stargateclient.js +351 -35
- package/dist/sdk/firmachain/contract/ContractTxClient.d.ts +2 -2
- package/dist/sdk/firmachain/contract/ContractTxClient.js +4 -4
- package/dist/sdk/firmachain/contract/ContractTxTypes.d.ts +1 -1
- package/dist/sdk/firmachain/contract/ContractTxTypes.js +3 -3
- package/dist/sdk/firmachain/cosmwasm/CosmWasmQueryClient.js +1 -1
- package/dist/sdk/firmachain/feegrant/FeeGrantTxTypes.d.ts +5 -5
- package/dist/sdk/firmachain/feegrant/FeeGrantTxTypes.js +10 -8
- package/dist/sdk/firmachain/google/protobuf/any.d.ts +3 -2
- package/dist/sdk/firmachain/google/protobuf/any.js +2 -1
- package/dist/sdk/firmachain/google/protobuf/duration.d.ts +3 -2
- package/dist/sdk/firmachain/google/protobuf/duration.js +2 -1
- package/dist/sdk/firmachain/google/protobuf/timestamp.d.ts +3 -2
- package/dist/sdk/firmachain/google/protobuf/timestamp.js +2 -1
- package/dist/sdk/firmachain/gov/GovQueryClient.d.ts +13 -1
- package/dist/sdk/firmachain/gov/GovQueryClient.js +9 -2
- package/dist/sdk/firmachain/gov/GovTxClient.d.ts +12 -0
- package/dist/sdk/firmachain/gov/GovTxClient.js +11 -1
- package/dist/sdk/firmachain/nft/NftTxClient.d.ts +3 -3
- package/dist/sdk/firmachain/nft/NftTxClient.js +6 -6
- package/dist/sdk/firmachain/nft/NftTxTypes.d.ts +1 -1
- package/dist/sdk/firmachain/nft/NftTxTypes.js +4 -4
- package/dist/sdk/firmachain/staking/StakingQueryClient.d.ts +1 -0
- package/dist/sdk/firmachain/staking/StakingQueryClient.js +0 -1
- package/dist/sdk/firmachain/token/TokenTxClient.d.ts +4 -4
- package/dist/sdk/firmachain/token/TokenTxClient.js +8 -8
- package/dist/sdk/firmachain/token/TokenTxTypes.d.ts +1 -1
- package/dist/sdk/firmachain/token/TokenTxTypes.js +5 -5
- package/dist/test/00.wallet.test.js +15 -9
- package/dist/test/01.contract_tx.test.js +53 -45
- package/dist/test/02.contract_query.test.js +54 -31
- package/dist/test/03.contract_scenario.test.js +170 -326
- package/dist/test/04.bank_tx.test.js +58 -59
- package/dist/test/05.bank_query.test.js +51 -56
- package/dist/test/06.feegrant_tx.test.js +74 -89
- package/dist/test/07.feegrant_query.test.js +69 -27
- package/dist/test/08.gas_estimate.test.js +422 -392
- package/dist/test/09.ipfs.test.js +3 -3
- package/dist/test/10.nft_tx.test.js +108 -76
- package/dist/test/11.nft_query.test.js +41 -46
- package/dist/test/12.staking_tx.test.js +81 -98
- package/dist/test/13.staking_query.test.js +66 -12
- package/dist/test/14.distribution_tx.test.js +69 -78
- package/dist/test/15.distribution_query.test.js +81 -57
- package/dist/test/16.gov_tx.test.js +247 -107
- package/dist/test/17.gov_query.test.js +48 -9
- package/dist/test/18.util.test.js +6 -1
- package/dist/test/19.chain.test.js +50 -4
- package/dist/test/20.slashing_query.test.js +31 -1
- package/dist/test/21.token_tx.test.js +48 -56
- package/dist/test/22.token_query.test.js +24 -20
- package/dist/test/23.authz_tx.test.js +119 -240
- package/dist/test/24.authz_query.test.js +116 -56
- package/dist/test/25.cosmwasm_tx.test.js +95 -57
- package/dist/test/26.cosmwasm_query.test.js +66 -26
- package/dist/test/27.arbitary_sign.test.js +59 -67
- package/dist/test/28.ibc_tx.test.js +29 -17
- package/dist/test/29.mint_query.test.js +2 -0
- package/dist/test/30.cw20_tx.test.js +161 -226
- package/dist/test/31.cw20_query.test.js +183 -37
- package/dist/test/32.cw721_tx.test.js +147 -149
- package/dist/test/33.cw721_query.test.js +188 -36
- package/dist/test/34.cw_bridge_tx.test.js +266 -155
- package/dist/test/35.cw_bridge_tx_low.test.js +221 -81
- package/dist/test/36.cw_bridge_query.test.js +157 -21
- package/dist/test/37.cw_marketplace_tx.test.js +22 -22
- package/dist/test/38.cw_marketplace_query.test.js +9 -9
- package/dist/test/config_test.d.ts +10 -4
- package/dist/test/config_test.js +16 -9
- package/dist/test/config_test.sample.d.ts +11 -0
- package/dist/test/config_test.sample.js +14 -0
- package/package.json +9 -7
- package/dist/sdk/firmachain/common/signingaminostargateclient.d.ts +0 -50
- package/dist/sdk/firmachain/common/signingaminostargateclient.js +0 -267
|
@@ -1,46 +1,210 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CometClient, HttpEndpoint } from "@cosmjs/tendermint-rpc";
|
|
2
2
|
import { MsgData } from "cosmjs-types/cosmos/base/abci/v1beta1/abci";
|
|
3
|
+
import { Coin } from "cosmjs-types/cosmos/base/v1beta1/coin";
|
|
4
|
+
import { Account, AccountParser } from "./accounts";
|
|
5
|
+
import { Event } from "./events";
|
|
6
|
+
import { AuthExtension, BankExtension, StakingExtension, TxExtension } from "./modules";
|
|
7
|
+
import { QueryClient } from "./queryclient";
|
|
8
|
+
import { SearchTxQuery } from "./search";
|
|
3
9
|
export declare class TimeoutError extends Error {
|
|
4
10
|
readonly txId: string;
|
|
5
11
|
constructor(message: string, txId: string);
|
|
6
12
|
}
|
|
13
|
+
export interface BlockHeader {
|
|
14
|
+
readonly version: {
|
|
15
|
+
readonly block: string;
|
|
16
|
+
readonly app: string;
|
|
17
|
+
};
|
|
18
|
+
readonly height: number;
|
|
19
|
+
readonly chainId: string;
|
|
20
|
+
/** An RFC 3339 time string like e.g. '2020-02-15T10:39:10.4696305Z' */
|
|
21
|
+
readonly time: string;
|
|
22
|
+
}
|
|
23
|
+
export interface Block {
|
|
24
|
+
/** The ID is a hash of the block header (uppercase hex) */
|
|
25
|
+
readonly id: string;
|
|
26
|
+
readonly header: BlockHeader;
|
|
27
|
+
/** Array of raw transactions */
|
|
28
|
+
readonly txs: readonly Uint8Array[];
|
|
29
|
+
}
|
|
7
30
|
/** A transaction that is indexed as part of the transaction history */
|
|
8
31
|
export interface IndexedTx {
|
|
9
32
|
readonly height: number;
|
|
33
|
+
/** The position of the transaction within the block. This is a 0-based index. */
|
|
34
|
+
readonly txIndex: number;
|
|
35
|
+
/** Transaction hash (might be used as transaction ID). Guaranteed to be non-empty upper-case hex */
|
|
10
36
|
readonly hash: string;
|
|
37
|
+
/** Transaction execution error code. 0 on success. */
|
|
11
38
|
readonly code: number;
|
|
39
|
+
readonly events: readonly Event[];
|
|
40
|
+
/**
|
|
41
|
+
* A string-based log document.
|
|
42
|
+
*
|
|
43
|
+
* This currently seems to merge attributes of multiple events into one event per type
|
|
44
|
+
* (https://github.com/tendermint/tendermint/issues/9595). You might want to use the `events`
|
|
45
|
+
* field instead.
|
|
46
|
+
*
|
|
47
|
+
* @deprecated This field is not filled anymore in Cosmos SDK 0.50+ (https://github.com/cosmos/cosmos-sdk/pull/15845).
|
|
48
|
+
* Please consider using `events` instead.
|
|
49
|
+
*/
|
|
12
50
|
readonly rawLog: string;
|
|
51
|
+
/**
|
|
52
|
+
* Raw transaction bytes stored in Tendermint.
|
|
53
|
+
*
|
|
54
|
+
* If you hash this, you get the transaction hash (= transaction ID):
|
|
55
|
+
*
|
|
56
|
+
* ```js
|
|
57
|
+
* import { sha256 } from "@cosmjs/crypto";
|
|
58
|
+
* import { toHex } from "@cosmjs/encoding";
|
|
59
|
+
*
|
|
60
|
+
* const transactionId = toHex(sha256(indexTx.tx)).toUpperCase();
|
|
61
|
+
* ```
|
|
62
|
+
*
|
|
63
|
+
* Use `decodeTxRaw` from @cosmjs/proto-signing to decode this.
|
|
64
|
+
*/
|
|
13
65
|
readonly tx: Uint8Array;
|
|
14
|
-
|
|
15
|
-
|
|
66
|
+
/**
|
|
67
|
+
* The message responses of the [TxMsgData](https://github.com/cosmos/cosmos-sdk/blob/v0.46.3/proto/cosmos/base/abci/v1beta1/abci.proto#L128-L140)
|
|
68
|
+
* as `Any`s.
|
|
69
|
+
* This field is an empty list for chains running Cosmos SDK < 0.46.
|
|
70
|
+
*/
|
|
71
|
+
readonly msgResponses: Array<{
|
|
72
|
+
readonly typeUrl: string;
|
|
73
|
+
readonly value: Uint8Array;
|
|
74
|
+
}>;
|
|
75
|
+
readonly gasUsed: bigint;
|
|
76
|
+
readonly gasWanted: bigint;
|
|
16
77
|
}
|
|
17
|
-
export interface
|
|
78
|
+
export interface SequenceResponse {
|
|
79
|
+
readonly accountNumber: number;
|
|
80
|
+
readonly sequence: number;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* The response after successfully broadcasting a transaction.
|
|
84
|
+
* Success or failure refer to the execution result.
|
|
85
|
+
*/
|
|
86
|
+
export interface DeliverTxResponse {
|
|
18
87
|
readonly height: number;
|
|
88
|
+
/** The position of the transaction within the block. This is a 0-based index. */
|
|
89
|
+
readonly txIndex: number;
|
|
90
|
+
/** Error code. The transaction suceeded if and only if code is 0. */
|
|
19
91
|
readonly code: number;
|
|
20
92
|
readonly transactionHash: string;
|
|
93
|
+
readonly events: readonly Event[];
|
|
94
|
+
/**
|
|
95
|
+
* A string-based log document.
|
|
96
|
+
*
|
|
97
|
+
* This currently seems to merge attributes of multiple events into one event per type
|
|
98
|
+
* (https://github.com/tendermint/tendermint/issues/9595). You might want to use the `events`
|
|
99
|
+
* field instead.
|
|
100
|
+
*
|
|
101
|
+
* @deprecated This field is not filled anymore in Cosmos SDK 0.50+ (https://github.com/cosmos/cosmos-sdk/pull/15845).
|
|
102
|
+
* Please consider using `events` instead.
|
|
103
|
+
*/
|
|
21
104
|
readonly rawLog?: string;
|
|
105
|
+
/** @deprecated Use `msgResponses` instead. */
|
|
22
106
|
readonly data?: readonly MsgData[];
|
|
107
|
+
/**
|
|
108
|
+
* The message responses of the [TxMsgData](https://github.com/cosmos/cosmos-sdk/blob/v0.46.3/proto/cosmos/base/abci/v1beta1/abci.proto#L128-L140)
|
|
109
|
+
* as `Any`s.
|
|
110
|
+
* This field is an empty list for chains running Cosmos SDK < 0.46.
|
|
111
|
+
*/
|
|
112
|
+
readonly msgResponses: Array<{
|
|
113
|
+
readonly typeUrl: string;
|
|
114
|
+
readonly value: Uint8Array;
|
|
115
|
+
}>;
|
|
116
|
+
readonly gasUsed: bigint;
|
|
117
|
+
readonly gasWanted: bigint;
|
|
23
118
|
}
|
|
24
|
-
export
|
|
25
|
-
|
|
119
|
+
export declare function isDeliverTxFailure(result: DeliverTxResponse): boolean;
|
|
120
|
+
export declare function isDeliverTxSuccess(result: DeliverTxResponse): boolean;
|
|
121
|
+
/**
|
|
122
|
+
* Ensures the given result is a success. Throws a detailed error message otherwise.
|
|
123
|
+
*/
|
|
124
|
+
export declare function assertIsDeliverTxSuccess(result: DeliverTxResponse): void;
|
|
125
|
+
/**
|
|
126
|
+
* Ensures the given result is a failure. Throws a detailed error message otherwise.
|
|
127
|
+
*/
|
|
128
|
+
export declare function assertIsDeliverTxFailure(result: DeliverTxResponse): void;
|
|
129
|
+
/**
|
|
130
|
+
* An error when broadcasting the transaction. This contains the CheckTx errors
|
|
131
|
+
* from the blockchain. Once a transaction is included in a block no BroadcastTxError
|
|
132
|
+
* is thrown, even if the execution fails (DeliverTx errors).
|
|
133
|
+
*/
|
|
134
|
+
export declare class BroadcastTxError extends Error {
|
|
26
135
|
readonly code: number;
|
|
27
|
-
readonly
|
|
28
|
-
readonly
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
136
|
+
readonly codespace: string;
|
|
137
|
+
readonly log: string | undefined;
|
|
138
|
+
constructor(code: number, codespace: string, log: string | undefined);
|
|
139
|
+
}
|
|
140
|
+
/** Use for testing only */
|
|
141
|
+
export interface PrivateStargateClient {
|
|
142
|
+
readonly cometClient: CometClient | undefined;
|
|
143
|
+
}
|
|
144
|
+
export interface StargateClientOptions {
|
|
145
|
+
readonly accountParser?: AccountParser;
|
|
32
146
|
}
|
|
33
|
-
export declare type BroadcastTxResponse = BroadcastTxSuccess | BroadcastTxFailure;
|
|
34
|
-
export declare function isBroadcastTxFailure(result: BroadcastTxResponse): boolean;
|
|
35
|
-
export declare function isBroadcastTxSuccess(result: BroadcastTxResponse): boolean;
|
|
36
147
|
export declare class StargateClient {
|
|
37
|
-
private readonly
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
148
|
+
private readonly cometClient;
|
|
149
|
+
private readonly queryClient;
|
|
150
|
+
private readonly accountParser;
|
|
151
|
+
/**
|
|
152
|
+
* Creates an instance by connecting to the given CometBFT RPC endpoint.
|
|
153
|
+
*
|
|
154
|
+
* This uses auto-detection to decide between a CometBFT 0.38, Tendermint 0.37 and 0.34 client.
|
|
155
|
+
* To set the Comet client explicitly, use `create`.
|
|
156
|
+
*/
|
|
157
|
+
static connect(endpoint: string | HttpEndpoint, options?: StargateClientOptions): Promise<StargateClient>;
|
|
158
|
+
/**
|
|
159
|
+
* Creates an instance from a manually created Comet client.
|
|
160
|
+
* Use this to use `Comet38Client` or `Tendermint37Client` instead of `Tendermint34Client`.
|
|
161
|
+
*/
|
|
162
|
+
static create(cometClient: CometClient, options?: StargateClientOptions): Promise<StargateClient>;
|
|
163
|
+
protected constructor(cometClient: CometClient | undefined, options: StargateClientOptions);
|
|
164
|
+
protected getCometClient(): CometClient | undefined;
|
|
165
|
+
protected forceGetCometClient(): CometClient;
|
|
166
|
+
protected getQueryClient(): (QueryClient & AuthExtension & BankExtension & StakingExtension & TxExtension) | undefined;
|
|
167
|
+
protected forceGetQueryClient(): QueryClient & AuthExtension & BankExtension & StakingExtension & TxExtension;
|
|
168
|
+
getHeight(): Promise<number>;
|
|
169
|
+
getAccount(searchAddress: string): Promise<Account | null>;
|
|
170
|
+
getSequence(address: string): Promise<SequenceResponse>;
|
|
171
|
+
getBlock(height?: number): Promise<Block>;
|
|
172
|
+
getBalance(address: string, searchDenom: string): Promise<Coin>;
|
|
173
|
+
/**
|
|
174
|
+
* Queries all balances for all denoms that belong to this address.
|
|
175
|
+
*
|
|
176
|
+
* Uses the grpc queries (which iterates over the store internally), and we cannot get
|
|
177
|
+
* proofs from such a method.
|
|
178
|
+
*/
|
|
179
|
+
getAllBalances(address: string): Promise<readonly Coin[]>;
|
|
180
|
+
getBalanceStaked(address: string): Promise<Coin | null>;
|
|
181
|
+
getDelegation(delegatorAddress: string, validatorAddress: string): Promise<Coin | null>;
|
|
42
182
|
getTx(id: string): Promise<IndexedTx | null>;
|
|
183
|
+
searchTx(query: SearchTxQuery): Promise<IndexedTx[]>;
|
|
43
184
|
disconnect(): void;
|
|
44
|
-
|
|
185
|
+
/**
|
|
186
|
+
* Broadcasts a signed transaction to the network and monitors its inclusion in a block.
|
|
187
|
+
*
|
|
188
|
+
* If broadcasting is rejected by the node for some reason (e.g. because of a CheckTx failure),
|
|
189
|
+
* an error is thrown.
|
|
190
|
+
*
|
|
191
|
+
* If the transaction is not included in a block before the provided timeout, this errors with a `TimeoutError`.
|
|
192
|
+
*
|
|
193
|
+
* If the transaction is included in a block, a `DeliverTxResponse` is returned. The caller then
|
|
194
|
+
* usually needs to check for execution success or failure.
|
|
195
|
+
*/
|
|
196
|
+
broadcastTx(tx: Uint8Array, timeoutMs?: number, pollIntervalMs?: number): Promise<DeliverTxResponse>;
|
|
197
|
+
/**
|
|
198
|
+
* Broadcasts a signed transaction to the network without monitoring it.
|
|
199
|
+
*
|
|
200
|
+
* If broadcasting is rejected by the node for some reason (e.g. because of a CheckTx failure),
|
|
201
|
+
* an error is thrown.
|
|
202
|
+
*
|
|
203
|
+
* If the transaction is broadcasted, a `string` containing the hash of the transaction is returned. The caller then
|
|
204
|
+
* usually needs to check if the transaction was included in a block and was successful.
|
|
205
|
+
*
|
|
206
|
+
* @returns Returns the hash of the transaction
|
|
207
|
+
*/
|
|
208
|
+
broadcastTxSync(tx: Uint8Array): Promise<string>;
|
|
45
209
|
private txsQuery;
|
|
46
210
|
}
|