@firmachain/firma-js 0.3.3 → 0.3.5
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/index.js +5 -1
- package/dist/sdk/FirmaAuthzService.d.ts +8 -7
- package/dist/sdk/FirmaAuthzService.js +12 -22
- package/dist/sdk/FirmaBankService.js +2 -2
- package/dist/sdk/FirmaChainService.js +1 -1
- package/dist/sdk/FirmaContractService.d.ts +1 -1
- package/dist/sdk/FirmaContractService.js +6 -6
- package/dist/sdk/FirmaCosmWasmCw20.d.ts +2 -2
- package/dist/sdk/FirmaCosmWasmCw20.js +8 -8
- package/dist/sdk/FirmaCosmWasmCw721.d.ts +2 -2
- package/dist/sdk/FirmaCosmWasmCw721.js +12 -12
- package/dist/sdk/FirmaCosmWasmCwBridge.d.ts +1 -1
- package/dist/sdk/FirmaCosmWasmCwBridge.js +8 -8
- package/dist/sdk/FirmaCosmWasmCwMarketplace.d.ts +1 -1
- package/dist/sdk/FirmaCosmWasmCwMarketplace.js +5 -5
- package/dist/sdk/FirmaCosmWasmService.d.ts +1 -1
- package/dist/sdk/FirmaCosmWasmService.js +13 -13
- package/dist/sdk/FirmaDistributionService.d.ts +1 -1
- package/dist/sdk/FirmaDistributionService.js +6 -6
- package/dist/sdk/FirmaFeeGrantService.d.ts +7 -6
- package/dist/sdk/FirmaFeeGrantService.js +9 -26
- package/dist/sdk/FirmaGovService.d.ts +1 -1
- package/dist/sdk/FirmaGovService.js +14 -14
- package/dist/sdk/FirmaIbcService.d.ts +3 -3
- package/dist/sdk/FirmaIbcService.js +11 -8
- package/dist/sdk/FirmaIpfsService.js +1 -1
- package/dist/sdk/FirmaMintService.js +1 -1
- package/dist/sdk/FirmaNftService.d.ts +1 -1
- package/dist/sdk/FirmaNftService.js +6 -6
- package/dist/sdk/FirmaSlashingService.js +1 -1
- package/dist/sdk/FirmaStakingService.d.ts +3 -3
- package/dist/sdk/FirmaStakingService.js +6 -6
- package/dist/sdk/FirmaTokenService.d.ts +1 -1
- package/dist/sdk/FirmaTokenService.js +5 -5
- package/dist/sdk/FirmaUtil.d.ts +25 -24
- package/dist/sdk/FirmaUtil.js +200 -145
- package/dist/sdk/FirmaWalletService.d.ts +6 -7
- package/dist/sdk/FirmaWalletService.js +78 -36
- package/dist/sdk/firmachain/authz/AuthzQueryClient.js +4 -4
- package/dist/sdk/firmachain/authz/AuthzTxTypes.d.ts +8 -11
- package/dist/sdk/firmachain/authz/AuthzTxTypes.js +6 -10
- package/dist/sdk/firmachain/authz/index.js +5 -1
- package/dist/sdk/firmachain/bank/BankQueryClient.js +5 -5
- package/dist/sdk/firmachain/bank/index.js +5 -1
- package/dist/sdk/firmachain/common/ITxClient.d.ts +2 -4
- package/dist/sdk/firmachain/common/ITxClient.js +20 -92
- package/dist/sdk/firmachain/common/LedgerWallet.d.ts +19 -3
- package/dist/sdk/firmachain/common/LedgerWallet.js +138 -68
- package/dist/sdk/firmachain/common/TendermintQueryClient.js +1 -1
- package/dist/sdk/firmachain/common/TxCommon.d.ts +13 -29
- package/dist/sdk/firmachain/common/accounts.d.ts +1 -1
- package/dist/sdk/firmachain/common/accounts.js +7 -7
- package/dist/sdk/firmachain/{amino → common}/coins.d.ts +2 -14
- package/dist/sdk/firmachain/{amino → common}/coins.js +4 -25
- package/dist/sdk/firmachain/common/index.d.ts +0 -1
- package/dist/sdk/firmachain/common/index.js +5 -4
- package/dist/sdk/firmachain/{amino → common}/wallet.js +15 -11
- package/dist/sdk/firmachain/contract/ContractQueryClient.js +3 -3
- package/dist/sdk/firmachain/contract/ContractTxTypes.d.ts +6 -6
- package/dist/sdk/firmachain/contract/index.js +5 -1
- package/dist/sdk/firmachain/cosmwasm/CosmWasmQueryClient.js +9 -9
- package/dist/sdk/firmachain/cosmwasm/index.js +5 -1
- package/dist/sdk/firmachain/distribution/DistributionQueryClient.js +6 -6
- package/dist/sdk/firmachain/distribution/index.js +5 -1
- package/dist/sdk/firmachain/feegrant/FeeGrantQueryClient.js +3 -3
- package/dist/sdk/firmachain/feegrant/FeeGrantTxTypes.d.ts +4 -45
- package/dist/sdk/firmachain/feegrant/FeeGrantTxTypes.js +3 -82
- package/dist/sdk/firmachain/feegrant/index.js +5 -1
- package/dist/sdk/firmachain/google/protobuf/any.d.ts +3 -3
- package/dist/sdk/firmachain/google/protobuf/descriptor.d.ts +29 -29
- package/dist/sdk/firmachain/google/protobuf/duration.d.ts +3 -3
- package/dist/sdk/firmachain/gov/GovQueryClient.js +3 -3
- package/dist/sdk/firmachain/gov/index.js +5 -1
- package/dist/sdk/firmachain/ibc/IbcQueryClient.js +2 -2
- package/dist/sdk/firmachain/ibc/index.js +5 -1
- package/dist/sdk/firmachain/mint/MintQueryClient.js +1 -1
- package/dist/sdk/firmachain/mint/index.js +5 -1
- package/dist/sdk/firmachain/nft/NftQueryClient.js +1 -1
- package/dist/sdk/firmachain/nft/NftTxTypes.d.ts +8 -8
- package/dist/sdk/firmachain/nft/index.js +5 -1
- package/dist/sdk/firmachain/slashing/SlashingQueryClient.js +1 -1
- package/dist/sdk/firmachain/slashing/index.js +5 -1
- package/dist/sdk/firmachain/staking/StakingQueryClient.d.ts +2 -2
- package/dist/sdk/firmachain/staking/StakingQueryClient.js +10 -9
- package/dist/sdk/firmachain/staking/index.js +5 -1
- package/dist/sdk/firmachain/token/TokenQueryClient.js +1 -1
- package/dist/sdk/firmachain/token/TokenTxTypes.d.ts +11 -11
- package/dist/sdk/firmachain/token/TokenTxTypes.js +1 -1
- package/dist/sdk/firmachain/token/index.js +5 -1
- package/dist/test/00.wallet.test.js +4 -4
- package/dist/test/01.contract_tx.test.js +5 -5
- package/dist/test/02.contract_query.test.js +15 -15
- package/dist/test/03.contract_scenario.test.js +28 -28
- package/dist/test/04.bank_tx.test.js +4 -4
- package/dist/test/05.bank_query.test.js +9 -9
- package/dist/test/06.feegrant_tx.test.js +59 -35
- package/dist/test/07.feegrant_query.test.js +18 -15
- package/dist/test/08.gas_estimate.test.js +110 -70
- package/dist/test/09.ipfs.test.js +4 -4
- package/dist/test/10.nft_tx.test.js +7 -7
- package/dist/test/11.nft_query.test.js +9 -9
- package/dist/test/12.staking_tx.test.js +27 -15
- package/dist/test/13.staking_query.test.js +20 -20
- package/dist/test/14.distribution_tx.test.js +8 -8
- package/dist/test/15.distribution_query.test.js +15 -15
- package/dist/test/16.gov_tx.test.js +17 -17
- package/dist/test/17.gov_query.test.js +19 -19
- package/dist/test/18.util.test.js +105 -63
- package/dist/test/19.chain.test.js +38 -38
- package/dist/test/20.slashing_query.test.js +25 -25
- package/dist/test/21.token_tx.test.js +6 -6
- package/dist/test/22.token_query.test.js +4 -4
- package/dist/test/23.authz_tx.test.js +77 -47
- package/dist/test/24.authz_query.test.js +66 -67
- package/dist/test/25.cosmwasm_tx.test.js +7 -7
- package/dist/test/26.cosmwasm_query.test.js +127 -59
- package/dist/test/{27.arbitary_sign.test.js → 27.arbitrary_sign.test.js} +34 -62
- package/dist/test/28.ibc_tx.test.js +8 -8
- package/dist/test/29.mint_query.test.js +2 -2
- package/dist/test/30.cw20_tx.test.js +20 -20
- package/dist/test/31.cw20_query.test.js +24 -24
- package/dist/test/32.cw721_tx.test.js +19 -19
- package/dist/test/33.cw721_query.test.js +32 -32
- package/dist/test/34.cw_bridge_tx.test.js +19 -19
- package/dist/test/35.cw_bridge_tx_low.test.js +13 -13
- package/dist/test/36.cw_bridge_query.test.js +20 -20
- package/dist/test/37.cw_marketplace_tx.test.js +32 -32
- package/dist/test/38.cw_marketplace_query.test.js +2 -2
- package/dist/test/config_test.d.ts +1 -1
- package/dist/test/config_test.js +2 -2
- package/package.json +9 -10
- package/dist/sdk/firmachain/amino/addresses.d.ts +0 -5
- package/dist/sdk/firmachain/amino/addresses.js +0 -46
- package/dist/sdk/firmachain/amino/aminomsgs.d.ts +0 -291
- package/dist/sdk/firmachain/amino/aminomsgs.js +0 -81
- package/dist/sdk/firmachain/amino/aminotypes.d.ts +0 -22
- package/dist/sdk/firmachain/amino/aminotypes.js +0 -538
- package/dist/sdk/firmachain/amino/encoding.d.ts +0 -33
- package/dist/sdk/firmachain/amino/encoding.js +0 -252
- package/dist/sdk/firmachain/amino/multisig.d.ts +0 -10
- package/dist/sdk/firmachain/amino/multisig.js +0 -42
- package/dist/sdk/firmachain/amino/pubkeys.d.ts +0 -47
- package/dist/sdk/firmachain/amino/pubkeys.js +0 -29
- package/dist/sdk/firmachain/amino/signature.d.ts +0 -16
- package/dist/sdk/firmachain/amino/signature.js +0 -36
- package/dist/sdk/firmachain/amino/signdoc.d.ts +0 -44
- package/dist/sdk/firmachain/amino/signdoc.js +0 -68
- package/dist/sdk/firmachain/amino/signer.d.ts +0 -33
- package/dist/sdk/firmachain/amino/signer.js +0 -2
- package/dist/sdk/firmachain/amino/stdtx.d.ts +0 -15
- package/dist/sdk/firmachain/amino/stdtx.js +0 -17
- package/dist/sdk/firmachain/common/LedgerSigningStargateClient.d.ts +0 -22
- package/dist/sdk/firmachain/common/LedgerSigningStargateClient.js +0 -170
- package/dist/sdk/firmachain/common/aminotypes.d.ts +0 -19
- package/dist/sdk/firmachain/common/aminotypes.js +0 -74
- package/dist/sdk/firmachain/common/events.d.ts +0 -32
- package/dist/sdk/firmachain/common/events.js +0 -18
- package/dist/sdk/firmachain/common/fee.d.ts +0 -26
- package/dist/sdk/firmachain/common/fee.js +0 -83
- package/dist/sdk/firmachain/common/modules/auth/queries.d.ts +0 -15
- package/dist/sdk/firmachain/common/modules/auth/queries.js +0 -64
- package/dist/sdk/firmachain/common/modules/authz/aminomessages.d.ts +0 -2
- package/dist/sdk/firmachain/common/modules/authz/aminomessages.js +0 -15
- package/dist/sdk/firmachain/common/modules/authz/messages.d.ts +0 -2
- package/dist/sdk/firmachain/common/modules/authz/messages.js +0 -9
- package/dist/sdk/firmachain/common/modules/authz/queries.d.ts +0 -10
- package/dist/sdk/firmachain/common/modules/authz/queries.js +0 -88
- package/dist/sdk/firmachain/common/modules/bank/aminomessages.d.ts +0 -35
- package/dist/sdk/firmachain/common/modules/bank/aminomessages.js +0 -85
- package/dist/sdk/firmachain/common/modules/bank/messages.d.ts +0 -8
- package/dist/sdk/firmachain/common/modules/bank/messages.js +0 -12
- package/dist/sdk/firmachain/common/modules/bank/queries.d.ts +0 -15
- package/dist/sdk/firmachain/common/modules/bank/queries.js +0 -128
- package/dist/sdk/firmachain/common/modules/crisis/aminomessages.d.ts +0 -14
- package/dist/sdk/firmachain/common/modules/crisis/aminomessages.js +0 -11
- package/dist/sdk/firmachain/common/modules/distribution/aminomessages.d.ts +0 -44
- package/dist/sdk/firmachain/common/modules/distribution/aminomessages.js +0 -113
- package/dist/sdk/firmachain/common/modules/distribution/messages.d.ts +0 -8
- package/dist/sdk/firmachain/common/modules/distribution/messages.js +0 -15
- package/dist/sdk/firmachain/common/modules/distribution/queries.d.ts +0 -16
- package/dist/sdk/firmachain/common/modules/distribution/queries.js +0 -171
- package/dist/sdk/firmachain/common/modules/evidence/aminomessages.d.ts +0 -18
- package/dist/sdk/firmachain/common/modules/evidence/aminomessages.js +0 -11
- package/dist/sdk/firmachain/common/modules/feegrant/aminomessages.d.ts +0 -2
- package/dist/sdk/firmachain/common/modules/feegrant/aminomessages.js +0 -14
- package/dist/sdk/firmachain/common/modules/feegrant/messages.d.ts +0 -2
- package/dist/sdk/firmachain/common/modules/feegrant/messages.js +0 -8
- package/dist/sdk/firmachain/common/modules/feegrant/queries.d.ts +0 -9
- package/dist/sdk/firmachain/common/modules/feegrant/queries.js +0 -81
- package/dist/sdk/firmachain/common/modules/gov/aminomessages.d.ts +0 -79
- package/dist/sdk/firmachain/common/modules/gov/aminomessages.js +0 -152
- package/dist/sdk/firmachain/common/modules/gov/messages.d.ts +0 -29
- package/dist/sdk/firmachain/common/modules/gov/messages.js +0 -39
- package/dist/sdk/firmachain/common/modules/gov/queries.d.ts +0 -19
- package/dist/sdk/firmachain/common/modules/gov/queries.js +0 -160
- package/dist/sdk/firmachain/common/modules/group/aminomessages.d.ts +0 -2
- package/dist/sdk/firmachain/common/modules/group/aminomessages.js +0 -8
- package/dist/sdk/firmachain/common/modules/group/messages.d.ts +0 -2
- package/dist/sdk/firmachain/common/modules/group/messages.js +0 -28
- package/dist/sdk/firmachain/common/modules/ibc/aminomessages.d.ts +0 -38
- package/dist/sdk/firmachain/common/modules/ibc/aminomessages.js +0 -55
- package/dist/sdk/firmachain/common/modules/ibc/messages.d.ts +0 -8
- package/dist/sdk/firmachain/common/modules/ibc/messages.js +0 -32
- package/dist/sdk/firmachain/common/modules/ibc/queries.d.ts +0 -58
- package/dist/sdk/firmachain/common/modules/ibc/queries.js +0 -576
- package/dist/sdk/firmachain/common/modules/index.d.ts +0 -32
- package/dist/sdk/firmachain/common/modules/index.js +0 -101
- package/dist/sdk/firmachain/common/modules/mint/queries.d.ts +0 -21
- package/dist/sdk/firmachain/common/modules/mint/queries.js +0 -95
- package/dist/sdk/firmachain/common/modules/slashing/aminomessages.d.ts +0 -12
- package/dist/sdk/firmachain/common/modules/slashing/aminomessages.js +0 -11
- package/dist/sdk/firmachain/common/modules/slashing/queries.d.ts +0 -10
- package/dist/sdk/firmachain/common/modules/slashing/queries.js +0 -88
- package/dist/sdk/firmachain/common/modules/staking/aminomessages.d.ts +0 -112
- package/dist/sdk/firmachain/common/modules/staking/aminomessages.js +0 -234
- package/dist/sdk/firmachain/common/modules/staking/messages.d.ts +0 -33
- package/dist/sdk/firmachain/common/modules/staking/messages.js +0 -37
- package/dist/sdk/firmachain/common/modules/staking/queries.d.ts +0 -23
- package/dist/sdk/firmachain/common/modules/staking/queries.js +0 -242
- package/dist/sdk/firmachain/common/modules/tx/queries.d.ts +0 -11
- package/dist/sdk/firmachain/common/modules/tx/queries.js +0 -103
- package/dist/sdk/firmachain/common/modules/vesting/aminomessages.d.ts +0 -16
- package/dist/sdk/firmachain/common/modules/vesting/aminomessages.js +0 -56
- package/dist/sdk/firmachain/common/modules/vesting/messages.d.ts +0 -2
- package/dist/sdk/firmachain/common/modules/vesting/messages.js +0 -7
- package/dist/sdk/firmachain/common/queryclient/index.d.ts +0 -2
- package/dist/sdk/firmachain/common/queryclient/index.js +0 -10
- package/dist/sdk/firmachain/common/queryclient/queryclient.d.ts +0 -75
- package/dist/sdk/firmachain/common/queryclient/queryclient.js +0 -157
- package/dist/sdk/firmachain/common/queryclient/utils.d.ts +0 -33
- package/dist/sdk/firmachain/common/queryclient/utils.js +0 -101
- package/dist/sdk/firmachain/common/search.d.ts +0 -10
- package/dist/sdk/firmachain/common/search.js +0 -7
- package/dist/sdk/firmachain/common/signing.d.ts +0 -15
- package/dist/sdk/firmachain/common/signing.js +0 -87
- package/dist/sdk/firmachain/common/signingstargateclient.d.ts +0 -121
- package/dist/sdk/firmachain/common/signingstargateclient.js +0 -674
- package/dist/sdk/firmachain/common/stargateclient.d.ts +0 -210
- package/dist/sdk/firmachain/common/stargateclient.js +0 -527
- package/dist/sdk/firmachain/google/protobuf/timestamp.d.ts +0 -110
- package/dist/sdk/firmachain/google/protobuf/timestamp.js +0 -108
- /package/dist/sdk/firmachain/{amino → common}/paths.d.ts +0 -0
- /package/dist/sdk/firmachain/{amino → common}/paths.js +0 -0
- /package/dist/sdk/firmachain/{amino → common}/wallet.d.ts +0 -0
- /package/dist/test/{27.arbitary_sign.test.d.ts → 27.arbitrary_sign.test.d.ts} +0 -0
|
@@ -2,8 +2,8 @@ import { NftItemType, Pagination, TxMisc } from "./firmachain/nft";
|
|
|
2
2
|
import { FirmaConfig } from "./FirmaConfig";
|
|
3
3
|
import { FirmaWalletService } from "./FirmaWalletService";
|
|
4
4
|
import { TxRaw } from "cosmjs-types/cosmos/tx/v1beta1/tx";
|
|
5
|
-
import { DeliverTxResponse } from "./firmachain/common/stargateclient";
|
|
6
5
|
import { EncodeObject } from "@cosmjs/proto-signing";
|
|
6
|
+
import { DeliverTxResponse } from "@cosmjs/stargate";
|
|
7
7
|
export declare class NftService {
|
|
8
8
|
private readonly config;
|
|
9
9
|
constructor(config: FirmaConfig);
|
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
|
@@ -215,7 +215,7 @@ var NftService = /** @class */ (function () {
|
|
|
215
215
|
case 1:
|
|
216
216
|
message = _a.sent();
|
|
217
217
|
nftTxClient = new nft_1.NftTxClient(wallet, this.config.rpcAddress);
|
|
218
|
-
return [4 /*yield*/, nftTxClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
218
|
+
return [4 /*yield*/, nftTxClient.sign([message], (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc))];
|
|
219
219
|
case 2: return [2 /*return*/, _a.sent()];
|
|
220
220
|
case 3:
|
|
221
221
|
error_8 = _a.sent();
|
|
@@ -304,7 +304,7 @@ var NftService = /** @class */ (function () {
|
|
|
304
304
|
case 1:
|
|
305
305
|
message = _a.sent();
|
|
306
306
|
nftTxClient = new nft_1.NftTxClient(wallet, this.config.rpcAddress);
|
|
307
|
-
return [4 /*yield*/, nftTxClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
307
|
+
return [4 /*yield*/, nftTxClient.sign([message], (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc))];
|
|
308
308
|
case 2: return [2 /*return*/, _a.sent()];
|
|
309
309
|
case 3:
|
|
310
310
|
error_12 = _a.sent();
|
|
@@ -347,7 +347,7 @@ var NftService = /** @class */ (function () {
|
|
|
347
347
|
case 0:
|
|
348
348
|
_a.trys.push([0, 3, , 4]);
|
|
349
349
|
nftTxClient = new nft_1.NftTxClient(wallet, this.config.rpcAddress);
|
|
350
|
-
return [4 /*yield*/, nftTxClient.sign(msgList, FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
350
|
+
return [4 /*yield*/, nftTxClient.sign(msgList, (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc))];
|
|
351
351
|
case 1:
|
|
352
352
|
txRaw = _a.sent();
|
|
353
353
|
return [4 /*yield*/, FirmaUtil_1.FirmaUtil.estimateGas(txRaw)];
|
|
@@ -395,7 +395,7 @@ var NftService = /** @class */ (function () {
|
|
|
395
395
|
case 1:
|
|
396
396
|
message = _a.sent();
|
|
397
397
|
nftTxClient = new nft_1.NftTxClient(wallet, this.config.rpcAddress);
|
|
398
|
-
return [4 /*yield*/, nftTxClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
398
|
+
return [4 /*yield*/, nftTxClient.sign([message], (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc))];
|
|
399
399
|
case 2: return [2 /*return*/, _a.sent()];
|
|
400
400
|
case 3:
|
|
401
401
|
error_16 = _a.sent();
|
|
@@ -459,7 +459,7 @@ var NftService = /** @class */ (function () {
|
|
|
459
459
|
case 0:
|
|
460
460
|
_a.trys.push([0, 2, , 3]);
|
|
461
461
|
contractTxClient = new nft_1.NftTxClient(wallet, this.config.rpcAddress);
|
|
462
|
-
return [4 /*yield*/, contractTxClient.signAndBroadcast(msgList, FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
462
|
+
return [4 /*yield*/, contractTxClient.signAndBroadcast(msgList, (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc))];
|
|
463
463
|
case 1: return [2 /*return*/, _a.sent()];
|
|
464
464
|
case 2:
|
|
465
465
|
error_19 = _a.sent();
|
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { StakingTxClient, TxMisc, ValidatorDataType, PoolDataType, DelegationInfo, RedelegationInfo, UndelegationInfo, Pagination
|
|
1
|
+
import { StakingTxClient, TxMisc, ValidatorDataType, PoolDataType, ParamsDataType, DelegationInfo, RedelegationInfo, UndelegationInfo, Pagination } from "./firmachain/staking";
|
|
2
2
|
import { FirmaWalletService } from "./FirmaWalletService";
|
|
3
3
|
import { FirmaConfig } from "./FirmaConfig";
|
|
4
|
-
import { DeliverTxResponse } from "./firmachain/common/stargateclient";
|
|
5
4
|
import { Description } from "cosmjs-types/cosmos/staking/v1beta1/staking";
|
|
6
5
|
import { MsgCreateValidator } from "cosmjs-types/cosmos/staking/v1beta1/tx";
|
|
6
|
+
import { DeliverTxResponse } from "@cosmjs/stargate";
|
|
7
7
|
import { Params as StakingParams } from "@kintsugi-tech/cosmjs-types/cosmos/staking/v1beta1/staking";
|
|
8
8
|
export declare enum StakingValidatorStatus {
|
|
9
9
|
ALL = "",
|
|
@@ -44,7 +44,7 @@ export declare class FirmaStakingService {
|
|
|
44
44
|
dataList: DelegationInfo[];
|
|
45
45
|
pagination: Pagination;
|
|
46
46
|
}>;
|
|
47
|
-
getParams(): Promise<
|
|
47
|
+
getParams(): Promise<ParamsDataType>;
|
|
48
48
|
getParamsAsStakingParams(): Promise<StakingParams>;
|
|
49
49
|
getPool(): Promise<PoolDataType>;
|
|
50
50
|
getValidator(valoperAddress: string): Promise<ValidatorDataType>;
|
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
|
@@ -137,7 +137,7 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
137
137
|
validatorAddress: validatorAddres,
|
|
138
138
|
amount: sendAmount
|
|
139
139
|
});
|
|
140
|
-
return [4 /*yield*/, txClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
140
|
+
return [4 /*yield*/, txClient.sign([message], (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc))];
|
|
141
141
|
case 2: return [2 /*return*/, _a.sent()];
|
|
142
142
|
case 3:
|
|
143
143
|
error_4 = _a.sent();
|
|
@@ -166,7 +166,7 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
166
166
|
validatorAddress: validatorAddres,
|
|
167
167
|
amount: sendAmount
|
|
168
168
|
});
|
|
169
|
-
return [4 /*yield*/, txClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
169
|
+
return [4 /*yield*/, txClient.sign([message], (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc))];
|
|
170
170
|
case 2: return [2 /*return*/, _a.sent()];
|
|
171
171
|
case 3:
|
|
172
172
|
error_5 = _a.sent();
|
|
@@ -196,7 +196,7 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
196
196
|
validatorDstAddress: validatorDstAddress,
|
|
197
197
|
amount: sendAmount
|
|
198
198
|
});
|
|
199
|
-
return [4 /*yield*/, txClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
199
|
+
return [4 /*yield*/, txClient.sign([message], (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc))];
|
|
200
200
|
case 2: return [2 /*return*/, _a.sent()];
|
|
201
201
|
case 3:
|
|
202
202
|
error_6 = _a.sent();
|
|
@@ -225,7 +225,7 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
225
225
|
pubkey: validatorInfo.pubkey,
|
|
226
226
|
value: validatorInfo.value
|
|
227
227
|
});
|
|
228
|
-
return [4 /*yield*/, txClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
228
|
+
return [4 /*yield*/, txClient.sign([message], (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc))];
|
|
229
229
|
case 1: return [2 /*return*/, _a.sent()];
|
|
230
230
|
case 2:
|
|
231
231
|
error_7 = _a.sent();
|
|
@@ -251,7 +251,7 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
251
251
|
commissionRate: commissionRate,
|
|
252
252
|
minSelfDelegation: minSelfDelegation
|
|
253
253
|
});
|
|
254
|
-
return [4 /*yield*/, txClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
254
|
+
return [4 /*yield*/, txClient.sign([message], (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc))];
|
|
255
255
|
case 1: return [2 /*return*/, _a.sent()];
|
|
256
256
|
case 2:
|
|
257
257
|
error_8 = _a.sent();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TxMisc, TokenDataType, Pagination } from "./firmachain/token";
|
|
2
2
|
import { FirmaConfig } from "./FirmaConfig";
|
|
3
3
|
import { FirmaWalletService } from "./FirmaWalletService";
|
|
4
|
-
import { DeliverTxResponse } from "
|
|
4
|
+
import { DeliverTxResponse } from "@cosmjs/stargate";
|
|
5
5
|
export declare class TokenService {
|
|
6
6
|
private readonly config;
|
|
7
7
|
constructor(config: FirmaConfig);
|
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
|
@@ -151,7 +151,7 @@ var TokenService = /** @class */ (function () {
|
|
|
151
151
|
tokenURI: tokenURI
|
|
152
152
|
});
|
|
153
153
|
txClient = new token_1.TokenTxClient(wallet, this.config.rpcAddress);
|
|
154
|
-
return [4 /*yield*/, txClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
154
|
+
return [4 /*yield*/, txClient.sign([message], (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc))];
|
|
155
155
|
case 2: return [2 /*return*/, _a.sent()];
|
|
156
156
|
case 3:
|
|
157
157
|
error_5 = _a.sent();
|
|
@@ -179,7 +179,7 @@ var TokenService = /** @class */ (function () {
|
|
|
179
179
|
amount: amount
|
|
180
180
|
});
|
|
181
181
|
txClient = new token_1.TokenTxClient(wallet, this.config.rpcAddress);
|
|
182
|
-
return [4 /*yield*/, txClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
182
|
+
return [4 /*yield*/, txClient.sign([message], (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc))];
|
|
183
183
|
case 2: return [2 /*return*/, _a.sent()];
|
|
184
184
|
case 3:
|
|
185
185
|
error_6 = _a.sent();
|
|
@@ -208,7 +208,7 @@ var TokenService = /** @class */ (function () {
|
|
|
208
208
|
toAddress: toAddress
|
|
209
209
|
});
|
|
210
210
|
txClient = new token_1.TokenTxClient(wallet, this.config.rpcAddress);
|
|
211
|
-
return [4 /*yield*/, txClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
211
|
+
return [4 /*yield*/, txClient.sign([message], (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc))];
|
|
212
212
|
case 2: return [2 /*return*/, _a.sent()];
|
|
213
213
|
case 3:
|
|
214
214
|
error_7 = _a.sent();
|
|
@@ -241,7 +241,7 @@ var TokenService = /** @class */ (function () {
|
|
|
241
241
|
burnable: isBurnable
|
|
242
242
|
});
|
|
243
243
|
txClient = new token_1.TokenTxClient(wallet, this.config.rpcAddress);
|
|
244
|
-
return [4 /*yield*/, txClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
244
|
+
return [4 /*yield*/, txClient.sign([message], (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc))];
|
|
245
245
|
case 2: return [2 /*return*/, _a.sent()];
|
|
246
246
|
case 3:
|
|
247
247
|
error_8 = _a.sent();
|
package/dist/sdk/FirmaUtil.d.ts
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { SignDoc, TxRaw } from "cosmjs-types/cosmos/tx/v1beta1/tx";
|
|
2
|
-
import {
|
|
3
|
-
import { SignerData } from "./firmachain/common/LedgerSigningStargateClient";
|
|
4
|
-
import { SignAndBroadcastOptions, TxMisc } from "./firmachain/common";
|
|
2
|
+
import { Duration } from "cosmjs-types/google/protobuf/duration";
|
|
5
3
|
import { EncodeObject, Registry } from "@cosmjs/proto-signing";
|
|
4
|
+
import { SignAndBroadcastOptions, TxMisc, ArbitraryVerifyData } from "./firmachain/common";
|
|
5
|
+
import { FirmaConfig } from "./FirmaConfig";
|
|
6
6
|
import { FirmaWalletService } from "./FirmaWalletService";
|
|
7
|
-
import { ArbitraryVerifyData } from "./firmachain/common/signingstargateclient";
|
|
8
7
|
import { Any } from "./firmachain/google/protobuf/any";
|
|
9
8
|
import { CommonTxClient } from "./firmachain/common/CommonTxClient";
|
|
10
|
-
import { Duration } from "cosmjs-types/google/protobuf/duration";
|
|
11
9
|
export declare class FirmaUtil {
|
|
12
10
|
static config: FirmaConfig;
|
|
13
11
|
static readonly FctDecimal: number;
|
|
@@ -35,39 +33,25 @@ export declare class FirmaUtil {
|
|
|
35
33
|
static getValOperAddressFromAccAddress(address: string): string;
|
|
36
34
|
static getValConsAddressFromAccAddress(consensusPubkey: string): string;
|
|
37
35
|
static getAccAddressFromValOperAddress(address: string): string;
|
|
38
|
-
static getSignerDataForLedger(address: string): Promise<SignerData>;
|
|
39
36
|
static estimateGas(txRaw: TxRaw): Promise<number>;
|
|
40
37
|
static estimateGasRaw(txRaw: Uint8Array): Promise<number>;
|
|
38
|
+
static getAccountInfo(address: string): Promise<{
|
|
39
|
+
account_number: string;
|
|
40
|
+
sequence: string;
|
|
41
|
+
}>;
|
|
42
|
+
static getChainId(): Promise<string>;
|
|
41
43
|
static printLog(log: any): void;
|
|
42
|
-
static experimentalAdr36Sign(wallet: FirmaWalletService, data: string): Promise<ArbitraryVerifyData>;
|
|
43
|
-
static experimentalAdr36Verify(data: ArbitraryVerifyData, checkMsg: string): Promise<boolean>;
|
|
44
44
|
private static recoverSigningAddress;
|
|
45
45
|
private static verifySignature;
|
|
46
46
|
static verifyDirectSignature(address: string, signature: string, signDoc: SignDoc): Promise<boolean>;
|
|
47
47
|
static parseSignDocValues(signDocString: string): any;
|
|
48
48
|
static stringifySignDocValues(signDoc: any): string;
|
|
49
|
-
static makeSignDoc(signerAddress: string, pubkey: string, messages: readonly EncodeObject[], txMisc?: TxMisc): Promise<SignDoc>;
|
|
50
|
-
static makeSignDocWithStringify(signerAddress: string, pubkey: string, messages: readonly EncodeObject[], txMisc?: TxMisc): Promise<string>;
|
|
51
49
|
static getAnyData(registry: Registry, message: EncodeObject): Any;
|
|
52
50
|
static getCommonTxClient(aliceWallet: FirmaWalletService): CommonTxClient;
|
|
53
|
-
/**
|
|
54
|
-
* Parses a duration string to a Duration object.
|
|
55
|
-
* Supports formats like "336h0m0s", "21d", "1000ms", "1s", "1m", "1h", "1ns", "1µs"/"1us"
|
|
56
|
-
*
|
|
57
|
-
* @param durationStr - Duration string to parse (e.g., "336h0m0s", "21d")
|
|
58
|
-
* @returns Duration object with seconds and nanos fields
|
|
59
|
-
*/
|
|
60
51
|
static parseDurationString(durationStr: string): {
|
|
61
52
|
seconds: bigint;
|
|
62
53
|
nanos: number;
|
|
63
54
|
};
|
|
64
|
-
/**
|
|
65
|
-
* Creates a Duration object from a duration string.
|
|
66
|
-
* This is a convenience method that combines parseDurationString with Duration.fromPartial.
|
|
67
|
-
*
|
|
68
|
-
* @param durationStr - Duration string to parse (e.g., "336h0m0s", "21d")
|
|
69
|
-
* @returns Duration object ready to use with protobuf
|
|
70
|
-
*/
|
|
71
55
|
static createDurationFromString(durationStr: string): Duration;
|
|
72
56
|
/**
|
|
73
57
|
* Safely processes commission rate strings to prevent big.Int conversion errors.
|
|
@@ -77,6 +61,23 @@ export declare class FirmaUtil {
|
|
|
77
61
|
* @returns Processed commission rate string safe for protobuf usage (atomics format or empty string)
|
|
78
62
|
*/
|
|
79
63
|
static processCommissionRateAsDecimal(commissionRate: string): string;
|
|
64
|
+
/**
|
|
65
|
+
* ADR-036 protobuf arbitrary signing
|
|
66
|
+
*
|
|
67
|
+
* @param wallet - FirmaWalletService instance
|
|
68
|
+
* @param signerAddress - Address of the signer
|
|
69
|
+
* @param data - Arbitrary data to sign
|
|
70
|
+
* @returns ArbitraryVerifyData for verification
|
|
71
|
+
*/
|
|
72
|
+
static protobufArbitrarySign(wallet: FirmaWalletService, signerAddress: string, data: Uint8Array): Promise<ArbitraryVerifyData>;
|
|
73
|
+
/**
|
|
74
|
+
* ADR-036 protobuf arbitrary signature verification
|
|
75
|
+
*
|
|
76
|
+
* @param data - ArbitraryVerifyData to verify
|
|
77
|
+
* @param originalMessage - Original message that was signed
|
|
78
|
+
* @returns boolean indicating if the signature is valid
|
|
79
|
+
*/
|
|
80
|
+
static protobufArbitraryVerify(data: ArbitraryVerifyData, originalMessage: Uint8Array): Promise<boolean>;
|
|
80
81
|
}
|
|
81
82
|
export declare const DefaultTxMisc: {
|
|
82
83
|
memo: string;
|