@initia/initia.js 0.1.0 → 0.1.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/package.json +1 -1
- package/dist/client/lcd/LCDUtils.d.ts +0 -18
- package/dist/client/lcd/LCDUtils.js +0 -93
- package/dist/client/lcd/LCDUtils.js.map +0 -1
- package/dist/client/lcd/api/MintAPI.d.ts +0 -27
- package/dist/client/lcd/api/MintAPI.js +0 -109
- package/dist/client/lcd/api/MintAPI.js.map +0 -1
- package/dist/client/lcd/api/StakingAPI.d.ts +0 -100
- package/dist/client/lcd/api/StakingAPI.js +0 -297
- package/dist/client/lcd/api/StakingAPI.js.map +0 -1
- package/dist/core/CompactBitArray.d.ts +0 -23
- package/dist/core/CompactBitArray.js +0 -94
- package/dist/core/CompactBitArray.js.map +0 -1
- package/dist/core/Deposit.d.ts +0 -37
- package/dist/core/Deposit.js +0 -81
- package/dist/core/Deposit.js.map +0 -1
- package/dist/core/Fee.d.ts +0 -42
- package/dist/core/Fee.js +0 -88
- package/dist/core/Fee.js.map +0 -1
- package/dist/core/MultiSignature.d.ts +0 -17
- package/dist/core/MultiSignature.js +0 -57
- package/dist/core/MultiSignature.js.map +0 -1
- package/dist/core/SignDoc.d.ts +0 -54
- package/dist/core/SignDoc.js +0 -96
- package/dist/core/SignDoc.js.map +0 -1
- package/dist/core/SignatureV2.d.ts +0 -66
- package/dist/core/SignatureV2.js +0 -131
- package/dist/core/SignatureV2.js.map +0 -1
- package/dist/core/Tx.d.ts +0 -147
- package/dist/core/Tx.js +0 -279
- package/dist/core/Tx.js.map +0 -1
- package/dist/core/TxInfo.d.ts +0 -91
- package/dist/core/TxInfo.js +0 -115
- package/dist/core/TxInfo.js.map +0 -1
- package/dist/core/ValidatorSet.d.ts +0 -11
- package/dist/core/ValidatorSet.js +0 -3
- package/dist/core/ValidatorSet.js.map +0 -1
- package/dist/core/auth/BaseVestingAccount.d.ts +0 -58
- package/dist/core/auth/BaseVestingAccount.js +0 -123
- package/dist/core/auth/BaseVestingAccount.js.map +0 -1
- package/dist/core/auth/ContinuousVestingAccount.d.ts +0 -45
- package/dist/core/auth/ContinuousVestingAccount.js +0 -116
- package/dist/core/auth/ContinuousVestingAccount.js.map +0 -1
- package/dist/core/auth/DelayedVestingAccount.d.ts +0 -42
- package/dist/core/auth/DelayedVestingAccount.js +0 -108
- package/dist/core/auth/DelayedVestingAccount.js.map +0 -1
- package/dist/core/auth/PeriodicVestingAccount.d.ts +0 -72
- package/dist/core/auth/PeriodicVestingAccount.js +0 -170
- package/dist/core/auth/PeriodicVestingAccount.js.map +0 -1
- package/dist/core/crisis/MsgVerifyInvariant.d.ts +0 -43
- package/dist/core/crisis/MsgVerifyInvariant.js +0 -77
- package/dist/core/crisis/MsgVerifyInvariant.js.map +0 -1
- package/dist/core/distribution/proposals/CommunityPoolSpendProposal.d.ts +0 -49
- package/dist/core/distribution/proposals/CommunityPoolSpendProposal.js +0 -97
- package/dist/core/distribution/proposals/CommunityPoolSpendProposal.js.map +0 -1
- package/dist/core/distribution/proposals/index.d.ts +0 -1
- package/dist/core/distribution/proposals/index.js +0 -18
- package/dist/core/distribution/proposals/index.js.map +0 -1
- package/dist/core/gov/Proposal.d.ts +0 -96
- package/dist/core/gov/Proposal.js +0 -244
- package/dist/core/gov/Proposal.js.map +0 -1
- package/dist/core/ibc/applications/fee/msgs/MsgRegisterCounterpartAddress.d.ts +0 -34
- package/dist/core/ibc/applications/fee/msgs/MsgRegisterCounterpartAddress.js +0 -82
- package/dist/core/ibc/applications/fee/msgs/MsgRegisterCounterpartAddress.js.map +0 -1
- package/dist/core/ibc/applications/nft-transfer/ClassTrace.d.ts +0 -28
- package/dist/core/ibc/applications/nft-transfer/ClassTrace.js +0 -67
- package/dist/core/ibc/applications/nft-transfer/ClassTrace.js.map +0 -1
- package/dist/core/ibc/core/connection/Version.d.ts +0 -28
- package/dist/core/ibc/core/connection/Version.js +0 -70
- package/dist/core/ibc/core/connection/Version.js.map +0 -1
- package/dist/core/move/StorageFee.d.ts +0 -34
- package/dist/core/move/StorageFee.js +0 -78
- package/dist/core/move/StorageFee.js.map +0 -1
- package/dist/core/move/proposals/DelistProposal.d.ts +0 -50
- package/dist/core/move/proposals/DelistProposal.js +0 -100
- package/dist/core/move/proposals/DelistProposal.js.map +0 -1
- package/dist/core/move/proposals/ExecuteOperation.d.ts +0 -51
- package/dist/core/move/proposals/ExecuteOperation.js +0 -100
- package/dist/core/move/proposals/ExecuteOperation.js.map +0 -1
- package/dist/core/move/proposals/ExecuteProposal.d.ts +0 -54
- package/dist/core/move/proposals/ExecuteProposal.js +0 -105
- package/dist/core/move/proposals/ExecuteProposal.js.map +0 -1
- package/dist/core/move/proposals/OperationsProposal.d.ts +0 -57
- package/dist/core/move/proposals/OperationsProposal.js +0 -129
- package/dist/core/move/proposals/OperationsProposal.js.map +0 -1
- package/dist/core/move/proposals/PublishOperation.d.ts +0 -34
- package/dist/core/move/proposals/PublishOperation.js +0 -76
- package/dist/core/move/proposals/PublishOperation.js.map +0 -1
- package/dist/core/move/proposals/PublishProposal.d.ts +0 -42
- package/dist/core/move/proposals/PublishProposal.js +0 -90
- package/dist/core/move/proposals/PublishProposal.js.map +0 -1
- package/dist/core/move/proposals/WhitelistProposal.d.ts +0 -54
- package/dist/core/move/proposals/WhitelistProposal.js +0 -105
- package/dist/core/move/proposals/WhitelistProposal.js.map +0 -1
- package/dist/core/move/proposals/index.d.ts +0 -5
- package/dist/core/move/proposals/index.js +0 -22
- package/dist/core/move/proposals/index.js.map +0 -1
- package/dist/core/staking/Delegation.d.ts +0 -45
- package/dist/core/staking/Delegation.js +0 -89
- package/dist/core/staking/Delegation.js.map +0 -1
- package/dist/core/staking/Redelegation.d.ts +0 -97
- package/dist/core/staking/Redelegation.js +0 -174
- package/dist/core/staking/Redelegation.js.map +0 -1
- package/dist/core/staking/UnbondingDelegation.d.ts +0 -75
- package/dist/core/staking/UnbondingDelegation.js +0 -143
- package/dist/core/staking/UnbondingDelegation.js.map +0 -1
- package/dist/core/staking/Validator.d.ts +0 -173
- package/dist/core/staking/Validator.js +0 -287
- package/dist/core/staking/Validator.js.map +0 -1
- package/dist/core/staking/msgs/MsgBeginRedelegate.d.ts +0 -51
- package/dist/core/staking/msgs/MsgBeginRedelegate.js +0 -99
- package/dist/core/staking/msgs/MsgBeginRedelegate.js.map +0 -1
- package/dist/core/staking/msgs/MsgCreateValidator.d.ts +0 -60
- package/dist/core/staking/msgs/MsgCreateValidator.js +0 -110
- package/dist/core/staking/msgs/MsgCreateValidator.js.map +0 -1
- package/dist/core/staking/msgs/MsgDelegate.d.ts +0 -46
- package/dist/core/staking/msgs/MsgDelegate.js +0 -93
- package/dist/core/staking/msgs/MsgDelegate.js.map +0 -1
- package/dist/core/staking/msgs/MsgEditValidator.d.ts +0 -50
- package/dist/core/staking/msgs/MsgEditValidator.js +0 -111
- package/dist/core/staking/msgs/MsgEditValidator.js.map +0 -1
- package/dist/core/staking/msgs/MsgUndelegate.d.ts +0 -46
- package/dist/core/staking/msgs/MsgUndelegate.js +0 -93
- package/dist/core/staking/msgs/MsgUndelegate.js.map +0 -1
- package/dist/core/staking/msgs/index.d.ts +0 -16
- package/dist/core/staking/msgs/index.js +0 -22
- package/dist/core/staking/msgs/index.js.map +0 -1
- package/dist/core/upgrade/proposals/CancelSoftwareUpgradeProposal.d.ts +0 -39
- package/dist/core/upgrade/proposals/CancelSoftwareUpgradeProposal.js +0 -86
- package/dist/core/upgrade/proposals/CancelSoftwareUpgradeProposal.js.map +0 -1
- package/dist/core/upgrade/proposals/SoftwareUpgradeProposal.d.ts +0 -44
- package/dist/core/upgrade/proposals/SoftwareUpgradeProposal.js +0 -92
- package/dist/core/upgrade/proposals/SoftwareUpgradeProposal.js.map +0 -1
- package/dist/core/upgrade/proposals/index.d.ts +0 -2
- package/dist/core/upgrade/proposals/index.js +0 -19
- package/dist/core/upgrade/proposals/index.js.map +0 -1
- package/dist/core/vesting/Period.d.ts +0 -32
- package/dist/core/vesting/Period.js +0 -78
- package/dist/core/vesting/Period.js.map +0 -1
- package/dist/core/vesting/index.d.ts +0 -2
- package/dist/core/vesting/index.js +0 -19
- package/dist/core/vesting/index.js.map +0 -1
- package/dist/core/vesting/msgs/MsgCreateVestingAccount.d.ts +0 -50
- package/dist/core/vesting/msgs/MsgCreateVestingAccount.js +0 -103
- package/dist/core/vesting/msgs/MsgCreateVestingAccount.js.map +0 -1
- package/dist/core/vesting/msgs/index.d.ts +0 -8
- package/dist/core/vesting/msgs/index.js +0 -18
- package/dist/core/vesting/msgs/index.js.map +0 -1
- package/dist/util/contract.d.ts +0 -9
- package/dist/util/contract.js +0 -57
- package/dist/util/contract.js.map +0 -1
- package/dist/util/convert.d.ts +0 -8
- package/dist/util/convert.js +0 -12
- package/dist/util/convert.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StakingAPI.js","sourceRoot":"","sources":["../../../../src/client/lcd/api/StakingAPI.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sCAKuB;AACvB,qCAAoC;AACpC,+DAA8D;AAC9D,6DAA4D;AAC5D,mEAAkE;AAgDlE;IAAgC,8BAAO;IAAvC;;IAiPA,CAAC;IAhPC;;;;;;OAMG;IACU,gCAAW,GAAxB,UACE,SAAsB,EACtB,SAAsB,EACtB,MAAmD;QAAnD,uBAAA,EAAA,WAAmD;;;gBAEnD,IAAI,SAAS,KAAK,SAAS,IAAI,SAAS,KAAK,SAAS,EAAE;oBACtD,sBAAO,IAAI,CAAC,CAAC;6BACV,GAAG,CACF,yCAAkC,SAAS,0BAAgB,SAAS,CAAE,EACtE,MAAM,CACP;6BACA,IAAI,CAAC,UAAC,EAA6B;gCAAN,IAAI,yBAAA;4BAAO,OAAA;gCACvC,CAAC,uBAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;gCAC3B,EAAE,KAAK,EAA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AAjPY,gCAAU"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { CompactBitArray as CompactBitArray_pb } from '@initia/initia.proto/cosmos/crypto/multisig/v1beta1/multisig';
|
|
3
|
-
export declare class CompactBitArray {
|
|
4
|
-
extra_bits_stored: number;
|
|
5
|
-
elems: Buffer;
|
|
6
|
-
constructor(extra_bits_stored: number, elems: Buffer);
|
|
7
|
-
static fromBits(bits: number): CompactBitArray;
|
|
8
|
-
count(): number;
|
|
9
|
-
getIndex(i: number): boolean;
|
|
10
|
-
setIndex(i: number, v: boolean): boolean;
|
|
11
|
-
numTrueBitsBefore(index: number): number;
|
|
12
|
-
static fromData(data: CompactBitArray.Data): CompactBitArray;
|
|
13
|
-
toData(): CompactBitArray.Data;
|
|
14
|
-
static fromProto(proto: CompactBitArray.Proto): CompactBitArray;
|
|
15
|
-
toProto(): CompactBitArray.Proto;
|
|
16
|
-
}
|
|
17
|
-
export declare namespace CompactBitArray {
|
|
18
|
-
interface Data {
|
|
19
|
-
extra_bits_stored: number;
|
|
20
|
-
elems: string;
|
|
21
|
-
}
|
|
22
|
-
type Proto = CompactBitArray_pb;
|
|
23
|
-
}
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CompactBitArray = void 0;
|
|
4
|
-
var multisig_1 = require("@initia/initia.proto/cosmos/crypto/multisig/v1beta1/multisig");
|
|
5
|
-
var CompactBitArray = /** @class */ (function () {
|
|
6
|
-
function CompactBitArray(extra_bits_stored, elems) {
|
|
7
|
-
this.extra_bits_stored = extra_bits_stored;
|
|
8
|
-
this.elems = elems;
|
|
9
|
-
}
|
|
10
|
-
CompactBitArray.fromBits = function (bits) {
|
|
11
|
-
if (bits <= 0) {
|
|
12
|
-
throw new Error('CompactBitArray bits must be bigger than 0');
|
|
13
|
-
}
|
|
14
|
-
var num_elems = (bits + 7) / 8;
|
|
15
|
-
if (num_elems <= 0 || num_elems > Math.pow(2, 32) - 1) {
|
|
16
|
-
// We encountered an overflow here, and shouldn't pass negatives
|
|
17
|
-
// to make, nor should we allow unreasonable limits > maxint32.
|
|
18
|
-
// See https://github.com/cosmos/cosmos-sdk/issues/9162
|
|
19
|
-
throw new Error('CompactBitArray overflow');
|
|
20
|
-
}
|
|
21
|
-
return new CompactBitArray(bits % 8, Buffer.alloc(num_elems));
|
|
22
|
-
};
|
|
23
|
-
// returns the number of bits in the bitarray
|
|
24
|
-
CompactBitArray.prototype.count = function () {
|
|
25
|
-
if (this.extra_bits_stored == 0) {
|
|
26
|
-
return this.elems.length * 8;
|
|
27
|
-
}
|
|
28
|
-
return (this.elems.length - 1) * 8 + this.extra_bits_stored;
|
|
29
|
-
};
|
|
30
|
-
// returns true if the bit at index i is set; returns false otherwise.
|
|
31
|
-
// The behavior is undefined if i >= bA.Count()
|
|
32
|
-
CompactBitArray.prototype.getIndex = function (i) {
|
|
33
|
-
if (i < 0 || i >= this.count()) {
|
|
34
|
-
return false;
|
|
35
|
-
}
|
|
36
|
-
return (this.elems.readUInt8(i >> 3) & (1 << (7 - (i % 8)))) > 0;
|
|
37
|
-
};
|
|
38
|
-
// sets the bit at index i within the bit array. Returns true if and only if the
|
|
39
|
-
// operation succeeded. The behavior is undefined if i >= bA.Count()
|
|
40
|
-
CompactBitArray.prototype.setIndex = function (i, v) {
|
|
41
|
-
if (i < 0 || i >= this.count()) {
|
|
42
|
-
return false;
|
|
43
|
-
}
|
|
44
|
-
if (v) {
|
|
45
|
-
this.elems[i >> 3] |= 1 << (7 - (i % 8));
|
|
46
|
-
}
|
|
47
|
-
else {
|
|
48
|
-
this.elems[i >> 3] &= ~(1 << (7 - (i % 8)));
|
|
49
|
-
}
|
|
50
|
-
return true;
|
|
51
|
-
};
|
|
52
|
-
// returns the number of bits set to true before the
|
|
53
|
-
// given index. e.g. if bA = _XX__XX, NumOfTrueBitsBefore(4) = 2, since
|
|
54
|
-
// there are two bits set to true before index 4.
|
|
55
|
-
CompactBitArray.prototype.numTrueBitsBefore = function (index) {
|
|
56
|
-
var countOneBits = function (n) {
|
|
57
|
-
return n.toString(2).split('0').join('').length;
|
|
58
|
-
};
|
|
59
|
-
var ones_count = 0;
|
|
60
|
-
var max = this.count();
|
|
61
|
-
if (index > max) {
|
|
62
|
-
index = max;
|
|
63
|
-
}
|
|
64
|
-
// below we iterate over the bytes then over bits (in low endian) and count bits set to 1
|
|
65
|
-
for (var elem = 0;; elem++) {
|
|
66
|
-
if (elem * 8 + 7 >= index) {
|
|
67
|
-
ones_count += countOneBits(this.elems[elem] >> (7 - (index % 8) + 1));
|
|
68
|
-
return ones_count;
|
|
69
|
-
}
|
|
70
|
-
ones_count += countOneBits(this.elems[elem]);
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
CompactBitArray.fromData = function (data) {
|
|
74
|
-
return new CompactBitArray(data.extra_bits_stored, Buffer.from(data.elems, 'base64'));
|
|
75
|
-
};
|
|
76
|
-
CompactBitArray.prototype.toData = function () {
|
|
77
|
-
return {
|
|
78
|
-
elems: this.elems.toString('base64'),
|
|
79
|
-
extra_bits_stored: this.extra_bits_stored,
|
|
80
|
-
};
|
|
81
|
-
};
|
|
82
|
-
CompactBitArray.fromProto = function (proto) {
|
|
83
|
-
return new CompactBitArray(proto.extraBitsStored, Buffer.from(proto.elems));
|
|
84
|
-
};
|
|
85
|
-
CompactBitArray.prototype.toProto = function () {
|
|
86
|
-
return multisig_1.CompactBitArray.fromPartial({
|
|
87
|
-
elems: this.elems,
|
|
88
|
-
extraBitsStored: this.extra_bits_stored,
|
|
89
|
-
});
|
|
90
|
-
};
|
|
91
|
-
return CompactBitArray;
|
|
92
|
-
}());
|
|
93
|
-
exports.CompactBitArray = CompactBitArray;
|
|
94
|
-
//# sourceMappingURL=CompactBitArray.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CompactBitArray.js","sourceRoot":"","sources":["../../src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IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;gBACtE,OAAO,UAAU,CAAC;aACnB;YACD,UAAU,IAAI,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;SAC9C;IACH,CAAC;IAEa,wBAAQ,GAAtB,UAAuB,IAA0B;QAC/C,OAAO,IAAI,eAAe,CACxB,IAAI,CAAC,iBAAiB,EACtB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAClC,CAAC;IACJ,CAAC;IAEM,gCAAM,GAAb;QACE,OAAO;YACL,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC;YACpC,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;SAC1C,CAAC;IACJ,CAAC;IAEa,yBAAS,GAAvB,UAAwB,KAA4B;QAClD,OAAO,IAAI,eAAe,CAAC,KAAK,CAAC,eAAe,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;IAC9E,CAAC;IAEM,iCAAO,GAAd;QACE,OAAO,0BAAkB,CAAC,WAAW,CAAC;YACpC,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,eAAe,EAAE,IAAI,CAAC,iBAAiB;SACxC,CAAC,CAAC;IACL,CAAC;IACH,sBAAC;AAAD,CAAC,AArGD,IAqGC;AArGY,0CAAe"}
|
package/dist/core/Deposit.d.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { Coins } from './Coins';
|
|
2
|
-
import { JSONSerializable } from '../util/json';
|
|
3
|
-
import { AccAddress } from './bech32';
|
|
4
|
-
import { Deposit as Deposit_pb } from '@initia/initia.proto/cosmos/gov/v1beta1/gov';
|
|
5
|
-
/**
|
|
6
|
-
* Stores deposit information for a proposal
|
|
7
|
-
*/
|
|
8
|
-
export declare class Deposit extends JSONSerializable<Deposit.Amino, Deposit.Data, Deposit.Proto> {
|
|
9
|
-
proposal_id: number;
|
|
10
|
-
depositor: AccAddress;
|
|
11
|
-
amount: Coins;
|
|
12
|
-
/**
|
|
13
|
-
* @param proposal_id Id of porposal to deposit to
|
|
14
|
-
* @param depositor depositor's account address
|
|
15
|
-
* @param amount amount to deposit
|
|
16
|
-
*/
|
|
17
|
-
constructor(proposal_id: number, depositor: AccAddress, amount: Coins.Input);
|
|
18
|
-
static fromAmino(data: Deposit.Amino): Deposit;
|
|
19
|
-
toAmino(): Deposit.Amino;
|
|
20
|
-
static fromData(data: Deposit.Data): Deposit;
|
|
21
|
-
toData(): Deposit.Data;
|
|
22
|
-
static fromProto(data: Deposit.Proto): Deposit;
|
|
23
|
-
toProto(): Deposit.Proto;
|
|
24
|
-
}
|
|
25
|
-
export declare namespace Deposit {
|
|
26
|
-
interface Amino {
|
|
27
|
-
proposal_id: string;
|
|
28
|
-
depositor: AccAddress;
|
|
29
|
-
amount: Coins.Amino;
|
|
30
|
-
}
|
|
31
|
-
interface Data {
|
|
32
|
-
proposal_id: string;
|
|
33
|
-
depositor: AccAddress;
|
|
34
|
-
amount: Coins.Data;
|
|
35
|
-
}
|
|
36
|
-
type Proto = Deposit_pb;
|
|
37
|
-
}
|
package/dist/core/Deposit.js
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
|
-
};
|
|
20
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.Deposit = void 0;
|
|
22
|
-
var Coins_1 = require("./Coins");
|
|
23
|
-
var json_1 = require("../util/json");
|
|
24
|
-
var gov_1 = require("@initia/initia.proto/cosmos/gov/v1beta1/gov");
|
|
25
|
-
var long_1 = __importDefault(require("long"));
|
|
26
|
-
/**
|
|
27
|
-
* Stores deposit information for a proposal
|
|
28
|
-
*/
|
|
29
|
-
var Deposit = /** @class */ (function (_super) {
|
|
30
|
-
__extends(Deposit, _super);
|
|
31
|
-
/**
|
|
32
|
-
* @param proposal_id Id of porposal to deposit to
|
|
33
|
-
* @param depositor depositor's account address
|
|
34
|
-
* @param amount amount to deposit
|
|
35
|
-
*/
|
|
36
|
-
function Deposit(proposal_id, depositor, amount) {
|
|
37
|
-
var _this = _super.call(this) || this;
|
|
38
|
-
_this.proposal_id = proposal_id;
|
|
39
|
-
_this.depositor = depositor;
|
|
40
|
-
_this.amount = new Coins_1.Coins(amount);
|
|
41
|
-
return _this;
|
|
42
|
-
}
|
|
43
|
-
Deposit.fromAmino = function (data) {
|
|
44
|
-
var proposal_id = data.proposal_id, depositor = data.depositor, amount = data.amount;
|
|
45
|
-
return new Deposit(Number.parseInt(proposal_id), depositor, Coins_1.Coins.fromAmino(amount));
|
|
46
|
-
};
|
|
47
|
-
Deposit.prototype.toAmino = function () {
|
|
48
|
-
var _a = this, proposal_id = _a.proposal_id, depositor = _a.depositor, amount = _a.amount;
|
|
49
|
-
return {
|
|
50
|
-
proposal_id: proposal_id.toString(),
|
|
51
|
-
depositor: depositor,
|
|
52
|
-
amount: amount.toAmino(),
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
Deposit.fromData = function (data) {
|
|
56
|
-
var proposal_id = data.proposal_id, depositor = data.depositor, amount = data.amount;
|
|
57
|
-
return new Deposit(Number.parseInt(proposal_id), depositor, Coins_1.Coins.fromData(amount));
|
|
58
|
-
};
|
|
59
|
-
Deposit.prototype.toData = function () {
|
|
60
|
-
var _a = this, proposal_id = _a.proposal_id, depositor = _a.depositor, amount = _a.amount;
|
|
61
|
-
return {
|
|
62
|
-
proposal_id: proposal_id.toString(),
|
|
63
|
-
depositor: depositor,
|
|
64
|
-
amount: amount.toData(),
|
|
65
|
-
};
|
|
66
|
-
};
|
|
67
|
-
Deposit.fromProto = function (data) {
|
|
68
|
-
return new Deposit(data.proposalId.toNumber(), data.depositor, Coins_1.Coins.fromProto(data.amount));
|
|
69
|
-
};
|
|
70
|
-
Deposit.prototype.toProto = function () {
|
|
71
|
-
var _a = this, proposal_id = _a.proposal_id, depositor = _a.depositor, amount = _a.amount;
|
|
72
|
-
return gov_1.Deposit.fromPartial({
|
|
73
|
-
proposalId: long_1.default.fromNumber(proposal_id),
|
|
74
|
-
depositor: depositor,
|
|
75
|
-
amount: amount.toProto(),
|
|
76
|
-
});
|
|
77
|
-
};
|
|
78
|
-
return Deposit;
|
|
79
|
-
}(json_1.JSONSerializable));
|
|
80
|
-
exports.Deposit = Deposit;
|
|
81
|
-
//# sourceMappingURL=Deposit.js.map
|
package/dist/core/Deposit.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Deposit.js","sourceRoot":"","sources":["../../src/core/Deposit.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,iCAAgC;AAChC,qCAAgD;AAEhD,mEAAoF;AACpF,8CAAwB;AAExB;;GAEG;AACH;IAA6B,2BAI5B;IAEC;;;;OAIG;IACH,iBACS,WAAm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,EAAE;SACxB,CAAC;IACJ,CAAC;IAEa,iBAAS,GAAvB,UAAwB,IAAmB;QACzC,OAAO,IAAI,OAAO,CAChB,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,EAC1B,IAAI,CAAC,SAAS,EACd,aAAK,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAC7B,CAAC;IACJ,CAAC;IAEM,yBAAO,GAAd;QACQ,IAAA,KAAqC,IAAI,EAAvC,WAAW,iBAAA,EAAE,SAAS,eAAA,EAAE,MAAM,YAAS,CAAC;QAChD,OAAO,aAAU,CAAC,WAAW,CAAC;YAC5B,UAAU,EAAE,cAAI,CAAC,UAAU,CAAC,WAAW,CAAC;YACxC,SAAS,EAAE,SAAS;YACpB,MAAM,EAAE,MAAM,CAAC,OAAO,EAAE;SACzB,CAAC,CAAC;IACL,CAAC;IACH,cAAC;AAAD,CAAC,AAxED,CAA6B,uBAAgB,GAwE5C;AAxEY,0BAAO"}
|
package/dist/core/Fee.d.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { JSONSerializable } from '../util/json';
|
|
2
|
-
import { Coins } from './Coins';
|
|
3
|
-
import { Fee as Fee_pb } from '@initia/initia.proto/cosmos/tx/v1beta1/tx';
|
|
4
|
-
/**
|
|
5
|
-
* A transaction must include a fee, otherwise it will be rejected.
|
|
6
|
-
*/
|
|
7
|
-
export declare class Fee extends JSONSerializable<Fee.Amino, Fee.Data, Fee.Proto> {
|
|
8
|
-
readonly gas_limit: number;
|
|
9
|
-
payer?: string | undefined;
|
|
10
|
-
granter?: string | undefined;
|
|
11
|
-
/** Fee amount to be paid */
|
|
12
|
-
readonly amount: Coins;
|
|
13
|
-
/**
|
|
14
|
-
* Creates a new Fee object.
|
|
15
|
-
* @param gas gas limit
|
|
16
|
-
* @param amount amount to be paid to validator
|
|
17
|
-
*/
|
|
18
|
-
constructor(gas_limit: number, amount: Coins.Input, payer?: string | undefined, granter?: string | undefined);
|
|
19
|
-
static fromAmino(data: Fee.Amino): Fee;
|
|
20
|
-
toAmino(): Fee.Amino;
|
|
21
|
-
static fromData(data: Fee.Data): Fee;
|
|
22
|
-
toData(): Fee.Data;
|
|
23
|
-
static fromProto(proto: Fee.Proto): Fee;
|
|
24
|
-
toProto(): Fee.Proto;
|
|
25
|
-
/**
|
|
26
|
-
* Gets the minimum gas prices implied by the fee. Minimum gas prices are `fee amount / gas`.
|
|
27
|
-
*/
|
|
28
|
-
gasPrices(): Coins;
|
|
29
|
-
}
|
|
30
|
-
export declare namespace Fee {
|
|
31
|
-
interface Amino {
|
|
32
|
-
gas: string;
|
|
33
|
-
amount: Coins.Amino;
|
|
34
|
-
}
|
|
35
|
-
interface Data {
|
|
36
|
-
gas_limit: string;
|
|
37
|
-
payer: string;
|
|
38
|
-
granter: string;
|
|
39
|
-
amount: Coins.Data;
|
|
40
|
-
}
|
|
41
|
-
type Proto = Fee_pb;
|
|
42
|
-
}
|
package/dist/core/Fee.js
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
|
-
};
|
|
20
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.Fee = void 0;
|
|
22
|
-
var json_1 = require("../util/json");
|
|
23
|
-
var Coins_1 = require("./Coins");
|
|
24
|
-
var num_1 = require("./num");
|
|
25
|
-
var tx_1 = require("@initia/initia.proto/cosmos/tx/v1beta1/tx");
|
|
26
|
-
var long_1 = __importDefault(require("long"));
|
|
27
|
-
/**
|
|
28
|
-
* A transaction must include a fee, otherwise it will be rejected.
|
|
29
|
-
*/
|
|
30
|
-
var Fee = /** @class */ (function (_super) {
|
|
31
|
-
__extends(Fee, _super);
|
|
32
|
-
/**
|
|
33
|
-
* Creates a new Fee object.
|
|
34
|
-
* @param gas gas limit
|
|
35
|
-
* @param amount amount to be paid to validator
|
|
36
|
-
*/
|
|
37
|
-
function Fee(gas_limit, amount, payer, granter) {
|
|
38
|
-
var _this = _super.call(this) || this;
|
|
39
|
-
_this.gas_limit = gas_limit;
|
|
40
|
-
_this.payer = payer;
|
|
41
|
-
_this.granter = granter;
|
|
42
|
-
_this.amount = new Coins_1.Coins(amount);
|
|
43
|
-
return _this;
|
|
44
|
-
}
|
|
45
|
-
Fee.fromAmino = function (data) {
|
|
46
|
-
var gas = data.gas, amount = data.amount;
|
|
47
|
-
return new Fee(Number.parseInt(gas), Coins_1.Coins.fromAmino(amount), '', '');
|
|
48
|
-
};
|
|
49
|
-
Fee.prototype.toAmino = function () {
|
|
50
|
-
return {
|
|
51
|
-
gas: (0, num_1.num)(this.gas_limit).toFixed(0),
|
|
52
|
-
amount: this.amount.toAmino(),
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
Fee.fromData = function (data) {
|
|
56
|
-
return new Fee(Number.parseInt(data.gas_limit), Coins_1.Coins.fromData(data.amount), data.payer, data.granter);
|
|
57
|
-
};
|
|
58
|
-
Fee.prototype.toData = function () {
|
|
59
|
-
var _a = this, amount = _a.amount, gas_limit = _a.gas_limit, payer = _a.payer, granter = _a.granter;
|
|
60
|
-
return {
|
|
61
|
-
amount: amount.toData(),
|
|
62
|
-
gas_limit: gas_limit.toFixed(),
|
|
63
|
-
granter: granter !== null && granter !== void 0 ? granter : '',
|
|
64
|
-
payer: payer !== null && payer !== void 0 ? payer : '',
|
|
65
|
-
};
|
|
66
|
-
};
|
|
67
|
-
Fee.fromProto = function (proto) {
|
|
68
|
-
return new Fee(proto.gasLimit.toNumber(), Coins_1.Coins.fromProto(proto.amount), proto.payer, proto.granter);
|
|
69
|
-
};
|
|
70
|
-
Fee.prototype.toProto = function () {
|
|
71
|
-
var _a = this, amount = _a.amount, gas_limit = _a.gas_limit, payer = _a.payer, granter = _a.granter;
|
|
72
|
-
return tx_1.Fee.fromPartial({
|
|
73
|
-
amount: amount.toProto(),
|
|
74
|
-
gasLimit: long_1.default.fromNumber(gas_limit),
|
|
75
|
-
granter: granter,
|
|
76
|
-
payer: payer,
|
|
77
|
-
});
|
|
78
|
-
};
|
|
79
|
-
/**
|
|
80
|
-
* Gets the minimum gas prices implied by the fee. Minimum gas prices are `fee amount / gas`.
|
|
81
|
-
*/
|
|
82
|
-
Fee.prototype.gasPrices = function () {
|
|
83
|
-
return this.amount.toDecCoins().div(this.gas_limit);
|
|
84
|
-
};
|
|
85
|
-
return Fee;
|
|
86
|
-
}(json_1.JSONSerializable));
|
|
87
|
-
exports.Fee = Fee;
|
|
88
|
-
//# sourceMappingURL=Fee.js.map
|
package/dist/core/Fee.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Fee.js","sourceRoot":"","sources":["../../src/core/Fee.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,qCAAgD;AAChD,iCAAgC;AAChC,6BAA4B;AAE5B,gEAA0E;AAC1E,8CAAwB;AAExB;;GAEG;AACH;IAAyB,uBAAgD;IAIvE;;;;OAIG;IACH,aACkB,SAAiB,EACjC,MAAmB,EACZ,KAAkB,EAClB,OAAo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AK,GAAI,EAAE;SACnB,CAAC;IACJ,CAAC;IAEa,aAAS,GAAvB,UAAwB,KAAgB;QACtC,OAAO,IAAI,GAAG,CACZ,KAAK,CAAC,QAAQ,CAAC,QAAQ,EAAE,EACzB,aAAK,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,EAC7B,KAAK,CAAC,KAAK,EACX,KAAK,CAAC,OAAO,CACd,CAAC;IACJ,CAAC;IAEM,qBAAO,GAAd;QACQ,IAAA,KAAwC,IAAI,EAA1C,MAAM,YAAA,EAAE,SAAS,eAAA,EAAE,KAAK,WAAA,EAAE,OAAO,aAAS,CAAC;QACnD,OAAO,QAAM,CAAC,WAAW,CAAC;YACxB,MAAM,EAAE,MAAM,CAAC,OAAO,EAAE;YACxB,QAAQ,EAAE,cAAI,CAAC,UAAU,CAAC,SAAS,CAAC;YACpC,OAAO,SAAA;YACP,KAAK,OAAA;SACN,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACI,uBAAS,GAAhB;QACE,OAAO,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACtD,CAAC;IACH,UAAC;AAAD,CAAC,AA3ED,CAAyB,uBAAgB,GA2ExC;AA3EY,kBAAG"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { LegacyAminoMultisigPublicKey, SimplePublicKey } from './PublicKey';
|
|
2
|
-
import { CompactBitArray } from './CompactBitArray';
|
|
3
|
-
import { SignatureV2 } from './SignatureV2';
|
|
4
|
-
export declare class MultiSignature {
|
|
5
|
-
multisig_pubkey: LegacyAminoMultisigPublicKey;
|
|
6
|
-
bitarray: CompactBitArray;
|
|
7
|
-
signatures: SignatureV2.Descriptor[];
|
|
8
|
-
/**
|
|
9
|
-
* MultiSignature constructor
|
|
10
|
-
* public_keys order must be guaranteed
|
|
11
|
-
*/
|
|
12
|
-
constructor(multisig_pubkey: LegacyAminoMultisigPublicKey);
|
|
13
|
-
appendSignature(signature_data: SignatureV2.Descriptor, index: number): void;
|
|
14
|
-
appendSignatureFromPubKey(signature_data: SignatureV2.Descriptor, public_key: SimplePublicKey): void;
|
|
15
|
-
appendSignatureV2s(signatures: SignatureV2[]): void;
|
|
16
|
-
toSignatureDescriptor(): SignatureV2.Descriptor;
|
|
17
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MultiSignature = void 0;
|
|
4
|
-
var PublicKey_1 = require("./PublicKey");
|
|
5
|
-
var CompactBitArray_1 = require("./CompactBitArray");
|
|
6
|
-
var SignatureV2_1 = require("./SignatureV2");
|
|
7
|
-
var MultiSignature = /** @class */ (function () {
|
|
8
|
-
/**
|
|
9
|
-
* MultiSignature constructor
|
|
10
|
-
* public_keys order must be guaranteed
|
|
11
|
-
*/
|
|
12
|
-
function MultiSignature(multisig_pubkey) {
|
|
13
|
-
this.multisig_pubkey = multisig_pubkey;
|
|
14
|
-
var n = multisig_pubkey.pubkeys.length;
|
|
15
|
-
this.bitarray = CompactBitArray_1.CompactBitArray.fromBits(n);
|
|
16
|
-
this.signatures = [];
|
|
17
|
-
}
|
|
18
|
-
MultiSignature.prototype.appendSignature = function (signature_data, index) {
|
|
19
|
-
var newSigIndex = this.bitarray.numTrueBitsBefore(index);
|
|
20
|
-
// Signature already exists, just replace the value there
|
|
21
|
-
if (this.bitarray.getIndex(index)) {
|
|
22
|
-
this.signatures[newSigIndex] = signature_data;
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
this.bitarray.setIndex(index, true);
|
|
26
|
-
// Optimization if the index is the greatest index
|
|
27
|
-
if (newSigIndex == this.signatures.length) {
|
|
28
|
-
this.signatures.push(signature_data);
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
this.signatures.splice(newSigIndex, 0, signature_data);
|
|
32
|
-
};
|
|
33
|
-
// adds a signature to the multisig, at the index in
|
|
34
|
-
// keys corresponding to the provided pubkey.
|
|
35
|
-
MultiSignature.prototype.appendSignatureFromPubKey = function (signature_data, public_key) {
|
|
36
|
-
var index = this.multisig_pubkey.pubkeys.findIndex(function (v) { return v.key === public_key.key; });
|
|
37
|
-
if (index == -1) {
|
|
38
|
-
throw new Error("provided key doesn't exist in public_keys");
|
|
39
|
-
}
|
|
40
|
-
this.appendSignature(signature_data, index);
|
|
41
|
-
};
|
|
42
|
-
MultiSignature.prototype.appendSignatureV2s = function (signatures) {
|
|
43
|
-
for (var _i = 0, signatures_1 = signatures; _i < signatures_1.length; _i++) {
|
|
44
|
-
var signature = signatures_1[_i];
|
|
45
|
-
if (!(signature.public_key instanceof PublicKey_1.SimplePublicKey)) {
|
|
46
|
-
throw new Error('non-SimplePublicKey cannot be used to sign multisig');
|
|
47
|
-
}
|
|
48
|
-
this.appendSignatureFromPubKey(signature.data, signature.public_key);
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
MultiSignature.prototype.toSignatureDescriptor = function () {
|
|
52
|
-
return new SignatureV2_1.SignatureV2.Descriptor(new SignatureV2_1.SignatureV2.Descriptor.Multi(this.bitarray, this.signatures));
|
|
53
|
-
};
|
|
54
|
-
return MultiSignature;
|
|
55
|
-
}());
|
|
56
|
-
exports.MultiSignature = MultiSignature;
|
|
57
|
-
//# sourceMappingURL=MultiSignature.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MultiSignature.js","sourceRoot":"","sources":["../../src/core/MultiSignature.ts"],"names":[],"mappings":";;;AAAA,yCAA4E;AAC5E,qDAAoD;AACpD,6CAA4C;AAE5C;IAIE;;;OAGG;IACH,wBAAmB,eAA6C;QAA7C,oBAAe,GAAf,eAAe,CAA8B;QAC9D,IAAM,CAAC,GAAG,eAAe,CAAC,OAAO,CAAC,MAAM,CAAC;QACzC,IAAI,CAAC,QAAQ,GAAG,iCAAe,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAC5C,IAAI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,YAAY,2BAAe,CAAC,EAAE;gBACtD,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;aACxE;YAED,IAAI,CAAC,yBAAyB,CAAC,SAAS,CAAC,IAAI,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;SACtE;IACH,CAAC;IAEM,8CAAqB,GAA5B;QACE,OAAO,IAAI,yBAAW,CAAC,UAAU,CAC/B,IAAI,yBAAW,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,CACjE,CAAC;IACJ,CAAC;IACH,qBAAC;AAAD,CAAC,AApED,IAoEC;AApEY,wCAAc"}
|
package/dist/core/SignDoc.d.ts
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { JSONSerializable } from '../util/json';
|
|
2
|
-
import { Fee } from './Fee';
|
|
3
|
-
import { Msg } from './Msg';
|
|
4
|
-
import { SignDoc as SignDoc_pb } from '@initia/initia.proto/cosmos/tx/v1beta1/tx';
|
|
5
|
-
import { TxBody, AuthInfo, Tx } from './Tx';
|
|
6
|
-
/**
|
|
7
|
-
* A sign message is a data structure that is used to create a [[StdSignature]] to be later
|
|
8
|
-
* appended to the list of signatures in an [[StdTx]]. Essentially, it contains all the
|
|
9
|
-
* information needed to sign and build a transaction, and can be described as an
|
|
10
|
-
* "unsigned transaction."
|
|
11
|
-
*/
|
|
12
|
-
export declare class SignDoc extends JSONSerializable<SignDoc.Amino, SignDoc.Data, SignDoc.Proto> {
|
|
13
|
-
chain_id: string;
|
|
14
|
-
account_number: number;
|
|
15
|
-
sequence: number;
|
|
16
|
-
auth_info: AuthInfo;
|
|
17
|
-
tx_body: TxBody;
|
|
18
|
-
/**
|
|
19
|
-
*
|
|
20
|
-
* @param chain_id ID of blockchain to submit transaction to
|
|
21
|
-
* @param account_number account number on blockchain
|
|
22
|
-
* @param sequence Sequence number (nonce), number of signed previous transactions by
|
|
23
|
-
* account included on the blockchain at time of broadcast.
|
|
24
|
-
* @param fee transaction fee
|
|
25
|
-
* @param msgs list of messages to include
|
|
26
|
-
* @param memo optional note
|
|
27
|
-
* @param timeout_height optional transaction timeout height, does not support amino
|
|
28
|
-
* @param public_key Signer's public key, only used at direct sign mode
|
|
29
|
-
*/
|
|
30
|
-
constructor(chain_id: string, account_number: number, sequence: number, auth_info: AuthInfo, tx_body: TxBody);
|
|
31
|
-
toAmino(): SignDoc.Amino;
|
|
32
|
-
toData(): SignDoc.Data;
|
|
33
|
-
toProto(): SignDoc.Proto;
|
|
34
|
-
toUnSignedTx(): Tx;
|
|
35
|
-
toBytes(): Uint8Array;
|
|
36
|
-
}
|
|
37
|
-
export declare namespace SignDoc {
|
|
38
|
-
interface Amino {
|
|
39
|
-
chain_id: string;
|
|
40
|
-
account_number: string;
|
|
41
|
-
sequence: string;
|
|
42
|
-
timeout_height?: string;
|
|
43
|
-
fee: Fee.Amino;
|
|
44
|
-
msgs: Msg.Amino[];
|
|
45
|
-
memo: string;
|
|
46
|
-
}
|
|
47
|
-
interface Data {
|
|
48
|
-
body_bytes: string;
|
|
49
|
-
auth_info_bytes: string;
|
|
50
|
-
chain_id: string;
|
|
51
|
-
account_number: string;
|
|
52
|
-
}
|
|
53
|
-
type Proto = SignDoc_pb;
|
|
54
|
-
}
|
package/dist/core/SignDoc.js
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
|
-
};
|
|
20
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.SignDoc = void 0;
|
|
22
|
-
var json_1 = require("../util/json");
|
|
23
|
-
var long_1 = __importDefault(require("long"));
|
|
24
|
-
var tx_1 = require("@initia/initia.proto/cosmos/tx/v1beta1/tx");
|
|
25
|
-
var Tx_1 = require("./Tx");
|
|
26
|
-
/**
|
|
27
|
-
* A sign message is a data structure that is used to create a [[StdSignature]] to be later
|
|
28
|
-
* appended to the list of signatures in an [[StdTx]]. Essentially, it contains all the
|
|
29
|
-
* information needed to sign and build a transaction, and can be described as an
|
|
30
|
-
* "unsigned transaction."
|
|
31
|
-
*/
|
|
32
|
-
var SignDoc = /** @class */ (function (_super) {
|
|
33
|
-
__extends(SignDoc, _super);
|
|
34
|
-
/**
|
|
35
|
-
*
|
|
36
|
-
* @param chain_id ID of blockchain to submit transaction to
|
|
37
|
-
* @param account_number account number on blockchain
|
|
38
|
-
* @param sequence Sequence number (nonce), number of signed previous transactions by
|
|
39
|
-
* account included on the blockchain at time of broadcast.
|
|
40
|
-
* @param fee transaction fee
|
|
41
|
-
* @param msgs list of messages to include
|
|
42
|
-
* @param memo optional note
|
|
43
|
-
* @param timeout_height optional transaction timeout height, does not support amino
|
|
44
|
-
* @param public_key Signer's public key, only used at direct sign mode
|
|
45
|
-
*/
|
|
46
|
-
function SignDoc(chain_id, account_number, sequence, auth_info, tx_body) {
|
|
47
|
-
var _this = _super.call(this) || this;
|
|
48
|
-
_this.chain_id = chain_id;
|
|
49
|
-
_this.account_number = account_number;
|
|
50
|
-
_this.sequence = sequence;
|
|
51
|
-
_this.auth_info = auth_info;
|
|
52
|
-
_this.tx_body = tx_body;
|
|
53
|
-
return _this;
|
|
54
|
-
}
|
|
55
|
-
SignDoc.prototype.toAmino = function () {
|
|
56
|
-
var _a = this, chain_id = _a.chain_id, account_number = _a.account_number, sequence = _a.sequence, _b = _a.tx_body, memo = _b.memo, messages = _b.messages, timeout_height = _b.timeout_height, fee = _a.auth_info.fee;
|
|
57
|
-
return {
|
|
58
|
-
chain_id: chain_id,
|
|
59
|
-
account_number: account_number.toString(),
|
|
60
|
-
sequence: sequence.toString(),
|
|
61
|
-
timeout_height: timeout_height && timeout_height !== 0
|
|
62
|
-
? timeout_height.toString()
|
|
63
|
-
: undefined,
|
|
64
|
-
fee: fee.toAmino(),
|
|
65
|
-
msgs: messages.map(function (m) { return m.toAmino(); }),
|
|
66
|
-
memo: memo !== null && memo !== void 0 ? memo : '',
|
|
67
|
-
};
|
|
68
|
-
};
|
|
69
|
-
SignDoc.prototype.toData = function () {
|
|
70
|
-
var _a = this, account_number = _a.account_number, chain_id = _a.chain_id, tx_body = _a.tx_body, auth_info = _a.auth_info;
|
|
71
|
-
return {
|
|
72
|
-
body_bytes: Buffer.from(tx_body.toBytes()).toString('base64'),
|
|
73
|
-
auth_info_bytes: Buffer.from(auth_info.toBytes()).toString('base64'),
|
|
74
|
-
account_number: account_number.toFixed(),
|
|
75
|
-
chain_id: chain_id,
|
|
76
|
-
};
|
|
77
|
-
};
|
|
78
|
-
SignDoc.prototype.toProto = function () {
|
|
79
|
-
var _a = this, account_number = _a.account_number, chain_id = _a.chain_id, tx_body = _a.tx_body, auth_info = _a.auth_info;
|
|
80
|
-
return tx_1.SignDoc.fromPartial({
|
|
81
|
-
bodyBytes: tx_body.toBytes(),
|
|
82
|
-
authInfoBytes: auth_info.toBytes(),
|
|
83
|
-
accountNumber: long_1.default.fromNumber(account_number),
|
|
84
|
-
chainId: chain_id,
|
|
85
|
-
});
|
|
86
|
-
};
|
|
87
|
-
SignDoc.prototype.toUnSignedTx = function () {
|
|
88
|
-
return new Tx_1.Tx(this.tx_body, this.auth_info, []);
|
|
89
|
-
};
|
|
90
|
-
SignDoc.prototype.toBytes = function () {
|
|
91
|
-
return tx_1.SignDoc.encode(this.toProto()).finish();
|
|
92
|
-
};
|
|
93
|
-
return SignDoc;
|
|
94
|
-
}(json_1.JSONSerializable));
|
|
95
|
-
exports.SignDoc = SignDoc;
|
|
96
|
-
//# sourceMappingURL=SignDoc.js.map
|
package/dist/core/SignDoc.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SignDoc.js","sourceRoot":"","sources":["../../src/core/SignDoc.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,qCAAgD;AAGhD,8CAAwB;AACxB,gEAAkF;AAClF,2BAA4C;AAC5C;;;;;GAKG;AACH;IAA6B,2BAI5B;IACC;;;;;;;;;;;OAWG;IACH,iBACS,QAAgB,EAChB,cAAsB,EACtB,QAAgB,EAChB,SAAmB,EACnB,OAAe;QALxB,YAOE,iBAAO,SACR;QAPQ,cAAQ,GAAR,QAAQ,CAAQ;QAChB,oBAAc,GAAd,cAAc,CAAQ;QACtB,cAAQ,GAAR,QAAQ,CAAQ;QAChB,eAAS,GAAT,SAAS,CAAU;QACnB,aAAO,GAAP,OAAO,CAAQ;;IAGxB,CAAC;IAEM,yBAAO,GAAd;QACQ,IAAA,KAMF,IAAI,EALN,QAAQ,cAAA,EACR,cAAc,oBAAA,EACd,QAAQ,cAAA,EACR,eAA2C,EAAhC,IAAI,UAAA,EAAE,QAAQ,cAAA,EAAE,cAAc,oBAAA,EAC5B,GAAG,mBACV,CAAC;QAET,OAAO;YACL,QAAQ,UAAA;YACR,cAAc,EAAE,cAAc,CAAC,QAAQ,EAAE;YACzC,QAAQ,EAAE,QAAQ,CAAC,QAAQ,EAAE;YAC7B,cAAc,EACZ,cAAc,IAAI,cAAc,KAAK,CAAC;gBACpC,CAAC,CAAC,cAAc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