@firmachain/firma-js 0.3.4 → 0.3.6-beta1
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 +26 -23
- package/dist/sdk/FirmaUtil.js +157 -137
- package/dist/sdk/FirmaWalletService.d.ts +5 -9
- package/dist/sdk/FirmaWalletService.js +86 -52
- 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 +3 -3
- package/dist/sdk/firmachain/common/ITxClient.js +25 -83
- 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 +14 -30
- package/dist/sdk/firmachain/common/accounts.d.ts +1 -1
- package/dist/sdk/firmachain/common/accounts.js +7 -7
- package/dist/sdk/firmachain/common/events.js +2 -2
- package/dist/sdk/firmachain/common/fee.d.ts +2 -2
- package/dist/sdk/firmachain/common/fee.js +4 -2
- package/dist/sdk/firmachain/common/index.d.ts +0 -1
- package/dist/sdk/firmachain/common/index.js +5 -4
- package/dist/sdk/firmachain/common/signing.d.ts +13 -9
- package/dist/sdk/firmachain/common/signing.js +81 -36
- package/dist/sdk/firmachain/common/signingprotobufstargateclient.d.ts +34 -0
- package/dist/sdk/firmachain/common/signingprotobufstargateclient.js +319 -0
- package/dist/sdk/firmachain/common/signingstargateclient.d.ts +21 -105
- package/dist/sdk/firmachain/common/signingstargateclient.js +120 -472
- package/dist/sdk/firmachain/common/{stargateclient.d.ts → stargateClient.d.ts} +11 -60
- package/dist/sdk/firmachain/common/{stargateclient.js → stargateClient.js} +109 -203
- 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} +41 -40
- 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 +2 -2
- package/dist/test/config_test.js +22 -5
- 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/coins.d.ts +0 -42
- package/dist/sdk/firmachain/amino/coins.js +0 -90
- 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/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/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
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { CometClient } from "@cosmjs/tendermint-rpc";
|
|
2
|
-
import { StargateClient, StargateClientOptions } from "./stargateclient";
|
|
3
|
-
import { Account } from "./accounts";
|
|
4
|
-
export interface SignerData {
|
|
5
|
-
readonly account_number: string;
|
|
6
|
-
readonly sequence: string;
|
|
7
|
-
readonly chain_id: string;
|
|
8
|
-
}
|
|
9
|
-
export interface SequenceResponse {
|
|
10
|
-
readonly account_number: string;
|
|
11
|
-
readonly sequence: string;
|
|
12
|
-
}
|
|
13
|
-
export declare class LedgerSigningStargateClient extends StargateClient {
|
|
14
|
-
private chainId;
|
|
15
|
-
private static _endpoint;
|
|
16
|
-
static connectWithSigner(endpoint: string): Promise<LedgerSigningStargateClient>;
|
|
17
|
-
protected constructor(cometClient: CometClient, options: StargateClientOptions);
|
|
18
|
-
getSignerData(address: string): Promise<SignerData>;
|
|
19
|
-
getChainId(): Promise<string>;
|
|
20
|
-
private toAccAddress;
|
|
21
|
-
getAccount(address: string): Promise<Account | null>;
|
|
22
|
-
}
|
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
-
function step(op) {
|
|
31
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
-
while (_) try {
|
|
33
|
-
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;
|
|
34
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
-
switch (op[0]) {
|
|
36
|
-
case 0: case 1: t = op; break;
|
|
37
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
-
default:
|
|
41
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
-
if (t[2]) _.ops.pop();
|
|
46
|
-
_.trys.pop(); continue;
|
|
47
|
-
}
|
|
48
|
-
op = body.call(thisArg, _);
|
|
49
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
54
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
55
|
-
};
|
|
56
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
57
|
-
exports.LedgerSigningStargateClient = void 0;
|
|
58
|
-
var encoding_1 = require("@cosmjs/encoding");
|
|
59
|
-
var tendermint_rpc_1 = require("@cosmjs/tendermint-rpc");
|
|
60
|
-
var stargateclient_1 = require("./stargateclient");
|
|
61
|
-
var accounts_1 = require("./accounts");
|
|
62
|
-
var axios_1 = __importDefault(require("axios"));
|
|
63
|
-
var any_1 = require("../google/protobuf/any");
|
|
64
|
-
var LedgerSigningStargateClient = /** @class */ (function (_super) {
|
|
65
|
-
__extends(LedgerSigningStargateClient, _super);
|
|
66
|
-
function LedgerSigningStargateClient(cometClient, options) {
|
|
67
|
-
return _super.call(this, cometClient, options) || this;
|
|
68
|
-
}
|
|
69
|
-
LedgerSigningStargateClient.connectWithSigner = function (endpoint) {
|
|
70
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
71
|
-
var tempCometClient;
|
|
72
|
-
return __generator(this, function (_a) {
|
|
73
|
-
switch (_a.label) {
|
|
74
|
-
case 0:
|
|
75
|
-
LedgerSigningStargateClient._endpoint = endpoint;
|
|
76
|
-
return [4 /*yield*/, tendermint_rpc_1.connectComet(endpoint)];
|
|
77
|
-
case 1:
|
|
78
|
-
tempCometClient = _a.sent();
|
|
79
|
-
return [2 /*return*/, new LedgerSigningStargateClient(tempCometClient, {})];
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
});
|
|
83
|
-
};
|
|
84
|
-
LedgerSigningStargateClient.prototype.getSignerData = function (address) {
|
|
85
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
86
|
-
var chainID, account;
|
|
87
|
-
return __generator(this, function (_a) {
|
|
88
|
-
switch (_a.label) {
|
|
89
|
-
case 0: return [4 /*yield*/, this.getChainId()];
|
|
90
|
-
case 1:
|
|
91
|
-
chainID = _a.sent();
|
|
92
|
-
return [4 /*yield*/, this.getAccount(address)];
|
|
93
|
-
case 2:
|
|
94
|
-
account = _a.sent();
|
|
95
|
-
if (!account)
|
|
96
|
-
throw new Error("Account not found");
|
|
97
|
-
return [2 /*return*/, {
|
|
98
|
-
account_number: account.accountNumber.toString(),
|
|
99
|
-
sequence: account.sequence.toString(),
|
|
100
|
-
chain_id: chainID,
|
|
101
|
-
}];
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
});
|
|
105
|
-
};
|
|
106
|
-
LedgerSigningStargateClient.prototype.getChainId = function () {
|
|
107
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
108
|
-
var status_1, chainId;
|
|
109
|
-
return __generator(this, function (_a) {
|
|
110
|
-
switch (_a.label) {
|
|
111
|
-
case 0:
|
|
112
|
-
if (!!this.chainId) return [3 /*break*/, 2];
|
|
113
|
-
return [4 /*yield*/, this.forceGetCometClient().status()];
|
|
114
|
-
case 1:
|
|
115
|
-
status_1 = _a.sent();
|
|
116
|
-
chainId = status_1.nodeInfo.network;
|
|
117
|
-
if (!chainId)
|
|
118
|
-
throw new Error("Chain ID must not be empty");
|
|
119
|
-
this.chainId = chainId;
|
|
120
|
-
_a.label = 2;
|
|
121
|
-
case 2: return [2 /*return*/, this.chainId];
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
});
|
|
125
|
-
};
|
|
126
|
-
LedgerSigningStargateClient.prototype.toAccAddress = function (address) {
|
|
127
|
-
return encoding_1.fromBech32(address).data;
|
|
128
|
-
};
|
|
129
|
-
LedgerSigningStargateClient.prototype.getAccount = function (address) {
|
|
130
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
131
|
-
var accAddress, hexAccAddress, axios, path, params, response, base64Value, decoded, account, finalAccount, error_1;
|
|
132
|
-
return __generator(this, function (_a) {
|
|
133
|
-
switch (_a.label) {
|
|
134
|
-
case 0:
|
|
135
|
-
_a.trys.push([0, 2, , 3]);
|
|
136
|
-
accAddress = this.toAccAddress(address);
|
|
137
|
-
hexAccAddress = "0x01" + Buffer.from(accAddress).toString("hex");
|
|
138
|
-
axios = axios_1.default.create({
|
|
139
|
-
baseURL: LedgerSigningStargateClient._endpoint,
|
|
140
|
-
headers: { Accept: "application/json" },
|
|
141
|
-
timeout: 15000,
|
|
142
|
-
});
|
|
143
|
-
path = "/abci_query";
|
|
144
|
-
params = {
|
|
145
|
-
path: "/store/acc/key",
|
|
146
|
-
data: hexAccAddress,
|
|
147
|
-
};
|
|
148
|
-
return [4 /*yield*/, axios.get(path, { params: params })];
|
|
149
|
-
case 1:
|
|
150
|
-
response = _a.sent();
|
|
151
|
-
base64Value = response.data.result.response.value;
|
|
152
|
-
if (!base64Value)
|
|
153
|
-
return [2 /*return*/, null];
|
|
154
|
-
decoded = Buffer.from(base64Value, "base64");
|
|
155
|
-
account = any_1.Any.decode(decoded);
|
|
156
|
-
finalAccount = accounts_1.accountFromAny(account);
|
|
157
|
-
return [2 /*return*/, finalAccount];
|
|
158
|
-
case 2:
|
|
159
|
-
error_1 = _a.sent();
|
|
160
|
-
console.error("getAccount error:", error_1);
|
|
161
|
-
return [2 /*return*/, null];
|
|
162
|
-
case 3: return [2 /*return*/];
|
|
163
|
-
}
|
|
164
|
-
});
|
|
165
|
-
});
|
|
166
|
-
};
|
|
167
|
-
LedgerSigningStargateClient._endpoint = "";
|
|
168
|
-
return LedgerSigningStargateClient;
|
|
169
|
-
}(stargateclient_1.StargateClient));
|
|
170
|
-
exports.LedgerSigningStargateClient = LedgerSigningStargateClient;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { AminoMsg } from "@cosmjs/amino";
|
|
2
|
-
import { EncodeObject } from "@cosmjs/proto-signing";
|
|
3
|
-
export interface AminoConverter {
|
|
4
|
-
readonly aminoType: string;
|
|
5
|
-
readonly toAmino: (value: any) => any;
|
|
6
|
-
readonly fromAmino: (value: any) => any;
|
|
7
|
-
}
|
|
8
|
-
/** A map from protobuf type URL to the AminoConverter implementation if supported on chain */
|
|
9
|
-
export declare type AminoConverters = Record<string, AminoConverter>;
|
|
10
|
-
/**
|
|
11
|
-
* A map from Stargate message types as used in the messages's `Any` type
|
|
12
|
-
* to Amino types.
|
|
13
|
-
*/
|
|
14
|
-
export declare class AminoTypes {
|
|
15
|
-
private readonly register;
|
|
16
|
-
constructor(types: AminoConverters);
|
|
17
|
-
toAmino({ typeUrl, value }: EncodeObject): AminoMsg;
|
|
18
|
-
fromAmino({ type, value }: AminoMsg): EncodeObject;
|
|
19
|
-
}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
3
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
4
|
-
if (!m) return o;
|
|
5
|
-
var i = m.call(o), r, ar = [], e;
|
|
6
|
-
try {
|
|
7
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
8
|
-
}
|
|
9
|
-
catch (error) { e = { error: error }; }
|
|
10
|
-
finally {
|
|
11
|
-
try {
|
|
12
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
13
|
-
}
|
|
14
|
-
finally { if (e) throw e.error; }
|
|
15
|
-
}
|
|
16
|
-
return ar;
|
|
17
|
-
};
|
|
18
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.AminoTypes = void 0;
|
|
20
|
-
/**
|
|
21
|
-
* A map from Stargate message types as used in the messages's `Any` type
|
|
22
|
-
* to Amino types.
|
|
23
|
-
*/
|
|
24
|
-
var AminoTypes = /** @class */ (function () {
|
|
25
|
-
function AminoTypes(types) {
|
|
26
|
-
this.register = types;
|
|
27
|
-
}
|
|
28
|
-
AminoTypes.prototype.toAmino = function (_a) {
|
|
29
|
-
var typeUrl = _a.typeUrl, value = _a.value;
|
|
30
|
-
var converter = this.register[typeUrl];
|
|
31
|
-
if (!converter) {
|
|
32
|
-
throw new Error("Type URL '" + typeUrl + "' does not exist in the Amino message type register. " +
|
|
33
|
-
"If you need support for this message type, you can pass in additional entries to the AminoTypes constructor. " +
|
|
34
|
-
"If you think this message type should be included by default, please open an issue at https://github.com/cosmos/cosmjs/issues.");
|
|
35
|
-
}
|
|
36
|
-
return {
|
|
37
|
-
type: converter.aminoType,
|
|
38
|
-
value: converter.toAmino(value),
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
AminoTypes.prototype.fromAmino = function (_a) {
|
|
42
|
-
var type = _a.type, value = _a.value;
|
|
43
|
-
var matches = Object.entries(this.register).filter(function (_a) {
|
|
44
|
-
var _b = __read(_a, 2), _typeUrl = _b[0], aminoType = _b[1].aminoType;
|
|
45
|
-
return aminoType === type;
|
|
46
|
-
});
|
|
47
|
-
switch (matches.length) {
|
|
48
|
-
case 0: {
|
|
49
|
-
throw new Error("Amino type identifier '" + type + "' does not exist in the Amino message type register. " +
|
|
50
|
-
"If you need support for this message type, you can pass in additional entries to the AminoTypes constructor. " +
|
|
51
|
-
"If you think this message type should be included by default, please open an issue at https://github.com/cosmos/cosmjs/issues.");
|
|
52
|
-
}
|
|
53
|
-
case 1: {
|
|
54
|
-
var _b = __read(matches[0], 2), typeUrl = _b[0], converter = _b[1];
|
|
55
|
-
return {
|
|
56
|
-
typeUrl: typeUrl,
|
|
57
|
-
value: converter.fromAmino(value),
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
default:
|
|
61
|
-
throw new Error("Multiple types are registered with Amino type identifier '" + type + "': '" +
|
|
62
|
-
matches
|
|
63
|
-
.map(function (_a) {
|
|
64
|
-
var _b = __read(_a, 2), key = _b[0], _value = _b[1];
|
|
65
|
-
return key;
|
|
66
|
-
})
|
|
67
|
-
.sort()
|
|
68
|
-
.join("', '") +
|
|
69
|
-
"'. Thus fromAmino cannot be performed.");
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
return AminoTypes;
|
|
73
|
-
}());
|
|
74
|
-
exports.AminoTypes = AminoTypes;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Any } from "cosmjs-types/google/protobuf/any";
|
|
2
|
-
import { QueryClient } from "../../queryclient";
|
|
3
|
-
export interface AuthExtension {
|
|
4
|
-
readonly auth: {
|
|
5
|
-
/**
|
|
6
|
-
* Returns an account if it exists and `null` otherwise.
|
|
7
|
-
*
|
|
8
|
-
* The account is a protobuf Any in order to be able to support many different
|
|
9
|
-
* account types in one API. The caller needs to switch over the expected and supported
|
|
10
|
-
* `typeUrl` and decode the `value` using its own type decoder.
|
|
11
|
-
*/
|
|
12
|
-
readonly account: (address: string) => Promise<Any | null>;
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
export declare function setupAuthExtension(base: QueryClient): AuthExtension;
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
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
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.setupAuthExtension = void 0;
|
|
40
|
-
var query_1 = require("cosmjs-types/cosmos/auth/v1beta1/query");
|
|
41
|
-
var queryclient_1 = require("../../queryclient");
|
|
42
|
-
function setupAuthExtension(base) {
|
|
43
|
-
var _this = this;
|
|
44
|
-
var rpc = queryclient_1.createProtobufRpcClient(base);
|
|
45
|
-
// Use this service to get easy typed access to query methods
|
|
46
|
-
// This cannot be used for proof verification
|
|
47
|
-
var queryService = new query_1.QueryClientImpl(rpc);
|
|
48
|
-
return {
|
|
49
|
-
auth: {
|
|
50
|
-
account: function (address) { return __awaiter(_this, void 0, void 0, function () {
|
|
51
|
-
var account;
|
|
52
|
-
return __generator(this, function (_a) {
|
|
53
|
-
switch (_a.label) {
|
|
54
|
-
case 0: return [4 /*yield*/, queryService.Account({ address: address })];
|
|
55
|
-
case 1:
|
|
56
|
-
account = (_a.sent()).account;
|
|
57
|
-
return [2 /*return*/, account !== null && account !== void 0 ? account : null];
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
}); },
|
|
61
|
-
},
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
exports.setupAuthExtension = setupAuthExtension;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createAuthzAminoConverters = void 0;
|
|
4
|
-
function createAuthzAminoConverters() {
|
|
5
|
-
return {
|
|
6
|
-
// For Cosmos SDK < 0.46 the Amino JSON codec was broken on chain and thus inaccessible.
|
|
7
|
-
// Now this can be implemented for 0.46+ chains, see
|
|
8
|
-
// https://github.com/cosmos/cosmjs/issues/1092
|
|
9
|
-
//
|
|
10
|
-
// "/cosmos.authz.v1beta1.MsgGrant": IMPLEMENT ME,
|
|
11
|
-
// "/cosmos.authz.v1beta1.MsgExec": IMPLEMENT ME,
|
|
12
|
-
// "/cosmos.authz.v1beta1.MsgRevoke": IMPLEMENT ME,
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
exports.createAuthzAminoConverters = createAuthzAminoConverters;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.authzTypes = void 0;
|
|
4
|
-
var tx_1 = require("cosmjs-types/cosmos/authz/v1beta1/tx");
|
|
5
|
-
exports.authzTypes = [
|
|
6
|
-
["/cosmos.authz.v1beta1.MsgExec", tx_1.MsgExec],
|
|
7
|
-
["/cosmos.authz.v1beta1.MsgGrant", tx_1.MsgGrant],
|
|
8
|
-
["/cosmos.authz.v1beta1.MsgRevoke", tx_1.MsgRevoke],
|
|
9
|
-
];
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { QueryGranteeGrantsResponse, QueryGranterGrantsResponse, QueryGrantsResponse } from "cosmjs-types/cosmos/authz/v1beta1/query";
|
|
2
|
-
import { QueryClient } from "../../queryclient";
|
|
3
|
-
export interface AuthzExtension {
|
|
4
|
-
readonly authz: {
|
|
5
|
-
readonly grants: (granter: string, grantee: string, msgTypeUrl: string, paginationKey?: Uint8Array) => Promise<QueryGrantsResponse>;
|
|
6
|
-
readonly granteeGrants: (grantee: string, paginationKey?: Uint8Array) => Promise<QueryGranteeGrantsResponse>;
|
|
7
|
-
readonly granterGrants: (granter: string, paginationKey?: Uint8Array) => Promise<QueryGranterGrantsResponse>;
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
export declare function setupAuthzExtension(base: QueryClient): AuthzExtension;
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
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
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.setupAuthzExtension = void 0;
|
|
40
|
-
var query_1 = require("cosmjs-types/cosmos/authz/v1beta1/query");
|
|
41
|
-
var queryclient_1 = require("../../queryclient");
|
|
42
|
-
function setupAuthzExtension(base) {
|
|
43
|
-
var _this = this;
|
|
44
|
-
// Use this service to get easy typed access to query methods
|
|
45
|
-
// This cannot be used for proof verification
|
|
46
|
-
var rpc = queryclient_1.createProtobufRpcClient(base);
|
|
47
|
-
var queryService = new query_1.QueryClientImpl(rpc);
|
|
48
|
-
return {
|
|
49
|
-
authz: {
|
|
50
|
-
grants: function (granter, grantee, msgTypeUrl, paginationKey) { return __awaiter(_this, void 0, void 0, function () {
|
|
51
|
-
return __generator(this, function (_a) {
|
|
52
|
-
switch (_a.label) {
|
|
53
|
-
case 0: return [4 /*yield*/, queryService.Grants({
|
|
54
|
-
granter: granter,
|
|
55
|
-
grantee: grantee,
|
|
56
|
-
msgTypeUrl: msgTypeUrl,
|
|
57
|
-
pagination: queryclient_1.createPagination(paginationKey),
|
|
58
|
-
})];
|
|
59
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
}); },
|
|
63
|
-
granteeGrants: function (grantee, paginationKey) { return __awaiter(_this, void 0, void 0, function () {
|
|
64
|
-
return __generator(this, function (_a) {
|
|
65
|
-
switch (_a.label) {
|
|
66
|
-
case 0: return [4 /*yield*/, queryService.GranteeGrants({
|
|
67
|
-
grantee: grantee,
|
|
68
|
-
pagination: queryclient_1.createPagination(paginationKey),
|
|
69
|
-
})];
|
|
70
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
}); },
|
|
74
|
-
granterGrants: function (granter, paginationKey) { return __awaiter(_this, void 0, void 0, function () {
|
|
75
|
-
return __generator(this, function (_a) {
|
|
76
|
-
switch (_a.label) {
|
|
77
|
-
case 0: return [4 /*yield*/, queryService.GranterGrants({
|
|
78
|
-
granter: granter,
|
|
79
|
-
pagination: queryclient_1.createPagination(paginationKey),
|
|
80
|
-
})];
|
|
81
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
}); },
|
|
85
|
-
},
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
exports.setupAuthzExtension = setupAuthzExtension;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { AminoMsg, Coin } from "@cosmjs/amino";
|
|
2
|
-
import { AminoConverters } from "../../aminotypes";
|
|
3
|
-
/** A high level transaction of the coin module */
|
|
4
|
-
export interface AminoMsgSend extends AminoMsg {
|
|
5
|
-
readonly type: "cosmos-sdk/MsgSend";
|
|
6
|
-
readonly value: {
|
|
7
|
-
/** Bech32 account address */
|
|
8
|
-
readonly from_address: string;
|
|
9
|
-
/** Bech32 account address */
|
|
10
|
-
readonly to_address: string;
|
|
11
|
-
readonly amount: readonly Coin[];
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
export declare function isAminoMsgSend(msg: AminoMsg): msg is AminoMsgSend;
|
|
15
|
-
interface Input {
|
|
16
|
-
/** Bech32 account address */
|
|
17
|
-
readonly address: string;
|
|
18
|
-
readonly coins: readonly Coin[];
|
|
19
|
-
}
|
|
20
|
-
interface Output {
|
|
21
|
-
/** Bech32 account address */
|
|
22
|
-
readonly address: string;
|
|
23
|
-
readonly coins: readonly Coin[];
|
|
24
|
-
}
|
|
25
|
-
/** A high level transaction of the coin module */
|
|
26
|
-
export interface AminoMsgMultiSend extends AminoMsg {
|
|
27
|
-
readonly type: "cosmos-sdk/MsgMultiSend";
|
|
28
|
-
readonly value: {
|
|
29
|
-
readonly inputs: readonly Input[];
|
|
30
|
-
readonly outputs: readonly Output[];
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
export declare function isAminoMsgMultiSend(msg: AminoMsg): msg is AminoMsgMultiSend;
|
|
34
|
-
export declare function createBankAminoConverters(): AminoConverters;
|
|
35
|
-
export {};
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
3
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
4
|
-
if (!m) return o;
|
|
5
|
-
var i = m.call(o), r, ar = [], e;
|
|
6
|
-
try {
|
|
7
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
8
|
-
}
|
|
9
|
-
catch (error) { e = { error: error }; }
|
|
10
|
-
finally {
|
|
11
|
-
try {
|
|
12
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
13
|
-
}
|
|
14
|
-
finally { if (e) throw e.error; }
|
|
15
|
-
}
|
|
16
|
-
return ar;
|
|
17
|
-
};
|
|
18
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
19
|
-
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
20
|
-
to[j] = from[i];
|
|
21
|
-
return to;
|
|
22
|
-
};
|
|
23
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
-
exports.createBankAminoConverters = exports.isAminoMsgMultiSend = exports.isAminoMsgSend = void 0;
|
|
25
|
-
function isAminoMsgSend(msg) {
|
|
26
|
-
return msg.type === "cosmos-sdk/MsgSend";
|
|
27
|
-
}
|
|
28
|
-
exports.isAminoMsgSend = isAminoMsgSend;
|
|
29
|
-
function isAminoMsgMultiSend(msg) {
|
|
30
|
-
return msg.type === "cosmos-sdk/MsgMultiSend";
|
|
31
|
-
}
|
|
32
|
-
exports.isAminoMsgMultiSend = isAminoMsgMultiSend;
|
|
33
|
-
function createBankAminoConverters() {
|
|
34
|
-
return {
|
|
35
|
-
"/cosmos.bank.v1beta1.MsgSend": {
|
|
36
|
-
aminoType: "cosmos-sdk/MsgSend",
|
|
37
|
-
toAmino: function (_a) {
|
|
38
|
-
var fromAddress = _a.fromAddress, toAddress = _a.toAddress, amount = _a.amount;
|
|
39
|
-
return ({
|
|
40
|
-
from_address: fromAddress,
|
|
41
|
-
to_address: toAddress,
|
|
42
|
-
amount: __spreadArray([], __read(amount)),
|
|
43
|
-
});
|
|
44
|
-
},
|
|
45
|
-
fromAmino: function (_a) {
|
|
46
|
-
var from_address = _a.from_address, to_address = _a.to_address, amount = _a.amount;
|
|
47
|
-
return ({
|
|
48
|
-
fromAddress: from_address,
|
|
49
|
-
toAddress: to_address,
|
|
50
|
-
amount: __spreadArray([], __read(amount)),
|
|
51
|
-
});
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
"/cosmos.bank.v1beta1.MsgMultiSend": {
|
|
55
|
-
aminoType: "cosmos-sdk/MsgMultiSend",
|
|
56
|
-
toAmino: function (_a) {
|
|
57
|
-
var inputs = _a.inputs, outputs = _a.outputs;
|
|
58
|
-
return ({
|
|
59
|
-
inputs: inputs.map(function (input) { return ({
|
|
60
|
-
address: input.address,
|
|
61
|
-
coins: __spreadArray([], __read(input.coins)),
|
|
62
|
-
}); }),
|
|
63
|
-
outputs: outputs.map(function (output) { return ({
|
|
64
|
-
address: output.address,
|
|
65
|
-
coins: __spreadArray([], __read(output.coins)),
|
|
66
|
-
}); }),
|
|
67
|
-
});
|
|
68
|
-
},
|
|
69
|
-
fromAmino: function (_a) {
|
|
70
|
-
var inputs = _a.inputs, outputs = _a.outputs;
|
|
71
|
-
return ({
|
|
72
|
-
inputs: inputs.map(function (input) { return ({
|
|
73
|
-
address: input.address,
|
|
74
|
-
coins: __spreadArray([], __read(input.coins)),
|
|
75
|
-
}); }),
|
|
76
|
-
outputs: outputs.map(function (output) { return ({
|
|
77
|
-
address: output.address,
|
|
78
|
-
coins: __spreadArray([], __read(output.coins)),
|
|
79
|
-
}); }),
|
|
80
|
-
});
|
|
81
|
-
},
|
|
82
|
-
},
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
exports.createBankAminoConverters = createBankAminoConverters;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { EncodeObject, GeneratedType } from "@cosmjs/proto-signing";
|
|
2
|
-
import { MsgSend } from "cosmjs-types/cosmos/bank/v1beta1/tx";
|
|
3
|
-
export declare const bankTypes: ReadonlyArray<[string, GeneratedType]>;
|
|
4
|
-
export interface MsgSendEncodeObject extends EncodeObject {
|
|
5
|
-
readonly typeUrl: "/cosmos.bank.v1beta1.MsgSend";
|
|
6
|
-
readonly value: Partial<MsgSend>;
|
|
7
|
-
}
|
|
8
|
-
export declare function isMsgSendEncodeObject(encodeObject: EncodeObject): encodeObject is MsgSendEncodeObject;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isMsgSendEncodeObject = exports.bankTypes = void 0;
|
|
4
|
-
var tx_1 = require("cosmjs-types/cosmos/bank/v1beta1/tx");
|
|
5
|
-
exports.bankTypes = [
|
|
6
|
-
["/cosmos.bank.v1beta1.MsgMultiSend", tx_1.MsgMultiSend],
|
|
7
|
-
["/cosmos.bank.v1beta1.MsgSend", tx_1.MsgSend],
|
|
8
|
-
];
|
|
9
|
-
function isMsgSendEncodeObject(encodeObject) {
|
|
10
|
-
return encodeObject.typeUrl === "/cosmos.bank.v1beta1.MsgSend";
|
|
11
|
-
}
|
|
12
|
-
exports.isMsgSendEncodeObject = isMsgSendEncodeObject;
|