@airgap/moonbeam 0.13.7-beta.11
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/airgap-coinlib-moonbeam.min.js +103205 -0
- package/index.d.ts +6 -0
- package/index.js +22 -0
- package/index.js.map +1 -0
- package/package.json +62 -0
- package/protocol/moonbase/MoonbaseProtocol.d.ts +17 -0
- package/protocol/moonbase/MoonbaseProtocol.js +73 -0
- package/protocol/moonbase/MoonbaseProtocol.js.map +1 -0
- package/protocol/moonbase/MoonbaseProtocolOptions.d.ts +21 -0
- package/protocol/moonbase/MoonbaseProtocolOptions.js +78 -0
- package/protocol/moonbase/MoonbaseProtocolOptions.js.map +1 -0
- package/protocol/moonbeam/MoonbeamProtocol.d.ts +55 -0
- package/protocol/moonbeam/MoonbeamProtocol.js +639 -0
- package/protocol/moonbeam/MoonbeamProtocol.js.map +1 -0
- package/protocol/moonbeam/MoonbeamProtocolOptions.d.ts +32 -0
- package/protocol/moonbeam/MoonbeamProtocolOptions.js +102 -0
- package/protocol/moonbeam/MoonbeamProtocolOptions.js.map +1 -0
- package/protocol/moonbeam/controllers/MoonbeamAccountController.d.ts +28 -0
- package/protocol/moonbeam/controllers/MoonbeamAccountController.js +543 -0
- package/protocol/moonbeam/controllers/MoonbeamAccountController.js.map +1 -0
- package/protocol/moonbeam/controllers/MoonbeamTransactionController.d.ts +9 -0
- package/protocol/moonbeam/controllers/MoonbeamTransactionController.js +73 -0
- package/protocol/moonbeam/controllers/MoonbeamTransactionController.js.map +1 -0
- package/protocol/moonbeam/data/staking/MoonbeamBond.d.ts +13 -0
- package/protocol/moonbeam/data/staking/MoonbeamBond.js +41 -0
- package/protocol/moonbeam/data/staking/MoonbeamBond.js.map +1 -0
- package/protocol/moonbeam/data/staking/MoonbeamCandidateBondLessRequest.d.ts +11 -0
- package/protocol/moonbeam/data/staking/MoonbeamCandidateBondLessRequest.js +41 -0
- package/protocol/moonbeam/data/staking/MoonbeamCandidateBondLessRequest.js.map +1 -0
- package/protocol/moonbeam/data/staking/MoonbeamCandidateMetadata.d.ts +28 -0
- package/protocol/moonbeam/data/staking/MoonbeamCandidateMetadata.js +49 -0
- package/protocol/moonbeam/data/staking/MoonbeamCandidateMetadata.js.map +1 -0
- package/protocol/moonbeam/data/staking/MoonbeamCollatorDetails.d.ts +9 -0
- package/protocol/moonbeam/data/staking/MoonbeamCollatorDetails.js +3 -0
- package/protocol/moonbeam/data/staking/MoonbeamCollatorDetails.js.map +1 -0
- package/protocol/moonbeam/data/staking/MoonbeamDelegationDetails.d.ts +13 -0
- package/protocol/moonbeam/data/staking/MoonbeamDelegationDetails.js +3 -0
- package/protocol/moonbeam/data/staking/MoonbeamDelegationDetails.js.map +1 -0
- package/protocol/moonbeam/data/staking/MoonbeamDelegationScheduledRequests.d.ts +46 -0
- package/protocol/moonbeam/data/staking/MoonbeamDelegationScheduledRequests.js +144 -0
- package/protocol/moonbeam/data/staking/MoonbeamDelegationScheduledRequests.js.map +1 -0
- package/protocol/moonbeam/data/staking/MoonbeamDelegator.d.ts +40 -0
- package/protocol/moonbeam/data/staking/MoonbeamDelegator.js +128 -0
- package/protocol/moonbeam/data/staking/MoonbeamDelegator.js.map +1 -0
- package/protocol/moonbeam/data/staking/MoonbeamDelegatorDetails.d.ts +5 -0
- package/protocol/moonbeam/data/staking/MoonbeamDelegatorDetails.js +3 -0
- package/protocol/moonbeam/data/staking/MoonbeamDelegatorDetails.js.map +1 -0
- package/protocol/moonbeam/data/staking/MoonbeamRoundInfo.d.ts +8 -0
- package/protocol/moonbeam/data/staking/MoonbeamRoundInfo.js +22 -0
- package/protocol/moonbeam/data/staking/MoonbeamRoundInfo.js.map +1 -0
- package/protocol/moonbeam/data/staking/MoonbeamStakingActionType.d.ts +13 -0
- package/protocol/moonbeam/data/staking/MoonbeamStakingActionType.js +18 -0
- package/protocol/moonbeam/data/staking/MoonbeamStakingActionType.js.map +1 -0
- package/protocol/moonbeam/node/MoonbeamNodeClient.d.ts +26 -0
- package/protocol/moonbeam/node/MoonbeamNodeClient.js +218 -0
- package/protocol/moonbeam/node/MoonbeamNodeClient.js.map +1 -0
- package/protocol/moonriver/MoonriverProtocol.d.ts +17 -0
- package/protocol/moonriver/MoonriverProtocol.js +73 -0
- package/protocol/moonriver/MoonriverProtocol.js.map +1 -0
- package/protocol/moonriver/MoonriverProtocolOptions.d.ts +21 -0
- package/protocol/moonriver/MoonriverProtocolOptions.js +78 -0
- package/protocol/moonriver/MoonriverProtocolOptions.js.map +1 -0
- package/readme.md +121 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MoonbeamDelegatorDetails.js","sourceRoot":"","sources":["../../../../../src/protocol/moonbeam/data/staking/MoonbeamDelegatorDetails.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SCALEInt } from '@airgap/substrate/protocol/common/data/scale/type/SCALEInt';
|
|
2
|
+
export declare class MoonbeamRoundInfo {
|
|
3
|
+
readonly current: SCALEInt;
|
|
4
|
+
readonly first: SCALEInt;
|
|
5
|
+
readonly length: SCALEInt;
|
|
6
|
+
static decode(runtimeVersion: number | undefined, raw: string): MoonbeamRoundInfo;
|
|
7
|
+
private constructor();
|
|
8
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MoonbeamRoundInfo = void 0;
|
|
4
|
+
var SCALEDecoder_1 = require("@airgap/substrate/protocol/common/data/scale/SCALEDecoder");
|
|
5
|
+
var SubstrateNetwork_1 = require("@airgap/substrate/protocol/SubstrateNetwork");
|
|
6
|
+
var MoonbeamRoundInfo = /** @class */ (function () {
|
|
7
|
+
function MoonbeamRoundInfo(current, first, length) {
|
|
8
|
+
this.current = current;
|
|
9
|
+
this.first = first;
|
|
10
|
+
this.length = length;
|
|
11
|
+
}
|
|
12
|
+
MoonbeamRoundInfo.decode = function (runtimeVersion, raw) {
|
|
13
|
+
var decoder = new SCALEDecoder_1.SCALEDecoder(SubstrateNetwork_1.SubstrateNetwork.MOONBEAM, runtimeVersion, raw);
|
|
14
|
+
var current = decoder.decodeNextInt(32);
|
|
15
|
+
var first = decoder.decodeNextInt(32);
|
|
16
|
+
var length = decoder.decodeNextInt(32);
|
|
17
|
+
return new MoonbeamRoundInfo(current.decoded, first.decoded, length.decoded);
|
|
18
|
+
};
|
|
19
|
+
return MoonbeamRoundInfo;
|
|
20
|
+
}());
|
|
21
|
+
exports.MoonbeamRoundInfo = MoonbeamRoundInfo;
|
|
22
|
+
//# sourceMappingURL=MoonbeamRoundInfo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MoonbeamRoundInfo.js","sourceRoot":"","sources":["../../../../../src/protocol/moonbeam/data/staking/MoonbeamRoundInfo.ts"],"names":[],"mappings":";;;AAAA,0FAAwF;AAExF,gFAA8E;AAE9E;IAWE,2BAAoC,OAAiB,EAAkB,KAAe,EAAkB,MAAgB;QAApF,YAAO,GAAP,OAAO,CAAU;QAAkB,UAAK,GAAL,KAAK,CAAU;QAAkB,WAAM,GAAN,MAAM,CAAU;IAAG,CAAC;IAV9G,wBAAM,GAApB,UAAqB,cAAkC,EAAE,GAAW;QAClE,IAAM,OAAO,GAAG,IAAI,2BAAY,CAAC,mCAAgB,CAAC,QAAQ,EAAE,cAAc,EAAE,GAAG,CAAC,CAAA;QAEhF,IAAM,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC,EAAE,CAAC,CAAA;QACzC,IAAM,KAAK,GAAG,OAAO,CAAC,aAAa,CAAC,EAAE,CAAC,CAAA;QACvC,IAAM,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,EAAE,CAAC,CAAA;QAExC,OAAO,IAAI,iBAAiB,CAAC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,CAAA;IAC9E,CAAC;IAGH,wBAAC;AAAD,CAAC,AAZD,IAYC;AAZY,8CAAiB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare enum MoonbeamStakingActionType {
|
|
2
|
+
DELEGATE = "delegate",
|
|
3
|
+
SCHEDULE_UNDELEGATE = "schedule_undelegate",
|
|
4
|
+
EXECUTE_UNDELEGATE = "execute_undelegate",
|
|
5
|
+
CANCEL_UNDELEGATE = "cancel_undelegate",
|
|
6
|
+
SCHEDULE_UNDELEGATE_ALL = "schedule_undelegate_all",
|
|
7
|
+
EXECUTE_UNDELEGATE_ALL = "execute_undelegate_all",
|
|
8
|
+
CANCEL_UNDELEGATE_ALL = "cancel_undelegate_all",
|
|
9
|
+
BOND_MORE = "bond_more",
|
|
10
|
+
SCHEDULE_BOND_LESS = "schedule_bond_less",
|
|
11
|
+
EXECUTE_BOND_LESS = "execute_bond_less",
|
|
12
|
+
CANCEL_BOND_LESS = "cancel_bond_less"
|
|
13
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MoonbeamStakingActionType = void 0;
|
|
4
|
+
var MoonbeamStakingActionType;
|
|
5
|
+
(function (MoonbeamStakingActionType) {
|
|
6
|
+
MoonbeamStakingActionType["DELEGATE"] = "delegate";
|
|
7
|
+
MoonbeamStakingActionType["SCHEDULE_UNDELEGATE"] = "schedule_undelegate";
|
|
8
|
+
MoonbeamStakingActionType["EXECUTE_UNDELEGATE"] = "execute_undelegate";
|
|
9
|
+
MoonbeamStakingActionType["CANCEL_UNDELEGATE"] = "cancel_undelegate";
|
|
10
|
+
MoonbeamStakingActionType["SCHEDULE_UNDELEGATE_ALL"] = "schedule_undelegate_all";
|
|
11
|
+
MoonbeamStakingActionType["EXECUTE_UNDELEGATE_ALL"] = "execute_undelegate_all";
|
|
12
|
+
MoonbeamStakingActionType["CANCEL_UNDELEGATE_ALL"] = "cancel_undelegate_all";
|
|
13
|
+
MoonbeamStakingActionType["BOND_MORE"] = "bond_more";
|
|
14
|
+
MoonbeamStakingActionType["SCHEDULE_BOND_LESS"] = "schedule_bond_less";
|
|
15
|
+
MoonbeamStakingActionType["EXECUTE_BOND_LESS"] = "execute_bond_less";
|
|
16
|
+
MoonbeamStakingActionType["CANCEL_BOND_LESS"] = "cancel_bond_less";
|
|
17
|
+
})(MoonbeamStakingActionType = exports.MoonbeamStakingActionType || (exports.MoonbeamStakingActionType = {}));
|
|
18
|
+
//# sourceMappingURL=MoonbeamStakingActionType.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MoonbeamStakingActionType.js","sourceRoot":"","sources":["../../../../../src/protocol/moonbeam/data/staking/MoonbeamStakingActionType.ts"],"names":[],"mappings":";;;AAAA,IAAY,yBAYX;AAZD,WAAY,yBAAyB;IACnC,kDAAqB,CAAA;IACrB,wEAA2C,CAAA;IAC3C,sEAAyC,CAAA;IACzC,oEAAuC,CAAA;IACvC,gFAAmD,CAAA;IACnD,8EAAiD,CAAA;IACjD,4EAA+C,CAAA;IAC/C,oDAAuB,CAAA;IACvB,sEAAyC,CAAA;IACzC,oEAAuC,CAAA;IACvC,kEAAqC,CAAA;AACvC,CAAC,EAZW,yBAAyB,GAAzB,iCAAyB,KAAzB,iCAAyB,QAYpC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import BigNumber from '@airgap/coinlib-core/dependencies/src/bignumber.js-9.0.0/bignumber';
|
|
2
|
+
import { SubstrateNodeClient } from '@airgap/substrate/protocol/common/node/SubstrateNodeClient';
|
|
3
|
+
import { MoonbeamAddress } from '@airgap/substrate/protocol/moonbeam/MoonbeamAddress';
|
|
4
|
+
import { SubstrateNetwork } from '@airgap/substrate/protocol/SubstrateNetwork';
|
|
5
|
+
import { MoonbeamCandidateMetadata } from '../data/staking/MoonbeamCandidateMetadata';
|
|
6
|
+
import { MoonbeamDelegationScheduledRequests } from '../data/staking/MoonbeamDelegationScheduledRequests';
|
|
7
|
+
import { MoonbeamDelegator } from '../data/staking/MoonbeamDelegator';
|
|
8
|
+
import { MoonbeamRoundInfo } from '../data/staking/MoonbeamRoundInfo';
|
|
9
|
+
export declare class MoonbeamNodeClient extends SubstrateNodeClient<SubstrateNetwork.MOONBEAM> {
|
|
10
|
+
getRound(): Promise<MoonbeamRoundInfo | undefined>;
|
|
11
|
+
getCollators(): Promise<MoonbeamAddress[] | undefined>;
|
|
12
|
+
getDelegatorState(address: MoonbeamAddress): Promise<MoonbeamDelegator | undefined>;
|
|
13
|
+
getDelegationScheduledRequests(address: MoonbeamAddress): Promise<MoonbeamDelegationScheduledRequests | undefined>;
|
|
14
|
+
getCandidateInfo(address: MoonbeamAddress): Promise<MoonbeamCandidateMetadata | undefined>;
|
|
15
|
+
getCollatorCommission(): Promise<BigNumber | undefined>;
|
|
16
|
+
getMaxTopDelegationsPerCandidate(): Promise<BigNumber | undefined>;
|
|
17
|
+
getMaxBottomDelegationsPerCandidate(): Promise<BigNumber | undefined>;
|
|
18
|
+
getMaxDelegationsPerDelegator(): Promise<BigNumber | undefined>;
|
|
19
|
+
getMinDelegation(): Promise<BigNumber | undefined>;
|
|
20
|
+
getMinDelegatorStake(): Promise<BigNumber | undefined>;
|
|
21
|
+
getCandidateBondLessDelay(): Promise<BigNumber | undefined>;
|
|
22
|
+
getLeaveDelegatorsDelay(): Promise<BigNumber | undefined>;
|
|
23
|
+
getRevokeDelegationDelay(): Promise<BigNumber | undefined>;
|
|
24
|
+
getDelegationBondLessDelay(): Promise<BigNumber | undefined>;
|
|
25
|
+
getDefaultBlocksPerRound(): Promise<BigNumber | undefined>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,218 @@
|
|
|
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
|
+
extendStatics(d, b);
|
|
11
|
+
function __() { this.constructor = d; }
|
|
12
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
+
};
|
|
14
|
+
})();
|
|
15
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
16
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
17
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
18
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
19
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
20
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
21
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
25
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
26
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
27
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
28
|
+
function step(op) {
|
|
29
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
30
|
+
while (_) try {
|
|
31
|
+
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;
|
|
32
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
33
|
+
switch (op[0]) {
|
|
34
|
+
case 0: case 1: t = op; break;
|
|
35
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
36
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
37
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
38
|
+
default:
|
|
39
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
40
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
41
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
42
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
43
|
+
if (t[2]) _.ops.pop();
|
|
44
|
+
_.trys.pop(); continue;
|
|
45
|
+
}
|
|
46
|
+
op = body.call(thisArg, _);
|
|
47
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
48
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
52
|
+
exports.MoonbeamNodeClient = void 0;
|
|
53
|
+
var SCALEAccountId_1 = require("@airgap/substrate/protocol/common/data/scale/type/SCALEAccountId");
|
|
54
|
+
var SCALEArray_1 = require("@airgap/substrate/protocol/common/data/scale/type/SCALEArray");
|
|
55
|
+
var SCALEInt_1 = require("@airgap/substrate/protocol/common/data/scale/type/SCALEInt");
|
|
56
|
+
var SubstrateNodeClient_1 = require("@airgap/substrate/protocol/common/node/SubstrateNodeClient");
|
|
57
|
+
var MoonbeamCandidateMetadata_1 = require("../data/staking/MoonbeamCandidateMetadata");
|
|
58
|
+
var MoonbeamDelegationScheduledRequests_1 = require("../data/staking/MoonbeamDelegationScheduledRequests");
|
|
59
|
+
var MoonbeamDelegator_1 = require("../data/staking/MoonbeamDelegator");
|
|
60
|
+
var MoonbeamRoundInfo_1 = require("../data/staking/MoonbeamRoundInfo");
|
|
61
|
+
var MoonbeamNodeClient = /** @class */ (function (_super) {
|
|
62
|
+
__extends(MoonbeamNodeClient, _super);
|
|
63
|
+
function MoonbeamNodeClient() {
|
|
64
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
65
|
+
}
|
|
66
|
+
MoonbeamNodeClient.prototype.getRound = function () {
|
|
67
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
68
|
+
var _this = this;
|
|
69
|
+
return __generator(this, function (_a) {
|
|
70
|
+
return [2 /*return*/, this.fromStorage('ParachainStaking', 'Round').then(function (item) {
|
|
71
|
+
return item ? MoonbeamRoundInfo_1.MoonbeamRoundInfo.decode(_this.runtimeVersion, item) : undefined;
|
|
72
|
+
})];
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
MoonbeamNodeClient.prototype.getCollators = function () {
|
|
77
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
78
|
+
var _this = this;
|
|
79
|
+
return __generator(this, function (_a) {
|
|
80
|
+
return [2 /*return*/, this.fromStorage('ParachainStaking', 'SelectedCandidates').then(function (items) {
|
|
81
|
+
return items
|
|
82
|
+
? SCALEArray_1.SCALEArray.decode(_this.network, _this.runtimeVersion, items, function (network, _, hex) {
|
|
83
|
+
return SCALEAccountId_1.SCALEAccountId.decode(network, hex, 20);
|
|
84
|
+
}).decoded.elements.map(function (encoded) { return encoded.address; })
|
|
85
|
+
: undefined;
|
|
86
|
+
})];
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
MoonbeamNodeClient.prototype.getDelegatorState = function (address) {
|
|
91
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
92
|
+
var _this = this;
|
|
93
|
+
return __generator(this, function (_a) {
|
|
94
|
+
return [2 /*return*/, this.fromStorage('ParachainStaking', 'DelegatorState', SCALEAccountId_1.SCALEAccountId.from(address, this.network)).then(function (item) {
|
|
95
|
+
return item ? MoonbeamDelegator_1.MoonbeamDelegator.decode(_this.runtimeVersion, item) : undefined;
|
|
96
|
+
})];
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
MoonbeamNodeClient.prototype.getDelegationScheduledRequests = function (address) {
|
|
101
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
102
|
+
var _this = this;
|
|
103
|
+
return __generator(this, function (_a) {
|
|
104
|
+
return [2 /*return*/, this.fromStorage('ParachainStaking', 'DelegationScheduledRequests', SCALEAccountId_1.SCALEAccountId.from(address, this.network)).then(function (item) {
|
|
105
|
+
return item ? MoonbeamDelegationScheduledRequests_1.MoonbeamDelegationScheduledRequests.decode(_this.runtimeVersion, item) : undefined;
|
|
106
|
+
})];
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
};
|
|
110
|
+
MoonbeamNodeClient.prototype.getCandidateInfo = function (address) {
|
|
111
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
112
|
+
var _this = this;
|
|
113
|
+
return __generator(this, function (_a) {
|
|
114
|
+
return [2 /*return*/, this.fromStorage('ParachainStaking', 'CandidateInfo', SCALEAccountId_1.SCALEAccountId.from(address, this.network)).then(function (item) {
|
|
115
|
+
return item ? MoonbeamCandidateMetadata_1.MoonbeamCandidateMetadata.decode(_this.runtimeVersion, item) : undefined;
|
|
116
|
+
})];
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
};
|
|
120
|
+
MoonbeamNodeClient.prototype.getCollatorCommission = function () {
|
|
121
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
122
|
+
return __generator(this, function (_a) {
|
|
123
|
+
return [2 /*return*/, this.fromStorage('ParachainStaking', 'CollatorCommission').then(function (item) {
|
|
124
|
+
return item ? SCALEInt_1.SCALEInt.decode(item, 32).decoded.value : undefined;
|
|
125
|
+
})];
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
};
|
|
129
|
+
MoonbeamNodeClient.prototype.getMaxTopDelegationsPerCandidate = function () {
|
|
130
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
131
|
+
return __generator(this, function (_a) {
|
|
132
|
+
return [2 /*return*/, this.getConstant('ParachainStaking', 'MaxTopDelegationsPerCandidate').then(function (item) {
|
|
133
|
+
return item ? SCALEInt_1.SCALEInt.decode(item, 32).decoded.value : undefined;
|
|
134
|
+
})];
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
};
|
|
138
|
+
MoonbeamNodeClient.prototype.getMaxBottomDelegationsPerCandidate = function () {
|
|
139
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
140
|
+
return __generator(this, function (_a) {
|
|
141
|
+
return [2 /*return*/, this.getConstant('ParachainStaking', 'MaxBottomDelegationsPerCandidate').then(function (item) {
|
|
142
|
+
return item ? SCALEInt_1.SCALEInt.decode(item, 32).decoded.value : undefined;
|
|
143
|
+
})];
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
};
|
|
147
|
+
MoonbeamNodeClient.prototype.getMaxDelegationsPerDelegator = function () {
|
|
148
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
149
|
+
return __generator(this, function (_a) {
|
|
150
|
+
return [2 /*return*/, this.getConstant('ParachainStaking', 'MaxDelegationsPerDelegator').then(function (item) {
|
|
151
|
+
return item ? SCALEInt_1.SCALEInt.decode(item, 32).decoded.value : undefined;
|
|
152
|
+
})];
|
|
153
|
+
});
|
|
154
|
+
});
|
|
155
|
+
};
|
|
156
|
+
MoonbeamNodeClient.prototype.getMinDelegation = function () {
|
|
157
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
158
|
+
return __generator(this, function (_a) {
|
|
159
|
+
return [2 /*return*/, this.getConstant('ParachainStaking', 'MinDelegation').then(function (item) { return (item ? SCALEInt_1.SCALEInt.decode(item).decoded.value : undefined); })];
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
};
|
|
163
|
+
MoonbeamNodeClient.prototype.getMinDelegatorStake = function () {
|
|
164
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
165
|
+
return __generator(this, function (_a) {
|
|
166
|
+
return [2 /*return*/, this.getConstant('ParachainStaking', 'MinDelegatorStk').then(function (item) { return (item ? SCALEInt_1.SCALEInt.decode(item).decoded.value : undefined); })];
|
|
167
|
+
});
|
|
168
|
+
});
|
|
169
|
+
};
|
|
170
|
+
MoonbeamNodeClient.prototype.getCandidateBondLessDelay = function () {
|
|
171
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
172
|
+
return __generator(this, function (_a) {
|
|
173
|
+
return [2 /*return*/, this.getConstant('ParachainStaking', 'CandidateBondLessDelay').then(function (item) {
|
|
174
|
+
return item ? SCALEInt_1.SCALEInt.decode(item).decoded.value : undefined;
|
|
175
|
+
})];
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
};
|
|
179
|
+
MoonbeamNodeClient.prototype.getLeaveDelegatorsDelay = function () {
|
|
180
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
181
|
+
return __generator(this, function (_a) {
|
|
182
|
+
return [2 /*return*/, this.getConstant('ParachainStaking', 'LeaveDelegatorsDelay').then(function (item) {
|
|
183
|
+
return item ? SCALEInt_1.SCALEInt.decode(item).decoded.value : undefined;
|
|
184
|
+
})];
|
|
185
|
+
});
|
|
186
|
+
});
|
|
187
|
+
};
|
|
188
|
+
MoonbeamNodeClient.prototype.getRevokeDelegationDelay = function () {
|
|
189
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
190
|
+
return __generator(this, function (_a) {
|
|
191
|
+
return [2 /*return*/, this.getConstant('ParachainStaking', 'RevokeDelegationDelay').then(function (item) {
|
|
192
|
+
return item ? SCALEInt_1.SCALEInt.decode(item).decoded.value : undefined;
|
|
193
|
+
})];
|
|
194
|
+
});
|
|
195
|
+
});
|
|
196
|
+
};
|
|
197
|
+
MoonbeamNodeClient.prototype.getDelegationBondLessDelay = function () {
|
|
198
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
199
|
+
return __generator(this, function (_a) {
|
|
200
|
+
return [2 /*return*/, this.getConstant('ParachainStaking', 'DelegationBondLessDelay').then(function (item) {
|
|
201
|
+
return item ? SCALEInt_1.SCALEInt.decode(item).decoded.value : undefined;
|
|
202
|
+
})];
|
|
203
|
+
});
|
|
204
|
+
});
|
|
205
|
+
};
|
|
206
|
+
MoonbeamNodeClient.prototype.getDefaultBlocksPerRound = function () {
|
|
207
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
208
|
+
return __generator(this, function (_a) {
|
|
209
|
+
return [2 /*return*/, this.getConstant('ParachainStaking', 'DefaultBlocksPerRound').then(function (item) {
|
|
210
|
+
return item ? SCALEInt_1.SCALEInt.decode(item).decoded.value : undefined;
|
|
211
|
+
})];
|
|
212
|
+
});
|
|
213
|
+
});
|
|
214
|
+
};
|
|
215
|
+
return MoonbeamNodeClient;
|
|
216
|
+
}(SubstrateNodeClient_1.SubstrateNodeClient));
|
|
217
|
+
exports.MoonbeamNodeClient = MoonbeamNodeClient;
|
|
218
|
+
//# sourceMappingURL=MoonbeamNodeClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MoonbeamNodeClient.js","sourceRoot":"","sources":["../../../../src/protocol/moonbeam/node/MoonbeamNodeClient.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,mGAAiG;AACjG,2FAAyF;AACzF,uFAAqF;AACrF,kGAAgG;AAIhG,uFAAqF;AACrF,2GAAyG;AACzG,uEAAqE;AACrE,uEAAqE;AAErE;IAAwC,sCAA8C;IAAtF;;IAgGA,CAAC;IA/Fc,qCAAQ,GAArB;;;;gBACE,sBAAO,IAAI,CAAC,WAAW,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,UAAC,IAAI;wBAC7D,OAAA,IAAI,CAAC,CAAC,CAAC,qCAAiB,CAAC,MAAM,CAAC,KAAI,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC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import { CurrencyUnit, FeeDefaults } from '@airgap/coinlib-core/protocols/ICoinProtocol';
|
|
2
|
+
import { ProtocolSymbols } from '@airgap/coinlib-core/utils/ProtocolSymbols';
|
|
3
|
+
import { MoonbeamProtocol } from '../moonbeam/MoonbeamProtocol';
|
|
4
|
+
import { MoonriverProtocolOptions } from './MoonriverProtocolOptions';
|
|
5
|
+
export declare class MoonriverProtocol extends MoonbeamProtocol {
|
|
6
|
+
readonly options: MoonriverProtocolOptions;
|
|
7
|
+
symbol: string;
|
|
8
|
+
name: string;
|
|
9
|
+
marketSymbol: string;
|
|
10
|
+
feeSymbol: string;
|
|
11
|
+
decimals: number;
|
|
12
|
+
feeDecimals: number;
|
|
13
|
+
identifier: ProtocolSymbols;
|
|
14
|
+
feeDefaults: FeeDefaults;
|
|
15
|
+
units: CurrencyUnit[];
|
|
16
|
+
constructor(options?: MoonriverProtocolOptions);
|
|
17
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
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
|
+
extendStatics(d, b);
|
|
11
|
+
function __() { this.constructor = d; }
|
|
12
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
+
};
|
|
14
|
+
})();
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.MoonriverProtocol = void 0;
|
|
17
|
+
var ProtocolSymbols_1 = require("@airgap/coinlib-core/utils/ProtocolSymbols");
|
|
18
|
+
var MoonbeamProtocol_1 = require("../moonbeam/MoonbeamProtocol");
|
|
19
|
+
var MoonriverProtocolOptions_1 = require("./MoonriverProtocolOptions");
|
|
20
|
+
var MoonriverProtocol = /** @class */ (function (_super) {
|
|
21
|
+
__extends(MoonriverProtocol, _super);
|
|
22
|
+
function MoonriverProtocol(options) {
|
|
23
|
+
if (options === void 0) { options = new MoonriverProtocolOptions_1.MoonriverProtocolOptions(); }
|
|
24
|
+
var _this = _super.call(this, options) || this;
|
|
25
|
+
_this.options = options;
|
|
26
|
+
_this.symbol = 'MOVR';
|
|
27
|
+
_this.name = 'Moonriver';
|
|
28
|
+
_this.marketSymbol = 'MOVR';
|
|
29
|
+
_this.feeSymbol = 'MOVR';
|
|
30
|
+
_this.decimals = 18;
|
|
31
|
+
_this.feeDecimals = 18;
|
|
32
|
+
_this.identifier = ProtocolSymbols_1.MainProtocolSymbols.MOONRIVER;
|
|
33
|
+
_this.feeDefaults = {
|
|
34
|
+
low: '0.000000000125',
|
|
35
|
+
medium: '0.000000000125',
|
|
36
|
+
high: '0.000000000125'
|
|
37
|
+
};
|
|
38
|
+
_this.units = [
|
|
39
|
+
{
|
|
40
|
+
unitSymbol: 'MOVR',
|
|
41
|
+
factor: '1'
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
unitSymbol: 'mMOVR',
|
|
45
|
+
factor: '0.001'
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
unitSymbol: 'uMOVR',
|
|
49
|
+
factor: '0.000001'
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
unitSymbol: 'GWEI',
|
|
53
|
+
factor: '0.000000001'
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
unitSymbol: 'MWEI',
|
|
57
|
+
factor: '0.000000000001'
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
unitSymbol: 'kWEI',
|
|
61
|
+
factor: '0.000000000000001'
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
unitSymbol: 'WEI',
|
|
65
|
+
factor: '0.000000000000000001'
|
|
66
|
+
}
|
|
67
|
+
];
|
|
68
|
+
return _this;
|
|
69
|
+
}
|
|
70
|
+
return MoonriverProtocol;
|
|
71
|
+
}(MoonbeamProtocol_1.MoonbeamProtocol));
|
|
72
|
+
exports.MoonriverProtocol = MoonriverProtocol;
|
|
73
|
+
//# sourceMappingURL=MoonriverProtocol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MoonriverProtocol.js","sourceRoot":"","sources":["../../../src/protocol/moonriver/MoonriverProtocol.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AACA,8EAAiG;AAEjG,iEAA+D;AAE/D,uEAAqE;AAErE;IAAuC,qCAAgB;IA+CrD,2BAAmC,OAAkE;QAAlE,wBAAA,EAAA,cAAwC,mDAAwB,EAAE;QAArG,YACE,kBAAM,OAAO,CAAC,SACf;QAFkC,aAAO,GAAP,OAAO,CAA2D;QA9C9F,YAAM,GAAW,MAAM,CAAA;QACvB,UAAI,GAAW,WAAW,CAAA;QAC1B,kBAAY,GAAW,MAAM,CAAA;QAC7B,eAAS,GAAW,MAAM,CAAA;QAE1B,cAAQ,GAAW,EAAE,CAAA;QACrB,iBAAW,GAAW,EAAE,CAAA;QACxB,gBAAU,GAAoB,qCAAmB,CAAC,SAAS,CAAA;QAE3D,iBAAW,GAAgB;YAChC,GAAG,EAAE,gBAAgB;YACrB,MAAM,EAAE,gBAAgB;YACxB,IAAI,EAAE,gBAAgB;SACvB,CAAA;QAEM,WAAK,GAAmB;YAC7B;gBACE,UAAU,EAAE,MAAM;gBAClB,MAAM,EAAE,GAAG;aACZ;YACD;gBACE,UAAU,EAAE,OAAO;gBACnB,MAAM,EAAE,OAAO;aAChB;YACD;gBACE,UAAU,EAAE,OAAO;gBACnB,MAAM,EAAE,UAAU;aACnB;YACD;gBACE,UAAU,EAAE,MAAM;gBAClB,MAAM,EAAE,aAAa;aACtB;YACD;gBACE,UAAU,EAAE,MAAM;gBAClB,MAAM,EAAE,gBAAgB;aACzB;YACD;gBACE,UAAU,EAAE,MAAM;gBAClB,MAAM,EAAE,mBAAmB;aAC5B;YACD;gBACE,UAAU,EAAE,KAAK;gBACjB,MAAM,EAAE,sBAAsB;aAC/B;SACF,CAAA;;IAID,CAAC;IACH,wBAAC;AAAD,CAAC,AAlDD,CAAuC,mCAAgB,GAkDtD;AAlDY,8CAAiB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ProtocolBlockExplorer } from '@airgap/coinlib-core/utils/ProtocolBlockExplorer';
|
|
2
|
+
import { NetworkType } from '@airgap/coinlib-core/utils/ProtocolNetwork';
|
|
3
|
+
import { SubscanBlockExplorer } from '@airgap/substrate/protocol/SubstrateProtocolOptions';
|
|
4
|
+
import { BaseMoonbeamProtocolNetwork, BaseMoonbeamProtocolOptions, MoonbeamProtocolConfig, MoonbeamProtocolNetworkExtras } from '../moonbeam/MoonbeamProtocolOptions';
|
|
5
|
+
export declare class MoonriverProtocolConfig extends MoonbeamProtocolConfig {
|
|
6
|
+
}
|
|
7
|
+
export declare class MoonriverProtocolNetworkExtras extends MoonbeamProtocolNetworkExtras {
|
|
8
|
+
readonly apiUrl: string;
|
|
9
|
+
constructor(apiUrl?: string);
|
|
10
|
+
}
|
|
11
|
+
export declare class MoonriverSubscanBlockExplorer extends SubscanBlockExplorer {
|
|
12
|
+
constructor(blockExplorer?: string);
|
|
13
|
+
}
|
|
14
|
+
export declare class MoonriverProtocolNetwork extends BaseMoonbeamProtocolNetwork<MoonriverProtocolNetworkExtras> {
|
|
15
|
+
constructor(name?: string, type?: NetworkType, rpcUrl?: string, blockExplorer?: ProtocolBlockExplorer, extras?: MoonriverProtocolNetworkExtras);
|
|
16
|
+
}
|
|
17
|
+
export declare class MoonriverProtocolOptions extends BaseMoonbeamProtocolOptions<MoonriverProtocolConfig> {
|
|
18
|
+
readonly network: MoonriverProtocolNetwork;
|
|
19
|
+
readonly config: MoonriverProtocolConfig;
|
|
20
|
+
constructor(network?: MoonriverProtocolNetwork, config?: MoonriverProtocolConfig);
|
|
21
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
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
|
+
extendStatics(d, b);
|
|
11
|
+
function __() { this.constructor = d; }
|
|
12
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
+
};
|
|
14
|
+
})();
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.MoonriverProtocolOptions = exports.MoonriverProtocolNetwork = exports.MoonriverSubscanBlockExplorer = exports.MoonriverProtocolNetworkExtras = exports.MoonriverProtocolConfig = void 0;
|
|
17
|
+
var ProtocolNetwork_1 = require("@airgap/coinlib-core/utils/ProtocolNetwork");
|
|
18
|
+
var SubstrateProtocolOptions_1 = require("@airgap/substrate/protocol/SubstrateProtocolOptions");
|
|
19
|
+
var MoonbeamProtocolOptions_1 = require("../moonbeam/MoonbeamProtocolOptions");
|
|
20
|
+
var MAINNET_NAME = 'Mainnet';
|
|
21
|
+
var NODE_URL = 'https://moonriver-proxy.airgap.prod.gke.papers.tech';
|
|
22
|
+
var BLOCK_EXPLORER_URL = 'https://moonriver.subscan.io';
|
|
23
|
+
var BLOCK_EXPLORER_API = 'https://moonriver.subscan.prod.gke.papers.tech/api/scan';
|
|
24
|
+
var MoonriverProtocolConfig = /** @class */ (function (_super) {
|
|
25
|
+
__extends(MoonriverProtocolConfig, _super);
|
|
26
|
+
function MoonriverProtocolConfig() {
|
|
27
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
28
|
+
}
|
|
29
|
+
return MoonriverProtocolConfig;
|
|
30
|
+
}(MoonbeamProtocolOptions_1.MoonbeamProtocolConfig));
|
|
31
|
+
exports.MoonriverProtocolConfig = MoonriverProtocolConfig;
|
|
32
|
+
var MoonriverProtocolNetworkExtras = /** @class */ (function (_super) {
|
|
33
|
+
__extends(MoonriverProtocolNetworkExtras, _super);
|
|
34
|
+
function MoonriverProtocolNetworkExtras(apiUrl) {
|
|
35
|
+
if (apiUrl === void 0) { apiUrl = BLOCK_EXPLORER_API; }
|
|
36
|
+
var _this = _super.call(this, apiUrl) || this;
|
|
37
|
+
_this.apiUrl = apiUrl;
|
|
38
|
+
return _this;
|
|
39
|
+
}
|
|
40
|
+
return MoonriverProtocolNetworkExtras;
|
|
41
|
+
}(MoonbeamProtocolOptions_1.MoonbeamProtocolNetworkExtras));
|
|
42
|
+
exports.MoonriverProtocolNetworkExtras = MoonriverProtocolNetworkExtras;
|
|
43
|
+
var MoonriverSubscanBlockExplorer = /** @class */ (function (_super) {
|
|
44
|
+
__extends(MoonriverSubscanBlockExplorer, _super);
|
|
45
|
+
function MoonriverSubscanBlockExplorer(blockExplorer) {
|
|
46
|
+
if (blockExplorer === void 0) { blockExplorer = BLOCK_EXPLORER_URL; }
|
|
47
|
+
return _super.call(this, blockExplorer) || this;
|
|
48
|
+
}
|
|
49
|
+
return MoonriverSubscanBlockExplorer;
|
|
50
|
+
}(SubstrateProtocolOptions_1.SubscanBlockExplorer));
|
|
51
|
+
exports.MoonriverSubscanBlockExplorer = MoonriverSubscanBlockExplorer;
|
|
52
|
+
var MoonriverProtocolNetwork = /** @class */ (function (_super) {
|
|
53
|
+
__extends(MoonriverProtocolNetwork, _super);
|
|
54
|
+
function MoonriverProtocolNetwork(name, type, rpcUrl, blockExplorer, extras) {
|
|
55
|
+
if (name === void 0) { name = MAINNET_NAME; }
|
|
56
|
+
if (type === void 0) { type = ProtocolNetwork_1.NetworkType.MAINNET; }
|
|
57
|
+
if (rpcUrl === void 0) { rpcUrl = NODE_URL; }
|
|
58
|
+
if (blockExplorer === void 0) { blockExplorer = new MoonriverSubscanBlockExplorer(); }
|
|
59
|
+
if (extras === void 0) { extras = new MoonriverProtocolNetworkExtras(); }
|
|
60
|
+
return _super.call(this, name, type, rpcUrl, blockExplorer, extras) || this;
|
|
61
|
+
}
|
|
62
|
+
return MoonriverProtocolNetwork;
|
|
63
|
+
}(MoonbeamProtocolOptions_1.BaseMoonbeamProtocolNetwork));
|
|
64
|
+
exports.MoonriverProtocolNetwork = MoonriverProtocolNetwork;
|
|
65
|
+
var MoonriverProtocolOptions = /** @class */ (function (_super) {
|
|
66
|
+
__extends(MoonriverProtocolOptions, _super);
|
|
67
|
+
function MoonriverProtocolOptions(network, config) {
|
|
68
|
+
if (network === void 0) { network = new MoonriverProtocolNetwork(); }
|
|
69
|
+
if (config === void 0) { config = new MoonriverProtocolConfig(); }
|
|
70
|
+
var _this = _super.call(this, network, config) || this;
|
|
71
|
+
_this.network = network;
|
|
72
|
+
_this.config = config;
|
|
73
|
+
return _this;
|
|
74
|
+
}
|
|
75
|
+
return MoonriverProtocolOptions;
|
|
76
|
+
}(MoonbeamProtocolOptions_1.BaseMoonbeamProtocolOptions));
|
|
77
|
+
exports.MoonriverProtocolOptions = MoonriverProtocolOptions;
|
|
78
|
+
//# sourceMappingURL=MoonriverProtocolOptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MoonriverProtocolOptions.js","sourceRoot":"","sources":["../../../src/protocol/moonriver/MoonriverProtocolOptions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAEA,8EAAwE;AACxE,gGAA0F;AAE1F,+EAK4C;AAE5C,IAAM,YAAY,GAAW,SAAS,CAAA;AAEtC,IAAM,QAAQ,GAAW,qDAAqD,CAAA;AAE9E,IAAM,kBAAkB,GAAW,8BAA8B,CAAA;AACjE,IAAM,kBAAkB,GAAW,yDAAyD,CAAA;AAE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