@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
package/dist/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { FirmaWalletService } from "./FirmaWalletService";
|
|
2
2
|
import { FirmaConfig } from "./FirmaConfig";
|
|
3
|
-
import { DeliverTxResponse } from "./firmachain/common/stargateclient";
|
|
4
3
|
import { Any } from "./firmachain/google/protobuf/any";
|
|
5
4
|
import { GrantGenericData, GrantSendData, GrantStakingData, Pagination, TxMisc } from "./firmachain/authz";
|
|
6
5
|
import { AuthorizationType } from "./firmachain/authz/AuthzTxTypes";
|
|
6
|
+
import { DeliverTxResponse } from "@cosmjs/stargate";
|
|
7
|
+
import { Timestamp } from "cosmjs-types/google/protobuf/timestamp";
|
|
7
8
|
export declare class FirmaAuthzService {
|
|
8
9
|
private readonly config;
|
|
9
10
|
constructor(config: FirmaConfig);
|
|
@@ -12,12 +13,12 @@ export declare class FirmaAuthzService {
|
|
|
12
13
|
private getSignedTxGrantGenericAuthorization;
|
|
13
14
|
private getSignedTxRevokeGenericAuthorization;
|
|
14
15
|
private getSignedTxExecuteAllowance;
|
|
15
|
-
getGasEstimationGrantSendAuthorization(wallet: FirmaWalletService, granteeAddress: string, expirationDate:
|
|
16
|
-
grantSendAuthorization(wallet: FirmaWalletService, granteeAddress: string, expirationDate:
|
|
17
|
-
getGasEstimationGrantStakeAuthorization(wallet: FirmaWalletService, granteeAddress: string, validatorAddressList: string[], type: AuthorizationType, expirationDate:
|
|
18
|
-
grantStakeAuthorization(wallet: FirmaWalletService, granteeAddress: string, validatorAddressList: string[], type: AuthorizationType, expirationDate:
|
|
19
|
-
getGasEstimationGrantGenericAuthorization(wallet: FirmaWalletService, granteeAddress: string, msg: string, expirationDate:
|
|
20
|
-
grantGenericAuthorization(wallet: FirmaWalletService, granteeAddress: string, msg: string, expirationDate:
|
|
16
|
+
getGasEstimationGrantSendAuthorization(wallet: FirmaWalletService, granteeAddress: string, expirationDate: Timestamp, maxTokens: number, txMisc?: TxMisc): Promise<number>;
|
|
17
|
+
grantSendAuthorization(wallet: FirmaWalletService, granteeAddress: string, expirationDate: Timestamp, maxTokens: number, txMisc?: TxMisc): Promise<DeliverTxResponse>;
|
|
18
|
+
getGasEstimationGrantStakeAuthorization(wallet: FirmaWalletService, granteeAddress: string, validatorAddressList: string[], type: AuthorizationType, expirationDate: Timestamp, maxTokens?: number, txMisc?: TxMisc): Promise<number>;
|
|
19
|
+
grantStakeAuthorization(wallet: FirmaWalletService, granteeAddress: string, validatorAddressList: string[], type: AuthorizationType, expirationDate: Timestamp, maxTokens?: number, txMisc?: TxMisc): Promise<DeliverTxResponse>;
|
|
20
|
+
getGasEstimationGrantGenericAuthorization(wallet: FirmaWalletService, granteeAddress: string, msg: string, expirationDate: Timestamp, txMisc?: TxMisc): Promise<number>;
|
|
21
|
+
grantGenericAuthorization(wallet: FirmaWalletService, granteeAddress: string, msg: string, expirationDate: Timestamp, txMisc?: TxMisc): Promise<DeliverTxResponse>;
|
|
21
22
|
getGasEstimationRevokeGenericAuthorization(wallet: FirmaWalletService, granteeAddress: string, msgType: string, txMisc?: TxMisc): Promise<number>;
|
|
22
23
|
revokeGenericAuthorization(wallet: FirmaWalletService, granteeAddress: string, msgType: string, txMisc?: TxMisc): Promise<DeliverTxResponse>;
|
|
23
24
|
getGasEstimationRevokeSendAuthorization(wallet: FirmaWalletService, granteeAddress: string, txMisc?: TxMisc): Promise<number>;
|
|
@@ -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]) {
|
|
@@ -41,7 +41,6 @@ var FirmaUtil_1 = require("./FirmaUtil");
|
|
|
41
41
|
var any_1 = require("./firmachain/google/protobuf/any");
|
|
42
42
|
var authz_1 = require("./firmachain/authz");
|
|
43
43
|
var AuthzTxTypes_1 = require("./firmachain/authz/AuthzTxTypes");
|
|
44
|
-
var timestamp_1 = require("./firmachain/google/protobuf/timestamp");
|
|
45
44
|
var FirmaAuthzService = /** @class */ (function () {
|
|
46
45
|
function FirmaAuthzService(config) {
|
|
47
46
|
this.config = config;
|
|
@@ -49,7 +48,7 @@ var FirmaAuthzService = /** @class */ (function () {
|
|
|
49
48
|
FirmaAuthzService.prototype.getSignedTxGrantSendAutorization = function (wallet, granteeAddress, maxTokens, expirationDate, txMisc) {
|
|
50
49
|
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
51
50
|
return __awaiter(this, void 0, void 0, function () {
|
|
52
|
-
var address, authorization,
|
|
51
|
+
var address, authorization, message, authzTxClient, error_1;
|
|
53
52
|
return __generator(this, function (_a) {
|
|
54
53
|
switch (_a.label) {
|
|
55
54
|
case 0:
|
|
@@ -63,19 +62,16 @@ var FirmaAuthzService = /** @class */ (function () {
|
|
|
63
62
|
spendLimit: [{ denom: this.config.denom, amount: maxTokens }],
|
|
64
63
|
})).finish()),
|
|
65
64
|
});
|
|
66
|
-
seconds = Math.floor(expirationDate.getTime() / 1000);
|
|
67
|
-
nanos = (expirationDate.getMilliseconds() % 1000) * 1000000;
|
|
68
|
-
timestamp = timestamp_1.Timestamp.fromPartial({ seconds: seconds, nanos: nanos });
|
|
69
65
|
message = authz_1.AuthzTxClient.msgGrantAllowance({
|
|
70
66
|
granter: address,
|
|
71
67
|
grantee: granteeAddress,
|
|
72
68
|
grant: {
|
|
73
69
|
authorization: authorization,
|
|
74
|
-
expiration:
|
|
70
|
+
expiration: expirationDate
|
|
75
71
|
}
|
|
76
72
|
});
|
|
77
73
|
authzTxClient = new authz_1.AuthzTxClient(wallet, this.config.rpcAddress);
|
|
78
|
-
return [4 /*yield*/, authzTxClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
74
|
+
return [4 /*yield*/, authzTxClient.sign([message], (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc))];
|
|
79
75
|
case 2: return [2 /*return*/, _a.sent()];
|
|
80
76
|
case 3:
|
|
81
77
|
error_1 = _a.sent();
|
|
@@ -89,7 +85,7 @@ var FirmaAuthzService = /** @class */ (function () {
|
|
|
89
85
|
FirmaAuthzService.prototype.getSignedTxGrantStakeAutorization = function (wallet, granteeAddress, validatorAddressList, type, maxTokens, expirationDate, txMisc) {
|
|
90
86
|
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
91
87
|
return __awaiter(this, void 0, void 0, function () {
|
|
92
|
-
var address, authorization,
|
|
88
|
+
var address, authorization, message, authzTxClient, error_2;
|
|
93
89
|
return __generator(this, function (_a) {
|
|
94
90
|
switch (_a.label) {
|
|
95
91
|
case 0:
|
|
@@ -105,19 +101,16 @@ var FirmaAuthzService = /** @class */ (function () {
|
|
|
105
101
|
authorizationType: type
|
|
106
102
|
})).finish()),
|
|
107
103
|
});
|
|
108
|
-
seconds = Math.floor(expirationDate.getTime() / 1000);
|
|
109
|
-
nanos = (expirationDate.getMilliseconds() % 1000) * 1000000;
|
|
110
|
-
timestamp = timestamp_1.Timestamp.fromPartial({ seconds: seconds, nanos: nanos });
|
|
111
104
|
message = authz_1.AuthzTxClient.msgGrantAllowance({
|
|
112
105
|
granter: address,
|
|
113
106
|
grantee: granteeAddress,
|
|
114
107
|
grant: {
|
|
115
108
|
authorization: authorization,
|
|
116
|
-
expiration:
|
|
109
|
+
expiration: expirationDate
|
|
117
110
|
}
|
|
118
111
|
});
|
|
119
112
|
authzTxClient = new authz_1.AuthzTxClient(wallet, this.config.rpcAddress);
|
|
120
|
-
return [4 /*yield*/, authzTxClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
113
|
+
return [4 /*yield*/, authzTxClient.sign([message], (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc))];
|
|
121
114
|
case 2: return [2 /*return*/, _a.sent()];
|
|
122
115
|
case 3:
|
|
123
116
|
error_2 = _a.sent();
|
|
@@ -131,7 +124,7 @@ var FirmaAuthzService = /** @class */ (function () {
|
|
|
131
124
|
FirmaAuthzService.prototype.getSignedTxGrantGenericAuthorization = function (wallet, granteeAddress, msgType, expirationDate, txMisc) {
|
|
132
125
|
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
133
126
|
return __awaiter(this, void 0, void 0, function () {
|
|
134
|
-
var address, authorization,
|
|
127
|
+
var address, authorization, message, authzTxClient, error_3;
|
|
135
128
|
return __generator(this, function (_a) {
|
|
136
129
|
switch (_a.label) {
|
|
137
130
|
case 0:
|
|
@@ -145,19 +138,16 @@ var FirmaAuthzService = /** @class */ (function () {
|
|
|
145
138
|
msg: msgType
|
|
146
139
|
})).finish()),
|
|
147
140
|
});
|
|
148
|
-
seconds = Math.floor(expirationDate.getTime() / 1000);
|
|
149
|
-
nanos = (expirationDate.getMilliseconds() % 1000) * 1000000;
|
|
150
|
-
timestamp = timestamp_1.Timestamp.fromPartial({ seconds: seconds, nanos: nanos });
|
|
151
141
|
message = authz_1.AuthzTxClient.msgGrantAllowance({
|
|
152
142
|
granter: address,
|
|
153
143
|
grantee: granteeAddress,
|
|
154
144
|
grant: {
|
|
155
145
|
authorization: authorization,
|
|
156
|
-
expiration:
|
|
146
|
+
expiration: expirationDate
|
|
157
147
|
}
|
|
158
148
|
});
|
|
159
149
|
authzTxClient = new authz_1.AuthzTxClient(wallet, this.config.rpcAddress);
|
|
160
|
-
return [4 /*yield*/, authzTxClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
150
|
+
return [4 /*yield*/, authzTxClient.sign([message], (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc))];
|
|
161
151
|
case 2: return [2 /*return*/, _a.sent()];
|
|
162
152
|
case 3:
|
|
163
153
|
error_3 = _a.sent();
|
|
@@ -185,7 +175,7 @@ var FirmaAuthzService = /** @class */ (function () {
|
|
|
185
175
|
msgTypeUrl: msgType
|
|
186
176
|
});
|
|
187
177
|
authzTxClient = new authz_1.AuthzTxClient(wallet, this.config.rpcAddress);
|
|
188
|
-
return [4 /*yield*/, authzTxClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
178
|
+
return [4 /*yield*/, authzTxClient.sign([message], (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc))];
|
|
189
179
|
case 2: return [2 /*return*/, _a.sent()];
|
|
190
180
|
case 3:
|
|
191
181
|
error_4 = _a.sent();
|
|
@@ -213,7 +203,7 @@ var FirmaAuthzService = /** @class */ (function () {
|
|
|
213
203
|
msgs: msgs
|
|
214
204
|
});
|
|
215
205
|
authzTxClient = new authz_1.AuthzTxClient(wallet, this.config.rpcAddress);
|
|
216
|
-
return [4 /*yield*/, authzTxClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
206
|
+
return [4 /*yield*/, authzTxClient.sign([message], (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc))];
|
|
217
207
|
case 2: return [2 /*return*/, _a.sent()];
|
|
218
208
|
case 3:
|
|
219
209
|
error_5 = _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]) {
|
|
@@ -286,7 +286,7 @@ var FirmaBankService = /** @class */ (function () {
|
|
|
286
286
|
address = _a.sent();
|
|
287
287
|
sendAmount = { denom: denom, amount: amount };
|
|
288
288
|
message = bank_1.BankTxClient.msgSend({ fromAddress: address, toAddress: targetAddress, amount: [sendAmount] });
|
|
289
|
-
return [4 /*yield*/, bankTxClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
289
|
+
return [4 /*yield*/, bankTxClient.sign([message], (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc))];
|
|
290
290
|
case 2: return [2 /*return*/, _a.sent()];
|
|
291
291
|
case 3:
|
|
292
292
|
error_11 = _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]) {
|
|
@@ -2,7 +2,7 @@ import { ContractLogType, ContractFileType, Pagination, TxMisc } from "./firmach
|
|
|
2
2
|
import { EncodeObject } from "@cosmjs/proto-signing";
|
|
3
3
|
import { FirmaConfig } from "./FirmaConfig";
|
|
4
4
|
import { FirmaWalletService } from "./FirmaWalletService";
|
|
5
|
-
import { DeliverTxResponse } from "
|
|
5
|
+
import { DeliverTxResponse } from "@cosmjs/stargate";
|
|
6
6
|
export declare class ContractService {
|
|
7
7
|
private readonly config;
|
|
8
8
|
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]) {
|
|
@@ -168,7 +168,7 @@ var ContractService = /** @class */ (function () {
|
|
|
168
168
|
case 0:
|
|
169
169
|
_a.trys.push([0, 3, , 4]);
|
|
170
170
|
contractTxClient = new contract_1.ContractTxClient(wallet, this.config.rpcAddress);
|
|
171
|
-
return [4 /*yield*/, contractTxClient.sign(txList, FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
171
|
+
return [4 /*yield*/, contractTxClient.sign(txList, (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc))];
|
|
172
172
|
case 1:
|
|
173
173
|
txRaw = _a.sent();
|
|
174
174
|
return [4 /*yield*/, FirmaUtil_1.FirmaUtil.estimateGas(txRaw)];
|
|
@@ -249,7 +249,7 @@ var ContractService = /** @class */ (function () {
|
|
|
249
249
|
metaDataJsonString: metaDataJsonString
|
|
250
250
|
});
|
|
251
251
|
contractTxClient = new contract_1.ContractTxClient(wallet, this.config.rpcAddress);
|
|
252
|
-
return [4 /*yield*/, contractTxClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
252
|
+
return [4 /*yield*/, contractTxClient.sign([message], (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc))];
|
|
253
253
|
case 2: return [2 /*return*/, _a.sent()];
|
|
254
254
|
case 3:
|
|
255
255
|
error_10 = _a.sent();
|
|
@@ -325,7 +325,7 @@ var ContractService = /** @class */ (function () {
|
|
|
325
325
|
jsonString: jsonString
|
|
326
326
|
});
|
|
327
327
|
contractTxClient = new contract_1.ContractTxClient(wallet, this.config.rpcAddress);
|
|
328
|
-
return [4 /*yield*/, contractTxClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
328
|
+
return [4 /*yield*/, contractTxClient.sign([message], (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc))];
|
|
329
329
|
case 2: return [2 /*return*/, _a.sent()];
|
|
330
330
|
case 3:
|
|
331
331
|
error_13 = _a.sent();
|
|
@@ -395,7 +395,7 @@ var ContractService = /** @class */ (function () {
|
|
|
395
395
|
case 0:
|
|
396
396
|
_a.trys.push([0, 3, , 4]);
|
|
397
397
|
contractTxClient = new contract_1.ContractTxClient(wallet, this.config.rpcAddress);
|
|
398
|
-
return [4 /*yield*/, contractTxClient.sign(msgList, FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
398
|
+
return [4 /*yield*/, contractTxClient.sign(msgList, (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc))];
|
|
399
399
|
case 1:
|
|
400
400
|
txRaw = _a.sent();
|
|
401
401
|
return [4 /*yield*/, FirmaUtil_1.FirmaUtil.estimateGas(txRaw)];
|
|
@@ -418,7 +418,7 @@ var ContractService = /** @class */ (function () {
|
|
|
418
418
|
case 0:
|
|
419
419
|
_a.trys.push([0, 2, , 3]);
|
|
420
420
|
contractTxClient = new contract_1.ContractTxClient(wallet, this.config.rpcAddress);
|
|
421
|
-
return [4 /*yield*/, contractTxClient.signAndBroadcast(msgList, FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
421
|
+
return [4 /*yield*/, contractTxClient.signAndBroadcast(msgList, (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc))];
|
|
422
422
|
case 1: return [2 /*return*/, _a.sent()];
|
|
423
423
|
case 2:
|
|
424
424
|
error_17 = _a.sent();
|
|
@@ -3,7 +3,7 @@ import { FirmaCosmWasmService } from "./FirmaCosmWasmService";
|
|
|
3
3
|
import { FirmaWalletService } from "./FirmaWalletService";
|
|
4
4
|
import { TxMisc } from "./firmachain/common";
|
|
5
5
|
import { EncodeObject } from "@cosmjs/proto-signing";
|
|
6
|
-
import { DeliverTxResponse } from "
|
|
6
|
+
import { DeliverTxResponse } from "@cosmjs/stargate";
|
|
7
7
|
export interface Cw20Minter {
|
|
8
8
|
minter: string;
|
|
9
9
|
cap: string;
|
|
@@ -31,7 +31,7 @@ export interface ExpiresAtTime {
|
|
|
31
31
|
export interface ExpiresNever {
|
|
32
32
|
never: {};
|
|
33
33
|
}
|
|
34
|
-
export
|
|
34
|
+
export type Expires = ExpiresAtHeight | ExpiresAtTime | ExpiresNever;
|
|
35
35
|
export interface Cw20Allowance {
|
|
36
36
|
allowance: string;
|
|
37
37
|
expires: Expires;
|
|
@@ -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]) {
|
|
@@ -487,7 +487,7 @@ var FirmaCosmWasmCw20Service = /** @class */ (function () {
|
|
|
487
487
|
case 0:
|
|
488
488
|
_a.trys.push([0, 2, , 3]);
|
|
489
489
|
txClient = new cosmwasm_1.CosmWasmTxClient(wallet, this.config.rpcAddress);
|
|
490
|
-
return [4 /*yield*/, txClient.signAndBroadcast(msgList, FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
490
|
+
return [4 /*yield*/, txClient.signAndBroadcast(msgList, (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc))];
|
|
491
491
|
case 1: return [2 /*return*/, _a.sent()];
|
|
492
492
|
case 2:
|
|
493
493
|
error_1 = _a.sent();
|
|
@@ -507,7 +507,7 @@ var FirmaCosmWasmCw20Service = /** @class */ (function () {
|
|
|
507
507
|
case 0:
|
|
508
508
|
_a.trys.push([0, 3, , 4]);
|
|
509
509
|
txClient = new cosmwasm_1.CosmWasmTxClient(wallet, this.config.rpcAddress);
|
|
510
|
-
return [4 /*yield*/, txClient.sign(msgList, FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
510
|
+
return [4 /*yield*/, txClient.sign(msgList, (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc))];
|
|
511
511
|
case 1:
|
|
512
512
|
txRaw = _a.sent();
|
|
513
513
|
return [4 /*yield*/, FirmaUtil_1.FirmaUtil.estimateGas(txRaw)];
|
|
@@ -686,7 +686,7 @@ var FirmaCosmWasmCw20Service = /** @class */ (function () {
|
|
|
686
686
|
switch (_a.label) {
|
|
687
687
|
case 0:
|
|
688
688
|
_a.trys.push([0, 2, , 3]);
|
|
689
|
-
query = "{\"balance\": { \"address\": \""
|
|
689
|
+
query = "{\"balance\": { \"address\": \"".concat(address, "\" }}");
|
|
690
690
|
return [4 /*yield*/, this.cosmwasmService.getContractSmartQueryData(contractAddress, query)];
|
|
691
691
|
case 1:
|
|
692
692
|
result = _a.sent();
|
|
@@ -774,7 +774,7 @@ var FirmaCosmWasmCw20Service = /** @class */ (function () {
|
|
|
774
774
|
switch (_a.label) {
|
|
775
775
|
case 0:
|
|
776
776
|
_a.trys.push([0, 2, , 3]);
|
|
777
|
-
query = "{\"allowance\": {\"owner\": \""
|
|
777
|
+
query = "{\"allowance\": {\"owner\": \"".concat(owner, "\", \"spender\":\"").concat(spender, "\"}}");
|
|
778
778
|
return [4 /*yield*/, this.cosmwasmService.getContractSmartQueryData(contractAddress, query)];
|
|
779
779
|
case 1:
|
|
780
780
|
result = _a.sent();
|
|
@@ -798,7 +798,7 @@ var FirmaCosmWasmCw20Service = /** @class */ (function () {
|
|
|
798
798
|
switch (_a.label) {
|
|
799
799
|
case 0:
|
|
800
800
|
_a.trys.push([0, 2, , 3]);
|
|
801
|
-
query = "{\"all_allowances\": {\"owner\": \""
|
|
801
|
+
query = "{\"all_allowances\": {\"owner\": \"".concat(owner, "\", \"limit\": ").concat(limit, ", \"start_after\": ").concat(start_after !== null ? "\"".concat(start_after, "\"") : null, "}}");
|
|
802
802
|
return [4 /*yield*/, this.cosmwasmService.getContractSmartQueryData(contractAddress, query)];
|
|
803
803
|
case 1:
|
|
804
804
|
result = _a.sent();
|
|
@@ -822,7 +822,7 @@ var FirmaCosmWasmCw20Service = /** @class */ (function () {
|
|
|
822
822
|
switch (_a.label) {
|
|
823
823
|
case 0:
|
|
824
824
|
_a.trys.push([0, 2, , 3]);
|
|
825
|
-
query = "{\"all_spender_allowances\": {\"spender\": \""
|
|
825
|
+
query = "{\"all_spender_allowances\": {\"spender\": \"".concat(spender, "\", \"limit\": ").concat(limit, ", \"start_after\": ").concat(start_after !== null ? "\"".concat(start_after, "\"") : null, "}}");
|
|
826
826
|
return [4 /*yield*/, this.cosmwasmService.getContractSmartQueryData(contractAddress, query)];
|
|
827
827
|
case 1:
|
|
828
828
|
result = _a.sent();
|
|
@@ -846,7 +846,7 @@ var FirmaCosmWasmCw20Service = /** @class */ (function () {
|
|
|
846
846
|
switch (_a.label) {
|
|
847
847
|
case 0:
|
|
848
848
|
_a.trys.push([0, 2, , 3]);
|
|
849
|
-
query = "{\"all_accounts\": {\"limit\": "
|
|
849
|
+
query = "{\"all_accounts\": {\"limit\": ".concat(limit, ", \"start_after\": ").concat(start_after !== null ? "\"".concat(start_after, "\"") : null, "}}");
|
|
850
850
|
return [4 /*yield*/, this.cosmwasmService.getContractSmartQueryData(contractAddress, query)];
|
|
851
851
|
case 1:
|
|
852
852
|
result = _a.sent();
|
|
@@ -3,7 +3,7 @@ import { FirmaCosmWasmService } from "./FirmaCosmWasmService";
|
|
|
3
3
|
import { FirmaWalletService } from "./FirmaWalletService";
|
|
4
4
|
import { TxMisc } from "./firmachain/common";
|
|
5
5
|
import { EncodeObject } from "@cosmjs/proto-signing";
|
|
6
|
-
import { DeliverTxResponse } from "
|
|
6
|
+
import { DeliverTxResponse } from "@cosmjs/stargate";
|
|
7
7
|
export interface Cw721ExpiresAtHeight {
|
|
8
8
|
at_height: number;
|
|
9
9
|
}
|
|
@@ -13,7 +13,7 @@ export interface Cw721ExpiresAtTime {
|
|
|
13
13
|
export interface Cw721ExpiresNever {
|
|
14
14
|
never: {};
|
|
15
15
|
}
|
|
16
|
-
export
|
|
16
|
+
export type Cw721Expires = Cw721ExpiresAtHeight | Cw721ExpiresAtTime | Cw721ExpiresNever;
|
|
17
17
|
interface OwnershipResponse {
|
|
18
18
|
owner: string | null;
|
|
19
19
|
pending_owner: string | null;
|
|
@@ -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]) {
|
|
@@ -472,7 +472,7 @@ var FirmaCosmWasmCw721Service = /** @class */ (function () {
|
|
|
472
472
|
case 0:
|
|
473
473
|
_a.trys.push([0, 2, , 3]);
|
|
474
474
|
txClient = new CosmWasmTxClient_1.CosmWasmTxClient(wallet, this.config.rpcAddress);
|
|
475
|
-
return [4 /*yield*/, txClient.signAndBroadcast(msgList, FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
475
|
+
return [4 /*yield*/, txClient.signAndBroadcast(msgList, (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc))];
|
|
476
476
|
case 1: return [2 /*return*/, _a.sent()];
|
|
477
477
|
case 2:
|
|
478
478
|
error_1 = _a.sent();
|
|
@@ -492,7 +492,7 @@ var FirmaCosmWasmCw721Service = /** @class */ (function () {
|
|
|
492
492
|
case 0:
|
|
493
493
|
_a.trys.push([0, 3, , 4]);
|
|
494
494
|
txClient = new CosmWasmTxClient_1.CosmWasmTxClient(wallet, this.config.rpcAddress);
|
|
495
|
-
return [4 /*yield*/, txClient.sign(msgList, FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
495
|
+
return [4 /*yield*/, txClient.sign(msgList, (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc))];
|
|
496
496
|
case 1:
|
|
497
497
|
txRaw = _a.sent();
|
|
498
498
|
return [4 /*yield*/, FirmaUtil_1.FirmaUtil.estimateGas(txRaw)];
|
|
@@ -659,7 +659,7 @@ var FirmaCosmWasmCw721Service = /** @class */ (function () {
|
|
|
659
659
|
switch (_a.label) {
|
|
660
660
|
case 0:
|
|
661
661
|
_a.trys.push([0, 2, , 3]);
|
|
662
|
-
query = "{\"owner_of\": { \"token_id\": \""
|
|
662
|
+
query = "{\"owner_of\": { \"token_id\": \"".concat(tokenId, "\" }}");
|
|
663
663
|
return [4 /*yield*/, this.cosmwasmService.getContractSmartQueryData(contractAddress, query)];
|
|
664
664
|
case 1:
|
|
665
665
|
result = _a.sent();
|
|
@@ -682,7 +682,7 @@ var FirmaCosmWasmCw721Service = /** @class */ (function () {
|
|
|
682
682
|
switch (_a.label) {
|
|
683
683
|
case 0:
|
|
684
684
|
_a.trys.push([0, 2, , 3]);
|
|
685
|
-
query = "{\"approval\": { \"token_id\": \""
|
|
685
|
+
query = "{\"approval\": { \"token_id\": \"".concat(tokenId, "\", \"spender\" : \"").concat(spender, "\", \"include_expired\" : ").concat(isIncludeExpired, " }}");
|
|
686
686
|
return [4 /*yield*/, this.cosmwasmService.getContractSmartQueryData(contractAddress, query)];
|
|
687
687
|
case 1:
|
|
688
688
|
result = _a.sent();
|
|
@@ -705,7 +705,7 @@ var FirmaCosmWasmCw721Service = /** @class */ (function () {
|
|
|
705
705
|
switch (_a.label) {
|
|
706
706
|
case 0:
|
|
707
707
|
_a.trys.push([0, 2, , 3]);
|
|
708
|
-
query = "{\"approvals\": { \"token_id\": \""
|
|
708
|
+
query = "{\"approvals\": { \"token_id\": \"".concat(tokenId, "\", \"include_expired\" : ").concat(isIncludeExpired, " }}");
|
|
709
709
|
return [4 /*yield*/, this.cosmwasmService.getContractSmartQueryData(contractAddress, query)];
|
|
710
710
|
case 1:
|
|
711
711
|
result = _a.sent();
|
|
@@ -730,7 +730,7 @@ var FirmaCosmWasmCw721Service = /** @class */ (function () {
|
|
|
730
730
|
switch (_a.label) {
|
|
731
731
|
case 0:
|
|
732
732
|
_a.trys.push([0, 2, , 3]);
|
|
733
|
-
query = "{\n \"all_operators\": { \n \"owner\": \""
|
|
733
|
+
query = "{\n \"all_operators\": { \n \"owner\": \"".concat(owner, "\", \n \"include_expired\" : ").concat(isIncludeExpired, ", \n \"limit\": ").concat(limit, ",\n \"start_after\": ").concat(start_after !== null ? "\"".concat(start_after, "\"") : null, " \n }\n }");
|
|
734
734
|
return [4 /*yield*/, this.cosmwasmService.getContractSmartQueryData(contractAddress, query)];
|
|
735
735
|
case 1:
|
|
736
736
|
result = _a.sent();
|
|
@@ -753,7 +753,7 @@ var FirmaCosmWasmCw721Service = /** @class */ (function () {
|
|
|
753
753
|
switch (_a.label) {
|
|
754
754
|
case 0:
|
|
755
755
|
_a.trys.push([0, 2, , 3]);
|
|
756
|
-
query = "{\"operator\": { \"owner\": \""
|
|
756
|
+
query = "{\"operator\": { \"owner\": \"".concat(owner, "\", \"operator\": \"").concat(operator, "\" ,\"include_expired\" : ").concat(isIncludeExpired, " }}");
|
|
757
757
|
return [4 /*yield*/, this.cosmwasmService.getContractSmartQueryData(contractAddress, query)];
|
|
758
758
|
case 1:
|
|
759
759
|
result = _a.sent();
|
|
@@ -819,7 +819,7 @@ var FirmaCosmWasmCw721Service = /** @class */ (function () {
|
|
|
819
819
|
switch (_a.label) {
|
|
820
820
|
case 0:
|
|
821
821
|
_a.trys.push([0, 2, , 3]);
|
|
822
|
-
query = "{\"nft_info\": { \"token_id\": \""
|
|
822
|
+
query = "{\"nft_info\": { \"token_id\": \"".concat(tokenId, "\" }}");
|
|
823
823
|
return [4 /*yield*/, this.cosmwasmService.getContractSmartQueryData(contractAddress, query)];
|
|
824
824
|
case 1:
|
|
825
825
|
result = _a.sent();
|
|
@@ -841,7 +841,7 @@ var FirmaCosmWasmCw721Service = /** @class */ (function () {
|
|
|
841
841
|
switch (_a.label) {
|
|
842
842
|
case 0:
|
|
843
843
|
_a.trys.push([0, 2, , 3]);
|
|
844
|
-
query = "{\"all_nft_info\": { \"token_id\": \""
|
|
844
|
+
query = "{\"all_nft_info\": { \"token_id\": \"".concat(tokenId, "\" }}");
|
|
845
845
|
return [4 /*yield*/, this.cosmwasmService.getContractSmartQueryData(contractAddress, query)];
|
|
846
846
|
case 1:
|
|
847
847
|
result = _a.sent();
|
|
@@ -865,7 +865,7 @@ var FirmaCosmWasmCw721Service = /** @class */ (function () {
|
|
|
865
865
|
switch (_a.label) {
|
|
866
866
|
case 0:
|
|
867
867
|
_a.trys.push([0, 2, , 3]);
|
|
868
|
-
query = "{\"tokens\": { \"owner\": \""
|
|
868
|
+
query = "{\"tokens\": { \"owner\": \"".concat(owner, "\", \"limit\": ").concat(limit, ", \"start_after\": ").concat(start_after !== null ? "\"".concat(start_after, "\"") : null, " }}");
|
|
869
869
|
return [4 /*yield*/, this.cosmwasmService.getContractSmartQueryData(contractAddress, query)];
|
|
870
870
|
case 1:
|
|
871
871
|
result = _a.sent();
|
|
@@ -889,7 +889,7 @@ var FirmaCosmWasmCw721Service = /** @class */ (function () {
|
|
|
889
889
|
switch (_a.label) {
|
|
890
890
|
case 0:
|
|
891
891
|
_a.trys.push([0, 2, , 3]);
|
|
892
|
-
query = "{\"all_tokens\": { \"limit\": "
|
|
892
|
+
query = "{\"all_tokens\": { \"limit\": ".concat(limit, ", \"start_after\": ").concat(start_after !== null ? "\"".concat(start_after, "\"") : null, " }}");
|
|
893
893
|
return [4 /*yield*/, this.cosmwasmService.getContractSmartQueryData(contractAddress, query)];
|
|
894
894
|
case 1:
|
|
895
895
|
result = _a.sent();
|
|
@@ -3,8 +3,8 @@ import { FirmaCosmWasmService } from "./FirmaCosmWasmService";
|
|
|
3
3
|
import { FirmaWalletService } from "./FirmaWalletService";
|
|
4
4
|
import { TxMisc } from "./firmachain/common";
|
|
5
5
|
import { EncodeObject } from "@cosmjs/proto-signing";
|
|
6
|
-
import { DeliverTxResponse } from "./firmachain/common/stargateclient";
|
|
7
6
|
import { FirmaCosmWasmCw721Service } from "./FirmaCosmWasmCw721";
|
|
7
|
+
import { DeliverTxResponse } from "@cosmjs/stargate";
|
|
8
8
|
export interface BridgeGlobalTxCounts {
|
|
9
9
|
lock_count: number;
|
|
10
10
|
unlock_count: number;
|
|
@@ -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]) {
|
|
@@ -315,7 +315,7 @@ var FirmaCosmWasmCwBridgeService = /** @class */ (function () {
|
|
|
315
315
|
case 0:
|
|
316
316
|
_a.trys.push([0, 2, , 3]);
|
|
317
317
|
txClient = new CosmWasmTxClient_1.CosmWasmTxClient(wallet, this.config.rpcAddress);
|
|
318
|
-
return [4 /*yield*/, txClient.signAndBroadcast(msgList, FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
318
|
+
return [4 /*yield*/, txClient.signAndBroadcast(msgList, (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc))];
|
|
319
319
|
case 1: return [2 /*return*/, _a.sent()];
|
|
320
320
|
case 2:
|
|
321
321
|
error_1 = _a.sent();
|
|
@@ -335,7 +335,7 @@ var FirmaCosmWasmCwBridgeService = /** @class */ (function () {
|
|
|
335
335
|
case 0:
|
|
336
336
|
_a.trys.push([0, 3, , 4]);
|
|
337
337
|
txClient = new CosmWasmTxClient_1.CosmWasmTxClient(wallet, this.config.rpcAddress);
|
|
338
|
-
return [4 /*yield*/, txClient.sign(msgList, FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
338
|
+
return [4 /*yield*/, txClient.sign(msgList, (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc))];
|
|
339
339
|
case 1:
|
|
340
340
|
txRaw = _a.sent();
|
|
341
341
|
return [4 /*yield*/, FirmaUtil_1.FirmaUtil.estimateGas(txRaw)];
|
|
@@ -493,7 +493,7 @@ var FirmaCosmWasmCwBridgeService = /** @class */ (function () {
|
|
|
493
493
|
return __generator(this, function (_a) {
|
|
494
494
|
switch (_a.label) {
|
|
495
495
|
case 0:
|
|
496
|
-
query = "{\"nft_info\": { \"token_id\": \""
|
|
496
|
+
query = "{\"nft_info\": { \"token_id\": \"".concat(tokenId, "\" }}");
|
|
497
497
|
return [4 /*yield*/, this.cosmwasmService.getContractSmartQueryData(contractAddress, query)];
|
|
498
498
|
case 1:
|
|
499
499
|
result = _a.sent();
|
|
@@ -510,7 +510,7 @@ var FirmaCosmWasmCwBridgeService = /** @class */ (function () {
|
|
|
510
510
|
return __generator(this, function (_a) {
|
|
511
511
|
switch (_a.label) {
|
|
512
512
|
case 0:
|
|
513
|
-
query = "{\"owner_nfts\": { \"owner_addr\": \""
|
|
513
|
+
query = "{\"owner_nfts\": { \"owner_addr\": \"".concat(ownerAddress, "\", \"limit\": ").concat(limit, ", \"start_after\": ").concat(start_after !== null ? "\"".concat(start_after, "\"") : null, " }}");
|
|
514
514
|
return [4 /*yield*/, this.cosmwasmService.getContractSmartQueryData(contractAddress, query)];
|
|
515
515
|
case 1:
|
|
516
516
|
result = _a.sent();
|
|
@@ -527,7 +527,7 @@ var FirmaCosmWasmCwBridgeService = /** @class */ (function () {
|
|
|
527
527
|
return __generator(this, function (_a) {
|
|
528
528
|
switch (_a.label) {
|
|
529
529
|
case 0:
|
|
530
|
-
query = "{\"owner_nfts_info\": { \"owner_addr\": \""
|
|
530
|
+
query = "{\"owner_nfts_info\": { \"owner_addr\": \"".concat(ownerAddress, "\", \"limit\": ").concat(limit, ",\"start_after\": ").concat(start_after !== null ? "\"".concat(start_after, "\"") : null, " }}");
|
|
531
531
|
return [4 /*yield*/, this.cosmwasmService.getContractSmartQueryData(contractAddress, query)];
|
|
532
532
|
case 1:
|
|
533
533
|
result = _a.sent();
|
|
@@ -544,7 +544,7 @@ var FirmaCosmWasmCwBridgeService = /** @class */ (function () {
|
|
|
544
544
|
return __generator(this, function (_a) {
|
|
545
545
|
switch (_a.label) {
|
|
546
546
|
case 0:
|
|
547
|
-
query = "{\"owner_withdrawable_nfts\": { \"owner_addr\": \""
|
|
547
|
+
query = "{\"owner_withdrawable_nfts\": { \"owner_addr\": \"".concat(ownerAddress, "\", \"limit\": ").concat(limit, ", \"start_after\": ").concat(start_after !== null ? "\"".concat(start_after, "\"") : null, "}}");
|
|
548
548
|
return [4 /*yield*/, this.cosmwasmService.getContractSmartQueryData(contractAddress, query)];
|
|
549
549
|
case 1:
|
|
550
550
|
result = _a.sent();
|
|
@@ -561,7 +561,7 @@ var FirmaCosmWasmCwBridgeService = /** @class */ (function () {
|
|
|
561
561
|
return __generator(this, function (_a) {
|
|
562
562
|
switch (_a.label) {
|
|
563
563
|
case 0:
|
|
564
|
-
query = "{\"owner_unlockable_nfts\": { \"owner_addr\": \""
|
|
564
|
+
query = "{\"owner_unlockable_nfts\": { \"owner_addr\": \"".concat(ownerAddress, "\", \"limit\": ").concat(limit, ", \"start_after\": \"").concat(start_after, "\" }}");
|
|
565
565
|
return [4 /*yield*/, this.cosmwasmService.getContractSmartQueryData(contractAddress, query)];
|
|
566
566
|
case 1:
|
|
567
567
|
result = _a.sent();
|
|
@@ -3,9 +3,9 @@ import { FirmaCosmWasmService } from "./FirmaCosmWasmService";
|
|
|
3
3
|
import { FirmaWalletService } from "./FirmaWalletService";
|
|
4
4
|
import { TxMisc } from "./firmachain/common";
|
|
5
5
|
import { EncodeObject } from "@cosmjs/proto-signing";
|
|
6
|
-
import { DeliverTxResponse } from "./firmachain/common/stargateclient";
|
|
7
6
|
import { FirmaCosmWasmCw721Service } from "./FirmaCosmWasmCw721";
|
|
8
7
|
import { FirmaCosmWasmCw20Service } from "./FirmaCosmWasmCw20";
|
|
8
|
+
import { DeliverTxResponse } from "@cosmjs/stargate";
|
|
9
9
|
export interface MarketplaceConfig {
|
|
10
10
|
owner: string;
|
|
11
11
|
cw721_address: string;
|