@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,51 +1,23 @@
|
|
|
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 __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
18
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
19
|
-
if (ar || !(i in from)) {
|
|
20
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
21
|
-
ar[i] = from[i];
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
25
|
-
};
|
|
26
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
3
|
exports.MoonbeamDelegator = exports.MoonbeamDelegatorStatusLeaving = exports.MoonbeamDelegatorStatusActive = exports.MoonbeamDelegatorStatus = exports.MoonbeamDelegatorStatusRaw = void 0;
|
|
28
4
|
// tslint:disable: max-classes-per-file
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
5
|
+
const errors_1 = require("@airgap/coinlib-core/errors");
|
|
6
|
+
const coinlib_error_1 = require("@airgap/coinlib-core/errors/coinlib-error");
|
|
7
|
+
const SCALEDecoder_1 = require("@airgap/substrate/v0/protocol/common/data/scale/SCALEDecoder");
|
|
8
|
+
const SCALEClass_1 = require("@airgap/substrate/v0/protocol/common/data/scale/type/SCALEClass");
|
|
9
|
+
const SCALEEnum_1 = require("@airgap/substrate/v0/protocol/common/data/scale/type/SCALEEnum");
|
|
10
|
+
const SubstrateNetwork_1 = require("@airgap/substrate/v0/protocol/SubstrateNetwork");
|
|
11
|
+
const MoonbeamBond_1 = require("./MoonbeamBond");
|
|
36
12
|
var MoonbeamDelegatorStatusRaw;
|
|
37
13
|
(function (MoonbeamDelegatorStatusRaw) {
|
|
38
14
|
MoonbeamDelegatorStatusRaw[MoonbeamDelegatorStatusRaw["ACTIVE"] = 0] = "ACTIVE";
|
|
39
15
|
MoonbeamDelegatorStatusRaw[MoonbeamDelegatorStatusRaw["LEAVING"] = 1] = "LEAVING";
|
|
40
|
-
})(MoonbeamDelegatorStatusRaw
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
MoonbeamDelegatorStatus.decode = function (network, runtimeVersion, raw) {
|
|
47
|
-
var prefix = parseInt(raw.substring(0, 2), 16);
|
|
48
|
-
var decoderMethod;
|
|
16
|
+
})(MoonbeamDelegatorStatusRaw || (exports.MoonbeamDelegatorStatusRaw = MoonbeamDelegatorStatusRaw = {}));
|
|
17
|
+
class MoonbeamDelegatorStatus extends SCALEClass_1.SCALEClass {
|
|
18
|
+
static decode(network, runtimeVersion, raw) {
|
|
19
|
+
const prefix = parseInt(raw.substring(0, 2), 16);
|
|
20
|
+
let decoderMethod;
|
|
49
21
|
switch (prefix) {
|
|
50
22
|
case MoonbeamDelegatorStatusRaw.ACTIVE:
|
|
51
23
|
decoderMethod = MoonbeamDelegatorStatusActive.decode;
|
|
@@ -56,77 +28,65 @@ var MoonbeamDelegatorStatus = /** @class */ (function (_super) {
|
|
|
56
28
|
default:
|
|
57
29
|
throw new errors_1.InvalidValueError(coinlib_error_1.Domain.SUBSTRATE, 'Unknown Moonbeam delegator status');
|
|
58
30
|
}
|
|
59
|
-
|
|
31
|
+
const decoded = decoderMethod(network, runtimeVersion, raw.slice(2));
|
|
60
32
|
return {
|
|
61
33
|
bytesDecoded: 1 + decoded.bytesDecoded,
|
|
62
34
|
decoded: decoded.decoded
|
|
63
35
|
};
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
enumerable: false,
|
|
70
|
-
configurable: true
|
|
71
|
-
});
|
|
72
|
-
return MoonbeamDelegatorStatus;
|
|
73
|
-
}(SCALEClass_1.SCALEClass));
|
|
36
|
+
}
|
|
37
|
+
get scaleFields() {
|
|
38
|
+
return [this.type, ...this._scaleFields];
|
|
39
|
+
}
|
|
40
|
+
}
|
|
74
41
|
exports.MoonbeamDelegatorStatus = MoonbeamDelegatorStatus;
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
_this._scaleFields = [];
|
|
81
|
-
return _this;
|
|
42
|
+
class MoonbeamDelegatorStatusActive extends MoonbeamDelegatorStatus {
|
|
43
|
+
constructor() {
|
|
44
|
+
super(...arguments);
|
|
45
|
+
this.type = SCALEEnum_1.SCALEEnum.from(MoonbeamDelegatorStatusRaw.ACTIVE);
|
|
46
|
+
this._scaleFields = [];
|
|
82
47
|
}
|
|
83
|
-
|
|
48
|
+
static decode(_network, _runtimeVersion, _raw) {
|
|
84
49
|
return {
|
|
85
50
|
bytesDecoded: 0,
|
|
86
51
|
decoded: new MoonbeamDelegatorStatusActive()
|
|
87
52
|
};
|
|
88
|
-
};
|
|
89
|
-
return MoonbeamDelegatorStatusActive;
|
|
90
|
-
}(MoonbeamDelegatorStatus));
|
|
91
|
-
exports.MoonbeamDelegatorStatusActive = MoonbeamDelegatorStatusActive;
|
|
92
|
-
var MoonbeamDelegatorStatusLeaving = /** @class */ (function (_super) {
|
|
93
|
-
__extends(MoonbeamDelegatorStatusLeaving, _super);
|
|
94
|
-
function MoonbeamDelegatorStatusLeaving(roundIndex) {
|
|
95
|
-
var _this = _super.call(this) || this;
|
|
96
|
-
_this.roundIndex = roundIndex;
|
|
97
|
-
_this.type = SCALEEnum_1.SCALEEnum.from(MoonbeamDelegatorStatusRaw.LEAVING);
|
|
98
|
-
_this._scaleFields = [];
|
|
99
|
-
return _this;
|
|
100
53
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
54
|
+
}
|
|
55
|
+
exports.MoonbeamDelegatorStatusActive = MoonbeamDelegatorStatusActive;
|
|
56
|
+
class MoonbeamDelegatorStatusLeaving extends MoonbeamDelegatorStatus {
|
|
57
|
+
static decode(network, runtimeVersion, raw) {
|
|
58
|
+
const decoder = new SCALEDecoder_1.SCALEDecoder(network, runtimeVersion, raw);
|
|
59
|
+
const roundIndex = decoder.decodeNextInt(32);
|
|
104
60
|
return {
|
|
105
61
|
bytesDecoded: roundIndex.bytesDecoded,
|
|
106
62
|
decoded: new MoonbeamDelegatorStatusLeaving(roundIndex.decoded)
|
|
107
63
|
};
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
|
|
64
|
+
}
|
|
65
|
+
constructor(roundIndex) {
|
|
66
|
+
super();
|
|
67
|
+
this.roundIndex = roundIndex;
|
|
68
|
+
this.type = SCALEEnum_1.SCALEEnum.from(MoonbeamDelegatorStatusRaw.LEAVING);
|
|
69
|
+
this._scaleFields = [];
|
|
70
|
+
}
|
|
71
|
+
}
|
|
111
72
|
exports.MoonbeamDelegatorStatusLeaving = MoonbeamDelegatorStatusLeaving;
|
|
112
|
-
|
|
113
|
-
|
|
73
|
+
class MoonbeamDelegator {
|
|
74
|
+
static decode(runtimeVersion, raw) {
|
|
75
|
+
const decoder = new SCALEDecoder_1.SCALEDecoder(SubstrateNetwork_1.SubstrateNetwork.MOONBEAM, runtimeVersion, raw);
|
|
76
|
+
const id = decoder.decodeNextAccountId(20);
|
|
77
|
+
const delegations = decoder.decodeNextArray((_, runtimeVersion, hex) => MoonbeamBond_1.MoonbeamBond.decode(runtimeVersion, hex));
|
|
78
|
+
const total = decoder.decodeNextInt(128);
|
|
79
|
+
const lessTotal = decoder.decodeNextInt(128);
|
|
80
|
+
const status = decoder.decodeNextObject(MoonbeamDelegatorStatus.decode);
|
|
81
|
+
return new MoonbeamDelegator(id.decoded, delegations.decoded, total.decoded, lessTotal.decoded, status.decoded);
|
|
82
|
+
}
|
|
83
|
+
constructor(id, delegations, total, lessTotal, status) {
|
|
114
84
|
this.id = id;
|
|
115
85
|
this.delegations = delegations;
|
|
116
86
|
this.total = total;
|
|
117
87
|
this.lessTotal = lessTotal;
|
|
118
88
|
this.status = status;
|
|
119
89
|
}
|
|
120
|
-
|
|
121
|
-
var decoder = new SCALEDecoder_1.SCALEDecoder(SubstrateNetwork_1.SubstrateNetwork.MOONBEAM, runtimeVersion, raw);
|
|
122
|
-
var id = decoder.decodeNextAccountId(20);
|
|
123
|
-
var delegations = decoder.decodeNextArray(function (_, runtimeVersion, hex) { return MoonbeamBond_1.MoonbeamBond.decode(runtimeVersion, hex); });
|
|
124
|
-
var total = decoder.decodeNextInt(128);
|
|
125
|
-
var lessTotal = decoder.decodeNextInt(128);
|
|
126
|
-
var status = decoder.decodeNextObject(MoonbeamDelegatorStatus.decode);
|
|
127
|
-
return new MoonbeamDelegator(id.decoded, delegations.decoded, total.decoded, lessTotal.decoded, status.decoded);
|
|
128
|
-
};
|
|
129
|
-
return MoonbeamDelegator;
|
|
130
|
-
}());
|
|
90
|
+
}
|
|
131
91
|
exports.MoonbeamDelegator = MoonbeamDelegator;
|
|
132
92
|
//# sourceMappingURL=MoonbeamDelegator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MoonbeamDelegator.js","sourceRoot":"","sources":["../../../../../../src/v0/protocol/moonbeam/data/staking/MoonbeamDelegator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MoonbeamDelegator.js","sourceRoot":"","sources":["../../../../../../src/v0/protocol/moonbeam/data/staking/MoonbeamDelegator.ts"],"names":[],"mappings":";;;AAAA,uCAAuC;AACvC,wDAA+D;AAC/D,6EAAkE;AAClE,+FAA6H;AAG7H,gGAA4F;AAC5F,8FAA0F;AAG1F,qFAAiF;AAEjF,iDAA6C;AAE7C,IAAY,0BAGX;AAHD,WAAY,0BAA0B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AC,CAAA;QAC5C,MAAM,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,uBAAuB,CAAC,MAAM,CAAC,CAAA;QAEvE,OAAO,IAAI,iBAAiB,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,SAAS,CAAC,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,CAAA;IACjH,CAAC;IAED,YACkB,EAA6C,EAC7C,WAAqC,EACrC,KAAe,EACf,SAAmB,EACnB,MAA+B;QAJ/B,OAAE,GAAF,EAAE,CAA2C;QAC7C,gBAAW,GAAX,WAAW,CAA0B;QACrC,UAAK,GAAL,KAAK,CAAU;QACf,cAAS,GAAT,SAAS,CAAU;QACnB,WAAM,GAAN,MAAM,CAAyB;IAC9C,CAAC;CACL;AApBD,8CAoBC"}
|
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MoonbeamRoundInfo = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
const SCALEDecoder_1 = require("@airgap/substrate/v0/protocol/common/data/scale/SCALEDecoder");
|
|
5
|
+
const SubstrateNetwork_1 = require("@airgap/substrate/v0/protocol/SubstrateNetwork");
|
|
6
|
+
class MoonbeamRoundInfo {
|
|
7
|
+
static decode(runtimeVersion, raw) {
|
|
8
|
+
const decoder = new SCALEDecoder_1.SCALEDecoder(SubstrateNetwork_1.SubstrateNetwork.MOONBEAM, runtimeVersion, raw);
|
|
9
|
+
const current = decoder.decodeNextInt(32);
|
|
10
|
+
const first = decoder.decodeNextInt(32);
|
|
11
|
+
const length = decoder.decodeNextInt(32);
|
|
12
|
+
return new MoonbeamRoundInfo(current.decoded, first.decoded, length.decoded);
|
|
13
|
+
}
|
|
14
|
+
constructor(current, first, length) {
|
|
8
15
|
this.current = current;
|
|
9
16
|
this.first = first;
|
|
10
17
|
this.length = length;
|
|
11
18
|
}
|
|
12
|
-
|
|
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
|
-
}());
|
|
19
|
+
}
|
|
21
20
|
exports.MoonbeamRoundInfo = MoonbeamRoundInfo;
|
|
22
21
|
//# sourceMappingURL=MoonbeamRoundInfo.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MoonbeamRoundInfo.js","sourceRoot":"","sources":["../../../../../../src/v0/protocol/moonbeam/data/staking/MoonbeamRoundInfo.ts"],"names":[],"mappings":";;;AAAA
|
|
1
|
+
{"version":3,"file":"MoonbeamRoundInfo.js","sourceRoot":"","sources":["../../../../../../src/v0/protocol/moonbeam/data/staking/MoonbeamRoundInfo.ts"],"names":[],"mappings":";;;AAAA,+FAA2F;AAE3F,qFAAiF;AAEjF,MAAa,iBAAiB;IACrB,MAAM,CAAC,MAAM,CAAC,cAAkC,EAAE,GAAW;QAClE,MAAM,OAAO,GAAG,IAAI,2BAAY,CAAC,mCAAgB,CAAC,QAAQ,EAAE,cAAc,EAAE,GAAG,CAAC,CAAA;QAEhF,MAAM,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC,EAAE,CAAC,CAAA;QACzC,MAAM,KAAK,GAAG,OAAO,CAAC,aAAa,CAAC,EAAE,CAAC,CAAA;QACvC,MAAM,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;IAED,YAAoC,OAAiB,EAAkB,KAAe,EAAkB,MAAgB;QAApF,YAAO,GAAP,OAAO,CAAU;QAAkB,UAAK,GAAL,KAAK,CAAU;QAAkB,WAAM,GAAN,MAAM,CAAU;IAAG,CAAC;CAC7H;AAZD,8CAYC"}
|
|
@@ -14,5 +14,5 @@ var MoonbeamStakingActionType;
|
|
|
14
14
|
MoonbeamStakingActionType["SCHEDULE_BOND_LESS"] = "schedule_bond_less";
|
|
15
15
|
MoonbeamStakingActionType["EXECUTE_BOND_LESS"] = "execute_bond_less";
|
|
16
16
|
MoonbeamStakingActionType["CANCEL_BOND_LESS"] = "cancel_bond_less";
|
|
17
|
-
})(MoonbeamStakingActionType
|
|
17
|
+
})(MoonbeamStakingActionType || (exports.MoonbeamStakingActionType = MoonbeamStakingActionType = {}));
|
|
18
18
|
//# sourceMappingURL=MoonbeamStakingActionType.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MoonbeamStakingActionType.js","sourceRoot":"","sources":["../../../../../../src/v0/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,
|
|
1
|
+
{"version":3,"file":"MoonbeamStakingActionType.js","sourceRoot":"","sources":["../../../../../../src/v0/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,yCAAzB,yBAAyB,QAYpC"}
|
|
@@ -1,220 +1,65 @@
|
|
|
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.MoonbeamNodeClient = void 0;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
return
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
return
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
return __generator(this, function (_a) {
|
|
116
|
-
return [2 /*return*/, this.fromStorage('ParachainStaking', 'CandidateInfo', SCALEAccountId_1.SCALEAccountId.from(address, this.network)).then(function (item) {
|
|
117
|
-
return item ? MoonbeamCandidateMetadata_1.MoonbeamCandidateMetadata.decode(_this.runtimeVersion, item) : undefined;
|
|
118
|
-
})];
|
|
119
|
-
});
|
|
120
|
-
});
|
|
121
|
-
};
|
|
122
|
-
MoonbeamNodeClient.prototype.getCollatorCommission = function () {
|
|
123
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
124
|
-
return __generator(this, function (_a) {
|
|
125
|
-
return [2 /*return*/, this.fromStorage('ParachainStaking', 'CollatorCommission').then(function (item) {
|
|
126
|
-
return item ? SCALEInt_1.SCALEInt.decode(item, 32).decoded.value : undefined;
|
|
127
|
-
})];
|
|
128
|
-
});
|
|
129
|
-
});
|
|
130
|
-
};
|
|
131
|
-
MoonbeamNodeClient.prototype.getMaxTopDelegationsPerCandidate = function () {
|
|
132
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
133
|
-
return __generator(this, function (_a) {
|
|
134
|
-
return [2 /*return*/, this.getConstant('ParachainStaking', 'MaxTopDelegationsPerCandidate').then(function (item) {
|
|
135
|
-
return item ? SCALEInt_1.SCALEInt.decode(item, 32).decoded.value : undefined;
|
|
136
|
-
})];
|
|
137
|
-
});
|
|
138
|
-
});
|
|
139
|
-
};
|
|
140
|
-
MoonbeamNodeClient.prototype.getMaxBottomDelegationsPerCandidate = function () {
|
|
141
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
142
|
-
return __generator(this, function (_a) {
|
|
143
|
-
return [2 /*return*/, this.getConstant('ParachainStaking', 'MaxBottomDelegationsPerCandidate').then(function (item) {
|
|
144
|
-
return item ? SCALEInt_1.SCALEInt.decode(item, 32).decoded.value : undefined;
|
|
145
|
-
})];
|
|
146
|
-
});
|
|
147
|
-
});
|
|
148
|
-
};
|
|
149
|
-
MoonbeamNodeClient.prototype.getMaxDelegationsPerDelegator = function () {
|
|
150
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
151
|
-
return __generator(this, function (_a) {
|
|
152
|
-
return [2 /*return*/, this.getConstant('ParachainStaking', 'MaxDelegationsPerDelegator').then(function (item) {
|
|
153
|
-
return item ? SCALEInt_1.SCALEInt.decode(item, 32).decoded.value : undefined;
|
|
154
|
-
})];
|
|
155
|
-
});
|
|
156
|
-
});
|
|
157
|
-
};
|
|
158
|
-
MoonbeamNodeClient.prototype.getMinDelegation = function () {
|
|
159
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
160
|
-
return __generator(this, function (_a) {
|
|
161
|
-
return [2 /*return*/, this.getConstant('ParachainStaking', 'MinDelegation').then(function (item) { return (item ? SCALEInt_1.SCALEInt.decode(item).decoded.value : undefined); })];
|
|
162
|
-
});
|
|
163
|
-
});
|
|
164
|
-
};
|
|
165
|
-
MoonbeamNodeClient.prototype.getMinDelegatorStake = function () {
|
|
166
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
167
|
-
return __generator(this, function (_a) {
|
|
168
|
-
return [2 /*return*/, this.getConstant('ParachainStaking', 'MinDelegatorStk').then(function (item) { return (item ? SCALEInt_1.SCALEInt.decode(item).decoded.value : undefined); })];
|
|
169
|
-
});
|
|
170
|
-
});
|
|
171
|
-
};
|
|
172
|
-
MoonbeamNodeClient.prototype.getCandidateBondLessDelay = function () {
|
|
173
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
174
|
-
return __generator(this, function (_a) {
|
|
175
|
-
return [2 /*return*/, this.getConstant('ParachainStaking', 'CandidateBondLessDelay').then(function (item) {
|
|
176
|
-
return item ? SCALEInt_1.SCALEInt.decode(item).decoded.value : undefined;
|
|
177
|
-
})];
|
|
178
|
-
});
|
|
179
|
-
});
|
|
180
|
-
};
|
|
181
|
-
MoonbeamNodeClient.prototype.getLeaveDelegatorsDelay = function () {
|
|
182
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
183
|
-
return __generator(this, function (_a) {
|
|
184
|
-
return [2 /*return*/, this.getConstant('ParachainStaking', 'LeaveDelegatorsDelay').then(function (item) {
|
|
185
|
-
return item ? SCALEInt_1.SCALEInt.decode(item).decoded.value : undefined;
|
|
186
|
-
})];
|
|
187
|
-
});
|
|
188
|
-
});
|
|
189
|
-
};
|
|
190
|
-
MoonbeamNodeClient.prototype.getRevokeDelegationDelay = function () {
|
|
191
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
192
|
-
return __generator(this, function (_a) {
|
|
193
|
-
return [2 /*return*/, this.getConstant('ParachainStaking', 'RevokeDelegationDelay').then(function (item) {
|
|
194
|
-
return item ? SCALEInt_1.SCALEInt.decode(item).decoded.value : undefined;
|
|
195
|
-
})];
|
|
196
|
-
});
|
|
197
|
-
});
|
|
198
|
-
};
|
|
199
|
-
MoonbeamNodeClient.prototype.getDelegationBondLessDelay = function () {
|
|
200
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
201
|
-
return __generator(this, function (_a) {
|
|
202
|
-
return [2 /*return*/, this.getConstant('ParachainStaking', 'DelegationBondLessDelay').then(function (item) {
|
|
203
|
-
return item ? SCALEInt_1.SCALEInt.decode(item).decoded.value : undefined;
|
|
204
|
-
})];
|
|
205
|
-
});
|
|
206
|
-
});
|
|
207
|
-
};
|
|
208
|
-
MoonbeamNodeClient.prototype.getDefaultBlocksPerRound = function () {
|
|
209
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
210
|
-
return __generator(this, function (_a) {
|
|
211
|
-
return [2 /*return*/, this.getConstant('ParachainStaking', 'DefaultBlocksPerRound').then(function (item) {
|
|
212
|
-
return item ? SCALEInt_1.SCALEInt.decode(item).decoded.value : undefined;
|
|
213
|
-
})];
|
|
214
|
-
});
|
|
215
|
-
});
|
|
216
|
-
};
|
|
217
|
-
return MoonbeamNodeClient;
|
|
218
|
-
}(SubstrateNodeClient_1.SubstrateNodeClient));
|
|
4
|
+
const SCALEAccountId_1 = require("@airgap/substrate/v0/protocol/common/data/scale/type/SCALEAccountId");
|
|
5
|
+
const SCALEArray_1 = require("@airgap/substrate/v0/protocol/common/data/scale/type/SCALEArray");
|
|
6
|
+
const SCALEInt_1 = require("@airgap/substrate/v0/protocol/common/data/scale/type/SCALEInt");
|
|
7
|
+
const SubstrateNodeClient_1 = require("@airgap/substrate/v0/protocol/common/node/SubstrateNodeClient");
|
|
8
|
+
const MoonbeamCandidateMetadata_1 = require("../data/staking/MoonbeamCandidateMetadata");
|
|
9
|
+
const MoonbeamDelegationScheduledRequests_1 = require("../data/staking/MoonbeamDelegationScheduledRequests");
|
|
10
|
+
const MoonbeamDelegator_1 = require("../data/staking/MoonbeamDelegator");
|
|
11
|
+
const MoonbeamRoundInfo_1 = require("../data/staking/MoonbeamRoundInfo");
|
|
12
|
+
class MoonbeamNodeClient extends SubstrateNodeClient_1.SubstrateNodeClient {
|
|
13
|
+
async getRound() {
|
|
14
|
+
return this.fromStorage('ParachainStaking', 'Round').then((item) => item ? MoonbeamRoundInfo_1.MoonbeamRoundInfo.decode(this.runtimeVersion, item) : undefined);
|
|
15
|
+
}
|
|
16
|
+
async getCollators() {
|
|
17
|
+
return this.fromStorage('ParachainStaking', 'SelectedCandidates').then((items) => items
|
|
18
|
+
? SCALEArray_1.SCALEArray.decode(this.network, this.runtimeVersion, items, (network, _, hex) => SCALEAccountId_1.SCALEAccountId.decode(network, hex, 20)).decoded.elements.map((encoded) => encoded.address)
|
|
19
|
+
: undefined);
|
|
20
|
+
}
|
|
21
|
+
async getDelegatorState(address) {
|
|
22
|
+
return this.fromStorage('ParachainStaking', 'DelegatorState', SCALEAccountId_1.SCALEAccountId.from(address, this.network)).then((item) => item ? MoonbeamDelegator_1.MoonbeamDelegator.decode(this.runtimeVersion, item) : undefined);
|
|
23
|
+
}
|
|
24
|
+
async getDelegationScheduledRequests(address) {
|
|
25
|
+
return this.fromStorage('ParachainStaking', 'DelegationScheduledRequests', SCALEAccountId_1.SCALEAccountId.from(address, this.network)).then((item) => item ? MoonbeamDelegationScheduledRequests_1.MoonbeamDelegationScheduledRequests.decode(this.runtimeVersion, item) : undefined);
|
|
26
|
+
}
|
|
27
|
+
async getCandidateInfo(address) {
|
|
28
|
+
return this.fromStorage('ParachainStaking', 'CandidateInfo', SCALEAccountId_1.SCALEAccountId.from(address, this.network)).then((item) => item ? MoonbeamCandidateMetadata_1.MoonbeamCandidateMetadata.decode(this.runtimeVersion, item) : undefined);
|
|
29
|
+
}
|
|
30
|
+
async getCollatorCommission() {
|
|
31
|
+
return this.fromStorage('ParachainStaking', 'CollatorCommission').then((item) => item ? SCALEInt_1.SCALEInt.decode(item, 32).decoded.value : undefined);
|
|
32
|
+
}
|
|
33
|
+
async getMaxTopDelegationsPerCandidate() {
|
|
34
|
+
return this.getConstant('ParachainStaking', 'MaxTopDelegationsPerCandidate').then((item) => item ? SCALEInt_1.SCALEInt.decode(item, 32).decoded.value : undefined);
|
|
35
|
+
}
|
|
36
|
+
async getMaxBottomDelegationsPerCandidate() {
|
|
37
|
+
return this.getConstant('ParachainStaking', 'MaxBottomDelegationsPerCandidate').then((item) => item ? SCALEInt_1.SCALEInt.decode(item, 32).decoded.value : undefined);
|
|
38
|
+
}
|
|
39
|
+
async getMaxDelegationsPerDelegator() {
|
|
40
|
+
return this.getConstant('ParachainStaking', 'MaxDelegationsPerDelegator').then((item) => item ? SCALEInt_1.SCALEInt.decode(item, 32).decoded.value : undefined);
|
|
41
|
+
}
|
|
42
|
+
async getMinDelegation() {
|
|
43
|
+
return this.getConstant('ParachainStaking', 'MinDelegation').then((item) => (item ? SCALEInt_1.SCALEInt.decode(item).decoded.value : undefined));
|
|
44
|
+
}
|
|
45
|
+
async getMinDelegatorStake() {
|
|
46
|
+
return this.getConstant('ParachainStaking', 'MinDelegatorStk').then((item) => (item ? SCALEInt_1.SCALEInt.decode(item).decoded.value : undefined));
|
|
47
|
+
}
|
|
48
|
+
async getCandidateBondLessDelay() {
|
|
49
|
+
return this.getConstant('ParachainStaking', 'CandidateBondLessDelay').then((item) => item ? SCALEInt_1.SCALEInt.decode(item).decoded.value : undefined);
|
|
50
|
+
}
|
|
51
|
+
async getLeaveDelegatorsDelay() {
|
|
52
|
+
return this.getConstant('ParachainStaking', 'LeaveDelegatorsDelay').then((item) => item ? SCALEInt_1.SCALEInt.decode(item).decoded.value : undefined);
|
|
53
|
+
}
|
|
54
|
+
async getRevokeDelegationDelay() {
|
|
55
|
+
return this.getConstant('ParachainStaking', 'RevokeDelegationDelay').then((item) => item ? SCALEInt_1.SCALEInt.decode(item).decoded.value : undefined);
|
|
56
|
+
}
|
|
57
|
+
async getDelegationBondLessDelay() {
|
|
58
|
+
return this.getConstant('ParachainStaking', 'DelegationBondLessDelay').then((item) => item ? SCALEInt_1.SCALEInt.decode(item).decoded.value : undefined);
|
|
59
|
+
}
|
|
60
|
+
async getDefaultBlocksPerRound() {
|
|
61
|
+
return this.getConstant('ParachainStaking', 'DefaultBlocksPerRound').then((item) => item ? SCALEInt_1.SCALEInt.decode(item).decoded.value : undefined);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
219
64
|
exports.MoonbeamNodeClient = MoonbeamNodeClient;
|
|
220
65
|
//# sourceMappingURL=MoonbeamNodeClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MoonbeamNodeClient.js","sourceRoot":"","sources":["../../../../../src/v0/protocol/moonbeam/node/MoonbeamNodeClient.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MoonbeamNodeClient.js","sourceRoot":"","sources":["../../../../../src/v0/protocol/moonbeam/node/MoonbeamNodeClient.ts"],"names":[],"mappings":";;;AACA,wGAAoG;AACpG,gGAA4F;AAC5F,4FAAwF;AACxF,uGAAmG;AAInG,yFAAqF;AACrF,6GAAyG;AACzG,yEAAqE;AACrE,yEAAqE;AAErE,MAAa,kBAAmB,SAAQ,yCAA8C;IAC7E,KAAK,CAAC,QAAQ;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CACjE,IAAI,CAAC,CAAC,CAAC,qCAAiB,CAAC,MAAM,CAAC,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CACvE,CAAA;IACH,CAAC;IAEM,KAAK,CAAC,YAAY;QACvB,OAAO,IAAI,CAAC,WAAW,CAAC,kBAAkB,EAAE,oBAAoB,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAC/E,KAAK;YACH,CAAC,CAAC,uBAAU,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,cAAc,EAAE,KAAK,EAAE,CAAC,OAAO,EAAE,CAAC,EAAE,GAAG,EAAE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