@firmachain/firma-js 0.2.30 → 0.2.33
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/sdk/FirmaAuthzService.d.ts +41 -0
- package/dist/sdk/FirmaAuthzService.js +633 -0
- package/dist/sdk/FirmaBankService.d.ts +2 -1
- package/dist/sdk/FirmaBankService.js +4 -1
- package/dist/sdk/FirmaContractService.js +10 -12
- package/dist/sdk/FirmaCosmWasmService.d.ts +38 -0
- package/dist/sdk/FirmaCosmWasmService.js +667 -0
- package/dist/sdk/FirmaDistributionService.d.ts +2 -1
- package/dist/sdk/FirmaDistributionService.js +8 -5
- package/dist/sdk/FirmaFeeGrantService.js +3 -3
- package/dist/sdk/FirmaGovService.js +19 -19
- package/dist/sdk/FirmaIbcService.d.ts +15 -0
- package/dist/sdk/FirmaIbcService.js +144 -0
- package/dist/sdk/FirmaMobileSDK.d.ts +3 -1
- package/dist/sdk/FirmaMobileSDK.js +4 -1
- package/dist/sdk/FirmaNftService.js +6 -6
- package/dist/sdk/FirmaSDK.d.ts +7 -1
- package/dist/sdk/FirmaSDK.js +10 -1
- package/dist/sdk/FirmaStakingService.d.ts +18 -5
- package/dist/sdk/FirmaStakingService.js +20 -13
- package/dist/sdk/FirmaTokenService.js +12 -12
- package/dist/sdk/FirmaUtil.d.ts +18 -1
- package/dist/sdk/FirmaUtil.js +193 -0
- package/dist/sdk/FirmaWalletService.d.ts +3 -0
- package/dist/sdk/FirmaWalletService.js +18 -10
- package/dist/sdk/firmachain/amino/signer.d.ts +1 -2
- 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 +3 -0
- package/dist/sdk/firmachain/authz/index.js +15 -0
- package/dist/sdk/firmachain/bank/BankTxClient.d.ts +4 -3
- package/dist/sdk/firmachain/bank/BankTxClient.js +5 -2
- package/dist/sdk/firmachain/common/ITxClient.d.ts +4 -1
- package/dist/sdk/firmachain/common/ITxClient.js +15 -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 +15 -8
- package/dist/sdk/firmachain/common/signingstargateclient.js +68 -9
- package/dist/sdk/firmachain/contract/ContractTxClient.d.ts +4 -3
- package/dist/sdk/firmachain/contract/ContractTxClient.js +5 -2
- 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 +15 -0
- package/dist/sdk/firmachain/distribution/DistributionTxClient.d.ts +6 -5
- package/dist/sdk/firmachain/distribution/DistributionTxClient.js +7 -4
- package/dist/sdk/firmachain/feegrant/FeeGrantTxClient.d.ts +4 -3
- package/dist/sdk/firmachain/feegrant/FeeGrantTxClient.js +5 -2
- package/dist/sdk/firmachain/gov/GovTxClient.d.ts +5 -4
- package/dist/sdk/firmachain/gov/GovTxClient.js +6 -3
- 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 +15 -0
- package/dist/sdk/firmachain/nft/NftTxClient.d.ts +5 -4
- package/dist/sdk/firmachain/nft/NftTxClient.js +6 -3
- package/dist/sdk/firmachain/staking/StakingQueryClient.d.ts +17 -4
- package/dist/sdk/firmachain/staking/StakingQueryClient.js +38 -18
- package/dist/sdk/firmachain/staking/StakingTxClient.d.ts +7 -6
- package/dist/sdk/firmachain/staking/StakingTxClient.js +8 -5
- package/dist/sdk/firmachain/token/TokenTxClient.d.ts +6 -5
- package/dist/sdk/firmachain/token/TokenTxClient.js +7 -4
- package/package.json +3 -1
- 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
|
@@ -0,0 +1,193 @@
|
|
|
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.CosmWasmQueryClient = void 0;
|
|
43
|
+
var axios_1 = __importDefault(require("axios"));
|
|
44
|
+
var CosmWasmQueryClient = /** @class */ (function () {
|
|
45
|
+
function CosmWasmQueryClient(baseUrl) {
|
|
46
|
+
this.axios = axios_1.default.create({
|
|
47
|
+
baseURL: baseUrl,
|
|
48
|
+
headers: {
|
|
49
|
+
Accept: "application/json",
|
|
50
|
+
},
|
|
51
|
+
timeout: 15000,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
CosmWasmQueryClient.prototype.getCodeInfoList = function () {
|
|
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 = "/cosmwasm/wasm/v1/code";
|
|
61
|
+
return [4 /*yield*/, this.axios.get(path)];
|
|
62
|
+
case 1:
|
|
63
|
+
result = _a.sent();
|
|
64
|
+
return [2 /*return*/, result.data.code_infos];
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
CosmWasmQueryClient.prototype.getCodeData = function (codeId) {
|
|
70
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
71
|
+
var path, result;
|
|
72
|
+
return __generator(this, function (_a) {
|
|
73
|
+
switch (_a.label) {
|
|
74
|
+
case 0:
|
|
75
|
+
path = "/cosmwasm/wasm/v1/code/" + codeId;
|
|
76
|
+
return [4 /*yield*/, this.axios.get(path)];
|
|
77
|
+
case 1:
|
|
78
|
+
result = _a.sent();
|
|
79
|
+
return [2 /*return*/, result.data];
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
CosmWasmQueryClient.prototype.getContractListFromCodeId = function (codeId) {
|
|
85
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
86
|
+
var path, result;
|
|
87
|
+
return __generator(this, function (_a) {
|
|
88
|
+
switch (_a.label) {
|
|
89
|
+
case 0:
|
|
90
|
+
path = "/cosmwasm/wasm/v1/code/" + codeId + "/contracts";
|
|
91
|
+
return [4 /*yield*/, this.axios.get(path)];
|
|
92
|
+
case 1:
|
|
93
|
+
result = _a.sent();
|
|
94
|
+
return [2 /*return*/, result.data.contracts];
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
};
|
|
99
|
+
CosmWasmQueryClient.prototype.getContractInfo = function (contractAddress) {
|
|
100
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
101
|
+
var path, result;
|
|
102
|
+
return __generator(this, function (_a) {
|
|
103
|
+
switch (_a.label) {
|
|
104
|
+
case 0:
|
|
105
|
+
path = "/cosmwasm/wasm/v1/contract/" + contractAddress;
|
|
106
|
+
return [4 /*yield*/, this.axios.get(path)];
|
|
107
|
+
case 1:
|
|
108
|
+
result = _a.sent();
|
|
109
|
+
return [2 /*return*/, result.data];
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
};
|
|
114
|
+
CosmWasmQueryClient.prototype.getContractHistory = function (contractAddress) {
|
|
115
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
116
|
+
var path, result;
|
|
117
|
+
return __generator(this, function (_a) {
|
|
118
|
+
switch (_a.label) {
|
|
119
|
+
case 0:
|
|
120
|
+
path = "/cosmwasm/wasm/v1/contract/" + contractAddress + "/history";
|
|
121
|
+
return [4 /*yield*/, this.axios.get(path)];
|
|
122
|
+
case 1:
|
|
123
|
+
result = _a.sent();
|
|
124
|
+
return [2 /*return*/, result.data.entries];
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
};
|
|
129
|
+
CosmWasmQueryClient.prototype.getContractRawQueryData = function (contractAddress, hexString) {
|
|
130
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
131
|
+
var hexStringBase64, path, result;
|
|
132
|
+
return __generator(this, function (_a) {
|
|
133
|
+
switch (_a.label) {
|
|
134
|
+
case 0:
|
|
135
|
+
hexStringBase64 = Buffer.from(hexString, 'hex').toString('base64');
|
|
136
|
+
path = "/cosmwasm/wasm/v1/contract/" + contractAddress + "/raw/" + hexStringBase64;
|
|
137
|
+
return [4 /*yield*/, this.axios.get(path)];
|
|
138
|
+
case 1:
|
|
139
|
+
result = _a.sent();
|
|
140
|
+
return [2 /*return*/, result.data];
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
};
|
|
145
|
+
CosmWasmQueryClient.prototype.getContractSmartQueryData = function (contractAddress, query) {
|
|
146
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
147
|
+
var queryBase64, path, result;
|
|
148
|
+
return __generator(this, function (_a) {
|
|
149
|
+
switch (_a.label) {
|
|
150
|
+
case 0:
|
|
151
|
+
queryBase64 = Buffer.from(query, 'binary').toString('base64');
|
|
152
|
+
path = "/cosmwasm/wasm/v1/contract/" + contractAddress + "/smart/" + queryBase64;
|
|
153
|
+
return [4 /*yield*/, this.axios.get(path)];
|
|
154
|
+
case 1:
|
|
155
|
+
result = _a.sent();
|
|
156
|
+
return [2 /*return*/, result.data.data];
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
});
|
|
160
|
+
};
|
|
161
|
+
CosmWasmQueryClient.prototype.getContractState = function (contractAddress) {
|
|
162
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
163
|
+
var path, result;
|
|
164
|
+
return __generator(this, function (_a) {
|
|
165
|
+
switch (_a.label) {
|
|
166
|
+
case 0:
|
|
167
|
+
path = "/cosmwasm/wasm/v1/contract/" + contractAddress + "/state";
|
|
168
|
+
return [4 /*yield*/, this.axios.get(path)];
|
|
169
|
+
case 1:
|
|
170
|
+
result = _a.sent();
|
|
171
|
+
return [2 /*return*/, result.data.models];
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
};
|
|
176
|
+
CosmWasmQueryClient.prototype.getPinnedCodeList = function () {
|
|
177
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
178
|
+
var path, result;
|
|
179
|
+
return __generator(this, function (_a) {
|
|
180
|
+
switch (_a.label) {
|
|
181
|
+
case 0:
|
|
182
|
+
path = "/cosmwasm/wasm/v1/codes/pinned";
|
|
183
|
+
return [4 /*yield*/, this.axios.get(path)];
|
|
184
|
+
case 1:
|
|
185
|
+
result = _a.sent();
|
|
186
|
+
return [2 /*return*/, result.data.code_ids];
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
});
|
|
190
|
+
};
|
|
191
|
+
return CosmWasmQueryClient;
|
|
192
|
+
}());
|
|
193
|
+
exports.CosmWasmQueryClient = CosmWasmQueryClient;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Registry, EncodeObject } from "@cosmjs/proto-signing";
|
|
2
|
+
import { ITxClient } from "../common/ITxClient";
|
|
3
|
+
import { FirmaWalletService } from "../../FirmaWalletService";
|
|
4
|
+
import { MsgClearAdmin, MsgExecuteContract, MsgMigrateContract, MsgStoreCode, MsgInstantiateContract, MsgUpdateAdmin } from "cosmjs-types/cosmwasm/wasm/v1/tx";
|
|
5
|
+
export interface MsgStoreCodeEncodeObject extends EncodeObject {
|
|
6
|
+
readonly typeUrl: "/cosmwasm.wasm.v1.MsgStoreCode";
|
|
7
|
+
readonly value: Partial<MsgStoreCode>;
|
|
8
|
+
}
|
|
9
|
+
export interface MsgInstantiateContractEncodeObject extends EncodeObject {
|
|
10
|
+
readonly typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract";
|
|
11
|
+
readonly value: Partial<MsgInstantiateContract>;
|
|
12
|
+
}
|
|
13
|
+
export interface MsgUpdateAdminEncodeObject extends EncodeObject {
|
|
14
|
+
readonly typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdmin";
|
|
15
|
+
readonly value: Partial<MsgUpdateAdmin>;
|
|
16
|
+
}
|
|
17
|
+
export interface MsgClearAdminEncodeObject extends EncodeObject {
|
|
18
|
+
readonly typeUrl: "/cosmwasm.wasm.v1.MsgClearAdmin";
|
|
19
|
+
readonly value: Partial<MsgClearAdmin>;
|
|
20
|
+
}
|
|
21
|
+
export interface MsgMigrateContractEncodeObject extends EncodeObject {
|
|
22
|
+
readonly typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContract";
|
|
23
|
+
readonly value: Partial<MsgMigrateContract>;
|
|
24
|
+
}
|
|
25
|
+
export interface MsgExecuteContractEncodeObject extends EncodeObject {
|
|
26
|
+
readonly typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract";
|
|
27
|
+
readonly value: Partial<MsgExecuteContract>;
|
|
28
|
+
}
|
|
29
|
+
export declare class CosmWasmTxClient extends ITxClient {
|
|
30
|
+
constructor(wallet: FirmaWalletService, serverUrl: string);
|
|
31
|
+
static getRegistry(): Registry;
|
|
32
|
+
static msgStoreCode(data: MsgStoreCode): MsgStoreCodeEncodeObject;
|
|
33
|
+
static msgInstantiateContract(data: MsgInstantiateContract): MsgInstantiateContractEncodeObject;
|
|
34
|
+
static msgExecuteContract(data: MsgExecuteContract): MsgExecuteContractEncodeObject;
|
|
35
|
+
static msgUpdateAdmin(data: MsgUpdateAdmin): MsgUpdateAdminEncodeObject;
|
|
36
|
+
static msgClearAdmin(data: MsgClearAdmin): MsgClearAdminEncodeObject;
|
|
37
|
+
static msgMigrateContract(data: MsgMigrateContract): MsgMigrateContractEncodeObject;
|
|
38
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
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.CosmWasmTxClient = 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/cosmwasm/wasm/v1/tx");
|
|
22
|
+
var types = [
|
|
23
|
+
["/cosmwasm.wasm.v1.MsgStoreCode", tx_1.MsgStoreCode],
|
|
24
|
+
["/cosmwasm.wasm.v1.MsgInstantiateContract", tx_1.MsgInstantiateContract],
|
|
25
|
+
["/cosmwasm.wasm.v1.MsgExecuteContract", tx_1.MsgExecuteContract],
|
|
26
|
+
["/cosmwasm.wasm.v1.MsgUpdateAdmin", tx_1.MsgUpdateAdmin],
|
|
27
|
+
["/cosmwasm.wasm.v1.MsgClearAdmin", tx_1.MsgClearAdmin],
|
|
28
|
+
["/cosmwasm.wasm.v1.MsgMigrateContract", tx_1.MsgMigrateContract],
|
|
29
|
+
];
|
|
30
|
+
var registry = new proto_signing_1.Registry(types);
|
|
31
|
+
var CosmWasmTxClient = /** @class */ (function (_super) {
|
|
32
|
+
__extends(CosmWasmTxClient, _super);
|
|
33
|
+
function CosmWasmTxClient(wallet, serverUrl) {
|
|
34
|
+
return _super.call(this, wallet, serverUrl, registry) || this;
|
|
35
|
+
}
|
|
36
|
+
CosmWasmTxClient.getRegistry = function () {
|
|
37
|
+
return registry;
|
|
38
|
+
};
|
|
39
|
+
CosmWasmTxClient.msgStoreCode = function (data) {
|
|
40
|
+
return { typeUrl: "/cosmwasm.wasm.v1.MsgStoreCode", value: data };
|
|
41
|
+
};
|
|
42
|
+
CosmWasmTxClient.msgInstantiateContract = function (data) {
|
|
43
|
+
return { typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract", value: data };
|
|
44
|
+
};
|
|
45
|
+
CosmWasmTxClient.msgExecuteContract = function (data) {
|
|
46
|
+
return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: data };
|
|
47
|
+
};
|
|
48
|
+
CosmWasmTxClient.msgUpdateAdmin = function (data) {
|
|
49
|
+
return { typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdmin", value: data };
|
|
50
|
+
};
|
|
51
|
+
CosmWasmTxClient.msgClearAdmin = function (data) {
|
|
52
|
+
return { typeUrl: "/cosmwasm.wasm.v1.MsgClearAdmin", value: data };
|
|
53
|
+
};
|
|
54
|
+
CosmWasmTxClient.msgMigrateContract = function (data) {
|
|
55
|
+
return { typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContract", value: data };
|
|
56
|
+
};
|
|
57
|
+
return CosmWasmTxClient;
|
|
58
|
+
}(ITxClient_1.ITxClient));
|
|
59
|
+
exports.CosmWasmTxClient = CosmWasmTxClient;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./CosmWasmTxClient"), exports);
|
|
14
|
+
__exportStar(require("./CosmWasmQueryClient"), exports);
|
|
15
|
+
__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 { MsgFundCommunityPool, MsgSetWithdrawAddress, MsgWithdrawDelegatorReward, MsgWithdrawValidatorCommission } from "cosmjs-types/cosmos/distribution/v1beta1/tx";
|
|
3
3
|
import { FirmaWalletService } from "../../FirmaWalletService";
|
|
4
4
|
import { ITxClient } from "../common/ITxClient";
|
|
@@ -20,8 +20,9 @@ export interface MsgWithdrawValidatorCommissionEncodeObject extends EncodeObject
|
|
|
20
20
|
}
|
|
21
21
|
export declare class DistributionTxClient extends ITxClient {
|
|
22
22
|
constructor(wallet: FirmaWalletService, serverUrl: string);
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
static getRegistry(): Registry;
|
|
24
|
+
static msgFundCommunityPool(data: MsgFundCommunityPool): MsgFundCommunityPoolEncodeObject;
|
|
25
|
+
static msgSetWithdrawAddress(data: MsgSetWithdrawAddress): MsgSetWithdrawAddressEncodeObject;
|
|
26
|
+
static msgWithdrawDelegatorReward(data: MsgWithdrawDelegatorReward): MsgWithdrawDelegatorRewardEncodeObject;
|
|
27
|
+
static msgWithdrawValidatorCommission(data: MsgWithdrawValidatorCommission): MsgWithdrawValidatorCommissionEncodeObject;
|
|
27
28
|
}
|
|
@@ -31,16 +31,19 @@ var DistributionTxClient = /** @class */ (function (_super) {
|
|
|
31
31
|
function DistributionTxClient(wallet, serverUrl) {
|
|
32
32
|
return _super.call(this, wallet, serverUrl, registry) || this;
|
|
33
33
|
}
|
|
34
|
-
DistributionTxClient.
|
|
34
|
+
DistributionTxClient.getRegistry = function () {
|
|
35
|
+
return registry;
|
|
36
|
+
};
|
|
37
|
+
DistributionTxClient.msgFundCommunityPool = function (data) {
|
|
35
38
|
return { typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPool", value: data };
|
|
36
39
|
};
|
|
37
|
-
DistributionTxClient.
|
|
40
|
+
DistributionTxClient.msgSetWithdrawAddress = function (data) {
|
|
38
41
|
return { typeUrl: "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", value: data };
|
|
39
42
|
};
|
|
40
|
-
DistributionTxClient.
|
|
43
|
+
DistributionTxClient.msgWithdrawDelegatorReward = function (data) {
|
|
41
44
|
return { typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", value: data };
|
|
42
45
|
};
|
|
43
|
-
DistributionTxClient.
|
|
46
|
+
DistributionTxClient.msgWithdrawValidatorCommission = function (data) {
|
|
44
47
|
return { typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", value: data };
|
|
45
48
|
};
|
|
46
49
|
return DistributionTxClient;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EncodeObject } from "@cosmjs/proto-signing";
|
|
1
|
+
import { Registry, EncodeObject } from "@cosmjs/proto-signing";
|
|
2
2
|
import { MsgGrantAllowance, MsgRevokeAllowance } from "./FeeGrantTxTypes";
|
|
3
3
|
import { ITxClient } from "../common/ITxClient";
|
|
4
4
|
import { FirmaWalletService } from "../../FirmaWalletService";
|
|
@@ -12,6 +12,7 @@ export interface MsgRevokeAllowanceEncodeObject extends EncodeObject {
|
|
|
12
12
|
}
|
|
13
13
|
export declare class FeeGrantTxClient extends ITxClient {
|
|
14
14
|
constructor(wallet: FirmaWalletService, serverUrl: string);
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
static getRegistry(): Registry;
|
|
16
|
+
static msgGrantAllowance(data: MsgGrantAllowance): MsgGrantAllowanceEncodeObject;
|
|
17
|
+
static msgRevokeAllowance(data: MsgRevokeAllowance): MsgRevokeAllowanceEncodeObject;
|
|
17
18
|
}
|
|
@@ -29,10 +29,13 @@ var FeeGrantTxClient = /** @class */ (function (_super) {
|
|
|
29
29
|
function FeeGrantTxClient(wallet, serverUrl) {
|
|
30
30
|
return _super.call(this, wallet, serverUrl, registry) || this;
|
|
31
31
|
}
|
|
32
|
-
FeeGrantTxClient.
|
|
32
|
+
FeeGrantTxClient.getRegistry = function () {
|
|
33
|
+
return registry;
|
|
34
|
+
};
|
|
35
|
+
FeeGrantTxClient.msgGrantAllowance = function (data) {
|
|
33
36
|
return { typeUrl: "/cosmos.feegrant.v1beta1.MsgGrantAllowance", value: data };
|
|
34
37
|
};
|
|
35
|
-
FeeGrantTxClient.
|
|
38
|
+
FeeGrantTxClient.msgRevokeAllowance = function (data) {
|
|
36
39
|
return { typeUrl: "/cosmos.feegrant.v1beta1.MsgRevokeAllowance", value: data };
|
|
37
40
|
};
|
|
38
41
|
return FeeGrantTxClient;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EncodeObject } from "@cosmjs/proto-signing";
|
|
1
|
+
import { Registry, EncodeObject } from "@cosmjs/proto-signing";
|
|
2
2
|
import { MsgDeposit, MsgSubmitProposal, MsgVote } from "cosmjs-types/cosmos/gov/v1beta1/tx";
|
|
3
3
|
import { FirmaWalletService } from "../../FirmaWalletService";
|
|
4
4
|
import { ITxClient } from "../common/ITxClient";
|
|
@@ -16,7 +16,8 @@ export interface MsgVoteEncodeObject extends EncodeObject {
|
|
|
16
16
|
}
|
|
17
17
|
export declare class GovTxClient extends ITxClient {
|
|
18
18
|
constructor(wallet: FirmaWalletService, serverUrl: string);
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
static getRegistry(): Registry;
|
|
20
|
+
static msgDeposit(data: MsgDeposit): MsgDepositEncodeObject;
|
|
21
|
+
static msgSubmitProposal(data: MsgSubmitProposal): MsgSubmitProposalEncodeObject;
|
|
22
|
+
static msgVote(data: MsgVote): MsgVoteEncodeObject;
|
|
22
23
|
}
|
|
@@ -30,13 +30,16 @@ var GovTxClient = /** @class */ (function (_super) {
|
|
|
30
30
|
function GovTxClient(wallet, serverUrl) {
|
|
31
31
|
return _super.call(this, wallet, serverUrl, registry) || this;
|
|
32
32
|
}
|
|
33
|
-
GovTxClient.
|
|
33
|
+
GovTxClient.getRegistry = function () {
|
|
34
|
+
return registry;
|
|
35
|
+
};
|
|
36
|
+
GovTxClient.msgDeposit = function (data) {
|
|
34
37
|
return { typeUrl: "/cosmos.gov.v1beta1.MsgDeposit", value: data };
|
|
35
38
|
};
|
|
36
|
-
GovTxClient.
|
|
39
|
+
GovTxClient.msgSubmitProposal = function (data) {
|
|
37
40
|
return { typeUrl: "/cosmos.gov.v1beta1.MsgSubmitProposal", value: data };
|
|
38
41
|
};
|
|
39
|
-
GovTxClient.
|
|
42
|
+
GovTxClient.msgVote = function (data) {
|
|
40
43
|
return { typeUrl: "/cosmos.gov.v1beta1.MsgVote", value: data };
|
|
41
44
|
};
|
|
42
45
|
return GovTxClient;
|
|
@@ -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/" + sourceChannel + "/ports/" + 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,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./IbcTxClient"), exports);
|
|
14
|
+
__exportStar(require("./IbcQueryClient"), exports);
|
|
15
|
+
__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
|
}
|