coreum-js 2.16.3 → 2.17.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/main/client/index.js +15 -16
- package/dist/main/coreum/asset/ft/v1/authz.d.ts +38 -0
- package/dist/main/coreum/asset/ft/v1/authz.js +122 -0
- package/dist/main/coreum/asset/ft/v1/event.d.ts +52 -28
- package/dist/main/coreum/asset/ft/v1/event.js +744 -138
- package/dist/main/coreum/asset/ft/v1/genesis.d.ts +31 -21
- package/dist/main/coreum/asset/ft/v1/genesis.js +273 -62
- package/dist/main/coreum/asset/ft/v1/params.d.ts +12 -11
- package/dist/main/coreum/asset/ft/v1/params.js +37 -33
- package/dist/main/coreum/asset/ft/v1/query.d.ts +87 -127
- package/dist/main/coreum/asset/ft/v1/query.js +697 -217
- package/dist/main/coreum/asset/ft/v1/token.d.ts +17 -51
- package/dist/main/coreum/asset/ft/v1/token.js +276 -200
- package/dist/main/coreum/asset/ft/v1/tx.d.ts +30 -147
- package/dist/main/coreum/asset/ft/v1/tx.js +502 -386
- package/dist/main/coreum/asset/index.d.ts +2 -3
- package/dist/main/coreum/asset/nft/v1/authz.d.ts +33 -0
- package/dist/main/coreum/asset/nft/v1/authz.js +137 -0
- package/dist/main/coreum/asset/nft/v1/event.d.ts +35 -43
- package/dist/main/coreum/asset/nft/v1/event.js +475 -147
- package/dist/main/coreum/asset/nft/v1/genesis.d.ts +27 -36
- package/dist/main/coreum/asset/nft/v1/genesis.js +311 -119
- package/dist/main/coreum/asset/nft/v1/nft.d.ts +20 -26
- package/dist/main/coreum/asset/nft/v1/nft.js +139 -104
- package/dist/main/coreum/asset/nft/v1/params.d.ts +12 -12
- package/dist/main/coreum/asset/nft/v1/params.js +17 -20
- package/dist/main/coreum/asset/nft/v1/query.d.ts +110 -88
- package/dist/main/coreum/asset/nft/v1/query.js +1079 -185
- package/dist/main/coreum/asset/nft/v1/tx.d.ts +96 -70
- package/dist/main/coreum/asset/nft/v1/tx.js +865 -234
- package/dist/main/coreum/asset/nft/v1/types.d.ts +38 -11
- package/dist/main/coreum/asset/nft/v1/types.js +273 -45
- package/dist/main/coreum/customparams/v1/genesis.d.ts +12 -12
- package/dist/main/coreum/customparams/v1/genesis.js +26 -22
- package/dist/main/coreum/customparams/v1/params.d.ts +11 -11
- package/dist/main/coreum/customparams/v1/params.js +23 -20
- package/dist/main/coreum/customparams/v1/query.d.ts +14 -20
- package/dist/main/coreum/customparams/v1/query.js +35 -29
- package/dist/main/coreum/dex/index.d.ts +1 -0
- package/dist/main/coreum/dex/index.js +12 -0
- package/dist/main/coreum/dex/v1/event.d.ts +73 -0
- package/dist/main/coreum/dex/v1/event.js +470 -0
- package/dist/main/coreum/dex/v1/genesis.d.ts +49 -0
- package/dist/main/coreum/dex/v1/genesis.js +318 -0
- package/dist/main/coreum/dex/v1/order.d.ts +172 -0
- package/dist/main/coreum/dex/v1/order.js +1137 -0
- package/dist/main/coreum/dex/v1/params.d.ts +34 -0
- package/dist/main/coreum/dex/v1/params.js +139 -0
- package/dist/main/coreum/dex/v1/query.d.ts +133 -0
- package/dist/main/coreum/dex/v1/query.js +873 -0
- package/dist/main/coreum/dex/v1/tx.d.ts +102 -0
- package/dist/main/coreum/dex/v1/tx.js +521 -0
- package/dist/main/coreum/extensions/dex.d.ts +12 -0
- package/dist/main/coreum/extensions/dex.js +32 -0
- package/dist/main/coreum/extensions/ft.js +2 -1
- package/dist/main/coreum/extensions/nft.js +2 -1
- package/dist/main/coreum/extensions/nftbeta.js +2 -1
- package/dist/main/coreum/feemodel/v1/genesis.d.ts +13 -13
- package/dist/main/coreum/feemodel/v1/genesis.js +23 -24
- package/dist/main/coreum/feemodel/v1/params.d.ts +14 -21
- package/dist/main/coreum/feemodel/v1/params.js +113 -66
- package/dist/main/coreum/feemodel/v1/query.d.ts +30 -37
- package/dist/main/coreum/feemodel/v1/query.js +196 -43
- package/dist/main/coreum/index.d.ts +46 -0
- package/dist/main/coreum/index.js +58 -1
- package/dist/main/coreum/nft/index.d.ts +1 -2
- package/dist/main/coreum/nft/v1beta1/event.d.ts +23 -27
- package/dist/main/coreum/nft/v1beta1/event.js +103 -77
- package/dist/main/coreum/nft/v1beta1/genesis.d.ts +13 -19
- package/dist/main/coreum/nft/v1beta1/genesis.js +50 -52
- package/dist/main/coreum/nft/v1beta1/nft.d.ts +15 -22
- package/dist/main/coreum/nft/v1beta1/nft.js +111 -81
- package/dist/main/coreum/nft/v1beta1/query.d.ts +54 -124
- package/dist/main/coreum/nft/v1beta1/query.js +259 -223
- package/dist/main/coreum/nft/v1beta1/tx.d.ts +13 -19
- package/dist/main/coreum/nft/v1beta1/tx.js +54 -43
- package/dist/main/cosmos/extensions/bank.js +2 -1
- package/dist/main/cosmos/extensions/distribution.d.ts +4 -4
- package/dist/main/cosmos/extensions/distribution.js +11 -10
- package/dist/main/cosmos/extensions/gov.d.ts +13 -13
- package/dist/main/cosmos/extensions/gov.js +16 -9
- package/dist/main/cosmos/index.d.ts +8 -8
- package/dist/main/google/api/http.d.ts +2636 -6
- package/dist/main/google/api/http.js +18 -21
- package/dist/main/google/protobuf/any.d.ts +14 -2
- package/dist/main/google/protobuf/any.js +6 -7
- package/dist/main/google/protobuf/duration.d.ts +14 -2
- package/dist/main/google/protobuf/duration.js +3 -4
- package/dist/main/google/protobuf/timestamp.d.ts +14 -2
- package/dist/main/google/protobuf/timestamp.js +3 -4
- package/dist/main/index.js +7 -17
- package/dist/main/services/cosmostation.js +1 -1
- package/dist/main/tendermint/abci/types.d.ts +6360 -92
- package/dist/main/tendermint/abci/types.js +195 -235
- package/dist/main/tendermint/crypto/keys.d.ts +14 -2
- package/dist/main/tendermint/crypto/keys.js +3 -4
- package/dist/main/tendermint/crypto/proof.d.ts +152 -10
- package/dist/main/tendermint/crypto/proof.js +19 -24
- package/dist/main/tendermint/types/params.d.ts +196 -12
- package/dist/main/tendermint/types/params.js +15 -20
- package/dist/main/tendermint/types/types.d.ts +1744 -26
- package/dist/main/tendermint/types/types.js +62 -73
- package/dist/main/tendermint/types/validator.d.ts +230 -6
- package/dist/main/tendermint/types/validator.js +10 -13
- package/dist/main/tendermint/version/types.d.ts +28 -4
- package/dist/main/tendermint/version/types.js +6 -8
- package/dist/main/types/core.d.ts +2 -1
- package/dist/main/types/core.js +2 -0
- package/dist/main/utils/convertStringToAny.d.ts +0 -1
- package/dist/main/utils/nft.js +2 -1
- package/dist/main/wasm/v1/authz.d.ts +20 -75
- package/dist/main/wasm/v1/authz.js +129 -148
- package/dist/main/wasm/v1/extensions/wasm.js +2 -1
- package/dist/main/wasm/v1/genesis.d.ts +14 -34
- package/dist/main/wasm/v1/genesis.js +169 -140
- package/dist/main/wasm/v1/ibc.d.ts +13 -26
- package/dist/main/wasm/v1/ibc.js +91 -76
- package/dist/main/wasm/v1/index.d.ts +1 -2
- package/dist/main/wasm/v1/pagination.d.ts +40 -4
- package/dist/main/wasm/v1/pagination.js +9 -11
- package/dist/main/wasm/v1/proposal.d.ts +23 -106
- package/dist/main/wasm/v1/proposal.js +634 -465
- package/dist/main/wasm/v1/query.d.ts +35 -187
- package/dist/main/wasm/v1/query.js +370 -363
- package/dist/main/wasm/v1/tx.d.ts +37 -210
- package/dist/main/wasm/v1/tx.js +621 -497
- package/dist/main/wasm/v1/types.d.ts +19 -67
- package/dist/main/wasm/v1/types.js +224 -195
- package/dist/module/client/index.js +2 -1
- package/dist/module/coreum/asset/ft/v1/authz.d.ts +38 -0
- package/dist/module/coreum/asset/ft/v1/authz.js +119 -0
- package/dist/module/coreum/asset/ft/v1/event.d.ts +52 -28
- package/dist/module/coreum/asset/ft/v1/event.js +721 -109
- package/dist/module/coreum/asset/ft/v1/genesis.d.ts +31 -21
- package/dist/module/coreum/asset/ft/v1/genesis.js +266 -50
- package/dist/module/coreum/asset/ft/v1/params.d.ts +12 -11
- package/dist/module/coreum/asset/ft/v1/params.js +35 -27
- package/dist/module/coreum/asset/ft/v1/query.d.ts +87 -127
- package/dist/module/coreum/asset/ft/v1/query.js +672 -180
- package/dist/module/coreum/asset/ft/v1/token.d.ts +17 -51
- package/dist/module/coreum/asset/ft/v1/token.js +236 -152
- package/dist/module/coreum/asset/ft/v1/tx.d.ts +30 -147
- package/dist/module/coreum/asset/ft/v1/tx.js +437 -301
- package/dist/module/coreum/asset/index.d.ts +2 -3
- package/dist/module/coreum/asset/nft/v1/authz.d.ts +33 -0
- package/dist/module/coreum/asset/nft/v1/authz.js +134 -0
- package/dist/module/coreum/asset/nft/v1/event.d.ts +35 -43
- package/dist/module/coreum/asset/nft/v1/event.js +448 -112
- package/dist/module/coreum/asset/nft/v1/genesis.d.ts +27 -36
- package/dist/module/coreum/asset/nft/v1/genesis.js +299 -100
- package/dist/module/coreum/asset/nft/v1/nft.d.ts +20 -26
- package/dist/module/coreum/asset/nft/v1/nft.js +121 -81
- package/dist/module/coreum/asset/nft/v1/params.d.ts +12 -12
- package/dist/module/coreum/asset/nft/v1/params.js +16 -16
- package/dist/module/coreum/asset/nft/v1/query.d.ts +110 -88
- package/dist/module/coreum/asset/nft/v1/query.js +1057 -153
- package/dist/module/coreum/asset/nft/v1/tx.d.ts +96 -70
- package/dist/module/coreum/asset/nft/v1/tx.js +825 -184
- package/dist/module/coreum/asset/nft/v1/types.d.ts +38 -11
- package/dist/module/coreum/asset/nft/v1/types.js +269 -39
- package/dist/module/coreum/customparams/v1/genesis.d.ts +12 -12
- package/dist/module/coreum/customparams/v1/genesis.js +25 -18
- package/dist/module/coreum/customparams/v1/params.d.ts +11 -11
- package/dist/module/coreum/customparams/v1/params.js +21 -14
- package/dist/module/coreum/customparams/v1/query.d.ts +14 -20
- package/dist/module/coreum/customparams/v1/query.js +32 -23
- package/dist/module/coreum/dex/index.d.ts +1 -0
- package/dist/module/coreum/dex/index.js +9 -0
- package/dist/module/coreum/dex/v1/event.d.ts +73 -0
- package/dist/module/coreum/dex/v1/event.js +467 -0
- package/dist/module/coreum/dex/v1/genesis.d.ts +49 -0
- package/dist/module/coreum/dex/v1/genesis.js +315 -0
- package/dist/module/coreum/dex/v1/order.d.ts +172 -0
- package/dist/module/coreum/dex/v1/order.js +1128 -0
- package/dist/module/coreum/dex/v1/params.d.ts +34 -0
- package/dist/module/coreum/dex/v1/params.js +136 -0
- package/dist/module/coreum/dex/v1/query.d.ts +133 -0
- package/dist/module/coreum/dex/v1/query.js +871 -0
- package/dist/module/coreum/dex/v1/tx.d.ts +102 -0
- package/dist/module/coreum/dex/v1/tx.js +519 -0
- package/dist/module/coreum/extensions/dex.d.ts +12 -0
- package/dist/module/coreum/extensions/dex.js +28 -0
- package/dist/module/coreum/feemodel/v1/genesis.d.ts +13 -13
- package/dist/module/coreum/feemodel/v1/genesis.js +22 -20
- package/dist/module/coreum/feemodel/v1/params.d.ts +14 -21
- package/dist/module/coreum/feemodel/v1/params.js +105 -54
- package/dist/module/coreum/feemodel/v1/query.d.ts +30 -37
- package/dist/module/coreum/feemodel/v1/query.js +191 -35
- package/dist/module/coreum/index.d.ts +46 -0
- package/dist/module/coreum/index.js +57 -0
- package/dist/module/coreum/nft/index.d.ts +1 -2
- package/dist/module/coreum/nft/v1beta1/event.d.ts +23 -27
- package/dist/module/coreum/nft/v1beta1/event.js +90 -58
- package/dist/module/coreum/nft/v1beta1/genesis.d.ts +13 -19
- package/dist/module/coreum/nft/v1beta1/genesis.js +44 -41
- package/dist/module/coreum/nft/v1beta1/nft.d.ts +15 -22
- package/dist/module/coreum/nft/v1beta1/nft.js +99 -64
- package/dist/module/coreum/nft/v1beta1/query.d.ts +54 -124
- package/dist/module/coreum/nft/v1beta1/query.js +231 -183
- package/dist/module/coreum/nft/v1beta1/tx.d.ts +13 -19
- package/dist/module/coreum/nft/v1beta1/tx.js +47 -32
- package/dist/module/cosmos/extensions/distribution.d.ts +4 -4
- package/dist/module/cosmos/extensions/gov.d.ts +13 -13
- package/dist/module/cosmos/index.d.ts +8 -8
- package/dist/module/google/api/http.d.ts +2636 -6
- package/dist/module/google/protobuf/any.d.ts +14 -2
- package/dist/module/google/protobuf/duration.d.ts +14 -2
- package/dist/module/google/protobuf/timestamp.d.ts +14 -2
- package/dist/module/services/cosmostation.js +1 -1
- package/dist/module/tendermint/abci/types.d.ts +6360 -92
- package/dist/module/tendermint/crypto/keys.d.ts +14 -2
- package/dist/module/tendermint/crypto/proof.d.ts +152 -10
- package/dist/module/tendermint/types/params.d.ts +196 -12
- package/dist/module/tendermint/types/types.d.ts +1744 -26
- package/dist/module/tendermint/types/validator.d.ts +230 -6
- package/dist/module/tendermint/version/types.d.ts +28 -4
- package/dist/module/types/core.d.ts +2 -1
- package/dist/module/types/core.js +2 -0
- package/dist/module/utils/convertStringToAny.d.ts +0 -1
- package/dist/module/wasm/v1/authz.d.ts +20 -75
- package/dist/module/wasm/v1/authz.js +111 -119
- package/dist/module/wasm/v1/genesis.d.ts +14 -34
- package/dist/module/wasm/v1/genesis.js +161 -125
- package/dist/module/wasm/v1/ibc.d.ts +13 -26
- package/dist/module/wasm/v1/ibc.js +83 -62
- package/dist/module/wasm/v1/index.d.ts +1 -2
- package/dist/module/wasm/v1/pagination.d.ts +40 -4
- package/dist/module/wasm/v1/proposal.d.ts +23 -106
- package/dist/module/wasm/v1/proposal.js +562 -377
- package/dist/module/wasm/v1/query.d.ts +35 -187
- package/dist/module/wasm/v1/query.js +330 -301
- package/dist/module/wasm/v1/tx.d.ts +37 -210
- package/dist/module/wasm/v1/tx.js +551 -404
- package/dist/module/wasm/v1/types.d.ts +19 -67
- package/dist/module/wasm/v1/types.js +196 -156
- package/package.json +11 -10
|
@@ -9,6 +9,7 @@ const v1_1 = require("../wasm/v1");
|
|
|
9
9
|
const ft_1 = require("../coreum/extensions/ft");
|
|
10
10
|
const nft_1 = require("../coreum/extensions/nft");
|
|
11
11
|
const nftbeta_1 = require("../coreum/extensions/nftbeta");
|
|
12
|
+
const dex_1 = require("../coreum/extensions/dex");
|
|
12
13
|
const services_1 = require("../services");
|
|
13
14
|
const coreum_2 = require("../types/coreum");
|
|
14
15
|
const query_1 = require("../coreum/feemodel/v1/query");
|
|
@@ -33,13 +34,13 @@ class Client {
|
|
|
33
34
|
constructor(props) {
|
|
34
35
|
this._eventSequence = 0;
|
|
35
36
|
console.log("Coreum JS => Test");
|
|
36
|
-
this.config =
|
|
37
|
+
this.config = props?.network
|
|
37
38
|
? coreum_2.COREUM_CONFIG[props.network]
|
|
38
39
|
: coreum_2.COREUM_CONFIG.mainnet;
|
|
39
|
-
this._tx_memo =
|
|
40
|
-
this._custom_ws_endpoint =
|
|
41
|
-
this._custom_node_endpoint =
|
|
42
|
-
if (
|
|
40
|
+
this._tx_memo = props?.tx_memo || undefined;
|
|
41
|
+
this._custom_ws_endpoint = props?.custom_ws_endpoint || undefined;
|
|
42
|
+
this._custom_node_endpoint = props?.custom_node_endpoint || undefined;
|
|
43
|
+
if (props?.custom_node_endpoint && !props.network)
|
|
43
44
|
throw new Error("If using a custom node, please specify the type of network.");
|
|
44
45
|
}
|
|
45
46
|
disconnect() {
|
|
@@ -95,7 +96,7 @@ class Client {
|
|
|
95
96
|
await this._createClient();
|
|
96
97
|
this._initQueryClient();
|
|
97
98
|
this._initFeeModel();
|
|
98
|
-
if (options
|
|
99
|
+
if (options?.withWS) {
|
|
99
100
|
await this._initWsClient(this._custom_ws_endpoint || this.config.chain_ws_endpoint);
|
|
100
101
|
}
|
|
101
102
|
}
|
|
@@ -108,7 +109,6 @@ class Client {
|
|
|
108
109
|
* If `withWS` is passed on the options object, a WS Connection will be created alongside the RPC client
|
|
109
110
|
*/
|
|
110
111
|
async connectWithExtension(extension = types_1.ExtensionWallets.KEPLR, options) {
|
|
111
|
-
var _a;
|
|
112
112
|
try {
|
|
113
113
|
switch (extension) {
|
|
114
114
|
case types_1.ExtensionWallets.COSMOSTATION:
|
|
@@ -123,7 +123,7 @@ class Client {
|
|
|
123
123
|
await this._initTendermintClient(this.config.chain_rpc_endpoint);
|
|
124
124
|
this._initQueryClient();
|
|
125
125
|
this._initFeeModel();
|
|
126
|
-
if (options
|
|
126
|
+
if (options?.withWS) {
|
|
127
127
|
await this._initWsClient(this.config.chain_ws_endpoint);
|
|
128
128
|
}
|
|
129
129
|
}
|
|
@@ -134,7 +134,7 @@ class Client {
|
|
|
134
134
|
if (e.error === "Extension not installed.") {
|
|
135
135
|
code = 4000;
|
|
136
136
|
}
|
|
137
|
-
if (["User rejected the request.", "Request rejected"].includes(
|
|
137
|
+
if (["User rejected the request.", "Request rejected"].includes(e.error?.message)) {
|
|
138
138
|
error = "Request rejected";
|
|
139
139
|
code = 4001;
|
|
140
140
|
}
|
|
@@ -160,7 +160,7 @@ class Client {
|
|
|
160
160
|
this._initQueryClient();
|
|
161
161
|
this._initFeeModel();
|
|
162
162
|
await this._createClient(offlineSigner);
|
|
163
|
-
if (options
|
|
163
|
+
if (options?.withWS) {
|
|
164
164
|
await this._initWsClient(this.config.chain_ws_endpoint);
|
|
165
165
|
}
|
|
166
166
|
}
|
|
@@ -200,7 +200,7 @@ class Client {
|
|
|
200
200
|
*/
|
|
201
201
|
async broadcastTx(transaction, options) {
|
|
202
202
|
try {
|
|
203
|
-
return await this._client.broadcastTx(transaction,
|
|
203
|
+
return await this._client.broadcastTx(transaction, options?.timeoutMs || undefined, options?.pollIntervalMs || undefined);
|
|
204
204
|
}
|
|
205
205
|
catch (e) {
|
|
206
206
|
throw {
|
|
@@ -342,18 +342,17 @@ class Client {
|
|
|
342
342
|
}
|
|
343
343
|
}
|
|
344
344
|
async _getGasPrice() {
|
|
345
|
-
var _a, _b, _c, _d;
|
|
346
345
|
const gasPriceMultiplier = 1.1;
|
|
347
346
|
// the param can be change via governance
|
|
348
347
|
const feemodelParams = await this._feeModel.Params({});
|
|
349
348
|
const minGasPriceRes = await this._feeModel.MinGasPrice({});
|
|
350
|
-
const minGasPrice = (0, stargate_1.decodeCosmosSdkDecFromProto)(
|
|
349
|
+
const minGasPrice = (0, stargate_1.decodeCosmosSdkDecFromProto)(minGasPriceRes.minGasPrice?.amount || "");
|
|
351
350
|
let gasPrice = minGasPrice.toFloatApproximation() * gasPriceMultiplier;
|
|
352
|
-
const initialGasPrice = (0, stargate_1.decodeCosmosSdkDecFromProto)(
|
|
351
|
+
const initialGasPrice = (0, stargate_1.decodeCosmosSdkDecFromProto)(feemodelParams.params?.model?.initialGasPrice || "").toFloatApproximation();
|
|
353
352
|
if (gasPrice > initialGasPrice) {
|
|
354
353
|
gasPrice = initialGasPrice;
|
|
355
354
|
}
|
|
356
|
-
return stargate_1.GasPrice.fromString(`${gasPrice}${
|
|
355
|
+
return stargate_1.GasPrice.fromString(`${gasPrice}${minGasPriceRes.minGasPrice?.denom || ""}`);
|
|
357
356
|
}
|
|
358
357
|
_isSigningClientInit() {
|
|
359
358
|
if (!this._client || !isSigningClient(this._client))
|
|
@@ -363,7 +362,7 @@ class Client {
|
|
|
363
362
|
this._tmClient = await tendermint_rpc_1.Tendermint37Client.connect(rpcEndpoint);
|
|
364
363
|
}
|
|
365
364
|
_initQueryClient() {
|
|
366
|
-
this._queryClient = stargate_1.QueryClient.withExtensions(this._tmClient, ft_1.setupFTExtension, nft_1.setupNFTExtension, nftbeta_1.setupNFTBetaExtension, stargate_1.setupStakingExtension, extensions_1.setupBankExtension, extensions_1.setupDistributionExtension, stargate_1.setupTxExtension, stargate_1.setupAuthExtension, stargate_1.setupMintExtension, stargate_1.setupFeegrantExtension, extensions_1.setupGovExtension, stargate_1.setupIbcExtension, cosmwasm_stargate_1.setupWasmExtension);
|
|
365
|
+
this._queryClient = stargate_1.QueryClient.withExtensions(this._tmClient, ft_1.setupFTExtension, nft_1.setupNFTExtension, nftbeta_1.setupNFTBetaExtension, stargate_1.setupStakingExtension, extensions_1.setupBankExtension, extensions_1.setupDistributionExtension, stargate_1.setupTxExtension, stargate_1.setupAuthExtension, stargate_1.setupMintExtension, stargate_1.setupFeegrantExtension, extensions_1.setupGovExtension, stargate_1.setupIbcExtension, cosmwasm_stargate_1.setupWasmExtension, dex_1.setupDexExtension);
|
|
367
366
|
}
|
|
368
367
|
_initFeeModel() {
|
|
369
368
|
const rpcClient = (0, stargate_1.createProtobufRpcClient)(this._queryClient);
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "cosmjs-types/binary";
|
|
2
|
+
import { Coin } from "cosmjs-types/cosmos/base/v1beta1/coin";
|
|
3
|
+
export declare const protobufPackage = "coreum.asset.ft.v1";
|
|
4
|
+
/**
|
|
5
|
+
* MintAuthorization allows the grantee to mint up to mint_limit coin from
|
|
6
|
+
* the granter's account.
|
|
7
|
+
*/
|
|
8
|
+
export interface MintAuthorization {
|
|
9
|
+
mintLimit: Coin[];
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* BurnAuthorization allows the grantee to burn up to burn_limit coin from
|
|
13
|
+
* the granter's account.
|
|
14
|
+
*/
|
|
15
|
+
export interface BurnAuthorization {
|
|
16
|
+
burnLimit: Coin[];
|
|
17
|
+
}
|
|
18
|
+
export declare const MintAuthorization: MessageFns<MintAuthorization>;
|
|
19
|
+
export declare const BurnAuthorization: MessageFns<BurnAuthorization>;
|
|
20
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
21
|
+
export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|
|
22
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
23
|
+
} : Partial<T>;
|
|
24
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
25
|
+
export type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
26
|
+
[K in keyof P]: Exact<P[K], I[K]>;
|
|
27
|
+
} & {
|
|
28
|
+
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
29
|
+
};
|
|
30
|
+
export interface MessageFns<T> {
|
|
31
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
32
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
33
|
+
fromJSON(object: any): T;
|
|
34
|
+
toJSON(message: T): unknown;
|
|
35
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
36
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
37
|
+
}
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.7.0
|
|
5
|
+
// protoc v3.21.12
|
|
6
|
+
// source: coreum-protos/ft/authz.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.BurnAuthorization = exports.MintAuthorization = exports.protobufPackage = void 0;
|
|
9
|
+
/* eslint-disable */
|
|
10
|
+
const binary_1 = require("cosmjs-types/binary");
|
|
11
|
+
const coin_1 = require("cosmjs-types/cosmos/base/v1beta1/coin");
|
|
12
|
+
exports.protobufPackage = "coreum.asset.ft.v1";
|
|
13
|
+
function createBaseMintAuthorization() {
|
|
14
|
+
return { mintLimit: [] };
|
|
15
|
+
}
|
|
16
|
+
exports.MintAuthorization = {
|
|
17
|
+
encode(message, writer = new binary_1.BinaryWriter()) {
|
|
18
|
+
for (const v of message.mintLimit) {
|
|
19
|
+
coin_1.Coin.encode(v, writer.uint32(10).fork()).ldelim();
|
|
20
|
+
}
|
|
21
|
+
return writer;
|
|
22
|
+
},
|
|
23
|
+
decode(input, length) {
|
|
24
|
+
const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
|
|
25
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
26
|
+
const message = createBaseMintAuthorization();
|
|
27
|
+
while (reader.pos < end) {
|
|
28
|
+
const tag = reader.uint32();
|
|
29
|
+
switch (tag >>> 3) {
|
|
30
|
+
case 1: {
|
|
31
|
+
if (tag !== 10) {
|
|
32
|
+
break;
|
|
33
|
+
}
|
|
34
|
+
message.mintLimit.push(coin_1.Coin.decode(reader, reader.uint32()));
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
reader.skip(tag & 7);
|
|
42
|
+
}
|
|
43
|
+
return message;
|
|
44
|
+
},
|
|
45
|
+
fromJSON(object) {
|
|
46
|
+
return {
|
|
47
|
+
mintLimit: globalThis.Array.isArray(object?.mintLimit)
|
|
48
|
+
? object.mintLimit.map((e) => coin_1.Coin.fromJSON(e))
|
|
49
|
+
: [],
|
|
50
|
+
};
|
|
51
|
+
},
|
|
52
|
+
toJSON(message) {
|
|
53
|
+
const obj = {};
|
|
54
|
+
if (message.mintLimit?.length) {
|
|
55
|
+
obj.mintLimit = message.mintLimit.map((e) => coin_1.Coin.toJSON(e));
|
|
56
|
+
}
|
|
57
|
+
return obj;
|
|
58
|
+
},
|
|
59
|
+
create(base) {
|
|
60
|
+
return exports.MintAuthorization.fromPartial(base ?? {});
|
|
61
|
+
},
|
|
62
|
+
fromPartial(object) {
|
|
63
|
+
const message = createBaseMintAuthorization();
|
|
64
|
+
message.mintLimit = object.mintLimit?.map((e) => coin_1.Coin.fromPartial(e)) || [];
|
|
65
|
+
return message;
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
function createBaseBurnAuthorization() {
|
|
69
|
+
return { burnLimit: [] };
|
|
70
|
+
}
|
|
71
|
+
exports.BurnAuthorization = {
|
|
72
|
+
encode(message, writer = new binary_1.BinaryWriter()) {
|
|
73
|
+
for (const v of message.burnLimit) {
|
|
74
|
+
coin_1.Coin.encode(v, writer.uint32(10).fork()).ldelim();
|
|
75
|
+
}
|
|
76
|
+
return writer;
|
|
77
|
+
},
|
|
78
|
+
decode(input, length) {
|
|
79
|
+
const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
|
|
80
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
81
|
+
const message = createBaseBurnAuthorization();
|
|
82
|
+
while (reader.pos < end) {
|
|
83
|
+
const tag = reader.uint32();
|
|
84
|
+
switch (tag >>> 3) {
|
|
85
|
+
case 1: {
|
|
86
|
+
if (tag !== 10) {
|
|
87
|
+
break;
|
|
88
|
+
}
|
|
89
|
+
message.burnLimit.push(coin_1.Coin.decode(reader, reader.uint32()));
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
94
|
+
break;
|
|
95
|
+
}
|
|
96
|
+
reader.skip(tag & 7);
|
|
97
|
+
}
|
|
98
|
+
return message;
|
|
99
|
+
},
|
|
100
|
+
fromJSON(object) {
|
|
101
|
+
return {
|
|
102
|
+
burnLimit: globalThis.Array.isArray(object?.burnLimit)
|
|
103
|
+
? object.burnLimit.map((e) => coin_1.Coin.fromJSON(e))
|
|
104
|
+
: [],
|
|
105
|
+
};
|
|
106
|
+
},
|
|
107
|
+
toJSON(message) {
|
|
108
|
+
const obj = {};
|
|
109
|
+
if (message.burnLimit?.length) {
|
|
110
|
+
obj.burnLimit = message.burnLimit.map((e) => coin_1.Coin.toJSON(e));
|
|
111
|
+
}
|
|
112
|
+
return obj;
|
|
113
|
+
},
|
|
114
|
+
create(base) {
|
|
115
|
+
return exports.BurnAuthorization.fromPartial(base ?? {});
|
|
116
|
+
},
|
|
117
|
+
fromPartial(object) {
|
|
118
|
+
const message = createBaseBurnAuthorization();
|
|
119
|
+
message.burnLimit = object.burnLimit?.map((e) => coin_1.Coin.fromPartial(e)) || [];
|
|
120
|
+
return message;
|
|
121
|
+
},
|
|
122
|
+
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { Feature } from "./token";
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "cosmjs-types/binary";
|
|
2
|
+
import { DEXSettings, Feature } from "./token";
|
|
4
3
|
export declare const protobufPackage = "coreum.asset.ft.v1";
|
|
5
4
|
/** EventIssued is emitted on MsgIssue. */
|
|
6
5
|
export interface EventIssued {
|
|
@@ -16,6 +15,8 @@ export interface EventIssued {
|
|
|
16
15
|
sendCommissionRate: string;
|
|
17
16
|
uri: string;
|
|
18
17
|
uriHash: string;
|
|
18
|
+
admin: string;
|
|
19
|
+
dexSettings: DEXSettings | undefined;
|
|
19
20
|
}
|
|
20
21
|
export interface EventFrozenAmountChanged {
|
|
21
22
|
account: string;
|
|
@@ -23,38 +24,53 @@ export interface EventFrozenAmountChanged {
|
|
|
23
24
|
previousAmount: string;
|
|
24
25
|
currentAmount: string;
|
|
25
26
|
}
|
|
27
|
+
export interface EventAmountClawedBack {
|
|
28
|
+
account: string;
|
|
29
|
+
denom: string;
|
|
30
|
+
amount: string;
|
|
31
|
+
}
|
|
26
32
|
export interface EventWhitelistedAmountChanged {
|
|
27
33
|
account: string;
|
|
28
34
|
denom: string;
|
|
29
35
|
previousAmount: string;
|
|
30
36
|
currentAmount: string;
|
|
31
37
|
}
|
|
32
|
-
export
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
38
|
+
export interface EventDEXLockedAmountChanged {
|
|
39
|
+
account: string;
|
|
40
|
+
denom: string;
|
|
41
|
+
previousAmount: string;
|
|
42
|
+
currentAmount: string;
|
|
43
|
+
}
|
|
44
|
+
export interface EventDEXExpectedToReceiveAmountChanged {
|
|
45
|
+
account: string;
|
|
46
|
+
denom: string;
|
|
47
|
+
previousAmount: string;
|
|
48
|
+
currentAmount: string;
|
|
49
|
+
}
|
|
50
|
+
export interface EventAdminTransferred {
|
|
51
|
+
denom: string;
|
|
52
|
+
previousAdmin: string;
|
|
53
|
+
currentAdmin: string;
|
|
54
|
+
}
|
|
55
|
+
export interface EventAdminCleared {
|
|
56
|
+
denom: string;
|
|
57
|
+
previousAdmin: string;
|
|
58
|
+
}
|
|
59
|
+
export interface EventDEXSettingsChanged {
|
|
60
|
+
previousSettings: DEXSettings | undefined;
|
|
61
|
+
newSettings: DEXSettings | undefined;
|
|
62
|
+
}
|
|
63
|
+
export declare const EventIssued: MessageFns<EventIssued>;
|
|
64
|
+
export declare const EventFrozenAmountChanged: MessageFns<EventFrozenAmountChanged>;
|
|
65
|
+
export declare const EventAmountClawedBack: MessageFns<EventAmountClawedBack>;
|
|
66
|
+
export declare const EventWhitelistedAmountChanged: MessageFns<EventWhitelistedAmountChanged>;
|
|
67
|
+
export declare const EventDEXLockedAmountChanged: MessageFns<EventDEXLockedAmountChanged>;
|
|
68
|
+
export declare const EventDEXExpectedToReceiveAmountChanged: MessageFns<EventDEXExpectedToReceiveAmountChanged>;
|
|
69
|
+
export declare const EventAdminTransferred: MessageFns<EventAdminTransferred>;
|
|
70
|
+
export declare const EventAdminCleared: MessageFns<EventAdminCleared>;
|
|
71
|
+
export declare const EventDEXSettingsChanged: MessageFns<EventDEXSettingsChanged>;
|
|
56
72
|
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
57
|
-
export type DeepPartial<T> = T extends Builtin ? T : T extends
|
|
73
|
+
export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|
|
58
74
|
[K in keyof T]?: DeepPartial<T[K]>;
|
|
59
75
|
} : Partial<T>;
|
|
60
76
|
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
@@ -63,4 +79,12 @@ export type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
|
63
79
|
} & {
|
|
64
80
|
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
65
81
|
};
|
|
82
|
+
export interface MessageFns<T> {
|
|
83
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
84
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
85
|
+
fromJSON(object: any): T;
|
|
86
|
+
toJSON(message: T): unknown;
|
|
87
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
88
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
89
|
+
}
|
|
66
90
|
export {};
|