@firmachain/firma-js 0.2.64 → 0.3.1
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/README.md +1 -1
- package/dist/sdk/FirmaAuthzService.d.ts +8 -8
- package/dist/sdk/FirmaAuthzService.js +12 -6
- package/dist/sdk/FirmaBankService.d.ts +4 -4
- package/dist/sdk/FirmaContractService.d.ts +4 -4
- package/dist/sdk/FirmaCosmWasmCw20.d.ts +14 -14
- package/dist/sdk/FirmaCosmWasmCw721.d.ts +14 -14
- package/dist/sdk/FirmaCosmWasmCwBridge.d.ts +9 -9
- package/dist/sdk/FirmaCosmWasmCwMarketplace.d.ts +8 -8
- package/dist/sdk/FirmaCosmWasmService.d.ts +8 -8
- package/dist/sdk/FirmaCosmWasmService.js +2 -3
- package/dist/sdk/FirmaDistributionService.d.ts +6 -6
- package/dist/sdk/FirmaFeeGrantService.d.ts +4 -4
- package/dist/sdk/FirmaGovService.d.ts +27 -16
- package/dist/sdk/FirmaGovService.js +305 -195
- package/dist/sdk/FirmaIbcService.d.ts +3 -4
- package/dist/sdk/FirmaIbcService.js +5 -2
- package/dist/sdk/FirmaNftService.d.ts +5 -5
- package/dist/sdk/FirmaStakingService.d.ts +6 -6
- package/dist/sdk/FirmaTokenService.d.ts +5 -5
- package/dist/sdk/FirmaUtil.d.ts +1 -1
- package/dist/sdk/FirmaUtil.js +12 -14
- package/dist/sdk/firmachain/amino/addresses.js +1 -1
- package/dist/sdk/firmachain/amino/aminomsgs.d.ts +10 -0
- package/dist/sdk/firmachain/amino/aminomsgs.js +5 -1
- package/dist/sdk/firmachain/amino/aminotypes.js +27 -10
- package/dist/sdk/firmachain/amino/coins.d.ts +14 -2
- package/dist/sdk/firmachain/amino/coins.js +26 -5
- package/dist/sdk/firmachain/amino/encoding.d.ts +10 -1
- package/dist/sdk/firmachain/amino/encoding.js +21 -3
- package/dist/sdk/firmachain/amino/signdoc.d.ts +21 -3
- package/dist/sdk/firmachain/amino/signdoc.js +37 -11
- package/dist/sdk/firmachain/amino/signer.d.ts +2 -1
- package/dist/sdk/firmachain/authz/AuthzTxTypes.d.ts +7 -6
- package/dist/sdk/firmachain/authz/AuthzTxTypes.js +7 -6
- package/dist/sdk/firmachain/bank/BankQueryClient.js +1 -1
- package/dist/sdk/firmachain/common/CommonTxClient.js +11 -9
- package/dist/sdk/firmachain/common/ITxClient.d.ts +6 -6
- package/dist/sdk/firmachain/common/ITxClient.js +82 -24
- package/dist/sdk/firmachain/common/LedgerSigningStargateClient.d.ts +4 -9
- package/dist/sdk/firmachain/common/LedgerSigningStargateClient.js +37 -32
- package/dist/sdk/firmachain/common/LedgerWallet.js +4 -8
- package/dist/sdk/firmachain/common/TxCommon.d.ts +1 -2
- package/dist/sdk/firmachain/common/accounts.d.ts +7 -3
- package/dist/sdk/firmachain/common/accounts.js +28 -33
- package/dist/sdk/firmachain/common/aminotypes.d.ts +19 -0
- package/dist/sdk/firmachain/common/aminotypes.js +74 -0
- package/dist/sdk/firmachain/common/events.d.ts +32 -0
- package/dist/sdk/firmachain/common/events.js +18 -0
- package/dist/sdk/firmachain/common/fee.d.ts +26 -0
- package/dist/sdk/firmachain/common/fee.js +83 -0
- package/dist/sdk/firmachain/common/index.d.ts +1 -0
- package/dist/sdk/firmachain/common/index.js +3 -0
- package/dist/sdk/firmachain/common/modules/auth/queries.d.ts +15 -0
- package/dist/sdk/firmachain/common/modules/auth/queries.js +64 -0
- package/dist/sdk/firmachain/common/modules/authz/aminomessages.d.ts +2 -0
- package/dist/sdk/firmachain/common/modules/authz/aminomessages.js +15 -0
- package/dist/sdk/firmachain/common/modules/authz/messages.d.ts +2 -0
- package/dist/sdk/firmachain/common/modules/authz/messages.js +9 -0
- package/dist/sdk/firmachain/common/modules/authz/queries.d.ts +10 -0
- package/dist/sdk/firmachain/common/modules/authz/queries.js +88 -0
- package/dist/sdk/firmachain/common/modules/bank/aminomessages.d.ts +35 -0
- package/dist/sdk/firmachain/common/modules/bank/aminomessages.js +85 -0
- package/dist/sdk/firmachain/common/modules/bank/messages.d.ts +8 -0
- package/dist/sdk/firmachain/common/modules/bank/messages.js +12 -0
- package/dist/sdk/firmachain/common/modules/bank/queries.d.ts +15 -0
- package/dist/sdk/firmachain/common/modules/bank/queries.js +128 -0
- package/dist/sdk/firmachain/common/modules/crisis/aminomessages.d.ts +14 -0
- package/dist/sdk/firmachain/common/modules/crisis/aminomessages.js +11 -0
- package/dist/sdk/firmachain/common/modules/distribution/aminomessages.d.ts +44 -0
- package/dist/sdk/firmachain/common/modules/distribution/aminomessages.js +113 -0
- package/dist/sdk/firmachain/common/modules/distribution/messages.d.ts +8 -0
- package/dist/sdk/firmachain/common/modules/distribution/messages.js +15 -0
- package/dist/sdk/firmachain/common/modules/distribution/queries.d.ts +16 -0
- package/dist/sdk/firmachain/common/modules/distribution/queries.js +171 -0
- package/dist/sdk/firmachain/common/modules/evidence/aminomessages.d.ts +18 -0
- package/dist/sdk/firmachain/common/modules/evidence/aminomessages.js +11 -0
- package/dist/sdk/firmachain/common/modules/feegrant/aminomessages.d.ts +2 -0
- package/dist/sdk/firmachain/common/modules/feegrant/aminomessages.js +14 -0
- package/dist/sdk/firmachain/common/modules/feegrant/messages.d.ts +2 -0
- package/dist/sdk/firmachain/common/modules/feegrant/messages.js +8 -0
- package/dist/sdk/firmachain/common/modules/feegrant/queries.d.ts +9 -0
- package/dist/sdk/firmachain/common/modules/feegrant/queries.js +81 -0
- package/dist/sdk/firmachain/common/modules/gov/aminomessages.d.ts +79 -0
- package/dist/sdk/firmachain/common/modules/gov/aminomessages.js +152 -0
- package/dist/sdk/firmachain/common/modules/gov/messages.d.ts +29 -0
- package/dist/sdk/firmachain/common/modules/gov/messages.js +38 -0
- package/dist/sdk/firmachain/common/modules/gov/queries.d.ts +19 -0
- package/dist/sdk/firmachain/common/modules/gov/queries.js +160 -0
- package/dist/sdk/firmachain/common/modules/group/aminomessages.d.ts +2 -0
- package/dist/sdk/firmachain/common/modules/group/aminomessages.js +8 -0
- package/dist/sdk/firmachain/common/modules/group/messages.d.ts +2 -0
- package/dist/sdk/firmachain/common/modules/group/messages.js +28 -0
- package/dist/sdk/firmachain/common/modules/ibc/aminomessages.d.ts +38 -0
- package/dist/sdk/firmachain/common/modules/ibc/aminomessages.js +55 -0
- package/dist/sdk/firmachain/common/modules/ibc/messages.d.ts +8 -0
- package/dist/sdk/firmachain/common/modules/ibc/messages.js +32 -0
- package/dist/sdk/firmachain/common/modules/ibc/queries.d.ts +58 -0
- package/dist/sdk/firmachain/common/modules/ibc/queries.js +576 -0
- package/dist/sdk/firmachain/common/modules/index.d.ts +32 -0
- package/dist/sdk/firmachain/common/modules/index.js +101 -0
- package/dist/sdk/firmachain/common/modules/mint/queries.d.ts +21 -0
- package/dist/sdk/firmachain/common/modules/mint/queries.js +95 -0
- package/dist/sdk/firmachain/common/modules/slashing/aminomessages.d.ts +12 -0
- package/dist/sdk/firmachain/common/modules/slashing/aminomessages.js +11 -0
- package/dist/sdk/firmachain/common/modules/slashing/queries.d.ts +10 -0
- package/dist/sdk/firmachain/common/modules/slashing/queries.js +88 -0
- package/dist/sdk/firmachain/common/modules/staking/aminomessages.d.ts +112 -0
- package/dist/sdk/firmachain/common/modules/staking/aminomessages.js +234 -0
- package/dist/sdk/firmachain/common/modules/staking/messages.d.ts +33 -0
- package/dist/sdk/firmachain/common/modules/staking/messages.js +37 -0
- package/dist/sdk/firmachain/common/modules/staking/queries.d.ts +23 -0
- package/dist/sdk/firmachain/common/modules/staking/queries.js +242 -0
- package/dist/sdk/firmachain/common/modules/tx/queries.d.ts +11 -0
- package/dist/sdk/firmachain/common/modules/tx/queries.js +103 -0
- package/dist/sdk/firmachain/common/modules/vesting/aminomessages.d.ts +16 -0
- package/dist/sdk/firmachain/common/modules/vesting/aminomessages.js +56 -0
- package/dist/sdk/firmachain/common/modules/vesting/messages.d.ts +2 -0
- package/dist/sdk/firmachain/common/modules/vesting/messages.js +7 -0
- package/dist/sdk/firmachain/common/queryclient/index.d.ts +2 -0
- package/dist/sdk/firmachain/common/queryclient/index.js +10 -0
- package/dist/sdk/firmachain/common/queryclient/queryclient.d.ts +75 -0
- package/dist/sdk/firmachain/common/queryclient/queryclient.js +157 -0
- package/dist/sdk/firmachain/common/queryclient/utils.d.ts +33 -0
- package/dist/sdk/firmachain/common/queryclient/utils.js +101 -0
- package/dist/sdk/firmachain/common/search.d.ts +10 -0
- package/dist/sdk/firmachain/common/search.js +7 -0
- package/dist/sdk/firmachain/common/signing.d.ts +8 -3
- package/dist/sdk/firmachain/common/signing.js +24 -12
- package/dist/sdk/firmachain/common/signingstargateclient.d.ts +107 -30
- package/dist/sdk/firmachain/common/signingstargateclient.js +445 -128
- package/dist/sdk/firmachain/common/stargateclient.d.ts +184 -20
- package/dist/sdk/firmachain/common/stargateclient.js +351 -35
- package/dist/sdk/firmachain/contract/ContractTxClient.d.ts +2 -2
- package/dist/sdk/firmachain/contract/ContractTxClient.js +4 -4
- package/dist/sdk/firmachain/contract/ContractTxTypes.d.ts +1 -1
- package/dist/sdk/firmachain/contract/ContractTxTypes.js +3 -3
- package/dist/sdk/firmachain/cosmwasm/CosmWasmQueryClient.js +1 -1
- package/dist/sdk/firmachain/feegrant/FeeGrantTxTypes.d.ts +5 -5
- package/dist/sdk/firmachain/feegrant/FeeGrantTxTypes.js +10 -8
- package/dist/sdk/firmachain/google/protobuf/any.d.ts +3 -2
- package/dist/sdk/firmachain/google/protobuf/any.js +2 -1
- package/dist/sdk/firmachain/google/protobuf/duration.d.ts +3 -2
- package/dist/sdk/firmachain/google/protobuf/duration.js +2 -1
- package/dist/sdk/firmachain/google/protobuf/timestamp.d.ts +3 -2
- package/dist/sdk/firmachain/google/protobuf/timestamp.js +2 -1
- package/dist/sdk/firmachain/gov/GovQueryClient.d.ts +13 -1
- package/dist/sdk/firmachain/gov/GovQueryClient.js +9 -2
- package/dist/sdk/firmachain/gov/GovTxClient.d.ts +12 -0
- package/dist/sdk/firmachain/gov/GovTxClient.js +11 -1
- package/dist/sdk/firmachain/nft/NftTxClient.d.ts +3 -3
- package/dist/sdk/firmachain/nft/NftTxClient.js +6 -6
- package/dist/sdk/firmachain/nft/NftTxTypes.d.ts +1 -1
- package/dist/sdk/firmachain/nft/NftTxTypes.js +4 -4
- package/dist/sdk/firmachain/staking/StakingQueryClient.d.ts +1 -0
- package/dist/sdk/firmachain/staking/StakingQueryClient.js +0 -1
- package/dist/sdk/firmachain/token/TokenTxClient.d.ts +4 -4
- package/dist/sdk/firmachain/token/TokenTxClient.js +8 -8
- package/dist/sdk/firmachain/token/TokenTxTypes.d.ts +1 -1
- package/dist/sdk/firmachain/token/TokenTxTypes.js +5 -5
- package/dist/test/00.wallet.test.js +15 -9
- package/dist/test/01.contract_tx.test.js +53 -45
- package/dist/test/02.contract_query.test.js +54 -31
- package/dist/test/03.contract_scenario.test.js +170 -326
- package/dist/test/04.bank_tx.test.js +58 -59
- package/dist/test/05.bank_query.test.js +51 -56
- package/dist/test/06.feegrant_tx.test.js +74 -89
- package/dist/test/07.feegrant_query.test.js +69 -27
- package/dist/test/08.gas_estimate.test.js +422 -392
- package/dist/test/09.ipfs.test.js +3 -3
- package/dist/test/10.nft_tx.test.js +108 -76
- package/dist/test/11.nft_query.test.js +41 -46
- package/dist/test/12.staking_tx.test.js +81 -98
- package/dist/test/13.staking_query.test.js +66 -12
- package/dist/test/14.distribution_tx.test.js +69 -78
- package/dist/test/15.distribution_query.test.js +81 -57
- package/dist/test/16.gov_tx.test.js +247 -107
- package/dist/test/17.gov_query.test.js +48 -9
- package/dist/test/18.util.test.js +6 -1
- package/dist/test/19.chain.test.js +50 -4
- package/dist/test/20.slashing_query.test.js +31 -1
- package/dist/test/21.token_tx.test.js +48 -56
- package/dist/test/22.token_query.test.js +24 -20
- package/dist/test/23.authz_tx.test.js +119 -240
- package/dist/test/24.authz_query.test.js +116 -56
- package/dist/test/25.cosmwasm_tx.test.js +95 -57
- package/dist/test/26.cosmwasm_query.test.js +66 -26
- package/dist/test/27.arbitary_sign.test.js +59 -67
- package/dist/test/28.ibc_tx.test.js +29 -17
- package/dist/test/29.mint_query.test.js +2 -0
- package/dist/test/30.cw20_tx.test.js +161 -226
- package/dist/test/31.cw20_query.test.js +183 -37
- package/dist/test/32.cw721_tx.test.js +147 -149
- package/dist/test/33.cw721_query.test.js +188 -36
- package/dist/test/34.cw_bridge_tx.test.js +266 -155
- package/dist/test/35.cw_bridge_tx_low.test.js +221 -81
- package/dist/test/36.cw_bridge_query.test.js +157 -21
- package/dist/test/37.cw_marketplace_tx.test.js +22 -22
- package/dist/test/38.cw_marketplace_query.test.js +9 -9
- package/dist/test/config_test.d.ts +10 -4
- package/dist/test/config_test.js +16 -9
- package/dist/test/config_test.sample.d.ts +11 -0
- package/dist/test/config_test.sample.js +14 -0
- package/package.json +9 -7
- package/dist/sdk/firmachain/common/signingaminostargateclient.d.ts +0 -50
- package/dist/sdk/firmachain/common/signingaminostargateclient.js +0 -267
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Reader } from "protobufjs/minimal";
|
|
2
|
+
import { BinaryWriter } from "cosmjs-types/binary";
|
|
2
3
|
export declare const protobufPackage = "google.protobuf";
|
|
3
4
|
/**
|
|
4
5
|
* `Any` contains an arbitrary serialized protocol buffer message along with a
|
|
@@ -116,7 +117,7 @@ export interface Any {
|
|
|
116
117
|
value: Uint8Array;
|
|
117
118
|
}
|
|
118
119
|
export declare const Any: {
|
|
119
|
-
encode(message: Any, writer?:
|
|
120
|
+
encode(message: Any, writer?: BinaryWriter): BinaryWriter;
|
|
120
121
|
decode(input: Reader | Uint8Array, length?: number | undefined): Any;
|
|
121
122
|
fromJSON(object: any): Any;
|
|
122
123
|
fromPartial(object: DeepPartial<Any>): Any;
|
|
@@ -14,11 +14,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
14
14
|
exports.Any = exports.protobufPackage = void 0;
|
|
15
15
|
/* eslint-disable */
|
|
16
16
|
var minimal_1 = require("protobufjs/minimal");
|
|
17
|
+
var binary_1 = require("cosmjs-types/binary");
|
|
17
18
|
exports.protobufPackage = "google.protobuf";
|
|
18
19
|
var baseAny = { typeUrl: "" };
|
|
19
20
|
exports.Any = {
|
|
20
21
|
encode: function (message, writer) {
|
|
21
|
-
if (writer === void 0) { writer =
|
|
22
|
+
if (writer === void 0) { writer = binary_1.BinaryWriter.create(); }
|
|
22
23
|
if (message.typeUrl !== "") {
|
|
23
24
|
writer.uint32(10).string(message.typeUrl);
|
|
24
25
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Reader } from "protobufjs/minimal";
|
|
2
|
+
import { BinaryWriter } from "cosmjs-types/binary";
|
|
2
3
|
export declare const protobufPackage = "google.protobuf";
|
|
3
4
|
/**
|
|
4
5
|
* A Duration represents a signed, fixed-length span of time represented
|
|
@@ -78,7 +79,7 @@ export interface Duration {
|
|
|
78
79
|
nanos: number;
|
|
79
80
|
}
|
|
80
81
|
export declare const Duration: {
|
|
81
|
-
encode(message: Duration, writer?:
|
|
82
|
+
encode(message: Duration, writer?: BinaryWriter): BinaryWriter;
|
|
82
83
|
decode(input: Reader | Uint8Array, length?: number | undefined): Duration;
|
|
83
84
|
fromJSON(object: any): Duration;
|
|
84
85
|
toJSON(message: Duration): unknown;
|
|
@@ -14,11 +14,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
14
14
|
exports.Duration = exports.protobufPackage = void 0;
|
|
15
15
|
/* eslint-disable */
|
|
16
16
|
var minimal_1 = require("protobufjs/minimal");
|
|
17
|
+
var binary_1 = require("cosmjs-types/binary");
|
|
17
18
|
exports.protobufPackage = "google.protobuf";
|
|
18
19
|
var baseDuration = { seconds: 0, nanos: 0 };
|
|
19
20
|
exports.Duration = {
|
|
20
21
|
encode: function (message, writer) {
|
|
21
|
-
if (writer === void 0) { writer =
|
|
22
|
+
if (writer === void 0) { writer = binary_1.BinaryWriter.create(); }
|
|
22
23
|
if (message.seconds !== 0) {
|
|
23
24
|
writer.uint32(8).int64(message.seconds);
|
|
24
25
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Reader } from "protobufjs/minimal";
|
|
2
|
+
import { BinaryWriter } from "cosmjs-types/binary";
|
|
2
3
|
export declare const protobufPackage = "google.protobuf";
|
|
3
4
|
/**
|
|
4
5
|
* A Timestamp represents a point in time independent of any time zone
|
|
@@ -96,7 +97,7 @@ export interface Timestamp {
|
|
|
96
97
|
nanos: number;
|
|
97
98
|
}
|
|
98
99
|
export declare const Timestamp: {
|
|
99
|
-
encode(message: Timestamp, writer?:
|
|
100
|
+
encode(message: Timestamp, writer?: BinaryWriter): BinaryWriter;
|
|
100
101
|
decode(input: Reader | Uint8Array, length?: number | undefined): Timestamp;
|
|
101
102
|
fromJSON(object: any): Timestamp;
|
|
102
103
|
toJSON(message: Timestamp): unknown;
|
|
@@ -14,11 +14,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
14
14
|
exports.Timestamp = exports.protobufPackage = void 0;
|
|
15
15
|
/* eslint-disable */
|
|
16
16
|
var minimal_1 = require("protobufjs/minimal");
|
|
17
|
+
var binary_1 = require("cosmjs-types/binary");
|
|
17
18
|
exports.protobufPackage = "google.protobuf";
|
|
18
19
|
var baseTimestamp = { seconds: 0, nanos: 0 };
|
|
19
20
|
exports.Timestamp = {
|
|
20
21
|
encode: function (message, writer) {
|
|
21
|
-
if (writer === void 0) { writer =
|
|
22
|
+
if (writer === void 0) { writer = binary_1.BinaryWriter.create(); }
|
|
22
23
|
if (message.seconds !== 0) {
|
|
23
24
|
writer.uint32(8).int64(message.seconds);
|
|
24
25
|
}
|
|
@@ -7,7 +7,9 @@ export declare enum ProposalStatus {
|
|
|
7
7
|
PROPOSAL_STATUS_FAILED = 5
|
|
8
8
|
}
|
|
9
9
|
export interface ProposalParam {
|
|
10
|
-
|
|
10
|
+
voting_params: {
|
|
11
|
+
voting_period: string;
|
|
12
|
+
};
|
|
11
13
|
deposit_params: {
|
|
12
14
|
min_deposit: {
|
|
13
15
|
denom: string;
|
|
@@ -20,6 +22,16 @@ export interface ProposalParam {
|
|
|
20
22
|
threshold: string;
|
|
21
23
|
veto_threshold: string;
|
|
22
24
|
};
|
|
25
|
+
min_initial_deposit_ratio: string;
|
|
26
|
+
burn_vote_quorum: boolean;
|
|
27
|
+
burn_proposal_deposit_prevote: boolean;
|
|
28
|
+
burn_vote_veto: boolean;
|
|
29
|
+
expedited_voting_period: string;
|
|
30
|
+
expedited_threshold: string;
|
|
31
|
+
expedited_min_deposit: {
|
|
32
|
+
denom: string;
|
|
33
|
+
amount: string;
|
|
34
|
+
}[];
|
|
23
35
|
}
|
|
24
36
|
export interface CurrentVoteInfo {
|
|
25
37
|
yes: string;
|
|
@@ -94,9 +94,16 @@ var GovQueryClient = /** @class */ (function () {
|
|
|
94
94
|
case 3:
|
|
95
95
|
tallyingResult = _a.sent();
|
|
96
96
|
return [2 /*return*/, {
|
|
97
|
-
|
|
97
|
+
voting_params: votingResult.data.voting_params,
|
|
98
98
|
deposit_params: depositResult.data.deposit_params,
|
|
99
|
-
tally_params: tallyingResult.data.tally_params
|
|
99
|
+
tally_params: tallyingResult.data.tally_params,
|
|
100
|
+
min_initial_deposit_ratio: votingResult.data.min_initial_deposit_ratio,
|
|
101
|
+
burn_vote_quorum: votingResult.data.burn_vote_quorum,
|
|
102
|
+
burn_proposal_deposit_prevote: votingResult.data.burn_proposal_deposit_prevote,
|
|
103
|
+
burn_vote_veto: votingResult.data.burn_vote_veto,
|
|
104
|
+
expedited_voting_period: votingResult.data.expedited_voting_period,
|
|
105
|
+
expedited_threshold: votingResult.data.expedited_threshold,
|
|
106
|
+
expedited_min_deposit: votingResult.data.expedited_min_deposit
|
|
100
107
|
}];
|
|
101
108
|
}
|
|
102
109
|
});
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Registry, EncodeObject } from "@cosmjs/proto-signing";
|
|
2
2
|
import { MsgDeposit, MsgSubmitProposal, MsgVote } from "cosmjs-types/cosmos/gov/v1beta1/tx";
|
|
3
|
+
import { MsgSubmitProposal as MsgSubmitGenericProposal } from "cosmjs-types/cosmos/gov/v1/tx";
|
|
4
|
+
import { MsgCancelProposal } from "@kintsugi-tech/cosmjs-types/cosmos/gov/v1/tx";
|
|
3
5
|
import { FirmaWalletService } from "../../FirmaWalletService";
|
|
4
6
|
import { ITxClient } from "../common/ITxClient";
|
|
5
7
|
export interface MsgDepositEncodeObject extends EncodeObject {
|
|
@@ -10,14 +12,24 @@ export interface MsgSubmitProposalEncodeObject extends EncodeObject {
|
|
|
10
12
|
readonly typeUrl: "/cosmos.gov.v1beta1.MsgSubmitProposal";
|
|
11
13
|
readonly value: Partial<MsgSubmitProposal>;
|
|
12
14
|
}
|
|
15
|
+
export interface MsgSubmitGenericProposalEncodeObject extends EncodeObject {
|
|
16
|
+
readonly typeUrl: "/cosmos.gov.v1.MsgSubmitProposal";
|
|
17
|
+
readonly value: Partial<MsgSubmitGenericProposal>;
|
|
18
|
+
}
|
|
13
19
|
export interface MsgVoteEncodeObject extends EncodeObject {
|
|
14
20
|
readonly typeUrl: "/cosmos.gov.v1beta1.MsgVote";
|
|
15
21
|
readonly value: Partial<MsgVote>;
|
|
16
22
|
}
|
|
23
|
+
export interface MsgCancelProposalEncodeObject extends EncodeObject {
|
|
24
|
+
readonly typeUrl: "/cosmos.gov.v1.MsgCancelProposal";
|
|
25
|
+
readonly value: Partial<MsgCancelProposal>;
|
|
26
|
+
}
|
|
17
27
|
export declare class GovTxClient extends ITxClient {
|
|
18
28
|
constructor(wallet: FirmaWalletService, serverUrl: string);
|
|
19
29
|
static getRegistry(): Registry;
|
|
20
30
|
static msgDeposit(data: MsgDeposit): MsgDepositEncodeObject;
|
|
21
31
|
static msgSubmitProposal(data: MsgSubmitProposal): MsgSubmitProposalEncodeObject;
|
|
32
|
+
static msgSubmitGenericProposal(data: MsgSubmitGenericProposal): MsgSubmitGenericProposalEncodeObject;
|
|
22
33
|
static msgVote(data: MsgVote): MsgVoteEncodeObject;
|
|
34
|
+
static msgCancelProposal(data: MsgCancelProposal): MsgCancelProposalEncodeObject;
|
|
23
35
|
}
|
|
@@ -18,11 +18,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
18
18
|
exports.GovTxClient = void 0;
|
|
19
19
|
var proto_signing_1 = require("@cosmjs/proto-signing");
|
|
20
20
|
var tx_1 = require("cosmjs-types/cosmos/gov/v1beta1/tx");
|
|
21
|
+
var tx_2 = require("cosmjs-types/cosmos/gov/v1/tx");
|
|
22
|
+
var tx_3 = require("@kintsugi-tech/cosmjs-types/cosmos/gov/v1/tx");
|
|
21
23
|
var ITxClient_1 = require("../common/ITxClient");
|
|
22
24
|
var types = [
|
|
23
25
|
["/cosmos.gov.v1beta1.MsgDeposit", tx_1.MsgDeposit],
|
|
24
26
|
["/cosmos.gov.v1beta1.MsgSubmitProposal", tx_1.MsgSubmitProposal],
|
|
25
|
-
["/cosmos.gov.
|
|
27
|
+
["/cosmos.gov.v1.MsgSubmitProposal", tx_2.MsgSubmitProposal],
|
|
28
|
+
["/cosmos.gov.v1beta1.MsgVote", tx_1.MsgVote],
|
|
29
|
+
["/cosmos.gov.v1.MsgCancelProposal", tx_3.MsgCancelProposal],
|
|
26
30
|
];
|
|
27
31
|
var registry = new proto_signing_1.Registry(types);
|
|
28
32
|
var GovTxClient = /** @class */ (function (_super) {
|
|
@@ -39,9 +43,15 @@ var GovTxClient = /** @class */ (function (_super) {
|
|
|
39
43
|
GovTxClient.msgSubmitProposal = function (data) {
|
|
40
44
|
return { typeUrl: "/cosmos.gov.v1beta1.MsgSubmitProposal", value: data };
|
|
41
45
|
};
|
|
46
|
+
GovTxClient.msgSubmitGenericProposal = function (data) {
|
|
47
|
+
return { typeUrl: "/cosmos.gov.v1.MsgSubmitProposal", value: data };
|
|
48
|
+
};
|
|
42
49
|
GovTxClient.msgVote = function (data) {
|
|
43
50
|
return { typeUrl: "/cosmos.gov.v1beta1.MsgVote", value: data };
|
|
44
51
|
};
|
|
52
|
+
GovTxClient.msgCancelProposal = function (data) {
|
|
53
|
+
return { typeUrl: "/cosmos.gov.v1.MsgCancelProposal", value: data };
|
|
54
|
+
};
|
|
45
55
|
return GovTxClient;
|
|
46
56
|
}(ITxClient_1.ITxClient));
|
|
47
57
|
exports.GovTxClient = GovTxClient;
|
|
@@ -3,15 +3,15 @@ import { MsgTransfer, MsgMint, MsgBurn } from "./NftTxTypes";
|
|
|
3
3
|
import { ITxClient } from "../common/ITxClient";
|
|
4
4
|
import { FirmaWalletService } from "../../FirmaWalletService";
|
|
5
5
|
export interface MsgNftTransferEncodeObject extends EncodeObject {
|
|
6
|
-
readonly typeUrl: "/firmachain.
|
|
6
|
+
readonly typeUrl: "/firmachain.nft.MsgTransfer";
|
|
7
7
|
readonly value: Partial<MsgTransfer>;
|
|
8
8
|
}
|
|
9
9
|
export interface MsgNftMintEncodeObject extends EncodeObject {
|
|
10
|
-
readonly typeUrl: "/firmachain.
|
|
10
|
+
readonly typeUrl: "/firmachain.nft.MsgMint";
|
|
11
11
|
readonly value: Partial<MsgMint>;
|
|
12
12
|
}
|
|
13
13
|
export interface MsgNftBurnEncodeObject extends EncodeObject {
|
|
14
|
-
readonly typeUrl: "/firmachain.
|
|
14
|
+
readonly typeUrl: "/firmachain.nft.MsgBurn";
|
|
15
15
|
readonly value: Partial<MsgBurn>;
|
|
16
16
|
}
|
|
17
17
|
export declare class NftTxClient extends ITxClient {
|
|
@@ -20,9 +20,9 @@ var proto_signing_1 = require("@cosmjs/proto-signing");
|
|
|
20
20
|
var NftTxTypes_1 = require("./NftTxTypes");
|
|
21
21
|
var ITxClient_1 = require("../common/ITxClient");
|
|
22
22
|
var types = [
|
|
23
|
-
["/firmachain.
|
|
24
|
-
["/firmachain.
|
|
25
|
-
["/firmachain.
|
|
23
|
+
["/firmachain.nft.MsgTransfer", NftTxTypes_1.MsgTransfer],
|
|
24
|
+
["/firmachain.nft.MsgMint", NftTxTypes_1.MsgMint],
|
|
25
|
+
["/firmachain.nft.MsgBurn", NftTxTypes_1.MsgBurn]
|
|
26
26
|
];
|
|
27
27
|
var registry = new proto_signing_1.Registry(types);
|
|
28
28
|
var NftTxClient = /** @class */ (function (_super) {
|
|
@@ -34,13 +34,13 @@ var NftTxClient = /** @class */ (function (_super) {
|
|
|
34
34
|
return registry;
|
|
35
35
|
};
|
|
36
36
|
NftTxClient.msgTransfer = function (data) {
|
|
37
|
-
return { typeUrl: "/firmachain.
|
|
37
|
+
return { typeUrl: "/firmachain.nft.MsgTransfer", value: data };
|
|
38
38
|
};
|
|
39
39
|
NftTxClient.msgMint = function (data) {
|
|
40
|
-
return { typeUrl: "/firmachain.
|
|
40
|
+
return { typeUrl: "/firmachain.nft.MsgMint", value: data };
|
|
41
41
|
};
|
|
42
42
|
NftTxClient.msgBurn = function (data) {
|
|
43
|
-
return { typeUrl: "/firmachain.
|
|
43
|
+
return { typeUrl: "/firmachain.nft.MsgBurn", value: data };
|
|
44
44
|
};
|
|
45
45
|
return NftTxClient;
|
|
46
46
|
}(ITxClient_1.ITxClient));
|
|
@@ -13,7 +13,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
exports.MsgClientImpl = exports.MsgMintResponse = exports.MsgMint = exports.MsgBurnResponse = exports.MsgBurn = exports.MsgTransferResponse = exports.MsgTransfer = exports.protobufPackage = void 0;
|
|
15
15
|
var minimal_1 = require("protobufjs/minimal");
|
|
16
|
-
exports.protobufPackage = "firmachain.
|
|
16
|
+
exports.protobufPackage = "firmachain.nft";
|
|
17
17
|
var baseMsgTransfer = { owner: "", nftId: 0, toAddress: "" };
|
|
18
18
|
exports.MsgTransfer = {
|
|
19
19
|
encode: function (message, writer) {
|
|
@@ -389,17 +389,17 @@ var MsgClientImpl = /** @class */ (function () {
|
|
|
389
389
|
}
|
|
390
390
|
MsgClientImpl.prototype.Transfer = function (request) {
|
|
391
391
|
var data = exports.MsgTransfer.encode(request).finish();
|
|
392
|
-
var promise = this.rpc.request("firmachain.
|
|
392
|
+
var promise = this.rpc.request("firmachain.nft.Msg", "Transfer", data);
|
|
393
393
|
return promise.then(function (data) { return exports.MsgTransferResponse.decode(new minimal_1.Reader(data)); });
|
|
394
394
|
};
|
|
395
395
|
MsgClientImpl.prototype.Burn = function (request) {
|
|
396
396
|
var data = exports.MsgBurn.encode(request).finish();
|
|
397
|
-
var promise = this.rpc.request("firmachain.
|
|
397
|
+
var promise = this.rpc.request("firmachain.nft.Msg", "Burn", data);
|
|
398
398
|
return promise.then(function (data) { return exports.MsgBurnResponse.decode(new minimal_1.Reader(data)); });
|
|
399
399
|
};
|
|
400
400
|
MsgClientImpl.prototype.Mint = function (request) {
|
|
401
401
|
var data = exports.MsgMint.encode(request).finish();
|
|
402
|
-
var promise = this.rpc.request("firmachain.
|
|
402
|
+
var promise = this.rpc.request("firmachain.nft.Msg", "Mint", data);
|
|
403
403
|
return promise.then(function (data) { return exports.MsgMintResponse.decode(new minimal_1.Reader(data)); });
|
|
404
404
|
};
|
|
405
405
|
return MsgClientImpl;
|
|
@@ -3,19 +3,19 @@ import { MsgUpdateTokenURI, MsgMint, MsgBurn, MsgCreateToken } from "./TokenTxTy
|
|
|
3
3
|
import { ITxClient } from "../common/ITxClient";
|
|
4
4
|
import { FirmaWalletService } from "../../FirmaWalletService";
|
|
5
5
|
export interface MsgCreateTokenEncodeObject extends EncodeObject {
|
|
6
|
-
readonly typeUrl: "/firmachain.
|
|
6
|
+
readonly typeUrl: "/firmachain.token.MsgCreateToken";
|
|
7
7
|
readonly value: Partial<MsgCreateToken>;
|
|
8
8
|
}
|
|
9
9
|
export interface MsgUpdateTokenURIEncodeObject extends EncodeObject {
|
|
10
|
-
readonly typeUrl: "/firmachain.
|
|
10
|
+
readonly typeUrl: "/firmachain.token.MsgUpdateTokenURI";
|
|
11
11
|
readonly value: Partial<MsgUpdateTokenURI>;
|
|
12
12
|
}
|
|
13
13
|
export interface MsgMintEncodeObject extends EncodeObject {
|
|
14
|
-
readonly typeUrl: "/firmachain.
|
|
14
|
+
readonly typeUrl: "/firmachain.token.MsgMint";
|
|
15
15
|
readonly value: Partial<MsgMint>;
|
|
16
16
|
}
|
|
17
17
|
export interface MsgBurnEncodeObject extends EncodeObject {
|
|
18
|
-
readonly typeUrl: "/firmachain.
|
|
18
|
+
readonly typeUrl: "/firmachain.token.MsgBurn";
|
|
19
19
|
readonly value: Partial<MsgBurn>;
|
|
20
20
|
}
|
|
21
21
|
export declare class TokenTxClient extends ITxClient {
|
|
@@ -20,10 +20,10 @@ var proto_signing_1 = require("@cosmjs/proto-signing");
|
|
|
20
20
|
var TokenTxTypes_1 = require("./TokenTxTypes");
|
|
21
21
|
var ITxClient_1 = require("../common/ITxClient");
|
|
22
22
|
var types = [
|
|
23
|
-
["/firmachain.
|
|
24
|
-
["/firmachain.
|
|
25
|
-
["/firmachain.
|
|
26
|
-
["/firmachain.
|
|
23
|
+
["/firmachain.token.MsgCreateToken", TokenTxTypes_1.MsgCreateToken],
|
|
24
|
+
["/firmachain.token.MsgUpdateTokenURI", TokenTxTypes_1.MsgUpdateTokenURI],
|
|
25
|
+
["/firmachain.token.MsgMint", TokenTxTypes_1.MsgMint],
|
|
26
|
+
["/firmachain.token.MsgBurn", TokenTxTypes_1.MsgBurn]
|
|
27
27
|
];
|
|
28
28
|
var registry = new proto_signing_1.Registry(types);
|
|
29
29
|
var TokenTxClient = /** @class */ (function (_super) {
|
|
@@ -35,16 +35,16 @@ var TokenTxClient = /** @class */ (function (_super) {
|
|
|
35
35
|
return registry;
|
|
36
36
|
};
|
|
37
37
|
TokenTxClient.msgCreateToken = function (data) {
|
|
38
|
-
return { typeUrl: "/firmachain.
|
|
38
|
+
return { typeUrl: "/firmachain.token.MsgCreateToken", value: data };
|
|
39
39
|
};
|
|
40
40
|
TokenTxClient.msgUpdateTokenURI = function (data) {
|
|
41
|
-
return { typeUrl: "/firmachain.
|
|
41
|
+
return { typeUrl: "/firmachain.token.MsgUpdateTokenURI", value: data };
|
|
42
42
|
};
|
|
43
43
|
TokenTxClient.msgMint = function (data) {
|
|
44
|
-
return { typeUrl: "/firmachain.
|
|
44
|
+
return { typeUrl: "/firmachain.token.MsgMint", value: data };
|
|
45
45
|
};
|
|
46
46
|
TokenTxClient.msgBurn = function (data) {
|
|
47
|
-
return { typeUrl: "/firmachain.
|
|
47
|
+
return { typeUrl: "/firmachain.token.MsgBurn", value: data };
|
|
48
48
|
};
|
|
49
49
|
return TokenTxClient;
|
|
50
50
|
}(ITxClient_1.ITxClient));
|
|
@@ -13,7 +13,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
exports.MsgClientImpl = exports.MsgUpdateTokenURIResponse = exports.MsgUpdateTokenURI = exports.MsgBurnResponse = exports.MsgBurn = exports.MsgMintResponse = exports.MsgMint = exports.MsgCreateTokenResponse = exports.MsgCreateToken = exports.protobufPackage = void 0;
|
|
15
15
|
var minimal_1 = require("protobufjs/minimal");
|
|
16
|
-
exports.protobufPackage = "firmachain.
|
|
16
|
+
exports.protobufPackage = "firmachain.token";
|
|
17
17
|
var baseMsgCreateToken = {
|
|
18
18
|
owner: "",
|
|
19
19
|
name: "",
|
|
@@ -641,24 +641,24 @@ var MsgClientImpl = /** @class */ (function () {
|
|
|
641
641
|
}
|
|
642
642
|
MsgClientImpl.prototype.CreateToken = function (request) {
|
|
643
643
|
var data = exports.MsgCreateToken.encode(request).finish();
|
|
644
|
-
var promise = this.rpc.request("firmachain.
|
|
644
|
+
var promise = this.rpc.request("firmachain.token.Msg", "CreateToken", data);
|
|
645
645
|
return promise.then(function (data) {
|
|
646
646
|
return exports.MsgCreateTokenResponse.decode(new minimal_1.Reader(data));
|
|
647
647
|
});
|
|
648
648
|
};
|
|
649
649
|
MsgClientImpl.prototype.Mint = function (request) {
|
|
650
650
|
var data = exports.MsgMint.encode(request).finish();
|
|
651
|
-
var promise = this.rpc.request("firmachain.
|
|
651
|
+
var promise = this.rpc.request("firmachain.token.Msg", "Mint", data);
|
|
652
652
|
return promise.then(function (data) { return exports.MsgMintResponse.decode(new minimal_1.Reader(data)); });
|
|
653
653
|
};
|
|
654
654
|
MsgClientImpl.prototype.Burn = function (request) {
|
|
655
655
|
var data = exports.MsgBurn.encode(request).finish();
|
|
656
|
-
var promise = this.rpc.request("firmachain.
|
|
656
|
+
var promise = this.rpc.request("firmachain.token.Msg", "Burn", data);
|
|
657
657
|
return promise.then(function (data) { return exports.MsgBurnResponse.decode(new minimal_1.Reader(data)); });
|
|
658
658
|
};
|
|
659
659
|
MsgClientImpl.prototype.UpdateTokenURI = function (request) {
|
|
660
660
|
var data = exports.MsgUpdateTokenURI.encode(request).finish();
|
|
661
|
-
var promise = this.rpc.request("firmachain.
|
|
661
|
+
var promise = this.rpc.request("firmachain.token.Msg", "UpdateTokenURI", data);
|
|
662
662
|
return promise.then(function (data) {
|
|
663
663
|
return exports.MsgUpdateTokenURIResponse.decode(new minimal_1.Reader(data));
|
|
664
664
|
});
|
|
@@ -41,19 +41,25 @@ var FirmaSDK_1 = require("../sdk/FirmaSDK");
|
|
|
41
41
|
var config_test_1 = require("./config_test");
|
|
42
42
|
describe('[00. Wallet Test]', function () {
|
|
43
43
|
var firma;
|
|
44
|
+
var aliceWallet;
|
|
44
45
|
beforeEach(function () {
|
|
45
|
-
|
|
46
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
47
|
+
return __generator(this, function (_a) {
|
|
48
|
+
switch (_a.label) {
|
|
49
|
+
case 0:
|
|
50
|
+
firma = new FirmaSDK_1.FirmaSDK(config_test_1.TestChainConfig);
|
|
51
|
+
return [4 /*yield*/, firma.Wallet.fromMnemonic(config_test_1.aliceMnemonic)];
|
|
52
|
+
case 1:
|
|
53
|
+
aliceWallet = _a.sent();
|
|
54
|
+
return [2 /*return*/];
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
});
|
|
46
58
|
});
|
|
47
59
|
it('fromMnemonic check', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
48
|
-
var wallet;
|
|
49
60
|
return __generator(this, function (_a) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
case 1:
|
|
53
|
-
wallet = _a.sent();
|
|
54
|
-
chai_1.expect(wallet.getMnemonic()).to.equal(config_test_1.aliceMnemonic);
|
|
55
|
-
return [2 /*return*/];
|
|
56
|
-
}
|
|
61
|
+
chai_1.expect(aliceWallet.getMnemonic()).to.equal(config_test_1.aliceMnemonic);
|
|
62
|
+
return [2 /*return*/];
|
|
57
63
|
});
|
|
58
64
|
}); });
|
|
59
65
|
it('Wallet.fromPrivateKey check', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -41,29 +41,49 @@ var FirmaSDK_1 = require("../sdk/FirmaSDK");
|
|
|
41
41
|
var config_test_1 = require("./config_test");
|
|
42
42
|
describe('[01. Contract Tx Test]', function () {
|
|
43
43
|
var firma;
|
|
44
|
+
var aliceWallet;
|
|
45
|
+
var aliceAddress;
|
|
46
|
+
var bobWallet;
|
|
47
|
+
var bobAddress;
|
|
44
48
|
beforeEach(function () {
|
|
45
|
-
|
|
49
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
50
|
+
return __generator(this, function (_a) {
|
|
51
|
+
switch (_a.label) {
|
|
52
|
+
case 0:
|
|
53
|
+
firma = new FirmaSDK_1.FirmaSDK(config_test_1.TestChainConfig);
|
|
54
|
+
return [4 /*yield*/, firma.Wallet.fromMnemonic(config_test_1.aliceMnemonic)];
|
|
55
|
+
case 1:
|
|
56
|
+
aliceWallet = _a.sent();
|
|
57
|
+
return [4 /*yield*/, aliceWallet.getAddress()];
|
|
58
|
+
case 2:
|
|
59
|
+
aliceAddress = _a.sent();
|
|
60
|
+
return [4 /*yield*/, firma.Wallet.fromMnemonic(config_test_1.bobMnemonic)];
|
|
61
|
+
case 3:
|
|
62
|
+
bobWallet = _a.sent();
|
|
63
|
+
return [4 /*yield*/, bobWallet.getAddress()];
|
|
64
|
+
case 4:
|
|
65
|
+
bobAddress = _a.sent();
|
|
66
|
+
return [2 /*return*/];
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
});
|
|
46
70
|
});
|
|
47
71
|
it('Contract getUnsignedTxAddContractLog X 3 and signAndBroadcast', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
48
|
-
var
|
|
72
|
+
var contractHash, timeStamp, eventName, ownerAddress, jsonString, tx, result;
|
|
49
73
|
return __generator(this, function (_a) {
|
|
50
74
|
switch (_a.label) {
|
|
51
|
-
case 0:
|
|
52
|
-
case 1:
|
|
53
|
-
wallet = _a.sent();
|
|
75
|
+
case 0:
|
|
54
76
|
contractHash = "0xsalkdjfasldkjf2";
|
|
55
77
|
timeStamp = Math.round(+new Date() / 1000);
|
|
56
78
|
;
|
|
57
79
|
eventName = "CreateContract";
|
|
58
|
-
|
|
59
|
-
case 2:
|
|
60
|
-
ownerAddress = _a.sent();
|
|
80
|
+
ownerAddress = aliceAddress;
|
|
61
81
|
jsonString = "{}";
|
|
62
|
-
return [4 /*yield*/, firma.Contract.getUnsignedTxAddContractLog(
|
|
63
|
-
case
|
|
82
|
+
return [4 /*yield*/, firma.Contract.getUnsignedTxAddContractLog(aliceWallet, contractHash, timeStamp, eventName, ownerAddress, jsonString)];
|
|
83
|
+
case 1:
|
|
64
84
|
tx = _a.sent();
|
|
65
|
-
return [4 /*yield*/, firma.Contract.signAndBroadcast(
|
|
66
|
-
case
|
|
85
|
+
return [4 /*yield*/, firma.Contract.signAndBroadcast(aliceWallet, [tx, tx, tx])];
|
|
86
|
+
case 2:
|
|
67
87
|
result = _a.sent();
|
|
68
88
|
chai_1.expect(result.code).equal(0);
|
|
69
89
|
return [2 /*return*/];
|
|
@@ -71,22 +91,18 @@ describe('[01. Contract Tx Test]', function () {
|
|
|
71
91
|
});
|
|
72
92
|
}); });
|
|
73
93
|
it('Contract addContractLog', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
74
|
-
var
|
|
94
|
+
var contractHash, timeStamp, eventName, ownerAddress, jsonString, result;
|
|
75
95
|
return __generator(this, function (_a) {
|
|
76
96
|
switch (_a.label) {
|
|
77
|
-
case 0:
|
|
78
|
-
case 1:
|
|
79
|
-
wallet = _a.sent();
|
|
97
|
+
case 0:
|
|
80
98
|
contractHash = "0xsalkdjfasldkjf2";
|
|
81
99
|
timeStamp = Math.round(+new Date() / 1000);
|
|
82
100
|
;
|
|
83
101
|
eventName = "CreateContract";
|
|
84
|
-
|
|
85
|
-
case 2:
|
|
86
|
-
ownerAddress = _a.sent();
|
|
102
|
+
ownerAddress = aliceAddress;
|
|
87
103
|
jsonString = "{}";
|
|
88
|
-
return [4 /*yield*/, firma.Contract.addContractLog(
|
|
89
|
-
case
|
|
104
|
+
return [4 /*yield*/, firma.Contract.addContractLog(aliceWallet, contractHash, timeStamp, eventName, ownerAddress, jsonString)];
|
|
105
|
+
case 1:
|
|
90
106
|
result = _a.sent();
|
|
91
107
|
chai_1.expect(result.code).equal(0);
|
|
92
108
|
return [2 /*return*/];
|
|
@@ -94,30 +110,26 @@ describe('[01. Contract Tx Test]', function () {
|
|
|
94
110
|
});
|
|
95
111
|
}); });
|
|
96
112
|
it('Contract getUnsignedTxCreateContractFile x3 signAndBroadcast', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
97
|
-
var
|
|
113
|
+
var timeStamp, fileHash, ownerAddress, ownerList, jsonString, tx1, tx2, tx3, result;
|
|
98
114
|
return __generator(this, function (_a) {
|
|
99
115
|
switch (_a.label) {
|
|
100
|
-
case 0:
|
|
101
|
-
case 1:
|
|
102
|
-
wallet = _a.sent();
|
|
116
|
+
case 0:
|
|
103
117
|
timeStamp = Math.round(+new Date() / 1000);
|
|
104
118
|
fileHash = "0xklsdjflaksjflaksjf" + timeStamp;
|
|
105
|
-
|
|
106
|
-
case 2:
|
|
107
|
-
ownerAddress = _a.sent();
|
|
119
|
+
ownerAddress = aliceAddress;
|
|
108
120
|
ownerList = [ownerAddress, ownerAddress];
|
|
109
121
|
jsonString = "{}";
|
|
110
|
-
return [4 /*yield*/, firma.Contract.getUnsignedTxCreateContractFile(
|
|
111
|
-
case
|
|
122
|
+
return [4 /*yield*/, firma.Contract.getUnsignedTxCreateContractFile(aliceWallet, fileHash, timeStamp, ownerList, jsonString)];
|
|
123
|
+
case 1:
|
|
112
124
|
tx1 = _a.sent();
|
|
113
|
-
return [4 /*yield*/, firma.Contract.getUnsignedTxCreateContractFile(
|
|
114
|
-
case
|
|
125
|
+
return [4 /*yield*/, firma.Contract.getUnsignedTxCreateContractFile(aliceWallet, fileHash + "a", timeStamp, ownerList, jsonString)];
|
|
126
|
+
case 2:
|
|
115
127
|
tx2 = _a.sent();
|
|
116
|
-
return [4 /*yield*/, firma.Contract.getUnsignedTxCreateContractFile(
|
|
117
|
-
case
|
|
128
|
+
return [4 /*yield*/, firma.Contract.getUnsignedTxCreateContractFile(aliceWallet, fileHash + "b", timeStamp, ownerList, jsonString)];
|
|
129
|
+
case 3:
|
|
118
130
|
tx3 = _a.sent();
|
|
119
|
-
return [4 /*yield*/, firma.Contract.signAndBroadcast(
|
|
120
|
-
case
|
|
131
|
+
return [4 /*yield*/, firma.Contract.signAndBroadcast(aliceWallet, [tx1, tx2, tx3])];
|
|
132
|
+
case 4:
|
|
121
133
|
result = _a.sent();
|
|
122
134
|
chai_1.expect(result.code).equal(0);
|
|
123
135
|
return [2 /*return*/];
|
|
@@ -125,21 +137,17 @@ describe('[01. Contract Tx Test]', function () {
|
|
|
125
137
|
});
|
|
126
138
|
}); });
|
|
127
139
|
it('Contract createContractFile', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
128
|
-
var
|
|
140
|
+
var timeStamp, fileHash, ownerAddress, ownerList, jsonString, result;
|
|
129
141
|
return __generator(this, function (_a) {
|
|
130
142
|
switch (_a.label) {
|
|
131
|
-
case 0:
|
|
132
|
-
case 1:
|
|
133
|
-
wallet = _a.sent();
|
|
143
|
+
case 0:
|
|
134
144
|
timeStamp = Math.round(+new Date() / 1000);
|
|
135
145
|
fileHash = "0xklsdjflaksjflaksjf" + timeStamp;
|
|
136
|
-
|
|
137
|
-
case 2:
|
|
138
|
-
ownerAddress = _a.sent();
|
|
146
|
+
ownerAddress = aliceAddress;
|
|
139
147
|
ownerList = [ownerAddress, ownerAddress];
|
|
140
148
|
jsonString = "{}";
|
|
141
|
-
return [4 /*yield*/, firma.Contract.createContractFile(
|
|
142
|
-
case
|
|
149
|
+
return [4 /*yield*/, firma.Contract.createContractFile(aliceWallet, fileHash, timeStamp, ownerList, jsonString)];
|
|
150
|
+
case 1:
|
|
143
151
|
result = _a.sent();
|
|
144
152
|
chai_1.expect(result.code).equal(0);
|
|
145
153
|
return [2 /*return*/];
|