@wallfree-dev/polkadot 0.13.42
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/LICENSE.md +7 -0
- package/index.d.ts +1 -0
- package/index.js +18 -0
- package/index.js.map +1 -0
- package/package.json +65 -0
- package/readme.md +121 -0
- package/v0/index.d.ts +5 -0
- package/v0/index.js +31 -0
- package/v0/index.js.map +1 -0
- package/v0/protocol/kusama/KusamaProtocol.d.ts +22 -0
- package/v0/protocol/kusama/KusamaProtocol.js +71 -0
- package/v0/protocol/kusama/KusamaProtocol.js.map +1 -0
- package/v0/protocol/kusama/KusamaProtocolOptions.d.ts +23 -0
- package/v0/protocol/kusama/KusamaProtocolOptions.js +85 -0
- package/v0/protocol/kusama/KusamaProtocolOptions.js.map +1 -0
- package/v0/protocol/polkadot/PolkadotProtocol.d.ts +23 -0
- package/v0/protocol/polkadot/PolkadotProtocol.js +72 -0
- package/v0/protocol/polkadot/PolkadotProtocol.js.map +1 -0
- package/v0/protocol/polkadot/PolkadotProtocolOptions.d.ts +23 -0
- package/v0/protocol/polkadot/PolkadotProtocolOptions.js +85 -0
- package/v0/protocol/polkadot/PolkadotProtocolOptions.js.map +1 -0
- package/v1/controller/PolkadotAccountController.d.ts +30 -0
- package/v1/controller/PolkadotAccountController.js +675 -0
- package/v1/controller/PolkadotAccountController.js.map +1 -0
- package/v1/controller/PolkadotTransactionController.d.ts +5 -0
- package/v1/controller/PolkadotTransactionController.js +28 -0
- package/v1/controller/PolkadotTransactionController.js.map +1 -0
- package/v1/data/staking/PolkadotActiveEraInfo.d.ts +8 -0
- package/v1/data/staking/PolkadotActiveEraInfo.js +19 -0
- package/v1/data/staking/PolkadotActiveEraInfo.js.map +1 -0
- package/v1/data/staking/PolkadotEraRewardPoints.d.ts +8 -0
- package/v1/data/staking/PolkadotEraRewardPoints.js +21 -0
- package/v1/data/staking/PolkadotEraRewardPoints.js.map +1 -0
- package/v1/data/staking/PolkadotExposure.d.ts +9 -0
- package/v1/data/staking/PolkadotExposure.js +23 -0
- package/v1/data/staking/PolkadotExposure.js.map +1 -0
- package/v1/data/staking/PolkadotNominationStatus.d.ts +5 -0
- package/v1/data/staking/PolkadotNominationStatus.js +10 -0
- package/v1/data/staking/PolkadotNominationStatus.js.map +1 -0
- package/v1/data/staking/PolkadotNominations.d.ts +9 -0
- package/v1/data/staking/PolkadotNominations.js +21 -0
- package/v1/data/staking/PolkadotNominations.js.map +1 -0
- package/v1/data/staking/PolkadotNominatorDetails.d.ts +24 -0
- package/v1/data/staking/PolkadotNominatorDetails.js +3 -0
- package/v1/data/staking/PolkadotNominatorDetails.js.map +1 -0
- package/v1/data/staking/PolkadotPayee.d.ts +5 -0
- package/v1/data/staking/PolkadotPayee.js +10 -0
- package/v1/data/staking/PolkadotPayee.js.map +1 -0
- package/v1/data/staking/PolkadotSlashingSpans.d.ts +10 -0
- package/v1/data/staking/PolkadotSlashingSpans.js +23 -0
- package/v1/data/staking/PolkadotSlashingSpans.js.map +1 -0
- package/v1/data/staking/PolkadotStakingActionType.d.ts +14 -0
- package/v1/data/staking/PolkadotStakingActionType.js +19 -0
- package/v1/data/staking/PolkadotStakingActionType.js.map +1 -0
- package/v1/data/staking/PolkadotStakingBalance.d.ts +5 -0
- package/v1/data/staking/PolkadotStakingBalance.js +3 -0
- package/v1/data/staking/PolkadotStakingBalance.js.map +1 -0
- package/v1/data/staking/PolkadotStakingLedger.d.ts +11 -0
- package/v1/data/staking/PolkadotStakingLedger.js +27 -0
- package/v1/data/staking/PolkadotStakingLedger.js.map +1 -0
- package/v1/data/staking/PolkadotValidatorDetails.d.ts +16 -0
- package/v1/data/staking/PolkadotValidatorDetails.js +3 -0
- package/v1/data/staking/PolkadotValidatorDetails.js.map +1 -0
- package/v1/data/staking/PolkadotValidatorPrefs.d.ts +7 -0
- package/v1/data/staking/PolkadotValidatorPrefs.js +17 -0
- package/v1/data/staking/PolkadotValidatorPrefs.js.map +1 -0
- package/v1/data/transaction/method/args.d.ts +2 -0
- package/v1/data/transaction/method/args.js +441 -0
- package/v1/data/transaction/method/args.js.map +1 -0
- package/v1/data/transaction/transaction.d.ts +2 -0
- package/v1/data/transaction/transaction.js +28 -0
- package/v1/data/transaction/transaction.js.map +1 -0
- package/v1/index.d.ts +15 -0
- package/v1/index.js +16 -0
- package/v1/index.js.map +1 -0
- package/v1/module/PolkadotModule.d.ts +19 -0
- package/v1/module/PolkadotModule.js +113 -0
- package/v1/module/PolkadotModule.js.map +1 -0
- package/v1/module.d.ts +3 -0
- package/v1/module.js +24 -0
- package/v1/module.js.map +1 -0
- package/v1/node/PolkadotNodeClient.d.ts +45 -0
- package/v1/node/PolkadotNodeClient.js +319 -0
- package/v1/node/PolkadotNodeClient.js.map +1 -0
- package/v1/protocol/KusamaProtocol.d.ts +14 -0
- package/v1/protocol/KusamaProtocol.js +106 -0
- package/v1/protocol/KusamaProtocol.js.map +1 -0
- package/v1/protocol/PolkadotBaseProtocol.d.ts +57 -0
- package/v1/protocol/PolkadotBaseProtocol.js +737 -0
- package/v1/protocol/PolkadotBaseProtocol.js.map +1 -0
- package/v1/protocol/PolkadotProtocol.d.ts +14 -0
- package/v1/protocol/PolkadotProtocol.js +119 -0
- package/v1/protocol/PolkadotProtocol.js.map +1 -0
- package/v1/serializer/v3/schemas/converter/transaction-converter.d.ts +7 -0
- package/v1/serializer/v3/schemas/converter/transaction-converter.js +21 -0
- package/v1/serializer/v3/schemas/converter/transaction-converter.js.map +1 -0
- package/v1/serializer/v3/schemas/definitions/transaction-sign-request-polkadot.d.ts +3 -0
- package/v1/serializer/v3/schemas/definitions/transaction-sign-request-polkadot.js +3 -0
- package/v1/serializer/v3/schemas/definitions/transaction-sign-request-polkadot.js.map +1 -0
- package/v1/serializer/v3/schemas/definitions/transaction-sign-response-polkadot.d.ts +3 -0
- package/v1/serializer/v3/schemas/definitions/transaction-sign-response-polkadot.js +3 -0
- package/v1/serializer/v3/schemas/definitions/transaction-sign-response-polkadot.js.map +1 -0
- package/v1/serializer/v3/schemas/generated/transaction-sign-request-polkadot.json +36 -0
- package/v1/serializer/v3/schemas/generated/transaction-sign-response-polkadot.json +19 -0
- package/v1/serializer/v3/serializer-companion.d.ts +14 -0
- package/v1/serializer/v3/serializer-companion.js +189 -0
- package/v1/serializer/v3/serializer-companion.js.map +1 -0
- package/v1/serializer/v3/validators/transaction-validator.d.ts +4 -0
- package/v1/serializer/v3/validators/transaction-validator.js +28 -0
- package/v1/serializer/v3/validators/transaction-validator.js.map +1 -0
- package/v1/serializer/v3/validators/validators.d.ts +4 -0
- package/v1/serializer/v3/validators/validators.js +6 -0
- package/v1/serializer/v3/validators/validators.js.map +1 -0
- package/v1/types/configuration.d.ts +11 -0
- package/v1/types/configuration.js +3 -0
- package/v1/types/configuration.js.map +1 -0
- package/v1/types/crypto.d.ts +2 -0
- package/v1/types/crypto.js +3 -0
- package/v1/types/crypto.js.map +1 -0
- package/v1/types/protocol.d.ts +13 -0
- package/v1/types/protocol.js +3 -0
- package/v1/types/protocol.js.map +1 -0
|
@@ -0,0 +1,441 @@
|
|
|
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.factories = void 0;
|
|
19
|
+
// tslint:disable: max-classes-per-file
|
|
20
|
+
var coinlib_core_1 = require("@wallfree-dev/coinlib-core");
|
|
21
|
+
var errors_1 = require("@wallfree-dev/coinlib-core/errors");
|
|
22
|
+
var assert_1 = require("@wallfree-dev/coinlib-core/utils/assert");
|
|
23
|
+
var module_kit_1 = require("@wallfree-dev/module-kit");
|
|
24
|
+
var v1_1 = require("@wallfree-dev/substrate/v1");
|
|
25
|
+
var PolkadotPayee_1 = require("../../staking/PolkadotPayee");
|
|
26
|
+
function factories(type) {
|
|
27
|
+
return {
|
|
28
|
+
createArgsFactory: function (configuration, args) {
|
|
29
|
+
return createArgsFactory(configuration, type, args);
|
|
30
|
+
},
|
|
31
|
+
createArgsDecoder: function (configuration) {
|
|
32
|
+
return createArgsDecoder(configuration, type);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
exports.factories = factories;
|
|
37
|
+
function createArgsFactory(configuration, type, args) {
|
|
38
|
+
switch (type) {
|
|
39
|
+
case 'bond':
|
|
40
|
+
(0, assert_1.assertFields)(type, args, 'value', 'payee');
|
|
41
|
+
return new BondArgsFactory(configuration, args);
|
|
42
|
+
case 'unbond':
|
|
43
|
+
(0, assert_1.assertFields)(type, args, 'value');
|
|
44
|
+
return new UnbondArgsFactory(configuration, args);
|
|
45
|
+
case 'rebond':
|
|
46
|
+
(0, assert_1.assertFields)(type, args, 'value');
|
|
47
|
+
return new RebondArgsFactory(configuration, args);
|
|
48
|
+
case 'bond_extra':
|
|
49
|
+
(0, assert_1.assertFields)(type, args, 'value');
|
|
50
|
+
return new BondExtraArgsFactory(configuration, args);
|
|
51
|
+
case 'withdraw_unbonded':
|
|
52
|
+
(0, assert_1.assertFields)(type, args, 'slashingSpansNumber');
|
|
53
|
+
return new WithdrawUnbondedArgsFactory(configuration, args);
|
|
54
|
+
case 'nominate':
|
|
55
|
+
(0, assert_1.assertFields)(type, args, 'targets');
|
|
56
|
+
return new NominateArgsFactory(configuration, args);
|
|
57
|
+
case 'cancel_nomination':
|
|
58
|
+
return new StopNominatingArgsFactory(configuration, args);
|
|
59
|
+
case 'collect_payout':
|
|
60
|
+
(0, assert_1.assertFields)(type, args, 'eraIndex', 'validators');
|
|
61
|
+
return new PayoutStakersArgsFactory(configuration, args);
|
|
62
|
+
case 'set_payee':
|
|
63
|
+
(0, assert_1.assertFields)(type, args, 'payee');
|
|
64
|
+
return new SetPayeeArgsFactory(configuration, args);
|
|
65
|
+
case 'set_controller':
|
|
66
|
+
(0, assert_1.assertFields)(type, args, 'controller');
|
|
67
|
+
return new SetControllerArgsFactory(configuration, args);
|
|
68
|
+
default:
|
|
69
|
+
(0, assert_1.assertNever)(type);
|
|
70
|
+
throw new errors_1.UnsupportedError(coinlib_core_1.Domain.SUBSTRATE, "Unsupported Polkadot transaction type ".concat(type));
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
function createArgsDecoder(_configuration, type) {
|
|
74
|
+
switch (type) {
|
|
75
|
+
case 'bond':
|
|
76
|
+
return new BondArgsDecoder();
|
|
77
|
+
case 'unbond':
|
|
78
|
+
return new UnbondArgsDecoder();
|
|
79
|
+
case 'rebond':
|
|
80
|
+
return new RebondArgsDecoder();
|
|
81
|
+
case 'bond_extra':
|
|
82
|
+
return new BondExtraArgsDecoder();
|
|
83
|
+
case 'withdraw_unbonded':
|
|
84
|
+
return new WithdrawUnbondedArgsDecoder();
|
|
85
|
+
case 'nominate':
|
|
86
|
+
return new NominateArgsDecoder();
|
|
87
|
+
case 'cancel_nomination':
|
|
88
|
+
return new StopNominatingArgsDecoder();
|
|
89
|
+
case 'collect_payout':
|
|
90
|
+
return new PayoutStakersArgsDecoder();
|
|
91
|
+
case 'set_payee':
|
|
92
|
+
return new SetPayeeArgsDecoder();
|
|
93
|
+
case 'set_controller':
|
|
94
|
+
return new SetControllerArgsDecoder();
|
|
95
|
+
default:
|
|
96
|
+
(0, assert_1.assertNever)(type);
|
|
97
|
+
throw new errors_1.UnsupportedError(coinlib_core_1.Domain.SUBSTRATE, "Unsupported Polkadot transaction type ".concat(type));
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
var BondArgsFactory = /** @class */ (function (_super) {
|
|
101
|
+
__extends(BondArgsFactory, _super);
|
|
102
|
+
function BondArgsFactory() {
|
|
103
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
104
|
+
}
|
|
105
|
+
BondArgsFactory.prototype.createFields = function () {
|
|
106
|
+
return [
|
|
107
|
+
// ['controller', scaleAddressFactory(this.configuration).from(this.args.controller, this.configuration)],
|
|
108
|
+
['value', v1_1.SCALECompactInt.from(this.args.value)],
|
|
109
|
+
['payee', v1_1.SCALEEnum.from(this.args.payee)]
|
|
110
|
+
];
|
|
111
|
+
};
|
|
112
|
+
BondArgsFactory.prototype.createToAirGapTransactionParts = function () {
|
|
113
|
+
var _this = this;
|
|
114
|
+
return function () { return [
|
|
115
|
+
{
|
|
116
|
+
// to: [
|
|
117
|
+
// substrateAddressFactory(this.configuration)
|
|
118
|
+
// .from(this.args.controller)
|
|
119
|
+
// .asString()
|
|
120
|
+
// ],
|
|
121
|
+
amount: (0, module_kit_1.newAmount)(_this.args.value, 'blockchain')
|
|
122
|
+
}
|
|
123
|
+
]; };
|
|
124
|
+
};
|
|
125
|
+
return BondArgsFactory;
|
|
126
|
+
}(v1_1.SubstrateTransactionMethodArgsFactory));
|
|
127
|
+
var BondArgsDecoder = /** @class */ (function (_super) {
|
|
128
|
+
__extends(BondArgsDecoder, _super);
|
|
129
|
+
function BondArgsDecoder() {
|
|
130
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
131
|
+
}
|
|
132
|
+
BondArgsDecoder.prototype._decode = function (decoder) {
|
|
133
|
+
var value = decoder.decodeNextCompactInt();
|
|
134
|
+
var payee = decoder.decodeNextEnum(function (value) { return PolkadotPayee_1.PolkadotPayee[PolkadotPayee_1.PolkadotPayee[value]]; });
|
|
135
|
+
return {
|
|
136
|
+
bytesDecoded: value.bytesDecoded + payee.bytesDecoded,
|
|
137
|
+
decoded: {
|
|
138
|
+
value: value.decoded.value,
|
|
139
|
+
payee: payee.decoded.value
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
return BondArgsDecoder;
|
|
144
|
+
}(v1_1.SubstrateTransactionMethodArgsDecoder));
|
|
145
|
+
var UnbondArgsFactory = /** @class */ (function (_super) {
|
|
146
|
+
__extends(UnbondArgsFactory, _super);
|
|
147
|
+
function UnbondArgsFactory() {
|
|
148
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
149
|
+
}
|
|
150
|
+
UnbondArgsFactory.prototype.createFields = function () {
|
|
151
|
+
return [['value', v1_1.SCALECompactInt.from(this.args.value)]];
|
|
152
|
+
};
|
|
153
|
+
UnbondArgsFactory.prototype.createToAirGapTransactionParts = function () {
|
|
154
|
+
var _this = this;
|
|
155
|
+
return function () { return [
|
|
156
|
+
{
|
|
157
|
+
amount: (0, module_kit_1.newAmount)(_this.args.value, 'blockchain')
|
|
158
|
+
}
|
|
159
|
+
]; };
|
|
160
|
+
};
|
|
161
|
+
return UnbondArgsFactory;
|
|
162
|
+
}(v1_1.SubstrateTransactionMethodArgsFactory));
|
|
163
|
+
var UnbondArgsDecoder = /** @class */ (function (_super) {
|
|
164
|
+
__extends(UnbondArgsDecoder, _super);
|
|
165
|
+
function UnbondArgsDecoder() {
|
|
166
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
167
|
+
}
|
|
168
|
+
UnbondArgsDecoder.prototype._decode = function (decoder) {
|
|
169
|
+
var value = decoder.decodeNextCompactInt();
|
|
170
|
+
return {
|
|
171
|
+
bytesDecoded: value.bytesDecoded,
|
|
172
|
+
decoded: {
|
|
173
|
+
value: value.decoded.value
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
return UnbondArgsDecoder;
|
|
178
|
+
}(v1_1.SubstrateTransactionMethodArgsDecoder));
|
|
179
|
+
var RebondArgsFactory = /** @class */ (function (_super) {
|
|
180
|
+
__extends(RebondArgsFactory, _super);
|
|
181
|
+
function RebondArgsFactory() {
|
|
182
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
183
|
+
}
|
|
184
|
+
RebondArgsFactory.prototype.createFields = function () {
|
|
185
|
+
return [['value', v1_1.SCALECompactInt.from(this.args.value)]];
|
|
186
|
+
};
|
|
187
|
+
RebondArgsFactory.prototype.createToAirGapTransactionParts = function () {
|
|
188
|
+
var _this = this;
|
|
189
|
+
return function () { return [
|
|
190
|
+
{
|
|
191
|
+
amount: (0, module_kit_1.newAmount)(_this.args.value, 'blockchain')
|
|
192
|
+
}
|
|
193
|
+
]; };
|
|
194
|
+
};
|
|
195
|
+
return RebondArgsFactory;
|
|
196
|
+
}(v1_1.SubstrateTransactionMethodArgsFactory));
|
|
197
|
+
var RebondArgsDecoder = /** @class */ (function (_super) {
|
|
198
|
+
__extends(RebondArgsDecoder, _super);
|
|
199
|
+
function RebondArgsDecoder() {
|
|
200
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
201
|
+
}
|
|
202
|
+
RebondArgsDecoder.prototype._decode = function (decoder) {
|
|
203
|
+
var value = decoder.decodeNextCompactInt();
|
|
204
|
+
return {
|
|
205
|
+
bytesDecoded: value.bytesDecoded,
|
|
206
|
+
decoded: {
|
|
207
|
+
value: value.decoded.value
|
|
208
|
+
}
|
|
209
|
+
};
|
|
210
|
+
};
|
|
211
|
+
return RebondArgsDecoder;
|
|
212
|
+
}(v1_1.SubstrateTransactionMethodArgsDecoder));
|
|
213
|
+
var BondExtraArgsFactory = /** @class */ (function (_super) {
|
|
214
|
+
__extends(BondExtraArgsFactory, _super);
|
|
215
|
+
function BondExtraArgsFactory() {
|
|
216
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
217
|
+
}
|
|
218
|
+
BondExtraArgsFactory.prototype.createFields = function () {
|
|
219
|
+
return [['value', v1_1.SCALECompactInt.from(this.args.value)]];
|
|
220
|
+
};
|
|
221
|
+
BondExtraArgsFactory.prototype.createToAirGapTransactionParts = function () {
|
|
222
|
+
var _this = this;
|
|
223
|
+
return function () { return [
|
|
224
|
+
{
|
|
225
|
+
amount: (0, module_kit_1.newAmount)(_this.args.value, 'blockchain')
|
|
226
|
+
}
|
|
227
|
+
]; };
|
|
228
|
+
};
|
|
229
|
+
return BondExtraArgsFactory;
|
|
230
|
+
}(v1_1.SubstrateTransactionMethodArgsFactory));
|
|
231
|
+
var BondExtraArgsDecoder = /** @class */ (function (_super) {
|
|
232
|
+
__extends(BondExtraArgsDecoder, _super);
|
|
233
|
+
function BondExtraArgsDecoder() {
|
|
234
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
235
|
+
}
|
|
236
|
+
BondExtraArgsDecoder.prototype._decode = function (decoder) {
|
|
237
|
+
var value = decoder.decodeNextCompactInt();
|
|
238
|
+
return {
|
|
239
|
+
bytesDecoded: value.bytesDecoded,
|
|
240
|
+
decoded: {
|
|
241
|
+
value: value.decoded.value
|
|
242
|
+
}
|
|
243
|
+
};
|
|
244
|
+
};
|
|
245
|
+
return BondExtraArgsDecoder;
|
|
246
|
+
}(v1_1.SubstrateTransactionMethodArgsDecoder));
|
|
247
|
+
var WithdrawUnbondedArgsFactory = /** @class */ (function (_super) {
|
|
248
|
+
__extends(WithdrawUnbondedArgsFactory, _super);
|
|
249
|
+
function WithdrawUnbondedArgsFactory() {
|
|
250
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
251
|
+
}
|
|
252
|
+
WithdrawUnbondedArgsFactory.prototype.createFields = function () {
|
|
253
|
+
return [['slashingSpansNumber', v1_1.SCALEInt.from(this.args.slashingSpansNumber, 32)]];
|
|
254
|
+
};
|
|
255
|
+
WithdrawUnbondedArgsFactory.prototype.createToAirGapTransactionParts = function () {
|
|
256
|
+
return function () { return []; };
|
|
257
|
+
};
|
|
258
|
+
return WithdrawUnbondedArgsFactory;
|
|
259
|
+
}(v1_1.SubstrateTransactionMethodArgsFactory));
|
|
260
|
+
var WithdrawUnbondedArgsDecoder = /** @class */ (function (_super) {
|
|
261
|
+
__extends(WithdrawUnbondedArgsDecoder, _super);
|
|
262
|
+
function WithdrawUnbondedArgsDecoder() {
|
|
263
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
264
|
+
}
|
|
265
|
+
WithdrawUnbondedArgsDecoder.prototype._decode = function (decoder) {
|
|
266
|
+
var slashingSpansNumber = decoder.decodeNextInt(32);
|
|
267
|
+
return {
|
|
268
|
+
bytesDecoded: slashingSpansNumber.bytesDecoded,
|
|
269
|
+
decoded: {
|
|
270
|
+
slashingSpansNumber: slashingSpansNumber.decoded.toNumber()
|
|
271
|
+
}
|
|
272
|
+
};
|
|
273
|
+
};
|
|
274
|
+
return WithdrawUnbondedArgsDecoder;
|
|
275
|
+
}(v1_1.SubstrateTransactionMethodArgsDecoder));
|
|
276
|
+
var NominateArgsFactory = /** @class */ (function (_super) {
|
|
277
|
+
__extends(NominateArgsFactory, _super);
|
|
278
|
+
function NominateArgsFactory() {
|
|
279
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
280
|
+
}
|
|
281
|
+
NominateArgsFactory.prototype.createFields = function () {
|
|
282
|
+
var _this = this;
|
|
283
|
+
return [
|
|
284
|
+
[
|
|
285
|
+
'targets',
|
|
286
|
+
v1_1.SCALEArray.from(this.args.targets.map(function (target) { return (0, v1_1.scaleAddressFactory)(_this.configuration).from(target, _this.configuration); }))
|
|
287
|
+
]
|
|
288
|
+
];
|
|
289
|
+
};
|
|
290
|
+
NominateArgsFactory.prototype.createToAirGapTransactionParts = function () {
|
|
291
|
+
var _this = this;
|
|
292
|
+
return function () { return [
|
|
293
|
+
{
|
|
294
|
+
to: _this.args.targets.map(function (target) { return (0, v1_1.substrateAddressFactory)(_this.configuration).from(target).asString(); })
|
|
295
|
+
}
|
|
296
|
+
]; };
|
|
297
|
+
};
|
|
298
|
+
return NominateArgsFactory;
|
|
299
|
+
}(v1_1.SubstrateTransactionMethodArgsFactory));
|
|
300
|
+
var NominateArgsDecoder = /** @class */ (function (_super) {
|
|
301
|
+
__extends(NominateArgsDecoder, _super);
|
|
302
|
+
function NominateArgsDecoder() {
|
|
303
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
304
|
+
}
|
|
305
|
+
NominateArgsDecoder.prototype._decode = function (decoder) {
|
|
306
|
+
var targets = decoder.decodeNextArray(function (network, runtimeVersion, hex) {
|
|
307
|
+
return (0, v1_1.scaleAddressFactory)(network).decode(network, runtimeVersion, hex);
|
|
308
|
+
});
|
|
309
|
+
return {
|
|
310
|
+
bytesDecoded: targets.bytesDecoded,
|
|
311
|
+
decoded: {
|
|
312
|
+
targets: targets.decoded.elements.map(function (target) { return target.toString(); })
|
|
313
|
+
}
|
|
314
|
+
};
|
|
315
|
+
};
|
|
316
|
+
return NominateArgsDecoder;
|
|
317
|
+
}(v1_1.SubstrateTransactionMethodArgsDecoder));
|
|
318
|
+
var StopNominatingArgsFactory = /** @class */ (function (_super) {
|
|
319
|
+
__extends(StopNominatingArgsFactory, _super);
|
|
320
|
+
function StopNominatingArgsFactory() {
|
|
321
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
322
|
+
}
|
|
323
|
+
StopNominatingArgsFactory.prototype.createFields = function () {
|
|
324
|
+
return [];
|
|
325
|
+
};
|
|
326
|
+
StopNominatingArgsFactory.prototype.createToAirGapTransactionParts = function () {
|
|
327
|
+
return function () { return []; };
|
|
328
|
+
};
|
|
329
|
+
return StopNominatingArgsFactory;
|
|
330
|
+
}(v1_1.SubstrateTransactionMethodArgsFactory));
|
|
331
|
+
var StopNominatingArgsDecoder = /** @class */ (function (_super) {
|
|
332
|
+
__extends(StopNominatingArgsDecoder, _super);
|
|
333
|
+
function StopNominatingArgsDecoder() {
|
|
334
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
335
|
+
}
|
|
336
|
+
StopNominatingArgsDecoder.prototype._decode = function (decoder) {
|
|
337
|
+
return {
|
|
338
|
+
bytesDecoded: 0,
|
|
339
|
+
decoded: {}
|
|
340
|
+
};
|
|
341
|
+
};
|
|
342
|
+
return StopNominatingArgsDecoder;
|
|
343
|
+
}(v1_1.SubstrateTransactionMethodArgsDecoder));
|
|
344
|
+
var PayoutStakersArgsFactory = /** @class */ (function (_super) {
|
|
345
|
+
__extends(PayoutStakersArgsFactory, _super);
|
|
346
|
+
function PayoutStakersArgsFactory() {
|
|
347
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
348
|
+
}
|
|
349
|
+
PayoutStakersArgsFactory.prototype.createFields = function () {
|
|
350
|
+
return [
|
|
351
|
+
['validatorStash', (0, v1_1.scaleAddressFactory)(this.configuration).from(this.args.validator, this.configuration)],
|
|
352
|
+
['era', v1_1.SCALEInt.from(this.args.era, 32)]
|
|
353
|
+
];
|
|
354
|
+
};
|
|
355
|
+
PayoutStakersArgsFactory.prototype.createToAirGapTransactionParts = function () {
|
|
356
|
+
return function () { return []; };
|
|
357
|
+
};
|
|
358
|
+
return PayoutStakersArgsFactory;
|
|
359
|
+
}(v1_1.SubstrateTransactionMethodArgsFactory));
|
|
360
|
+
var PayoutStakersArgsDecoder = /** @class */ (function (_super) {
|
|
361
|
+
__extends(PayoutStakersArgsDecoder, _super);
|
|
362
|
+
function PayoutStakersArgsDecoder() {
|
|
363
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
364
|
+
}
|
|
365
|
+
PayoutStakersArgsDecoder.prototype._decode = function (decoder) {
|
|
366
|
+
var validatorStash = decoder.decodeNextAccountId();
|
|
367
|
+
var era = decoder.decodeNextInt(32);
|
|
368
|
+
return {
|
|
369
|
+
bytesDecoded: era.bytesDecoded + validatorStash.bytesDecoded,
|
|
370
|
+
decoded: {
|
|
371
|
+
validator: validatorStash.decoded.address,
|
|
372
|
+
era: era.decoded.value
|
|
373
|
+
}
|
|
374
|
+
};
|
|
375
|
+
};
|
|
376
|
+
return PayoutStakersArgsDecoder;
|
|
377
|
+
}(v1_1.SubstrateTransactionMethodArgsDecoder));
|
|
378
|
+
var SetPayeeArgsFactory = /** @class */ (function (_super) {
|
|
379
|
+
__extends(SetPayeeArgsFactory, _super);
|
|
380
|
+
function SetPayeeArgsFactory() {
|
|
381
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
382
|
+
}
|
|
383
|
+
SetPayeeArgsFactory.prototype.createFields = function () {
|
|
384
|
+
return [['payee', v1_1.SCALEEnum.from(this.args.payee)]];
|
|
385
|
+
};
|
|
386
|
+
SetPayeeArgsFactory.prototype.createToAirGapTransactionParts = function () {
|
|
387
|
+
return function () { return []; };
|
|
388
|
+
};
|
|
389
|
+
return SetPayeeArgsFactory;
|
|
390
|
+
}(v1_1.SubstrateTransactionMethodArgsFactory));
|
|
391
|
+
var SetPayeeArgsDecoder = /** @class */ (function (_super) {
|
|
392
|
+
__extends(SetPayeeArgsDecoder, _super);
|
|
393
|
+
function SetPayeeArgsDecoder() {
|
|
394
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
395
|
+
}
|
|
396
|
+
SetPayeeArgsDecoder.prototype._decode = function (decoder) {
|
|
397
|
+
var payee = decoder.decodeNextEnum(function (value) { return PolkadotPayee_1.PolkadotPayee[PolkadotPayee_1.PolkadotPayee[value]]; });
|
|
398
|
+
return {
|
|
399
|
+
bytesDecoded: payee.bytesDecoded,
|
|
400
|
+
decoded: {
|
|
401
|
+
payee: payee.decoded.value
|
|
402
|
+
}
|
|
403
|
+
};
|
|
404
|
+
};
|
|
405
|
+
return SetPayeeArgsDecoder;
|
|
406
|
+
}(v1_1.SubstrateTransactionMethodArgsDecoder));
|
|
407
|
+
var SetControllerArgsFactory = /** @class */ (function (_super) {
|
|
408
|
+
__extends(SetControllerArgsFactory, _super);
|
|
409
|
+
function SetControllerArgsFactory() {
|
|
410
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
411
|
+
}
|
|
412
|
+
SetControllerArgsFactory.prototype.createFields = function () {
|
|
413
|
+
return [['controller', (0, v1_1.scaleAddressFactory)(this.configuration).from(this.args.controller, this.configuration)]];
|
|
414
|
+
};
|
|
415
|
+
SetControllerArgsFactory.prototype.createToAirGapTransactionParts = function () {
|
|
416
|
+
var _this = this;
|
|
417
|
+
return function () { return [
|
|
418
|
+
{
|
|
419
|
+
to: [(0, v1_1.substrateAddressFactory)(_this.configuration).from(_this.args.controller).asString()]
|
|
420
|
+
}
|
|
421
|
+
]; };
|
|
422
|
+
};
|
|
423
|
+
return SetControllerArgsFactory;
|
|
424
|
+
}(v1_1.SubstrateTransactionMethodArgsFactory));
|
|
425
|
+
var SetControllerArgsDecoder = /** @class */ (function (_super) {
|
|
426
|
+
__extends(SetControllerArgsDecoder, _super);
|
|
427
|
+
function SetControllerArgsDecoder() {
|
|
428
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
429
|
+
}
|
|
430
|
+
SetControllerArgsDecoder.prototype._decode = function (decoder) {
|
|
431
|
+
var controller = decoder.decodeNextAccount();
|
|
432
|
+
return {
|
|
433
|
+
bytesDecoded: controller.bytesDecoded,
|
|
434
|
+
decoded: {
|
|
435
|
+
controller: controller.decoded.toString()
|
|
436
|
+
}
|
|
437
|
+
};
|
|
438
|
+
};
|
|
439
|
+
return SetControllerArgsDecoder;
|
|
440
|
+
}(v1_1.SubstrateTransactionMethodArgsDecoder));
|
|
441
|
+
//# sourceMappingURL=args.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"args.js","sourceRoot":"","sources":["../../../../../src/v1/data/transaction/method/args.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,uCAAuC;AACvC,2DAAmD;AAEnD,4DAAoE;AACpE,kEAAmF;AACnF,uDAAuE;AACvE,iDAcmC;AAGnC,6DAA2D;AAE3D,SAAgB,SAAS,CACvB,IAAO;IAEP,OAAO;QACL,iBAAiB,YAAC,aAAa,EAAE,IAAI;YACnC,OAAO,iBAAiB,CAAC,aAAa,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;QACrD,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|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.TRANSACTION_TYPES = void 0;
|
|
15
|
+
var args_1 = require("./method/args");
|
|
16
|
+
exports.TRANSACTION_TYPES = {
|
|
17
|
+
bond: __assign(__assign({}, (0, args_1.factories)('bond')), { index: 1 }),
|
|
18
|
+
unbond: __assign(__assign({}, (0, args_1.factories)('unbond')), { index: 2 }),
|
|
19
|
+
rebond: __assign(__assign({}, (0, args_1.factories)('rebond')), { index: 3 }),
|
|
20
|
+
bond_extra: __assign(__assign({}, (0, args_1.factories)('bond_extra')), { index: 4 }),
|
|
21
|
+
withdraw_unbonded: __assign(__assign({}, (0, args_1.factories)('withdraw_unbonded')), { index: 5 }),
|
|
22
|
+
nominate: __assign(__assign({}, (0, args_1.factories)('nominate')), { index: 6 }),
|
|
23
|
+
cancel_nomination: __assign(__assign({}, (0, args_1.factories)('cancel_nomination')), { index: 7 }),
|
|
24
|
+
collect_payout: __assign(__assign({}, (0, args_1.factories)('collect_payout')), { index: 8 }),
|
|
25
|
+
set_payee: __assign(__assign({}, (0, args_1.factories)('set_payee')), { index: 9 }),
|
|
26
|
+
set_controller: __assign(__assign({}, (0, args_1.factories)('set_controller')), { index: 10 })
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=transaction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transaction.js","sourceRoot":"","sources":["../../../../src/v1/data/transaction/transaction.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAEA,sCAAyC;AAE5B,QAAA,iBAAiB,GAA0D;IACtF,IAAI,wBAAO,IAAA,gBAAS,EAAC,MAAM,CAAC,KAAE,KAAK,EAAE,CAAC,GAAE;IACxC,MAAM,wBAAO,IAAA,gBAAS,EAAC,QAAQ,CAAC,KAAE,KAAK,EAAE,CAAC,GAAE;IAC5C,MAAM,wBAAO,IAAA,gBAAS,EAAC,QAAQ,CAAC,KAAE,KAAK,EAAE,CAAC,GAAE;IAC5C,UAAU,wBAAO,IAAA,gBAAS,EAAC,YAAY,CAAC,KAAE,KAAK,EAAE,CAAC,GAAE;IACpD,iBAAiB,wBAAO,IAAA,gBAAS,EAAC,mBAAmB,CAAC,KAAE,KAAK,EAAE,CAAC,GAAE;IAClE,QAAQ,wBAAO,IAAA,gBAAS,EAAC,UAAU,CAAC,KAAE,KAAK,EAAE,CAAC,GAAE;IAChD,iBAAiB,wBAAO,IAAA,gBAAS,EAAC,mBAAmB,CAAC,KAAE,KAAK,EAAE,CAAC,GAAE;IAClE,cAAc,wBAAO,IAAA,gBAAS,EAAC,gBAAgB,CAAC,KAAE,KAAK,EAAE,CAAC,GAAE;IAC5D,SAAS,wBAAO,IAAA,gBAAS,EAAC,WAAW,CAAC,KAAE,KAAK,EAAE,CAAC,GAAE;IAClD,cAAc,wBAAO,IAAA,gBAAS,EAAC,gBAAgB,CAAC,KAAE,KAAK,EAAE,EAAE,GAAE;CAC9D,CAAA"}
|
package/v1/index.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { PolkadotNominationStatus } from './data/staking/PolkadotNominationStatus';
|
|
2
|
+
import { PolkadotNominatorDetails, PolkadotStakingDetails } from './data/staking/PolkadotNominatorDetails';
|
|
3
|
+
import { PolkadotPayee } from './data/staking/PolkadotPayee';
|
|
4
|
+
import { PolkadotStakingActionType } from './data/staking/PolkadotStakingActionType';
|
|
5
|
+
import { PolkadotStakingBalance } from './data/staking/PolkadotStakingBalance';
|
|
6
|
+
import { PolkadotValidatorDetails } from './data/staking/PolkadotValidatorDetails';
|
|
7
|
+
import { PolkadotModule } from './module/PolkadotModule';
|
|
8
|
+
import { createKusamaProtocol, KusamaProtocol } from './protocol/KusamaProtocol';
|
|
9
|
+
import { createPolkadotProtocol, PolkadotProtocol } from './protocol/PolkadotProtocol';
|
|
10
|
+
import { PolkadotProtocolConfiguration } from './types/configuration';
|
|
11
|
+
import { PolkadotCryptoConfiguration } from './types/crypto';
|
|
12
|
+
import { KusamaUnits, PolkadotProtocolNetwork, PolkadotProtocolOptions, PolkadotUnits } from './types/protocol';
|
|
13
|
+
export { PolkadotModule };
|
|
14
|
+
export { PolkadotProtocol, createPolkadotProtocol, KusamaProtocol, createKusamaProtocol };
|
|
15
|
+
export { PolkadotCryptoConfiguration, PolkadotUnits, KusamaUnits, PolkadotProtocolNetwork, PolkadotProtocolOptions, PolkadotProtocolConfiguration, PolkadotStakingActionType, PolkadotStakingDetails, PolkadotStakingBalance, PolkadotNominatorDetails, PolkadotValidatorDetails, PolkadotNominationStatus, PolkadotPayee };
|
package/v1/index.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PolkadotPayee = exports.PolkadotNominationStatus = exports.PolkadotStakingActionType = exports.createKusamaProtocol = exports.createPolkadotProtocol = exports.PolkadotModule = void 0;
|
|
4
|
+
var PolkadotNominationStatus_1 = require("./data/staking/PolkadotNominationStatus");
|
|
5
|
+
Object.defineProperty(exports, "PolkadotNominationStatus", { enumerable: true, get: function () { return PolkadotNominationStatus_1.PolkadotNominationStatus; } });
|
|
6
|
+
var PolkadotPayee_1 = require("./data/staking/PolkadotPayee");
|
|
7
|
+
Object.defineProperty(exports, "PolkadotPayee", { enumerable: true, get: function () { return PolkadotPayee_1.PolkadotPayee; } });
|
|
8
|
+
var PolkadotStakingActionType_1 = require("./data/staking/PolkadotStakingActionType");
|
|
9
|
+
Object.defineProperty(exports, "PolkadotStakingActionType", { enumerable: true, get: function () { return PolkadotStakingActionType_1.PolkadotStakingActionType; } });
|
|
10
|
+
var PolkadotModule_1 = require("./module/PolkadotModule");
|
|
11
|
+
Object.defineProperty(exports, "PolkadotModule", { enumerable: true, get: function () { return PolkadotModule_1.PolkadotModule; } });
|
|
12
|
+
var KusamaProtocol_1 = require("./protocol/KusamaProtocol");
|
|
13
|
+
Object.defineProperty(exports, "createKusamaProtocol", { enumerable: true, get: function () { return KusamaProtocol_1.createKusamaProtocol; } });
|
|
14
|
+
var PolkadotProtocol_1 = require("./protocol/PolkadotProtocol");
|
|
15
|
+
Object.defineProperty(exports, "createPolkadotProtocol", { enumerable: true, get: function () { return PolkadotProtocol_1.createPolkadotProtocol; } });
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
package/v1/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/v1/index.ts"],"names":[],"mappings":";;;AAAA,oFAAkF;AAmChF,yGAnCO,mDAAwB,OAmCP;AAjC1B,8DAA4D;AAkC1D,8FAlCO,6BAAa,OAkCP;AAjCf,sFAAoF;AA2BlF,0GA3BO,qDAAyB,OA2BP;AAxB3B,0DAAwD;AAS/C,+FATA,+BAAc,OASA;AARvB,4DAAgF;AAYb,qGAZ1D,qCAAoB,OAY0D;AAXvF,gEAAsF;AAW3D,uGAXlB,yCAAsB,OAWkB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { MainProtocolSymbols } from '@wallfree-dev/coinlib-core';
|
|
2
|
+
import { AirGapModule, AirGapV3SerializerCompanion, ProtocolConfiguration } from '@wallfree-dev/module-kit';
|
|
3
|
+
import { BlockExplorer } from '@wallfree-dev/module-kit/block-explorer/block-explorer';
|
|
4
|
+
import { OfflineProtocol, OnlineProtocol } from '@wallfree-dev/module-kit/protocol/protocol';
|
|
5
|
+
import { PolkadotProtocolNetwork } from '../types/protocol';
|
|
6
|
+
declare type SupportedProtocols = MainProtocolSymbols.POLKADOT | MainProtocolSymbols.KUSAMA;
|
|
7
|
+
export declare class PolkadotModule implements AirGapModule<{
|
|
8
|
+
Protocols: SupportedProtocols;
|
|
9
|
+
ProtocolNetwork: PolkadotProtocolNetwork;
|
|
10
|
+
}> {
|
|
11
|
+
private readonly networkRegistries;
|
|
12
|
+
readonly supportedProtocols: Record<SupportedProtocols, ProtocolConfiguration>;
|
|
13
|
+
createOfflineProtocol(identifier: SupportedProtocols): Promise<OfflineProtocol | undefined>;
|
|
14
|
+
createOnlineProtocol(identifier: SupportedProtocols, networkOrId?: PolkadotProtocolNetwork | string): Promise<OnlineProtocol | undefined>;
|
|
15
|
+
createBlockExplorer(identifier: SupportedProtocols, networkOrId?: PolkadotProtocolNetwork | string): Promise<BlockExplorer | undefined>;
|
|
16
|
+
createV3SerializerCompanion(): Promise<AirGapV3SerializerCompanion>;
|
|
17
|
+
private createProtocol;
|
|
18
|
+
}
|
|
19
|
+
export {};
|