@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.
Files changed (154) hide show
  1. package/package.json +1 -1
  2. package/dist/client/lcd/LCDUtils.d.ts +0 -18
  3. package/dist/client/lcd/LCDUtils.js +0 -93
  4. package/dist/client/lcd/LCDUtils.js.map +0 -1
  5. package/dist/client/lcd/api/MintAPI.d.ts +0 -27
  6. package/dist/client/lcd/api/MintAPI.js +0 -109
  7. package/dist/client/lcd/api/MintAPI.js.map +0 -1
  8. package/dist/client/lcd/api/StakingAPI.d.ts +0 -100
  9. package/dist/client/lcd/api/StakingAPI.js +0 -297
  10. package/dist/client/lcd/api/StakingAPI.js.map +0 -1
  11. package/dist/core/CompactBitArray.d.ts +0 -23
  12. package/dist/core/CompactBitArray.js +0 -94
  13. package/dist/core/CompactBitArray.js.map +0 -1
  14. package/dist/core/Deposit.d.ts +0 -37
  15. package/dist/core/Deposit.js +0 -81
  16. package/dist/core/Deposit.js.map +0 -1
  17. package/dist/core/Fee.d.ts +0 -42
  18. package/dist/core/Fee.js +0 -88
  19. package/dist/core/Fee.js.map +0 -1
  20. package/dist/core/MultiSignature.d.ts +0 -17
  21. package/dist/core/MultiSignature.js +0 -57
  22. package/dist/core/MultiSignature.js.map +0 -1
  23. package/dist/core/SignDoc.d.ts +0 -54
  24. package/dist/core/SignDoc.js +0 -96
  25. package/dist/core/SignDoc.js.map +0 -1
  26. package/dist/core/SignatureV2.d.ts +0 -66
  27. package/dist/core/SignatureV2.js +0 -131
  28. package/dist/core/SignatureV2.js.map +0 -1
  29. package/dist/core/Tx.d.ts +0 -147
  30. package/dist/core/Tx.js +0 -279
  31. package/dist/core/Tx.js.map +0 -1
  32. package/dist/core/TxInfo.d.ts +0 -91
  33. package/dist/core/TxInfo.js +0 -115
  34. package/dist/core/TxInfo.js.map +0 -1
  35. package/dist/core/ValidatorSet.d.ts +0 -11
  36. package/dist/core/ValidatorSet.js +0 -3
  37. package/dist/core/ValidatorSet.js.map +0 -1
  38. package/dist/core/auth/BaseVestingAccount.d.ts +0 -58
  39. package/dist/core/auth/BaseVestingAccount.js +0 -123
  40. package/dist/core/auth/BaseVestingAccount.js.map +0 -1
  41. package/dist/core/auth/ContinuousVestingAccount.d.ts +0 -45
  42. package/dist/core/auth/ContinuousVestingAccount.js +0 -116
  43. package/dist/core/auth/ContinuousVestingAccount.js.map +0 -1
  44. package/dist/core/auth/DelayedVestingAccount.d.ts +0 -42
  45. package/dist/core/auth/DelayedVestingAccount.js +0 -108
  46. package/dist/core/auth/DelayedVestingAccount.js.map +0 -1
  47. package/dist/core/auth/PeriodicVestingAccount.d.ts +0 -72
  48. package/dist/core/auth/PeriodicVestingAccount.js +0 -170
  49. package/dist/core/auth/PeriodicVestingAccount.js.map +0 -1
  50. package/dist/core/crisis/MsgVerifyInvariant.d.ts +0 -43
  51. package/dist/core/crisis/MsgVerifyInvariant.js +0 -77
  52. package/dist/core/crisis/MsgVerifyInvariant.js.map +0 -1
  53. package/dist/core/distribution/proposals/CommunityPoolSpendProposal.d.ts +0 -49
  54. package/dist/core/distribution/proposals/CommunityPoolSpendProposal.js +0 -97
  55. package/dist/core/distribution/proposals/CommunityPoolSpendProposal.js.map +0 -1
  56. package/dist/core/distribution/proposals/index.d.ts +0 -1
  57. package/dist/core/distribution/proposals/index.js +0 -18
  58. package/dist/core/distribution/proposals/index.js.map +0 -1
  59. package/dist/core/gov/Proposal.d.ts +0 -96
  60. package/dist/core/gov/Proposal.js +0 -244
  61. package/dist/core/gov/Proposal.js.map +0 -1
  62. package/dist/core/ibc/applications/fee/msgs/MsgRegisterCounterpartAddress.d.ts +0 -34
  63. package/dist/core/ibc/applications/fee/msgs/MsgRegisterCounterpartAddress.js +0 -82
  64. package/dist/core/ibc/applications/fee/msgs/MsgRegisterCounterpartAddress.js.map +0 -1
  65. package/dist/core/ibc/applications/nft-transfer/ClassTrace.d.ts +0 -28
  66. package/dist/core/ibc/applications/nft-transfer/ClassTrace.js +0 -67
  67. package/dist/core/ibc/applications/nft-transfer/ClassTrace.js.map +0 -1
  68. package/dist/core/ibc/core/connection/Version.d.ts +0 -28
  69. package/dist/core/ibc/core/connection/Version.js +0 -70
  70. package/dist/core/ibc/core/connection/Version.js.map +0 -1
  71. package/dist/core/move/StorageFee.d.ts +0 -34
  72. package/dist/core/move/StorageFee.js +0 -78
  73. package/dist/core/move/StorageFee.js.map +0 -1
  74. package/dist/core/move/proposals/DelistProposal.d.ts +0 -50
  75. package/dist/core/move/proposals/DelistProposal.js +0 -100
  76. package/dist/core/move/proposals/DelistProposal.js.map +0 -1
  77. package/dist/core/move/proposals/ExecuteOperation.d.ts +0 -51
  78. package/dist/core/move/proposals/ExecuteOperation.js +0 -100
  79. package/dist/core/move/proposals/ExecuteOperation.js.map +0 -1
  80. package/dist/core/move/proposals/ExecuteProposal.d.ts +0 -54
  81. package/dist/core/move/proposals/ExecuteProposal.js +0 -105
  82. package/dist/core/move/proposals/ExecuteProposal.js.map +0 -1
  83. package/dist/core/move/proposals/OperationsProposal.d.ts +0 -57
  84. package/dist/core/move/proposals/OperationsProposal.js +0 -129
  85. package/dist/core/move/proposals/OperationsProposal.js.map +0 -1
  86. package/dist/core/move/proposals/PublishOperation.d.ts +0 -34
  87. package/dist/core/move/proposals/PublishOperation.js +0 -76
  88. package/dist/core/move/proposals/PublishOperation.js.map +0 -1
  89. package/dist/core/move/proposals/PublishProposal.d.ts +0 -42
  90. package/dist/core/move/proposals/PublishProposal.js +0 -90
  91. package/dist/core/move/proposals/PublishProposal.js.map +0 -1
  92. package/dist/core/move/proposals/WhitelistProposal.d.ts +0 -54
  93. package/dist/core/move/proposals/WhitelistProposal.js +0 -105
  94. package/dist/core/move/proposals/WhitelistProposal.js.map +0 -1
  95. package/dist/core/move/proposals/index.d.ts +0 -5
  96. package/dist/core/move/proposals/index.js +0 -22
  97. package/dist/core/move/proposals/index.js.map +0 -1
  98. package/dist/core/staking/Delegation.d.ts +0 -45
  99. package/dist/core/staking/Delegation.js +0 -89
  100. package/dist/core/staking/Delegation.js.map +0 -1
  101. package/dist/core/staking/Redelegation.d.ts +0 -97
  102. package/dist/core/staking/Redelegation.js +0 -174
  103. package/dist/core/staking/Redelegation.js.map +0 -1
  104. package/dist/core/staking/UnbondingDelegation.d.ts +0 -75
  105. package/dist/core/staking/UnbondingDelegation.js +0 -143
  106. package/dist/core/staking/UnbondingDelegation.js.map +0 -1
  107. package/dist/core/staking/Validator.d.ts +0 -173
  108. package/dist/core/staking/Validator.js +0 -287
  109. package/dist/core/staking/Validator.js.map +0 -1
  110. package/dist/core/staking/msgs/MsgBeginRedelegate.d.ts +0 -51
  111. package/dist/core/staking/msgs/MsgBeginRedelegate.js +0 -99
  112. package/dist/core/staking/msgs/MsgBeginRedelegate.js.map +0 -1
  113. package/dist/core/staking/msgs/MsgCreateValidator.d.ts +0 -60
  114. package/dist/core/staking/msgs/MsgCreateValidator.js +0 -110
  115. package/dist/core/staking/msgs/MsgCreateValidator.js.map +0 -1
  116. package/dist/core/staking/msgs/MsgDelegate.d.ts +0 -46
  117. package/dist/core/staking/msgs/MsgDelegate.js +0 -93
  118. package/dist/core/staking/msgs/MsgDelegate.js.map +0 -1
  119. package/dist/core/staking/msgs/MsgEditValidator.d.ts +0 -50
  120. package/dist/core/staking/msgs/MsgEditValidator.js +0 -111
  121. package/dist/core/staking/msgs/MsgEditValidator.js.map +0 -1
  122. package/dist/core/staking/msgs/MsgUndelegate.d.ts +0 -46
  123. package/dist/core/staking/msgs/MsgUndelegate.js +0 -93
  124. package/dist/core/staking/msgs/MsgUndelegate.js.map +0 -1
  125. package/dist/core/staking/msgs/index.d.ts +0 -16
  126. package/dist/core/staking/msgs/index.js +0 -22
  127. package/dist/core/staking/msgs/index.js.map +0 -1
  128. package/dist/core/upgrade/proposals/CancelSoftwareUpgradeProposal.d.ts +0 -39
  129. package/dist/core/upgrade/proposals/CancelSoftwareUpgradeProposal.js +0 -86
  130. package/dist/core/upgrade/proposals/CancelSoftwareUpgradeProposal.js.map +0 -1
  131. package/dist/core/upgrade/proposals/SoftwareUpgradeProposal.d.ts +0 -44
  132. package/dist/core/upgrade/proposals/SoftwareUpgradeProposal.js +0 -92
  133. package/dist/core/upgrade/proposals/SoftwareUpgradeProposal.js.map +0 -1
  134. package/dist/core/upgrade/proposals/index.d.ts +0 -2
  135. package/dist/core/upgrade/proposals/index.js +0 -19
  136. package/dist/core/upgrade/proposals/index.js.map +0 -1
  137. package/dist/core/vesting/Period.d.ts +0 -32
  138. package/dist/core/vesting/Period.js +0 -78
  139. package/dist/core/vesting/Period.js.map +0 -1
  140. package/dist/core/vesting/index.d.ts +0 -2
  141. package/dist/core/vesting/index.js +0 -19
  142. package/dist/core/vesting/index.js.map +0 -1
  143. package/dist/core/vesting/msgs/MsgCreateVestingAccount.d.ts +0 -50
  144. package/dist/core/vesting/msgs/MsgCreateVestingAccount.js +0 -103
  145. package/dist/core/vesting/msgs/MsgCreateVestingAccount.js.map +0 -1
  146. package/dist/core/vesting/msgs/index.d.ts +0 -8
  147. package/dist/core/vesting/msgs/index.js +0 -18
  148. package/dist/core/vesting/msgs/index.js.map +0 -1
  149. package/dist/util/contract.d.ts +0 -9
  150. package/dist/util/contract.js +0 -57
  151. package/dist/util/contract.js.map +0 -1
  152. package/dist/util/convert.d.ts +0 -8
  153. package/dist/util/convert.js +0 -12
  154. package/dist/util/convert.js.map +0 -1
@@ -1,105 +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
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.WhitelistProposal = void 0;
19
- var json_1 = require("../../../util/json");
20
- var any_1 = require("@initia/initia.proto/google/protobuf/any");
21
- var proposal_1 = require("@initia/initia.proto/initia/move/v1/proposal");
22
- /**
23
- * WhitelistProposal proposal which supports whitelisting dex pairs
24
- */
25
- var WhitelistProposal = /** @class */ (function (_super) {
26
- __extends(WhitelistProposal, _super);
27
- /**
28
- * @param title a short summary
29
- * @param description a human readable text
30
- * @param coin_a coin A struct tag
31
- * @param coin_b coin B struct tag
32
- * @param coin_lp coin LP struct tag
33
- * @param reward_weight reward weight
34
- */
35
- function WhitelistProposal(title, description, coin_a, coin_b, coin_lp, reward_weight) {
36
- var _this = _super.call(this) || this;
37
- _this.title = title;
38
- _this.description = description;
39
- _this.coin_a = coin_a;
40
- _this.coin_b = coin_b;
41
- _this.coin_lp = coin_lp;
42
- _this.reward_weight = reward_weight;
43
- return _this;
44
- }
45
- WhitelistProposal.fromAmino = function (data) {
46
- var _a = data.value, title = _a.title, description = _a.description, coin_a = _a.coin_a, coin_b = _a.coin_b, coin_lp = _a.coin_lp, reward_weight = _a.reward_weight;
47
- return new WhitelistProposal(title, description, coin_a, coin_b, coin_lp, reward_weight);
48
- };
49
- WhitelistProposal.prototype.toAmino = function () {
50
- var _a = this, title = _a.title, description = _a.description, coin_a = _a.coin_a, coin_b = _a.coin_b, coin_lp = _a.coin_lp, reward_weight = _a.reward_weight;
51
- return {
52
- type: 'move/WhitelistProposal',
53
- value: {
54
- title: title,
55
- description: description,
56
- coin_a: coin_a,
57
- coin_b: coin_b,
58
- coin_lp: coin_lp,
59
- reward_weight: reward_weight,
60
- },
61
- };
62
- };
63
- WhitelistProposal.fromData = function (data) {
64
- var title = data.title, description = data.description, coin_a = data.coin_a, coin_b = data.coin_b, coin_lp = data.coin_lp, reward_weight = data.reward_weight;
65
- return new WhitelistProposal(title, description, coin_a, coin_b, coin_lp, reward_weight);
66
- };
67
- WhitelistProposal.prototype.toData = function () {
68
- var _a = this, title = _a.title, description = _a.description, coin_a = _a.coin_a, coin_b = _a.coin_b, coin_lp = _a.coin_lp, reward_weight = _a.reward_weight;
69
- return {
70
- '@type': '/initia.move.v1.WhitelistProposal',
71
- title: title,
72
- description: description,
73
- coin_a: coin_a,
74
- coin_b: coin_b,
75
- coin_lp: coin_lp,
76
- reward_weight: reward_weight,
77
- };
78
- };
79
- WhitelistProposal.fromProto = function (proto) {
80
- return new WhitelistProposal(proto.title, proto.description, proto.coinA, proto.coinB, proto.coinLp, proto.rewardWeight);
81
- };
82
- WhitelistProposal.prototype.toProto = function () {
83
- var _a = this, title = _a.title, description = _a.description, coin_a = _a.coin_a, coin_b = _a.coin_b, coin_lp = _a.coin_lp, reward_weight = _a.reward_weight;
84
- return proposal_1.WhitelistProposal.fromPartial({
85
- title: title,
86
- description: description,
87
- coinA: coin_a,
88
- coinB: coin_b,
89
- coinLp: coin_lp,
90
- rewardWeight: reward_weight,
91
- });
92
- };
93
- WhitelistProposal.prototype.packAny = function () {
94
- return any_1.Any.fromPartial({
95
- typeUrl: '/initia.move.v1.WhitelistProposal',
96
- value: proposal_1.WhitelistProposal.encode(this.toProto()).finish(),
97
- });
98
- };
99
- WhitelistProposal.unpackAny = function (msgAny) {
100
- return WhitelistProposal.fromProto(proposal_1.WhitelistProposal.decode(msgAny.value));
101
- };
102
- return WhitelistProposal;
103
- }(json_1.JSONSerializable));
104
- exports.WhitelistProposal = WhitelistProposal;
105
- //# sourceMappingURL=WhitelistProposal.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"WhitelistProposal.js","sourceRoot":"","sources":["../../../../src/core/move/proposals/WhitelistProposal.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,2CAAsD;AACtD,gEAA+D;AAC/D,yEAAyG;AAEzG;;GAEG;AACH;IAAuC,qCAItC;I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AAvB,UAAwB,MAAW;QACjC,OAAO,iBAAiB,CAAC,SAAS,CAChC,4BAAoB,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAC1C,CAAC;IACJ,CAAC;IACH,wBAAC;AAAD,CAAC,AAjHD,CAAuC,uBAAgB,GAiHtD;AAjHY,8CAAiB"}
@@ -1,5 +0,0 @@
1
- export * from './OperationsProposal';
2
- export * from './ExecuteOperation';
3
- export * from './PublishOperation';
4
- export * from './WhitelistProposal';
5
- export * from './DelistProposal';
@@ -1,22 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./OperationsProposal"), exports);
18
- __exportStar(require("./ExecuteOperation"), exports);
19
- __exportStar(require("./PublishOperation"), exports);
20
- __exportStar(require("./WhitelistProposal"), exports);
21
- __exportStar(require("./DelistProposal"), exports);
22
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/move/proposals/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,qDAAmC;AACnC,qDAAmC;AACnC,sDAAoC;AACpC,mDAAiC"}
@@ -1,45 +0,0 @@
1
- import { JSONSerializable } from '../../util/json';
2
- import { AccAddress, ValAddress } from '../bech32';
3
- import { Coins } from '../Coins';
4
- import { DelegationResponse as DelegationResponse_pb } from '@initia/initia.proto/initia/mstaking/v1/staking';
5
- /**
6
- * Stores information about the status of a delegation between a delegator and validator, fetched from the blockchain.
7
- */
8
- export declare class Delegation extends JSONSerializable<Delegation.Amino, Delegation.Data, Delegation.Proto> {
9
- delegator_address: AccAddress;
10
- validator_address: ValAddress;
11
- shares: Coins;
12
- balance: Coins;
13
- /**
14
- * @param delegator_address delegator's account address
15
- * @param validator_address validator's operator address
16
- * @param shares delegator's shares
17
- * @param balance balance of the delegation
18
- */
19
- constructor(delegator_address: AccAddress, validator_address: ValAddress, shares: Coins.Input, balance: Coins.Input);
20
- static fromAmino(data: Delegation.Amino): Delegation;
21
- toAmino(): Delegation.Amino;
22
- static fromData(data: Delegation.Data): Delegation;
23
- toData(): Delegation.Data;
24
- static fromProto(proto: Delegation.Proto): Delegation;
25
- toProto(): Delegation.Proto;
26
- }
27
- export declare namespace Delegation {
28
- interface Amino {
29
- delegation: {
30
- delegator_address: AccAddress;
31
- validator_address: ValAddress;
32
- shares: Coins.Amino;
33
- };
34
- balance: Coins.Amino;
35
- }
36
- interface Data {
37
- delegation: {
38
- delegator_address: AccAddress;
39
- validator_address: ValAddress;
40
- shares: Coins.Data;
41
- };
42
- balance: Coins.Data;
43
- }
44
- type Proto = DelegationResponse_pb;
45
- }
@@ -1,89 +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
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.Delegation = void 0;
19
- var json_1 = require("../../util/json");
20
- var Coins_1 = require("../Coins");
21
- var staking_1 = require("@initia/initia.proto/initia/mstaking/v1/staking");
22
- /**
23
- * Stores information about the status of a delegation between a delegator and validator, fetched from the blockchain.
24
- */
25
- var Delegation = /** @class */ (function (_super) {
26
- __extends(Delegation, _super);
27
- /**
28
- * @param delegator_address delegator's account address
29
- * @param validator_address validator's operator address
30
- * @param shares delegator's shares
31
- * @param balance balance of the delegation
32
- */
33
- function Delegation(delegator_address, validator_address, shares, balance) {
34
- var _this = _super.call(this) || this;
35
- _this.delegator_address = delegator_address;
36
- _this.validator_address = validator_address;
37
- _this.shares = new Coins_1.Coins(shares);
38
- _this.balance = new Coins_1.Coins(balance);
39
- return _this;
40
- }
41
- Delegation.fromAmino = function (data) {
42
- var _a = data.delegation, delegator_address = _a.delegator_address, validator_address = _a.validator_address, shares = _a.shares, balance = data.balance;
43
- return new Delegation(delegator_address, validator_address, Coins_1.Coins.fromAmino(shares), Coins_1.Coins.fromAmino(balance));
44
- };
45
- Delegation.prototype.toAmino = function () {
46
- var _a = this, delegator_address = _a.delegator_address, validator_address = _a.validator_address, shares = _a.shares, balance = _a.balance;
47
- return {
48
- delegation: {
49
- delegator_address: delegator_address,
50
- validator_address: validator_address,
51
- shares: shares.toAmino(),
52
- },
53
- balance: balance.toAmino(),
54
- };
55
- };
56
- Delegation.fromData = function (data) {
57
- var _a = data.delegation, delegator_address = _a.delegator_address, validator_address = _a.validator_address, shares = _a.shares, balance = data.balance;
58
- return new Delegation(delegator_address, validator_address, Coins_1.Coins.fromData(shares), Coins_1.Coins.fromData(balance));
59
- };
60
- Delegation.prototype.toData = function () {
61
- var _a = this, delegator_address = _a.delegator_address, validator_address = _a.validator_address, shares = _a.shares, balance = _a.balance;
62
- return {
63
- delegation: {
64
- delegator_address: delegator_address,
65
- validator_address: validator_address,
66
- shares: shares.toData(),
67
- },
68
- balance: balance.toData(),
69
- };
70
- };
71
- Delegation.fromProto = function (proto) {
72
- var delegationProto = proto.delegation;
73
- return new Delegation(delegationProto.delegatorAddress, delegationProto.validatorAddress, Coins_1.Coins.fromProto(delegationProto.shares), Coins_1.Coins.fromProto(proto.balance));
74
- };
75
- Delegation.prototype.toProto = function () {
76
- var _a = this, delegator_address = _a.delegator_address, validator_address = _a.validator_address, shares = _a.shares, balance = _a.balance;
77
- return staking_1.DelegationResponse.fromPartial({
78
- delegation: staking_1.Delegation.fromPartial({
79
- delegatorAddress: delegator_address,
80
- validatorAddress: validator_address,
81
- shares: shares.toProto(),
82
- }),
83
- balance: balance.toProto(),
84
- });
85
- };
86
- return Delegation;
87
- }(json_1.JSONSerializable));
88
- exports.Delegation = Delegation;
89
- //# sourceMappingURL=Delegation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Delegation.js","sourceRoot":"","sources":["../../../src/core/staking/Delegation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,wCAAmD;AAEnD,kCAAiC;AACjC,2EAGyD;AAEzD;;GAEG;AACH;IAAgC,8BAI/B;IAIC;;;;;OAKG;IACH,oBACS,iBAA6B,EAC7B,iBAA6B,EACpC,MAAmB,EACnB,OAAoB;QAJtB,YAME,iBAAO,SAGR;QARQ,uBAAiB,GAAjB,iBAAiB,CAAY;QAC7B,uBAAiB,GAAjB,iBAAiB,CAAY;QAKpC,KAAI,CAAC,MAAM,GAAG,IAAI,aAAK,CAAC,MAAM,CAAC,CAAC;QAChC,KAAI,CAAC,OAAO,GAAG,IAAI,aAAK,CAAC,OAAO,CAAC,CAAC;;IACpC,CAAC;IAEa,oBAAS,GAAvB,UAAwB,IAAsB;QAE1C,IAAA,KAEE,IAAI,WAFsD,EAA9C,iBAAiB,uBAAA,EAAE,iBAAiB,uBAAA,EAAE,MAAM,YAAA,EAC1D,OAAO,GACL,IAAI,QADC,CACA;QACT,OAAO,IAAI,UAAU,CACn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BAAgB,EAChC,eAAe,CAAC,gBAAgB,EAChC,aAAK,CAAC,SAAS,CAAC,eAAe,CAAC,MAAM,CAAC,EACvC,aAAK,CAAC,SAAS,CAAC,KAAK,CAAC,OAAsB,CAAC,CAC9C,CAAC;IACJ,CAAC;IAEM,4BAAO,GAAd;QACQ,IAAA,KAA4D,IAAI,EAA9D,iBAAiB,uBAAA,EAAE,iBAAiB,uBAAA,EAAE,MAAM,YAAA,EAAE,OAAO,aAAS,CAAC;QACvE,OAAO,4BAAqB,CAAC,WAAW,CAAC;YACvC,UAAU,EAAE,oBAAa,CAAC,WAAW,CAAC;gBACpC,gBAAgB,EAAE,iBAAiB;gBACnC,gBAAgB,EAAE,iBAAiB;gBACnC,MAAM,EAAE,MAAM,CAAC,OAAO,EAAE;aACzB,CAAC;YACF,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE;SAC3B,CAAC,CAAC;IACL,CAAC;IACH,iBAAC;AAAD,CAAC,AAlGD,CAAgC,uBAAgB,GAkG/C;AAlGY,gCAAU"}
@@ -1,97 +0,0 @@
1
- import { JSONSerializable } from '../../util/json';
2
- import { Coins } from '../Coins';
3
- import { AccAddress, ValAddress } from '../bech32';
4
- import { RedelegationResponse as RedelegationResponse_pb, RedelegationEntryResponse as RedelegationEntryResponse_pb } from '@initia/initia.proto/initia/mstaking/v1/staking';
5
- /**
6
- * A redelegation is when a delegator decides to stop staking with one validator and
7
- * transfer their delegation to another validator. Rather than unbonding (which takes
8
- * some time) and re-staking, the funds can be redelegated immediately if a
9
- * [[Redelegation.Entry]] can be created.
10
- *
11
- * A redelegation, like an unbonding delegation, is implemented through
12
- * [[Redelegation.Entry]] objects, limited by the `max_entry` parameter in the staking
13
- * module params. For each pair of source and target validators, you cannot redelegate
14
- * more times than the amount of entries. Entries are cleared when the redelegation is
15
- * completed, the same amount of time as unbonding.
16
- */
17
- export declare class Redelegation extends JSONSerializable<Redelegation.Amino, Redelegation.Data, Redelegation.Proto> {
18
- delegator_address: AccAddress;
19
- validator_src_address: ValAddress;
20
- validator_dst_address: ValAddress;
21
- entries: Redelegation.Entry[];
22
- /**
23
- *
24
- * @param delegator_address delegator's account address
25
- * @param validator_src_address source validator's operator address (from)
26
- * @param validator_dst_address target validator's operator address (to)
27
- * @param entries entries
28
- */
29
- constructor(delegator_address: AccAddress, validator_src_address: ValAddress, validator_dst_address: ValAddress, entries: Redelegation.Entry[]);
30
- static fromAmino(data: Redelegation.Amino): Redelegation;
31
- toAmino(): Redelegation.Amino;
32
- static fromData(data: Redelegation.Data): Redelegation;
33
- toData(): Redelegation.Data;
34
- static fromProto(data: Redelegation.Proto): Redelegation;
35
- toProto(): Redelegation.Proto;
36
- }
37
- export declare namespace Redelegation {
38
- interface Amino {
39
- redelegation: {
40
- delegator_address: AccAddress;
41
- validator_src_address: ValAddress;
42
- validator_dst_address: ValAddress;
43
- };
44
- entries: Redelegation.Entry.Amino[];
45
- }
46
- interface Data {
47
- redelegation: {
48
- delegator_address: AccAddress;
49
- validator_src_address: ValAddress;
50
- validator_dst_address: ValAddress;
51
- };
52
- entries: Redelegation.Entry.Data[];
53
- }
54
- type Proto = RedelegationResponse_pb;
55
- class Entry extends JSONSerializable<Entry.Amino, Entry.Data, Entry.Proto> {
56
- creation_height: number;
57
- completion_time: Date;
58
- initial_balance: Coins;
59
- shares_dst: Coins;
60
- balance: Coins;
61
- /**
62
- *
63
- * @param initial_balance balance of delegation prior to initiating redelegation
64
- * @param shares_dst
65
- * @param creation_height height of blockchain when entry was created
66
- * @param completion_time time when redelegation entry will be removed
67
- */
68
- constructor(initial_balance: Coins.Input, balance: Coins.Input, shares_dst: Coins.Input, creation_height: number, completion_time: Date);
69
- toAmino(): Entry.Amino;
70
- static fromAmino(data: Entry.Amino): Entry;
71
- toData(): Entry.Data;
72
- static fromData(data: Entry.Data): Entry;
73
- toProto(): Entry.Proto;
74
- static fromProto(proto: Entry.Proto): Entry;
75
- }
76
- namespace Entry {
77
- interface Amino {
78
- redelegation_entry: {
79
- creation_height: number;
80
- completion_time: string;
81
- initial_balance: Coins.Amino;
82
- shares_dst: Coins.Amino;
83
- };
84
- balance: Coins.Amino;
85
- }
86
- interface Data {
87
- redelegation_entry: {
88
- creation_height: number;
89
- completion_time: string;
90
- initial_balance: Coins.Data;
91
- shares_dst: Coins.Data;
92
- };
93
- balance: Coins.Data;
94
- }
95
- type Proto = RedelegationEntryResponse_pb;
96
- }
97
- }
@@ -1,174 +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.Redelegation = void 0;
22
- var json_1 = require("../../util/json");
23
- var Coins_1 = require("../Coins");
24
- var staking_1 = require("@initia/initia.proto/initia/mstaking/v1/staking");
25
- var long_1 = __importDefault(require("long"));
26
- /**
27
- * A redelegation is when a delegator decides to stop staking with one validator and
28
- * transfer their delegation to another validator. Rather than unbonding (which takes
29
- * some time) and re-staking, the funds can be redelegated immediately if a
30
- * [[Redelegation.Entry]] can be created.
31
- *
32
- * A redelegation, like an unbonding delegation, is implemented through
33
- * [[Redelegation.Entry]] objects, limited by the `max_entry` parameter in the staking
34
- * module params. For each pair of source and target validators, you cannot redelegate
35
- * more times than the amount of entries. Entries are cleared when the redelegation is
36
- * completed, the same amount of time as unbonding.
37
- */
38
- var Redelegation = /** @class */ (function (_super) {
39
- __extends(Redelegation, _super);
40
- /**
41
- *
42
- * @param delegator_address delegator's account address
43
- * @param validator_src_address source validator's operator address (from)
44
- * @param validator_dst_address target validator's operator address (to)
45
- * @param entries entries
46
- */
47
- function Redelegation(delegator_address, validator_src_address, validator_dst_address, entries) {
48
- var _this = _super.call(this) || this;
49
- _this.delegator_address = delegator_address;
50
- _this.validator_src_address = validator_src_address;
51
- _this.validator_dst_address = validator_dst_address;
52
- _this.entries = entries;
53
- return _this;
54
- }
55
- Redelegation.fromAmino = function (data) {
56
- var _a = data.redelegation, delegator_address = _a.delegator_address, validator_src_address = _a.validator_src_address, validator_dst_address = _a.validator_dst_address, entries = data.entries;
57
- return new Redelegation(delegator_address, validator_src_address, validator_dst_address, entries.map(function (e) { return Redelegation.Entry.fromAmino(e); }));
58
- };
59
- Redelegation.prototype.toAmino = function () {
60
- var _a = this, delegator_address = _a.delegator_address, validator_src_address = _a.validator_src_address, validator_dst_address = _a.validator_dst_address, entries = _a.entries;
61
- return {
62
- redelegation: {
63
- delegator_address: delegator_address,
64
- validator_src_address: validator_src_address,
65
- validator_dst_address: validator_dst_address,
66
- },
67
- entries: entries.map(function (e) { return e.toAmino(); }),
68
- };
69
- };
70
- Redelegation.fromData = function (data) {
71
- var _a = data.redelegation, delegator_address = _a.delegator_address, validator_src_address = _a.validator_src_address, validator_dst_address = _a.validator_dst_address, entries = data.entries;
72
- return new Redelegation(delegator_address, validator_src_address, validator_dst_address, entries.map(function (e) { return Redelegation.Entry.fromData(e); }));
73
- };
74
- Redelegation.prototype.toData = function () {
75
- var _a = this, delegator_address = _a.delegator_address, validator_src_address = _a.validator_src_address, validator_dst_address = _a.validator_dst_address, entries = _a.entries;
76
- return {
77
- redelegation: {
78
- delegator_address: delegator_address,
79
- validator_src_address: validator_src_address,
80
- validator_dst_address: validator_dst_address,
81
- },
82
- entries: entries.map(function (e) { return e.toData(); }),
83
- };
84
- };
85
- Redelegation.fromProto = function (data) {
86
- var redelegationProto = data.redelegation;
87
- return new Redelegation(redelegationProto.delegatorAddress, redelegationProto.validatorDstAddress, redelegationProto.validatorDstAddress, data.entries.map(function (e) { return Redelegation.Entry.fromProto(e); }));
88
- };
89
- Redelegation.prototype.toProto = function () {
90
- var _a = this, delegator_address = _a.delegator_address, validator_src_address = _a.validator_src_address, validator_dst_address = _a.validator_dst_address, entries = _a.entries;
91
- return staking_1.RedelegationResponse.fromPartial({
92
- entries: entries.map(function (e) { return e.toProto(); }),
93
- redelegation: staking_1.Redelegation.fromPartial({
94
- delegatorAddress: delegator_address,
95
- entries: entries.map(function (e) { return e.toProto().redelegationEntry; }),
96
- validatorDstAddress: validator_dst_address,
97
- validatorSrcAddress: validator_src_address,
98
- }),
99
- });
100
- };
101
- return Redelegation;
102
- }(json_1.JSONSerializable));
103
- exports.Redelegation = Redelegation;
104
- (function (Redelegation) {
105
- var Entry = /** @class */ (function (_super) {
106
- __extends(Entry, _super);
107
- /**
108
- *
109
- * @param initial_balance balance of delegation prior to initiating redelegation
110
- * @param shares_dst
111
- * @param creation_height height of blockchain when entry was created
112
- * @param completion_time time when redelegation entry will be removed
113
- */
114
- function Entry(initial_balance, balance, shares_dst, creation_height, completion_time) {
115
- var _this = _super.call(this) || this;
116
- _this.creation_height = creation_height;
117
- _this.completion_time = completion_time;
118
- _this.initial_balance = new Coins_1.Coins(initial_balance);
119
- _this.balance = new Coins_1.Coins(balance);
120
- _this.shares_dst = new Coins_1.Coins(shares_dst);
121
- return _this;
122
- }
123
- Entry.prototype.toAmino = function () {
124
- return {
125
- redelegation_entry: {
126
- initial_balance: this.initial_balance.toAmino(),
127
- shares_dst: this.shares_dst.toAmino(),
128
- creation_height: this.creation_height,
129
- completion_time: this.completion_time.toISOString(),
130
- },
131
- balance: this.balance.toAmino(),
132
- };
133
- };
134
- Entry.fromAmino = function (data) {
135
- var _a = data.redelegation_entry, initial_balance = _a.initial_balance, shares_dst = _a.shares_dst, creation_height = _a.creation_height, completion_time = _a.completion_time, balance = data.balance;
136
- return new Entry(Coins_1.Coins.fromAmino(initial_balance), Coins_1.Coins.fromAmino(balance), Coins_1.Coins.fromAmino(shares_dst), creation_height, new Date(completion_time));
137
- };
138
- Entry.prototype.toData = function () {
139
- return {
140
- redelegation_entry: {
141
- initial_balance: this.initial_balance.toData(),
142
- shares_dst: this.shares_dst.toData(),
143
- creation_height: this.creation_height,
144
- completion_time: this.completion_time.toISOString(),
145
- },
146
- balance: this.balance.toData(),
147
- };
148
- };
149
- Entry.fromData = function (data) {
150
- var _a = data.redelegation_entry, initial_balance = _a.initial_balance, shares_dst = _a.shares_dst, creation_height = _a.creation_height, completion_time = _a.completion_time, balance = data.balance;
151
- return new Entry(Coins_1.Coins.fromData(initial_balance), Coins_1.Coins.fromData(balance), Coins_1.Coins.fromData(shares_dst), creation_height, new Date(completion_time));
152
- };
153
- Entry.prototype.toProto = function () {
154
- var _a = this, initial_balance = _a.initial_balance, balance = _a.balance, shares_dst = _a.shares_dst, creation_height = _a.creation_height, completion_time = _a.completion_time;
155
- return staking_1.RedelegationEntryResponse.fromPartial({
156
- balance: balance.toProto(),
157
- redelegationEntry: staking_1.RedelegationEntry.fromPartial({
158
- completionTime: completion_time,
159
- creationHeight: long_1.default.fromNumber(creation_height),
160
- initialBalance: initial_balance.toProto(),
161
- sharesDst: shares_dst.toProto(),
162
- }),
163
- });
164
- };
165
- Entry.fromProto = function (proto) {
166
- var redelegationEntryProto = proto.redelegationEntry;
167
- return new Entry(Coins_1.Coins.fromProto(redelegationEntryProto.initialBalance), Coins_1.Coins.fromProto(proto.balance), Coins_1.Coins.fromProto(redelegationEntryProto.sharesDst), redelegationEntryProto.creationHeight.toNumber(), redelegationEntryProto.completionTime);
168
- };
169
- return Entry;
170
- }(json_1.JSONSerializable));
171
- Redelegation.Entry = Entry;
172
- })(Redelegation = exports.Redelegation || (exports.Redelegation = {}));
173
- exports.Redelegation = Redelegation;
174
- //# sourceMappingURL=Redelegation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Redelegation.js","sourceRoot":"","sources":["../../../src/core/staking/Redelegation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,wCAAmD;AACnD,kCAAiC;AAEjC,2EAKyD;AACzD,8CAAwB;AAExB;;;;;;;;;;;GAWG;AACH;IAAkC,gCAIjC;IACC;;;;;;OAMG;IACH,sBACS,iBAA6B,EAC7B,qBAAiC,EACjC,qBAAiC,EACjC,OAA6B;QAJtC,YAME,iBAAO,SACR;QANQ,uBAAiB,GAAjB,iBAAiB,CAAY;QAC7B,2BAAqB,GAArB,qBAAqB,CAAY;QACjC,2BAAqB,GAArB,qBAAqB,CAAY;QACjC,aAAO,GAAP,OAAO,CAAsB;;IAGtC,CAAC;IAEa,sBAAS,GAAvB,UAAwB,IAAwB;QAE5C,IAAA,KAME,IAAI,aAFL,EAHC,iBAAiB,uBAAA,EACjB,qBAAqB,2BAAA,EACrB,qBAAqB,2BAAA,EAEvB,OAAO,GACL,IAAI,QADC,CACA;QACT,OAAO,IAAI,YAAY,CACrB,iBAAiB,EACjB,qBAAqB,EACrB,qBAAqB,EACrB,OAAO,CAAC,GAAG,CAAC,UAAA,CAAC,IAAI,OAAA,YAAY,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,EAA/B,CAA+B,CAAC,CAClD,CAAC;IACJ,CAAC;IAEM,8BAAO,GAAd;QACQ,IAAA,KAKF,IAAI,EAJN,iBAAiB,uBAAA,EACjB,qBAAqB,2BAAA,EACrB,qBAAqB,2BAAA,EACrB,OAAO,aACD,CAAC;QACT,OAAO;YACL,YAAY,EAAE;gBACZ,iBAAiB,mBAAA;gBACjB,qBAAqB,uBAAA;gBACrB,qBAAqB,uBAAA;aACtB;YACD,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,OAAO,EAAE,EAAX,CAAW,CAAC;SACvC,CAAC;IACJ,CAAC;IAEa,qBAAQ,GAA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eAAe,qBAAA,EACf,OAAO,aAAA,EACP,UAAU,gBAAA,EACV,eAAe,qBAAA,EACf,eAAe,qBACT,CAAC;YAET,OAAO,mCAA4B,CAAC,WAAW,CAAC;gBAC9C,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE;gBAC1B,iBAAiB,EAAE,2BAAoB,CAAC,WAAW,CAAC;oBAClD,cAAc,EAAE,eAAe;oBAC/B,cAAc,EAAE,cAAI,CAAC,UAAU,CAAC,eAAe,CAAC;oBAChD,cAAc,EAAE,eAAe,CAAC,OAAO,EAAE;oBACzC,SAAS,EAAE,UAAU,CAAC,OAAO,EAAE;iBAChC,CAAC;aACH,CAAC,CAAC;QACL,CAAC;QAEa,eAAS,GAAvB,UAAwB,KAAkB;YACxC,IAAM,sBAAsB,GAC1B,KAAK,CAAC,iBAAyC,CAAC;YAElD,OAAO,IAAI,KAAK,CACd,aAAK,CAAC,SAAS,CAAC,sBAAsB,CAAC,cAAc,CAAC,EACtD,aAAK,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,EAC9B,aAAK,CAAC,SAAS,CAAC,sBAAsB,CAAC,SAAS,CAAC,EACjD,sBAAsB,CAAC,cAAc,CAAC,QAAQ,EAAE,EAChD,sBAAsB,CAAC,cAAsB,CAC9C,CAAC;QACJ,CAAC;QACH,YAAC;IAAD,CAAC,AA3HD,CAA2B,uBAAgB,GA2H1C;IA3HY,kBAAK,QA2HjB,CAAA;AAyBH,CAAC,EAzKgB,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAyK5B;AAlSY,oCAAY"}
@@ -1,75 +0,0 @@
1
- import { JSONSerializable } from '../../util/json';
2
- import { Coins } from '../Coins';
3
- import { AccAddress, ValAddress } from '../bech32';
4
- import { UnbondingDelegation as UnbondingDelegation_pb, UnbondingDelegationEntry as UnbondingDelegationEntry_pb } from '@initia/initia.proto/initia/mstaking/v1/staking';
5
- /**
6
- * When a delegator decides to take out their funds from the staking pool, they must
7
- * unbond their tokens which takes an amount of time specified by `unbonding_time`
8
- * parameter in the staking module.
9
- *
10
- * An unbonding delegation is implemented through creating [[UnbondingDelegation.Entry]]
11
- * objects, limited by the max_entry parameter in the staking module params. You cannot
12
- * initiate unbonds more times than the amount of entries permitted. Entries are cleared
13
- * when their unbonding periods are completed and the funds are returned to the
14
- * delegator's account balance to be spent freely.
15
- */
16
- export declare class UnbondingDelegation extends JSONSerializable<UnbondingDelegation.Amino, UnbondingDelegation.Data, UnbondingDelegation.Proto> {
17
- delegator_address: AccAddress;
18
- validator_address: ValAddress;
19
- entries: UnbondingDelegation.Entry[];
20
- constructor(delegator_address: AccAddress, validator_address: ValAddress, entries: UnbondingDelegation.Entry[]);
21
- static fromAmino(data: UnbondingDelegation.Amino): UnbondingDelegation;
22
- toAmino(): UnbondingDelegation.Amino;
23
- static fromData(data: UnbondingDelegation.Data): UnbondingDelegation;
24
- toData(): UnbondingDelegation.Data;
25
- toProto(): UnbondingDelegation.Proto;
26
- static fromProto(proto: UnbondingDelegation.Proto): UnbondingDelegation;
27
- }
28
- export declare namespace UnbondingDelegation {
29
- interface Amino {
30
- delegator_address: AccAddress;
31
- validator_address: ValAddress;
32
- entries: UnbondingDelegation.Entry.Amino[];
33
- }
34
- interface Data {
35
- delegator_address: AccAddress;
36
- validator_address: ValAddress;
37
- entries: UnbondingDelegation.Entry.Data[];
38
- }
39
- type Proto = UnbondingDelegation_pb;
40
- class Entry extends JSONSerializable<Entry.Amino, Entry.Data, Entry.Proto> {
41
- creation_height: number;
42
- completion_time: Date;
43
- initial_balance: Coins;
44
- balance: Coins;
45
- /**
46
- * Note that the size of the undelegation is `initial_balance - balance`
47
- * @param initial_balance balance of delegation prior to initiating unbond
48
- * @param balance balance of delegation after initiating unbond
49
- * @param creation_height height of blockchain when entry was created
50
- * @param completion_time time when unbonding will be completed
51
- */
52
- constructor(initial_balance: Coins.Input, balance: Coins.Input, creation_height: number, completion_time: Date);
53
- toAmino(): Entry.Amino;
54
- static fromAmino(data: Entry.Amino): Entry;
55
- toData(): Entry.Data;
56
- static fromData(data: Entry.Data): Entry;
57
- toProto(): Entry.Proto;
58
- static fromProto(proto: Entry.Proto): Entry;
59
- }
60
- namespace Entry {
61
- interface Amino {
62
- initial_balance: Coins.Amino;
63
- balance: Coins.Amino;
64
- creation_height: string;
65
- completion_time: string;
66
- }
67
- interface Data {
68
- initial_balance: Coins.Data;
69
- balance: Coins.Data;
70
- creation_height: string;
71
- completion_time: string;
72
- }
73
- type Proto = UnbondingDelegationEntry_pb;
74
- }
75
- }