@firmachain/firma-js 0.2.37 → 0.2.40
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.d.ts +16 -0
- package/dist/index.js +32 -0
- package/dist/sdk/FirmaAuthzService.d.ts +41 -0
- package/dist/sdk/FirmaAuthzService.js +633 -0
- package/dist/sdk/FirmaBankService.d.ts +17 -0
- package/dist/sdk/FirmaBankService.js +236 -0
- package/dist/sdk/FirmaChainService.d.ts +8 -0
- package/dist/sdk/FirmaChainService.js +86 -0
- package/dist/sdk/FirmaConfig.d.ts +18 -0
- package/dist/sdk/FirmaConfig.js +63 -0
- package/dist/sdk/FirmaContractService.d.ts +32 -0
- package/dist/sdk/FirmaContractService.js +434 -0
- package/dist/sdk/FirmaCosmWasmService.d.ts +38 -0
- package/dist/sdk/FirmaCosmWasmService.js +667 -0
- package/dist/sdk/FirmaDistributionService.d.ts +32 -0
- package/dist/sdk/FirmaDistributionService.js +527 -0
- package/dist/sdk/FirmaFeeGrantService.d.ts +21 -0
- package/dist/sdk/FirmaFeeGrantService.js +341 -0
- package/dist/sdk/FirmaGovService.d.ts +35 -0
- package/dist/sdk/FirmaGovService.js +775 -0
- package/dist/sdk/FirmaIbcService.d.ts +15 -0
- package/dist/sdk/FirmaIbcService.js +144 -0
- package/dist/sdk/FirmaIpfsService.d.ts +10 -0
- package/dist/sdk/FirmaIpfsService.js +143 -0
- package/dist/sdk/FirmaMobileSDK.d.ts +29 -0
- package/dist/sdk/FirmaMobileSDK.js +48 -0
- package/dist/sdk/FirmaNftService.d.ts +31 -0
- package/dist/sdk/FirmaNftService.js +372 -0
- package/dist/sdk/FirmaSDK.d.ts +35 -0
- package/dist/sdk/FirmaSDK.js +57 -0
- package/dist/sdk/FirmaSlashingService.d.ts +9 -0
- package/dist/sdk/FirmaSlashingService.js +105 -0
- package/dist/sdk/FirmaStakingService.d.ts +47 -0
- package/dist/sdk/FirmaStakingService.js +611 -0
- package/dist/sdk/FirmaTokenService.d.ts +26 -0
- package/dist/sdk/FirmaTokenService.js +416 -0
- package/dist/sdk/FirmaUtil.d.ts +56 -0
- package/dist/sdk/FirmaUtil.js +430 -0
- package/dist/sdk/FirmaWalletService.d.ts +39 -0
- package/dist/sdk/FirmaWalletService.js +317 -0
- package/dist/sdk/firmachain/amino/addresses.d.ts +5 -0
- package/dist/sdk/firmachain/amino/addresses.js +46 -0
- package/dist/sdk/firmachain/amino/aminomsgs.d.ts +281 -0
- package/dist/sdk/firmachain/amino/aminomsgs.js +77 -0
- package/dist/sdk/firmachain/amino/aminotypes.d.ts +22 -0
- package/dist/sdk/firmachain/amino/aminotypes.js +525 -0
- package/dist/sdk/firmachain/amino/coins.d.ts +30 -0
- package/dist/sdk/firmachain/amino/coins.js +69 -0
- package/dist/sdk/firmachain/amino/encoding.d.ts +24 -0
- package/dist/sdk/firmachain/amino/encoding.js +238 -0
- package/dist/sdk/firmachain/amino/multisig.d.ts +10 -0
- package/dist/sdk/firmachain/amino/multisig.js +42 -0
- package/dist/sdk/firmachain/amino/paths.d.ts +6 -0
- package/dist/sdk/firmachain/amino/paths.js +18 -0
- package/dist/sdk/firmachain/amino/pubkeys.d.ts +47 -0
- package/dist/sdk/firmachain/amino/pubkeys.js +29 -0
- package/dist/sdk/firmachain/amino/signature.d.ts +16 -0
- package/dist/sdk/firmachain/amino/signature.js +36 -0
- package/dist/sdk/firmachain/amino/signdoc.d.ts +26 -0
- package/dist/sdk/firmachain/amino/signdoc.js +42 -0
- package/dist/sdk/firmachain/amino/signer.d.ts +32 -0
- package/dist/sdk/firmachain/amino/signer.js +2 -0
- package/dist/sdk/firmachain/amino/stdtx.d.ts +15 -0
- package/dist/sdk/firmachain/amino/stdtx.js +17 -0
- package/dist/sdk/firmachain/amino/wallet.d.ts +32 -0
- package/dist/sdk/firmachain/amino/wallet.js +136 -0
- package/dist/sdk/firmachain/authz/AuthzQueryClient.d.ts +48 -0
- package/dist/sdk/firmachain/authz/AuthzQueryClient.js +142 -0
- package/dist/sdk/firmachain/authz/AuthzTxClient.d.ts +23 -0
- package/dist/sdk/firmachain/authz/AuthzTxClient.js +47 -0
- package/dist/sdk/firmachain/authz/AuthzTxTypes.d.ts +147 -0
- package/dist/sdk/firmachain/authz/AuthzTxTypes.js +358 -0
- package/dist/sdk/firmachain/authz/index.d.ts +4 -0
- package/dist/sdk/firmachain/authz/index.js +20 -0
- package/dist/sdk/firmachain/bank/BankQueryClient.d.ts +12 -0
- package/dist/sdk/firmachain/bank/BankQueryClient.js +116 -0
- package/dist/sdk/firmachain/bank/BankTxClient.d.ts +18 -0
- package/dist/sdk/firmachain/bank/BankTxClient.js +43 -0
- package/dist/sdk/firmachain/bank/index.d.ts +3 -0
- package/dist/sdk/firmachain/bank/index.js +19 -0
- package/dist/sdk/firmachain/common/CommonTxClient.d.ts +7 -0
- package/dist/sdk/firmachain/common/CommonTxClient.js +79 -0
- package/dist/sdk/firmachain/common/ITxClient.d.ts +18 -0
- package/dist/sdk/firmachain/common/ITxClient.js +117 -0
- package/dist/sdk/firmachain/common/LedgerSigningStargateClient.d.ts +27 -0
- package/dist/sdk/firmachain/common/LedgerSigningStargateClient.js +165 -0
- package/dist/sdk/firmachain/common/LedgerWallet.d.ts +14 -0
- package/dist/sdk/firmachain/common/LedgerWallet.js +151 -0
- package/dist/sdk/firmachain/common/QueryCommon.d.ts +4 -0
- package/dist/sdk/firmachain/common/QueryCommon.js +2 -0
- package/dist/sdk/firmachain/common/TendermintQueryClient.d.ts +42 -0
- package/dist/sdk/firmachain/common/TendermintQueryClient.js +111 -0
- package/dist/sdk/firmachain/common/TxCommon.d.ts +87 -0
- package/dist/sdk/firmachain/common/TxCommon.js +18 -0
- package/dist/sdk/firmachain/common/accounts.d.ts +16 -0
- package/dist/sdk/firmachain/common/accounts.js +64 -0
- package/dist/sdk/firmachain/common/index.d.ts +2 -0
- package/dist/sdk/firmachain/common/index.js +18 -0
- package/dist/sdk/firmachain/common/signing.d.ts +10 -0
- package/dist/sdk/firmachain/common/signing.js +79 -0
- package/dist/sdk/firmachain/common/signingaminostargateclient.d.ts +50 -0
- package/dist/sdk/firmachain/common/signingaminostargateclient.js +267 -0
- package/dist/sdk/firmachain/common/signingstargateclient.d.ts +44 -0
- package/dist/sdk/firmachain/common/signingstargateclient.js +361 -0
- package/dist/sdk/firmachain/common/stargateclient.d.ts +46 -0
- package/dist/sdk/firmachain/common/stargateclient.js +211 -0
- package/dist/sdk/firmachain/contract/ContractQueryClient.d.ts +32 -0
- package/dist/sdk/firmachain/contract/ContractQueryClient.js +156 -0
- package/dist/sdk/firmachain/contract/ContractTxClient.d.ts +18 -0
- package/dist/sdk/firmachain/contract/ContractTxClient.js +43 -0
- package/dist/sdk/firmachain/contract/ContractTxTypes.d.ts +69 -0
- package/dist/sdk/firmachain/contract/ContractTxTypes.js +483 -0
- package/dist/sdk/firmachain/contract/index.d.ts +3 -0
- package/dist/sdk/firmachain/contract/index.js +19 -0
- package/dist/sdk/firmachain/cosmwasm/CosmWasmQueryClient.d.ts +52 -0
- package/dist/sdk/firmachain/cosmwasm/CosmWasmQueryClient.js +193 -0
- package/dist/sdk/firmachain/cosmwasm/CosmWasmTxClient.d.ts +38 -0
- package/dist/sdk/firmachain/cosmwasm/CosmWasmTxClient.js +59 -0
- package/dist/sdk/firmachain/cosmwasm/index.d.ts +3 -0
- package/dist/sdk/firmachain/cosmwasm/index.js +19 -0
- package/dist/sdk/firmachain/distribution/DistributionQueryClient.d.ts +18 -0
- package/dist/sdk/firmachain/distribution/DistributionQueryClient.js +167 -0
- package/dist/sdk/firmachain/distribution/DistributionTxClient.d.ts +28 -0
- package/dist/sdk/firmachain/distribution/DistributionTxClient.js +51 -0
- package/dist/sdk/firmachain/distribution/index.d.ts +3 -0
- package/dist/sdk/firmachain/distribution/index.js +19 -0
- package/dist/sdk/firmachain/feegrant/FeeGrantQueryClient.d.ts +17 -0
- package/dist/sdk/firmachain/feegrant/FeeGrantQueryClient.js +86 -0
- package/dist/sdk/firmachain/feegrant/FeeGrantTxClient.d.ts +18 -0
- package/dist/sdk/firmachain/feegrant/FeeGrantTxClient.js +43 -0
- package/dist/sdk/firmachain/feegrant/FeeGrantTxTypes.d.ts +76 -0
- package/dist/sdk/firmachain/feegrant/FeeGrantTxTypes.js +194 -0
- package/dist/sdk/firmachain/feegrant/index.d.ts +3 -0
- package/dist/sdk/firmachain/feegrant/index.js +19 -0
- package/dist/sdk/firmachain/google/protobuf/any.d.ts +128 -0
- package/dist/sdk/firmachain/google/protobuf/any.js +106 -0
- package/dist/sdk/firmachain/google/protobuf/descriptor.d.ts +996 -0
- package/dist/sdk/firmachain/google/protobuf/descriptor.js +5329 -0
- package/dist/sdk/firmachain/google/protobuf/duration.d.ts +91 -0
- package/dist/sdk/firmachain/google/protobuf/duration.js +107 -0
- package/dist/sdk/firmachain/google/protobuf/timestamp.d.ts +109 -0
- package/dist/sdk/firmachain/google/protobuf/timestamp.js +107 -0
- package/dist/sdk/firmachain/gov/GovQueryClient.d.ts +61 -0
- package/dist/sdk/firmachain/gov/GovQueryClient.js +152 -0
- package/dist/sdk/firmachain/gov/GovTxClient.d.ts +23 -0
- package/dist/sdk/firmachain/gov/GovTxClient.js +47 -0
- package/dist/sdk/firmachain/gov/index.d.ts +3 -0
- package/dist/sdk/firmachain/gov/index.js +19 -0
- package/dist/sdk/firmachain/ibc/IbcQueryClient.d.ts +34 -0
- package/dist/sdk/firmachain/ibc/IbcQueryClient.js +71 -0
- package/dist/sdk/firmachain/ibc/IbcTxClient.d.ts +13 -0
- package/dist/sdk/firmachain/ibc/IbcTxClient.js +39 -0
- package/dist/sdk/firmachain/ibc/index.d.ts +3 -0
- package/dist/sdk/firmachain/ibc/index.js +19 -0
- package/dist/sdk/firmachain/nft/NftQueryClient.d.ts +20 -0
- package/dist/sdk/firmachain/nft/NftQueryClient.js +125 -0
- package/dist/sdk/firmachain/nft/NftTxClient.d.ts +23 -0
- package/dist/sdk/firmachain/nft/NftTxClient.js +47 -0
- package/dist/sdk/firmachain/nft/NftTxTypes.d.ts +86 -0
- package/dist/sdk/firmachain/nft/NftTxTypes.js +424 -0
- package/dist/sdk/firmachain/nft/index.d.ts +3 -0
- package/dist/sdk/firmachain/nft/index.js +19 -0
- package/dist/sdk/firmachain/slashing/SlashingQueryClient.d.ts +22 -0
- package/dist/sdk/firmachain/slashing/SlashingQueryClient.js +101 -0
- package/dist/sdk/firmachain/slashing/index.d.ts +2 -0
- package/dist/sdk/firmachain/slashing/index.js +18 -0
- package/dist/sdk/firmachain/staking/StakingQueryClient.d.ts +106 -0
- package/dist/sdk/firmachain/staking/StakingQueryClient.js +243 -0
- package/dist/sdk/firmachain/staking/StakingTxClient.d.ts +33 -0
- package/dist/sdk/firmachain/staking/StakingTxClient.js +55 -0
- package/dist/sdk/firmachain/staking/index.d.ts +3 -0
- package/dist/sdk/firmachain/staking/index.js +19 -0
- package/dist/sdk/firmachain/token/TokenQueryClient.d.ts +24 -0
- package/dist/sdk/firmachain/token/TokenQueryClient.js +106 -0
- package/dist/sdk/firmachain/token/TokenTxClient.d.ts +28 -0
- package/dist/sdk/firmachain/token/TokenTxClient.js +51 -0
- package/dist/sdk/firmachain/token/TokenTxTypes.d.ts +116 -0
- package/dist/sdk/firmachain/token/TokenTxTypes.js +685 -0
- package/dist/sdk/firmachain/token/index.d.ts +3 -0
- package/dist/sdk/firmachain/token/index.js +19 -0
- package/package.json +3 -7
|
@@ -0,0 +1,111 @@
|
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
+
};
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
exports.TendermintQueryClient = void 0;
|
|
43
|
+
var axios_1 = __importDefault(require("axios"));
|
|
44
|
+
var TendermintQueryClient = /** @class */ (function () {
|
|
45
|
+
function TendermintQueryClient(baseUrl) {
|
|
46
|
+
this.axios = axios_1.default.create({
|
|
47
|
+
baseURL: baseUrl,
|
|
48
|
+
headers: {
|
|
49
|
+
Accept: "application/json",
|
|
50
|
+
},
|
|
51
|
+
timeout: 15000,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
TendermintQueryClient.prototype.queryEstimateGas = function (hexTx) {
|
|
55
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
56
|
+
var path, result, data, jsonString, jsonData;
|
|
57
|
+
return __generator(this, function (_a) {
|
|
58
|
+
switch (_a.label) {
|
|
59
|
+
case 0:
|
|
60
|
+
path = "/abci_query?path=\"app/simulate\"";
|
|
61
|
+
return [4 /*yield*/, this.axios.get(path, { params: { data: hexTx } })];
|
|
62
|
+
case 1:
|
|
63
|
+
result = _a.sent();
|
|
64
|
+
data = result.data.result.response.value;
|
|
65
|
+
if (result.data.result.response.code != 0) {
|
|
66
|
+
throw result.data.result.response.log;
|
|
67
|
+
}
|
|
68
|
+
jsonString = Buffer.from(data, "base64").toString("utf8");
|
|
69
|
+
jsonData = JSON.parse(jsonString);
|
|
70
|
+
return [2 /*return*/, Number.parseInt(jsonData.gas_info.gas_used)];
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
TendermintQueryClient.prototype.queryChainSyncInfo = function () {
|
|
76
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
77
|
+
var path, result;
|
|
78
|
+
return __generator(this, function (_a) {
|
|
79
|
+
switch (_a.label) {
|
|
80
|
+
case 0:
|
|
81
|
+
path = "/status";
|
|
82
|
+
return [4 /*yield*/, this.axios.get(path)];
|
|
83
|
+
case 1:
|
|
84
|
+
result = _a.sent();
|
|
85
|
+
return [2 /*return*/, result.data.result.sync_info];
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
TendermintQueryClient.prototype.queryTransactionHash = function (txHash) {
|
|
91
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
92
|
+
var path, result;
|
|
93
|
+
return __generator(this, function (_a) {
|
|
94
|
+
switch (_a.label) {
|
|
95
|
+
case 0:
|
|
96
|
+
path = "/tx?hash=" + txHash;
|
|
97
|
+
return [4 /*yield*/, this.axios.get(path)];
|
|
98
|
+
case 1:
|
|
99
|
+
result = _a.sent();
|
|
100
|
+
return [2 /*return*/, result.data.result];
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
};
|
|
105
|
+
return TendermintQueryClient;
|
|
106
|
+
}());
|
|
107
|
+
exports.TendermintQueryClient = TendermintQueryClient;
|
|
108
|
+
// https://imperium-lcd.firmachain.org:26657/abci_query?path=%22app/simulate%22&data=0x0a9b010a8d010a1c2f636f736d6f732e62616e6b2e763162657461312e4d736753656e64126d0a2c6669726d6131747271796c65396d326e7679616663326e323566726b70776564323530347936617667667a72122c6669726d6131306e65336e77346b63666a36766a7a38346c326d33676a38767961637a66686d6135666636391a0f0a0475666374120731303030303030120974657374206d656d6f12670a510a460a1f2f636f736d6f732e63727970746f2e736563703235366b312e5075624b657912230a21027b57273b1d23a87862c6a47f214d77b6144b552498c2dff9e9368551b4e08a8c12040a02080118e60412120a0c0a047566637412043230303010c09a0c1a40ce1072ff09660c80595b7ff2fec36062ebcf8fde88947f1fa3f6cb5ff808edba04fcf584f81ce52e5ec9be6724759fb58a411a17ed2816210f4df5b811117e4c
|
|
109
|
+
// 6669726d613177613375346b6e773734723539387175767a7964766361343271736d6b366a727667716e3779
|
|
110
|
+
// curl 'http://0.0.0.0:26657/abci_query?path="/store/acc/key"&data=0x6669726d6131383934767470336461756d737a70397a36306564657074736a786a6667656d656a73646b3277'
|
|
111
|
+
// curl 'http://0.0.0.0:26657/abci_query?path="/account/tbnb1hn8ym9xht925jkncjpf7lhjnax6z8nv2mu9wy3'
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/// <reference types="long" />
|
|
2
|
+
import { Coin } from "cosmjs-types/cosmos/base/v1beta1/coin";
|
|
3
|
+
import { Any } from "../google/protobuf/any";
|
|
4
|
+
export interface StdFee {
|
|
5
|
+
amount: Coin[];
|
|
6
|
+
gas: string;
|
|
7
|
+
granter: string;
|
|
8
|
+
}
|
|
9
|
+
export interface BasicFeeGrantOption {
|
|
10
|
+
spendLimit?: number;
|
|
11
|
+
expiration?: Date;
|
|
12
|
+
}
|
|
13
|
+
export interface PeriodicFeeGrantOption {
|
|
14
|
+
basicSpendLimit?: number;
|
|
15
|
+
basicExpiration?: Date;
|
|
16
|
+
periodSeconds: number;
|
|
17
|
+
periodSpendLimit: number;
|
|
18
|
+
periodCanSpend: number;
|
|
19
|
+
periodReset: Date;
|
|
20
|
+
}
|
|
21
|
+
export declare const DefaultBasicFeeGrantOption: {
|
|
22
|
+
spendLimit: undefined;
|
|
23
|
+
expiration: undefined;
|
|
24
|
+
};
|
|
25
|
+
export interface TxMisc {
|
|
26
|
+
memo?: string;
|
|
27
|
+
fee?: number;
|
|
28
|
+
gas?: number;
|
|
29
|
+
feeGranter?: string;
|
|
30
|
+
}
|
|
31
|
+
export interface SignAndBroadcastOptions {
|
|
32
|
+
fee: StdFee;
|
|
33
|
+
memo: string;
|
|
34
|
+
}
|
|
35
|
+
export interface MsgCreateValidator {
|
|
36
|
+
description?: Description;
|
|
37
|
+
commission?: CommissionRates;
|
|
38
|
+
minSelfDelegation: string;
|
|
39
|
+
delegatorAddress: string;
|
|
40
|
+
validatorAddress: string;
|
|
41
|
+
value: Number;
|
|
42
|
+
}
|
|
43
|
+
export interface CommissionRates {
|
|
44
|
+
/** rate is the commission rate charged to delegators, as a fraction. */
|
|
45
|
+
rate: string;
|
|
46
|
+
/** max_rate defines the maximum commission rate which validator can ever charge, as a fraction. */
|
|
47
|
+
maxRate: string;
|
|
48
|
+
/** max_change_rate defines the maximum daily increase of the validator commission, as a fraction. */
|
|
49
|
+
maxChangeRate: string;
|
|
50
|
+
}
|
|
51
|
+
export interface Description {
|
|
52
|
+
/** moniker defines a human-readable name for the validator. */
|
|
53
|
+
moniker: string;
|
|
54
|
+
/** identity defines an optional identity signature (ex. UPort or Keybase). */
|
|
55
|
+
identity: string;
|
|
56
|
+
/** website defines an optional website link. */
|
|
57
|
+
website: string;
|
|
58
|
+
/** security_contact defines an optional email for security contact. */
|
|
59
|
+
securityContact: string;
|
|
60
|
+
/** details define other optional details. */
|
|
61
|
+
details: string;
|
|
62
|
+
}
|
|
63
|
+
export declare enum VotingOption {
|
|
64
|
+
/** VOTE_OPTION_UNSPECIFIED - VOTE_OPTION_UNSPECIFIED defines a no-op vote option. */
|
|
65
|
+
VOTE_OPTION_UNSPECIFIED = 0,
|
|
66
|
+
/** VOTE_OPTION_YES - VOTE_OPTION_YES defines a yes vote option. */
|
|
67
|
+
VOTE_OPTION_YES = 1,
|
|
68
|
+
/** VOTE_OPTION_ABSTAIN - VOTE_OPTION_ABSTAIN defines an abstain vote option. */
|
|
69
|
+
VOTE_OPTION_ABSTAIN = 2,
|
|
70
|
+
/** VOTE_OPTION_NO - VOTE_OPTION_NO defines a no vote option. */
|
|
71
|
+
VOTE_OPTION_NO = 3,
|
|
72
|
+
/** VOTE_OPTION_NO_WITH_VETO - VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. */
|
|
73
|
+
VOTE_OPTION_NO_WITH_VETO = 4,
|
|
74
|
+
UNRECOGNIZED = -1
|
|
75
|
+
}
|
|
76
|
+
export interface ParamChangeOption {
|
|
77
|
+
subspace: string;
|
|
78
|
+
key: string;
|
|
79
|
+
value: string;
|
|
80
|
+
}
|
|
81
|
+
export interface SoftwareUpgradePlan {
|
|
82
|
+
name: string;
|
|
83
|
+
time?: Date;
|
|
84
|
+
height?: Long;
|
|
85
|
+
info?: string;
|
|
86
|
+
upgradedClientState?: Any;
|
|
87
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VotingOption = exports.DefaultBasicFeeGrantOption = void 0;
|
|
4
|
+
exports.DefaultBasicFeeGrantOption = { spendLimit: undefined, expiration: undefined };
|
|
5
|
+
var VotingOption;
|
|
6
|
+
(function (VotingOption) {
|
|
7
|
+
/** VOTE_OPTION_UNSPECIFIED - VOTE_OPTION_UNSPECIFIED defines a no-op vote option. */
|
|
8
|
+
VotingOption[VotingOption["VOTE_OPTION_UNSPECIFIED"] = 0] = "VOTE_OPTION_UNSPECIFIED";
|
|
9
|
+
/** VOTE_OPTION_YES - VOTE_OPTION_YES defines a yes vote option. */
|
|
10
|
+
VotingOption[VotingOption["VOTE_OPTION_YES"] = 1] = "VOTE_OPTION_YES";
|
|
11
|
+
/** VOTE_OPTION_ABSTAIN - VOTE_OPTION_ABSTAIN defines an abstain vote option. */
|
|
12
|
+
VotingOption[VotingOption["VOTE_OPTION_ABSTAIN"] = 2] = "VOTE_OPTION_ABSTAIN";
|
|
13
|
+
/** VOTE_OPTION_NO - VOTE_OPTION_NO defines a no vote option. */
|
|
14
|
+
VotingOption[VotingOption["VOTE_OPTION_NO"] = 3] = "VOTE_OPTION_NO";
|
|
15
|
+
/** VOTE_OPTION_NO_WITH_VETO - VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. */
|
|
16
|
+
VotingOption[VotingOption["VOTE_OPTION_NO_WITH_VETO"] = 4] = "VOTE_OPTION_NO_WITH_VETO";
|
|
17
|
+
VotingOption[VotingOption["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
18
|
+
})(VotingOption = exports.VotingOption || (exports.VotingOption = {}));
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Pubkey } from "@cosmjs/amino";
|
|
2
|
+
import { Any } from "../google/protobuf/any";
|
|
3
|
+
export interface Account {
|
|
4
|
+
/** Bech32 account address */
|
|
5
|
+
readonly address: string;
|
|
6
|
+
readonly pubkey: Pubkey | null;
|
|
7
|
+
readonly accountNumber: number;
|
|
8
|
+
readonly sequence: number;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Takes an `Any` encoded account from the chain and extracts some common
|
|
12
|
+
* `Account` information from it. This is supposed to support the most relevant
|
|
13
|
+
* common Cosmos SDK account types. If you need support for exotic account types,
|
|
14
|
+
* you'll need to write your own account decoder.
|
|
15
|
+
*/
|
|
16
|
+
export declare function accountFromAny(input: Any): Account;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.accountFromAny = void 0;
|
|
4
|
+
var math_1 = require("@cosmjs/math");
|
|
5
|
+
var proto_signing_1 = require("@cosmjs/proto-signing");
|
|
6
|
+
var auth_1 = require("cosmjs-types/cosmos/auth/v1beta1/auth");
|
|
7
|
+
var vesting_1 = require("cosmjs-types/cosmos/vesting/v1beta1/vesting");
|
|
8
|
+
function uint64FromProto(input) {
|
|
9
|
+
return math_1.Uint64.fromString(input.toString());
|
|
10
|
+
}
|
|
11
|
+
function accountFromBaseAccount(input) {
|
|
12
|
+
var address = input.address, pubKey = input.pubKey, accountNumber = input.accountNumber, sequence = input.sequence;
|
|
13
|
+
var pubkey = (0, proto_signing_1.decodePubkey)(pubKey);
|
|
14
|
+
return {
|
|
15
|
+
address: address,
|
|
16
|
+
pubkey: pubkey,
|
|
17
|
+
accountNumber: uint64FromProto(accountNumber).toNumber(),
|
|
18
|
+
sequence: uint64FromProto(sequence).toNumber(),
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Takes an `Any` encoded account from the chain and extracts some common
|
|
23
|
+
* `Account` information from it. This is supposed to support the most relevant
|
|
24
|
+
* common Cosmos SDK account types. If you need support for exotic account types,
|
|
25
|
+
* you'll need to write your own account decoder.
|
|
26
|
+
*/
|
|
27
|
+
function accountFromAny(input) {
|
|
28
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
29
|
+
var typeUrl = input.typeUrl, value = input.value;
|
|
30
|
+
switch (typeUrl) {
|
|
31
|
+
// auth
|
|
32
|
+
case "/cosmos.auth.v1beta1.BaseAccount":
|
|
33
|
+
return accountFromBaseAccount(auth_1.BaseAccount.decode(value));
|
|
34
|
+
case "/cosmos.auth.v1beta1.ModuleAccount":
|
|
35
|
+
{
|
|
36
|
+
var baseAccount = auth_1.ModuleAccount.decode(value).baseAccount;
|
|
37
|
+
return accountFromBaseAccount(baseAccount);
|
|
38
|
+
}
|
|
39
|
+
// vesting
|
|
40
|
+
case "/cosmos.vesting.v1beta1.BaseVestingAccount":
|
|
41
|
+
{
|
|
42
|
+
var baseAccount = (_a = vesting_1.BaseVestingAccount.decode(value)) === null || _a === void 0 ? void 0 : _a.baseAccount;
|
|
43
|
+
return accountFromBaseAccount(baseAccount);
|
|
44
|
+
}
|
|
45
|
+
case "/cosmos.vesting.v1beta1.ContinuousVestingAccount":
|
|
46
|
+
{
|
|
47
|
+
var baseAccount = (_c = (_b = vesting_1.ContinuousVestingAccount.decode(value)) === null || _b === void 0 ? void 0 : _b.baseVestingAccount) === null || _c === void 0 ? void 0 : _c.baseAccount;
|
|
48
|
+
return accountFromBaseAccount(baseAccount);
|
|
49
|
+
}
|
|
50
|
+
case "/cosmos.vesting.v1beta1.DelayedVestingAccount":
|
|
51
|
+
{
|
|
52
|
+
var baseAccount = (_e = (_d = vesting_1.DelayedVestingAccount.decode(value)) === null || _d === void 0 ? void 0 : _d.baseVestingAccount) === null || _e === void 0 ? void 0 : _e.baseAccount;
|
|
53
|
+
return accountFromBaseAccount(baseAccount);
|
|
54
|
+
}
|
|
55
|
+
case "/cosmos.vesting.v1beta1.PeriodicVestingAccount":
|
|
56
|
+
{
|
|
57
|
+
var baseAccount = (_g = (_f = vesting_1.PeriodicVestingAccount.decode(value)) === null || _f === void 0 ? void 0 : _f.baseVestingAccount) === null || _g === void 0 ? void 0 : _g.baseAccount;
|
|
58
|
+
return accountFromBaseAccount(baseAccount);
|
|
59
|
+
}
|
|
60
|
+
default:
|
|
61
|
+
throw new Error("Unsupported type: '".concat(typeUrl, "'"));
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
exports.accountFromAny = accountFromAny;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
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);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./TxCommon"), exports);
|
|
18
|
+
__exportStar(require("./QueryCommon"), exports);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Coin } from "cosmjs-types/cosmos/base/v1beta1/coin";
|
|
2
|
+
import { SignMode } from "cosmjs-types/cosmos/tx/signing/v1beta1/signing";
|
|
3
|
+
import { SignDoc } from "cosmjs-types/cosmos/tx/v1beta1/tx";
|
|
4
|
+
import { Any } from "../google/protobuf/any";
|
|
5
|
+
export declare function makeAuthInfoBytes(signers: ReadonlyArray<{
|
|
6
|
+
readonly pubkey: Any;
|
|
7
|
+
readonly sequence: number;
|
|
8
|
+
}>, feeAmount: readonly Coin[], gasLimit: number, granter: string, signMode?: SignMode): Uint8Array;
|
|
9
|
+
export declare function makeSignDoc(bodyBytes: Uint8Array, authInfoBytes: Uint8Array, chainId: string, accountNumber: number): SignDoc;
|
|
10
|
+
export declare function makeSignBytes({ accountNumber, authInfoBytes, bodyBytes, chainId }: SignDoc): Uint8Array;
|
|
@@ -0,0 +1,79 @@
|
|
|
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, pack) {
|
|
19
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
20
|
+
if (ar || !(i in from)) {
|
|
21
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
22
|
+
ar[i] = from[i];
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
26
|
+
};
|
|
27
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
28
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
29
|
+
};
|
|
30
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
+
exports.makeSignBytes = exports.makeSignDoc = exports.makeAuthInfoBytes = void 0;
|
|
32
|
+
var signing_1 = require("cosmjs-types/cosmos/tx/signing/v1beta1/signing");
|
|
33
|
+
var tx_1 = require("cosmjs-types/cosmos/tx/v1beta1/tx");
|
|
34
|
+
var long_1 = __importDefault(require("long"));
|
|
35
|
+
function makeSignerInfos(signers, signMode) {
|
|
36
|
+
return signers.map(function (_a) {
|
|
37
|
+
var pubkey = _a.pubkey, sequence = _a.sequence;
|
|
38
|
+
return ({
|
|
39
|
+
publicKey: pubkey,
|
|
40
|
+
modeInfo: {
|
|
41
|
+
single: { mode: signMode },
|
|
42
|
+
},
|
|
43
|
+
sequence: long_1.default.fromNumber(sequence),
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
function makeAuthInfoBytes(signers, feeAmount, gasLimit, granter, signMode) {
|
|
48
|
+
if (signMode === void 0) { signMode = signing_1.SignMode.SIGN_MODE_DIRECT; }
|
|
49
|
+
var authInfo = {
|
|
50
|
+
signerInfos: makeSignerInfos(signers, signMode),
|
|
51
|
+
fee: {
|
|
52
|
+
amount: __spreadArray([], __read(feeAmount), false),
|
|
53
|
+
gasLimit: long_1.default.fromNumber(gasLimit),
|
|
54
|
+
granter: granter,
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
return tx_1.AuthInfo.encode(tx_1.AuthInfo.fromPartial(authInfo)).finish();
|
|
58
|
+
}
|
|
59
|
+
exports.makeAuthInfoBytes = makeAuthInfoBytes;
|
|
60
|
+
function makeSignDoc(bodyBytes, authInfoBytes, chainId, accountNumber) {
|
|
61
|
+
return {
|
|
62
|
+
bodyBytes: bodyBytes,
|
|
63
|
+
authInfoBytes: authInfoBytes,
|
|
64
|
+
chainId: chainId,
|
|
65
|
+
accountNumber: long_1.default.fromNumber(accountNumber),
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
exports.makeSignDoc = makeSignDoc;
|
|
69
|
+
function makeSignBytes(_a) {
|
|
70
|
+
var accountNumber = _a.accountNumber, authInfoBytes = _a.authInfoBytes, bodyBytes = _a.bodyBytes, chainId = _a.chainId;
|
|
71
|
+
var signDoc = tx_1.SignDoc.fromPartial({
|
|
72
|
+
accountNumber: accountNumber,
|
|
73
|
+
authInfoBytes: authInfoBytes,
|
|
74
|
+
bodyBytes: bodyBytes,
|
|
75
|
+
chainId: chainId,
|
|
76
|
+
});
|
|
77
|
+
return tx_1.SignDoc.encode(signDoc).finish();
|
|
78
|
+
}
|
|
79
|
+
exports.makeSignBytes = makeSignBytes;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Registry } from "@cosmjs/proto-signing";
|
|
2
|
+
import { Tendermint34Client } from "@cosmjs/tendermint-rpc";
|
|
3
|
+
import { Account } from "./accounts";
|
|
4
|
+
import { StargateClient } from "./stargateclient";
|
|
5
|
+
import { AminoMsg } from "@cosmjs/amino";
|
|
6
|
+
import { OfflineAminoSigner } from "../amino/signer";
|
|
7
|
+
export interface SignerData {
|
|
8
|
+
readonly accountNumber: number;
|
|
9
|
+
readonly sequence: number;
|
|
10
|
+
readonly chainId: string;
|
|
11
|
+
}
|
|
12
|
+
export interface SequenceResponse {
|
|
13
|
+
readonly accountNumber: number;
|
|
14
|
+
readonly sequence: number;
|
|
15
|
+
}
|
|
16
|
+
export interface ArbitraryVerifyData {
|
|
17
|
+
type: string;
|
|
18
|
+
signer: string;
|
|
19
|
+
data: string;
|
|
20
|
+
pubkey: string;
|
|
21
|
+
signature: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* See ADR-036
|
|
25
|
+
*/
|
|
26
|
+
export interface MsgSignData extends AminoMsg {
|
|
27
|
+
readonly type: "sign/MsgSignData";
|
|
28
|
+
readonly value: {
|
|
29
|
+
/** Bech32 account address */
|
|
30
|
+
signer: string;
|
|
31
|
+
/** Base64 encoded data */
|
|
32
|
+
data: string;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export declare function isMsgSignData(msg: AminoMsg): msg is MsgSignData;
|
|
36
|
+
export declare class SigningAminoStargateClient extends StargateClient {
|
|
37
|
+
private readonly signer;
|
|
38
|
+
private static _endpoint;
|
|
39
|
+
static connectWithSigner(endpoint: string, signer: OfflineAminoSigner, registry: Registry): Promise<SigningAminoStargateClient>;
|
|
40
|
+
protected constructor(tmClient: Tendermint34Client | undefined, signer: OfflineAminoSigner);
|
|
41
|
+
experimentalAdr36Sign(signerAddress: string, data: Uint8Array | Uint8Array[]): Promise<ArbitraryVerifyData>;
|
|
42
|
+
static experimentalAdr36Verify(data: ArbitraryVerifyData, checkMsg: string): Promise<boolean>;
|
|
43
|
+
/**
|
|
44
|
+
* Takes a bech32 encoded address and returns the data part. The prefix is ignored and discarded.
|
|
45
|
+
* This is called AccAddress in Cosmos SDK, which is basically an alias for raw binary data.
|
|
46
|
+
* The result is typically 20 bytes long but not restricted to that.
|
|
47
|
+
*/
|
|
48
|
+
private toAccAddress;
|
|
49
|
+
getAccount(address: string): Promise<Account | undefined>;
|
|
50
|
+
}
|