@airgap/moonbeam 0.13.45-beta.2 → 0.13.45-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +5 -5
- package/v0/index.js +7 -7
- package/v0/index.js.map +1 -1
- package/v0/protocol/moonbase/MoonbaseProtocol.js +17 -36
- package/v0/protocol/moonbase/MoonbaseProtocol.js.map +1 -1
- package/v0/protocol/moonbase/MoonbaseProtocolOptions.js +28 -67
- package/v0/protocol/moonbase/MoonbaseProtocolOptions.js.map +1 -1
- package/v0/protocol/moonbeam/MoonbeamProtocol.js +334 -589
- package/v0/protocol/moonbeam/MoonbeamProtocol.js.map +1 -1
- package/v0/protocol/moonbeam/MoonbeamProtocolOptions.js +41 -87
- package/v0/protocol/moonbeam/MoonbeamProtocolOptions.js.map +1 -1
- package/v0/protocol/moonbeam/controllers/MoonbeamAccountController.js +287 -495
- package/v0/protocol/moonbeam/controllers/MoonbeamAccountController.js.map +1 -1
- package/v0/protocol/moonbeam/controllers/MoonbeamTransactionController.d.ts +0 -1
- package/v0/protocol/moonbeam/controllers/MoonbeamTransactionController.js +9 -69
- package/v0/protocol/moonbeam/controllers/MoonbeamTransactionController.js.map +1 -1
- package/v0/protocol/moonbeam/data/staking/MoonbeamBond.js +16 -34
- package/v0/protocol/moonbeam/data/staking/MoonbeamBond.js.map +1 -1
- package/v0/protocol/moonbeam/data/staking/MoonbeamCandidateBondLessRequest.js +16 -34
- package/v0/protocol/moonbeam/data/staking/MoonbeamCandidateBondLessRequest.js.map +1 -1
- package/v0/protocol/moonbeam/data/staking/MoonbeamCandidateMetadata.js +22 -23
- package/v0/protocol/moonbeam/data/staking/MoonbeamCandidateMetadata.js.map +1 -1
- package/v0/protocol/moonbeam/data/staking/MoonbeamDelegationScheduledRequests.js +64 -107
- package/v0/protocol/moonbeam/data/staking/MoonbeamDelegationScheduledRequests.js.map +1 -1
- package/v0/protocol/moonbeam/data/staking/MoonbeamDelegator.js +50 -90
- package/v0/protocol/moonbeam/data/staking/MoonbeamDelegator.js.map +1 -1
- package/v0/protocol/moonbeam/data/staking/MoonbeamRoundInfo.js +12 -13
- package/v0/protocol/moonbeam/data/staking/MoonbeamRoundInfo.js.map +1 -1
- package/v0/protocol/moonbeam/data/staking/MoonbeamStakingActionType.js +1 -1
- package/v0/protocol/moonbeam/data/staking/MoonbeamStakingActionType.js.map +1 -1
- package/v0/protocol/moonbeam/node/MoonbeamNodeClient.js +60 -215
- package/v0/protocol/moonbeam/node/MoonbeamNodeClient.js.map +1 -1
- package/v0/protocol/moonriver/MoonriverProtocol.js +17 -36
- package/v0/protocol/moonriver/MoonriverProtocol.js.map +1 -1
- package/v0/protocol/moonriver/MoonriverProtocolOptions.js +28 -67
- package/v0/protocol/moonriver/MoonriverProtocolOptions.js.map +1 -1
- package/v1/controller/MoonbeamAccountController.js +252 -456
- package/v1/controller/MoonbeamAccountController.js.map +1 -1
- package/v1/controller/MoonbeamTransactionController.js +3 -23
- package/v1/controller/MoonbeamTransactionController.js.map +1 -1
- package/v1/data/staking/MoonbeamBond.js +14 -32
- package/v1/data/staking/MoonbeamBond.js.map +1 -1
- package/v1/data/staking/MoonbeamCandidateBondLessRequest.js +14 -32
- package/v1/data/staking/MoonbeamCandidateBondLessRequest.js.map +1 -1
- package/v1/data/staking/MoonbeamCandidateMetadata.js +21 -24
- package/v1/data/staking/MoonbeamCandidateMetadata.js.map +1 -1
- package/v1/data/staking/MoonbeamDelegationScheduledRequests.js +62 -107
- package/v1/data/staking/MoonbeamDelegationScheduledRequests.js.map +1 -1
- package/v1/data/staking/MoonbeamDelegator.js +48 -90
- package/v1/data/staking/MoonbeamDelegator.js.map +1 -1
- package/v1/data/staking/MoonbeamRoundInfo.js +11 -12
- package/v1/data/staking/MoonbeamRoundInfo.js.map +1 -1
- package/v1/data/staking/MoonbeamStakingActionType.js +1 -1
- package/v1/data/staking/MoonbeamStakingActionType.js.map +1 -1
- package/v1/data/transaction/method/args.js +160 -293
- package/v1/data/transaction/method/args.js.map +1 -1
- package/v1/data/transaction/transaction.js +12 -23
- package/v1/data/transaction/transaction.js.map +1 -1
- package/v1/index.js +5 -5
- package/v1/index.js.map +1 -1
- package/v1/module/MoonbeamModule.d.ts +1 -1
- package/v1/module/MoonbeamModule.js +40 -98
- package/v1/module/MoonbeamModule.js.map +1 -1
- package/v1/module.js +2 -3
- package/v1/module.js.map +1 -1
- package/v1/node/MoonbeamNodeClient.js +71 -222
- package/v1/node/MoonbeamNodeClient.js.map +1 -1
- package/v1/protocol/MoonbaseProtocol.js +18 -49
- package/v1/protocol/MoonbaseProtocol.js.map +1 -1
- package/v1/protocol/MoonbeamBaseProtocol.js +340 -625
- package/v1/protocol/MoonbeamBaseProtocol.js.map +1 -1
- package/v1/protocol/MoonbeamProtocol.js +20 -51
- package/v1/protocol/MoonbeamProtocol.js.map +1 -1
- package/v1/protocol/MoonriverProtocol.js +18 -49
- package/v1/protocol/MoonriverProtocol.js.map +1 -1
- package/v1/serializer/v3/schemas/converter/transaction-converter.js +5 -6
- package/v1/serializer/v3/schemas/converter/transaction-converter.js.map +1 -1
- package/v1/serializer/v3/serializer-companion.js +75 -154
- package/v1/serializer/v3/serializer-companion.js.map +1 -1
- package/v1/serializer/v3/validators/transaction-validator.js +3 -23
- package/v1/serializer/v3/validators/transaction-validator.js.map +1 -1
- package/v1/serializer/v3/validators/validators.js +1 -1
- package/v1/serializer/v3/validators/validators.js.map +1 -1
- package/v1/types/configuration.d.ts +1 -1
- package/v1/types/crypto.d.ts +1 -1
- package/v1/types/protocol.d.ts +3 -3
|
@@ -1,29 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
3
|
exports.TRANSACTION_TYPES = void 0;
|
|
15
|
-
|
|
4
|
+
const args_1 = require("./method/args");
|
|
16
5
|
exports.TRANSACTION_TYPES = {
|
|
17
|
-
delegate:
|
|
18
|
-
schedule_leave_delegators:
|
|
19
|
-
execute_leave_delegators:
|
|
20
|
-
cancel_leave_delegators:
|
|
21
|
-
schedule_revoke_delegation:
|
|
22
|
-
execute_delegation_request:
|
|
23
|
-
cancel_delegation_request:
|
|
24
|
-
delegator_bond_more:
|
|
25
|
-
schedule_delegator_bond_less:
|
|
26
|
-
execute_candidate_bond_less:
|
|
27
|
-
cancel_candidate_bond_less:
|
|
6
|
+
delegate: { ...(0, args_1.factories)('delegate'), index: 12 },
|
|
7
|
+
schedule_leave_delegators: { ...(0, args_1.factories)('schedule_leave_delegators'), index: 13 },
|
|
8
|
+
execute_leave_delegators: { ...(0, args_1.factories)('execute_leave_delegators'), index: 14 },
|
|
9
|
+
cancel_leave_delegators: { ...(0, args_1.factories)('cancel_leave_delegators'), index: 15 },
|
|
10
|
+
schedule_revoke_delegation: { ...(0, args_1.factories)('schedule_revoke_delegation'), index: 16 },
|
|
11
|
+
execute_delegation_request: { ...(0, args_1.factories)('execute_delegation_request'), index: 17 },
|
|
12
|
+
cancel_delegation_request: { ...(0, args_1.factories)('cancel_delegation_request'), index: 18 },
|
|
13
|
+
delegator_bond_more: { ...(0, args_1.factories)('delegator_bond_more'), index: 19 },
|
|
14
|
+
schedule_delegator_bond_less: { ...(0, args_1.factories)('schedule_delegator_bond_less'), index: 20 },
|
|
15
|
+
execute_candidate_bond_less: { ...(0, args_1.factories)('execute_candidate_bond_less'), index: 21 },
|
|
16
|
+
cancel_candidate_bond_less: { ...(0, args_1.factories)('cancel_candidate_bond_less'), index: 22 }
|
|
28
17
|
};
|
|
29
18
|
//# sourceMappingURL=transaction.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transaction.js","sourceRoot":"","sources":["../../../../src/v1/data/transaction/transaction.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"transaction.js","sourceRoot":"","sources":["../../../../src/v1/data/transaction/transaction.ts"],"names":[],"mappings":";;;AAEA,wCAAyC;AAE5B,QAAA,iBAAiB,GAA0D;IACtF,QAAQ,EAAE,EAAE,GAAG,IAAA,gBAAS,EAAC,UAAU,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACjD,yBAAyB,EAAE,EAAE,GAAG,IAAA,gBAAS,EAAC,2BAA2B,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACnF,wBAAwB,EAAE,EAAE,GAAG,IAAA,gBAAS,EAAC,0BAA0B,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACjF,uBAAuB,EAAE,EAAE,GAAG,IAAA,gBAAS,EAAC,yBAAyB,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC/E,0BAA0B,EAAE,EAAE,GAAG,IAAA,gBAAS,EAAC,4BAA4B,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACrF,0BAA0B,EAAE,EAAE,GAAG,IAAA,gBAAS,EAAC,4BAA4B,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACrF,yBAAyB,EAAE,EAAE,GAAG,IAAA,gBAAS,EAAC,2BAA2B,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACnF,mBAAmB,EAAE,EAAE,GAAG,IAAA,gBAAS,EAAC,qBAAqB,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACvE,4BAA4B,EAAE,EAAE,GAAG,IAAA,gBAAS,EAAC,8BAA8B,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACzF,2BAA2B,EAAE,EAAE,GAAG,IAAA,gBAAS,EAAC,6BAA6B,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACvF,0BAA0B,EAAE,EAAE,GAAG,IAAA,gBAAS,EAAC,4BAA4B,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;CACtF,CAAA"}
|
package/v1/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MoonbeamStakingActionType = exports.createMoonbaseProtocol = exports.createMoonriverProtocol = exports.createMoonbeamProtocol = exports.MoonbeamModule = void 0;
|
|
4
|
-
|
|
4
|
+
const MoonbeamStakingActionType_1 = require("./data/staking/MoonbeamStakingActionType");
|
|
5
5
|
Object.defineProperty(exports, "MoonbeamStakingActionType", { enumerable: true, get: function () { return MoonbeamStakingActionType_1.MoonbeamStakingActionType; } });
|
|
6
|
-
|
|
6
|
+
const MoonbeamModule_1 = require("./module/MoonbeamModule");
|
|
7
7
|
Object.defineProperty(exports, "MoonbeamModule", { enumerable: true, get: function () { return MoonbeamModule_1.MoonbeamModule; } });
|
|
8
|
-
|
|
8
|
+
const MoonbaseProtocol_1 = require("./protocol/MoonbaseProtocol");
|
|
9
9
|
Object.defineProperty(exports, "createMoonbaseProtocol", { enumerable: true, get: function () { return MoonbaseProtocol_1.createMoonbaseProtocol; } });
|
|
10
|
-
|
|
10
|
+
const MoonbeamProtocol_1 = require("./protocol/MoonbeamProtocol");
|
|
11
11
|
Object.defineProperty(exports, "createMoonbeamProtocol", { enumerable: true, get: function () { return MoonbeamProtocol_1.createMoonbeamProtocol; } });
|
|
12
|
-
|
|
12
|
+
const MoonriverProtocol_1 = require("./protocol/MoonriverProtocol");
|
|
13
13
|
Object.defineProperty(exports, "createMoonriverProtocol", { enumerable: true, get: function () { return MoonriverProtocol_1.createMoonriverProtocol; } });
|
|
14
14
|
//# sourceMappingURL=index.js.map
|
package/v1/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/v1/index.ts"],"names":[],"mappings":";;;AAGA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/v1/index.ts"],"names":[],"mappings":";;;AAGA,wFAAoF;AAuClF,0GAvCO,qDAAyB,OAuCP;AAtC3B,4DAAwD;AAW/C,+FAXA,+BAAc,OAWA;AAVvB,kEAAsF;AAoBpF,uGApBO,yCAAsB,OAoBP;AAlBxB,kEAAsF;AAcpF,uGAdO,yCAAsB,OAcP;AAbxB,oEAAyF;AAevF,wGAfO,2CAAuB,OAeP"}
|
|
@@ -3,7 +3,7 @@ import { AirGapModule, AirGapV3SerializerCompanion, ProtocolConfiguration } from
|
|
|
3
3
|
import { BlockExplorer } from '@airgap/module-kit/block-explorer/block-explorer';
|
|
4
4
|
import { OfflineProtocol, OnlineProtocol } from '@airgap/module-kit/protocol/protocol';
|
|
5
5
|
import { MoonbeamProtocolNetwork } from '../types/protocol';
|
|
6
|
-
|
|
6
|
+
type SupportedProtocols = MainProtocolSymbols.MOONBEAM | MainProtocolSymbols.MOONRIVER;
|
|
7
7
|
export declare class MoonbeamModule implements AirGapModule<{
|
|
8
8
|
Protocols: SupportedProtocols;
|
|
9
9
|
ProtocolNetwork: MoonbeamProtocolNetwork;
|
|
@@ -1,113 +1,55 @@
|
|
|
1
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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
3
|
exports.MoonbeamModule = void 0;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
_a[coinlib_core_1.MainProtocolSymbols.MOONBEAM] = new module_kit_1.ModuleNetworkRegistry({
|
|
4
|
+
const coinlib_core_1 = require("@airgap/coinlib-core");
|
|
5
|
+
const errors_1 = require("@airgap/coinlib-core/errors");
|
|
6
|
+
const module_kit_1 = require("@airgap/module-kit");
|
|
7
|
+
const substrate_1 = require("@airgap/substrate");
|
|
8
|
+
const MoonbeamProtocol_1 = require("../protocol/MoonbeamProtocol");
|
|
9
|
+
const MoonriverProtocol_1 = require("../protocol/MoonriverProtocol");
|
|
10
|
+
const serializer_companion_1 = require("../serializer/v3/serializer-companion");
|
|
11
|
+
class MoonbeamModule {
|
|
12
|
+
constructor() {
|
|
13
|
+
this.networkRegistries = {
|
|
14
|
+
[coinlib_core_1.MainProtocolSymbols.MOONBEAM]: new module_kit_1.ModuleNetworkRegistry({
|
|
52
15
|
supportedNetworks: [MoonbeamProtocol_1.MOONBEAM_MAINNET_PROTOCOL_NETWORK]
|
|
53
16
|
}),
|
|
54
|
-
|
|
17
|
+
[coinlib_core_1.MainProtocolSymbols.MOONRIVER]: new module_kit_1.ModuleNetworkRegistry({
|
|
55
18
|
supportedNetworks: [MoonriverProtocol_1.MOONRIVER_MAINNET_PROTOCOL_NETWORK]
|
|
56
|
-
})
|
|
57
|
-
|
|
19
|
+
})
|
|
20
|
+
};
|
|
58
21
|
this.supportedProtocols = (0, module_kit_1.createSupportedProtocols)(this.networkRegistries);
|
|
59
22
|
}
|
|
60
|
-
|
|
61
|
-
return
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
|
|
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. (Moonbeam)");
|
|
88
|
-
}
|
|
89
|
-
return [2 /*return*/, new substrate_1.SubscanBlockExplorer(network.blockExplorerUrl)];
|
|
90
|
-
});
|
|
91
|
-
});
|
|
92
|
-
};
|
|
93
|
-
MoonbeamModule.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.MoonbeamV3SerializerCompanion()];
|
|
97
|
-
});
|
|
98
|
-
});
|
|
99
|
-
};
|
|
100
|
-
MoonbeamModule.prototype.createProtocol = function (identifier, network) {
|
|
23
|
+
async createOfflineProtocol(identifier) {
|
|
24
|
+
return this.createProtocol(identifier);
|
|
25
|
+
}
|
|
26
|
+
async createOnlineProtocol(identifier, networkOrId) {
|
|
27
|
+
const network = typeof networkOrId === 'object' ? networkOrId : this.networkRegistries[identifier]?.findNetwork(networkOrId);
|
|
28
|
+
if (network === undefined) {
|
|
29
|
+
throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.SUBSTRATE, `Protocol network type not supported. (Moonbeam)`);
|
|
30
|
+
}
|
|
31
|
+
return this.createProtocol(identifier, network);
|
|
32
|
+
}
|
|
33
|
+
async createBlockExplorer(identifier, networkOrId) {
|
|
34
|
+
const network = typeof networkOrId === 'object' ? networkOrId : this.networkRegistries[identifier]?.findNetwork(networkOrId);
|
|
35
|
+
if (network === undefined) {
|
|
36
|
+
throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.SUBSTRATE, `Block Explorer network type not supported. (Moonbeam)`);
|
|
37
|
+
}
|
|
38
|
+
return new substrate_1.SubscanBlockExplorer(network.blockExplorerUrl);
|
|
39
|
+
}
|
|
40
|
+
async createV3SerializerCompanion() {
|
|
41
|
+
return new serializer_companion_1.MoonbeamV3SerializerCompanion();
|
|
42
|
+
}
|
|
43
|
+
createProtocol(identifier, network) {
|
|
101
44
|
switch (identifier) {
|
|
102
45
|
case coinlib_core_1.MainProtocolSymbols.MOONBEAM:
|
|
103
|
-
return (0, MoonbeamProtocol_1.createMoonbeamProtocol)({ network
|
|
46
|
+
return (0, MoonbeamProtocol_1.createMoonbeamProtocol)({ network });
|
|
104
47
|
case coinlib_core_1.MainProtocolSymbols.MOONRIVER:
|
|
105
|
-
return (0, MoonriverProtocol_1.createMoonriverProtocol)({ network
|
|
48
|
+
return (0, MoonriverProtocol_1.createMoonriverProtocol)({ network });
|
|
106
49
|
default:
|
|
107
|
-
throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.SUBSTRATE,
|
|
50
|
+
throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.SUBSTRATE, `Protocol ${identifier} not supported. (Moonbeam)`);
|
|
108
51
|
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
}());
|
|
52
|
+
}
|
|
53
|
+
}
|
|
112
54
|
exports.MoonbeamModule = MoonbeamModule;
|
|
113
55
|
//# sourceMappingURL=MoonbeamModule.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MoonbeamModule.js","sourceRoot":"","sources":["../../../src/v1/module/MoonbeamModule.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MoonbeamModule.js","sourceRoot":"","sources":["../../../src/v1/module/MoonbeamModule.ts"],"names":[],"mappings":";;;AAAA,uDAAkE;AAClE,wDAAqE;AACrE,mDAO2B;AAG3B,iDAAwD;AAExD,mEAAwG;AACxG,qEAA2G;AAC3G,gFAAqF;AAKrF,MAAa,cAAc;IAA3B;QACmB,sBAAiB,GAAsD;YACtF,CAAC,kCAAmB,CAAC,QAAQ,CAAC,EAAE,IAAI,kCAAqB,CAAC;gBACxD,iBAAiB,EAAE,CAAC,oDAAiC,CAAC;aACvD,CAAC;YACF,CAAC,kCAAmB,CAAC,SAAS,CAAC,EAAE,IAAI,kCAAqB,CAAC;gBACzD,iBAAiB,EAAE,CAAC,sDAAkC,CAAC;aACxD,CAAC;SACH,CAAA;QACe,uBAAkB,GAAsD,IAAA,qCAAwB,EAAC,IAAI,CAAC,iBAAiB,CAAC,CAAA;IAgD1I,CAAC;IA9CQ,KAAK,CAAC,qBAAqB,CAAC,UAA8B;QAC/D,OAAO,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,CAAA;IACxC,CAAC;IAEM,KAAK,CAAC,oBAAoB,CAC/B,UAA8B,EAC9B,WAA8C;QAE9C,MAAM,OAAO,GACX,OAAO,WAAW,KAAK,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,EAAE,WAAW,CAAC,WAAW,CAAC,CAAA;QAE9G,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YAC1B,MAAM,IAAI,gCAAuB,CAAC,qBAAM,CAAC,SAAS,EAAE,iDAAiD,CAAC,CAAA;QACxG,CAAC;QAED,OAAO,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,OAAO,CAAC,CAAA;IACjD,CAAC;IAEM,KAAK,CAAC,mBAAmB,CAC9B,UAA8B,EAC9B,WAA8C;QAE9C,MAAM,OAAO,GACX,OAAO,WAAW,KAAK,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,EAAE,WAAW,CAAC,WAAW,CAAC,CAAA;QAE9G,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YAC1B,MAAM,IAAI,gCAAuB,CAAC,qBAAM,CAAC,SAAS,EAAE,uDAAuD,CAAC,CAAA;QAC9G,CAAC;QAED,OAAO,IAAI,gCAAoB,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAA;IAC3D,CAAC;IAEM,KAAK,CAAC,2BAA2B;QACtC,OAAO,IAAI,oDAA6B,EAAE,CAAA;IAC5C,CAAC;IAEO,cAAc,CAAC,UAA8B,EAAE,OAAyB;QAC9E,QAAQ,UAAU,EAAE,CAAC;YACnB,KAAK,kCAAmB,CAAC,QAAQ;gBAC/B,OAAO,IAAA,yCAAsB,EAAC,EAAE,OAAO,EAAE,CAAC,CAAA;YAC5C,KAAK,kCAAmB,CAAC,SAAS;gBAChC,OAAO,IAAA,2CAAuB,EAAC,EAAE,OAAO,EAAE,CAAC,CAAA;YAC7C;gBACE,MAAM,IAAI,gCAAuB,CAAC,qBAAM,CAAC,SAAS,EAAE,YAAY,UAAU,4BAA4B,CAAC,CAAA;QAC3G,CAAC;IACH,CAAC;CACF;AAzDD,wCAyDC"}
|
package/v1/module.js
CHANGED
|
@@ -14,11 +14,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.create =
|
|
18
|
-
|
|
17
|
+
exports.create = create;
|
|
18
|
+
const MoonbeamModule_1 = require("./module/MoonbeamModule");
|
|
19
19
|
__exportStar(require("./index"), exports);
|
|
20
20
|
function create() {
|
|
21
21
|
return new MoonbeamModule_1.MoonbeamModule();
|
|
22
22
|
}
|
|
23
|
-
exports.create = create;
|
|
24
23
|
//# sourceMappingURL=module.js.map
|
package/v1/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../src/v1/module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../src/v1/module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAKA,wBAEC;AAND,4DAAwD;AAExD,0CAAuB;AAEvB,SAAgB,MAAM;IACpB,OAAO,IAAI,+BAAc,EAAE,CAAA;AAC7B,CAAC"}
|
|
@@ -1,230 +1,79 @@
|
|
|
1
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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
3
|
exports.CONSTANTS = exports.CALLS = exports.STORAGE_ENTRIES = exports.MoonbeamNodeClient = void 0;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
_this.createCallEndpointEntry('cancel_candidate_bond_less', 'ParachainStaking', 'cancel_candidate_bond_less')
|
|
4
|
+
const v1_1 = require("@airgap/substrate/v1");
|
|
5
|
+
const MoonbeamCandidateMetadata_1 = require("../data/staking/MoonbeamCandidateMetadata");
|
|
6
|
+
const MoonbeamDelegationScheduledRequests_1 = require("../data/staking/MoonbeamDelegationScheduledRequests");
|
|
7
|
+
const MoonbeamDelegator_1 = require("../data/staking/MoonbeamDelegator");
|
|
8
|
+
const MoonbeamRoundInfo_1 = require("../data/staking/MoonbeamRoundInfo");
|
|
9
|
+
class MoonbeamNodeClient extends v1_1.SubstrateCommonNodeClient {
|
|
10
|
+
constructor(configuration, url) {
|
|
11
|
+
super(configuration, url);
|
|
12
|
+
this.registerCallEntrypointEntries([
|
|
13
|
+
this.createCallEndpointEntry('delegate', 'ParachainStaking', 'delegate'),
|
|
14
|
+
this.createCallEndpointEntry('schedule_leave_delegators', 'ParachainStaking', 'schedule_leave_delegators'),
|
|
15
|
+
this.createCallEndpointEntry('execute_leave_delegators', 'ParachainStaking', 'execute_leave_delegators'),
|
|
16
|
+
this.createCallEndpointEntry('cancel_leave_delegators', 'ParachainStaking', 'cancel_leave_delegators'),
|
|
17
|
+
this.createCallEndpointEntry('schedule_revoke_delegation', 'ParachainStaking', 'schedule_revoke_delegation'),
|
|
18
|
+
this.createCallEndpointEntry('execute_delegation_request', 'ParachainStaking', 'execute_delegation_request'),
|
|
19
|
+
this.createCallEndpointEntry('cancel_delegation_request', 'ParachainStaking', 'cancel_delegation_request'),
|
|
20
|
+
this.createCallEndpointEntry('delegator_bond_more', 'ParachainStaking', 'delegator_bond_more'),
|
|
21
|
+
this.createCallEndpointEntry('schedule_delegator_bond_less', 'ParachainStaking', 'schedule_delegator_bond_less'),
|
|
22
|
+
this.createCallEndpointEntry('execute_candidate_bond_less', 'ParachainStaking', 'execute_candidate_bond_less'),
|
|
23
|
+
this.createCallEndpointEntry('cancel_candidate_bond_less', 'ParachainStaking', 'cancel_candidate_bond_less')
|
|
76
24
|
]);
|
|
77
|
-
return _this;
|
|
78
25
|
}
|
|
79
|
-
|
|
80
|
-
return
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
};
|
|
131
|
-
MoonbeamNodeClient.prototype.getCollatorCommission = function () {
|
|
132
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
133
|
-
return __generator(this, function (_a) {
|
|
134
|
-
return [2 /*return*/, this.fromStorage('ParachainStaking', 'CollatorCommission').then(function (item) {
|
|
135
|
-
return item ? v1_1.SCALEInt.decode(item, 32).decoded.value : undefined;
|
|
136
|
-
})];
|
|
137
|
-
});
|
|
138
|
-
});
|
|
139
|
-
};
|
|
140
|
-
MoonbeamNodeClient.prototype.getMaxTopDelegationsPerCandidate = function () {
|
|
141
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
142
|
-
return __generator(this, function (_a) {
|
|
143
|
-
return [2 /*return*/, this.getConstant('ParachainStaking', 'MaxTopDelegationsPerCandidate').then(function (item) {
|
|
144
|
-
return item ? v1_1.SCALEInt.decode(item, 32).decoded.value : undefined;
|
|
145
|
-
})];
|
|
146
|
-
});
|
|
147
|
-
});
|
|
148
|
-
};
|
|
149
|
-
MoonbeamNodeClient.prototype.getMaxBottomDelegationsPerCandidate = function () {
|
|
150
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
151
|
-
return __generator(this, function (_a) {
|
|
152
|
-
return [2 /*return*/, this.getConstant('ParachainStaking', 'MaxBottomDelegationsPerCandidate').then(function (item) {
|
|
153
|
-
return item ? v1_1.SCALEInt.decode(item, 32).decoded.value : undefined;
|
|
154
|
-
})];
|
|
155
|
-
});
|
|
156
|
-
});
|
|
157
|
-
};
|
|
158
|
-
MoonbeamNodeClient.prototype.getMaxDelegationsPerDelegator = function () {
|
|
159
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
160
|
-
return __generator(this, function (_a) {
|
|
161
|
-
return [2 /*return*/, this.getConstant('ParachainStaking', 'MaxDelegationsPerDelegator').then(function (item) {
|
|
162
|
-
return item ? v1_1.SCALEInt.decode(item, 32).decoded.value : undefined;
|
|
163
|
-
})];
|
|
164
|
-
});
|
|
165
|
-
});
|
|
166
|
-
};
|
|
167
|
-
MoonbeamNodeClient.prototype.getMinDelegation = function () {
|
|
168
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
169
|
-
return __generator(this, function (_a) {
|
|
170
|
-
return [2 /*return*/, this.getConstant('ParachainStaking', 'MinDelegation').then(function (item) { return (item ? v1_1.SCALEInt.decode(item).decoded.value : undefined); })];
|
|
171
|
-
});
|
|
172
|
-
});
|
|
173
|
-
};
|
|
174
|
-
MoonbeamNodeClient.prototype.getMinDelegatorStake = function () {
|
|
175
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
176
|
-
return __generator(this, function (_a) {
|
|
177
|
-
return [2 /*return*/, this.getConstant('ParachainStaking', 'MinDelegation').then(function (item) { return (item ? v1_1.SCALEInt.decode(item).decoded.value : undefined); })];
|
|
178
|
-
});
|
|
179
|
-
});
|
|
180
|
-
};
|
|
181
|
-
MoonbeamNodeClient.prototype.getCandidateBondLessDelay = function () {
|
|
182
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
183
|
-
return __generator(this, function (_a) {
|
|
184
|
-
return [2 /*return*/, this.getConstant('ParachainStaking', 'CandidateBondLessDelay').then(function (item) {
|
|
185
|
-
return item ? v1_1.SCALEInt.decode(item).decoded.value : undefined;
|
|
186
|
-
})];
|
|
187
|
-
});
|
|
188
|
-
});
|
|
189
|
-
};
|
|
190
|
-
MoonbeamNodeClient.prototype.getLeaveDelegatorsDelay = function () {
|
|
191
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
192
|
-
return __generator(this, function (_a) {
|
|
193
|
-
return [2 /*return*/, this.getConstant('ParachainStaking', 'LeaveDelegatorsDelay').then(function (item) {
|
|
194
|
-
return item ? v1_1.SCALEInt.decode(item).decoded.value : undefined;
|
|
195
|
-
})];
|
|
196
|
-
});
|
|
197
|
-
});
|
|
198
|
-
};
|
|
199
|
-
MoonbeamNodeClient.prototype.getRevokeDelegationDelay = function () {
|
|
200
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
201
|
-
return __generator(this, function (_a) {
|
|
202
|
-
return [2 /*return*/, this.getConstant('ParachainStaking', 'RevokeDelegationDelay').then(function (item) {
|
|
203
|
-
return item ? v1_1.SCALEInt.decode(item).decoded.value : undefined;
|
|
204
|
-
})];
|
|
205
|
-
});
|
|
206
|
-
});
|
|
207
|
-
};
|
|
208
|
-
MoonbeamNodeClient.prototype.getDelegationBondLessDelay = function () {
|
|
209
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
210
|
-
return __generator(this, function (_a) {
|
|
211
|
-
return [2 /*return*/, this.getConstant('ParachainStaking', 'DelegationBondLessDelay').then(function (item) {
|
|
212
|
-
return item ? v1_1.SCALEInt.decode(item).decoded.value : undefined;
|
|
213
|
-
})];
|
|
214
|
-
});
|
|
215
|
-
});
|
|
216
|
-
};
|
|
217
|
-
MoonbeamNodeClient.prototype.getDefaultBlocksPerRound = function () {
|
|
218
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
219
|
-
return __generator(this, function (_a) {
|
|
220
|
-
return [2 /*return*/, this.getConstant('ParachainStaking', 'DefaultBlocksPerRound').then(function (item) {
|
|
221
|
-
return item ? v1_1.SCALEInt.decode(item).decoded.value : undefined;
|
|
222
|
-
})];
|
|
223
|
-
});
|
|
224
|
-
});
|
|
225
|
-
};
|
|
226
|
-
return MoonbeamNodeClient;
|
|
227
|
-
}(v1_1.SubstrateCommonNodeClient));
|
|
26
|
+
async getRound() {
|
|
27
|
+
return this.fromStorage('ParachainStaking', 'Round').then((item) => item ? MoonbeamRoundInfo_1.MoonbeamRoundInfo.decode(this.configuration, this.runtimeVersion, item) : undefined);
|
|
28
|
+
}
|
|
29
|
+
async getCollators() {
|
|
30
|
+
return this.fromStorage('ParachainStaking', 'SelectedCandidates').then((items) => items
|
|
31
|
+
? v1_1.SCALEArray.decode(this.configuration, this.runtimeVersion, items, (configuration, _, hex) => v1_1.SCALEAccountId.decode(configuration, hex, 20)).decoded.elements.map((encoded) => encoded.address)
|
|
32
|
+
: undefined);
|
|
33
|
+
}
|
|
34
|
+
async getDelegatorState(address) {
|
|
35
|
+
return this.fromStorage('ParachainStaking', 'DelegatorState', v1_1.SCALEAccountId.from(address, this.configuration)).then((item) => item ? MoonbeamDelegator_1.MoonbeamDelegator.decode(this.configuration, this.runtimeVersion, item) : undefined);
|
|
36
|
+
}
|
|
37
|
+
async getDelegationScheduledRequests(address) {
|
|
38
|
+
return this.fromStorage('ParachainStaking', 'DelegationScheduledRequests', v1_1.SCALEAccountId.from(address, this.configuration)).then((item) => (item ? MoonbeamDelegationScheduledRequests_1.MoonbeamDelegationScheduledRequests.decode(this.configuration, this.runtimeVersion, item) : undefined));
|
|
39
|
+
}
|
|
40
|
+
async getCandidateInfo(address) {
|
|
41
|
+
return this.fromStorage('ParachainStaking', 'CandidateInfo', v1_1.SCALEAccountId.from(address, this.configuration)).then((item) => item ? MoonbeamCandidateMetadata_1.MoonbeamCandidateMetadata.decode(this.configuration, this.runtimeVersion, item) : undefined);
|
|
42
|
+
}
|
|
43
|
+
async getCollatorCommission() {
|
|
44
|
+
return this.fromStorage('ParachainStaking', 'CollatorCommission').then((item) => item ? v1_1.SCALEInt.decode(item, 32).decoded.value : undefined);
|
|
45
|
+
}
|
|
46
|
+
async getMaxTopDelegationsPerCandidate() {
|
|
47
|
+
return this.getConstant('ParachainStaking', 'MaxTopDelegationsPerCandidate').then((item) => item ? v1_1.SCALEInt.decode(item, 32).decoded.value : undefined);
|
|
48
|
+
}
|
|
49
|
+
async getMaxBottomDelegationsPerCandidate() {
|
|
50
|
+
return this.getConstant('ParachainStaking', 'MaxBottomDelegationsPerCandidate').then((item) => item ? v1_1.SCALEInt.decode(item, 32).decoded.value : undefined);
|
|
51
|
+
}
|
|
52
|
+
async getMaxDelegationsPerDelegator() {
|
|
53
|
+
return this.getConstant('ParachainStaking', 'MaxDelegationsPerDelegator').then((item) => item ? v1_1.SCALEInt.decode(item, 32).decoded.value : undefined);
|
|
54
|
+
}
|
|
55
|
+
async getMinDelegation() {
|
|
56
|
+
return this.getConstant('ParachainStaking', 'MinDelegation').then((item) => (item ? v1_1.SCALEInt.decode(item).decoded.value : undefined));
|
|
57
|
+
}
|
|
58
|
+
async getMinDelegatorStake() {
|
|
59
|
+
return this.getConstant('ParachainStaking', 'MinDelegation').then((item) => (item ? v1_1.SCALEInt.decode(item).decoded.value : undefined));
|
|
60
|
+
}
|
|
61
|
+
async getCandidateBondLessDelay() {
|
|
62
|
+
return this.getConstant('ParachainStaking', 'CandidateBondLessDelay').then((item) => item ? v1_1.SCALEInt.decode(item).decoded.value : undefined);
|
|
63
|
+
}
|
|
64
|
+
async getLeaveDelegatorsDelay() {
|
|
65
|
+
return this.getConstant('ParachainStaking', 'LeaveDelegatorsDelay').then((item) => item ? v1_1.SCALEInt.decode(item).decoded.value : undefined);
|
|
66
|
+
}
|
|
67
|
+
async getRevokeDelegationDelay() {
|
|
68
|
+
return this.getConstant('ParachainStaking', 'RevokeDelegationDelay').then((item) => item ? v1_1.SCALEInt.decode(item).decoded.value : undefined);
|
|
69
|
+
}
|
|
70
|
+
async getDelegationBondLessDelay() {
|
|
71
|
+
return this.getConstant('ParachainStaking', 'DelegationBondLessDelay').then((item) => item ? v1_1.SCALEInt.decode(item).decoded.value : undefined);
|
|
72
|
+
}
|
|
73
|
+
async getDefaultBlocksPerRound() {
|
|
74
|
+
return this.getConstant('ParachainStaking', 'DefaultBlocksPerRound').then((item) => item ? v1_1.SCALEInt.decode(item).decoded.value : undefined);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
228
77
|
exports.MoonbeamNodeClient = MoonbeamNodeClient;
|
|
229
78
|
// Supported Calls
|
|
230
79
|
exports.STORAGE_ENTRIES = {
|