@airgap/polkadot 0.13.10 → 0.13.11-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +14 -8
- package/airgap-coinlib-polkadot.min.js +0 -85359
- package/index.d.ts +0 -1
- package/index.js +0 -18
- package/index.js.map +0 -1
- package/v0/index.d.ts +0 -5
- package/v0/index.js +0 -31
- package/v0/index.js.map +0 -1
- package/v0/protocol/kusama/KusamaProtocol.d.ts +0 -22
- package/v0/protocol/kusama/KusamaProtocol.js +0 -71
- package/v0/protocol/kusama/KusamaProtocol.js.map +0 -1
- package/v0/protocol/kusama/KusamaProtocolOptions.d.ts +0 -23
- package/v0/protocol/kusama/KusamaProtocolOptions.js +0 -85
- package/v0/protocol/kusama/KusamaProtocolOptions.js.map +0 -1
- package/v0/protocol/polkadot/PolkadotProtocol.d.ts +0 -23
- package/v0/protocol/polkadot/PolkadotProtocol.js +0 -72
- package/v0/protocol/polkadot/PolkadotProtocol.js.map +0 -1
- package/v0/protocol/polkadot/PolkadotProtocolOptions.d.ts +0 -23
- package/v0/protocol/polkadot/PolkadotProtocolOptions.js +0 -85
- package/v0/protocol/polkadot/PolkadotProtocolOptions.js.map +0 -1
- package/v1/block-explorer/SubscanBlockExplorer.d.ts +0 -3
- package/v1/block-explorer/SubscanBlockExplorer.js +0 -16
- package/v1/block-explorer/SubscanBlockExplorer.js.map +0 -1
- package/v1/controller/PolkadotAccountController.d.ts +0 -28
- package/v1/controller/PolkadotAccountController.js +0 -656
- package/v1/controller/PolkadotAccountController.js.map +0 -1
- package/v1/controller/PolkadotTransactionController.d.ts +0 -5
- package/v1/controller/PolkadotTransactionController.js +0 -28
- package/v1/controller/PolkadotTransactionController.js.map +0 -1
- package/v1/data/staking/PolkadotActiveEraInfo.d.ts +0 -8
- package/v1/data/staking/PolkadotActiveEraInfo.js +0 -19
- package/v1/data/staking/PolkadotActiveEraInfo.js.map +0 -1
- package/v1/data/staking/PolkadotEraElectionStatus.d.ts +0 -12
- package/v1/data/staking/PolkadotEraElectionStatus.js +0 -27
- package/v1/data/staking/PolkadotEraElectionStatus.js.map +0 -1
- package/v1/data/staking/PolkadotEraRewardPoints.d.ts +0 -8
- package/v1/data/staking/PolkadotEraRewardPoints.js +0 -21
- package/v1/data/staking/PolkadotEraRewardPoints.js.map +0 -1
- package/v1/data/staking/PolkadotExposure.d.ts +0 -9
- package/v1/data/staking/PolkadotExposure.js +0 -23
- package/v1/data/staking/PolkadotExposure.js.map +0 -1
- package/v1/data/staking/PolkadotNominationStatus.d.ts +0 -5
- package/v1/data/staking/PolkadotNominationStatus.js +0 -10
- package/v1/data/staking/PolkadotNominationStatus.js.map +0 -1
- package/v1/data/staking/PolkadotNominations.d.ts +0 -9
- package/v1/data/staking/PolkadotNominations.js +0 -21
- package/v1/data/staking/PolkadotNominations.js.map +0 -1
- package/v1/data/staking/PolkadotNominatorDetails.d.ts +0 -24
- package/v1/data/staking/PolkadotNominatorDetails.js +0 -3
- package/v1/data/staking/PolkadotNominatorDetails.js.map +0 -1
- package/v1/data/staking/PolkadotPayee.d.ts +0 -5
- package/v1/data/staking/PolkadotPayee.js +0 -10
- package/v1/data/staking/PolkadotPayee.js.map +0 -1
- package/v1/data/staking/PolkadotSlashingSpans.d.ts +0 -10
- package/v1/data/staking/PolkadotSlashingSpans.js +0 -23
- package/v1/data/staking/PolkadotSlashingSpans.js.map +0 -1
- package/v1/data/staking/PolkadotStakingActionType.d.ts +0 -14
- package/v1/data/staking/PolkadotStakingActionType.js +0 -19
- package/v1/data/staking/PolkadotStakingActionType.js.map +0 -1
- package/v1/data/staking/PolkadotStakingLedger.d.ts +0 -11
- package/v1/data/staking/PolkadotStakingLedger.js +0 -27
- package/v1/data/staking/PolkadotStakingLedger.js.map +0 -1
- package/v1/data/staking/PolkadotValidatorDetails.d.ts +0 -16
- package/v1/data/staking/PolkadotValidatorDetails.js +0 -3
- package/v1/data/staking/PolkadotValidatorDetails.js.map +0 -1
- package/v1/data/staking/PolkadotValidatorPrefs.d.ts +0 -7
- package/v1/data/staking/PolkadotValidatorPrefs.js +0 -17
- package/v1/data/staking/PolkadotValidatorPrefs.js.map +0 -1
- package/v1/data/transaction/method/args.d.ts +0 -2
- package/v1/data/transaction/method/args.js +0 -439
- package/v1/data/transaction/method/args.js.map +0 -1
- package/v1/data/transaction/transaction.d.ts +0 -2
- package/v1/data/transaction/transaction.js +0 -28
- package/v1/data/transaction/transaction.js.map +0 -1
- package/v1/index.d.ts +0 -10
- package/v1/index.js +0 -13
- package/v1/index.js.map +0 -1
- package/v1/module/PolkadotModule.d.ts +0 -17
- package/v1/module/PolkadotModule.js +0 -121
- package/v1/module/PolkadotModule.js.map +0 -1
- package/v1/node/PolkadotNodeClient.d.ts +0 -46
- package/v1/node/PolkadotNodeClient.js +0 -323
- package/v1/node/PolkadotNodeClient.js.map +0 -1
- package/v1/protocol/KusamaProtocol.d.ts +0 -14
- package/v1/protocol/KusamaProtocol.js +0 -105
- package/v1/protocol/KusamaProtocol.js.map +0 -1
- package/v1/protocol/PolkadotBaseProtocol.d.ts +0 -24
- package/v1/protocol/PolkadotBaseProtocol.js +0 -478
- package/v1/protocol/PolkadotBaseProtocol.js.map +0 -1
- package/v1/protocol/PolkadotProtocol.d.ts +0 -14
- package/v1/protocol/PolkadotProtocol.js +0 -116
- package/v1/protocol/PolkadotProtocol.js.map +0 -1
- package/v1/serializer/v3/schemas/converter/transaction-converter.d.ts +0 -7
- package/v1/serializer/v3/schemas/converter/transaction-converter.js +0 -21
- package/v1/serializer/v3/schemas/converter/transaction-converter.js.map +0 -1
- package/v1/serializer/v3/schemas/definitions/transaction-sign-request-polkadot.d.ts +0 -3
- package/v1/serializer/v3/schemas/definitions/transaction-sign-request-polkadot.js +0 -3
- package/v1/serializer/v3/schemas/definitions/transaction-sign-request-polkadot.js.map +0 -1
- package/v1/serializer/v3/schemas/definitions/transaction-sign-response-polkadot.d.ts +0 -3
- package/v1/serializer/v3/schemas/definitions/transaction-sign-response-polkadot.js +0 -3
- package/v1/serializer/v3/schemas/definitions/transaction-sign-response-polkadot.js.map +0 -1
- package/v1/serializer/v3/schemas/generated/transaction-sign-request-polkadot.json +0 -36
- package/v1/serializer/v3/schemas/generated/transaction-sign-response-polkadot.json +0 -19
- package/v1/serializer/v3/serializer-companion.d.ts +0 -14
- package/v1/serializer/v3/serializer-companion.js +0 -189
- package/v1/serializer/v3/serializer-companion.js.map +0 -1
- package/v1/serializer/v3/validators/transaction-validator.d.ts +0 -4
- package/v1/serializer/v3/validators/transaction-validator.js +0 -28
- package/v1/serializer/v3/validators/transaction-validator.js.map +0 -1
- package/v1/serializer/v3/validators/validators.d.ts +0 -4
- package/v1/serializer/v3/validators/validators.js +0 -6
- package/v1/serializer/v3/validators/validators.js.map +0 -1
- package/v1/types/configuration.d.ts +0 -11
- package/v1/types/configuration.js +0 -3
- package/v1/types/configuration.js.map +0 -1
- package/v1/types/protocol.d.ts +0 -12
- package/v1/types/protocol.js +0 -3
- package/v1/types/protocol.js.map +0 -1
|
@@ -1,121 +0,0 @@
|
|
|
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("@airgap/coinlib-core");
|
|
41
|
-
var errors_1 = require("@airgap/coinlib-core/errors");
|
|
42
|
-
var module_kit_1 = require("@airgap/module-kit");
|
|
43
|
-
var SubscanBlockExplorer_1 = require("../block-explorer/SubscanBlockExplorer");
|
|
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, networkId) {
|
|
68
|
-
var _a;
|
|
69
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
70
|
-
var network;
|
|
71
|
-
return __generator(this, function (_b) {
|
|
72
|
-
network = (_a = this.networkRegistries[identifier]) === null || _a === void 0 ? void 0 : _a.findNetwork(networkId);
|
|
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, networkId) {
|
|
81
|
-
var _a;
|
|
82
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
83
|
-
var network;
|
|
84
|
-
return __generator(this, function (_b) {
|
|
85
|
-
network = (_a = this.networkRegistries[identifier]) === null || _a === void 0 ? void 0 : _a.findNetwork(networkId);
|
|
86
|
-
if ((network === null || network === void 0 ? void 0 : network.type) !== 'mainnet') {
|
|
87
|
-
throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.SUBSTRATE, "Block Explorer network type not supported. (Polkadot)");
|
|
88
|
-
}
|
|
89
|
-
switch (identifier) {
|
|
90
|
-
case coinlib_core_1.MainProtocolSymbols.POLKADOT:
|
|
91
|
-
return [2 /*return*/, (0, SubscanBlockExplorer_1.createPolkadotSubscanBlockExplorer)()];
|
|
92
|
-
case coinlib_core_1.MainProtocolSymbols.KUSAMA:
|
|
93
|
-
return [2 /*return*/, (0, SubscanBlockExplorer_1.createKusamaSubscanBlockExplorer)()];
|
|
94
|
-
default:
|
|
95
|
-
throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.SUBSTRATE, "Protocol ".concat(identifier, " not supported. (Polkadot)"));
|
|
96
|
-
}
|
|
97
|
-
return [2 /*return*/];
|
|
98
|
-
});
|
|
99
|
-
});
|
|
100
|
-
};
|
|
101
|
-
PolkadotModule.prototype.createV3SerializerCompanion = function () {
|
|
102
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
103
|
-
return __generator(this, function (_a) {
|
|
104
|
-
return [2 /*return*/, new serializer_companion_1.PolkadotV3SerializerCompanion()];
|
|
105
|
-
});
|
|
106
|
-
});
|
|
107
|
-
};
|
|
108
|
-
PolkadotModule.prototype.createProtocol = function (identifier, network) {
|
|
109
|
-
switch (identifier) {
|
|
110
|
-
case coinlib_core_1.MainProtocolSymbols.POLKADOT:
|
|
111
|
-
return (0, PolkadotProtocol_1.createPolkadotProtocol)({ network: network });
|
|
112
|
-
case coinlib_core_1.MainProtocolSymbols.KUSAMA:
|
|
113
|
-
return (0, KusamaProtocol_1.createKusamaProtocol)({ network: network });
|
|
114
|
-
default:
|
|
115
|
-
throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.SUBSTRATE, "Protocol ".concat(identifier, " not supported. (Polkadot)"));
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
|
-
return PolkadotModule;
|
|
119
|
-
}());
|
|
120
|
-
exports.PolkadotModule = PolkadotModule;
|
|
121
|
-
//# sourceMappingURL=PolkadotModule.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PolkadotModule.js","sourceRoot":"","sources":["../../../src/v1/module/PolkadotModule.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAAkE;AAClE,sDAAqE;AACrE,iDAO2B;AAI3B,+EAA6H;AAC7H,6DAAkG;AAClG,iEAAwG;AACxG,8EAAqF;AAIrF;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;IA6C1I,CAAC;IA3Cc,8CAAqB,GAAlC,UAAmC,UAA8B;;;gBAC/D,sBAAO,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,EAAA;;;KACvC;IAEY,6CA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AAK,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,AAtDD,IAsDC;AAtDY,wCAAc"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import BigNumber from '@airgap/coinlib-core/dependencies/src/bignumber.js-9.0.0/bignumber';
|
|
2
|
-
import { SCALEAccountId, SCALEArray, SCALECompactInt, SCALEData, SCALETuple, SubstrateCommonNodeClient, SubstrateRegistration, SubstrateSS58Address } from '@airgap/substrate/v1';
|
|
3
|
-
import { PolkadotActiveEraInfo } from '../data/staking/PolkadotActiveEraInfo';
|
|
4
|
-
import { PolkadotEraElectionStatus } from '../data/staking/PolkadotEraElectionStatus';
|
|
5
|
-
import { PolkadotEraRewardPoints } from '../data/staking/PolkadotEraRewardPoints';
|
|
6
|
-
import { PolkadotExposure } from '../data/staking/PolkadotExposure';
|
|
7
|
-
import { PolkadotNominations } from '../data/staking/PolkadotNominations';
|
|
8
|
-
import { PolkadotPayee } from '../data/staking/PolkadotPayee';
|
|
9
|
-
import { PolkadotSlashingSpans } from '../data/staking/PolkadotSlashingSpans';
|
|
10
|
-
import { PolkadotStakingLedger } from '../data/staking/PolkadotStakingLedger';
|
|
11
|
-
import { PolkadotValidatorPrefs } from '../data/staking/PolkadotValidatorPrefs';
|
|
12
|
-
import { PolkadotProtocolConfiguration } from '../types/configuration';
|
|
13
|
-
export declare class PolkadotNodeClient extends SubstrateCommonNodeClient<PolkadotProtocolConfiguration> {
|
|
14
|
-
constructor(configuration: PolkadotProtocolConfiguration, url: string);
|
|
15
|
-
getBlockTime(): Promise<BigNumber>;
|
|
16
|
-
getCurrentEraIndex(): Promise<BigNumber | undefined>;
|
|
17
|
-
getBonded(address: SubstrateSS58Address): Promise<SubstrateSS58Address | undefined>;
|
|
18
|
-
getNominations(address: SubstrateSS58Address): Promise<PolkadotNominations | undefined>;
|
|
19
|
-
getRewardPoints(eraIndex: number): Promise<PolkadotEraRewardPoints | undefined>;
|
|
20
|
-
getValidatorReward(eraIndex: number): Promise<BigNumber | undefined>;
|
|
21
|
-
getStakersClipped(eraIndex: number, validator: SubstrateSS58Address): Promise<PolkadotExposure | undefined>;
|
|
22
|
-
getRewardDestination(address: SubstrateSS58Address): Promise<PolkadotPayee | undefined>;
|
|
23
|
-
getStakingLedger(address: SubstrateSS58Address): Promise<PolkadotStakingLedger | undefined>;
|
|
24
|
-
getValidators(): Promise<SubstrateSS58Address[] | undefined>;
|
|
25
|
-
getValidatorExposure(eraIndex: number, address: SubstrateSS58Address): Promise<PolkadotExposure | undefined>;
|
|
26
|
-
getElectionStatus(): Promise<PolkadotEraElectionStatus | undefined>;
|
|
27
|
-
getIdentityOf(address: SubstrateSS58Address): Promise<SubstrateRegistration | undefined>;
|
|
28
|
-
getSuperOf(address: SubstrateSS58Address): Promise<SCALETuple<SCALEAccountId<PolkadotProtocolConfiguration>, SCALEData> | undefined>;
|
|
29
|
-
getSubsOf(address: SubstrateSS58Address): Promise<SCALETuple<SCALECompactInt, SCALEArray<SCALEAccountId<PolkadotProtocolConfiguration>>> | undefined>;
|
|
30
|
-
getValidatorPrefs(eraIndex: number, address: SubstrateSS58Address): Promise<PolkadotValidatorPrefs | undefined>;
|
|
31
|
-
getExpectedEraDuration(): Promise<BigNumber | undefined>;
|
|
32
|
-
getActiveEraInfo(): Promise<PolkadotActiveEraInfo | undefined>;
|
|
33
|
-
getSlashingSpan(address: SubstrateSS58Address): Promise<PolkadotSlashingSpans | undefined>;
|
|
34
|
-
}
|
|
35
|
-
export declare const STORAGE_ENTRIES: {
|
|
36
|
-
Identity: readonly ["IdentityOf", "SuperOf", "SubsOf"];
|
|
37
|
-
Staking: readonly ["Bonded", "Ledger", "Payee", "Nominators", "CurrentEra", "ActiveEra", "EraElectionStatus", "ErasStakers", "ErasStakersClipped", "ErasValidatorPrefs", "ErasValidatorReward", "ErasRewardPoints", "SlashingSpans"];
|
|
38
|
-
Session: readonly ["Validators"];
|
|
39
|
-
};
|
|
40
|
-
export declare const CALLS: {
|
|
41
|
-
Staking: readonly ["bond", "bond_extra", "unbond", "withdraw_unbonded", "nominate", "chill", "set_payee", "set_controller", "payout_stakers", "rebond"];
|
|
42
|
-
};
|
|
43
|
-
export declare const CONSTANTS: {
|
|
44
|
-
Babe: readonly ["EpochDuration", "ExpectedBlockTime"];
|
|
45
|
-
Staking: readonly ["SessionsPerEra"];
|
|
46
|
-
};
|
|
@@ -1,323 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __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("@airgap/substrate/v1");
|
|
56
|
-
var PolkadotActiveEraInfo_1 = require("../data/staking/PolkadotActiveEraInfo");
|
|
57
|
-
var PolkadotEraElectionStatus_1 = require("../data/staking/PolkadotEraElectionStatus");
|
|
58
|
-
var PolkadotEraRewardPoints_1 = require("../data/staking/PolkadotEraRewardPoints");
|
|
59
|
-
var PolkadotExposure_1 = require("../data/staking/PolkadotExposure");
|
|
60
|
-
var PolkadotNominations_1 = require("../data/staking/PolkadotNominations");
|
|
61
|
-
var PolkadotPayee_1 = require("../data/staking/PolkadotPayee");
|
|
62
|
-
var PolkadotSlashingSpans_1 = require("../data/staking/PolkadotSlashingSpans");
|
|
63
|
-
var PolkadotStakingLedger_1 = require("../data/staking/PolkadotStakingLedger");
|
|
64
|
-
var PolkadotValidatorPrefs_1 = require("../data/staking/PolkadotValidatorPrefs");
|
|
65
|
-
var PolkadotNodeClient = /** @class */ (function (_super) {
|
|
66
|
-
__extends(PolkadotNodeClient, _super);
|
|
67
|
-
function PolkadotNodeClient(configuration, url) {
|
|
68
|
-
var _this = _super.call(this, configuration, url) || this;
|
|
69
|
-
_this.registerCallEntrypointEntries([
|
|
70
|
-
_this.createCallEndpointEntry('bond', 'Staking', 'bond'),
|
|
71
|
-
_this.createCallEndpointEntry('unbond', 'Staking', 'unbond'),
|
|
72
|
-
_this.createCallEndpointEntry('bond_extra', 'Staking', 'bond_extra'),
|
|
73
|
-
_this.createCallEndpointEntry('withdraw_unbonded', 'Staking', 'withdraw_unbonded'),
|
|
74
|
-
_this.createCallEndpointEntry('nominate', 'Staking', 'nominate'),
|
|
75
|
-
_this.createCallEndpointEntry('cancel_nomination', 'Staking', 'chill'),
|
|
76
|
-
_this.createCallEndpointEntry('collect_payout', 'Staking', 'payout_stakers'),
|
|
77
|
-
_this.createCallEndpointEntry('set_payee', 'Staking', 'set_payee'),
|
|
78
|
-
_this.createCallEndpointEntry('set_controller', 'Staking', 'set_controller'),
|
|
79
|
-
_this.createCallEndpointEntry('rebond', 'Staking', 'rebond')
|
|
80
|
-
]);
|
|
81
|
-
return _this;
|
|
82
|
-
}
|
|
83
|
-
PolkadotNodeClient.prototype.getBlockTime = function () {
|
|
84
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
85
|
-
return __generator(this, function (_a) {
|
|
86
|
-
return [2 /*return*/, this.getConstant('Babe', 'ExpectedBlockTime').then(function (constant) { return v1_1.SCALEInt.decode(constant).decoded.value; })];
|
|
87
|
-
});
|
|
88
|
-
});
|
|
89
|
-
};
|
|
90
|
-
PolkadotNodeClient.prototype.getCurrentEraIndex = function () {
|
|
91
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
92
|
-
return __generator(this, function (_a) {
|
|
93
|
-
return [2 /*return*/, this.fromStorage('Staking', 'CurrentEra').then(function (item) { return (item ? v1_1.SCALEInt.decode(item).decoded.value : undefined); })];
|
|
94
|
-
});
|
|
95
|
-
});
|
|
96
|
-
};
|
|
97
|
-
PolkadotNodeClient.prototype.getBonded = function (address) {
|
|
98
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
99
|
-
var _this = this;
|
|
100
|
-
return __generator(this, function (_a) {
|
|
101
|
-
return [2 /*return*/, this.fromStorage('Staking', 'Bonded', v1_1.SCALEAccountId.from(address, this.configuration)).then(function (item) {
|
|
102
|
-
return item ? v1_1.SCALEAccountId.decode(_this.configuration, item).decoded.address : undefined;
|
|
103
|
-
})];
|
|
104
|
-
});
|
|
105
|
-
});
|
|
106
|
-
};
|
|
107
|
-
PolkadotNodeClient.prototype.getNominations = function (address) {
|
|
108
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
109
|
-
var _this = this;
|
|
110
|
-
return __generator(this, function (_a) {
|
|
111
|
-
return [2 /*return*/, this.fromStorage('Staking', 'Nominators', v1_1.SCALEAccountId.from(address, this.configuration)).then(function (item) {
|
|
112
|
-
return item ? PolkadotNominations_1.PolkadotNominations.decode(_this.configuration, _this.runtimeVersion, item) : undefined;
|
|
113
|
-
})];
|
|
114
|
-
});
|
|
115
|
-
});
|
|
116
|
-
};
|
|
117
|
-
PolkadotNodeClient.prototype.getRewardPoints = function (eraIndex) {
|
|
118
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
119
|
-
var _this = this;
|
|
120
|
-
return __generator(this, function (_a) {
|
|
121
|
-
return [2 /*return*/, this.fromStorage('Staking', 'ErasRewardPoints', v1_1.SCALEInt.from(eraIndex, 32)).then(function (item) {
|
|
122
|
-
return item ? PolkadotEraRewardPoints_1.PolkadotEraRewardPoints.decode(_this.configuration, _this.runtimeVersion, item) : undefined;
|
|
123
|
-
})];
|
|
124
|
-
});
|
|
125
|
-
});
|
|
126
|
-
};
|
|
127
|
-
PolkadotNodeClient.prototype.getValidatorReward = function (eraIndex) {
|
|
128
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
129
|
-
return __generator(this, function (_a) {
|
|
130
|
-
return [2 /*return*/, this.fromStorage('Staking', 'ErasValidatorReward', v1_1.SCALEInt.from(eraIndex, 32)).then(function (item) {
|
|
131
|
-
return item ? v1_1.SCALEInt.decode(item).decoded.value : undefined;
|
|
132
|
-
})];
|
|
133
|
-
});
|
|
134
|
-
});
|
|
135
|
-
};
|
|
136
|
-
PolkadotNodeClient.prototype.getStakersClipped = function (eraIndex, validator) {
|
|
137
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
138
|
-
var _this = this;
|
|
139
|
-
return __generator(this, function (_a) {
|
|
140
|
-
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); })];
|
|
141
|
-
});
|
|
142
|
-
});
|
|
143
|
-
};
|
|
144
|
-
PolkadotNodeClient.prototype.getRewardDestination = function (address) {
|
|
145
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
146
|
-
return __generator(this, function (_a) {
|
|
147
|
-
return [2 /*return*/, this.fromStorage('Staking', 'Payee', v1_1.SCALEAccountId.from(address, this.configuration)).then(function (item) {
|
|
148
|
-
return item ? v1_1.SCALEEnum.decode(item, function (hex) { return PolkadotPayee_1.PolkadotPayee[PolkadotPayee_1.PolkadotPayee[hex]]; }).decoded.value : undefined;
|
|
149
|
-
})];
|
|
150
|
-
});
|
|
151
|
-
});
|
|
152
|
-
};
|
|
153
|
-
PolkadotNodeClient.prototype.getStakingLedger = function (address) {
|
|
154
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
155
|
-
var _this = this;
|
|
156
|
-
return __generator(this, function (_a) {
|
|
157
|
-
return [2 /*return*/, this.fromStorage('Staking', 'Ledger', v1_1.SCALEAccountId.from(address, this.configuration)).then(function (item) {
|
|
158
|
-
return item ? PolkadotStakingLedger_1.PolkadotStakingLedger.decode(_this.configuration, _this.runtimeVersion, item) : undefined;
|
|
159
|
-
})];
|
|
160
|
-
});
|
|
161
|
-
});
|
|
162
|
-
};
|
|
163
|
-
PolkadotNodeClient.prototype.getValidators = function () {
|
|
164
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
165
|
-
var _this = this;
|
|
166
|
-
return __generator(this, function (_a) {
|
|
167
|
-
return [2 /*return*/, this.fromStorage('Session', 'Validators').then(function (items) {
|
|
168
|
-
return items
|
|
169
|
-
? v1_1.SCALEArray.decode(_this.configuration, _this.runtimeVersion, items, function (network, _, hex) {
|
|
170
|
-
return v1_1.SCALEAccountId.decode(network, hex);
|
|
171
|
-
}).decoded.elements.map(function (encoded) { return encoded.address; })
|
|
172
|
-
: undefined;
|
|
173
|
-
})];
|
|
174
|
-
});
|
|
175
|
-
});
|
|
176
|
-
};
|
|
177
|
-
PolkadotNodeClient.prototype.getValidatorExposure = function (eraIndex, address) {
|
|
178
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
179
|
-
var _this = this;
|
|
180
|
-
return __generator(this, function (_a) {
|
|
181
|
-
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); })];
|
|
182
|
-
});
|
|
183
|
-
});
|
|
184
|
-
};
|
|
185
|
-
PolkadotNodeClient.prototype.getElectionStatus = function () {
|
|
186
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
187
|
-
var _this = this;
|
|
188
|
-
return __generator(this, function (_a) {
|
|
189
|
-
return [2 /*return*/, this.fromStorage('Staking', 'EraElectionStatus').then(function (item) {
|
|
190
|
-
return item ? PolkadotEraElectionStatus_1.PolkadotEraElectionStatus.decode(_this.configuration, _this.runtimeVersion, item) : undefined;
|
|
191
|
-
})];
|
|
192
|
-
});
|
|
193
|
-
});
|
|
194
|
-
};
|
|
195
|
-
PolkadotNodeClient.prototype.getIdentityOf = function (address) {
|
|
196
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
197
|
-
var _this = this;
|
|
198
|
-
return __generator(this, function (_a) {
|
|
199
|
-
return [2 /*return*/, this.fromStorage('Identity', 'IdentityOf', v1_1.SCALEAccountId.from(address, this.configuration)).then(function (item) {
|
|
200
|
-
return item ? v1_1.SubstrateRegistration.decode(_this.configuration, _this.runtimeVersion, item) : undefined;
|
|
201
|
-
})];
|
|
202
|
-
});
|
|
203
|
-
});
|
|
204
|
-
};
|
|
205
|
-
PolkadotNodeClient.prototype.getSuperOf = function (address) {
|
|
206
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
207
|
-
var _this = this;
|
|
208
|
-
return __generator(this, function (_a) {
|
|
209
|
-
return [2 /*return*/, this.fromStorage('Identity', 'SuperOf', v1_1.SCALEAccountId.from(address, this.configuration)).then(function (item) {
|
|
210
|
-
return item
|
|
211
|
-
? 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
|
|
212
|
-
: undefined;
|
|
213
|
-
})];
|
|
214
|
-
});
|
|
215
|
-
});
|
|
216
|
-
};
|
|
217
|
-
PolkadotNodeClient.prototype.getSubsOf = function (address) {
|
|
218
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
219
|
-
var _this = this;
|
|
220
|
-
return __generator(this, function (_a) {
|
|
221
|
-
return [2 /*return*/, this.fromStorage('Identity', 'SubsOf', v1_1.SCALEAccountId.from(address, this.configuration)).then(function (item) {
|
|
222
|
-
return item
|
|
223
|
-
? v1_1.SCALETuple.decode(_this.configuration, _this.runtimeVersion, item, function (_network, _runtimeVersion, hex) { return v1_1.SCALECompactInt.decode(hex); }, function (network, _, hex) {
|
|
224
|
-
return v1_1.SCALEArray.decode(network, _, hex, function (innerNetwork, _, innerHex) { return v1_1.SCALEAccountId.decode(innerNetwork, innerHex); });
|
|
225
|
-
}).decoded
|
|
226
|
-
: undefined;
|
|
227
|
-
})];
|
|
228
|
-
});
|
|
229
|
-
});
|
|
230
|
-
};
|
|
231
|
-
PolkadotNodeClient.prototype.getValidatorPrefs = function (eraIndex, address) {
|
|
232
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
233
|
-
var _this = this;
|
|
234
|
-
return __generator(this, function (_a) {
|
|
235
|
-
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); })];
|
|
236
|
-
});
|
|
237
|
-
});
|
|
238
|
-
};
|
|
239
|
-
PolkadotNodeClient.prototype.getExpectedEraDuration = function () {
|
|
240
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
241
|
-
var constants, expectedBlockTime, epochDuration, sessionsPerEra;
|
|
242
|
-
return __generator(this, function (_a) {
|
|
243
|
-
switch (_a.label) {
|
|
244
|
-
case 0: return [4 /*yield*/, Promise.all([
|
|
245
|
-
this.getConstant('Babe', 'ExpectedBlockTime'),
|
|
246
|
-
this.getConstant('Babe', 'EpochDuration'),
|
|
247
|
-
this.getConstant('Staking', 'SessionsPerEra')
|
|
248
|
-
]).then(function (constants) { return constants.map(function (constant) { return (constant ? v1_1.SCALEInt.decode(constant).decoded.value : undefined); }); })];
|
|
249
|
-
case 1:
|
|
250
|
-
constants = _a.sent();
|
|
251
|
-
if (constants.some(function (constant) { return constant === undefined; })) {
|
|
252
|
-
return [2 /*return*/, undefined];
|
|
253
|
-
}
|
|
254
|
-
expectedBlockTime = constants[0];
|
|
255
|
-
epochDuration = constants[1];
|
|
256
|
-
sessionsPerEra = constants[2];
|
|
257
|
-
return [2 /*return*/, expectedBlockTime.multipliedBy(epochDuration).multipliedBy(sessionsPerEra)];
|
|
258
|
-
}
|
|
259
|
-
});
|
|
260
|
-
});
|
|
261
|
-
};
|
|
262
|
-
PolkadotNodeClient.prototype.getActiveEraInfo = function () {
|
|
263
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
264
|
-
var _this = this;
|
|
265
|
-
return __generator(this, function (_a) {
|
|
266
|
-
return [2 /*return*/, this.fromStorage('Staking', 'ActiveEra').then(function (item) {
|
|
267
|
-
return item ? PolkadotActiveEraInfo_1.PolkadotActiveEraInfo.decode(_this.configuration, _this.runtimeVersion, item) : undefined;
|
|
268
|
-
})];
|
|
269
|
-
});
|
|
270
|
-
});
|
|
271
|
-
};
|
|
272
|
-
PolkadotNodeClient.prototype.getSlashingSpan = function (address) {
|
|
273
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
274
|
-
var _this = this;
|
|
275
|
-
return __generator(this, function (_a) {
|
|
276
|
-
return [2 /*return*/, this.fromStorage('Staking', 'SlashingSpans', v1_1.SCALEAccountId.from(address, this.configuration)).then(function (item) {
|
|
277
|
-
return item ? PolkadotSlashingSpans_1.PolkadotSlashingSpans.decode(_this.configuration, _this.runtimeVersion, item) : undefined;
|
|
278
|
-
})];
|
|
279
|
-
});
|
|
280
|
-
});
|
|
281
|
-
};
|
|
282
|
-
return PolkadotNodeClient;
|
|
283
|
-
}(v1_1.SubstrateCommonNodeClient));
|
|
284
|
-
exports.PolkadotNodeClient = PolkadotNodeClient;
|
|
285
|
-
// Supported Calls
|
|
286
|
-
exports.STORAGE_ENTRIES = {
|
|
287
|
-
Identity: ['IdentityOf', 'SuperOf', 'SubsOf'],
|
|
288
|
-
Staking: [
|
|
289
|
-
'Bonded',
|
|
290
|
-
'Ledger',
|
|
291
|
-
'Payee',
|
|
292
|
-
'Nominators',
|
|
293
|
-
'CurrentEra',
|
|
294
|
-
'ActiveEra',
|
|
295
|
-
'EraElectionStatus',
|
|
296
|
-
'ErasStakers',
|
|
297
|
-
'ErasStakersClipped',
|
|
298
|
-
'ErasValidatorPrefs',
|
|
299
|
-
'ErasValidatorReward',
|
|
300
|
-
'ErasRewardPoints',
|
|
301
|
-
'SlashingSpans'
|
|
302
|
-
],
|
|
303
|
-
Session: ['Validators']
|
|
304
|
-
};
|
|
305
|
-
exports.CALLS = {
|
|
306
|
-
Staking: [
|
|
307
|
-
'bond',
|
|
308
|
-
'bond_extra',
|
|
309
|
-
'unbond',
|
|
310
|
-
'withdraw_unbonded',
|
|
311
|
-
'nominate',
|
|
312
|
-
'chill',
|
|
313
|
-
'set_payee',
|
|
314
|
-
'set_controller',
|
|
315
|
-
'payout_stakers',
|
|
316
|
-
'rebond'
|
|
317
|
-
]
|
|
318
|
-
};
|
|
319
|
-
exports.CONSTANTS = {
|
|
320
|
-
Babe: ['EpochDuration', 'ExpectedBlockTime'],
|
|
321
|
-
Staking: ['SessionsPerEra']
|
|
322
|
-
};
|
|
323
|
-
//# sourceMappingURL=PolkadotNodeClient.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PolkadotNodeClient.js","sourceRoot":"","sources":["../../../src/v1/node/PolkadotNodeClient.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,2CAW6B;AAE7B,+EAA6E;AAC7E,uFAAqF;AACrF,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,uBAAuB,CAAC,YAAY,EAAE,SAAS,EAAE,YAAY,CAAC;YACnE,KAAI,CAAC,uBAAuB,CAAC,mBAAmB,EAAE,SAAS,EAAE,mBAAmB,CAAC;YACjF,KAAI,CAAC,uBAAuB,CAAC,UAAU,EAAE,SAAS,EAAE,UAAU,CAAC;YAC/D,KAAI,CAAC,uBAAuB,CAAC,mBAAmB,EAAE,SAAS,EAAE,OAAO,CAAC;YACrE,KAAI,CAAC,uBAAuB,CAAC,gBAAgB,EAAE,SAAS,EAAE,gBAAgB,CAAC;YAC3E,KAAI,CAAC,uBAAuB,CAAC,WAAW,EAAE,SAAS,EAAE,WAAW,CAAC;YACjE,KAAI,CAAC,uBAAuB,CAAC,gBAAgB,EAAE,SAAS,EAAE,gBAAgB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e,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,mBAAmB;QACnB,aAAa;QACb,oBAAoB;QACpB,oBAAoB;QACpB,qBAAqB;QACrB,kBAAkB;QAClB,eAAe;KACP;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"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ProtocolMetadata, RecursivePartial } from '@airgap/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;
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __assign = (this && this.__assign) || function () {
|
|
18
|
-
__assign = Object.assign || function(t) {
|
|
19
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
20
|
-
s = arguments[i];
|
|
21
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
22
|
-
t[p] = s[p];
|
|
23
|
-
}
|
|
24
|
-
return t;
|
|
25
|
-
};
|
|
26
|
-
return __assign.apply(this, arguments);
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.createKusamaProtocolOptions = exports.KUSAMA_MAINNET_PROTOCOL_NETWORK = exports.createKusamaProtocol = exports.KusamaProtocolImpl = exports.KUSAMA_CONFIGURATION = exports.KUSAMA_METADATA = void 0;
|
|
30
|
-
var coinlib_core_1 = require("@airgap/coinlib-core");
|
|
31
|
-
var PolkadotBaseProtocol_1 = require("./PolkadotBaseProtocol");
|
|
32
|
-
var PolkadotProtocol_1 = require("./PolkadotProtocol");
|
|
33
|
-
// Implementation
|
|
34
|
-
exports.KUSAMA_METADATA = {
|
|
35
|
-
identifier: coinlib_core_1.MainProtocolSymbols.KUSAMA,
|
|
36
|
-
name: 'Kusama',
|
|
37
|
-
units: {
|
|
38
|
-
KSM: {
|
|
39
|
-
symbol: { value: 'KSM' },
|
|
40
|
-
decimals: 12
|
|
41
|
-
},
|
|
42
|
-
mKSM: {
|
|
43
|
-
symbol: { value: 'mKSM' },
|
|
44
|
-
decimals: 9
|
|
45
|
-
},
|
|
46
|
-
uKSM: {
|
|
47
|
-
symbol: { value: 'uKSM' },
|
|
48
|
-
decimals: 6
|
|
49
|
-
},
|
|
50
|
-
Point: {
|
|
51
|
-
symbol: { value: 'Point' },
|
|
52
|
-
decimals: 3
|
|
53
|
-
},
|
|
54
|
-
Planck: {
|
|
55
|
-
symbol: { value: 'Planck' },
|
|
56
|
-
decimals: 0
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
mainUnit: 'KSM',
|
|
60
|
-
account: {
|
|
61
|
-
standardDerivationPath: "m/44'/434'/0'/0/0",
|
|
62
|
-
address: {
|
|
63
|
-
isCaseSensitive: true,
|
|
64
|
-
placeholder: "C/D/E/F/G/H/J...",
|
|
65
|
-
regex: '^[C-HJ][a-km-zA-HJ-NP-Z1-9]+$'
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
exports.KUSAMA_CONFIGURATION = __assign(__assign({}, PolkadotProtocol_1.POLKADOT_CONFIGURATION), { account: {
|
|
70
|
-
type: 'ss58',
|
|
71
|
-
format: 2
|
|
72
|
-
} });
|
|
73
|
-
var KusamaProtocolImpl = /** @class */ (function (_super) {
|
|
74
|
-
__extends(KusamaProtocolImpl, _super);
|
|
75
|
-
function KusamaProtocolImpl(options) {
|
|
76
|
-
if (options === void 0) { options = {}; }
|
|
77
|
-
var completeOptions = createKusamaProtocolOptions(options.network);
|
|
78
|
-
var metadata = exports.KUSAMA_METADATA;
|
|
79
|
-
var configuration = exports.KUSAMA_CONFIGURATION;
|
|
80
|
-
return _super.call(this, { metadata: metadata, configuration: configuration, network: completeOptions.network }) || this;
|
|
81
|
-
}
|
|
82
|
-
return KusamaProtocolImpl;
|
|
83
|
-
}(PolkadotBaseProtocol_1.PolkadotBaseProtocolImpl));
|
|
84
|
-
exports.KusamaProtocolImpl = KusamaProtocolImpl;
|
|
85
|
-
// Factory
|
|
86
|
-
function createKusamaProtocol(options) {
|
|
87
|
-
if (options === void 0) { options = {}; }
|
|
88
|
-
return new KusamaProtocolImpl(options);
|
|
89
|
-
}
|
|
90
|
-
exports.createKusamaProtocol = createKusamaProtocol;
|
|
91
|
-
exports.KUSAMA_MAINNET_PROTOCOL_NETWORK = {
|
|
92
|
-
name: 'Mainnet',
|
|
93
|
-
type: 'mainnet',
|
|
94
|
-
rpcUrl: 'https://polkadot-kusama-node.prod.gke.papers.tech',
|
|
95
|
-
blockExplorerApi: 'https://kusama.subscan.prod.gke.papers.tech/api/scan'
|
|
96
|
-
};
|
|
97
|
-
var DEFAULT_KUSAMA_PROTOCOL_NETWORK = exports.KUSAMA_MAINNET_PROTOCOL_NETWORK;
|
|
98
|
-
function createKusamaProtocolOptions(network) {
|
|
99
|
-
if (network === void 0) { network = {}; }
|
|
100
|
-
return {
|
|
101
|
-
network: __assign(__assign({}, DEFAULT_KUSAMA_PROTOCOL_NETWORK), network)
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
exports.createKusamaProtocolOptions = createKusamaProtocolOptions;
|
|
105
|
-
//# sourceMappingURL=KusamaProtocol.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"KusamaProtocol.js","sourceRoot":"","sources":["../../../src/v1/protocol/KusamaProtocol.ts"],"names":[],"mappings":";;;;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