@firmachain/firma-js 0.2.31 → 0.2.34
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 +13 -4
- package/dist/sdk/FirmaAuthzService.js +29 -26
- package/dist/sdk/FirmaBankService.js +2 -2
- package/dist/sdk/FirmaContractService.js +14 -16
- package/dist/sdk/FirmaCosmWasmService.js +27 -29
- package/dist/sdk/FirmaDistributionService.js +10 -10
- package/dist/sdk/FirmaFeeGrantService.js +6 -6
- package/dist/sdk/FirmaGovService.js +26 -26
- package/dist/sdk/FirmaIbcService.d.ts +15 -0
- package/dist/sdk/FirmaIbcService.js +144 -0
- package/dist/sdk/FirmaIpfsService.js +1 -1
- package/dist/sdk/FirmaNftService.js +9 -9
- package/dist/sdk/FirmaSDK.d.ts +3 -1
- package/dist/sdk/FirmaSDK.js +4 -1
- package/dist/sdk/FirmaStakingService.d.ts +17 -5
- package/dist/sdk/FirmaStakingService.js +22 -18
- package/dist/sdk/FirmaTokenService.js +16 -16
- package/dist/sdk/FirmaUtil.d.ts +19 -1
- package/dist/sdk/FirmaUtil.js +198 -3
- package/dist/sdk/FirmaWalletService.d.ts +3 -0
- package/dist/sdk/FirmaWalletService.js +21 -13
- package/dist/sdk/firmachain/amino/addresses.js +11 -11
- package/dist/sdk/firmachain/amino/aminotypes.js +36 -32
- package/dist/sdk/firmachain/amino/encoding.js +30 -26
- package/dist/sdk/firmachain/amino/multisig.js +5 -5
- package/dist/sdk/firmachain/amino/signature.js +4 -4
- package/dist/sdk/firmachain/amino/signdoc.js +1 -1
- package/dist/sdk/firmachain/amino/signer.d.ts +1 -2
- package/dist/sdk/firmachain/amino/wallet.js +14 -10
- package/dist/sdk/firmachain/authz/AuthzQueryClient.d.ts +13 -3
- package/dist/sdk/firmachain/authz/AuthzQueryClient.js +42 -15
- package/dist/sdk/firmachain/authz/AuthzTxClient.d.ts +5 -4
- package/dist/sdk/firmachain/authz/AuthzTxClient.js +6 -3
- package/dist/sdk/firmachain/authz/index.js +5 -1
- package/dist/sdk/firmachain/bank/BankQueryClient.js +4 -4
- package/dist/sdk/firmachain/bank/BankTxClient.d.ts +4 -3
- package/dist/sdk/firmachain/bank/BankTxClient.js +5 -2
- package/dist/sdk/firmachain/bank/index.js +5 -1
- 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 +3 -3
- package/dist/sdk/firmachain/common/ITxClient.js +14 -8
- package/dist/sdk/firmachain/common/LedgerSigningStargateClient.js +2 -2
- package/dist/sdk/firmachain/common/LedgerWallet.js +14 -10
- package/dist/sdk/firmachain/common/accounts.js +2 -2
- package/dist/sdk/firmachain/common/index.js +5 -1
- package/dist/sdk/firmachain/common/signing.js +9 -5
- 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 +15 -8
- package/dist/sdk/firmachain/common/signingstargateclient.js +82 -19
- package/dist/sdk/firmachain/common/stargateclient.js +6 -6
- package/dist/sdk/firmachain/contract/ContractQueryClient.js +2 -2
- package/dist/sdk/firmachain/contract/ContractTxClient.d.ts +4 -3
- package/dist/sdk/firmachain/contract/ContractTxClient.js +5 -2
- package/dist/sdk/firmachain/contract/ContractTxTypes.d.ts +4 -4
- package/dist/sdk/firmachain/contract/index.js +5 -1
- package/dist/sdk/firmachain/cosmwasm/CosmWasmQueryClient.js +7 -7
- package/dist/sdk/firmachain/cosmwasm/CosmWasmTxClient.d.ts +8 -7
- package/dist/sdk/firmachain/cosmwasm/CosmWasmTxClient.js +9 -6
- package/dist/sdk/firmachain/cosmwasm/index.js +5 -1
- package/dist/sdk/firmachain/distribution/DistributionQueryClient.js +5 -5
- package/dist/sdk/firmachain/distribution/DistributionTxClient.d.ts +6 -5
- package/dist/sdk/firmachain/distribution/DistributionTxClient.js +7 -4
- package/dist/sdk/firmachain/distribution/index.js +5 -1
- package/dist/sdk/firmachain/feegrant/FeeGrantQueryClient.js +2 -2
- package/dist/sdk/firmachain/feegrant/FeeGrantTxClient.d.ts +4 -3
- package/dist/sdk/firmachain/feegrant/FeeGrantTxClient.js +5 -2
- package/dist/sdk/firmachain/feegrant/index.js +5 -1
- package/dist/sdk/firmachain/google/protobuf/any.d.ts +1 -1
- package/dist/sdk/firmachain/google/protobuf/descriptor.d.ts +27 -27
- package/dist/sdk/firmachain/google/protobuf/duration.d.ts +1 -1
- package/dist/sdk/firmachain/google/protobuf/timestamp.d.ts +1 -1
- package/dist/sdk/firmachain/gov/GovQueryClient.js +2 -2
- package/dist/sdk/firmachain/gov/GovTxClient.d.ts +5 -4
- package/dist/sdk/firmachain/gov/GovTxClient.js +6 -3
- package/dist/sdk/firmachain/gov/index.js +5 -1
- 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/NftTxClient.d.ts +5 -4
- package/dist/sdk/firmachain/nft/NftTxClient.js +6 -3
- package/dist/sdk/firmachain/nft/NftTxTypes.d.ts +6 -6
- package/dist/sdk/firmachain/nft/index.js +5 -1
- package/dist/sdk/firmachain/slashing/index.js +5 -1
- package/dist/sdk/firmachain/staking/StakingQueryClient.d.ts +17 -4
- package/dist/sdk/firmachain/staking/StakingQueryClient.js +44 -24
- package/dist/sdk/firmachain/staking/StakingTxClient.d.ts +7 -6
- package/dist/sdk/firmachain/staking/StakingTxClient.js +8 -5
- package/dist/sdk/firmachain/staking/index.js +5 -1
- package/dist/sdk/firmachain/token/TokenTxClient.d.ts +6 -5
- package/dist/sdk/firmachain/token/TokenTxClient.js +7 -4
- package/dist/sdk/firmachain/token/TokenTxTypes.d.ts +8 -8
- package/dist/sdk/firmachain/token/index.js +5 -1
- package/package.json +2 -3
- package/dist/sdk/firmachain/amino/secp256k1hdwallet.d.ts +0 -94
- package/dist/sdk/firmachain/amino/secp256k1hdwallet.js +0 -437
- package/dist/sdk/firmachain/amino/secp256k1wallet.d.ts +0 -23
- package/dist/sdk/firmachain/amino/secp256k1wallet.js +0 -141
|
@@ -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];
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export interface ClientState {
|
|
2
|
+
identified_client_state: {
|
|
3
|
+
client_id: string;
|
|
4
|
+
client_state: {
|
|
5
|
+
"@type": "string";
|
|
6
|
+
chain_id: string;
|
|
7
|
+
trust_level: {
|
|
8
|
+
numerator: string;
|
|
9
|
+
denominator: string;
|
|
10
|
+
};
|
|
11
|
+
trusting_period: string;
|
|
12
|
+
unbonding_period: string;
|
|
13
|
+
max_clock_drift: string;
|
|
14
|
+
frozen_height: {
|
|
15
|
+
revision_number: string;
|
|
16
|
+
revision_height: string;
|
|
17
|
+
};
|
|
18
|
+
latest_height: {
|
|
19
|
+
revision_number: string;
|
|
20
|
+
revision_height: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
proof: string;
|
|
25
|
+
proof_height: {
|
|
26
|
+
revision_number: string;
|
|
27
|
+
revision_height: string;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export declare class IbcQueryClient {
|
|
31
|
+
private readonly axios;
|
|
32
|
+
constructor(baseUrl: string);
|
|
33
|
+
getClientState(sourceChannel: string, sourcePort: string): Promise<ClientState>;
|
|
34
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
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.IbcQueryClient = void 0;
|
|
43
|
+
var axios_1 = __importDefault(require("axios"));
|
|
44
|
+
var IbcQueryClient = /** @class */ (function () {
|
|
45
|
+
function IbcQueryClient(baseUrl) {
|
|
46
|
+
this.axios = axios_1.default.create({
|
|
47
|
+
baseURL: baseUrl,
|
|
48
|
+
headers: {
|
|
49
|
+
Accept: "application/json",
|
|
50
|
+
},
|
|
51
|
+
timeout: 15000,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
IbcQueryClient.prototype.getClientState = function (sourceChannel, sourcePort) {
|
|
55
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
56
|
+
var path, result;
|
|
57
|
+
return __generator(this, function (_a) {
|
|
58
|
+
switch (_a.label) {
|
|
59
|
+
case 0:
|
|
60
|
+
path = "/ibc/core/channel/v1/channels/".concat(sourceChannel, "/ports/").concat(sourcePort, "/client_state");
|
|
61
|
+
return [4 /*yield*/, this.axios.get(path)];
|
|
62
|
+
case 1:
|
|
63
|
+
result = _a.sent();
|
|
64
|
+
return [2 /*return*/, result.data];
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
return IbcQueryClient;
|
|
70
|
+
}());
|
|
71
|
+
exports.IbcQueryClient = IbcQueryClient;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Registry, EncodeObject } from "@cosmjs/proto-signing";
|
|
2
|
+
import { FirmaWalletService } from "../../FirmaWalletService";
|
|
3
|
+
import { ITxClient } from "../common/ITxClient";
|
|
4
|
+
import { MsgTransfer } from "cosmjs-types/ibc/applications/transfer/v1/tx";
|
|
5
|
+
export interface MsgTransferEncodeObject extends EncodeObject {
|
|
6
|
+
readonly typeUrl: "/ibc.applications.transfer.v1.MsgTransfer";
|
|
7
|
+
readonly value: Partial<MsgTransfer>;
|
|
8
|
+
}
|
|
9
|
+
export declare class IbcTxClient extends ITxClient {
|
|
10
|
+
constructor(wallet: FirmaWalletService, address: string);
|
|
11
|
+
static getRegistry(): Registry;
|
|
12
|
+
static msgTransfer(data: MsgTransfer): MsgTransferEncodeObject;
|
|
13
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.IbcTxClient = void 0;
|
|
19
|
+
var proto_signing_1 = require("@cosmjs/proto-signing");
|
|
20
|
+
var ITxClient_1 = require("../common/ITxClient");
|
|
21
|
+
var tx_1 = require("cosmjs-types/ibc/applications/transfer/v1/tx");
|
|
22
|
+
var types = [
|
|
23
|
+
["/ibc.applications.transfer.v1.MsgTransfer", tx_1.MsgTransfer],
|
|
24
|
+
];
|
|
25
|
+
var registry = new proto_signing_1.Registry(types);
|
|
26
|
+
var IbcTxClient = /** @class */ (function (_super) {
|
|
27
|
+
__extends(IbcTxClient, _super);
|
|
28
|
+
function IbcTxClient(wallet, address) {
|
|
29
|
+
return _super.call(this, wallet, address, registry) || this;
|
|
30
|
+
}
|
|
31
|
+
IbcTxClient.getRegistry = function () {
|
|
32
|
+
return registry;
|
|
33
|
+
};
|
|
34
|
+
IbcTxClient.msgTransfer = function (data) {
|
|
35
|
+
return { typeUrl: "/ibc.applications.transfer.v1.MsgTransfer", value: data };
|
|
36
|
+
};
|
|
37
|
+
return IbcTxClient;
|
|
38
|
+
}(ITxClient_1.ITxClient));
|
|
39
|
+
exports.IbcTxClient = IbcTxClient;
|
|
@@ -0,0 +1,19 @@
|
|
|
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("./IbcTxClient"), exports);
|
|
18
|
+
__exportStar(require("./IbcQueryClient"), exports);
|
|
19
|
+
__exportStar(require("../common"), exports);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EncodeObject } from "@cosmjs/proto-signing";
|
|
1
|
+
import { Registry, EncodeObject } from "@cosmjs/proto-signing";
|
|
2
2
|
import { MsgTransfer, MsgMint, MsgBurn } from "./NftTxTypes";
|
|
3
3
|
import { ITxClient } from "../common/ITxClient";
|
|
4
4
|
import { FirmaWalletService } from "../../FirmaWalletService";
|
|
@@ -16,7 +16,8 @@ export interface MsgBurnEncodeObject extends EncodeObject {
|
|
|
16
16
|
}
|
|
17
17
|
export declare class NftTxClient extends ITxClient {
|
|
18
18
|
constructor(wallet: FirmaWalletService, serverUrl: string);
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
static getRegistry(): Registry;
|
|
20
|
+
static msgTransfer(data: MsgTransfer): MsgTransferEncodeObject;
|
|
21
|
+
static msgMint(data: MsgMint): MsgMintEncodeObject;
|
|
22
|
+
static msgBurn(data: MsgBurn): MsgBurnEncodeObject;
|
|
22
23
|
}
|
|
@@ -30,13 +30,16 @@ var NftTxClient = /** @class */ (function (_super) {
|
|
|
30
30
|
function NftTxClient(wallet, serverUrl) {
|
|
31
31
|
return _super.call(this, wallet, serverUrl, registry) || this;
|
|
32
32
|
}
|
|
33
|
-
NftTxClient.
|
|
33
|
+
NftTxClient.getRegistry = function () {
|
|
34
|
+
return registry;
|
|
35
|
+
};
|
|
36
|
+
NftTxClient.msgTransfer = function (data) {
|
|
34
37
|
return { typeUrl: "/firmachain.firmachain.nft.MsgTransfer", value: data };
|
|
35
38
|
};
|
|
36
|
-
NftTxClient.
|
|
39
|
+
NftTxClient.msgMint = function (data) {
|
|
37
40
|
return { typeUrl: "/firmachain.firmachain.nft.MsgMint", value: data };
|
|
38
41
|
};
|
|
39
|
-
NftTxClient.
|
|
42
|
+
NftTxClient.msgBurn = function (data) {
|
|
40
43
|
return { typeUrl: "/firmachain.firmachain.nft.MsgBurn", value: data };
|
|
41
44
|
};
|
|
42
45
|
return NftTxClient;
|
|
@@ -23,42 +23,42 @@ export interface MsgMintResponse {
|
|
|
23
23
|
}
|
|
24
24
|
export declare const MsgTransfer: {
|
|
25
25
|
encode(message: MsgTransfer, writer?: Writer): Writer;
|
|
26
|
-
decode(input: Reader | Uint8Array, length?: number
|
|
26
|
+
decode(input: Reader | Uint8Array, length?: number): MsgTransfer;
|
|
27
27
|
fromJSON(object: any): MsgTransfer;
|
|
28
28
|
toJSON(message: MsgTransfer): unknown;
|
|
29
29
|
fromPartial(object: DeepPartial<MsgTransfer>): MsgTransfer;
|
|
30
30
|
};
|
|
31
31
|
export declare const MsgTransferResponse: {
|
|
32
32
|
encode(_: MsgTransferResponse, writer?: Writer): Writer;
|
|
33
|
-
decode(input: Reader | Uint8Array, length?: number
|
|
33
|
+
decode(input: Reader | Uint8Array, length?: number): MsgTransferResponse;
|
|
34
34
|
fromJSON(_: any): MsgTransferResponse;
|
|
35
35
|
toJSON(_: MsgTransferResponse): unknown;
|
|
36
36
|
fromPartial(_: DeepPartial<MsgTransferResponse>): MsgTransferResponse;
|
|
37
37
|
};
|
|
38
38
|
export declare const MsgBurn: {
|
|
39
39
|
encode(message: MsgBurn, writer?: Writer): Writer;
|
|
40
|
-
decode(input: Reader | Uint8Array, length?: number
|
|
40
|
+
decode(input: Reader | Uint8Array, length?: number): MsgBurn;
|
|
41
41
|
fromJSON(object: any): MsgBurn;
|
|
42
42
|
toJSON(message: MsgBurn): unknown;
|
|
43
43
|
fromPartial(object: DeepPartial<MsgBurn>): MsgBurn;
|
|
44
44
|
};
|
|
45
45
|
export declare const MsgBurnResponse: {
|
|
46
46
|
encode(message: MsgBurnResponse, writer?: Writer): Writer;
|
|
47
|
-
decode(input: Reader | Uint8Array, length?: number
|
|
47
|
+
decode(input: Reader | Uint8Array, length?: number): MsgBurnResponse;
|
|
48
48
|
fromJSON(object: any): MsgBurnResponse;
|
|
49
49
|
toJSON(message: MsgBurnResponse): unknown;
|
|
50
50
|
fromPartial(object: DeepPartial<MsgBurnResponse>): MsgBurnResponse;
|
|
51
51
|
};
|
|
52
52
|
export declare const MsgMint: {
|
|
53
53
|
encode(message: MsgMint, writer?: Writer): Writer;
|
|
54
|
-
decode(input: Reader | Uint8Array, length?: number
|
|
54
|
+
decode(input: Reader | Uint8Array, length?: number): MsgMint;
|
|
55
55
|
fromJSON(object: any): MsgMint;
|
|
56
56
|
toJSON(message: MsgMint): unknown;
|
|
57
57
|
fromPartial(object: DeepPartial<MsgMint>): MsgMint;
|
|
58
58
|
};
|
|
59
59
|
export declare const MsgMintResponse: {
|
|
60
60
|
encode(message: MsgMintResponse, writer?: Writer): Writer;
|
|
61
|
-
decode(input: Reader | Uint8Array, length?: number
|
|
61
|
+
decode(input: Reader | Uint8Array, length?: number): MsgMintResponse;
|
|
62
62
|
fromJSON(object: any): MsgMintResponse;
|
|
63
63
|
toJSON(message: MsgMintResponse): unknown;
|
|
64
64
|
fromPartial(object: DeepPartial<MsgMintResponse>): MsgMintResponse;
|
|
@@ -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,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,3 +1,4 @@
|
|
|
1
|
+
import { Pagination } from "../common";
|
|
1
2
|
export interface ParamsDataType {
|
|
2
3
|
unbonding_time: string;
|
|
3
4
|
max_validators: number;
|
|
@@ -83,11 +84,23 @@ export declare class StakingQueryClient {
|
|
|
83
84
|
queryGetDelegationInfoFromValidator(address: string, validatorAddress: string): Promise<DelegationInfo>;
|
|
84
85
|
queryGetTotalUndelegateInfo(address: string): Promise<UndelegationInfo[]>;
|
|
85
86
|
querygetTotalRedelegationInfo(address: string): Promise<RedelegationInfo[]>;
|
|
86
|
-
queryGetUndelegationListFromValidator(
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
queryGetUndelegationListFromValidator(valoperAddress: string, paginationKey?: string): Promise<{
|
|
88
|
+
dataList: UndelegationInfo[];
|
|
89
|
+
pagination: Pagination;
|
|
90
|
+
}>;
|
|
91
|
+
queryGetDelegateListFromValidator(valoperAddress: string, paginationKey?: string): Promise<{
|
|
92
|
+
dataList: DelegationInfo[];
|
|
93
|
+
pagination: Pagination;
|
|
94
|
+
}>;
|
|
95
|
+
queryGetTotalDelegationInfo(address: string, paginationKey?: string): Promise<{
|
|
96
|
+
dataList: DelegationInfo[];
|
|
97
|
+
pagination: Pagination;
|
|
98
|
+
}>;
|
|
89
99
|
queryGetParams(): Promise<ParamsDataType>;
|
|
90
100
|
queryGetPool(): Promise<PoolDataType>;
|
|
91
101
|
queryValidator(valoperAddress: string): Promise<ValidatorDataType>;
|
|
92
|
-
queryValidators(): Promise<
|
|
102
|
+
queryValidators(paginationKey?: string): Promise<{
|
|
103
|
+
dataList: ValidatorDataType[];
|
|
104
|
+
pagination: Pagination;
|
|
105
|
+
}>;
|
|
93
106
|
}
|
|
@@ -57,7 +57,7 @@ var StakingQueryClient = /** @class */ (function () {
|
|
|
57
57
|
return __generator(this, function (_a) {
|
|
58
58
|
switch (_a.label) {
|
|
59
59
|
case 0:
|
|
60
|
-
path = "/cosmos/staking/v1beta1/validators/"
|
|
60
|
+
path = "/cosmos/staking/v1beta1/validators/".concat(validatorAddress, "/delegations/").concat(address, "/unbonding_delegation");
|
|
61
61
|
return [4 /*yield*/, this.axios.get(path)];
|
|
62
62
|
case 1:
|
|
63
63
|
result = _a.sent();
|
|
@@ -74,7 +74,7 @@ var StakingQueryClient = /** @class */ (function () {
|
|
|
74
74
|
return __generator(this, function (_a) {
|
|
75
75
|
switch (_a.label) {
|
|
76
76
|
case 0:
|
|
77
|
-
path = "/cosmos/staking/v1beta1/validators/"
|
|
77
|
+
path = "/cosmos/staking/v1beta1/validators/".concat(validatorAddress, "/delegations/").concat(address);
|
|
78
78
|
return [4 /*yield*/, this.axios.get(path)];
|
|
79
79
|
case 1:
|
|
80
80
|
result = _a.sent();
|
|
@@ -89,7 +89,7 @@ var StakingQueryClient = /** @class */ (function () {
|
|
|
89
89
|
return __generator(this, function (_a) {
|
|
90
90
|
switch (_a.label) {
|
|
91
91
|
case 0:
|
|
92
|
-
path = "/cosmos/staking/v1beta1/delegators/"
|
|
92
|
+
path = "/cosmos/staking/v1beta1/delegators/".concat(address, "/unbonding_delegations");
|
|
93
93
|
return [4 /*yield*/, this.axios.get(path)];
|
|
94
94
|
case 1:
|
|
95
95
|
result = _a.sent();
|
|
@@ -104,7 +104,7 @@ var StakingQueryClient = /** @class */ (function () {
|
|
|
104
104
|
return __generator(this, function (_a) {
|
|
105
105
|
switch (_a.label) {
|
|
106
106
|
case 0:
|
|
107
|
-
path = "/cosmos/staking/v1beta1/delegators/"
|
|
107
|
+
path = "/cosmos/staking/v1beta1/delegators/".concat(address, "/redelegations");
|
|
108
108
|
return [4 /*yield*/, this.axios.get(path)];
|
|
109
109
|
case 1:
|
|
110
110
|
result = _a.sent();
|
|
@@ -113,47 +113,62 @@ var StakingQueryClient = /** @class */ (function () {
|
|
|
113
113
|
});
|
|
114
114
|
});
|
|
115
115
|
};
|
|
116
|
-
StakingQueryClient.prototype.queryGetUndelegationListFromValidator = function (
|
|
116
|
+
StakingQueryClient.prototype.queryGetUndelegationListFromValidator = function (valoperAddress, paginationKey) {
|
|
117
|
+
if (paginationKey === void 0) { paginationKey = ""; }
|
|
117
118
|
return __awaiter(this, void 0, void 0, function () {
|
|
118
|
-
var path, result;
|
|
119
|
+
var path, result, convertPagination;
|
|
119
120
|
return __generator(this, function (_a) {
|
|
120
121
|
switch (_a.label) {
|
|
121
122
|
case 0:
|
|
122
|
-
path = "/cosmos/staking/v1beta1/validators/"
|
|
123
|
-
return [4 /*yield*/, this.axios.get(path)];
|
|
123
|
+
path = "/cosmos/staking/v1beta1/validators/".concat(valoperAddress, "/unbonding_delegations");
|
|
124
|
+
return [4 /*yield*/, this.axios.get(path, { params: { "pagination.key": paginationKey } })];
|
|
124
125
|
case 1:
|
|
125
126
|
result = _a.sent();
|
|
126
|
-
|
|
127
|
+
convertPagination = {
|
|
128
|
+
next_key: result.data.pagination.next_key,
|
|
129
|
+
total: Number.parseInt(result.data.pagination.total)
|
|
130
|
+
};
|
|
131
|
+
return [2 /*return*/, { dataList: result.data.unbonding_responses, pagination: convertPagination }];
|
|
127
132
|
}
|
|
128
133
|
});
|
|
129
134
|
});
|
|
130
135
|
};
|
|
131
|
-
StakingQueryClient.prototype.queryGetDelegateListFromValidator = function (
|
|
136
|
+
StakingQueryClient.prototype.queryGetDelegateListFromValidator = function (valoperAddress, paginationKey) {
|
|
137
|
+
if (paginationKey === void 0) { paginationKey = ""; }
|
|
132
138
|
return __awaiter(this, void 0, void 0, function () {
|
|
133
|
-
var path, result;
|
|
139
|
+
var path, result, convertPagination;
|
|
134
140
|
return __generator(this, function (_a) {
|
|
135
141
|
switch (_a.label) {
|
|
136
142
|
case 0:
|
|
137
|
-
path = "/cosmos/staking/v1beta1/validators/"
|
|
138
|
-
return [4 /*yield*/, this.axios.get(path)];
|
|
143
|
+
path = "/cosmos/staking/v1beta1/validators/".concat(valoperAddress, "/delegations");
|
|
144
|
+
return [4 /*yield*/, this.axios.get(path, { params: { "pagination.key": paginationKey } })];
|
|
139
145
|
case 1:
|
|
140
146
|
result = _a.sent();
|
|
141
|
-
|
|
147
|
+
convertPagination = {
|
|
148
|
+
next_key: result.data.pagination.next_key,
|
|
149
|
+
total: Number.parseInt(result.data.pagination.total)
|
|
150
|
+
};
|
|
151
|
+
return [2 /*return*/, { dataList: result.data.delegation_responses, pagination: convertPagination }];
|
|
142
152
|
}
|
|
143
153
|
});
|
|
144
154
|
});
|
|
145
155
|
};
|
|
146
|
-
StakingQueryClient.prototype.queryGetTotalDelegationInfo = function (address) {
|
|
156
|
+
StakingQueryClient.prototype.queryGetTotalDelegationInfo = function (address, paginationKey) {
|
|
157
|
+
if (paginationKey === void 0) { paginationKey = ""; }
|
|
147
158
|
return __awaiter(this, void 0, void 0, function () {
|
|
148
|
-
var path, result;
|
|
159
|
+
var path, result, convertPagination;
|
|
149
160
|
return __generator(this, function (_a) {
|
|
150
161
|
switch (_a.label) {
|
|
151
162
|
case 0:
|
|
152
|
-
path = "/cosmos/staking/v1beta1/delegations/"
|
|
153
|
-
return [4 /*yield*/, this.axios.get(path)];
|
|
163
|
+
path = "/cosmos/staking/v1beta1/delegations/".concat(address);
|
|
164
|
+
return [4 /*yield*/, this.axios.get(path, { params: { "pagination.key": paginationKey } })];
|
|
154
165
|
case 1:
|
|
155
166
|
result = _a.sent();
|
|
156
|
-
|
|
167
|
+
convertPagination = {
|
|
168
|
+
next_key: result.data.pagination.next_key,
|
|
169
|
+
total: Number.parseInt(result.data.pagination.total)
|
|
170
|
+
};
|
|
171
|
+
return [2 /*return*/, { dataList: result.data.delegation_responses, pagination: convertPagination }];
|
|
157
172
|
}
|
|
158
173
|
});
|
|
159
174
|
});
|
|
@@ -194,7 +209,7 @@ var StakingQueryClient = /** @class */ (function () {
|
|
|
194
209
|
return __generator(this, function (_a) {
|
|
195
210
|
switch (_a.label) {
|
|
196
211
|
case 0:
|
|
197
|
-
path = "/cosmos/staking/v1beta1/validators/"
|
|
212
|
+
path = "/cosmos/staking/v1beta1/validators/".concat(valoperAddress);
|
|
198
213
|
return [4 /*yield*/, this.axios.get(path)];
|
|
199
214
|
case 1:
|
|
200
215
|
result = _a.sent();
|
|
@@ -203,17 +218,22 @@ var StakingQueryClient = /** @class */ (function () {
|
|
|
203
218
|
});
|
|
204
219
|
});
|
|
205
220
|
};
|
|
206
|
-
StakingQueryClient.prototype.queryValidators = function () {
|
|
221
|
+
StakingQueryClient.prototype.queryValidators = function (paginationKey) {
|
|
222
|
+
if (paginationKey === void 0) { paginationKey = ""; }
|
|
207
223
|
return __awaiter(this, void 0, void 0, function () {
|
|
208
|
-
var path, result;
|
|
224
|
+
var path, result, convertPagination;
|
|
209
225
|
return __generator(this, function (_a) {
|
|
210
226
|
switch (_a.label) {
|
|
211
227
|
case 0:
|
|
212
228
|
path = "/cosmos/staking/v1beta1/validators";
|
|
213
|
-
return [4 /*yield*/, this.axios.get(path)];
|
|
229
|
+
return [4 /*yield*/, this.axios.get(path, { params: { "pagination.key": paginationKey } })];
|
|
214
230
|
case 1:
|
|
215
231
|
result = _a.sent();
|
|
216
|
-
|
|
232
|
+
convertPagination = {
|
|
233
|
+
next_key: result.data.pagination.next_key,
|
|
234
|
+
total: Number.parseInt(result.data.pagination.total)
|
|
235
|
+
};
|
|
236
|
+
return [2 /*return*/, { dataList: result.data.validators, pagination: convertPagination }];
|
|
217
237
|
}
|
|
218
238
|
});
|
|
219
239
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EncodeObject } from "@cosmjs/proto-signing";
|
|
1
|
+
import { Registry, EncodeObject } from "@cosmjs/proto-signing";
|
|
2
2
|
import { MsgBeginRedelegate, MsgCreateValidator, MsgDelegate, MsgEditValidator, MsgUndelegate } from "cosmjs-types/cosmos/staking/v1beta1/tx";
|
|
3
3
|
import { FirmaWalletService } from "../../FirmaWalletService";
|
|
4
4
|
import { ITxClient } from "../common/ITxClient";
|
|
@@ -24,9 +24,10 @@ export interface MsgCreateValidatorEncodeObject extends EncodeObject {
|
|
|
24
24
|
}
|
|
25
25
|
export declare class StakingTxClient extends ITxClient {
|
|
26
26
|
constructor(wallet: FirmaWalletService, serverUrl: string);
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
static getRegistry(): Registry;
|
|
28
|
+
static msgDelegate(data: MsgDelegate): MsgDelegateEncodeObject;
|
|
29
|
+
static msgUndelegate(data: MsgUndelegate): MsgUndelegateEncodeObject;
|
|
30
|
+
static msgRedelegate(data: MsgBeginRedelegate): MsgRedelegateEncodeObject;
|
|
31
|
+
static msgEditValidator(data: MsgEditValidator): MsgEditValidatorEncodeObject;
|
|
32
|
+
static msgCreateValidator(data: MsgCreateValidator): MsgCreateValidatorEncodeObject;
|
|
32
33
|
}
|
|
@@ -32,19 +32,22 @@ var StakingTxClient = /** @class */ (function (_super) {
|
|
|
32
32
|
function StakingTxClient(wallet, serverUrl) {
|
|
33
33
|
return _super.call(this, wallet, serverUrl, registry) || this;
|
|
34
34
|
}
|
|
35
|
-
StakingTxClient.
|
|
35
|
+
StakingTxClient.getRegistry = function () {
|
|
36
|
+
return registry;
|
|
37
|
+
};
|
|
38
|
+
StakingTxClient.msgDelegate = function (data) {
|
|
36
39
|
return { typeUrl: "/cosmos.staking.v1beta1.MsgDelegate", value: data };
|
|
37
40
|
};
|
|
38
|
-
StakingTxClient.
|
|
41
|
+
StakingTxClient.msgUndelegate = function (data) {
|
|
39
42
|
return { typeUrl: "/cosmos.staking.v1beta1.MsgUndelegate", value: data };
|
|
40
43
|
};
|
|
41
|
-
StakingTxClient.
|
|
44
|
+
StakingTxClient.msgRedelegate = function (data) {
|
|
42
45
|
return { typeUrl: "/cosmos.staking.v1beta1.MsgBeginRedelegate", value: data };
|
|
43
46
|
};
|
|
44
|
-
StakingTxClient.
|
|
47
|
+
StakingTxClient.msgEditValidator = function (data) {
|
|
45
48
|
return { typeUrl: "/cosmos.staking.v1beta1.MsgEditValidator", value: data };
|
|
46
49
|
};
|
|
47
|
-
StakingTxClient.
|
|
50
|
+
StakingTxClient.msgCreateValidator = function (data) {
|
|
48
51
|
return { typeUrl: "/cosmos.staking.v1beta1.MsgCreateValidator", value: data };
|
|
49
52
|
};
|
|
50
53
|
return StakingTxClient;
|
|
@@ -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,4 +1,4 @@
|
|
|
1
|
-
import { EncodeObject } from "@cosmjs/proto-signing";
|
|
1
|
+
import { Registry, EncodeObject } from "@cosmjs/proto-signing";
|
|
2
2
|
import { MsgUpdateTokenURI, MsgMint, MsgBurn, MsgCreateToken } from "./TokenTxTypes";
|
|
3
3
|
import { ITxClient } from "../common/ITxClient";
|
|
4
4
|
import { FirmaWalletService } from "../../FirmaWalletService";
|
|
@@ -20,8 +20,9 @@ export interface MsgBurnEncodeObject extends EncodeObject {
|
|
|
20
20
|
}
|
|
21
21
|
export declare class TokenTxClient extends ITxClient {
|
|
22
22
|
constructor(wallet: FirmaWalletService, serverUrl: string);
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
static getRegistry(): Registry;
|
|
24
|
+
static msgCreateToken(data: MsgCreateToken): MsgCreateTokenEncodeObject;
|
|
25
|
+
static msgUpdateTokenURI(data: MsgUpdateTokenURI): MsgUpdateTokenURIEncodeObject;
|
|
26
|
+
static msgMint(data: MsgMint): MsgMintEncodeObject;
|
|
27
|
+
static msgBurn(data: MsgBurn): MsgBurnEncodeObject;
|
|
27
28
|
}
|
|
@@ -31,16 +31,19 @@ var TokenTxClient = /** @class */ (function (_super) {
|
|
|
31
31
|
function TokenTxClient(wallet, serverUrl) {
|
|
32
32
|
return _super.call(this, wallet, serverUrl, registry) || this;
|
|
33
33
|
}
|
|
34
|
-
TokenTxClient.
|
|
34
|
+
TokenTxClient.getRegistry = function () {
|
|
35
|
+
return registry;
|
|
36
|
+
};
|
|
37
|
+
TokenTxClient.msgCreateToken = function (data) {
|
|
35
38
|
return { typeUrl: "/firmachain.firmachain.token.MsgCreateToken", value: data };
|
|
36
39
|
};
|
|
37
|
-
TokenTxClient.
|
|
40
|
+
TokenTxClient.msgUpdateTokenURI = function (data) {
|
|
38
41
|
return { typeUrl: "/firmachain.firmachain.token.MsgUpdateTokenURI", value: data };
|
|
39
42
|
};
|
|
40
|
-
TokenTxClient.
|
|
43
|
+
TokenTxClient.msgMint = function (data) {
|
|
41
44
|
return { typeUrl: "/firmachain.firmachain.token.MsgMint", value: data };
|
|
42
45
|
};
|
|
43
|
-
TokenTxClient.
|
|
46
|
+
TokenTxClient.msgBurn = function (data) {
|
|
44
47
|
return { typeUrl: "/firmachain.firmachain.token.MsgBurn", value: data };
|
|
45
48
|
};
|
|
46
49
|
return TokenTxClient;
|