@firmachain/firma-js 0.3.6-beta1 → 0.3.7-beta1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/sdk/FirmaGovService.js +44 -58
- package/dist/sdk/FirmaUtil.d.ts +1 -1
- package/dist/sdk/FirmaUtil.js +5 -5
- package/dist/sdk/firmachain/common/CommonTxClient.js +31 -24
- package/dist/sdk/firmachain/common/ITxClient.d.ts +1 -1
- package/dist/sdk/firmachain/common/ITxClient.js +5 -5
- package/dist/sdk/firmachain/common/{signingprotobufstargateclient.d.ts → SigningProtobufStargateClient.d.ts} +1 -1
- package/dist/sdk/firmachain/common/{signingprotobufstargateclient.js → SigningProtobufStargateClient.js} +2 -2
- package/dist/sdk/firmachain/common/{signingstargateclient.d.ts → SigningStargateClient.d.ts} +1 -1
- package/dist/sdk/firmachain/common/{signingstargateclient.js → SigningStargateClient.js} +2 -2
- package/dist/sdk/firmachain/common/TxCommon.d.ts +0 -14
- package/dist/sdk/firmachain/common/accounts.d.ts +4 -0
- package/dist/sdk/firmachain/common/events.d.ts +4 -0
- package/dist/sdk/firmachain/common/fee.js +5 -0
- package/dist/sdk/firmachain/gov/GovQueryClient.js +1 -1
- package/dist/sdk/firmachain/gov/GovTxClient.d.ts +37 -12
- package/dist/sdk/firmachain/gov/GovTxClient.js +31 -11
- package/dist/test/17.gov_query.test.js +4 -4
- package/dist/test/26.cosmwasm_query.test.js +1 -3
- package/dist/test/27.arbitrary_sign.test.js +4 -2
- package/dist/test/config_test.d.ts +9 -9
- package/dist/test/config_test.js +27 -43
- package/package.json +1 -1
- /package/dist/sdk/firmachain/common/{stargateClient.d.ts → StargateClient.d.ts} +0 -0
- /package/dist/sdk/firmachain/common/{stargateClient.js → StargateClient.js} +0 -0
|
@@ -327,7 +327,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
327
327
|
if (metadata === void 0) { metadata = ""; }
|
|
328
328
|
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
329
329
|
return __awaiter(this, void 0, void 0, function () {
|
|
330
|
-
var proposer, initialDeposit,
|
|
330
|
+
var proposer, initialDeposit, txClient, message, error_10;
|
|
331
331
|
return __generator(this, function (_a) {
|
|
332
332
|
switch (_a.label) {
|
|
333
333
|
case 0:
|
|
@@ -336,18 +336,16 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
336
336
|
case 1:
|
|
337
337
|
proposer = _a.sent();
|
|
338
338
|
initialDeposit = [{ amount: FirmaUtil_1.FirmaUtil.getUFCTStringFromFCT(initialDepositFCT), denom: this.config.denom }];
|
|
339
|
-
message = {
|
|
340
|
-
typeUrl: "/cosmos.gov.v1.MsgSubmitProposal",
|
|
341
|
-
value: tx_2.MsgSubmitProposal.fromPartial({
|
|
342
|
-
title: title,
|
|
343
|
-
summary: summary,
|
|
344
|
-
metadata: metadata,
|
|
345
|
-
messages: messages,
|
|
346
|
-
proposer: proposer,
|
|
347
|
-
initialDeposit: initialDeposit
|
|
348
|
-
})
|
|
349
|
-
};
|
|
350
339
|
txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
|
|
340
|
+
message = gov_1.GovTxClient.v1MsgSubmitProposal({
|
|
341
|
+
title: title,
|
|
342
|
+
summary: summary,
|
|
343
|
+
metadata: metadata,
|
|
344
|
+
messages: messages,
|
|
345
|
+
proposer: proposer,
|
|
346
|
+
initialDeposit: initialDeposit,
|
|
347
|
+
expedited: false
|
|
348
|
+
});
|
|
351
349
|
return [4 /*yield*/, txClient.sign([message], (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc))];
|
|
352
350
|
case 2: return [2 /*return*/, _a.sent()];
|
|
353
351
|
case 3:
|
|
@@ -363,7 +361,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
363
361
|
if (metadata === void 0) { metadata = ""; }
|
|
364
362
|
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
365
363
|
return __awaiter(this, void 0, void 0, function () {
|
|
366
|
-
var proposer, initialDeposit,
|
|
364
|
+
var proposer, initialDeposit, txClient, message, error_11;
|
|
367
365
|
return __generator(this, function (_a) {
|
|
368
366
|
switch (_a.label) {
|
|
369
367
|
case 0:
|
|
@@ -372,18 +370,16 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
372
370
|
case 1:
|
|
373
371
|
proposer = _a.sent();
|
|
374
372
|
initialDeposit = [{ amount: FirmaUtil_1.FirmaUtil.getUFCTStringFromFCT(initialDepositFCT), denom: this.config.denom }];
|
|
375
|
-
message = {
|
|
376
|
-
typeUrl: "/cosmos.gov.v1.MsgSubmitProposal",
|
|
377
|
-
value: tx_2.MsgSubmitProposal.fromPartial({
|
|
378
|
-
title: title,
|
|
379
|
-
summary: summary,
|
|
380
|
-
metadata: metadata,
|
|
381
|
-
messages: messages,
|
|
382
|
-
proposer: proposer,
|
|
383
|
-
initialDeposit: initialDeposit
|
|
384
|
-
})
|
|
385
|
-
};
|
|
386
373
|
txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
|
|
374
|
+
message = gov_1.GovTxClient.v1MsgSubmitProposal({
|
|
375
|
+
title: title,
|
|
376
|
+
summary: summary,
|
|
377
|
+
metadata: metadata,
|
|
378
|
+
messages: messages,
|
|
379
|
+
proposer: proposer,
|
|
380
|
+
initialDeposit: initialDeposit,
|
|
381
|
+
expedited: false
|
|
382
|
+
});
|
|
387
383
|
return [4 /*yield*/, txClient.sign([message], (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc))];
|
|
388
384
|
case 2: return [2 /*return*/, _a.sent()];
|
|
389
385
|
case 3:
|
|
@@ -399,7 +395,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
399
395
|
if (metadata === void 0) { metadata = ""; }
|
|
400
396
|
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
401
397
|
return __awaiter(this, void 0, void 0, function () {
|
|
402
|
-
var proposer, initialDeposit,
|
|
398
|
+
var proposer, initialDeposit, txClient, message, error_12;
|
|
403
399
|
return __generator(this, function (_a) {
|
|
404
400
|
switch (_a.label) {
|
|
405
401
|
case 0:
|
|
@@ -408,18 +404,16 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
408
404
|
case 1:
|
|
409
405
|
proposer = _a.sent();
|
|
410
406
|
initialDeposit = [{ amount: FirmaUtil_1.FirmaUtil.getUFCTStringFromFCT(initialDepositFCT), denom: this.config.denom }];
|
|
411
|
-
message = {
|
|
412
|
-
typeUrl: "/cosmos.gov.v1.MsgSubmitProposal",
|
|
413
|
-
value: tx_2.MsgSubmitProposal.fromPartial({
|
|
414
|
-
title: title,
|
|
415
|
-
summary: summary,
|
|
416
|
-
metadata: metadata,
|
|
417
|
-
messages: messages,
|
|
418
|
-
proposer: proposer,
|
|
419
|
-
initialDeposit: initialDeposit
|
|
420
|
-
})
|
|
421
|
-
};
|
|
422
407
|
txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
|
|
408
|
+
message = gov_1.GovTxClient.v1MsgSubmitProposal({
|
|
409
|
+
title: title,
|
|
410
|
+
summary: summary,
|
|
411
|
+
metadata: metadata,
|
|
412
|
+
messages: messages,
|
|
413
|
+
proposer: proposer,
|
|
414
|
+
initialDeposit: initialDeposit,
|
|
415
|
+
expedited: false
|
|
416
|
+
});
|
|
423
417
|
return [4 /*yield*/, txClient.sign([message], (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc))];
|
|
424
418
|
case 2: return [2 /*return*/, _a.sent()];
|
|
425
419
|
case 3:
|
|
@@ -435,7 +429,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
435
429
|
if (metadata === void 0) { metadata = ""; }
|
|
436
430
|
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
437
431
|
return __awaiter(this, void 0, void 0, function () {
|
|
438
|
-
var proposer, initialDeposit,
|
|
432
|
+
var proposer, initialDeposit, txClient, message, error_13;
|
|
439
433
|
return __generator(this, function (_a) {
|
|
440
434
|
switch (_a.label) {
|
|
441
435
|
case 0:
|
|
@@ -444,18 +438,16 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
444
438
|
case 1:
|
|
445
439
|
proposer = _a.sent();
|
|
446
440
|
initialDeposit = [{ amount: FirmaUtil_1.FirmaUtil.getUFCTStringFromFCT(initialDepositFCT), denom: this.config.denom }];
|
|
447
|
-
message = {
|
|
448
|
-
typeUrl: "/cosmos.gov.v1.MsgSubmitProposal",
|
|
449
|
-
value: tx_2.MsgSubmitProposal.fromPartial({
|
|
450
|
-
title: title,
|
|
451
|
-
summary: summary,
|
|
452
|
-
metadata: metadata,
|
|
453
|
-
messages: messages,
|
|
454
|
-
proposer: proposer,
|
|
455
|
-
initialDeposit: initialDeposit,
|
|
456
|
-
})
|
|
457
|
-
};
|
|
458
441
|
txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
|
|
442
|
+
message = gov_1.GovTxClient.v1MsgSubmitProposal({
|
|
443
|
+
title: title,
|
|
444
|
+
summary: summary,
|
|
445
|
+
metadata: metadata,
|
|
446
|
+
messages: messages,
|
|
447
|
+
proposer: proposer,
|
|
448
|
+
initialDeposit: initialDeposit,
|
|
449
|
+
expedited: false
|
|
450
|
+
});
|
|
459
451
|
return [4 /*yield*/, txClient.sign([message], (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc))];
|
|
460
452
|
case 2: return [2 /*return*/, _a.sent()];
|
|
461
453
|
case 3:
|
|
@@ -470,20 +462,14 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
470
462
|
FirmaGovService.prototype.getSignedTxCancelProposal = function (wallet, proposalId, txMisc) {
|
|
471
463
|
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
472
464
|
return __awaiter(this, void 0, void 0, function () {
|
|
473
|
-
var proposer,
|
|
465
|
+
var proposer, txClient, message;
|
|
474
466
|
return __generator(this, function (_a) {
|
|
475
467
|
switch (_a.label) {
|
|
476
468
|
case 0: return [4 /*yield*/, wallet.getAddress()];
|
|
477
469
|
case 1:
|
|
478
470
|
proposer = _a.sent();
|
|
479
|
-
message = {
|
|
480
|
-
typeUrl: "/cosmos.gov.v1.MsgCancelProposal",
|
|
481
|
-
value: tx_2.MsgCancelProposal.fromPartial({
|
|
482
|
-
proposalId: BigInt(proposalId),
|
|
483
|
-
proposer: proposer
|
|
484
|
-
})
|
|
485
|
-
};
|
|
486
471
|
txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
|
|
472
|
+
message = gov_1.GovTxClient.v1MsgCancelProposal({ proposalId: BigInt(proposalId), proposer: proposer });
|
|
487
473
|
return [4 /*yield*/, txClient.sign([message], (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc))];
|
|
488
474
|
case 2: return [2 /*return*/, _a.sent()];
|
|
489
475
|
}
|
|
@@ -736,7 +722,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
736
722
|
case 1:
|
|
737
723
|
voter = _a.sent();
|
|
738
724
|
txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
|
|
739
|
-
message = gov_1.GovTxClient.
|
|
725
|
+
message = gov_1.GovTxClient.v1MsgVote({ proposalId: proposalId, voter: voter, option: option, metadata: "" });
|
|
740
726
|
return [4 /*yield*/, txClient.sign([message], (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc))];
|
|
741
727
|
case 2: return [2 /*return*/, _a.sent()];
|
|
742
728
|
case 3:
|
|
@@ -784,7 +770,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
784
770
|
case 1:
|
|
785
771
|
depositor = _a.sent();
|
|
786
772
|
sendAmount = { denom: this.config.denom, amount: FirmaUtil_1.FirmaUtil.getUFCTStringFromFCT(amount) };
|
|
787
|
-
message = gov_1.GovTxClient.
|
|
773
|
+
message = gov_1.GovTxClient.v1MsgDeposit({ proposalId: proposalId, depositor: depositor, amount: [sendAmount] });
|
|
788
774
|
txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
|
|
789
775
|
return [4 /*yield*/, txClient.sign([message], (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc))];
|
|
790
776
|
case 2: return [2 /*return*/, _a.sent()];
|
package/dist/sdk/FirmaUtil.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { FirmaConfig } from "./FirmaConfig";
|
|
|
6
6
|
import { FirmaWalletService } from "./FirmaWalletService";
|
|
7
7
|
import { Any } from "cosmjs-types/google/protobuf/any";
|
|
8
8
|
import { CommonTxClient } from "./firmachain/common/CommonTxClient";
|
|
9
|
-
import { ArbitraryVerifyData } from "./firmachain/common/
|
|
9
|
+
import { ArbitraryVerifyData } from "./firmachain/common/SigningProtobufStargateClient";
|
|
10
10
|
export declare class FirmaUtil {
|
|
11
11
|
static config: FirmaConfig;
|
|
12
12
|
static readonly FctDecimal: number;
|
package/dist/sdk/FirmaUtil.js
CHANGED
|
@@ -88,9 +88,9 @@ var CommonTxClient_1 = require("./firmachain/common/CommonTxClient");
|
|
|
88
88
|
var TendermintQueryClient_1 = require("./firmachain/common/TendermintQueryClient");
|
|
89
89
|
var bignumber_js_1 = require("bignumber.js");
|
|
90
90
|
var tendermint_rpc_1 = require("@cosmjs/tendermint-rpc");
|
|
91
|
-
var signingprotobufstargateclient_1 = require("./firmachain/common/signingprotobufstargateclient");
|
|
92
|
-
var signingstargateclient_1 = require("./firmachain/common/signingstargateclient");
|
|
93
91
|
var coin_1 = require("cosmjs-types/cosmos/base/v1beta1/coin");
|
|
92
|
+
var SigningStargateClient_1 = require("./firmachain/common/SigningStargateClient");
|
|
93
|
+
var SigningProtobufStargateClient_1 = require("./firmachain/common/SigningProtobufStargateClient");
|
|
94
94
|
var CryptoJS = require("crypto-js");
|
|
95
95
|
var sha1 = require("crypto-js/sha1");
|
|
96
96
|
var sha256 = require("crypto-js/sha256");
|
|
@@ -337,7 +337,7 @@ var FirmaUtil = /** @class */ (function () {
|
|
|
337
337
|
switch (_a.label) {
|
|
338
338
|
case 0:
|
|
339
339
|
_a.trys.push([0, 4, , 5]);
|
|
340
|
-
return [4 /*yield*/,
|
|
340
|
+
return [4 /*yield*/, SigningProtobufStargateClient_1.SigningProtobufStargateClient.connectWithSigner(FirmaUtil.config.rpcAddress, wallet.getRawWallet(), {})];
|
|
341
341
|
case 1:
|
|
342
342
|
client = _a.sent();
|
|
343
343
|
return [4 /*yield*/, wallet.getAddress()];
|
|
@@ -369,7 +369,7 @@ var FirmaUtil = /** @class */ (function () {
|
|
|
369
369
|
switch (_a.label) {
|
|
370
370
|
case 0:
|
|
371
371
|
_a.trys.push([0, 2, , 3]);
|
|
372
|
-
return [4 /*yield*/,
|
|
372
|
+
return [4 /*yield*/, SigningProtobufStargateClient_1.SigningProtobufStargateClient.experimentalAdr36Verify(data, checkMsg)];
|
|
373
373
|
case 1: return [2 /*return*/, _a.sent()];
|
|
374
374
|
case 2:
|
|
375
375
|
error_5 = _a.sent();
|
|
@@ -397,7 +397,7 @@ var FirmaUtil = /** @class */ (function () {
|
|
|
397
397
|
granter: result.fee.granter || "",
|
|
398
398
|
payer: ""
|
|
399
399
|
};
|
|
400
|
-
return [4 /*yield*/,
|
|
400
|
+
return [4 /*yield*/, SigningStargateClient_1.SigningStargateClient.makeSignDocForSend(signerAddress, pubkey, messages, fee, result.memo, serverUrl, chainID, registry)];
|
|
401
401
|
case 1: return [2 /*return*/, _a.sent()];
|
|
402
402
|
}
|
|
403
403
|
});
|
|
@@ -18,12 +18,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
18
18
|
exports.CommonTxClient = void 0;
|
|
19
19
|
var proto_signing_1 = require("@cosmjs/proto-signing");
|
|
20
20
|
var tx_1 = require("cosmjs-types/cosmos/bank/v1beta1/tx");
|
|
21
|
-
var tx_2 = require("cosmjs-types/cosmos/
|
|
22
|
-
var tx_3 = require("cosmjs-types/cosmos/
|
|
23
|
-
var tx_4 = require("cosmjs-types/cosmos/
|
|
24
|
-
var tx_5 = require("cosmjs-types/
|
|
21
|
+
var tx_2 = require("cosmjs-types/cosmos/gov/v1/tx");
|
|
22
|
+
var tx_3 = require("cosmjs-types/cosmos/distribution/v1beta1/tx");
|
|
23
|
+
var tx_4 = require("cosmjs-types/cosmos/gov/v1beta1/tx");
|
|
24
|
+
var tx_5 = require("cosmjs-types/cosmos/staking/v1beta1/tx");
|
|
25
|
+
var tx_6 = require("cosmjs-types/cosmwasm/wasm/v1/tx");
|
|
25
26
|
// temporarly using kintsugi-tech/cosmjs-types - this will be returned to original cosmjs-types after the PR is merged
|
|
26
|
-
var
|
|
27
|
+
var tx_7 = require("@kintsugi-tech/cosmjs-types/cosmos/gov/v1/tx");
|
|
27
28
|
var AuthzTxTypes_1 = require("../authz/AuthzTxTypes");
|
|
28
29
|
var ContractTxTypes_1 = require("../contract/ContractTxTypes");
|
|
29
30
|
var FeeGrantTxTypes_1 = require("../feegrant/FeeGrantTxTypes");
|
|
@@ -38,31 +39,37 @@ var types = [
|
|
|
38
39
|
["/cosmos.bank.v1beta1.MsgMultiSend", tx_1.MsgMultiSend],
|
|
39
40
|
["/firmachain.contract.MsgCreateContractFile", ContractTxTypes_1.MsgCreateContractFile],
|
|
40
41
|
["/firmachain.contract.MsgAddContractLog", ContractTxTypes_1.MsgAddContractLog],
|
|
41
|
-
["/cosmwasm.wasm.v1.MsgStoreCode",
|
|
42
|
-
["/cosmwasm.wasm.v1.MsgInstantiateContract",
|
|
43
|
-
["/cosmwasm.wasm.v1.MsgExecuteContract",
|
|
44
|
-
["/cosmwasm.wasm.v1.MsgUpdateAdmin",
|
|
45
|
-
["/cosmwasm.wasm.v1.MsgClearAdmin",
|
|
46
|
-
["/cosmwasm.wasm.v1.MsgMigrateContract",
|
|
47
|
-
["/cosmos.distribution.v1beta1.MsgFundCommunityPool",
|
|
48
|
-
["/cosmos.distribution.v1beta1.MsgSetWithdrawAddress",
|
|
49
|
-
["/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward",
|
|
50
|
-
["/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission",
|
|
42
|
+
["/cosmwasm.wasm.v1.MsgStoreCode", tx_6.MsgStoreCode],
|
|
43
|
+
["/cosmwasm.wasm.v1.MsgInstantiateContract", tx_6.MsgInstantiateContract],
|
|
44
|
+
["/cosmwasm.wasm.v1.MsgExecuteContract", tx_6.MsgExecuteContract],
|
|
45
|
+
["/cosmwasm.wasm.v1.MsgUpdateAdmin", tx_6.MsgUpdateAdmin],
|
|
46
|
+
["/cosmwasm.wasm.v1.MsgClearAdmin", tx_6.MsgClearAdmin],
|
|
47
|
+
["/cosmwasm.wasm.v1.MsgMigrateContract", tx_6.MsgMigrateContract],
|
|
48
|
+
["/cosmos.distribution.v1beta1.MsgFundCommunityPool", tx_3.MsgFundCommunityPool],
|
|
49
|
+
["/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", tx_3.MsgSetWithdrawAddress],
|
|
50
|
+
["/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", tx_3.MsgWithdrawDelegatorReward],
|
|
51
|
+
["/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", tx_3.MsgWithdrawValidatorCommission],
|
|
51
52
|
["/cosmos.feegrant.v1beta1.MsgGrantAllowance", FeeGrantTxTypes_1.MsgGrantAllowance],
|
|
52
53
|
["/cosmos.feegrant.v1beta1.MsgRevokeAllowance", FeeGrantTxTypes_1.MsgRevokeAllowance],
|
|
53
|
-
["/cosmos.gov.
|
|
54
|
-
["/cosmos.gov.
|
|
55
|
-
["/cosmos.gov.
|
|
56
|
-
["/cosmos.gov.v1.
|
|
54
|
+
["/cosmos.gov.v1.MsgDeposit", tx_2.MsgDeposit],
|
|
55
|
+
["/cosmos.gov.v1.MsgSubmitProposal", tx_2.MsgSubmitProposal],
|
|
56
|
+
["/cosmos.gov.v1.MsgUpdateParams", tx_2.MsgUpdateParams],
|
|
57
|
+
["/cosmos.gov.v1.MsgVote", tx_2.MsgVote],
|
|
58
|
+
["/cosmos.gov.v1.MsgVoteWeighted", tx_2.MsgVoteWeighted],
|
|
59
|
+
["/cosmos.gov.v1.MsgCancelProposal", tx_7.MsgCancelProposal],
|
|
60
|
+
["/cosmos.gov.v1beta1.MsgDeposit", tx_4.MsgDeposit],
|
|
61
|
+
["/cosmos.gov.v1beta1.MsgSubmitProposal", tx_4.MsgSubmitProposal],
|
|
62
|
+
["/cosmos.gov.v1beta1.MsgVote", tx_4.MsgVote],
|
|
63
|
+
["/cosmos.gov.v1beta1.MsgVoteWeighted", tx_4.MsgVoteWeighted],
|
|
57
64
|
["/ibc.applications.transfer.v1.MsgTransfer", NftTxTypes_1.MsgTransfer],
|
|
58
65
|
["/firmachain.nft.MsgTransfer", NftTxTypes_1.MsgTransfer],
|
|
59
66
|
["/firmachain.nft.MsgMint", NftTxTypes_1.MsgMint],
|
|
60
67
|
["/firmachain.nft.MsgBurn", NftTxTypes_1.MsgBurn],
|
|
61
|
-
["/cosmos.staking.v1beta1.MsgDelegate",
|
|
62
|
-
["/cosmos.staking.v1beta1.MsgUndelegate",
|
|
63
|
-
["/cosmos.staking.v1beta1.MsgBeginRedelegate",
|
|
64
|
-
["/cosmos.staking.v1beta1.MsgEditValidator",
|
|
65
|
-
["/cosmos.staking.v1beta1.MsgCreateValidator",
|
|
68
|
+
["/cosmos.staking.v1beta1.MsgDelegate", tx_5.MsgDelegate],
|
|
69
|
+
["/cosmos.staking.v1beta1.MsgUndelegate", tx_5.MsgUndelegate],
|
|
70
|
+
["/cosmos.staking.v1beta1.MsgBeginRedelegate", tx_5.MsgBeginRedelegate],
|
|
71
|
+
["/cosmos.staking.v1beta1.MsgEditValidator", tx_5.MsgEditValidator],
|
|
72
|
+
["/cosmos.staking.v1beta1.MsgCreateValidator", tx_5.MsgCreateValidator],
|
|
66
73
|
["/firmachain.token.MsgCreateToken", TokenTxTypes_1.MsgCreateToken],
|
|
67
74
|
["/firmachain.token.MsgUpdateTokenURI", TokenTxTypes_1.MsgUpdateTokenURI],
|
|
68
75
|
["/firmachain.token.MsgMint", NftTxTypes_1.MsgMint],
|
|
@@ -3,7 +3,7 @@ import { SignAndBroadcastOptions } from ".";
|
|
|
3
3
|
import { SignDoc, TxRaw } from "cosmjs-types/cosmos/tx/v1beta1/tx";
|
|
4
4
|
import { FirmaWalletService } from "../../FirmaWalletService";
|
|
5
5
|
import { DeliverTxResponse } from "@cosmjs/stargate";
|
|
6
|
-
import { TxRawExt } from "./
|
|
6
|
+
import { TxRawExt } from "./SigningStargateClient";
|
|
7
7
|
export declare class ITxClient {
|
|
8
8
|
private readonly wallet;
|
|
9
9
|
private readonly serverUrl;
|
|
@@ -38,7 +38,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.ITxClient = void 0;
|
|
40
40
|
var tx_1 = require("cosmjs-types/cosmos/tx/v1beta1/tx");
|
|
41
|
-
var
|
|
41
|
+
var SigningStargateClient_1 = require("./SigningStargateClient");
|
|
42
42
|
var ITxClient = /** @class */ (function () {
|
|
43
43
|
function ITxClient(wallet, serverUrl, registry) {
|
|
44
44
|
this.wallet = wallet;
|
|
@@ -56,7 +56,7 @@ var ITxClient = /** @class */ (function () {
|
|
|
56
56
|
case 0:
|
|
57
57
|
if (!this.wallet.isLedger()) return [3 /*break*/, 1];
|
|
58
58
|
return [2 /*return*/, this.wallet.signLedger(msgs, { fee: fee, memo: memo }, this.registry)];
|
|
59
|
-
case 1: return [4 /*yield*/,
|
|
59
|
+
case 1: return [4 /*yield*/, SigningStargateClient_1.SigningStargateClient.connectWithSigner(this.serverUrl, this.rawWallet, { registry: this.registry })];
|
|
60
60
|
case 2:
|
|
61
61
|
client = _b.sent();
|
|
62
62
|
return [4 /*yield*/, this.rawWallet.getAccounts()];
|
|
@@ -73,7 +73,7 @@ var ITxClient = /** @class */ (function () {
|
|
|
73
73
|
var client, txBytes;
|
|
74
74
|
return __generator(this, function (_a) {
|
|
75
75
|
switch (_a.label) {
|
|
76
|
-
case 0: return [4 /*yield*/,
|
|
76
|
+
case 0: return [4 /*yield*/, SigningStargateClient_1.SigningStargateClient.connectWithSigner(this.serverUrl, this.rawWallet, { registry: this.registry })];
|
|
77
77
|
case 1:
|
|
78
78
|
client = _a.sent();
|
|
79
79
|
txBytes = tx_1.TxRaw.encode(txRaw).finish();
|
|
@@ -88,7 +88,7 @@ var ITxClient = /** @class */ (function () {
|
|
|
88
88
|
var client;
|
|
89
89
|
return __generator(this, function (_a) {
|
|
90
90
|
switch (_a.label) {
|
|
91
|
-
case 0: return [4 /*yield*/,
|
|
91
|
+
case 0: return [4 /*yield*/, SigningStargateClient_1.SigningStargateClient.connectWithSigner(this.serverUrl, this.rawWallet, { registry: this.registry })];
|
|
92
92
|
case 1:
|
|
93
93
|
client = _a.sent();
|
|
94
94
|
return [4 /*yield*/, client.broadcastTx(txBytes)];
|
|
@@ -117,7 +117,7 @@ var ITxClient = /** @class */ (function () {
|
|
|
117
117
|
var client;
|
|
118
118
|
return __generator(this, function (_a) {
|
|
119
119
|
switch (_a.label) {
|
|
120
|
-
case 0: return [4 /*yield*/,
|
|
120
|
+
case 0: return [4 /*yield*/, SigningStargateClient_1.SigningStargateClient.connectWithSigner(this.serverUrl, this.rawWallet, { registry: this.registry })];
|
|
121
121
|
case 1:
|
|
122
122
|
client = _a.sent();
|
|
123
123
|
return [4 /*yield*/, client.signDirectForSignDoc(signerAddress, signDoc)];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { OfflineDirectSigner } from "@cosmjs/proto-signing";
|
|
2
2
|
import { Comet38Client } from "@cosmjs/tendermint-rpc";
|
|
3
3
|
import { Account } from "./accounts";
|
|
4
|
-
import { StargateClient, StargateClientOptions } from "./
|
|
4
|
+
import { StargateClient, StargateClientOptions } from "./StargateClient";
|
|
5
5
|
export interface SignerData {
|
|
6
6
|
readonly accountNumber: number;
|
|
7
7
|
readonly sequence: number;
|
|
@@ -92,7 +92,7 @@ var signing_1 = require("cosmjs-types/cosmos/tx/signing/v1beta1/signing");
|
|
|
92
92
|
var keys_1 = require("cosmjs-types/cosmos/crypto/secp256k1/keys");
|
|
93
93
|
var accounts_1 = require("./accounts");
|
|
94
94
|
var axios_1 = __importDefault(require("axios"));
|
|
95
|
-
var
|
|
95
|
+
var StargateClient_1 = require("./StargateClient");
|
|
96
96
|
var SigningProtobufStargateClient = /** @class */ (function (_super) {
|
|
97
97
|
__extends(SigningProtobufStargateClient, _super);
|
|
98
98
|
function SigningProtobufStargateClient(cometClient, options, signer, endpoint) {
|
|
@@ -315,5 +315,5 @@ var SigningProtobufStargateClient = /** @class */ (function (_super) {
|
|
|
315
315
|
});
|
|
316
316
|
};
|
|
317
317
|
return SigningProtobufStargateClient;
|
|
318
|
-
}(
|
|
318
|
+
}(StargateClient_1.StargateClient));
|
|
319
319
|
exports.SigningProtobufStargateClient = SigningProtobufStargateClient;
|
package/dist/sdk/firmachain/common/{signingstargateclient.d.ts → SigningStargateClient.d.ts}
RENAMED
|
@@ -2,7 +2,7 @@ import { EncodeObject, OfflineDirectSigner, Registry, GeneratedType } from "@cos
|
|
|
2
2
|
import { CometClient, HttpEndpoint } from "@cosmjs/tendermint-rpc";
|
|
3
3
|
import { SignDoc, TxRaw, Fee } from "cosmjs-types/cosmos/tx/v1beta1/tx";
|
|
4
4
|
import { Account } from "./accounts";
|
|
5
|
-
import { DeliverTxResponse, StargateClient, StargateClientOptions } from "./
|
|
5
|
+
import { DeliverTxResponse, StargateClient, StargateClientOptions } from "./StargateClient";
|
|
6
6
|
export declare const defaultRegistryTypes: ReadonlyArray<[string, GeneratedType]>;
|
|
7
7
|
export interface SignerData {
|
|
8
8
|
readonly accountNumber: number;
|
|
@@ -88,7 +88,7 @@ var tx_1 = require("cosmjs-types/cosmos/tx/v1beta1/tx");
|
|
|
88
88
|
var keys_1 = require("cosmjs-types/cosmos/crypto/secp256k1/keys");
|
|
89
89
|
var axios_1 = __importDefault(require("axios"));
|
|
90
90
|
var accounts_1 = require("./accounts");
|
|
91
|
-
var
|
|
91
|
+
var StargateClient_1 = require("./StargateClient");
|
|
92
92
|
var any_1 = require("cosmjs-types/google/protobuf/any");
|
|
93
93
|
var modules_1 = require("@cosmjs/stargate/build/modules");
|
|
94
94
|
var signing_1 = require("./signing");
|
|
@@ -318,5 +318,5 @@ var SigningStargateClient = /** @class */ (function (_super) {
|
|
|
318
318
|
};
|
|
319
319
|
SigningStargateClient._endpoint = "";
|
|
320
320
|
return SigningStargateClient;
|
|
321
|
-
}(
|
|
321
|
+
}(StargateClient_1.StargateClient));
|
|
322
322
|
exports.SigningStargateClient = SigningStargateClient;
|
|
@@ -54,17 +54,3 @@ export declare enum VotingOption {
|
|
|
54
54
|
VOTE_OPTION_NO_WITH_VETO = 4,
|
|
55
55
|
UNRECOGNIZED = -1
|
|
56
56
|
}
|
|
57
|
-
export interface ArbitraryVerifyData {
|
|
58
|
-
chainId: string;
|
|
59
|
-
accountNumber: string;
|
|
60
|
-
sequence: string;
|
|
61
|
-
bodyBytes: string;
|
|
62
|
-
authInfoBytes: string;
|
|
63
|
-
signerAddress: string;
|
|
64
|
-
pubkey: string;
|
|
65
|
-
signature: string;
|
|
66
|
-
}
|
|
67
|
-
export interface MsgSignArbitraryData {
|
|
68
|
-
signer: string;
|
|
69
|
-
data: Uint8Array;
|
|
70
|
-
}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { Pubkey } from "@cosmjs/amino";
|
|
2
2
|
import { Any } from "cosmjs-types/google/protobuf/any";
|
|
3
|
+
/**
|
|
4
|
+
* This file is copied from @cosmjs/stargate.
|
|
5
|
+
* https://github.com/cosmos/cosmjs/blob/v0.34.0/packages/stargate/src/accounts.ts
|
|
6
|
+
*/
|
|
3
7
|
export interface Account {
|
|
4
8
|
/** Bech32 account address */
|
|
5
9
|
readonly address: string;
|
|
@@ -19,6 +19,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
19
19
|
exports.calculateFee = exports.GasPrice = void 0;
|
|
20
20
|
var math_1 = require("@cosmjs/math");
|
|
21
21
|
var proto_signing_1 = require("@cosmjs/proto-signing");
|
|
22
|
+
/**
|
|
23
|
+
* This file is copied from @cosmjs/stargate.
|
|
24
|
+
* https://github.com/cosmos/cosmjs/blob/v0.34.0/packages/stargate/src/fee.ts
|
|
25
|
+
* For future support of next version of cosmos and cosmjs. Not used in this project and firmachain ecosystem for now.
|
|
26
|
+
*/
|
|
22
27
|
/**
|
|
23
28
|
* Denom checker for the Cosmos SDK 0.42 denom pattern
|
|
24
29
|
* (https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/types/coin.go#L599-L601).
|
|
@@ -77,7 +77,7 @@ var GovQueryClient = /** @class */ (function () {
|
|
|
77
77
|
return __generator(this, function (_a) {
|
|
78
78
|
switch (_a.label) {
|
|
79
79
|
case 0:
|
|
80
|
-
path = "/cosmos/gov/
|
|
80
|
+
path = "/cosmos/gov/v1/proposals/".concat(id, "/tally");
|
|
81
81
|
return [4 /*yield*/, this.axios.get(path)];
|
|
82
82
|
case 1:
|
|
83
83
|
result = _a.sent();
|
|
@@ -1,9 +1,33 @@
|
|
|
1
1
|
import { Registry, EncodeObject } from "@cosmjs/proto-signing";
|
|
2
|
-
import { MsgDeposit, MsgSubmitProposal, MsgVote } from "cosmjs-types/cosmos/gov/
|
|
3
|
-
import { MsgSubmitProposal
|
|
4
|
-
import { MsgCancelProposal } from "@kintsugi-tech/cosmjs-types/cosmos/gov/v1/tx";
|
|
2
|
+
import { MsgDeposit as V1MsgDeposit, MsgSubmitProposal as V1MsgSubmitProposal, MsgUpdateParams as V1MsgUpdateParams, MsgVote as V1MsgVote, MsgVoteWeighted as V1MsgVoteWeighted } from "@kintsugi-tech/cosmjs-types/cosmos/gov/v1/tx";
|
|
3
|
+
import { MsgDeposit, MsgSubmitProposal, MsgVote, MsgVoteWeighted } from "@kintsugi-tech/cosmjs-types/cosmos/gov/v1beta1/tx";
|
|
4
|
+
import { MsgCancelProposal as V1MsgCancelProposal } from "@kintsugi-tech/cosmjs-types/cosmos/gov/v1/tx";
|
|
5
5
|
import { FirmaWalletService } from "../../FirmaWalletService";
|
|
6
6
|
import { ITxClient } from "../common/ITxClient";
|
|
7
|
+
export interface V1MsgDepositEncodeObject extends EncodeObject {
|
|
8
|
+
readonly typeUrl: "/cosmos.gov.v1.MsgDeposit";
|
|
9
|
+
readonly value: Partial<V1MsgDeposit>;
|
|
10
|
+
}
|
|
11
|
+
export interface V1MsgSubmitProposalEncodeObject extends EncodeObject {
|
|
12
|
+
readonly typeUrl: "/cosmos.gov.v1.MsgSubmitProposal";
|
|
13
|
+
readonly value: Partial<V1MsgSubmitProposal>;
|
|
14
|
+
}
|
|
15
|
+
export interface V1MsgUpdateParamsEncodeObject extends EncodeObject {
|
|
16
|
+
readonly typeUrl: "/cosmos.gov.v1.MsgUpdateParams";
|
|
17
|
+
readonly value: Partial<V1MsgUpdateParams>;
|
|
18
|
+
}
|
|
19
|
+
export interface V1MsgVoteWeightedEncodeObject extends EncodeObject {
|
|
20
|
+
readonly typeUrl: "/cosmos.gov.v1.MsgVoteWeighted";
|
|
21
|
+
readonly value: Partial<V1MsgVoteWeighted>;
|
|
22
|
+
}
|
|
23
|
+
export interface V1MsgCancelProposalEncodeObject extends EncodeObject {
|
|
24
|
+
readonly typeUrl: "/cosmos.gov.v1.MsgCancelProposal";
|
|
25
|
+
readonly value: Partial<V1MsgCancelProposal>;
|
|
26
|
+
}
|
|
27
|
+
export interface V1MsgVoteEncodeObject extends EncodeObject {
|
|
28
|
+
readonly typeUrl: "/cosmos.gov.v1.MsgVote";
|
|
29
|
+
readonly value: Partial<V1MsgVote>;
|
|
30
|
+
}
|
|
7
31
|
export interface MsgDepositEncodeObject extends EncodeObject {
|
|
8
32
|
readonly typeUrl: "/cosmos.gov.v1beta1.MsgDeposit";
|
|
9
33
|
readonly value: Partial<MsgDeposit>;
|
|
@@ -12,24 +36,25 @@ export interface MsgSubmitProposalEncodeObject extends EncodeObject {
|
|
|
12
36
|
readonly typeUrl: "/cosmos.gov.v1beta1.MsgSubmitProposal";
|
|
13
37
|
readonly value: Partial<MsgSubmitProposal>;
|
|
14
38
|
}
|
|
15
|
-
export interface MsgSubmitGenericProposalEncodeObject extends EncodeObject {
|
|
16
|
-
readonly typeUrl: "/cosmos.gov.v1.MsgSubmitProposal";
|
|
17
|
-
readonly value: Partial<MsgSubmitGenericProposal>;
|
|
18
|
-
}
|
|
19
39
|
export interface MsgVoteEncodeObject extends EncodeObject {
|
|
20
40
|
readonly typeUrl: "/cosmos.gov.v1beta1.MsgVote";
|
|
21
41
|
readonly value: Partial<MsgVote>;
|
|
22
42
|
}
|
|
23
|
-
export interface
|
|
24
|
-
readonly typeUrl: "/cosmos.gov.
|
|
25
|
-
readonly value: Partial<
|
|
43
|
+
export interface MsgVoteWeightedEncodeObject extends EncodeObject {
|
|
44
|
+
readonly typeUrl: "/cosmos.gov.v1beta1.MsgVoteWeighted";
|
|
45
|
+
readonly value: Partial<MsgVoteWeighted>;
|
|
26
46
|
}
|
|
27
47
|
export declare class GovTxClient extends ITxClient {
|
|
28
48
|
constructor(wallet: FirmaWalletService, serverUrl: string);
|
|
29
49
|
static getRegistry(): Registry;
|
|
50
|
+
static v1MsgDeposit(data: V1MsgDeposit): V1MsgDepositEncodeObject;
|
|
51
|
+
static v1MsgSubmitProposal(data: V1MsgSubmitProposal): V1MsgSubmitProposalEncodeObject;
|
|
52
|
+
static v1MsgUpdateParams(data: V1MsgUpdateParams): V1MsgUpdateParamsEncodeObject;
|
|
53
|
+
static v1MsgVote(data: V1MsgVote): V1MsgVoteEncodeObject;
|
|
54
|
+
static v1MsgVoteWeighted(data: V1MsgVoteWeighted): V1MsgVoteWeightedEncodeObject;
|
|
55
|
+
static v1MsgCancelProposal(data: V1MsgCancelProposal): V1MsgCancelProposalEncodeObject;
|
|
30
56
|
static msgDeposit(data: MsgDeposit): MsgDepositEncodeObject;
|
|
31
57
|
static msgSubmitProposal(data: MsgSubmitProposal): MsgSubmitProposalEncodeObject;
|
|
32
|
-
static msgSubmitGenericProposal(data: MsgSubmitGenericProposal): MsgSubmitGenericProposalEncodeObject;
|
|
33
58
|
static msgVote(data: MsgVote): MsgVoteEncodeObject;
|
|
34
|
-
static
|
|
59
|
+
static msgVoteWeighted(data: MsgVoteWeighted): MsgVoteWeightedEncodeObject;
|
|
35
60
|
}
|
|
@@ -17,17 +17,22 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.GovTxClient = void 0;
|
|
19
19
|
var proto_signing_1 = require("@cosmjs/proto-signing");
|
|
20
|
-
var tx_1 = require("cosmjs-types/cosmos/gov/
|
|
21
|
-
var tx_2 = require("cosmjs-types/cosmos/gov/
|
|
20
|
+
var tx_1 = require("@kintsugi-tech/cosmjs-types/cosmos/gov/v1/tx");
|
|
21
|
+
var tx_2 = require("@kintsugi-tech/cosmjs-types/cosmos/gov/v1beta1/tx");
|
|
22
22
|
// temporarly using kintsugi-tech/cosmjs-types - this will be returned to original cosmjs-types after the PR is merged
|
|
23
23
|
var tx_3 = require("@kintsugi-tech/cosmjs-types/cosmos/gov/v1/tx");
|
|
24
24
|
var ITxClient_1 = require("../common/ITxClient");
|
|
25
25
|
var types = [
|
|
26
|
-
["/cosmos.gov.
|
|
27
|
-
["/cosmos.gov.
|
|
28
|
-
["/cosmos.gov.v1.
|
|
29
|
-
["/cosmos.gov.
|
|
26
|
+
["/cosmos.gov.v1.MsgDeposit", tx_1.MsgDeposit],
|
|
27
|
+
["/cosmos.gov.v1.MsgSubmitProposal", tx_1.MsgSubmitProposal],
|
|
28
|
+
["/cosmos.gov.v1.MsgUpdateParams", tx_1.MsgUpdateParams],
|
|
29
|
+
["/cosmos.gov.v1.MsgVote", tx_1.MsgVote],
|
|
30
|
+
["/cosmos.gov.v1.MsgVoteWeighted", tx_1.MsgVoteWeighted],
|
|
30
31
|
["/cosmos.gov.v1.MsgCancelProposal", tx_3.MsgCancelProposal],
|
|
32
|
+
["/cosmos.gov.v1beta1.MsgDeposit", tx_2.MsgDeposit],
|
|
33
|
+
["/cosmos.gov.v1beta1.MsgSubmitProposal", tx_2.MsgSubmitProposal],
|
|
34
|
+
["/cosmos.gov.v1beta1.MsgVote", tx_2.MsgVote],
|
|
35
|
+
["/cosmos.gov.v1beta1.MsgVoteWeighted", tx_2.MsgVoteWeighted],
|
|
31
36
|
];
|
|
32
37
|
var registry = new proto_signing_1.Registry(types);
|
|
33
38
|
var GovTxClient = /** @class */ (function (_super) {
|
|
@@ -38,20 +43,35 @@ var GovTxClient = /** @class */ (function (_super) {
|
|
|
38
43
|
GovTxClient.getRegistry = function () {
|
|
39
44
|
return registry;
|
|
40
45
|
};
|
|
46
|
+
GovTxClient.v1MsgDeposit = function (data) {
|
|
47
|
+
return { typeUrl: "/cosmos.gov.v1.MsgDeposit", value: data };
|
|
48
|
+
};
|
|
49
|
+
GovTxClient.v1MsgSubmitProposal = function (data) {
|
|
50
|
+
return { typeUrl: "/cosmos.gov.v1.MsgSubmitProposal", value: data };
|
|
51
|
+
};
|
|
52
|
+
GovTxClient.v1MsgUpdateParams = function (data) {
|
|
53
|
+
return { typeUrl: "/cosmos.gov.v1.MsgUpdateParams", value: data };
|
|
54
|
+
};
|
|
55
|
+
GovTxClient.v1MsgVote = function (data) {
|
|
56
|
+
return { typeUrl: "/cosmos.gov.v1.MsgVote", value: data };
|
|
57
|
+
};
|
|
58
|
+
GovTxClient.v1MsgVoteWeighted = function (data) {
|
|
59
|
+
return { typeUrl: "/cosmos.gov.v1.MsgVoteWeighted", value: data };
|
|
60
|
+
};
|
|
61
|
+
GovTxClient.v1MsgCancelProposal = function (data) {
|
|
62
|
+
return { typeUrl: "/cosmos.gov.v1.MsgCancelProposal", value: data };
|
|
63
|
+
};
|
|
41
64
|
GovTxClient.msgDeposit = function (data) {
|
|
42
65
|
return { typeUrl: "/cosmos.gov.v1beta1.MsgDeposit", value: data };
|
|
43
66
|
};
|
|
44
67
|
GovTxClient.msgSubmitProposal = function (data) {
|
|
45
68
|
return { typeUrl: "/cosmos.gov.v1beta1.MsgSubmitProposal", value: data };
|
|
46
69
|
};
|
|
47
|
-
GovTxClient.msgSubmitGenericProposal = function (data) {
|
|
48
|
-
return { typeUrl: "/cosmos.gov.v1.MsgSubmitProposal", value: data };
|
|
49
|
-
};
|
|
50
70
|
GovTxClient.msgVote = function (data) {
|
|
51
71
|
return { typeUrl: "/cosmos.gov.v1beta1.MsgVote", value: data };
|
|
52
72
|
};
|
|
53
|
-
GovTxClient.
|
|
54
|
-
return { typeUrl: "/cosmos.gov.
|
|
73
|
+
GovTxClient.msgVoteWeighted = function (data) {
|
|
74
|
+
return { typeUrl: "/cosmos.gov.v1beta1.MsgVoteWeighted", value: data };
|
|
55
75
|
};
|
|
56
76
|
return GovTxClient;
|
|
57
77
|
}(ITxClient_1.ITxClient));
|
|
@@ -142,10 +142,10 @@ describe('[17. Gov Query Test]', function () {
|
|
|
142
142
|
case 2:
|
|
143
143
|
param = _a.sent();
|
|
144
144
|
(0, chai_1.expect)(param).to.be.an('object');
|
|
145
|
-
(0, chai_1.expect)(param).to.have.property('
|
|
146
|
-
(0, chai_1.expect)(param).to.have.property('
|
|
147
|
-
(0, chai_1.expect)(param).to.have.property('
|
|
148
|
-
(0, chai_1.expect)(param).to.have.property('
|
|
145
|
+
(0, chai_1.expect)(param).to.have.property('yes_count');
|
|
146
|
+
(0, chai_1.expect)(param).to.have.property('abstain_count');
|
|
147
|
+
(0, chai_1.expect)(param).to.have.property('no_count');
|
|
148
|
+
(0, chai_1.expect)(param).to.have.property('no_with_veto_count');
|
|
149
149
|
return [3 /*break*/, 4];
|
|
150
150
|
case 3:
|
|
151
151
|
(0, chai_1.expect)(proposalList).to.have.lengthOf(0);
|
|
@@ -216,9 +216,7 @@ describe('[26. cosmwasm query Test]', function () {
|
|
|
216
216
|
switch (_b.label) {
|
|
217
217
|
case 0:
|
|
218
218
|
queries = [
|
|
219
|
-
'{"
|
|
220
|
-
'{"minter":{}}',
|
|
221
|
-
'{"marketing_info":{}}'
|
|
219
|
+
'{"config":{}}',
|
|
222
220
|
];
|
|
223
221
|
successfulQuery = null;
|
|
224
222
|
result = null;
|
|
@@ -71,7 +71,7 @@ describe('[27. protobuf arbitrary sign]', function () {
|
|
|
71
71
|
});
|
|
72
72
|
});
|
|
73
73
|
it('protobuf arbitrary sign & verify basic test', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
74
|
-
var testMsg, signatureResult, isMatch;
|
|
74
|
+
var testMsg, signatureResult, jsonString, finalData, isMatch;
|
|
75
75
|
return __generator(this, function (_a) {
|
|
76
76
|
switch (_a.label) {
|
|
77
77
|
case 0:
|
|
@@ -79,7 +79,9 @@ describe('[27. protobuf arbitrary sign]', function () {
|
|
|
79
79
|
return [4 /*yield*/, FirmaUtil_1.FirmaUtil.experimentalAdr36Sign(aliceWallet, testMsg)];
|
|
80
80
|
case 1:
|
|
81
81
|
signatureResult = _a.sent();
|
|
82
|
-
|
|
82
|
+
jsonString = JSON.stringify(signatureResult);
|
|
83
|
+
finalData = JSON.parse(jsonString);
|
|
84
|
+
return [4 /*yield*/, FirmaUtil_1.FirmaUtil.experimentalAdr36Verify(finalData, testMsg)];
|
|
83
85
|
case 2:
|
|
84
86
|
isMatch = _a.sent();
|
|
85
87
|
(0, chai_1.expect)(isMatch).to.be.equal(true);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { FirmaConfig } from '../sdk/FirmaConfig';
|
|
2
2
|
export declare let TestChainConfig: FirmaConfig;
|
|
3
|
-
export declare const validatorMnemonic = "
|
|
4
|
-
export declare const aliceMnemonic = "
|
|
5
|
-
export declare const bobMnemonic = "
|
|
6
|
-
export declare const feeMnemonic = "
|
|
7
|
-
export declare const firmaFeeMnemonic = "
|
|
8
|
-
export declare const signerMnemonic1 = "
|
|
9
|
-
export declare const signerMnemonic2 = "
|
|
10
|
-
export declare const signerMnemonic3 = "
|
|
11
|
-
export declare const signerMnemonic4 = "
|
|
3
|
+
export declare const validatorMnemonic = "uncle banana theme relax oak prosper volcano glad industry bicycle tower thrive jelly curious luggage frame that defy reason jewel figure begin nice moon";
|
|
4
|
+
export declare const aliceMnemonic = "ozone unfold device pave lemon potato omit insect column wise cover hint narrow large provide kidney episode clay notable milk mention dizzy muffin crazy";
|
|
5
|
+
export declare const bobMnemonic = "burst torch enemy quick crime slogan trust wood hamster way armor visual common language close park leg ill ball board couch nose theory must";
|
|
6
|
+
export declare const feeMnemonic = "";
|
|
7
|
+
export declare const firmaFeeMnemonic = "";
|
|
8
|
+
export declare const signerMnemonic1 = "owner pottery smile evolve pig base lady dismiss badge purchase divide royal medal buffalo miss carbon kiwi gate draft mouse yard reunion thank wage";
|
|
9
|
+
export declare const signerMnemonic2 = "clump erupt type lucky mask pig soup runway wrestle suspect element involve stamp civil auction resource blame same journey start unaware crush ten draw";
|
|
10
|
+
export declare const signerMnemonic3 = "main shallow liberty desk super palm remind throw track legal warrior client garbage type insect first token keen subway pony curtain pitch yellow arrive";
|
|
11
|
+
export declare const signerMnemonic4 = "sand mule spice strike summer invite hybrid inner deputy truly cabin little fence smart erase roast gesture raccoon side love odor decorate action lunar";
|
package/dist/test/config_test.js
CHANGED
|
@@ -1,10 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.signerMnemonic4 = exports.signerMnemonic3 = exports.signerMnemonic2 = exports.signerMnemonic1 = exports.firmaFeeMnemonic = exports.feeMnemonic = exports.bobMnemonic = exports.aliceMnemonic = exports.validatorMnemonic = exports.TestChainConfig = void 0;
|
|
4
|
-
|
|
5
|
-
var config = FirmaConfig_1.FirmaConfig.TestNetConfig;
|
|
6
|
-
config.isShowLog = false;
|
|
4
|
+
// TESTNET
|
|
7
5
|
// export let TestChainConfig: FirmaConfig = FirmaConfig.TestNetConfig;
|
|
6
|
+
// Validator 1
|
|
7
|
+
// export const validatorMnemonic = "owner pottery smile evolve pig base lady dismiss badge purchase divide royal medal buffalo miss carbon kiwi gate draft mouse yard reunion thank wage";
|
|
8
|
+
// Validator 2
|
|
9
|
+
// export const validatorMnemonic = "clump erupt type lucky mask pig soup runway wrestle suspect element involve stamp civil auction resource blame same journey start unaware crush ten draw";
|
|
10
|
+
// validator 3
|
|
11
|
+
// export const validatorMnemonic = "main shallow liberty desk super palm remind throw track legal warrior client garbage type insect first token keen subway pony curtain pitch yellow arrive";
|
|
12
|
+
// export const aliceMnemonic = "harvest galaxy sniff include record undo width oven tired sad month text museum curious firm mountain flash assault oval sand ribbon blouse consider lens";
|
|
13
|
+
// export const bobMnemonic = "certain bean eager measure crawl cliff innocent practice gas ladder board aspect fish link sweet raccoon staff long crumble skin special width click plastic";
|
|
14
|
+
// export const feeMnemonic = "";
|
|
15
|
+
// export const firmaFeeMnemonic = "";
|
|
16
|
+
// export const signerMnemonic1 = "owner pottery smile evolve pig base lady dismiss badge purchase divide royal medal buffalo miss carbon kiwi gate draft mouse yard reunion thank wage";
|
|
17
|
+
// export const signerMnemonic2 = "clump erupt type lucky mask pig soup runway wrestle suspect element involve stamp civil auction resource blame same journey start unaware crush ten draw";
|
|
18
|
+
// export const signerMnemonic3 = "main shallow liberty desk super palm remind throw track legal warrior client garbage type insect first token keen subway pony curtain pitch yellow arrive";
|
|
19
|
+
// export const signerMnemonic4 = "sand mule spice strike summer invite hybrid inner deputy truly cabin little fence smart erase roast gesture raccoon side love odor decorate action lunar";
|
|
20
|
+
// DEVNET
|
|
8
21
|
exports.TestChainConfig = {
|
|
9
22
|
chainID: "roma-1",
|
|
10
23
|
rpcAddress: "http://192.168.30.47:26657",
|
|
@@ -17,44 +30,15 @@ exports.TestChainConfig = {
|
|
|
17
30
|
denom: "ufct",
|
|
18
31
|
defaultFee: 20000,
|
|
19
32
|
defaultGas: 200000,
|
|
20
|
-
isShowLog:
|
|
33
|
+
isShowLog: true,
|
|
21
34
|
};
|
|
22
|
-
//
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
exports.
|
|
26
|
-
exports.
|
|
27
|
-
exports.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
// export const bobMnemonic = "certain bean eager measure crawl cliff innocent practice gas ladder board aspect fish link sweet raccoon staff long crumble skin special width click plastic";
|
|
33
|
-
// testnet인데 임시로 바꿈
|
|
34
|
-
// export const bobMnemonic = "harvest galaxy sniff include record undo width oven tired sad month text museum curious firm mountain flash assault oval sand ribbon blouse consider lens";
|
|
35
|
-
// export const aliceMnemonic = "certain bean eager measure crawl cliff innocent practice gas ladder board aspect fish link sweet raccoon staff long crumble skin special width click plastic";
|
|
36
|
-
// DEVNET validator 4
|
|
37
|
-
// export const validatorMnemonic = "ladder damage art company shield glance cushion float need layer rare toast intact grief wet point write season correct access mix bomb accident estate";
|
|
38
|
-
// DEVNET validator 3
|
|
39
|
-
// export const validatorMnemonic = "rebel engine situate catalog blood strong satisfy aerobic cupboard again vivid twice flag work taxi heart fruit island ribbon hungry cheap ordinary horse foam";
|
|
40
|
-
// DEVNET
|
|
41
|
-
// export const aliceMnemonic = "immune flavor record sphere foam planet faint grid disorder flag minute eternal beef sea camp surge extra scorpion pistol plastic happy siren juice found";
|
|
42
|
-
// TESTNET
|
|
43
|
-
// export const aliceMnemonic = "harvest galaxy sniff include record undo width oven tired sad month text museum curious firm mountain flash assault oval sand ribbon blouse consider lens";
|
|
44
|
-
// VALIDATOR
|
|
45
|
-
// export const aliceMnemonic = "clump erupt type lucky mask pig soup runway wrestle suspect element involve stamp civil auction resource blame same journey start unaware crush ten draw";
|
|
46
|
-
// export const aliceMnemonic = "owner pottery smile evolve pig base lady dismiss badge purchase divide royal medal buffalo miss carbon kiwi gate draft mouse yard reunion thank wage";
|
|
47
|
-
// export const aliceMnemonic = "main shallow liberty desk super palm remind throw track legal warrior client garbage type insect first token keen subway pony curtain pitch yellow arrive";
|
|
48
|
-
// export const aliceMnemonic = "clump erupt type lucky mask pig soup runway wrestle suspect element involve stamp civil auction resource blame same journey start unaware crush ten draw";
|
|
49
|
-
// export const aliceMnemonic = "angry water bunker where iron absurd cruise deliver clutch unique creek pyramid arch express flush pill lens concert absent enemy boring mom nuclear rose";
|
|
50
|
-
// export const aliceMnemonic = "stadium lonely midnight okay meat rib awesome wealth phone leisure turn prosper notable label fruit define little also father silver half drill bargain antique";
|
|
51
|
-
// export const aliceMnemonic = "uncle banana theme relax oak prosper volcano glad industry bicycle tower thrive jelly curious luggage frame that defy reason jewel figure begin nice moon";
|
|
52
|
-
// export const aliceMnemonic = "rebel engine situate catalog blood strong satisfy aerobic cupboard again vivid twice flag work taxi heart fruit island ribbon hungry cheap ordinary horse foam";
|
|
53
|
-
// export const aliceMnemonic = "ladder damage art company shield glance cushion float need layer rare toast intact grief wet point write season correct access mix bomb accident estate";
|
|
54
|
-
exports.feeMnemonic = "long shallow crumble clown truth book oval render seed canal buffalo assist sadness elbow afraid catalog brother trade food subject must luggage bread neither";
|
|
55
|
-
exports.firmaFeeMnemonic = "arrest dynamic typical lunch original glare truth narrow stairs clip canyon space alley chat drive sudden music bubble time mesh color office minor draft";
|
|
56
|
-
// export const firmaFeeMnemonic = "child material talent property foot sign talent congress cargo pistol suspect screen leader owner type style patch amused stable flame sure fluid april acoustic";
|
|
57
|
-
exports.signerMnemonic1 = "couch tonight jelly pond notice spring gold tornado cancel hover hill soft table can buyer already region bean mask cart gasp include change rent";
|
|
58
|
-
exports.signerMnemonic2 = "frozen never essence submit moon night cement omit final guilt border draft caution zoo gorilla illegal notable whisper try name orange hollow maximum arrive";
|
|
59
|
-
exports.signerMnemonic3 = "stock vapor planet van asthma upgrade scheme fuel cushion before brief knee kick lesson gun spatial protect danger they stem stay chunk critic cram";
|
|
60
|
-
exports.signerMnemonic4 = "tomorrow hospital bottom lucky insane play concert casual truly certain antique airport safe envelope relax matter cute zone boring calm pudding eyebrow mouse spawn";
|
|
35
|
+
// Validator
|
|
36
|
+
exports.validatorMnemonic = "uncle banana theme relax oak prosper volcano glad industry bicycle tower thrive jelly curious luggage frame that defy reason jewel figure begin nice moon";
|
|
37
|
+
exports.aliceMnemonic = "ozone unfold device pave lemon potato omit insect column wise cover hint narrow large provide kidney episode clay notable milk mention dizzy muffin crazy";
|
|
38
|
+
exports.bobMnemonic = "burst torch enemy quick crime slogan trust wood hamster way armor visual common language close park leg ill ball board couch nose theory must";
|
|
39
|
+
exports.feeMnemonic = "";
|
|
40
|
+
exports.firmaFeeMnemonic = "";
|
|
41
|
+
exports.signerMnemonic1 = "owner pottery smile evolve pig base lady dismiss badge purchase divide royal medal buffalo miss carbon kiwi gate draft mouse yard reunion thank wage";
|
|
42
|
+
exports.signerMnemonic2 = "clump erupt type lucky mask pig soup runway wrestle suspect element involve stamp civil auction resource blame same journey start unaware crush ten draw";
|
|
43
|
+
exports.signerMnemonic3 = "main shallow liberty desk super palm remind throw track legal warrior client garbage type insect first token keen subway pony curtain pitch yellow arrive";
|
|
44
|
+
exports.signerMnemonic4 = "sand mule spice strike summer invite hybrid inner deputy truly cabin little fence smart erase roast gesture raccoon side love odor decorate action lunar";
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|