@firmachain/firma-js 0.2.32 → 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.js +15 -15
- package/dist/sdk/FirmaBankService.js +1 -1
- package/dist/sdk/FirmaContractService.js +10 -12
- package/dist/sdk/FirmaCosmWasmService.js +18 -18
- package/dist/sdk/FirmaDistributionService.js +5 -5
- package/dist/sdk/FirmaFeeGrantService.js +3 -3
- package/dist/sdk/FirmaGovService.js +19 -19
- package/dist/sdk/FirmaIbcService.js +3 -3
- package/dist/sdk/FirmaNftService.js +6 -6
- package/dist/sdk/FirmaStakingService.js +5 -5
- package/dist/sdk/FirmaTokenService.js +12 -12
- package/dist/sdk/FirmaUtil.d.ts +11 -1
- package/dist/sdk/FirmaUtil.js +137 -11
- package/dist/sdk/firmachain/authz/AuthzTxClient.d.ts +5 -4
- package/dist/sdk/firmachain/authz/AuthzTxClient.js +6 -3
- 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 +3 -3
- package/dist/sdk/firmachain/common/ITxClient.js +14 -8
- 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/CosmWasmTxClient.d.ts +8 -7
- package/dist/sdk/firmachain/cosmwasm/CosmWasmTxClient.js +9 -6
- 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/IbcTxClient.d.ts +3 -2
- package/dist/sdk/firmachain/ibc/IbcTxClient.js +4 -1
- package/dist/sdk/firmachain/nft/NftTxClient.d.ts +5 -4
- package/dist/sdk/firmachain/nft/NftTxClient.js +6 -3
- 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 -3
|
@@ -49,12 +49,11 @@ var FirmaAuthzService = /** @class */ (function () {
|
|
|
49
49
|
FirmaAuthzService.prototype.getSignedTxGrantSendAutorization = function (wallet, granteeAddress, maxTokens, expirationDate, txMisc) {
|
|
50
50
|
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
51
51
|
return __awaiter(this, void 0, void 0, function () {
|
|
52
|
-
var
|
|
52
|
+
var address, authorization, timestamp, message, authzTxClient, error_1;
|
|
53
53
|
return __generator(this, function (_a) {
|
|
54
54
|
switch (_a.label) {
|
|
55
55
|
case 0:
|
|
56
56
|
_a.trys.push([0, 3, , 4]);
|
|
57
|
-
authzTxClient = new authz_1.AuthzTxClient(wallet, this.config.rpcAddress);
|
|
58
57
|
return [4 /*yield*/, wallet.getAddress()];
|
|
59
58
|
case 1:
|
|
60
59
|
address = _a.sent();
|
|
@@ -65,7 +64,7 @@ var FirmaAuthzService = /** @class */ (function () {
|
|
|
65
64
|
})).finish()),
|
|
66
65
|
});
|
|
67
66
|
timestamp = timestamp_1.Timestamp.fromPartial({ seconds: expirationDate.getTime() / 1000 });
|
|
68
|
-
message =
|
|
67
|
+
message = authz_1.AuthzTxClient.msgGrantAllowance({
|
|
69
68
|
granter: address,
|
|
70
69
|
grantee: granteeAddress,
|
|
71
70
|
grant: {
|
|
@@ -73,6 +72,7 @@ var FirmaAuthzService = /** @class */ (function () {
|
|
|
73
72
|
expiration: timestamp
|
|
74
73
|
}
|
|
75
74
|
});
|
|
75
|
+
authzTxClient = new authz_1.AuthzTxClient(wallet, this.config.rpcAddress);
|
|
76
76
|
return [4 /*yield*/, authzTxClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
77
77
|
case 2: return [2 /*return*/, _a.sent()];
|
|
78
78
|
case 3:
|
|
@@ -87,12 +87,11 @@ var FirmaAuthzService = /** @class */ (function () {
|
|
|
87
87
|
FirmaAuthzService.prototype.getSignedTxGrantStakeAutorization = function (wallet, granteeAddress, validatorAddress, type, maxTokens, expirationDate, txMisc) {
|
|
88
88
|
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
89
89
|
return __awaiter(this, void 0, void 0, function () {
|
|
90
|
-
var
|
|
90
|
+
var address, authorization, timestamp, message, authzTxClient, error_2;
|
|
91
91
|
return __generator(this, function (_a) {
|
|
92
92
|
switch (_a.label) {
|
|
93
93
|
case 0:
|
|
94
94
|
_a.trys.push([0, 3, , 4]);
|
|
95
|
-
authzTxClient = new authz_1.AuthzTxClient(wallet, this.config.rpcAddress);
|
|
96
95
|
return [4 /*yield*/, wallet.getAddress()];
|
|
97
96
|
case 1:
|
|
98
97
|
address = _a.sent();
|
|
@@ -105,7 +104,7 @@ var FirmaAuthzService = /** @class */ (function () {
|
|
|
105
104
|
})).finish()),
|
|
106
105
|
});
|
|
107
106
|
timestamp = timestamp_1.Timestamp.fromPartial({ seconds: expirationDate.getTime() / 1000 });
|
|
108
|
-
message =
|
|
107
|
+
message = authz_1.AuthzTxClient.msgGrantAllowance({
|
|
109
108
|
granter: address,
|
|
110
109
|
grantee: granteeAddress,
|
|
111
110
|
grant: {
|
|
@@ -113,6 +112,7 @@ var FirmaAuthzService = /** @class */ (function () {
|
|
|
113
112
|
expiration: timestamp
|
|
114
113
|
}
|
|
115
114
|
});
|
|
115
|
+
authzTxClient = new authz_1.AuthzTxClient(wallet, this.config.rpcAddress);
|
|
116
116
|
return [4 /*yield*/, authzTxClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
117
117
|
case 2: return [2 /*return*/, _a.sent()];
|
|
118
118
|
case 3:
|
|
@@ -127,12 +127,11 @@ var FirmaAuthzService = /** @class */ (function () {
|
|
|
127
127
|
FirmaAuthzService.prototype.getSignedTxGrantGenericAuthorization = function (wallet, granteeAddress, msgType, expirationDate, txMisc) {
|
|
128
128
|
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
129
129
|
return __awaiter(this, void 0, void 0, function () {
|
|
130
|
-
var
|
|
130
|
+
var address, authorization, timestamp, message, authzTxClient, error_3;
|
|
131
131
|
return __generator(this, function (_a) {
|
|
132
132
|
switch (_a.label) {
|
|
133
133
|
case 0:
|
|
134
134
|
_a.trys.push([0, 3, , 4]);
|
|
135
|
-
authzTxClient = new authz_1.AuthzTxClient(wallet, this.config.rpcAddress);
|
|
136
135
|
return [4 /*yield*/, wallet.getAddress()];
|
|
137
136
|
case 1:
|
|
138
137
|
address = _a.sent();
|
|
@@ -143,7 +142,7 @@ var FirmaAuthzService = /** @class */ (function () {
|
|
|
143
142
|
})).finish()),
|
|
144
143
|
});
|
|
145
144
|
timestamp = timestamp_1.Timestamp.fromPartial({ seconds: expirationDate.getTime() / 1000 });
|
|
146
|
-
message =
|
|
145
|
+
message = authz_1.AuthzTxClient.msgGrantAllowance({
|
|
147
146
|
granter: address,
|
|
148
147
|
grantee: granteeAddress,
|
|
149
148
|
grant: {
|
|
@@ -151,6 +150,7 @@ var FirmaAuthzService = /** @class */ (function () {
|
|
|
151
150
|
expiration: timestamp
|
|
152
151
|
}
|
|
153
152
|
});
|
|
153
|
+
authzTxClient = new authz_1.AuthzTxClient(wallet, this.config.rpcAddress);
|
|
154
154
|
return [4 /*yield*/, authzTxClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
155
155
|
case 2: return [2 /*return*/, _a.sent()];
|
|
156
156
|
case 3:
|
|
@@ -165,20 +165,20 @@ var FirmaAuthzService = /** @class */ (function () {
|
|
|
165
165
|
FirmaAuthzService.prototype.getSignedTxRevokeGenericAuthorization = function (wallet, granteeAddress, msgType, txMisc) {
|
|
166
166
|
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
167
167
|
return __awaiter(this, void 0, void 0, function () {
|
|
168
|
-
var
|
|
168
|
+
var address, message, authzTxClient, error_4;
|
|
169
169
|
return __generator(this, function (_a) {
|
|
170
170
|
switch (_a.label) {
|
|
171
171
|
case 0:
|
|
172
172
|
_a.trys.push([0, 3, , 4]);
|
|
173
|
-
authzTxClient = new authz_1.AuthzTxClient(wallet, this.config.rpcAddress);
|
|
174
173
|
return [4 /*yield*/, wallet.getAddress()];
|
|
175
174
|
case 1:
|
|
176
175
|
address = _a.sent();
|
|
177
|
-
message =
|
|
176
|
+
message = authz_1.AuthzTxClient.msgRevokeAllowance({
|
|
178
177
|
granter: address,
|
|
179
178
|
grantee: granteeAddress,
|
|
180
179
|
msgTypeUrl: msgType
|
|
181
180
|
});
|
|
181
|
+
authzTxClient = new authz_1.AuthzTxClient(wallet, this.config.rpcAddress);
|
|
182
182
|
return [4 /*yield*/, authzTxClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
183
183
|
case 2: return [2 /*return*/, _a.sent()];
|
|
184
184
|
case 3:
|
|
@@ -194,19 +194,19 @@ var FirmaAuthzService = /** @class */ (function () {
|
|
|
194
194
|
FirmaAuthzService.prototype.getSignedTxExecuteAllowance = function (wallet, msgs, txMisc) {
|
|
195
195
|
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
196
196
|
return __awaiter(this, void 0, void 0, function () {
|
|
197
|
-
var
|
|
197
|
+
var address, message, authzTxClient, error_5;
|
|
198
198
|
return __generator(this, function (_a) {
|
|
199
199
|
switch (_a.label) {
|
|
200
200
|
case 0:
|
|
201
201
|
_a.trys.push([0, 3, , 4]);
|
|
202
|
-
authzTxClient = new authz_1.AuthzTxClient(wallet, this.config.rpcAddress);
|
|
203
202
|
return [4 /*yield*/, wallet.getAddress()];
|
|
204
203
|
case 1:
|
|
205
204
|
address = _a.sent();
|
|
206
|
-
message =
|
|
205
|
+
message = authz_1.AuthzTxClient.msgExecAllowance({
|
|
207
206
|
grantee: address,
|
|
208
207
|
msgs: msgs
|
|
209
208
|
});
|
|
209
|
+
authzTxClient = new authz_1.AuthzTxClient(wallet, this.config.rpcAddress);
|
|
210
210
|
return [4 /*yield*/, authzTxClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
211
211
|
case 2: return [2 /*return*/, _a.sent()];
|
|
212
212
|
case 3:
|
|
@@ -219,7 +219,7 @@ var FirmaBankService = /** @class */ (function () {
|
|
|
219
219
|
case 1:
|
|
220
220
|
address = _a.sent();
|
|
221
221
|
sendAmount = { denom: denom, amount: amount };
|
|
222
|
-
message =
|
|
222
|
+
message = bank_1.BankTxClient.msgSend({ fromAddress: address, toAddress: targetAddress, amount: [sendAmount] });
|
|
223
223
|
return [4 /*yield*/, bankTxClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
224
224
|
case 2: return [2 /*return*/, _a.sent()];
|
|
225
225
|
case 3:
|
|
@@ -206,7 +206,7 @@ var ContractService = /** @class */ (function () {
|
|
|
206
206
|
};
|
|
207
207
|
ContractService.prototype.getUnsignedTxCreateContractFile = function (wallet, fileHash, timeStamp, ownerList, metaDataJsonString) {
|
|
208
208
|
return __awaiter(this, void 0, void 0, function () {
|
|
209
|
-
var address,
|
|
209
|
+
var address, error_9;
|
|
210
210
|
return __generator(this, function (_a) {
|
|
211
211
|
switch (_a.label) {
|
|
212
212
|
case 0:
|
|
@@ -214,8 +214,7 @@ var ContractService = /** @class */ (function () {
|
|
|
214
214
|
return [4 /*yield*/, wallet.getAddress()];
|
|
215
215
|
case 1:
|
|
216
216
|
address = _a.sent();
|
|
217
|
-
|
|
218
|
-
return [2 /*return*/, contractTxClient.msgCreateContractFile({
|
|
217
|
+
return [2 /*return*/, contract_1.ContractTxClient.msgCreateContractFile({
|
|
219
218
|
creator: address,
|
|
220
219
|
fileHash: fileHash,
|
|
221
220
|
timeStamp: timeStamp,
|
|
@@ -234,7 +233,7 @@ var ContractService = /** @class */ (function () {
|
|
|
234
233
|
ContractService.prototype.getSignedTxCreateContractFile = function (wallet, fileHash, timeStamp, ownerList, metaDataJsonString, txMisc) {
|
|
235
234
|
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
236
235
|
return __awaiter(this, void 0, void 0, function () {
|
|
237
|
-
var address,
|
|
236
|
+
var address, message, contractTxClient, error_10;
|
|
238
237
|
return __generator(this, function (_a) {
|
|
239
238
|
switch (_a.label) {
|
|
240
239
|
case 0:
|
|
@@ -242,14 +241,14 @@ var ContractService = /** @class */ (function () {
|
|
|
242
241
|
return [4 /*yield*/, wallet.getAddress()];
|
|
243
242
|
case 1:
|
|
244
243
|
address = _a.sent();
|
|
245
|
-
|
|
246
|
-
message = contractTxClient.msgCreateContractFile({
|
|
244
|
+
message = contract_1.ContractTxClient.msgCreateContractFile({
|
|
247
245
|
creator: address,
|
|
248
246
|
fileHash: fileHash,
|
|
249
247
|
timeStamp: timeStamp,
|
|
250
248
|
ownerList: ownerList,
|
|
251
249
|
metaDataJsonString: metaDataJsonString
|
|
252
250
|
});
|
|
251
|
+
contractTxClient = new contract_1.ContractTxClient(wallet, this.config.rpcAddress);
|
|
253
252
|
return [4 /*yield*/, contractTxClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
254
253
|
case 2: return [2 /*return*/, _a.sent()];
|
|
255
254
|
case 3:
|
|
@@ -309,7 +308,7 @@ var ContractService = /** @class */ (function () {
|
|
|
309
308
|
ContractService.prototype.getSignedTxAddContractLog = function (wallet, contractHash, timeStamp, eventName, ownerAddress, jsonString, txMisc) {
|
|
310
309
|
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
311
310
|
return __awaiter(this, void 0, void 0, function () {
|
|
312
|
-
var address,
|
|
311
|
+
var address, message, contractTxClient, error_13;
|
|
313
312
|
return __generator(this, function (_a) {
|
|
314
313
|
switch (_a.label) {
|
|
315
314
|
case 0:
|
|
@@ -317,8 +316,7 @@ var ContractService = /** @class */ (function () {
|
|
|
317
316
|
return [4 /*yield*/, wallet.getAddress()];
|
|
318
317
|
case 1:
|
|
319
318
|
address = _a.sent();
|
|
320
|
-
|
|
321
|
-
message = contractTxClient.msgAddContractLog({
|
|
319
|
+
message = contract_1.ContractTxClient.msgAddContractLog({
|
|
322
320
|
creator: address,
|
|
323
321
|
contractHash: contractHash,
|
|
324
322
|
timeStamp: timeStamp,
|
|
@@ -326,6 +324,7 @@ var ContractService = /** @class */ (function () {
|
|
|
326
324
|
ownerAddress: ownerAddress,
|
|
327
325
|
jsonString: jsonString
|
|
328
326
|
});
|
|
327
|
+
contractTxClient = new contract_1.ContractTxClient(wallet, this.config.rpcAddress);
|
|
329
328
|
return [4 /*yield*/, contractTxClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
330
329
|
case 2: return [2 /*return*/, _a.sent()];
|
|
331
330
|
case 3:
|
|
@@ -362,7 +361,7 @@ var ContractService = /** @class */ (function () {
|
|
|
362
361
|
};
|
|
363
362
|
ContractService.prototype.getUnsignedTxAddContractLog = function (wallet, contractHash, timeStamp, eventName, ownerAddress, jsonString) {
|
|
364
363
|
return __awaiter(this, void 0, void 0, function () {
|
|
365
|
-
var address,
|
|
364
|
+
var address, error_15;
|
|
366
365
|
return __generator(this, function (_a) {
|
|
367
366
|
switch (_a.label) {
|
|
368
367
|
case 0:
|
|
@@ -370,8 +369,7 @@ var ContractService = /** @class */ (function () {
|
|
|
370
369
|
return [4 /*yield*/, wallet.getAddress()];
|
|
371
370
|
case 1:
|
|
372
371
|
address = _a.sent();
|
|
373
|
-
|
|
374
|
-
return [2 /*return*/, contractTxClient.msgAddContractLog({
|
|
372
|
+
return [2 /*return*/, contract_1.ContractTxClient.msgAddContractLog({
|
|
375
373
|
creator: address,
|
|
376
374
|
contractHash: contractHash,
|
|
377
375
|
timeStamp: timeStamp,
|
|
@@ -327,17 +327,17 @@ var FirmaCosmWasmService = /** @class */ (function () {
|
|
|
327
327
|
FirmaCosmWasmService.prototype.getSignedTxInstantiateContract = function (wallet, admin, codeId, label, msg, funds, txMisc) {
|
|
328
328
|
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
329
329
|
return __awaiter(this, void 0, void 0, function () {
|
|
330
|
-
var
|
|
330
|
+
var address, utfMsg, message, txClient, error_13;
|
|
331
331
|
return __generator(this, function (_a) {
|
|
332
332
|
switch (_a.label) {
|
|
333
333
|
case 0:
|
|
334
334
|
_a.trys.push([0, 3, , 4]);
|
|
335
|
-
txClient = new cosmwasm_1.CosmWasmTxClient(wallet, this.config.rpcAddress);
|
|
336
335
|
return [4 /*yield*/, wallet.getAddress()];
|
|
337
336
|
case 1:
|
|
338
337
|
address = _a.sent();
|
|
339
338
|
utfMsg = encoding_1.toUtf8(msg);
|
|
340
|
-
message =
|
|
339
|
+
message = cosmwasm_1.CosmWasmTxClient.msgInstantiateContract({ sender: address, admin: admin, codeId: long_1.default.fromString(codeId), label: label, msg: utfMsg, funds: funds });
|
|
340
|
+
txClient = new cosmwasm_1.CosmWasmTxClient(wallet, this.config.rpcAddress);
|
|
341
341
|
return [4 /*yield*/, txClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
342
342
|
case 2: return [2 /*return*/, _a.sent()];
|
|
343
343
|
case 3:
|
|
@@ -352,16 +352,16 @@ var FirmaCosmWasmService = /** @class */ (function () {
|
|
|
352
352
|
FirmaCosmWasmService.prototype.getSignedTxUpdateAdmin = function (wallet, contractAddress, adminAddress, txMisc) {
|
|
353
353
|
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
354
354
|
return __awaiter(this, void 0, void 0, function () {
|
|
355
|
-
var
|
|
355
|
+
var address, message, txClient, error_14;
|
|
356
356
|
return __generator(this, function (_a) {
|
|
357
357
|
switch (_a.label) {
|
|
358
358
|
case 0:
|
|
359
359
|
_a.trys.push([0, 3, , 4]);
|
|
360
|
-
txClient = new cosmwasm_1.CosmWasmTxClient(wallet, this.config.rpcAddress);
|
|
361
360
|
return [4 /*yield*/, wallet.getAddress()];
|
|
362
361
|
case 1:
|
|
363
362
|
address = _a.sent();
|
|
364
|
-
message =
|
|
363
|
+
message = cosmwasm_1.CosmWasmTxClient.msgUpdateAdmin({ sender: address, contract: contractAddress, newAdmin: adminAddress });
|
|
364
|
+
txClient = new cosmwasm_1.CosmWasmTxClient(wallet, this.config.rpcAddress);
|
|
365
365
|
return [4 /*yield*/, txClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
366
366
|
case 2: return [2 /*return*/, _a.sent()];
|
|
367
367
|
case 3:
|
|
@@ -376,16 +376,16 @@ var FirmaCosmWasmService = /** @class */ (function () {
|
|
|
376
376
|
FirmaCosmWasmService.prototype.getSignedTxClearAdmin = function (wallet, contractAddress, txMisc) {
|
|
377
377
|
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
378
378
|
return __awaiter(this, void 0, void 0, function () {
|
|
379
|
-
var
|
|
379
|
+
var address, message, txClient, error_15;
|
|
380
380
|
return __generator(this, function (_a) {
|
|
381
381
|
switch (_a.label) {
|
|
382
382
|
case 0:
|
|
383
383
|
_a.trys.push([0, 3, , 4]);
|
|
384
|
-
txClient = new cosmwasm_1.CosmWasmTxClient(wallet, this.config.rpcAddress);
|
|
385
384
|
return [4 /*yield*/, wallet.getAddress()];
|
|
386
385
|
case 1:
|
|
387
386
|
address = _a.sent();
|
|
388
|
-
message =
|
|
387
|
+
message = cosmwasm_1.CosmWasmTxClient.msgClearAdmin({ sender: address, contract: contractAddress });
|
|
388
|
+
txClient = new cosmwasm_1.CosmWasmTxClient(wallet, this.config.rpcAddress);
|
|
389
389
|
return [4 /*yield*/, txClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
390
390
|
case 2: return [2 /*return*/, _a.sent()];
|
|
391
391
|
case 3:
|
|
@@ -400,17 +400,17 @@ var FirmaCosmWasmService = /** @class */ (function () {
|
|
|
400
400
|
FirmaCosmWasmService.prototype.getSignedTxMigrateContract = function (wallet, contractAddress, codeId, msg, txMisc) {
|
|
401
401
|
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
402
402
|
return __awaiter(this, void 0, void 0, function () {
|
|
403
|
-
var
|
|
403
|
+
var address, utfMsg, message, txClient, error_16;
|
|
404
404
|
return __generator(this, function (_a) {
|
|
405
405
|
switch (_a.label) {
|
|
406
406
|
case 0:
|
|
407
407
|
_a.trys.push([0, 3, , 4]);
|
|
408
|
-
txClient = new cosmwasm_1.CosmWasmTxClient(wallet, this.config.rpcAddress);
|
|
409
408
|
return [4 /*yield*/, wallet.getAddress()];
|
|
410
409
|
case 1:
|
|
411
410
|
address = _a.sent();
|
|
412
411
|
utfMsg = encoding_1.toUtf8(msg);
|
|
413
|
-
message =
|
|
412
|
+
message = cosmwasm_1.CosmWasmTxClient.msgMigrateContract({ sender: address, contract: contractAddress, codeId: long_1.default.fromString(codeId), msg: utfMsg });
|
|
413
|
+
txClient = new cosmwasm_1.CosmWasmTxClient(wallet, this.config.rpcAddress);
|
|
414
414
|
return [4 /*yield*/, txClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
415
415
|
case 2: return [2 /*return*/, _a.sent()];
|
|
416
416
|
case 3:
|
|
@@ -425,17 +425,17 @@ var FirmaCosmWasmService = /** @class */ (function () {
|
|
|
425
425
|
FirmaCosmWasmService.prototype.getSignedTxExecuteContract = function (wallet, contractAddress, msg, funds, txMisc) {
|
|
426
426
|
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
427
427
|
return __awaiter(this, void 0, void 0, function () {
|
|
428
|
-
var
|
|
428
|
+
var address, utfMsg, message, txClient, error_17;
|
|
429
429
|
return __generator(this, function (_a) {
|
|
430
430
|
switch (_a.label) {
|
|
431
431
|
case 0:
|
|
432
432
|
_a.trys.push([0, 3, , 4]);
|
|
433
|
-
txClient = new cosmwasm_1.CosmWasmTxClient(wallet, this.config.rpcAddress);
|
|
434
433
|
return [4 /*yield*/, wallet.getAddress()];
|
|
435
434
|
case 1:
|
|
436
435
|
address = _a.sent();
|
|
437
436
|
utfMsg = encoding_1.toUtf8(msg);
|
|
438
|
-
message =
|
|
437
|
+
message = cosmwasm_1.CosmWasmTxClient.msgExecuteContract({ sender: address, contract: contractAddress, msg: utfMsg, funds: funds });
|
|
438
|
+
txClient = new cosmwasm_1.CosmWasmTxClient(wallet, this.config.rpcAddress);
|
|
439
439
|
return [4 /*yield*/, txClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
440
440
|
case 2: return [2 /*return*/, _a.sent()];
|
|
441
441
|
case 3:
|
|
@@ -450,17 +450,17 @@ var FirmaCosmWasmService = /** @class */ (function () {
|
|
|
450
450
|
FirmaCosmWasmService.prototype.getSignedTxStoreCode = function (wallet, wasmCode, accessConfig, txMisc) {
|
|
451
451
|
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
452
452
|
return __awaiter(this, void 0, void 0, function () {
|
|
453
|
-
var
|
|
453
|
+
var address, compressed, message, txClient, error_18;
|
|
454
454
|
return __generator(this, function (_a) {
|
|
455
455
|
switch (_a.label) {
|
|
456
456
|
case 0:
|
|
457
457
|
_a.trys.push([0, 3, , 4]);
|
|
458
|
-
txClient = new cosmwasm_1.CosmWasmTxClient(wallet, this.config.rpcAddress);
|
|
459
458
|
return [4 /*yield*/, wallet.getAddress()];
|
|
460
459
|
case 1:
|
|
461
460
|
address = _a.sent();
|
|
462
461
|
compressed = pako_1.default.gzip(wasmCode, { level: 9 });
|
|
463
|
-
message =
|
|
462
|
+
message = cosmwasm_1.CosmWasmTxClient.msgStoreCode({ sender: address, wasmByteCode: compressed, instantiatePermission: accessConfig });
|
|
463
|
+
txClient = new cosmwasm_1.CosmWasmTxClient(wallet, this.config.rpcAddress);
|
|
464
464
|
return [4 /*yield*/, txClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
465
465
|
case 2: return [2 /*return*/, _a.sent()];
|
|
466
466
|
case 3:
|
|
@@ -168,7 +168,7 @@ var FirmaDistributionService = /** @class */ (function () {
|
|
|
168
168
|
return [4 /*yield*/, wallet.getAddress()];
|
|
169
169
|
case 1:
|
|
170
170
|
address = _a.sent();
|
|
171
|
-
message =
|
|
171
|
+
message = distribution_1.DistributionTxClient.msgWithdrawDelegatorReward({ delegatorAddress: address, validatorAddress: validatorAddress });
|
|
172
172
|
return [4 /*yield*/, txClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
173
173
|
case 2: return [2 /*return*/, _a.sent()];
|
|
174
174
|
case 3:
|
|
@@ -192,7 +192,7 @@ var FirmaDistributionService = /** @class */ (function () {
|
|
|
192
192
|
return [4 /*yield*/, wallet.getAddress()];
|
|
193
193
|
case 1:
|
|
194
194
|
address = _a.sent();
|
|
195
|
-
message =
|
|
195
|
+
message = distribution_1.DistributionTxClient.msgSetWithdrawAddress({ delegatorAddress: address, withdrawAddress: withdrawAddress });
|
|
196
196
|
return [4 /*yield*/, txClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
197
197
|
case 2: return [2 /*return*/, _a.sent()];
|
|
198
198
|
case 3:
|
|
@@ -217,7 +217,7 @@ var FirmaDistributionService = /** @class */ (function () {
|
|
|
217
217
|
case 1:
|
|
218
218
|
address = _a.sent();
|
|
219
219
|
sendAmount = { denom: this.config.denom, amount: FirmaUtil_1.FirmaUtil.getUFCTStringFromFCT(amount) };
|
|
220
|
-
message =
|
|
220
|
+
message = distribution_1.DistributionTxClient.msgFundCommunityPool({ depositor: address, amount: [sendAmount] });
|
|
221
221
|
return [4 /*yield*/, txClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
222
222
|
case 2: return [2 /*return*/, _a.sent()];
|
|
223
223
|
case 3:
|
|
@@ -238,7 +238,7 @@ var FirmaDistributionService = /** @class */ (function () {
|
|
|
238
238
|
case 0:
|
|
239
239
|
_a.trys.push([0, 2, , 3]);
|
|
240
240
|
txClient = new distribution_1.DistributionTxClient(wallet, this.config.rpcAddress);
|
|
241
|
-
message =
|
|
241
|
+
message = distribution_1.DistributionTxClient.msgWithdrawValidatorCommission({ validatorAddress: validatorAddres });
|
|
242
242
|
return [4 /*yield*/, txClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
243
243
|
case 1: return [2 /*return*/, _a.sent()];
|
|
244
244
|
case 2:
|
|
@@ -334,7 +334,7 @@ var FirmaDistributionService = /** @class */ (function () {
|
|
|
334
334
|
messageList = [];
|
|
335
335
|
for (i = 0; i < delegationList.length; i++) {
|
|
336
336
|
validatorAddress = delegationList[i].delegation.validator_address;
|
|
337
|
-
message =
|
|
337
|
+
message = distribution_1.DistributionTxClient.msgWithdrawDelegatorReward({ delegatorAddress: address, validatorAddress: validatorAddress });
|
|
338
338
|
messageList.push(message);
|
|
339
339
|
}
|
|
340
340
|
return [4 /*yield*/, txClient.sign(messageList, FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
@@ -80,7 +80,7 @@ var FirmaFeeGrantService = /** @class */ (function () {
|
|
|
80
80
|
case 1:
|
|
81
81
|
address = _a.sent();
|
|
82
82
|
feeGrantTxClient = new feegrant_1.FeeGrantTxClient(wallet, this.config.rpcAddress);
|
|
83
|
-
message =
|
|
83
|
+
message = feegrant_1.FeeGrantTxClient.msgRevokeAllowance({ granter: address, grantee: granteeAddress });
|
|
84
84
|
return [4 /*yield*/, feeGrantTxClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
85
85
|
case 2: return [2 /*return*/, _a.sent()];
|
|
86
86
|
case 3:
|
|
@@ -169,7 +169,7 @@ var FirmaFeeGrantService = /** @class */ (function () {
|
|
|
169
169
|
typeUrl: "/cosmos.feegrant.v1beta1.PeriodicAllowance",
|
|
170
170
|
value: bytes
|
|
171
171
|
};
|
|
172
|
-
message =
|
|
172
|
+
message = feegrant_1.FeeGrantTxClient.msgGrantAllowance({
|
|
173
173
|
granter: address,
|
|
174
174
|
grantee: granteeAddress,
|
|
175
175
|
allowance: any_1.Any.fromJSON(allowanceAnyData)
|
|
@@ -230,7 +230,7 @@ var FirmaFeeGrantService = /** @class */ (function () {
|
|
|
230
230
|
typeUrl: "/cosmos.feegrant.v1beta1.BasicAllowance",
|
|
231
231
|
value: bytes
|
|
232
232
|
};
|
|
233
|
-
message =
|
|
233
|
+
message = feegrant_1.FeeGrantTxClient.msgGrantAllowance({
|
|
234
234
|
granter: address,
|
|
235
235
|
grantee: granteeAddress,
|
|
236
236
|
allowance: any_1.Any.fromJSON(allowanceAnyData)
|
|
@@ -219,12 +219,11 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
219
219
|
FirmaGovService.prototype.getSignedTxSubmitTextProposal = function (wallet, title, description, initialDepositFCT, txMisc) {
|
|
220
220
|
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
221
221
|
return __awaiter(this, void 0, void 0, function () {
|
|
222
|
-
var
|
|
222
|
+
var sendAmount, proposal, content, proposer, message, txClient, error_8;
|
|
223
223
|
return __generator(this, function (_a) {
|
|
224
224
|
switch (_a.label) {
|
|
225
225
|
case 0:
|
|
226
226
|
_a.trys.push([0, 3, , 4]);
|
|
227
|
-
txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
|
|
228
227
|
sendAmount = { denom: this.config.denom, amount: FirmaUtil_1.FirmaUtil.getUFCTStringFromFCT(initialDepositFCT) };
|
|
229
228
|
proposal = gov_2.TextProposal.fromPartial({
|
|
230
229
|
title: title,
|
|
@@ -237,7 +236,8 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
237
236
|
return [4 /*yield*/, wallet.getAddress()];
|
|
238
237
|
case 1:
|
|
239
238
|
proposer = _a.sent();
|
|
240
|
-
message =
|
|
239
|
+
message = gov_1.GovTxClient.msgSubmitProposal({ content: content, initialDeposit: [sendAmount], proposer: proposer });
|
|
240
|
+
txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
|
|
241
241
|
return [4 /*yield*/, txClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
242
242
|
case 2: return [2 /*return*/, _a.sent()];
|
|
243
243
|
case 3:
|
|
@@ -252,12 +252,11 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
252
252
|
FirmaGovService.prototype.getSignedTxSubmitCancelSoftwareUpgradeProposal = function (wallet, title, description, initialDepositFCT, txMisc) {
|
|
253
253
|
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
254
254
|
return __awaiter(this, void 0, void 0, function () {
|
|
255
|
-
var
|
|
255
|
+
var initialDepositAmount, proposal, content, proposer, message, txClient, error_9;
|
|
256
256
|
return __generator(this, function (_a) {
|
|
257
257
|
switch (_a.label) {
|
|
258
258
|
case 0:
|
|
259
259
|
_a.trys.push([0, 3, , 4]);
|
|
260
|
-
txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
|
|
261
260
|
initialDepositAmount = {
|
|
262
261
|
denom: this.config.denom,
|
|
263
262
|
amount: FirmaUtil_1.FirmaUtil.getUFCTStringFromFCT(initialDepositFCT)
|
|
@@ -273,11 +272,12 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
273
272
|
return [4 /*yield*/, wallet.getAddress()];
|
|
274
273
|
case 1:
|
|
275
274
|
proposer = _a.sent();
|
|
276
|
-
message =
|
|
275
|
+
message = gov_1.GovTxClient.msgSubmitProposal({
|
|
277
276
|
content: content,
|
|
278
277
|
initialDeposit: [initialDepositAmount],
|
|
279
278
|
proposer: proposer
|
|
280
279
|
});
|
|
280
|
+
txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
|
|
281
281
|
return [4 /*yield*/, txClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
282
282
|
case 2: return [2 /*return*/, _a.sent()];
|
|
283
283
|
case 3:
|
|
@@ -292,12 +292,11 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
292
292
|
FirmaGovService.prototype.getSignedTxSubmitSoftwareUpgradeProposal = function (wallet, title, description, initialDepositFCT, plan, txMisc) {
|
|
293
293
|
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
294
294
|
return __awaiter(this, void 0, void 0, function () {
|
|
295
|
-
var
|
|
295
|
+
var initialDepositAmount, proposal, content, proposer, message, txClient, error_10;
|
|
296
296
|
return __generator(this, function (_a) {
|
|
297
297
|
switch (_a.label) {
|
|
298
298
|
case 0:
|
|
299
299
|
_a.trys.push([0, 3, , 4]);
|
|
300
|
-
txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
|
|
301
300
|
initialDepositAmount = {
|
|
302
301
|
denom: this.config.denom,
|
|
303
302
|
amount: FirmaUtil_1.FirmaUtil.getUFCTStringFromFCT(initialDepositFCT)
|
|
@@ -314,11 +313,12 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
314
313
|
return [4 /*yield*/, wallet.getAddress()];
|
|
315
314
|
case 1:
|
|
316
315
|
proposer = _a.sent();
|
|
317
|
-
message =
|
|
316
|
+
message = gov_1.GovTxClient.msgSubmitProposal({
|
|
318
317
|
content: content,
|
|
319
318
|
initialDeposit: [initialDepositAmount],
|
|
320
319
|
proposer: proposer
|
|
321
320
|
});
|
|
321
|
+
txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
|
|
322
322
|
return [4 /*yield*/, txClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
323
323
|
case 2: return [2 /*return*/, _a.sent()];
|
|
324
324
|
case 3:
|
|
@@ -333,12 +333,11 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
333
333
|
FirmaGovService.prototype.getSignedTxSubmitParameterChangeProposal = function (wallet, title, description, initialDepositFCT, paramList, txMisc) {
|
|
334
334
|
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
335
335
|
return __awaiter(this, void 0, void 0, function () {
|
|
336
|
-
var
|
|
336
|
+
var initialDepositAmount, proposal, content, proposer, message, txClient, error_11;
|
|
337
337
|
return __generator(this, function (_a) {
|
|
338
338
|
switch (_a.label) {
|
|
339
339
|
case 0:
|
|
340
340
|
_a.trys.push([0, 3, , 4]);
|
|
341
|
-
txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
|
|
342
341
|
initialDepositAmount = {
|
|
343
342
|
denom: this.config.denom,
|
|
344
343
|
amount: FirmaUtil_1.FirmaUtil.getUFCTStringFromFCT(initialDepositFCT)
|
|
@@ -355,11 +354,12 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
355
354
|
return [4 /*yield*/, wallet.getAddress()];
|
|
356
355
|
case 1:
|
|
357
356
|
proposer = _a.sent();
|
|
358
|
-
message =
|
|
357
|
+
message = gov_1.GovTxClient.msgSubmitProposal({
|
|
359
358
|
content: content,
|
|
360
359
|
initialDeposit: [initialDepositAmount],
|
|
361
360
|
proposer: proposer
|
|
362
361
|
});
|
|
362
|
+
txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
|
|
363
363
|
return [4 /*yield*/, txClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
364
364
|
case 2: return [2 /*return*/, _a.sent()];
|
|
365
365
|
case 3:
|
|
@@ -374,12 +374,11 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
374
374
|
FirmaGovService.prototype.getSignedTxSubmitCommunityPoolSpendProposal = function (wallet, title, description, initialDepositFCT, amount, recipient, txMisc) {
|
|
375
375
|
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
376
376
|
return __awaiter(this, void 0, void 0, function () {
|
|
377
|
-
var
|
|
377
|
+
var initialDepositAmount, sendAmount, proposal, content, proposer, message, txClient, error_12;
|
|
378
378
|
return __generator(this, function (_a) {
|
|
379
379
|
switch (_a.label) {
|
|
380
380
|
case 0:
|
|
381
381
|
_a.trys.push([0, 3, , 4]);
|
|
382
|
-
txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
|
|
383
382
|
initialDepositAmount = {
|
|
384
383
|
denom: this.config.denom,
|
|
385
384
|
amount: FirmaUtil_1.FirmaUtil.getUFCTStringFromFCT(initialDepositFCT)
|
|
@@ -398,11 +397,12 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
398
397
|
return [4 /*yield*/, wallet.getAddress()];
|
|
399
398
|
case 1:
|
|
400
399
|
proposer = _a.sent();
|
|
401
|
-
message =
|
|
400
|
+
message = gov_1.GovTxClient.msgSubmitProposal({
|
|
402
401
|
content: content,
|
|
403
402
|
initialDeposit: [initialDepositAmount],
|
|
404
403
|
proposer: proposer
|
|
405
404
|
});
|
|
405
|
+
txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
|
|
406
406
|
return [4 /*yield*/, txClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
407
407
|
case 2: return [2 /*return*/, _a.sent()];
|
|
408
408
|
case 3:
|
|
@@ -579,7 +579,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
579
579
|
case 1:
|
|
580
580
|
voter = _a.sent();
|
|
581
581
|
txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
|
|
582
|
-
message =
|
|
582
|
+
message = gov_1.GovTxClient.msgVote({ proposalId: proposalId, voter: voter, option: option });
|
|
583
583
|
return [4 /*yield*/, txClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
584
584
|
case 2: return [2 /*return*/, _a.sent()];
|
|
585
585
|
case 3:
|
|
@@ -618,17 +618,17 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
618
618
|
FirmaGovService.prototype.getSignedTxDeposit = function (wallet, proposalId, amount, txMisc) {
|
|
619
619
|
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
620
620
|
return __awaiter(this, void 0, void 0, function () {
|
|
621
|
-
var
|
|
621
|
+
var depositor, sendAmount, message, txClient, error_21;
|
|
622
622
|
return __generator(this, function (_a) {
|
|
623
623
|
switch (_a.label) {
|
|
624
624
|
case 0:
|
|
625
625
|
_a.trys.push([0, 3, , 4]);
|
|
626
|
-
txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
|
|
627
626
|
return [4 /*yield*/, wallet.getAddress()];
|
|
628
627
|
case 1:
|
|
629
628
|
depositor = _a.sent();
|
|
630
629
|
sendAmount = { denom: this.config.denom, amount: FirmaUtil_1.FirmaUtil.getUFCTStringFromFCT(amount) };
|
|
631
|
-
message =
|
|
630
|
+
message = gov_1.GovTxClient.msgDeposit({ proposalId: proposalId, depositor: depositor, amount: [sendAmount] });
|
|
631
|
+
txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
|
|
632
632
|
return [4 /*yield*/, txClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
633
633
|
case 2: return [2 /*return*/, _a.sent()];
|
|
634
634
|
case 3:
|
|
@@ -94,18 +94,18 @@ var FirmaIbcService = /** @class */ (function () {
|
|
|
94
94
|
FirmaIbcService.prototype.getSignedTxTransfer = function (wallet, sourcePort, sourceChannel, denom, amount, receiver, timeoutHeight, timeoutTimestamp, txMisc) {
|
|
95
95
|
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
96
96
|
return __awaiter(this, void 0, void 0, function () {
|
|
97
|
-
var
|
|
97
|
+
var address, message, ibcTxClient, error_3;
|
|
98
98
|
return __generator(this, function (_a) {
|
|
99
99
|
switch (_a.label) {
|
|
100
100
|
case 0:
|
|
101
101
|
_a.trys.push([0, 3, , 4]);
|
|
102
|
-
ibcTxClient = new ibc_1.IbcTxClient(wallet, this.config.rpcAddress);
|
|
103
102
|
return [4 /*yield*/, wallet.getAddress()];
|
|
104
103
|
case 1:
|
|
105
104
|
address = _a.sent();
|
|
106
|
-
message =
|
|
105
|
+
message = ibc_1.IbcTxClient.msgTransfer({ sourcePort: sourcePort, sourceChannel: sourceChannel, sender: address, receiver: receiver,
|
|
107
106
|
token: { denom: denom, amount: amount },
|
|
108
107
|
timeoutHeight: timeoutHeight, timeoutTimestamp: timeoutTimestamp });
|
|
108
|
+
ibcTxClient = new ibc_1.IbcTxClient(wallet, this.config.rpcAddress);
|
|
109
109
|
return [4 /*yield*/, ibcTxClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
110
110
|
case 2: return [2 /*return*/, _a.sent()];
|
|
111
111
|
case 3:
|