@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,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.PolkadotModule = void 0;
|
|
40
|
+
var coinlib_core_1 = require("@wallfree-dev/coinlib-core");
|
|
41
|
+
var errors_1 = require("@wallfree-dev/coinlib-core/errors");
|
|
42
|
+
var module_kit_1 = require("@wallfree-dev/module-kit");
|
|
43
|
+
var substrate_1 = require("@wallfree-dev/substrate");
|
|
44
|
+
var KusamaProtocol_1 = require("../protocol/KusamaProtocol");
|
|
45
|
+
var PolkadotProtocol_1 = require("../protocol/PolkadotProtocol");
|
|
46
|
+
var serializer_companion_1 = require("../serializer/v3/serializer-companion");
|
|
47
|
+
var PolkadotModule = /** @class */ (function () {
|
|
48
|
+
function PolkadotModule() {
|
|
49
|
+
var _a;
|
|
50
|
+
this.networkRegistries = (_a = {},
|
|
51
|
+
_a[coinlib_core_1.MainProtocolSymbols.POLKADOT] = new module_kit_1.ModuleNetworkRegistry({
|
|
52
|
+
supportedNetworks: [PolkadotProtocol_1.POLKADOT_MAINNET_PROTOCOL_NETWORK]
|
|
53
|
+
}),
|
|
54
|
+
_a[coinlib_core_1.MainProtocolSymbols.KUSAMA] = new module_kit_1.ModuleNetworkRegistry({
|
|
55
|
+
supportedNetworks: [KusamaProtocol_1.KUSAMA_MAINNET_PROTOCOL_NETWORK]
|
|
56
|
+
}),
|
|
57
|
+
_a);
|
|
58
|
+
this.supportedProtocols = (0, module_kit_1.createSupportedProtocols)(this.networkRegistries);
|
|
59
|
+
}
|
|
60
|
+
PolkadotModule.prototype.createOfflineProtocol = function (identifier) {
|
|
61
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
62
|
+
return __generator(this, function (_a) {
|
|
63
|
+
return [2 /*return*/, this.createProtocol(identifier)];
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
PolkadotModule.prototype.createOnlineProtocol = function (identifier, networkOrId) {
|
|
68
|
+
var _a;
|
|
69
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
70
|
+
var network;
|
|
71
|
+
return __generator(this, function (_b) {
|
|
72
|
+
network = typeof networkOrId === 'object' ? networkOrId : (_a = this.networkRegistries[identifier]) === null || _a === void 0 ? void 0 : _a.findNetwork(networkOrId);
|
|
73
|
+
if (network === undefined) {
|
|
74
|
+
throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.SUBSTRATE, "Protocol network type not supported. (Polkadot)");
|
|
75
|
+
}
|
|
76
|
+
return [2 /*return*/, this.createProtocol(identifier, network)];
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
PolkadotModule.prototype.createBlockExplorer = function (identifier, networkOrId) {
|
|
81
|
+
var _a;
|
|
82
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
83
|
+
var network;
|
|
84
|
+
return __generator(this, function (_b) {
|
|
85
|
+
network = typeof networkOrId === 'object' ? networkOrId : (_a = this.networkRegistries[identifier]) === null || _a === void 0 ? void 0 : _a.findNetwork(networkOrId);
|
|
86
|
+
if (network === undefined) {
|
|
87
|
+
throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.SUBSTRATE, "Block Explorer network type not supported. (Polkadot)");
|
|
88
|
+
}
|
|
89
|
+
return [2 /*return*/, new substrate_1.SubscanBlockExplorer(network.blockExplorerUrl)];
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
};
|
|
93
|
+
PolkadotModule.prototype.createV3SerializerCompanion = function () {
|
|
94
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
95
|
+
return __generator(this, function (_a) {
|
|
96
|
+
return [2 /*return*/, new serializer_companion_1.PolkadotV3SerializerCompanion()];
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
PolkadotModule.prototype.createProtocol = function (identifier, network) {
|
|
101
|
+
switch (identifier) {
|
|
102
|
+
case coinlib_core_1.MainProtocolSymbols.POLKADOT:
|
|
103
|
+
return (0, PolkadotProtocol_1.createPolkadotProtocol)({ network: network });
|
|
104
|
+
case coinlib_core_1.MainProtocolSymbols.KUSAMA:
|
|
105
|
+
return (0, KusamaProtocol_1.createKusamaProtocol)({ network: network });
|
|
106
|
+
default:
|
|
107
|
+
throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.SUBSTRATE, "Protocol ".concat(identifier, " not supported. (Polkadot)"));
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
return PolkadotModule;
|
|
111
|
+
}());
|
|
112
|
+
exports.PolkadotModule = PolkadotModule;
|
|
113
|
+
//# sourceMappingURL=PolkadotModule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PolkadotModule.js","sourceRoot":"","sources":["../../../src/v1/module/PolkadotModule.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2DAAwE;AACxE,4DAA2E;AAC3E,uDAOiC;AAGjC,qDAA8D;AAE9D,6DAAkG;AAClG,iEAAwG;AACxG,8EAAqF;AAKrF;IAAA;;QACmB,sBAAiB;YAChC,GAAC,kCAAmB,CAAC,QAAQ,IAAG,IAAI,kCAAqB,CAAC;gBACxD,iBAAiB,EAAE,CAAC,oDAAiC,CAAC;aACvD,CAAC;YACF,GAAC,kCAAmB,CAAC,MAAM,IAAG,IAAI,kCAAqB,CAAC;gBACtD,iBAAiB,EAAE,CAAC,gDAA+B,CAAC;aACrD,CAAC;gBACH;QACe,uBAAkB,GAAsD,IAAA,qCAAwB,EAAC,IAAI,CAAC,iBAAiB,CAAC,CAAA;IAgD1I,CAAC;IA9Cc,8CAAqB,GAAlC,UAAmC,UAA8B;;;gBAC/D,sBAAO,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,EAAA;;;KACvC;IAEY,6CAAoB,GAAjC,UACE,UAA8B,EAC9B,WAA8C;;;;;gBAExC,OAAO,GACX,OAAO,WAAW,KAAK,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,MAAA,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,0CAAE,WAAW,CAAC,WAAW,CAAC,CAAA;gBAE9G,IAAI,OAAO,KAAK,SAAS,EAAE;oBACzB,MAAM,IAAI,gCAAuB,CAAC,qBAAM,CAAC,SAAS,EAAE,iDAAiD,CAAC,CAAA;iBACvG;gBAED,sBAAO,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,OAAO,CAAC,EAAA;;;KAChD;IAEY,4CAAmB,GAAhC,UACE,UAA8B,EAC9B,WAA8C;;;;;gBAExC,OAAO,GACX,OAAO,WAAW,KAAK,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,MAAA,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,0CAAE,WAAW,CAAC,WAAW,CAAC,CAAA;gBAE9G,IAAI,OAAO,KAAK,SAAS,EAAE;oBACzB,MAAM,IAAI,gCAAuB,CAAC,qBAAM,CAAC,SAAS,EAAE,uDAAuD,CAAC,CAAA;iBAC7G;gBAED,sBAAO,IAAI,gCAAoB,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAA;;;KAC1D;IAEY,oDAA2B,GAAxC;;;gBACE,sBAAO,IAAI,oDAA6B,EAAE,EAAA;;;KAC3C;IAEO,uCAAc,GAAtB,UAAuB,UAA8B,EAAE,OAAyB;QAC9E,QAAQ,UAAU,EAAE;YAClB,KAAK,kCAAmB,CAAC,QAAQ;gBAC/B,OAAO,IAAA,yCAAsB,EAAC,EAAE,OAAO,SAAA,EAAE,CAAC,CAAA;YAC5C,KAAK,kCAAmB,CAAC,MAAM;gBAC7B,OAAO,IAAA,qCAAoB,EAAC,EAAE,OAAO,SAAA,EAAE,CAAC,CAAA;YAC1C;gBACE,MAAM,IAAI,gCAAuB,CAAC,qBAAM,CAAC,SAAS,EAAE,mBAAY,UAAU,+BAA4B,CAAC,CAAA;SAC1G;IACH,CAAC;IACH,qBAAC;AAAD,CAAC,AAzDD,IAyDC;AAzDY,wCAAc"}
|
package/v1/module.d.ts
ADDED
package/v1/module.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
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
|
+
exports.create = void 0;
|
|
18
|
+
var PolkadotModule_1 = require("./module/PolkadotModule");
|
|
19
|
+
__exportStar(require("./index"), exports);
|
|
20
|
+
function create() {
|
|
21
|
+
return new PolkadotModule_1.PolkadotModule();
|
|
22
|
+
}
|
|
23
|
+
exports.create = create;
|
|
24
|
+
//# sourceMappingURL=module.js.map
|
package/v1/module.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../src/v1/module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA,0DAAwD;AAExD,0CAAuB;AAEvB,SAAgB,MAAM;IACpB,OAAO,IAAI,+BAAc,EAAE,CAAA;AAC7B,CAAC;AAFD,wBAEC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import BigNumber from '@wallfree-dev/coinlib-core/dependencies/src/bignumber.js-9.0.0/bignumber';
|
|
2
|
+
import { SCALEAccountId, SCALEArray, SCALECompactInt, SCALEData, SCALETuple, SubstrateCommonNodeClient, SubstrateRegistration, SubstrateSS58Address } from '@wallfree-dev/substrate/v1';
|
|
3
|
+
import { PolkadotActiveEraInfo } from '../data/staking/PolkadotActiveEraInfo';
|
|
4
|
+
import { PolkadotEraRewardPoints } from '../data/staking/PolkadotEraRewardPoints';
|
|
5
|
+
import { PolkadotExposure } from '../data/staking/PolkadotExposure';
|
|
6
|
+
import { PolkadotNominations } from '../data/staking/PolkadotNominations';
|
|
7
|
+
import { PolkadotPayee } from '../data/staking/PolkadotPayee';
|
|
8
|
+
import { PolkadotSlashingSpans } from '../data/staking/PolkadotSlashingSpans';
|
|
9
|
+
import { PolkadotStakingLedger } from '../data/staking/PolkadotStakingLedger';
|
|
10
|
+
import { PolkadotValidatorPrefs } from '../data/staking/PolkadotValidatorPrefs';
|
|
11
|
+
import { PolkadotProtocolConfiguration } from '../types/configuration';
|
|
12
|
+
export declare class PolkadotNodeClient extends SubstrateCommonNodeClient<PolkadotProtocolConfiguration> {
|
|
13
|
+
constructor(configuration: PolkadotProtocolConfiguration, url: string);
|
|
14
|
+
getBlockTime(): Promise<BigNumber>;
|
|
15
|
+
getCurrentEraIndex(): Promise<BigNumber | undefined>;
|
|
16
|
+
getBonded(address: SubstrateSS58Address): Promise<SubstrateSS58Address | undefined>;
|
|
17
|
+
getNominations(address: SubstrateSS58Address): Promise<PolkadotNominations | undefined>;
|
|
18
|
+
getRewardPoints(eraIndex: number): Promise<PolkadotEraRewardPoints | undefined>;
|
|
19
|
+
getValidatorReward(eraIndex: number): Promise<BigNumber | undefined>;
|
|
20
|
+
getStakersClipped(eraIndex: number, validator: SubstrateSS58Address): Promise<PolkadotExposure | undefined>;
|
|
21
|
+
getRewardDestination(address: SubstrateSS58Address): Promise<PolkadotPayee | undefined>;
|
|
22
|
+
getStakingLedger(address: SubstrateSS58Address): Promise<PolkadotStakingLedger | undefined>;
|
|
23
|
+
getValidators(): Promise<SubstrateSS58Address[] | undefined>;
|
|
24
|
+
getValidatorExposure(eraIndex: number, address: SubstrateSS58Address): Promise<PolkadotExposure | undefined>;
|
|
25
|
+
getIdentityOf(address: SubstrateSS58Address): Promise<SubstrateRegistration | undefined>;
|
|
26
|
+
getSuperOf(address: SubstrateSS58Address): Promise<SCALETuple<SCALEAccountId<PolkadotProtocolConfiguration>, SCALEData> | undefined>;
|
|
27
|
+
getSubsOf(address: SubstrateSS58Address): Promise<SCALETuple<SCALECompactInt, SCALEArray<SCALEAccountId<PolkadotProtocolConfiguration>>> | undefined>;
|
|
28
|
+
getValidatorPrefs(eraIndex: number, address: SubstrateSS58Address): Promise<PolkadotValidatorPrefs | undefined>;
|
|
29
|
+
getExpectedEraDuration(): Promise<BigNumber | undefined>;
|
|
30
|
+
getActiveEraInfo(): Promise<PolkadotActiveEraInfo | undefined>;
|
|
31
|
+
getSlashingSpan(address: SubstrateSS58Address): Promise<PolkadotSlashingSpans | undefined>;
|
|
32
|
+
getMinNominatorBond(): Promise<BigNumber | undefined>;
|
|
33
|
+
}
|
|
34
|
+
export declare const STORAGE_ENTRIES: {
|
|
35
|
+
Identity: readonly ["IdentityOf", "SuperOf", "SubsOf"];
|
|
36
|
+
Staking: readonly ["Bonded", "Ledger", "Payee", "Nominators", "CurrentEra", "ActiveEra", "ErasStakers", "ErasStakersClipped", "ErasValidatorPrefs", "ErasValidatorReward", "ErasRewardPoints", "SlashingSpans", "MinNominatorBond"];
|
|
37
|
+
Session: readonly ["Validators"];
|
|
38
|
+
};
|
|
39
|
+
export declare const CALLS: {
|
|
40
|
+
Staking: readonly ["bond", "bond_extra", "unbond", "withdraw_unbonded", "nominate", "chill", "set_payee", "set_controller", "payout_stakers", "rebond"];
|
|
41
|
+
};
|
|
42
|
+
export declare const CONSTANTS: {
|
|
43
|
+
Babe: readonly ["EpochDuration", "ExpectedBlockTime"];
|
|
44
|
+
Staking: readonly ["SessionsPerEra"];
|
|
45
|
+
};
|
|
@@ -0,0 +1,319 @@
|
|
|
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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
+
function step(op) {
|
|
31
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
+
while (_) try {
|
|
33
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
+
switch (op[0]) {
|
|
36
|
+
case 0: case 1: t = op; break;
|
|
37
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
+
default:
|
|
41
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
+
if (t[2]) _.ops.pop();
|
|
46
|
+
_.trys.pop(); continue;
|
|
47
|
+
}
|
|
48
|
+
op = body.call(thisArg, _);
|
|
49
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
|
+
exports.CONSTANTS = exports.CALLS = exports.STORAGE_ENTRIES = exports.PolkadotNodeClient = void 0;
|
|
55
|
+
var v1_1 = require("@wallfree-dev/substrate/v1");
|
|
56
|
+
var PolkadotActiveEraInfo_1 = require("../data/staking/PolkadotActiveEraInfo");
|
|
57
|
+
var PolkadotEraRewardPoints_1 = require("../data/staking/PolkadotEraRewardPoints");
|
|
58
|
+
var PolkadotExposure_1 = require("../data/staking/PolkadotExposure");
|
|
59
|
+
var PolkadotNominations_1 = require("../data/staking/PolkadotNominations");
|
|
60
|
+
var PolkadotPayee_1 = require("../data/staking/PolkadotPayee");
|
|
61
|
+
var PolkadotSlashingSpans_1 = require("../data/staking/PolkadotSlashingSpans");
|
|
62
|
+
var PolkadotStakingLedger_1 = require("../data/staking/PolkadotStakingLedger");
|
|
63
|
+
var PolkadotValidatorPrefs_1 = require("../data/staking/PolkadotValidatorPrefs");
|
|
64
|
+
var PolkadotNodeClient = /** @class */ (function (_super) {
|
|
65
|
+
__extends(PolkadotNodeClient, _super);
|
|
66
|
+
function PolkadotNodeClient(configuration, url) {
|
|
67
|
+
var _this = _super.call(this, configuration, url) || this;
|
|
68
|
+
_this.registerCallEntrypointEntries([
|
|
69
|
+
_this.createCallEndpointEntry('bond', 'Staking', 'bond'),
|
|
70
|
+
_this.createCallEndpointEntry('unbond', 'Staking', 'unbond'),
|
|
71
|
+
_this.createCallEndpointEntry('bond_extra', 'Staking', 'bond_extra'),
|
|
72
|
+
_this.createCallEndpointEntry('withdraw_unbonded', 'Staking', 'withdraw_unbonded'),
|
|
73
|
+
_this.createCallEndpointEntry('nominate', 'Staking', 'nominate'),
|
|
74
|
+
_this.createCallEndpointEntry('cancel_nomination', 'Staking', 'chill'),
|
|
75
|
+
_this.createCallEndpointEntry('collect_payout', 'Staking', 'payout_stakers'),
|
|
76
|
+
_this.createCallEndpointEntry('set_payee', 'Staking', 'set_payee'),
|
|
77
|
+
_this.createCallEndpointEntry('set_controller', 'Staking', 'set_controller'),
|
|
78
|
+
_this.createCallEndpointEntry('rebond', 'Staking', 'rebond')
|
|
79
|
+
]);
|
|
80
|
+
return _this;
|
|
81
|
+
}
|
|
82
|
+
PolkadotNodeClient.prototype.getBlockTime = function () {
|
|
83
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
84
|
+
return __generator(this, function (_a) {
|
|
85
|
+
return [2 /*return*/, this.getConstant('Babe', 'ExpectedBlockTime').then(function (constant) { return v1_1.SCALEInt.decode(constant).decoded.value; })];
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
};
|
|
89
|
+
PolkadotNodeClient.prototype.getCurrentEraIndex = function () {
|
|
90
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
91
|
+
return __generator(this, function (_a) {
|
|
92
|
+
return [2 /*return*/, this.fromStorage('Staking', 'CurrentEra').then(function (item) { return (item ? v1_1.SCALEInt.decode(item).decoded.value : undefined); })];
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
PolkadotNodeClient.prototype.getBonded = function (address) {
|
|
97
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
98
|
+
var _this = this;
|
|
99
|
+
return __generator(this, function (_a) {
|
|
100
|
+
return [2 /*return*/, this.fromStorage('Staking', 'Bonded', v1_1.SCALEAccountId.from(address, this.configuration)).then(function (item) {
|
|
101
|
+
return item ? v1_1.SCALEAccountId.decode(_this.configuration, item).decoded.address : undefined;
|
|
102
|
+
})];
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
};
|
|
106
|
+
PolkadotNodeClient.prototype.getNominations = function (address) {
|
|
107
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
108
|
+
var _this = this;
|
|
109
|
+
return __generator(this, function (_a) {
|
|
110
|
+
return [2 /*return*/, this.fromStorage('Staking', 'Nominators', v1_1.SCALEAccountId.from(address, this.configuration)).then(function (item) {
|
|
111
|
+
return item ? PolkadotNominations_1.PolkadotNominations.decode(_this.configuration, _this.runtimeVersion, item) : undefined;
|
|
112
|
+
})];
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
};
|
|
116
|
+
PolkadotNodeClient.prototype.getRewardPoints = function (eraIndex) {
|
|
117
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
118
|
+
var _this = this;
|
|
119
|
+
return __generator(this, function (_a) {
|
|
120
|
+
return [2 /*return*/, this.fromStorage('Staking', 'ErasRewardPoints', v1_1.SCALEInt.from(eraIndex, 32)).then(function (item) {
|
|
121
|
+
return item ? PolkadotEraRewardPoints_1.PolkadotEraRewardPoints.decode(_this.configuration, _this.runtimeVersion, item) : undefined;
|
|
122
|
+
})];
|
|
123
|
+
});
|
|
124
|
+
});
|
|
125
|
+
};
|
|
126
|
+
PolkadotNodeClient.prototype.getValidatorReward = function (eraIndex) {
|
|
127
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
128
|
+
return __generator(this, function (_a) {
|
|
129
|
+
return [2 /*return*/, this.fromStorage('Staking', 'ErasValidatorReward', v1_1.SCALEInt.from(eraIndex, 32)).then(function (item) {
|
|
130
|
+
return item ? v1_1.SCALEInt.decode(item).decoded.value : undefined;
|
|
131
|
+
})];
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
};
|
|
135
|
+
PolkadotNodeClient.prototype.getStakersClipped = function (eraIndex, validator) {
|
|
136
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
137
|
+
var _this = this;
|
|
138
|
+
return __generator(this, function (_a) {
|
|
139
|
+
return [2 /*return*/, this.fromStorage('Staking', 'ErasStakersClipped', v1_1.SCALEInt.from(eraIndex, 32), v1_1.SCALEAccountId.from(validator, this.configuration)).then(function (item) { return (item ? PolkadotExposure_1.PolkadotExposure.decode(_this.configuration, _this.runtimeVersion, item) : undefined); })];
|
|
140
|
+
});
|
|
141
|
+
});
|
|
142
|
+
};
|
|
143
|
+
PolkadotNodeClient.prototype.getRewardDestination = function (address) {
|
|
144
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
145
|
+
return __generator(this, function (_a) {
|
|
146
|
+
return [2 /*return*/, this.fromStorage('Staking', 'Payee', v1_1.SCALEAccountId.from(address, this.configuration)).then(function (item) {
|
|
147
|
+
return item ? v1_1.SCALEEnum.decode(item, function (hex) { return PolkadotPayee_1.PolkadotPayee[PolkadotPayee_1.PolkadotPayee[hex]]; }).decoded.value : undefined;
|
|
148
|
+
})];
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
};
|
|
152
|
+
PolkadotNodeClient.prototype.getStakingLedger = function (address) {
|
|
153
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
154
|
+
var _this = this;
|
|
155
|
+
return __generator(this, function (_a) {
|
|
156
|
+
return [2 /*return*/, this.fromStorage('Staking', 'Ledger', v1_1.SCALEAccountId.from(address, this.configuration)).then(function (item) {
|
|
157
|
+
return item ? PolkadotStakingLedger_1.PolkadotStakingLedger.decode(_this.configuration, _this.runtimeVersion, item) : undefined;
|
|
158
|
+
})];
|
|
159
|
+
});
|
|
160
|
+
});
|
|
161
|
+
};
|
|
162
|
+
PolkadotNodeClient.prototype.getValidators = function () {
|
|
163
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
164
|
+
var _this = this;
|
|
165
|
+
return __generator(this, function (_a) {
|
|
166
|
+
return [2 /*return*/, this.fromStorage('Session', 'Validators').then(function (items) {
|
|
167
|
+
return items
|
|
168
|
+
? v1_1.SCALEArray.decode(_this.configuration, _this.runtimeVersion, items, function (network, _, hex) {
|
|
169
|
+
return v1_1.SCALEAccountId.decode(network, hex);
|
|
170
|
+
}).decoded.elements.map(function (encoded) { return encoded.address; })
|
|
171
|
+
: undefined;
|
|
172
|
+
})];
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
};
|
|
176
|
+
PolkadotNodeClient.prototype.getValidatorExposure = function (eraIndex, address) {
|
|
177
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
178
|
+
var _this = this;
|
|
179
|
+
return __generator(this, function (_a) {
|
|
180
|
+
return [2 /*return*/, this.fromStorage('Staking', 'ErasStakers', v1_1.SCALEInt.from(eraIndex, 32), v1_1.SCALEAccountId.from(address, this.configuration)).then(function (item) { return (item ? PolkadotExposure_1.PolkadotExposure.decode(_this.configuration, _this.runtimeVersion, item) : undefined); })];
|
|
181
|
+
});
|
|
182
|
+
});
|
|
183
|
+
};
|
|
184
|
+
PolkadotNodeClient.prototype.getIdentityOf = function (address) {
|
|
185
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
186
|
+
var _this = this;
|
|
187
|
+
return __generator(this, function (_a) {
|
|
188
|
+
return [2 /*return*/, this.fromStorage('Identity', 'IdentityOf', v1_1.SCALEAccountId.from(address, this.configuration)).then(function (item) {
|
|
189
|
+
return item ? v1_1.SubstrateRegistration.decode(_this.configuration, _this.runtimeVersion, item) : undefined;
|
|
190
|
+
})];
|
|
191
|
+
});
|
|
192
|
+
});
|
|
193
|
+
};
|
|
194
|
+
PolkadotNodeClient.prototype.getSuperOf = function (address) {
|
|
195
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
196
|
+
var _this = this;
|
|
197
|
+
return __generator(this, function (_a) {
|
|
198
|
+
return [2 /*return*/, this.fromStorage('Identity', 'SuperOf', v1_1.SCALEAccountId.from(address, this.configuration)).then(function (item) {
|
|
199
|
+
return item
|
|
200
|
+
? v1_1.SCALETuple.decode(_this.configuration, _this.runtimeVersion, item, function (network, _, hex) { return v1_1.SCALEAccountId.decode(network, hex); }, function (_network, _runtimeVersion, hex) { return v1_1.SCALEData.decode(hex); }).decoded
|
|
201
|
+
: undefined;
|
|
202
|
+
})];
|
|
203
|
+
});
|
|
204
|
+
});
|
|
205
|
+
};
|
|
206
|
+
PolkadotNodeClient.prototype.getSubsOf = function (address) {
|
|
207
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
208
|
+
var _this = this;
|
|
209
|
+
return __generator(this, function (_a) {
|
|
210
|
+
return [2 /*return*/, this.fromStorage('Identity', 'SubsOf', v1_1.SCALEAccountId.from(address, this.configuration)).then(function (item) {
|
|
211
|
+
return item
|
|
212
|
+
? v1_1.SCALETuple.decode(_this.configuration, _this.runtimeVersion, item, function (_network, _runtimeVersion, hex) { return v1_1.SCALECompactInt.decode(hex); }, function (network, _, hex) {
|
|
213
|
+
return v1_1.SCALEArray.decode(network, _, hex, function (innerNetwork, _, innerHex) { return v1_1.SCALEAccountId.decode(innerNetwork, innerHex); });
|
|
214
|
+
}).decoded
|
|
215
|
+
: undefined;
|
|
216
|
+
})];
|
|
217
|
+
});
|
|
218
|
+
});
|
|
219
|
+
};
|
|
220
|
+
PolkadotNodeClient.prototype.getValidatorPrefs = function (eraIndex, address) {
|
|
221
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
222
|
+
var _this = this;
|
|
223
|
+
return __generator(this, function (_a) {
|
|
224
|
+
return [2 /*return*/, this.fromStorage('Staking', 'ErasValidatorPrefs', v1_1.SCALEInt.from(eraIndex, 32), v1_1.SCALEAccountId.from(address, this.configuration)).then(function (item) { return (item ? PolkadotValidatorPrefs_1.PolkadotValidatorPrefs.decode(_this.configuration, _this.runtimeVersion, item) : undefined); })];
|
|
225
|
+
});
|
|
226
|
+
});
|
|
227
|
+
};
|
|
228
|
+
PolkadotNodeClient.prototype.getExpectedEraDuration = function () {
|
|
229
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
230
|
+
var constants, expectedBlockTime, epochDuration, sessionsPerEra;
|
|
231
|
+
return __generator(this, function (_a) {
|
|
232
|
+
switch (_a.label) {
|
|
233
|
+
case 0: return [4 /*yield*/, Promise.all([
|
|
234
|
+
this.getConstant('Babe', 'ExpectedBlockTime'),
|
|
235
|
+
this.getConstant('Babe', 'EpochDuration'),
|
|
236
|
+
this.getConstant('Staking', 'SessionsPerEra')
|
|
237
|
+
]).then(function (constants) { return constants.map(function (constant) { return (constant ? v1_1.SCALEInt.decode(constant).decoded.value : undefined); }); })];
|
|
238
|
+
case 1:
|
|
239
|
+
constants = _a.sent();
|
|
240
|
+
if (constants.some(function (constant) { return constant === undefined; })) {
|
|
241
|
+
return [2 /*return*/, undefined];
|
|
242
|
+
}
|
|
243
|
+
expectedBlockTime = constants[0];
|
|
244
|
+
epochDuration = constants[1];
|
|
245
|
+
sessionsPerEra = constants[2];
|
|
246
|
+
return [2 /*return*/, expectedBlockTime.multipliedBy(epochDuration).multipliedBy(sessionsPerEra)];
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
});
|
|
250
|
+
};
|
|
251
|
+
PolkadotNodeClient.prototype.getActiveEraInfo = function () {
|
|
252
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
253
|
+
var _this = this;
|
|
254
|
+
return __generator(this, function (_a) {
|
|
255
|
+
return [2 /*return*/, this.fromStorage('Staking', 'ActiveEra').then(function (item) {
|
|
256
|
+
return item ? PolkadotActiveEraInfo_1.PolkadotActiveEraInfo.decode(_this.configuration, _this.runtimeVersion, item) : undefined;
|
|
257
|
+
})];
|
|
258
|
+
});
|
|
259
|
+
});
|
|
260
|
+
};
|
|
261
|
+
PolkadotNodeClient.prototype.getSlashingSpan = function (address) {
|
|
262
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
263
|
+
var _this = this;
|
|
264
|
+
return __generator(this, function (_a) {
|
|
265
|
+
return [2 /*return*/, this.fromStorage('Staking', 'SlashingSpans', v1_1.SCALEAccountId.from(address, this.configuration)).then(function (item) {
|
|
266
|
+
return item ? PolkadotSlashingSpans_1.PolkadotSlashingSpans.decode(_this.configuration, _this.runtimeVersion, item) : undefined;
|
|
267
|
+
})];
|
|
268
|
+
});
|
|
269
|
+
});
|
|
270
|
+
};
|
|
271
|
+
PolkadotNodeClient.prototype.getMinNominatorBond = function () {
|
|
272
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
273
|
+
return __generator(this, function (_a) {
|
|
274
|
+
return [2 /*return*/, this.fromStorage('Staking', 'MinNominatorBond').then(function (value) { return (value ? v1_1.SCALEInt.decode(value).decoded.value : undefined); })];
|
|
275
|
+
});
|
|
276
|
+
});
|
|
277
|
+
};
|
|
278
|
+
return PolkadotNodeClient;
|
|
279
|
+
}(v1_1.SubstrateCommonNodeClient));
|
|
280
|
+
exports.PolkadotNodeClient = PolkadotNodeClient;
|
|
281
|
+
// Supported Calls
|
|
282
|
+
exports.STORAGE_ENTRIES = {
|
|
283
|
+
Identity: ['IdentityOf', 'SuperOf', 'SubsOf'],
|
|
284
|
+
Staking: [
|
|
285
|
+
'Bonded',
|
|
286
|
+
'Ledger',
|
|
287
|
+
'Payee',
|
|
288
|
+
'Nominators',
|
|
289
|
+
'CurrentEra',
|
|
290
|
+
'ActiveEra',
|
|
291
|
+
'ErasStakers',
|
|
292
|
+
'ErasStakersClipped',
|
|
293
|
+
'ErasValidatorPrefs',
|
|
294
|
+
'ErasValidatorReward',
|
|
295
|
+
'ErasRewardPoints',
|
|
296
|
+
'SlashingSpans',
|
|
297
|
+
'MinNominatorBond'
|
|
298
|
+
],
|
|
299
|
+
Session: ['Validators']
|
|
300
|
+
};
|
|
301
|
+
exports.CALLS = {
|
|
302
|
+
Staking: [
|
|
303
|
+
'bond',
|
|
304
|
+
'bond_extra',
|
|
305
|
+
'unbond',
|
|
306
|
+
'withdraw_unbonded',
|
|
307
|
+
'nominate',
|
|
308
|
+
'chill',
|
|
309
|
+
'set_payee',
|
|
310
|
+
'set_controller',
|
|
311
|
+
'payout_stakers',
|
|
312
|
+
'rebond'
|
|
313
|
+
]
|
|
314
|
+
};
|
|
315
|
+
exports.CONSTANTS = {
|
|
316
|
+
Babe: ['EpochDuration', 'ExpectedBlockTime'],
|
|
317
|
+
Staking: ['SessionsPerEra']
|
|
318
|
+
};
|
|
319
|
+
//# sourceMappingURL=PolkadotNodeClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PolkadotNodeClient.js","sourceRoot":"","sources":["../../../src/v1/node/PolkadotNodeClient.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,iDAWmC;AAEnC,+EAA6E;AAC7E,mFAAiF;AACjF,qEAAmE;AACnE,2EAAyE;AACzE,+DAA6D;AAC7D,+EAA6E;AAC7E,+EAA6E;AAC7E,iFAA+E;AAG/E;IAAwC,sCAAwD;IAC9F,4BAAmB,aAA4C,EAAE,GAAW;QAA5E,YACE,kBAAM,aAAa,EAAE,GAAG,CAAC,SAa1B;QAZC,KAAI,CAAC,6BAA6B,CAAC;YACjC,KAAI,CAAC,uBAAuB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC;YACvD,KAAI,CAAC,uBAAuB,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,CAAC;YAC3D,KAAI,CAAC,uBA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AC,CAAC,CAAC,CAAC,SAAS;oBAA9F,CAA8F,CAC/F,EAAA;;;KACF;IAEY,gDAAmB,GAAhC;;;gBACE,sBAAO,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,kBAAkB,CAAC,CAAC,IAAI,CAAC,UAAC,KAAK,IAAK,OAAA,CAAC,KAAK,CAAC,CAAC,CAAC,aAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,EAA1D,CAA0D,CAAC,EAAA;;;KACnI;IACH,yBAAC;AAAD,CAAC,AAvKD,CAAwC,8BAAyB,GAuKhE;AAvKY,gDAAkB;AAyK/B,kBAAkB;AAEL,QAAA,eAAe,GAAG;IAC7B,QAAQ,EAAE,CAAC,YAAY,EAAE,SAAS,EAAE,QAAQ,CAAU;IACtD,OAAO,EAAE;QACP,QAAQ;QACR,QAAQ;QACR,OAAO;QACP,YAAY;QACZ,YAAY;QACZ,WAAW;QACX,aAAa;QACb,oBAAoB;QACpB,oBAAoB;QACpB,qBAAqB;QACrB,kBAAkB;QAClB,eAAe;QACf,kBAAkB;KACV;IACV,OAAO,EAAE,CAAC,YAAY,CAAU;CACjC,CAAA;AAEY,QAAA,KAAK,GAAG;IACnB,OAAO,EAAE;QACP,MAAM;QACN,YAAY;QACZ,QAAQ;QACR,mBAAmB;QACnB,UAAU;QACV,OAAO;QACP,WAAW;QACX,gBAAgB;QAChB,gBAAgB;QAChB,QAAQ;KACA;CACX,CAAA;AAEY,QAAA,SAAS,GAAG;IACvB,IAAI,EAAE,CAAC,eAAe,EAAE,mBAAmB,CAAU;IACrD,OAAO,EAAE,CAAC,gBAAgB,CAAU;CACrC,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ProtocolMetadata, RecursivePartial } from '@wallfree-dev/module-kit';
|
|
2
|
+
import { PolkadotProtocolConfiguration } from '../types/configuration';
|
|
3
|
+
import { KusamaUnits, PolkadotProtocolNetwork, PolkadotProtocolOptions } from '../types/protocol';
|
|
4
|
+
import { PolkadotBaseProtocol, PolkadotBaseProtocolImpl } from './PolkadotBaseProtocol';
|
|
5
|
+
export interface KusamaProtocol extends PolkadotBaseProtocol<KusamaUnits> {
|
|
6
|
+
}
|
|
7
|
+
export declare const KUSAMA_METADATA: ProtocolMetadata<KusamaUnits>;
|
|
8
|
+
export declare const KUSAMA_CONFIGURATION: PolkadotProtocolConfiguration;
|
|
9
|
+
export declare class KusamaProtocolImpl extends PolkadotBaseProtocolImpl<KusamaUnits> implements KusamaProtocol {
|
|
10
|
+
constructor(options?: RecursivePartial<PolkadotProtocolOptions>);
|
|
11
|
+
}
|
|
12
|
+
export declare function createKusamaProtocol(options?: RecursivePartial<PolkadotProtocolOptions>): KusamaProtocol;
|
|
13
|
+
export declare const KUSAMA_MAINNET_PROTOCOL_NETWORK: PolkadotProtocolNetwork;
|
|
14
|
+
export declare function createKusamaProtocolOptions(network?: Partial<PolkadotProtocolNetwork>): PolkadotProtocolOptions;
|