@keetanetwork/keetanet-client 0.10.4 → 0.10.5
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/client/client_common_tests.d.ts +27 -0
- package/client/index-browser.d.ts +17 -4
- package/client/index-browser.js +799 -694
- package/client/index.d.ts +17 -4
- package/client/index.js +106 -24
- package/docs/assets/hierarchy.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/KeetaNetSDK.Client.html +12 -3
- package/docs/classes/KeetaNetSDK.Referenced.BaseSet.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.BlockHash.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperation.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationCREATE_IDENTIFIER.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationMODIFY_PERMISSIONS.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationRECEIVE.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationSEND.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationSET_INFO.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationSET_REP.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationTOKEN_ADMIN_MODIFY_BALANCE.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationTOKEN_ADMIN_SUPPLY.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.ECDSAKeyPair.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.ECDSASECP256K1KeyPair.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.ECDSASECP256K1PrivateKey.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.ECDSASECP256K1PublicKey.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.ECDSASECP256K1Signature.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.ECDSASECP256R1KeyPair.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.ECDSASECP256R1PrivateKey.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.ECDSASECP256R1PublicKey.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.ECDSASECP256R1Signature.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.ED25519KeyPair.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.ED25519PrivateKey.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.ED25519PublicKey.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.ED25519Signature.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.ExternalKeyPair.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.ExternalSet.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.HTTPAgentManager.html +4 -0
- package/docs/classes/KeetaNetSDK.Referenced.IdentifierKey.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.IdentifierKeyPair.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.KeetaNetError.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.KeyInterface.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.KeyStorage.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.PermissionSetHolder.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.PossiblyExpiredVote.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.SignatureStorage.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.Vote.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.VoteBlockHash.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.VoteHash.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.VoteStapleHash.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.src_lib_utils_buffer.BufferStorage.html +1 -1
- package/docs/classes/KeetaNetSDK.UserClient.html +3 -3
- package/docs/hierarchy.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.ACLEntry.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.ACLUpdate.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.ASN1ExplicitContextTag.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.ASN1ImplicitContextTag.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.ASN1Object.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.BaseExternalKeyPairFunctions.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.BaseGenerationConfig.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockCanonical.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperation.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationCREATE_IDENTIFIER.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationMODIFY_PERMISSIONS.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationRECEIVE.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationSEND.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationSET_INFO.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationSET_REP.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationTOKEN_ADMIN_MODIFY_BALANCE.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationTOKEN_ADMIN_SUPPLY.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOutput.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.Constructor.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.ExternalKeyPairFunctionsNoEncryption.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.ExternalKeyPairFunctionsSupportsEncryption.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.InitialConfigSupply.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.ModifyTokenBalanceEntry.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.NumericValueEntry.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.P2PPeerBase.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.P2PPeerListener.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.P2PPeerRepBase.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.PublicKeyStorage.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.RequestTokenReceiveEntry.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.TokenNumericEntry.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.UserClientConfig.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.UserClientOptions.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.VoteJSONOutput.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.WithIsInstance.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.src_lib_utils_asn1.ASN1BitString.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.src_lib_utils_asn1.ASN1Date.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.src_lib_utils_asn1.ASN1OID.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.src_lib_utils_asn1.ASN1Set.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.src_lib_utils_asn1.ASN1String.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.src_lib_utils_helper.InstanceSet.html +1 -1
- package/docs/modules/KeetaNetSDK.Referenced.html +1 -1
- package/docs/types/KeetaNetSDK.Referenced.ClientRepresentative.html +1 -1
- package/docs/types/KeetaNetSDK.Referenced.src_config.NetworkConfig.html +2 -2
- package/package.json +1 -1
- package/version.d.ts +1 -1
package/client/index-browser.js
CHANGED
|
@@ -137650,7 +137650,7 @@ client_certificate_defineProperty(src_client_Certificate, "certificateObjectType
|
|
|
137650
137650
|
}
|
|
137651
137651
|
});
|
|
137652
137652
|
;// ./src/version.ts
|
|
137653
|
-
var client_version = '0.10.
|
|
137653
|
+
var client_version = '0.10.5';
|
|
137654
137654
|
/* harmony default export */ const client_src_version = ((/* unused pure expression or super */ null && (client_version)));
|
|
137655
137655
|
// EXTERNAL MODULE: node-fetch (ignored)
|
|
137656
137656
|
var client_node_fetch_ignored_ = __webpack_require__(9495);
|
|
@@ -138851,12 +138851,12 @@ function client_client_asyncToGenerator(n) { return function () { var t = this,
|
|
|
138851
138851
|
function client_client_classPrivateMethodInitSpec(e, a) { client_client_checkPrivateRedeclaration(e, a), a.add(e); }
|
|
138852
138852
|
function client_client_classPrivateFieldInitSpec(e, t, a) { client_client_checkPrivateRedeclaration(e, t), t.set(e, a); }
|
|
138853
138853
|
function client_client_checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
|
|
138854
|
-
function client_src_client_defineProperty(e, r, t) { return (r = client_src_client_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
138855
|
-
function client_src_client_toPropertyKey(t) { var i = client_src_client_toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
138856
|
-
function client_src_client_toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
138857
138854
|
function client_client_classPrivateFieldGet(s, a) { return s.get(client_client_assertClassBrand(s, a)); }
|
|
138858
138855
|
function client_client_classPrivateFieldSet(s, a, r) { return s.set(client_client_assertClassBrand(s, a), r), r; }
|
|
138859
138856
|
function client_client_assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
|
|
138857
|
+
function client_src_client_defineProperty(e, r, t) { return (r = client_src_client_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
138858
|
+
function client_src_client_toPropertyKey(t) { var i = client_src_client_toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
138859
|
+
function client_src_client_toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
138860
138860
|
/**
|
|
138861
138861
|
* JavaScript and TypeScript SDK for the KeetaNet network.
|
|
138862
138862
|
*
|
|
@@ -138954,6 +138954,53 @@ if (typeof client_fetch !== 'function') {
|
|
|
138954
138954
|
}
|
|
138955
138955
|
}
|
|
138956
138956
|
}
|
|
138957
|
+
class client_HTTPAgentManager {
|
|
138958
|
+
constructor() {
|
|
138959
|
+
client_src_client_defineProperty(this, "agentMap", new Map());
|
|
138960
|
+
}
|
|
138961
|
+
getAgent(url) {
|
|
138962
|
+
var now = Date.now();
|
|
138963
|
+
var protocol;
|
|
138964
|
+
if (url.protocol === 'http:') {
|
|
138965
|
+
protocol = 'http';
|
|
138966
|
+
} else {
|
|
138967
|
+
protocol = 'https';
|
|
138968
|
+
}
|
|
138969
|
+
var agentEntry = this.agentMap.get(protocol);
|
|
138970
|
+
if (agentEntry !== undefined) {
|
|
138971
|
+
var agentAge = now - agentEntry.created;
|
|
138972
|
+
var expired = false;
|
|
138973
|
+
if (agentAge > client_HTTPAgentManager.AGENT_TTL_MS) {
|
|
138974
|
+
expired = true;
|
|
138975
|
+
}
|
|
138976
|
+
if (expired) {
|
|
138977
|
+
this.agentMap.delete(protocol);
|
|
138978
|
+
agentEntry = undefined;
|
|
138979
|
+
}
|
|
138980
|
+
}
|
|
138981
|
+
if (agentEntry === undefined) {
|
|
138982
|
+
var newAgent;
|
|
138983
|
+
if (protocol === 'http') {
|
|
138984
|
+
newAgent = new (client_stream_http_default()).Agent({
|
|
138985
|
+
keepAlive: true
|
|
138986
|
+
});
|
|
138987
|
+
} else {
|
|
138988
|
+
newAgent = new (client_https_browserify_default()).Agent({
|
|
138989
|
+
keepAlive: true
|
|
138990
|
+
});
|
|
138991
|
+
}
|
|
138992
|
+
agentEntry = {
|
|
138993
|
+
created: now,
|
|
138994
|
+
agent: newAgent
|
|
138995
|
+
};
|
|
138996
|
+
this.agentMap.set(protocol, agentEntry);
|
|
138997
|
+
}
|
|
138998
|
+
return agentEntry.agent;
|
|
138999
|
+
}
|
|
139000
|
+
destroy() {
|
|
139001
|
+
this.agentMap.clear();
|
|
139002
|
+
}
|
|
139003
|
+
}
|
|
138957
139004
|
|
|
138958
139005
|
/**
|
|
138959
139006
|
* The Client class provides a low-level interface to the KeetaNet network.
|
|
@@ -138973,6 +139020,7 @@ if (typeof client_fetch !== 'function') {
|
|
|
138973
139020
|
* const blocks = await client.getChain('keeta_...');
|
|
138974
139021
|
* ```
|
|
138975
139022
|
*/
|
|
139023
|
+
client_src_client_defineProperty(client_HTTPAgentManager, "AGENT_TTL_MS", 30 * 1000);
|
|
138976
139024
|
var client_reps = /*#__PURE__*/new WeakMap();
|
|
138977
139025
|
var client_weightOrderedReps = /*#__PURE__*/new WeakMap();
|
|
138978
139026
|
var client_agent = /*#__PURE__*/new WeakMap();
|
|
@@ -139037,6 +139085,7 @@ class src_client_Client {
|
|
|
139037
139085
|
client_client_classPrivateFieldInitSpec(this, client_agent, void 0);
|
|
139038
139086
|
client_client_classPrivateFieldInitSpec(this, client_intervals, void 0);
|
|
139039
139087
|
client_client_classPrivateFieldInitSpec(this, client_updateRepsPromise, void 0);
|
|
139088
|
+
// 5 minutes
|
|
139040
139089
|
/**
|
|
139041
139090
|
* Stats for this instance of the client
|
|
139042
139091
|
*/
|
|
@@ -139061,27 +139110,20 @@ class src_client_Client {
|
|
|
139061
139110
|
*/
|
|
139062
139111
|
client_src_client_defineProperty(this, "_testing_api", client_client_assertClassBrand(client_Client_brand, this, client_apiRaw).bind(this));
|
|
139063
139112
|
client_client_classPrivateFieldSet(client_reps, this, _reps2);
|
|
139064
|
-
|
|
139065
|
-
keepAlive: true
|
|
139066
|
-
});
|
|
139067
|
-
var httpsAgent = new (client_https_browserify_default()).Agent({
|
|
139068
|
-
keepAlive: true
|
|
139069
|
-
});
|
|
139070
|
-
client_client_classPrivateFieldSet(client_agent, this, function (parsedURL) {
|
|
139071
|
-
if (parsedURL.protocol === 'http:') {
|
|
139072
|
-
return httpAgent;
|
|
139073
|
-
} else {
|
|
139074
|
-
return httpsAgent;
|
|
139075
|
-
}
|
|
139076
|
-
});
|
|
139113
|
+
client_client_classPrivateFieldSet(client_agent, this, new client_HTTPAgentManager());
|
|
139077
139114
|
client_client_classPrivateFieldSet(client_updateRepsPromise, this, undefined);
|
|
139078
139115
|
client_client_classPrivateFieldSet(client_intervals, this, {});
|
|
139116
|
+
|
|
139079
139117
|
// Update Reps immediately and then every 5 minutes
|
|
139080
|
-
client_client_classPrivateFieldSet(client_updateRepsPromise, this, this.updateReps())
|
|
139118
|
+
client_client_classPrivateFieldSet(client_updateRepsPromise, this, this.updateReps().catch(function () {
|
|
139119
|
+
// Ignore any errors
|
|
139120
|
+
}));
|
|
139081
139121
|
if (client_client_classPrivateFieldGet(client_intervals, this).updateReps === undefined) {
|
|
139082
139122
|
client_client_classPrivateFieldGet(client_intervals, this).updateReps = setInterval(() => {
|
|
139083
|
-
client_client_classPrivateFieldSet(client_updateRepsPromise, this, this.updateReps())
|
|
139084
|
-
|
|
139123
|
+
client_client_classPrivateFieldSet(client_updateRepsPromise, this, this.updateReps().catch(function () {
|
|
139124
|
+
// Ignore any errors
|
|
139125
|
+
}));
|
|
139126
|
+
}, src_client_Client.updateRepsInterval);
|
|
139085
139127
|
}
|
|
139086
139128
|
}
|
|
139087
139129
|
|
|
@@ -139109,10 +139151,11 @@ class src_client_Client {
|
|
|
139109
139151
|
interval = _intervalIds[_i];
|
|
139110
139152
|
clearInterval(interval);
|
|
139111
139153
|
}
|
|
139154
|
+
client_client_classPrivateFieldGet(client_agent, _this).destroy();
|
|
139112
139155
|
|
|
139113
139156
|
// Clear Variables
|
|
139114
139157
|
client_client_classPrivateFieldSet(client_intervals, _this, {});
|
|
139115
|
-
case
|
|
139158
|
+
case 7:
|
|
139116
139159
|
case "end":
|
|
139117
139160
|
return _context.stop();
|
|
139118
139161
|
}
|
|
@@ -139717,34 +139760,37 @@ class src_client_Client {
|
|
|
139717
139760
|
* may have sent tokens to it.
|
|
139718
139761
|
*
|
|
139719
139762
|
* @param account The account to get the head block for
|
|
139763
|
+
* @param rep The representative to get the head block from -- this is generally "ANY" in which case the best representative will be used, but it is possible to request a specific representative
|
|
139720
139764
|
* @return The head block for the account or null if the account has
|
|
139721
139765
|
* not created any blocks
|
|
139722
139766
|
*/
|
|
139723
139767
|
getHeadBlock(account) {
|
|
139724
|
-
var
|
|
139768
|
+
var _arguments3 = arguments,
|
|
139769
|
+
_this14 = this;
|
|
139725
139770
|
return client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function _callee15() {
|
|
139726
|
-
var result, block;
|
|
139771
|
+
var rep, result, block;
|
|
139727
139772
|
return client_client_regeneratorRuntime().wrap(function _callee15$(_context16) {
|
|
139728
139773
|
while (1) switch (_context16.prev = _context16.next) {
|
|
139729
139774
|
case 0:
|
|
139775
|
+
rep = _arguments3.length > 1 && _arguments3[1] !== undefined ? _arguments3[1] : 'ANY';
|
|
139730
139776
|
account = client_src_lib.Account.toPublicKeyString(account);
|
|
139731
|
-
_context16.next =
|
|
139732
|
-
return client_client_assertClassBrand(client_Client_brand, _this14, src_client_api).call(_this14,
|
|
139777
|
+
_context16.next = 4;
|
|
139778
|
+
return client_client_assertClassBrand(client_Client_brand, _this14, src_client_api).call(_this14, rep, 'GET /node/ledger/account/:account/head', {
|
|
139733
139779
|
args: {
|
|
139734
139780
|
account
|
|
139735
139781
|
}
|
|
139736
139782
|
});
|
|
139737
|
-
case
|
|
139783
|
+
case 4:
|
|
139738
139784
|
result = _context16.sent;
|
|
139739
139785
|
if (!(result.block === null)) {
|
|
139740
|
-
_context16.next =
|
|
139786
|
+
_context16.next = 7;
|
|
139741
139787
|
break;
|
|
139742
139788
|
}
|
|
139743
139789
|
return _context16.abrupt("return", null);
|
|
139744
|
-
case
|
|
139790
|
+
case 7:
|
|
139745
139791
|
block = new client_src_lib.Block(result.block);
|
|
139746
139792
|
return _context16.abrupt("return", block);
|
|
139747
|
-
case
|
|
139793
|
+
case 9:
|
|
139748
139794
|
case "end":
|
|
139749
139795
|
return _context16.stop();
|
|
139750
139796
|
}
|
|
@@ -139781,14 +139827,14 @@ class src_client_Client {
|
|
|
139781
139827
|
* @return The block for the given block hash or null if the block does not exist on the given ledger
|
|
139782
139828
|
*/
|
|
139783
139829
|
getBlock(blockhash, side) {
|
|
139784
|
-
var
|
|
139830
|
+
var _arguments4 = arguments,
|
|
139785
139831
|
_this15 = this;
|
|
139786
139832
|
return client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function _callee16() {
|
|
139787
139833
|
var rep, info, block;
|
|
139788
139834
|
return client_client_regeneratorRuntime().wrap(function _callee16$(_context17) {
|
|
139789
139835
|
while (1) switch (_context17.prev = _context17.next) {
|
|
139790
139836
|
case 0:
|
|
139791
|
-
rep =
|
|
139837
|
+
rep = _arguments4.length > 2 && _arguments4[2] !== undefined ? _arguments4[2] : 'ANY';
|
|
139792
139838
|
if (typeof blockhash !== 'string') {
|
|
139793
139839
|
blockhash = blockhash.toString('hex');
|
|
139794
139840
|
}
|
|
@@ -139838,31 +139884,35 @@ class src_client_Client {
|
|
|
139838
139884
|
/**
|
|
139839
139885
|
* @param blockhash The block hash to get the vote staple for
|
|
139840
139886
|
* @param side The side of the ledger to get the vote staple from -- this is generally "main", but it is possible to request "side" ledger blocks
|
|
139887
|
+
* @param rep The representative to get the staple from -- this is generally "ANY" in which case the best representative will be used, but it is possible to request a specific representative
|
|
139841
139888
|
* @return The vote staple for the given block hash or null if the vote staple does not exist on the given ledger
|
|
139842
139889
|
*/
|
|
139843
139890
|
|
|
139844
139891
|
/**
|
|
139845
139892
|
* @param blockhash The block hash to get the vote staple for
|
|
139846
139893
|
* @param side The side of the ledger to get the vote staple from -- this is generally "main", but it is possible to request "side" ledger blocks
|
|
139894
|
+
* @param rep The representative to get the staple from -- this is generally "ANY" in which case the best representative will be used, but it is possible to request a specific representative
|
|
139847
139895
|
* @return The vote staple for the given block hash or null if the vote staple does not exist on the given ledger
|
|
139848
139896
|
*/
|
|
139849
139897
|
getVoteStaple(blockhash, side) {
|
|
139850
|
-
var
|
|
139898
|
+
var _arguments5 = arguments,
|
|
139899
|
+
_this16 = this;
|
|
139851
139900
|
return client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function _callee17() {
|
|
139852
|
-
var votes, sampleVote, blocksPromises, _iterator4, _step4, voteBlockhash, blocksOrNull, _iterator5, _step5, block, blocks, _iterator6, _step6, _block, voteStaple;
|
|
139901
|
+
var rep, votes, sampleVote, blocksPromises, _iterator4, _step4, voteBlockhash, blocksOrNull, _iterator5, _step5, block, blocks, _iterator6, _step6, _block, voteStaple;
|
|
139853
139902
|
return client_client_regeneratorRuntime().wrap(function _callee17$(_context18) {
|
|
139854
139903
|
while (1) switch (_context18.prev = _context18.next) {
|
|
139855
139904
|
case 0:
|
|
139856
|
-
|
|
139857
|
-
|
|
139858
|
-
|
|
139905
|
+
rep = _arguments5.length > 2 && _arguments5[2] !== undefined ? _arguments5[2] : 'ANY';
|
|
139906
|
+
_context18.next = 3;
|
|
139907
|
+
return client_client_assertClassBrand(client_Client_brand, _this16, client_getVotes).call(_this16, blockhash, side, rep);
|
|
139908
|
+
case 3:
|
|
139859
139909
|
votes = _context18.sent;
|
|
139860
139910
|
if (!(votes === null)) {
|
|
139861
|
-
_context18.next =
|
|
139911
|
+
_context18.next = 6;
|
|
139862
139912
|
break;
|
|
139863
139913
|
}
|
|
139864
139914
|
return _context18.abrupt("return", null);
|
|
139865
|
-
case
|
|
139915
|
+
case 6:
|
|
139866
139916
|
/**
|
|
139867
139917
|
* Pick a representative Vote from the list, all votes will be
|
|
139868
139918
|
* of the same set of Blocks so any one will do
|
|
@@ -139876,7 +139926,7 @@ class src_client_Client {
|
|
|
139876
139926
|
try {
|
|
139877
139927
|
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
139878
139928
|
voteBlockhash = _step4.value;
|
|
139879
|
-
blocksPromises.push(_this16.getBlock(voteBlockhash, side));
|
|
139929
|
+
blocksPromises.push(_this16.getBlock(voteBlockhash, side, rep));
|
|
139880
139930
|
}
|
|
139881
139931
|
|
|
139882
139932
|
/**
|
|
@@ -139888,82 +139938,82 @@ class src_client_Client {
|
|
|
139888
139938
|
} finally {
|
|
139889
139939
|
_iterator4.f();
|
|
139890
139940
|
}
|
|
139891
|
-
_context18.next =
|
|
139941
|
+
_context18.next = 12;
|
|
139892
139942
|
return Promise.all(blocksPromises);
|
|
139893
|
-
case
|
|
139943
|
+
case 12:
|
|
139894
139944
|
blocksOrNull = _context18.sent;
|
|
139895
139945
|
_iterator5 = client_client_createForOfIteratorHelper(blocksOrNull);
|
|
139896
|
-
_context18.prev =
|
|
139946
|
+
_context18.prev = 14;
|
|
139897
139947
|
_iterator5.s();
|
|
139898
|
-
case
|
|
139948
|
+
case 16:
|
|
139899
139949
|
if ((_step5 = _iterator5.n()).done) {
|
|
139900
|
-
_context18.next =
|
|
139950
|
+
_context18.next = 22;
|
|
139901
139951
|
break;
|
|
139902
139952
|
}
|
|
139903
139953
|
block = _step5.value;
|
|
139904
139954
|
if (!(block === null)) {
|
|
139905
|
-
_context18.next =
|
|
139955
|
+
_context18.next = 20;
|
|
139906
139956
|
break;
|
|
139907
139957
|
}
|
|
139908
139958
|
return _context18.abrupt("return", null);
|
|
139909
|
-
case
|
|
139910
|
-
_context18.next =
|
|
139959
|
+
case 20:
|
|
139960
|
+
_context18.next = 16;
|
|
139911
139961
|
break;
|
|
139912
|
-
case
|
|
139913
|
-
_context18.next =
|
|
139962
|
+
case 22:
|
|
139963
|
+
_context18.next = 27;
|
|
139914
139964
|
break;
|
|
139915
|
-
case
|
|
139916
|
-
_context18.prev =
|
|
139917
|
-
_context18.t0 = _context18["catch"](
|
|
139965
|
+
case 24:
|
|
139966
|
+
_context18.prev = 24;
|
|
139967
|
+
_context18.t0 = _context18["catch"](14);
|
|
139918
139968
|
_iterator5.e(_context18.t0);
|
|
139919
|
-
case
|
|
139920
|
-
_context18.prev =
|
|
139969
|
+
case 27:
|
|
139970
|
+
_context18.prev = 27;
|
|
139921
139971
|
_iterator5.f();
|
|
139922
|
-
return _context18.finish(
|
|
139923
|
-
case
|
|
139972
|
+
return _context18.finish(27);
|
|
139973
|
+
case 30:
|
|
139924
139974
|
/**
|
|
139925
139975
|
* Because we errored out on any null blocks above, we have
|
|
139926
139976
|
* only Blocks now
|
|
139927
139977
|
*/
|
|
139928
139978
|
blocks = [];
|
|
139929
139979
|
_iterator6 = client_client_createForOfIteratorHelper(blocksOrNull);
|
|
139930
|
-
_context18.prev =
|
|
139980
|
+
_context18.prev = 32;
|
|
139931
139981
|
_iterator6.s();
|
|
139932
|
-
case
|
|
139982
|
+
case 34:
|
|
139933
139983
|
if ((_step6 = _iterator6.n()).done) {
|
|
139934
|
-
_context18.next =
|
|
139984
|
+
_context18.next = 41;
|
|
139935
139985
|
break;
|
|
139936
139986
|
}
|
|
139937
139987
|
_block = _step6.value;
|
|
139938
139988
|
if (!(_block === null)) {
|
|
139939
|
-
_context18.next =
|
|
139989
|
+
_context18.next = 38;
|
|
139940
139990
|
break;
|
|
139941
139991
|
}
|
|
139942
139992
|
throw new Error('Impossible');
|
|
139943
|
-
case 37:
|
|
139944
|
-
blocks.push(_block);
|
|
139945
139993
|
case 38:
|
|
139946
|
-
|
|
139994
|
+
blocks.push(_block);
|
|
139995
|
+
case 39:
|
|
139996
|
+
_context18.next = 34;
|
|
139947
139997
|
break;
|
|
139948
|
-
case
|
|
139949
|
-
_context18.next =
|
|
139998
|
+
case 41:
|
|
139999
|
+
_context18.next = 46;
|
|
139950
140000
|
break;
|
|
139951
|
-
case
|
|
139952
|
-
_context18.prev =
|
|
139953
|
-
_context18.t1 = _context18["catch"](
|
|
140001
|
+
case 43:
|
|
140002
|
+
_context18.prev = 43;
|
|
140003
|
+
_context18.t1 = _context18["catch"](32);
|
|
139954
140004
|
_iterator6.e(_context18.t1);
|
|
139955
|
-
case
|
|
139956
|
-
_context18.prev =
|
|
140005
|
+
case 46:
|
|
140006
|
+
_context18.prev = 46;
|
|
139957
140007
|
_iterator6.f();
|
|
139958
|
-
return _context18.finish(
|
|
139959
|
-
case
|
|
140008
|
+
return _context18.finish(46);
|
|
140009
|
+
case 49:
|
|
139960
140010
|
voteStaple = client_src_lib.Vote.Staple.fromVotesAndBlocks(votes, blocks);
|
|
139961
140011
|
return _context18.abrupt("return", voteStaple);
|
|
139962
|
-
case
|
|
140012
|
+
case 51:
|
|
139963
140013
|
case "end":
|
|
139964
140014
|
return _context18.stop();
|
|
139965
140015
|
}
|
|
139966
|
-
}, _callee17, null, [[
|
|
140016
|
+
}, _callee17, null, [[14, 24, 27, 30], [32, 43, 46, 49]]);
|
|
139967
140017
|
}))();
|
|
139968
140018
|
}
|
|
139969
140019
|
|
|
@@ -139992,14 +140042,14 @@ class src_client_Client {
|
|
|
139992
140042
|
* @return The chain of blocks for the given account, in reverse order starting with the most recent block
|
|
139993
140043
|
*/
|
|
139994
140044
|
getChain(account) {
|
|
139995
|
-
var
|
|
140045
|
+
var _arguments6 = arguments,
|
|
139996
140046
|
_this17 = this;
|
|
139997
140047
|
return client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function _callee18() {
|
|
139998
140048
|
var options, _options$depth, depth, startBlock, query, retval, chain, _iterator7, _step7, blockInfo, blockJSON, blockBytes, block;
|
|
139999
140049
|
return client_client_regeneratorRuntime().wrap(function _callee18$(_context19) {
|
|
140000
140050
|
while (1) switch (_context19.prev = _context19.next) {
|
|
140001
140051
|
case 0:
|
|
140002
|
-
options =
|
|
140052
|
+
options = _arguments6.length > 1 && _arguments6[1] !== undefined ? _arguments6[1] : {};
|
|
140003
140053
|
_options$depth = options.depth, depth = _options$depth === void 0 ? Infinity : _options$depth, startBlock = options.startBlock;
|
|
140004
140054
|
account = client_lib_account.toPublicKeyString(account);
|
|
140005
140055
|
query = {
|
|
@@ -140109,14 +140159,14 @@ class src_client_Client {
|
|
|
140109
140159
|
* @return The history of vote staples for the given account, in reverse order starting with the most recent vote staple
|
|
140110
140160
|
*/
|
|
140111
140161
|
getHistory(account) {
|
|
140112
|
-
var
|
|
140162
|
+
var _arguments7 = arguments,
|
|
140113
140163
|
_this18 = this;
|
|
140114
140164
|
return client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function _callee19() {
|
|
140115
140165
|
var options, _options$depth2, depth, startBlocksHash, startVoteStapleID, retval, limit, query, history, _iterator8, _step8, historyEntry, voteStapleInfo, voteStapleBinary, voteStaple;
|
|
140116
140166
|
return client_client_regeneratorRuntime().wrap(function _callee19$(_context20) {
|
|
140117
140167
|
while (1) switch (_context20.prev = _context20.next) {
|
|
140118
140168
|
case 0:
|
|
140119
|
-
options =
|
|
140169
|
+
options = _arguments7.length > 1 && _arguments7[1] !== undefined ? _arguments7[1] : {};
|
|
140120
140170
|
_options$depth2 = options.depth, depth = _options$depth2 === void 0 ? Infinity : _options$depth2, startBlocksHash = options.startBlocksHash;
|
|
140121
140171
|
account = client_lib_account.toPublicKeyString(account);
|
|
140122
140172
|
startVoteStapleID = undefined;
|
|
@@ -140355,14 +140405,14 @@ class src_client_Client {
|
|
|
140355
140405
|
* @param timeout Maximum time to wait for a response from a representative in milliseconds
|
|
140356
140406
|
*/
|
|
140357
140407
|
getNetworkStatus() {
|
|
140358
|
-
var
|
|
140408
|
+
var _arguments8 = arguments,
|
|
140359
140409
|
_this22 = this;
|
|
140360
140410
|
return client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function _callee26() {
|
|
140361
140411
|
var timeout, reps, repsInfo, retval;
|
|
140362
140412
|
return client_client_regeneratorRuntime().wrap(function _callee26$(_context27) {
|
|
140363
140413
|
while (1) switch (_context27.prev = _context27.next) {
|
|
140364
140414
|
case 0:
|
|
140365
|
-
timeout =
|
|
140415
|
+
timeout = _arguments8.length > 0 && _arguments8[0] !== undefined ? _arguments8[0] : 5000;
|
|
140366
140416
|
reps = client_client_classPrivateFieldGet(client_reps, _this22);
|
|
140367
140417
|
repsInfo = reps.map(/*#__PURE__*/function () {
|
|
140368
140418
|
var _ref3 = client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function _callee25(rep) {
|
|
@@ -140441,14 +140491,14 @@ class src_client_Client {
|
|
|
140441
140491
|
* @param addNewReps If true, add any new representatives to the list of representatives
|
|
140442
140492
|
*/
|
|
140443
140493
|
updateReps() {
|
|
140444
|
-
var
|
|
140494
|
+
var _arguments9 = arguments,
|
|
140445
140495
|
_this23 = this;
|
|
140446
140496
|
return client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function _callee27() {
|
|
140447
140497
|
var addNewReps, repsResponse, weightedReps, _iterator9, _step9, _loop2;
|
|
140448
140498
|
return client_client_regeneratorRuntime().wrap(function _callee27$(_context29) {
|
|
140449
140499
|
while (1) switch (_context29.prev = _context29.next) {
|
|
140450
140500
|
case 0:
|
|
140451
|
-
addNewReps =
|
|
140501
|
+
addNewReps = _arguments9.length > 0 && _arguments9[0] !== undefined ? _arguments9[0] : false;
|
|
140452
140502
|
_context29.next = 3;
|
|
140453
140503
|
return client_client_assertClassBrand(client_Client_brand, _this23, src_client_api).call(_this23, 'ANY', 'GET /node/ledger/representatives');
|
|
140454
140504
|
case 3:
|
|
@@ -140704,6 +140754,54 @@ class src_client_Client {
|
|
|
140704
140754
|
}))();
|
|
140705
140755
|
}
|
|
140706
140756
|
|
|
140757
|
+
/**
|
|
140758
|
+
* Get the successor block for a given block. This will return the
|
|
140759
|
+
* block on the representative's ledger that comes after the given block
|
|
140760
|
+
*
|
|
140761
|
+
* @param blockOrHash The block or hash to get the successor for
|
|
140762
|
+
* @param rep The representative account to get the successor block from
|
|
140763
|
+
* @return The successor block for the block or null if there is no
|
|
140764
|
+
* successor block
|
|
140765
|
+
*/
|
|
140766
|
+
getSuccessorBlock(blockOrHash) {
|
|
140767
|
+
var _arguments10 = arguments,
|
|
140768
|
+
_this26 = this;
|
|
140769
|
+
return client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function _callee31() {
|
|
140770
|
+
var rep, blockHash, successor;
|
|
140771
|
+
return client_client_regeneratorRuntime().wrap(function _callee31$(_context33) {
|
|
140772
|
+
while (1) switch (_context33.prev = _context33.next) {
|
|
140773
|
+
case 0:
|
|
140774
|
+
rep = _arguments10.length > 1 && _arguments10[1] !== undefined ? _arguments10[1] : 'ANY';
|
|
140775
|
+
if (client_lib_block.isInstance(blockOrHash)) {
|
|
140776
|
+
blockHash = blockOrHash.hash.toString();
|
|
140777
|
+
} else if (client_block_BlockHash.isInstance(blockOrHash)) {
|
|
140778
|
+
blockHash = blockOrHash.toString();
|
|
140779
|
+
} else {
|
|
140780
|
+
blockHash = blockOrHash;
|
|
140781
|
+
}
|
|
140782
|
+
_context33.next = 4;
|
|
140783
|
+
return client_client_assertClassBrand(client_Client_brand, _this26, src_client_api).call(_this26, rep, 'GET /node/ledger/block/:blockhash/successor', {
|
|
140784
|
+
args: {
|
|
140785
|
+
blockhash: blockHash
|
|
140786
|
+
}
|
|
140787
|
+
});
|
|
140788
|
+
case 4:
|
|
140789
|
+
successor = _context33.sent;
|
|
140790
|
+
if (!successor.successorBlock) {
|
|
140791
|
+
_context33.next = 7;
|
|
140792
|
+
break;
|
|
140793
|
+
}
|
|
140794
|
+
return _context33.abrupt("return", new client_lib_block(successor.successorBlock));
|
|
140795
|
+
case 7:
|
|
140796
|
+
return _context33.abrupt("return", null);
|
|
140797
|
+
case 8:
|
|
140798
|
+
case "end":
|
|
140799
|
+
return _context33.stop();
|
|
140800
|
+
}
|
|
140801
|
+
}, _callee31);
|
|
140802
|
+
}))();
|
|
140803
|
+
}
|
|
140804
|
+
|
|
140707
140805
|
/**
|
|
140708
140806
|
* Recover any unpublished or half-publish account artifacts
|
|
140709
140807
|
*
|
|
@@ -140711,58 +140809,58 @@ class src_client_Client {
|
|
|
140711
140809
|
* @param publish Publish the recovered staple to the network (default is true)
|
|
140712
140810
|
*/
|
|
140713
140811
|
recoverAccount(account) {
|
|
140714
|
-
var
|
|
140715
|
-
|
|
140716
|
-
return client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function
|
|
140812
|
+
var _arguments11 = arguments,
|
|
140813
|
+
_this27 = this;
|
|
140814
|
+
return client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function _callee34() {
|
|
140717
140815
|
var publish, successorBlock, getVotes, votePromises, _iterator13, _step13, _rep2, votesInfo, permVotes, tempVotes, permReps, tempReps, missingReps, _iterator14, _step14, repInfo, repVotes, _iterator16, _step16, vote, foundVote, blockHashes, votedOnBlocksOrNull, containsNull, blockHashesStr, votedOnBlocksStr, votedOnBlocks, newTempVotes, missingPermReps, newPermVotes, voteStaple;
|
|
140718
|
-
return client_client_regeneratorRuntime().wrap(function
|
|
140719
|
-
while (1) switch (
|
|
140816
|
+
return client_client_regeneratorRuntime().wrap(function _callee34$(_context36) {
|
|
140817
|
+
while (1) switch (_context36.prev = _context36.next) {
|
|
140720
140818
|
case 0:
|
|
140721
|
-
publish =
|
|
140722
|
-
|
|
140723
|
-
return
|
|
140819
|
+
publish = _arguments11.length > 1 && _arguments11[1] !== undefined ? _arguments11[1] : true;
|
|
140820
|
+
_context36.next = 3;
|
|
140821
|
+
return _this27.getPendingBlock(account);
|
|
140724
140822
|
case 3:
|
|
140725
|
-
successorBlock =
|
|
140823
|
+
successorBlock = _context36.sent;
|
|
140726
140824
|
if (successorBlock) {
|
|
140727
|
-
|
|
140825
|
+
_context36.next = 6;
|
|
140728
140826
|
break;
|
|
140729
140827
|
}
|
|
140730
|
-
return
|
|
140828
|
+
return _context36.abrupt("return", null);
|
|
140731
140829
|
case 6:
|
|
140732
140830
|
getVotes = /*#__PURE__*/function () {
|
|
140733
|
-
var _ref6 = client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function
|
|
140831
|
+
var _ref6 = client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function _callee32(rep, hash) {
|
|
140734
140832
|
var votes;
|
|
140735
|
-
return client_client_regeneratorRuntime().wrap(function
|
|
140736
|
-
while (1) switch (
|
|
140833
|
+
return client_client_regeneratorRuntime().wrap(function _callee32$(_context34) {
|
|
140834
|
+
while (1) switch (_context34.prev = _context34.next) {
|
|
140737
140835
|
case 0:
|
|
140738
140836
|
votes = null;
|
|
140739
|
-
|
|
140740
|
-
|
|
140741
|
-
return client_client_assertClassBrand(client_Client_brand,
|
|
140837
|
+
_context34.prev = 1;
|
|
140838
|
+
_context34.next = 4;
|
|
140839
|
+
return client_client_assertClassBrand(client_Client_brand, _this27, client_getVotes).call(_this27, hash, 'side', rep);
|
|
140742
140840
|
case 4:
|
|
140743
|
-
votes =
|
|
140744
|
-
|
|
140841
|
+
votes = _context34.sent;
|
|
140842
|
+
_context34.next = 9;
|
|
140745
140843
|
break;
|
|
140746
140844
|
case 7:
|
|
140747
|
-
|
|
140748
|
-
|
|
140845
|
+
_context34.prev = 7;
|
|
140846
|
+
_context34.t0 = _context34["catch"](1);
|
|
140749
140847
|
case 9:
|
|
140750
|
-
return
|
|
140848
|
+
return _context34.abrupt("return", {
|
|
140751
140849
|
rep: rep,
|
|
140752
140850
|
votes: votes
|
|
140753
140851
|
});
|
|
140754
140852
|
case 10:
|
|
140755
140853
|
case "end":
|
|
140756
|
-
return
|
|
140854
|
+
return _context34.stop();
|
|
140757
140855
|
}
|
|
140758
|
-
},
|
|
140856
|
+
}, _callee32, null, [[1, 7]]);
|
|
140759
140857
|
}));
|
|
140760
140858
|
return function getVotes(_x4, _x5) {
|
|
140761
140859
|
return _ref6.apply(this, arguments);
|
|
140762
140860
|
};
|
|
140763
140861
|
}();
|
|
140764
140862
|
votePromises = [];
|
|
140765
|
-
_iterator13 = client_client_createForOfIteratorHelper(client_client_classPrivateFieldGet(client_reps,
|
|
140863
|
+
_iterator13 = client_client_createForOfIteratorHelper(client_client_classPrivateFieldGet(client_reps, _this27));
|
|
140766
140864
|
try {
|
|
140767
140865
|
for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {
|
|
140768
140866
|
_rep2 = _step13.value;
|
|
@@ -140773,15 +140871,15 @@ class src_client_Client {
|
|
|
140773
140871
|
} finally {
|
|
140774
140872
|
_iterator13.f();
|
|
140775
140873
|
}
|
|
140776
|
-
|
|
140874
|
+
_context36.next = 12;
|
|
140777
140875
|
return Promise.all(votePromises);
|
|
140778
140876
|
case 12:
|
|
140779
|
-
votesInfo =
|
|
140877
|
+
votesInfo = _context36.sent;
|
|
140780
140878
|
if (!(votesInfo.length === 0)) {
|
|
140781
|
-
|
|
140879
|
+
_context36.next = 15;
|
|
140782
140880
|
break;
|
|
140783
140881
|
}
|
|
140784
|
-
return
|
|
140882
|
+
return _context36.abrupt("return", null);
|
|
140785
140883
|
case 15:
|
|
140786
140884
|
/* Arrays of permanent or temporary votes from reps */
|
|
140787
140885
|
permVotes = [];
|
|
@@ -140834,64 +140932,64 @@ class src_client_Client {
|
|
|
140834
140932
|
foundVote = tempVotes[0];
|
|
140835
140933
|
}
|
|
140836
140934
|
blockHashes = foundVote.blocks;
|
|
140837
|
-
|
|
140935
|
+
_context36.next = 27;
|
|
140838
140936
|
return Promise.all(blockHashes.map(/*#__PURE__*/function () {
|
|
140839
|
-
var _ref7 = client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function
|
|
140937
|
+
var _ref7 = client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function _callee33(blockHash) {
|
|
140840
140938
|
var _iterator15, _step15, repInfo, block;
|
|
140841
|
-
return client_client_regeneratorRuntime().wrap(function
|
|
140842
|
-
while (1) switch (
|
|
140939
|
+
return client_client_regeneratorRuntime().wrap(function _callee33$(_context35) {
|
|
140940
|
+
while (1) switch (_context35.prev = _context35.next) {
|
|
140843
140941
|
case 0:
|
|
140844
|
-
_iterator15 = client_client_createForOfIteratorHelper(client_client_classPrivateFieldGet(client_reps,
|
|
140845
|
-
|
|
140942
|
+
_iterator15 = client_client_createForOfIteratorHelper(client_client_classPrivateFieldGet(client_reps, _this27));
|
|
140943
|
+
_context35.prev = 1;
|
|
140846
140944
|
_iterator15.s();
|
|
140847
140945
|
case 3:
|
|
140848
140946
|
if ((_step15 = _iterator15.n()).done) {
|
|
140849
|
-
|
|
140947
|
+
_context35.next = 12;
|
|
140850
140948
|
break;
|
|
140851
140949
|
}
|
|
140852
140950
|
repInfo = _step15.value;
|
|
140853
|
-
|
|
140854
|
-
return
|
|
140951
|
+
_context35.next = 7;
|
|
140952
|
+
return _this27.getBlock(blockHash, 'both', repInfo);
|
|
140855
140953
|
case 7:
|
|
140856
|
-
block =
|
|
140954
|
+
block = _context35.sent;
|
|
140857
140955
|
if (!(block !== null)) {
|
|
140858
|
-
|
|
140956
|
+
_context35.next = 10;
|
|
140859
140957
|
break;
|
|
140860
140958
|
}
|
|
140861
|
-
return
|
|
140959
|
+
return _context35.abrupt("return", block);
|
|
140862
140960
|
case 10:
|
|
140863
|
-
|
|
140961
|
+
_context35.next = 3;
|
|
140864
140962
|
break;
|
|
140865
140963
|
case 12:
|
|
140866
|
-
|
|
140964
|
+
_context35.next = 17;
|
|
140867
140965
|
break;
|
|
140868
140966
|
case 14:
|
|
140869
|
-
|
|
140870
|
-
|
|
140871
|
-
_iterator15.e(
|
|
140967
|
+
_context35.prev = 14;
|
|
140968
|
+
_context35.t0 = _context35["catch"](1);
|
|
140969
|
+
_iterator15.e(_context35.t0);
|
|
140872
140970
|
case 17:
|
|
140873
|
-
|
|
140971
|
+
_context35.prev = 17;
|
|
140874
140972
|
_iterator15.f();
|
|
140875
|
-
return
|
|
140973
|
+
return _context35.finish(17);
|
|
140876
140974
|
case 20:
|
|
140877
|
-
return
|
|
140975
|
+
return _context35.abrupt("return", null);
|
|
140878
140976
|
case 21:
|
|
140879
140977
|
case "end":
|
|
140880
|
-
return
|
|
140978
|
+
return _context35.stop();
|
|
140881
140979
|
}
|
|
140882
|
-
},
|
|
140980
|
+
}, _callee33, null, [[1, 14, 17, 20]]);
|
|
140883
140981
|
}));
|
|
140884
140982
|
return function (_x6) {
|
|
140885
140983
|
return _ref7.apply(this, arguments);
|
|
140886
140984
|
};
|
|
140887
140985
|
}()));
|
|
140888
140986
|
case 27:
|
|
140889
|
-
votedOnBlocksOrNull =
|
|
140987
|
+
votedOnBlocksOrNull = _context36.sent;
|
|
140890
140988
|
containsNull = votedOnBlocksOrNull.find(function (blockOrNull) {
|
|
140891
140989
|
return blockOrNull === null;
|
|
140892
140990
|
});
|
|
140893
140991
|
if (!(containsNull !== undefined)) {
|
|
140894
|
-
|
|
140992
|
+
_context36.next = 33;
|
|
140895
140993
|
break;
|
|
140896
140994
|
}
|
|
140897
140995
|
blockHashesStr = blockHashes.map(function (blockHash) {
|
|
@@ -140911,81 +141009,81 @@ class src_client_Client {
|
|
|
140911
141009
|
/*
|
|
140912
141010
|
* If additional permanent votes are needed, go get them
|
|
140913
141011
|
*/
|
|
140914
|
-
if (!(permVotes.length !== client_client_classPrivateFieldGet(client_reps,
|
|
140915
|
-
|
|
141012
|
+
if (!(permVotes.length !== client_client_classPrivateFieldGet(client_reps, _this27).length)) {
|
|
141013
|
+
_context36.next = 56;
|
|
140916
141014
|
break;
|
|
140917
141015
|
}
|
|
140918
141016
|
newTempVotes = [];
|
|
140919
|
-
if (!(tempVotes.length !== client_client_classPrivateFieldGet(client_reps,
|
|
140920
|
-
|
|
141017
|
+
if (!(tempVotes.length !== client_client_classPrivateFieldGet(client_reps, _this27).length)) {
|
|
141018
|
+
_context36.next = 46;
|
|
140921
141019
|
break;
|
|
140922
141020
|
}
|
|
140923
|
-
|
|
140924
|
-
|
|
140925
|
-
return client_client_assertClassBrand(client_Client_brand,
|
|
141021
|
+
_context36.prev = 37;
|
|
141022
|
+
_context36.next = 40;
|
|
141023
|
+
return client_client_assertClassBrand(client_Client_brand, _this27, client_requestVotes).call(_this27, votedOnBlocks, undefined, missingReps);
|
|
140926
141024
|
case 40:
|
|
140927
|
-
newTempVotes =
|
|
140928
|
-
|
|
141025
|
+
newTempVotes = _context36.sent;
|
|
141026
|
+
_context36.next = 45;
|
|
140929
141027
|
break;
|
|
140930
141028
|
case 43:
|
|
140931
|
-
|
|
140932
|
-
|
|
141029
|
+
_context36.prev = 43;
|
|
141030
|
+
_context36.t0 = _context36["catch"](37);
|
|
140933
141031
|
case 45:
|
|
140934
141032
|
tempVotes = [...tempVotes, ...newTempVotes];
|
|
140935
141033
|
case 46:
|
|
140936
|
-
missingPermReps = client_client_classPrivateFieldGet(client_reps,
|
|
140937
|
-
|
|
140938
|
-
|
|
140939
|
-
return client_client_assertClassBrand(client_Client_brand,
|
|
141034
|
+
missingPermReps = client_client_classPrivateFieldGet(client_reps, _this27).filter(rep => !permReps.includes(rep));
|
|
141035
|
+
_context36.prev = 47;
|
|
141036
|
+
_context36.next = 50;
|
|
141037
|
+
return client_client_assertClassBrand(client_Client_brand, _this27, client_requestVotes).call(_this27, votedOnBlocks, tempVotes, missingPermReps);
|
|
140940
141038
|
case 50:
|
|
140941
|
-
newPermVotes =
|
|
141039
|
+
newPermVotes = _context36.sent;
|
|
140942
141040
|
permVotes = [...permVotes, ...newPermVotes];
|
|
140943
|
-
|
|
141041
|
+
_context36.next = 56;
|
|
140944
141042
|
break;
|
|
140945
141043
|
case 54:
|
|
140946
|
-
|
|
140947
|
-
|
|
141044
|
+
_context36.prev = 54;
|
|
141045
|
+
_context36.t1 = _context36["catch"](47);
|
|
140948
141046
|
case 56:
|
|
140949
141047
|
/*
|
|
140950
141048
|
* Construct the vote staple from the recovered blocks and full set of votes
|
|
140951
141049
|
*/
|
|
140952
141050
|
voteStaple = client_src_lib.Vote.Staple.fromVotesAndBlocks(permVotes, votedOnBlocks);
|
|
140953
141051
|
if (!publish) {
|
|
140954
|
-
|
|
141052
|
+
_context36.next = 60;
|
|
140955
141053
|
break;
|
|
140956
141054
|
}
|
|
140957
|
-
|
|
140958
|
-
return
|
|
141055
|
+
_context36.next = 60;
|
|
141056
|
+
return _this27.transmitStaple(voteStaple);
|
|
140959
141057
|
case 60:
|
|
140960
|
-
return
|
|
141058
|
+
return _context36.abrupt("return", voteStaple);
|
|
140961
141059
|
case 61:
|
|
140962
141060
|
case "end":
|
|
140963
|
-
return
|
|
141061
|
+
return _context36.stop();
|
|
140964
141062
|
}
|
|
140965
|
-
},
|
|
141063
|
+
}, _callee34, null, [[37, 43], [47, 54]]);
|
|
140966
141064
|
}))();
|
|
140967
141065
|
}
|
|
140968
141066
|
|
|
140969
141067
|
/** Work in progress */
|
|
140970
141068
|
getLedgerChecksum() {
|
|
140971
|
-
var
|
|
140972
|
-
|
|
140973
|
-
return client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function
|
|
141069
|
+
var _arguments12 = arguments,
|
|
141070
|
+
_this28 = this;
|
|
141071
|
+
return client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function _callee35() {
|
|
140974
141072
|
var rep, checksumResponse;
|
|
140975
|
-
return client_client_regeneratorRuntime().wrap(function
|
|
140976
|
-
while (1) switch (
|
|
141073
|
+
return client_client_regeneratorRuntime().wrap(function _callee35$(_context37) {
|
|
141074
|
+
while (1) switch (_context37.prev = _context37.next) {
|
|
140977
141075
|
case 0:
|
|
140978
|
-
rep =
|
|
140979
|
-
|
|
140980
|
-
return client_client_assertClassBrand(client_Client_brand,
|
|
141076
|
+
rep = _arguments12.length > 0 && _arguments12[0] !== undefined ? _arguments12[0] : 'ANY';
|
|
141077
|
+
_context37.next = 3;
|
|
141078
|
+
return client_client_assertClassBrand(client_Client_brand, _this28, src_client_api).call(_this28, rep, 'GET /node/ledger/checksum');
|
|
140981
141079
|
case 3:
|
|
140982
|
-
checksumResponse =
|
|
140983
|
-
return
|
|
141080
|
+
checksumResponse = _context37.sent;
|
|
141081
|
+
return _context37.abrupt("return", checksumResponse);
|
|
140984
141082
|
case 5:
|
|
140985
141083
|
case "end":
|
|
140986
|
-
return
|
|
141084
|
+
return _context37.stop();
|
|
140987
141085
|
}
|
|
140988
|
-
},
|
|
141086
|
+
}, _callee35);
|
|
140989
141087
|
}))();
|
|
140990
141088
|
}
|
|
140991
141089
|
|
|
@@ -140995,24 +141093,24 @@ class src_client_Client {
|
|
|
140995
141093
|
* representative will be returned.
|
|
140996
141094
|
*/
|
|
140997
141095
|
getVersion() {
|
|
140998
|
-
var
|
|
140999
|
-
|
|
141000
|
-
return client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function
|
|
141096
|
+
var _arguments13 = arguments,
|
|
141097
|
+
_this29 = this;
|
|
141098
|
+
return client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function _callee36() {
|
|
141001
141099
|
var rep, version;
|
|
141002
|
-
return client_client_regeneratorRuntime().wrap(function
|
|
141003
|
-
while (1) switch (
|
|
141100
|
+
return client_client_regeneratorRuntime().wrap(function _callee36$(_context38) {
|
|
141101
|
+
while (1) switch (_context38.prev = _context38.next) {
|
|
141004
141102
|
case 0:
|
|
141005
|
-
rep =
|
|
141006
|
-
|
|
141007
|
-
return client_client_assertClassBrand(client_Client_brand,
|
|
141103
|
+
rep = _arguments13.length > 0 && _arguments13[0] !== undefined ? _arguments13[0] : 'ANY';
|
|
141104
|
+
_context38.next = 3;
|
|
141105
|
+
return client_client_assertClassBrand(client_Client_brand, _this29, src_client_api).call(_this29, rep, 'GET /node/version');
|
|
141008
141106
|
case 3:
|
|
141009
|
-
version =
|
|
141010
|
-
return
|
|
141107
|
+
version = _context38.sent;
|
|
141108
|
+
return _context38.abrupt("return", version);
|
|
141011
141109
|
case 5:
|
|
141012
141110
|
case "end":
|
|
141013
|
-
return
|
|
141111
|
+
return _context38.stop();
|
|
141014
141112
|
}
|
|
141015
|
-
},
|
|
141113
|
+
}, _callee36);
|
|
141016
141114
|
}))();
|
|
141017
141115
|
}
|
|
141018
141116
|
}
|
|
@@ -141021,7 +141119,7 @@ function client_apiRaw(_x15, _x16, _x17) {
|
|
|
141021
141119
|
return client_apiRaw2.apply(this, arguments);
|
|
141022
141120
|
}
|
|
141023
141121
|
function client_apiRaw2() {
|
|
141024
|
-
client_apiRaw2 = client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function
|
|
141122
|
+
client_apiRaw2 = client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function _callee59(rep, api, method) {
|
|
141025
141123
|
var options,
|
|
141026
141124
|
startTime,
|
|
141027
141125
|
delay,
|
|
@@ -141042,11 +141140,11 @@ function client_apiRaw2() {
|
|
|
141042
141140
|
data,
|
|
141043
141141
|
now,
|
|
141044
141142
|
error,
|
|
141045
|
-
|
|
141046
|
-
return client_client_regeneratorRuntime().wrap(function
|
|
141047
|
-
while (1) switch (
|
|
141143
|
+
_args61 = arguments;
|
|
141144
|
+
return client_client_regeneratorRuntime().wrap(function _callee59$(_context61) {
|
|
141145
|
+
while (1) switch (_context61.prev = _context61.next) {
|
|
141048
141146
|
case 0:
|
|
141049
|
-
options =
|
|
141147
|
+
options = _args61.length > 3 && _args61[3] !== undefined ? _args61[3] : {};
|
|
141050
141148
|
startTime = Date.now();
|
|
141051
141149
|
options = client_client_objectSpread({
|
|
141052
141150
|
maxRetries: 32
|
|
@@ -141055,18 +141153,18 @@ function client_apiRaw2() {
|
|
|
141055
141153
|
retry = 0;
|
|
141056
141154
|
case 5:
|
|
141057
141155
|
if (!(retry < Number.MAX_SAFE_INTEGER)) {
|
|
141058
|
-
|
|
141156
|
+
_context61.next = 83;
|
|
141059
141157
|
break;
|
|
141060
141158
|
}
|
|
141061
141159
|
if (!(rep === 'ANY')) {
|
|
141062
|
-
|
|
141160
|
+
_context61.next = 11;
|
|
141063
141161
|
break;
|
|
141064
141162
|
}
|
|
141065
141163
|
if (!(client_client_classPrivateFieldGet(client_weightOrderedReps, this).length === 0)) {
|
|
141066
|
-
|
|
141164
|
+
_context61.next = 10;
|
|
141067
141165
|
break;
|
|
141068
141166
|
}
|
|
141069
|
-
|
|
141167
|
+
_context61.next = 10;
|
|
141070
141168
|
return client_client_classPrivateFieldGet(client_updateRepsPromise, this);
|
|
141071
141169
|
case 10:
|
|
141072
141170
|
rep = (_classPrivateFieldGet5 = client_client_classPrivateFieldGet(client_weightOrderedReps, this)[0]) !== null && _classPrivateFieldGet5 !== void 0 ? _classPrivateFieldGet5 : client_client_classPrivateFieldGet(client_reps, this)[0];
|
|
@@ -141075,7 +141173,7 @@ function client_apiRaw2() {
|
|
|
141075
141173
|
fetchURL = "".concat(repURL).concat(api);
|
|
141076
141174
|
shouldFail = false;
|
|
141077
141175
|
resultThrow = undefined;
|
|
141078
|
-
|
|
141176
|
+
_context61.prev = 15;
|
|
141079
141177
|
this.stats.api.called++;
|
|
141080
141178
|
requestBody = void 0;
|
|
141081
141179
|
if (options.body !== undefined) {
|
|
@@ -141101,13 +141199,13 @@ function client_apiRaw2() {
|
|
|
141101
141199
|
fetchURL = "".concat(fetchURL, "?").concat(urlParams.toString());
|
|
141102
141200
|
}
|
|
141103
141201
|
if (!(fetchURL.length > 8192)) {
|
|
141104
|
-
|
|
141202
|
+
_context61.next = 25;
|
|
141105
141203
|
break;
|
|
141106
141204
|
}
|
|
141107
141205
|
shouldFail = true;
|
|
141108
141206
|
throw new Error('#api() URL Must not be over 8KiB');
|
|
141109
141207
|
case 25:
|
|
141110
|
-
|
|
141208
|
+
_context61.next = 27;
|
|
141111
141209
|
return client_fetch(fetchURL, {
|
|
141112
141210
|
method: method,
|
|
141113
141211
|
headers: {
|
|
@@ -141118,38 +141216,38 @@ function client_apiRaw2() {
|
|
|
141118
141216
|
* This is only used for "node-fetch"
|
|
141119
141217
|
*/
|
|
141120
141218
|
// @ts-ignore
|
|
141121
|
-
agent: client_client_classPrivateFieldGet(client_agent, this),
|
|
141219
|
+
agent: client_client_classPrivateFieldGet(client_agent, this).getAgent.bind(client_client_classPrivateFieldGet(client_agent, this)),
|
|
141122
141220
|
body: requestBody
|
|
141123
141221
|
});
|
|
141124
141222
|
case 27:
|
|
141125
|
-
response =
|
|
141223
|
+
response = _context61.sent;
|
|
141126
141224
|
if (!(response === undefined)) {
|
|
141127
|
-
|
|
141225
|
+
_context61.next = 30;
|
|
141128
141226
|
break;
|
|
141129
141227
|
}
|
|
141130
141228
|
throw new Error('Failed to publish (undefined)');
|
|
141131
141229
|
case 30:
|
|
141132
141230
|
if (response.ok) {
|
|
141133
|
-
|
|
141231
|
+
_context61.next = 55;
|
|
141134
141232
|
break;
|
|
141135
141233
|
}
|
|
141136
|
-
|
|
141137
|
-
|
|
141234
|
+
_context61.prev = 31;
|
|
141235
|
+
_context61.next = 34;
|
|
141138
141236
|
return response.json();
|
|
141139
141237
|
case 34:
|
|
141140
|
-
errorInfo =
|
|
141238
|
+
errorInfo = _context61.sent;
|
|
141141
141239
|
if (!(errorInfo.error === true)) {
|
|
141142
|
-
|
|
141240
|
+
_context61.next = 38;
|
|
141143
141241
|
break;
|
|
141144
141242
|
}
|
|
141145
141243
|
resultThrow = errorInfo;
|
|
141146
|
-
return
|
|
141244
|
+
return _context61.abrupt("break", 83);
|
|
141147
141245
|
case 38:
|
|
141148
|
-
|
|
141246
|
+
_context61.next = 42;
|
|
141149
141247
|
break;
|
|
141150
141248
|
case 40:
|
|
141151
|
-
|
|
141152
|
-
|
|
141249
|
+
_context61.prev = 40;
|
|
141250
|
+
_context61.t0 = _context61["catch"](31);
|
|
141153
141251
|
case 42:
|
|
141154
141252
|
/**
|
|
141155
141253
|
* If we get a fatal error, give up
|
|
@@ -141158,47 +141256,47 @@ function client_apiRaw2() {
|
|
|
141158
141256
|
shouldFail = true;
|
|
141159
141257
|
}
|
|
141160
141258
|
errorMessage = 'Failed to make API call (not ok)';
|
|
141161
|
-
|
|
141162
|
-
|
|
141163
|
-
|
|
141259
|
+
_context61.prev = 44;
|
|
141260
|
+
_context61.t1 = "".concat(errorMessage, ": ");
|
|
141261
|
+
_context61.next = 48;
|
|
141164
141262
|
return response.text();
|
|
141165
141263
|
case 48:
|
|
141166
|
-
|
|
141167
|
-
errorMessage =
|
|
141168
|
-
|
|
141264
|
+
_context61.t2 = _context61.sent;
|
|
141265
|
+
errorMessage = _context61.t1.concat.call(_context61.t1, _context61.t2);
|
|
141266
|
+
_context61.next = 54;
|
|
141169
141267
|
break;
|
|
141170
141268
|
case 52:
|
|
141171
|
-
|
|
141172
|
-
|
|
141269
|
+
_context61.prev = 52;
|
|
141270
|
+
_context61.t3 = _context61["catch"](44);
|
|
141173
141271
|
case 54:
|
|
141174
141272
|
throw new Error(errorMessage);
|
|
141175
141273
|
case 55:
|
|
141176
|
-
|
|
141274
|
+
_context61.next = 57;
|
|
141177
141275
|
return response.json();
|
|
141178
141276
|
case 57:
|
|
141179
|
-
data =
|
|
141277
|
+
data = _context61.sent;
|
|
141180
141278
|
if (data) {
|
|
141181
|
-
|
|
141279
|
+
_context61.next = 60;
|
|
141182
141280
|
break;
|
|
141183
141281
|
}
|
|
141184
141282
|
throw new Error('Failed to make API call (no data)');
|
|
141185
141283
|
case 60:
|
|
141186
141284
|
if (data instanceof Object) {
|
|
141187
|
-
|
|
141285
|
+
_context61.next = 62;
|
|
141188
141286
|
break;
|
|
141189
141287
|
}
|
|
141190
141288
|
throw new Error('Failed to make API call (malformed data)');
|
|
141191
141289
|
case 62:
|
|
141192
141290
|
result = data;
|
|
141193
|
-
|
|
141291
|
+
_context61.next = 79;
|
|
141194
141292
|
break;
|
|
141195
141293
|
case 65:
|
|
141196
|
-
|
|
141197
|
-
|
|
141294
|
+
_context61.prev = 65;
|
|
141295
|
+
_context61.t4 = _context61["catch"](15);
|
|
141198
141296
|
this.stats.api.failures++;
|
|
141199
141297
|
now = Date.now();
|
|
141200
141298
|
if (now - startTime > 5000) {
|
|
141201
|
-
this.logger.warn("API Request to ".concat(fetchURL, " failed. It has been failing for ").concat(now - startTime, "ms, latest error: (publish)"),
|
|
141299
|
+
this.logger.warn("API Request to ".concat(fetchURL, " failed. It has been failing for ").concat(now - startTime, "ms, latest error: (publish)"), _context61.t4, '(throw)', resultThrow);
|
|
141202
141300
|
}
|
|
141203
141301
|
if (options.maxRetries !== undefined) {
|
|
141204
141302
|
if (retry > options.maxRetries) {
|
|
@@ -141206,35 +141304,35 @@ function client_apiRaw2() {
|
|
|
141206
141304
|
}
|
|
141207
141305
|
}
|
|
141208
141306
|
if (!shouldFail) {
|
|
141209
|
-
|
|
141307
|
+
_context61.next = 74;
|
|
141210
141308
|
break;
|
|
141211
141309
|
}
|
|
141212
141310
|
if (!resultThrow) {
|
|
141213
|
-
resultThrow =
|
|
141311
|
+
resultThrow = _context61.t4;
|
|
141214
141312
|
}
|
|
141215
|
-
return
|
|
141313
|
+
return _context61.abrupt("break", 83);
|
|
141216
141314
|
case 74:
|
|
141217
141315
|
delay *= 2;
|
|
141218
141316
|
if (delay > 500) {
|
|
141219
141317
|
delay = 500;
|
|
141220
141318
|
}
|
|
141221
|
-
|
|
141319
|
+
_context61.next = 78;
|
|
141222
141320
|
return client_asleep(delay);
|
|
141223
141321
|
case 78:
|
|
141224
|
-
return
|
|
141322
|
+
return _context61.abrupt("continue", 80);
|
|
141225
141323
|
case 79:
|
|
141226
|
-
return
|
|
141324
|
+
return _context61.abrupt("break", 83);
|
|
141227
141325
|
case 80:
|
|
141228
141326
|
retry++;
|
|
141229
|
-
|
|
141327
|
+
_context61.next = 5;
|
|
141230
141328
|
break;
|
|
141231
141329
|
case 83:
|
|
141232
141330
|
if (!resultThrow) {
|
|
141233
|
-
|
|
141331
|
+
_context61.next = 91;
|
|
141234
141332
|
break;
|
|
141235
141333
|
}
|
|
141236
141334
|
if (!(resultThrow.code && resultThrow.type)) {
|
|
141237
|
-
|
|
141335
|
+
_context61.next = 90;
|
|
141238
141336
|
break;
|
|
141239
141337
|
}
|
|
141240
141338
|
error = new src_client_KeetaNetError(resultThrow.code, resultThrow.message);
|
|
@@ -141243,12 +141341,12 @@ function client_apiRaw2() {
|
|
|
141243
141341
|
case 90:
|
|
141244
141342
|
throw new Error(resultThrow.message);
|
|
141245
141343
|
case 91:
|
|
141246
|
-
return
|
|
141344
|
+
return _context61.abrupt("return", result);
|
|
141247
141345
|
case 92:
|
|
141248
141346
|
case "end":
|
|
141249
|
-
return
|
|
141347
|
+
return _context61.stop();
|
|
141250
141348
|
}
|
|
141251
|
-
},
|
|
141349
|
+
}, _callee59, this, [[15, 65], [31, 40], [44, 52]]);
|
|
141252
141350
|
}));
|
|
141253
141351
|
return client_apiRaw2.apply(this, arguments);
|
|
141254
141352
|
}
|
|
@@ -141256,16 +141354,16 @@ function src_client_api(_x18, _x19) {
|
|
|
141256
141354
|
return client_api2.apply(this, arguments);
|
|
141257
141355
|
}
|
|
141258
141356
|
function client_api2() {
|
|
141259
|
-
client_api2 = client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function
|
|
141357
|
+
client_api2 = client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function _callee60(rep, api) {
|
|
141260
141358
|
var options,
|
|
141261
141359
|
method,
|
|
141262
141360
|
path,
|
|
141263
141361
|
_key2,
|
|
141264
|
-
|
|
141265
|
-
return client_client_regeneratorRuntime().wrap(function
|
|
141266
|
-
while (1) switch (
|
|
141362
|
+
_args62 = arguments;
|
|
141363
|
+
return client_client_regeneratorRuntime().wrap(function _callee60$(_context62) {
|
|
141364
|
+
while (1) switch (_context62.prev = _context62.next) {
|
|
141267
141365
|
case 0:
|
|
141268
|
-
options =
|
|
141366
|
+
options = _args62.length > 2 && _args62[2] !== undefined ? _args62[2] : {};
|
|
141269
141367
|
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
141270
141368
|
method = api.split(' ')[0];
|
|
141271
141369
|
path = api.split(' ').slice(1).join(' ').replace('/_root', '');
|
|
@@ -141276,15 +141374,15 @@ function client_api2() {
|
|
|
141276
141374
|
}
|
|
141277
141375
|
|
|
141278
141376
|
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
141279
|
-
|
|
141377
|
+
_context62.next = 6;
|
|
141280
141378
|
return client_client_assertClassBrand(client_Client_brand, this, client_apiRaw).call(this, rep, path, method, options);
|
|
141281
141379
|
case 6:
|
|
141282
|
-
return
|
|
141380
|
+
return _context62.abrupt("return", _context62.sent);
|
|
141283
141381
|
case 7:
|
|
141284
141382
|
case "end":
|
|
141285
|
-
return
|
|
141383
|
+
return _context62.stop();
|
|
141286
141384
|
}
|
|
141287
|
-
},
|
|
141385
|
+
}, _callee60, this);
|
|
141288
141386
|
}));
|
|
141289
141387
|
return client_api2.apply(this, arguments);
|
|
141290
141388
|
}
|
|
@@ -141292,11 +141390,12 @@ function client_requestVotes(_x20, _x21) {
|
|
|
141292
141390
|
return client_requestVotes2.apply(this, arguments);
|
|
141293
141391
|
}
|
|
141294
141392
|
function client_requestVotes2() {
|
|
141295
|
-
client_requestVotes2 = client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function
|
|
141296
|
-
var
|
|
141393
|
+
client_requestVotes2 = client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function _callee62(blocks, otherVotes) {
|
|
141394
|
+
var _this51 = this;
|
|
141297
141395
|
var reps,
|
|
141298
141396
|
request,
|
|
141299
141397
|
recentVotingError,
|
|
141398
|
+
recentVotingErrorWeight,
|
|
141300
141399
|
votePromises,
|
|
141301
141400
|
_iterator21,
|
|
141302
141401
|
_step21,
|
|
@@ -141310,22 +141409,22 @@ function client_requestVotes2() {
|
|
|
141310
141409
|
voteObjectWrapper,
|
|
141311
141410
|
voteObject,
|
|
141312
141411
|
voteBin,
|
|
141313
|
-
|
|
141314
|
-
return client_client_regeneratorRuntime().wrap(function
|
|
141315
|
-
while (1) switch (
|
|
141412
|
+
_args65 = arguments;
|
|
141413
|
+
return client_client_regeneratorRuntime().wrap(function _callee62$(_context65) {
|
|
141414
|
+
while (1) switch (_context65.prev = _context65.next) {
|
|
141316
141415
|
case 0:
|
|
141317
|
-
reps =
|
|
141416
|
+
reps = _args65.length > 2 && _args65[2] !== undefined ? _args65[2] : client_client_classPrivateFieldGet(client_reps, this);
|
|
141318
141417
|
request = {
|
|
141319
141418
|
blocks: blocks.map(function (block) {
|
|
141320
141419
|
return client_client_Buffer.from(block.toBytes()).toString('base64');
|
|
141321
141420
|
})
|
|
141322
141421
|
};
|
|
141323
141422
|
if (!(otherVotes !== undefined)) {
|
|
141324
|
-
|
|
141423
|
+
_context65.next = 7;
|
|
141325
141424
|
break;
|
|
141326
141425
|
}
|
|
141327
141426
|
if (!(otherVotes.length === 0)) {
|
|
141328
|
-
|
|
141427
|
+
_context65.next = 5;
|
|
141329
141428
|
break;
|
|
141330
141429
|
}
|
|
141331
141430
|
throw new Error('requestVotes() otherVotes must not have a length of 0');
|
|
@@ -141353,142 +141452,146 @@ function client_requestVotes2() {
|
|
|
141353
141452
|
case 7:
|
|
141354
141453
|
votePromises = [];
|
|
141355
141454
|
_iterator21 = client_client_createForOfIteratorHelper(reps);
|
|
141356
|
-
|
|
141455
|
+
_context65.prev = 9;
|
|
141357
141456
|
_loop3 = /*#__PURE__*/client_client_regeneratorRuntime().mark(function _loop3() {
|
|
141358
141457
|
var rep;
|
|
141359
|
-
return client_client_regeneratorRuntime().wrap(function _loop3$(
|
|
141360
|
-
while (1) switch (
|
|
141458
|
+
return client_client_regeneratorRuntime().wrap(function _loop3$(_context64) {
|
|
141459
|
+
while (1) switch (_context64.prev = _context64.next) {
|
|
141361
141460
|
case 0:
|
|
141362
141461
|
rep = _step21.value;
|
|
141363
|
-
votePromises.push(client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function
|
|
141364
|
-
var apiResult;
|
|
141365
|
-
return client_client_regeneratorRuntime().wrap(function
|
|
141366
|
-
while (1) switch (
|
|
141462
|
+
votePromises.push(client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function _callee61() {
|
|
141463
|
+
var apiResult, _rep$weight, weight;
|
|
141464
|
+
return client_client_regeneratorRuntime().wrap(function _callee61$(_context63) {
|
|
141465
|
+
while (1) switch (_context63.prev = _context63.next) {
|
|
141367
141466
|
case 0:
|
|
141368
|
-
|
|
141369
|
-
|
|
141370
|
-
return client_client_assertClassBrand(client_Client_brand,
|
|
141467
|
+
_context63.prev = 0;
|
|
141468
|
+
_context63.next = 3;
|
|
141469
|
+
return client_client_assertClassBrand(client_Client_brand, _this51, src_client_api).call(_this51, rep, 'POST /vote/_root', {
|
|
141371
141470
|
body: request
|
|
141372
141471
|
});
|
|
141373
141472
|
case 3:
|
|
141374
|
-
apiResult =
|
|
141375
|
-
return
|
|
141473
|
+
apiResult = _context63.sent;
|
|
141474
|
+
return _context63.abrupt("return", apiResult);
|
|
141376
141475
|
case 7:
|
|
141377
|
-
|
|
141378
|
-
|
|
141476
|
+
_context63.prev = 7;
|
|
141477
|
+
_context63.t0 = _context63["catch"](0);
|
|
141379
141478
|
if (!(otherVotes !== undefined)) {
|
|
141380
|
-
|
|
141479
|
+
_context63.next = 11;
|
|
141381
141480
|
break;
|
|
141382
141481
|
}
|
|
141383
|
-
throw
|
|
141482
|
+
throw _context63.t0;
|
|
141384
141483
|
case 11:
|
|
141385
|
-
|
|
141386
|
-
|
|
141387
|
-
|
|
141484
|
+
weight = (_rep$weight = rep.weight) !== null && _rep$weight !== void 0 ? _rep$weight : BigInt(0);
|
|
141485
|
+
if (recentVotingErrorWeight === undefined || weight > recentVotingErrorWeight) {
|
|
141486
|
+
recentVotingError = _context63.t0;
|
|
141487
|
+
recentVotingErrorWeight = weight;
|
|
141488
|
+
}
|
|
141388
141489
|
case 13:
|
|
141490
|
+
return _context63.abrupt("return", undefined);
|
|
141491
|
+
case 14:
|
|
141389
141492
|
case "end":
|
|
141390
|
-
return
|
|
141493
|
+
return _context63.stop();
|
|
141391
141494
|
}
|
|
141392
|
-
},
|
|
141495
|
+
}, _callee61, null, [[0, 7]]);
|
|
141393
141496
|
}))());
|
|
141394
141497
|
case 2:
|
|
141395
141498
|
case "end":
|
|
141396
|
-
return
|
|
141499
|
+
return _context64.stop();
|
|
141397
141500
|
}
|
|
141398
141501
|
}, _loop3);
|
|
141399
141502
|
});
|
|
141400
141503
|
_iterator21.s();
|
|
141401
141504
|
case 12:
|
|
141402
141505
|
if ((_step21 = _iterator21.n()).done) {
|
|
141403
|
-
|
|
141506
|
+
_context65.next = 16;
|
|
141404
141507
|
break;
|
|
141405
141508
|
}
|
|
141406
|
-
return
|
|
141509
|
+
return _context65.delegateYield(_loop3(), "t0", 14);
|
|
141407
141510
|
case 14:
|
|
141408
|
-
|
|
141511
|
+
_context65.next = 12;
|
|
141409
141512
|
break;
|
|
141410
141513
|
case 16:
|
|
141411
|
-
|
|
141514
|
+
_context65.next = 21;
|
|
141412
141515
|
break;
|
|
141413
141516
|
case 18:
|
|
141414
|
-
|
|
141415
|
-
|
|
141416
|
-
_iterator21.e(
|
|
141517
|
+
_context65.prev = 18;
|
|
141518
|
+
_context65.t1 = _context65["catch"](9);
|
|
141519
|
+
_iterator21.e(_context65.t1);
|
|
141417
141520
|
case 21:
|
|
141418
|
-
|
|
141521
|
+
_context65.prev = 21;
|
|
141419
141522
|
_iterator21.f();
|
|
141420
|
-
return
|
|
141523
|
+
return _context65.finish(21);
|
|
141421
141524
|
case 24:
|
|
141422
|
-
|
|
141525
|
+
_context65.next = 26;
|
|
141423
141526
|
return Promise.allSettled(votePromises);
|
|
141424
141527
|
case 26:
|
|
141425
|
-
votesObjects =
|
|
141528
|
+
votesObjects = _context65.sent;
|
|
141426
141529
|
retval = [];
|
|
141427
141530
|
_iterator22 = client_client_createForOfIteratorHelper(votesObjects);
|
|
141428
|
-
|
|
141531
|
+
_context65.prev = 29;
|
|
141429
141532
|
_iterator22.s();
|
|
141430
141533
|
case 31:
|
|
141431
141534
|
if ((_step22 = _iterator22.n()).done) {
|
|
141432
|
-
|
|
141535
|
+
_context65.next = 44;
|
|
141433
141536
|
break;
|
|
141434
141537
|
}
|
|
141435
141538
|
voteObjectWrapperSettled = _step22.value;
|
|
141436
141539
|
if (!(voteObjectWrapperSettled.status === 'rejected')) {
|
|
141437
|
-
|
|
141540
|
+
_context65.next = 36;
|
|
141438
141541
|
break;
|
|
141439
141542
|
}
|
|
141440
141543
|
voteSettlementError = voteObjectWrapperSettled.reason;
|
|
141441
|
-
return
|
|
141544
|
+
return _context65.abrupt("continue", 42);
|
|
141442
141545
|
case 36:
|
|
141443
141546
|
voteObjectWrapper = voteObjectWrapperSettled.value;
|
|
141444
141547
|
if (!(voteObjectWrapper === undefined)) {
|
|
141445
|
-
|
|
141548
|
+
_context65.next = 39;
|
|
141446
141549
|
break;
|
|
141447
141550
|
}
|
|
141448
|
-
return
|
|
141551
|
+
return _context65.abrupt("continue", 42);
|
|
141449
141552
|
case 39:
|
|
141450
141553
|
voteObject = voteObjectWrapper['vote'];
|
|
141451
141554
|
voteBin = client_client_Buffer.from(voteObject['$binary'], 'base64');
|
|
141452
141555
|
retval.push(new client_src_lib.Vote(voteBin));
|
|
141453
141556
|
case 42:
|
|
141454
|
-
|
|
141557
|
+
_context65.next = 31;
|
|
141455
141558
|
break;
|
|
141456
141559
|
case 44:
|
|
141457
|
-
|
|
141560
|
+
_context65.next = 49;
|
|
141458
141561
|
break;
|
|
141459
141562
|
case 46:
|
|
141460
|
-
|
|
141461
|
-
|
|
141462
|
-
_iterator22.e(
|
|
141563
|
+
_context65.prev = 46;
|
|
141564
|
+
_context65.t2 = _context65["catch"](29);
|
|
141565
|
+
_iterator22.e(_context65.t2);
|
|
141463
141566
|
case 49:
|
|
141464
|
-
|
|
141567
|
+
_context65.prev = 49;
|
|
141465
141568
|
_iterator22.f();
|
|
141466
|
-
return
|
|
141569
|
+
return _context65.finish(49);
|
|
141467
141570
|
case 52:
|
|
141468
141571
|
if (!(retval.length === 0 && recentVotingError !== undefined)) {
|
|
141469
|
-
|
|
141572
|
+
_context65.next = 62;
|
|
141470
141573
|
break;
|
|
141471
141574
|
}
|
|
141472
141575
|
if (!(recentVotingError !== undefined)) {
|
|
141473
|
-
|
|
141576
|
+
_context65.next = 57;
|
|
141474
141577
|
break;
|
|
141475
141578
|
}
|
|
141476
141579
|
throw recentVotingError;
|
|
141477
141580
|
case 57:
|
|
141478
141581
|
if (!(voteSettlementError !== undefined)) {
|
|
141479
|
-
|
|
141582
|
+
_context65.next = 61;
|
|
141480
141583
|
break;
|
|
141481
141584
|
}
|
|
141482
141585
|
throw voteSettlementError;
|
|
141483
141586
|
case 61:
|
|
141484
141587
|
throw new Error('Unknown error requesting all votes');
|
|
141485
141588
|
case 62:
|
|
141486
|
-
return
|
|
141589
|
+
return _context65.abrupt("return", retval);
|
|
141487
141590
|
case 63:
|
|
141488
141591
|
case "end":
|
|
141489
|
-
return
|
|
141592
|
+
return _context65.stop();
|
|
141490
141593
|
}
|
|
141491
|
-
},
|
|
141594
|
+
}, _callee62, this, [[9, 18, 21, 24], [29, 46, 49, 52]]);
|
|
141492
141595
|
}));
|
|
141493
141596
|
return client_requestVotes2.apply(this, arguments);
|
|
141494
141597
|
}
|
|
@@ -141496,24 +141599,24 @@ function client_getVotes(_x22) {
|
|
|
141496
141599
|
return client_getVotes2.apply(this, arguments);
|
|
141497
141600
|
}
|
|
141498
141601
|
function client_getVotes2() {
|
|
141499
|
-
client_getVotes2 = client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function
|
|
141602
|
+
client_getVotes2 = client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function _callee63(blockhash) {
|
|
141500
141603
|
var side,
|
|
141501
141604
|
rep,
|
|
141502
141605
|
query,
|
|
141503
141606
|
votesInfo,
|
|
141504
141607
|
votesJSON,
|
|
141505
141608
|
votes,
|
|
141506
|
-
|
|
141507
|
-
return client_client_regeneratorRuntime().wrap(function
|
|
141508
|
-
while (1) switch (
|
|
141609
|
+
_args66 = arguments;
|
|
141610
|
+
return client_client_regeneratorRuntime().wrap(function _callee63$(_context66) {
|
|
141611
|
+
while (1) switch (_context66.prev = _context66.next) {
|
|
141509
141612
|
case 0:
|
|
141510
|
-
side =
|
|
141511
|
-
rep =
|
|
141613
|
+
side = _args66.length > 1 && _args66[1] !== undefined ? _args66[1] : 'main';
|
|
141614
|
+
rep = _args66.length > 2 && _args66[2] !== undefined ? _args66[2] : 'ANY';
|
|
141512
141615
|
query = {
|
|
141513
141616
|
side: client_assertLedgerStorage(side)
|
|
141514
141617
|
};
|
|
141515
141618
|
if (!(blockhash === null || blockhash === undefined)) {
|
|
141516
|
-
|
|
141619
|
+
_context66.next = 5;
|
|
141517
141620
|
break;
|
|
141518
141621
|
}
|
|
141519
141622
|
throw new Error('"blockhash" must be a string or BlockHash');
|
|
@@ -141525,7 +141628,7 @@ function client_getVotes2() {
|
|
|
141525
141628
|
/**
|
|
141526
141629
|
* Get all the vote information for a given block
|
|
141527
141630
|
*/
|
|
141528
|
-
|
|
141631
|
+
_context66.next = 8;
|
|
141529
141632
|
return client_client_assertClassBrand(client_Client_brand, this, src_client_api).call(this, rep, 'GET /vote/:blockhash', {
|
|
141530
141633
|
queryParams: query,
|
|
141531
141634
|
args: {
|
|
@@ -141533,9 +141636,9 @@ function client_getVotes2() {
|
|
|
141533
141636
|
}
|
|
141534
141637
|
});
|
|
141535
141638
|
case 8:
|
|
141536
|
-
votesInfo =
|
|
141639
|
+
votesInfo = _context66.sent;
|
|
141537
141640
|
if (!(votesInfo.blockhash === null)) {
|
|
141538
|
-
|
|
141641
|
+
_context66.next = 11;
|
|
141539
141642
|
break;
|
|
141540
141643
|
}
|
|
141541
141644
|
throw new Error('Vote Response Is Malformed');
|
|
@@ -141545,10 +141648,10 @@ function client_getVotes2() {
|
|
|
141545
141648
|
*/
|
|
141546
141649
|
votesJSON = votesInfo.votes;
|
|
141547
141650
|
if (!(votesJSON === null)) {
|
|
141548
|
-
|
|
141651
|
+
_context66.next = 14;
|
|
141549
141652
|
break;
|
|
141550
141653
|
}
|
|
141551
|
-
return
|
|
141654
|
+
return _context66.abrupt("return", null);
|
|
141552
141655
|
case 14:
|
|
141553
141656
|
/**
|
|
141554
141657
|
* Construct a Vote object from every vote
|
|
@@ -141562,41 +141665,41 @@ function client_getVotes2() {
|
|
|
141562
141665
|
* If there are no votes return null
|
|
141563
141666
|
*/
|
|
141564
141667
|
if (!(votes.length === 0)) {
|
|
141565
|
-
|
|
141668
|
+
_context66.next = 17;
|
|
141566
141669
|
break;
|
|
141567
141670
|
}
|
|
141568
|
-
return
|
|
141671
|
+
return _context66.abrupt("return", null);
|
|
141569
141672
|
case 17:
|
|
141570
|
-
return
|
|
141673
|
+
return _context66.abrupt("return", votes);
|
|
141571
141674
|
case 18:
|
|
141572
141675
|
case "end":
|
|
141573
|
-
return
|
|
141676
|
+
return _context66.stop();
|
|
141574
141677
|
}
|
|
141575
|
-
},
|
|
141678
|
+
}, _callee63, this);
|
|
141576
141679
|
}));
|
|
141577
141680
|
return client_getVotes2.apply(this, arguments);
|
|
141578
141681
|
}
|
|
141579
141682
|
function client_getBuilderRenderOptions(network) {
|
|
141580
|
-
var
|
|
141683
|
+
var _this49 = this;
|
|
141581
141684
|
return {
|
|
141582
141685
|
network,
|
|
141583
141686
|
getPrevious: function () {
|
|
141584
|
-
var _getPrevious = client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function
|
|
141585
|
-
var _yield$
|
|
141586
|
-
return client_client_regeneratorRuntime().wrap(function
|
|
141587
|
-
while (1) switch (
|
|
141687
|
+
var _getPrevious = client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function _callee55(acct) {
|
|
141688
|
+
var _yield$_this49$getAcc, currentHeadBlock;
|
|
141689
|
+
return client_client_regeneratorRuntime().wrap(function _callee55$(_context57) {
|
|
141690
|
+
while (1) switch (_context57.prev = _context57.next) {
|
|
141588
141691
|
case 0:
|
|
141589
|
-
|
|
141590
|
-
return
|
|
141692
|
+
_context57.next = 2;
|
|
141693
|
+
return _this49.getAccountInfo(acct);
|
|
141591
141694
|
case 2:
|
|
141592
|
-
_yield$
|
|
141593
|
-
currentHeadBlock = _yield$
|
|
141594
|
-
return
|
|
141695
|
+
_yield$_this49$getAcc = _context57.sent;
|
|
141696
|
+
currentHeadBlock = _yield$_this49$getAcc.currentHeadBlock;
|
|
141697
|
+
return _context57.abrupt("return", currentHeadBlock);
|
|
141595
141698
|
case 5:
|
|
141596
141699
|
case "end":
|
|
141597
|
-
return
|
|
141700
|
+
return _context57.stop();
|
|
141598
141701
|
}
|
|
141599
|
-
},
|
|
141702
|
+
}, _callee55);
|
|
141600
141703
|
}));
|
|
141601
141704
|
function getPrevious(_x23) {
|
|
141602
141705
|
return _getPrevious.apply(this, arguments);
|
|
@@ -141693,6 +141796,7 @@ client_src_client_defineProperty(src_client_Client, "Config", client_config_name
|
|
|
141693
141796
|
* by the application.
|
|
141694
141797
|
*/
|
|
141695
141798
|
client_src_client_defineProperty(src_client_Client, "DefaultLogger", console);
|
|
141799
|
+
client_src_client_defineProperty(src_client_Client, "updateRepsInterval", 5 * 60 * 1000);
|
|
141696
141800
|
client_src_client_defineProperty(src_client_Client, "isInstance", client_checkableGenerator(client_Client));
|
|
141697
141801
|
// Type guard function to check if a string is a valid UserClientEventName
|
|
141698
141802
|
function client_isUserClientEventName(eventName) {
|
|
@@ -141951,45 +142055,45 @@ class src_client_UserClient {
|
|
|
141951
142055
|
* @returns The vote staple that was generated and whether it was able to be published
|
|
141952
142056
|
*/
|
|
141953
142057
|
initializeNetwork(initOpts) {
|
|
141954
|
-
var
|
|
141955
|
-
|
|
141956
|
-
return client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function
|
|
142058
|
+
var _arguments14 = arguments,
|
|
142059
|
+
_this31 = this;
|
|
142060
|
+
return client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function _callee37() {
|
|
141957
142061
|
var options, _initOpts$delegateTo, delegateTo, addSupplyAmount, _initOpts$voteSerial, voteSerial, _yield$generateInitia, voteStaple;
|
|
141958
|
-
return client_client_regeneratorRuntime().wrap(function
|
|
141959
|
-
while (1) switch (
|
|
142062
|
+
return client_client_regeneratorRuntime().wrap(function _callee37$(_context39) {
|
|
142063
|
+
while (1) switch (_context39.prev = _context39.next) {
|
|
141960
142064
|
case 0:
|
|
141961
|
-
options =
|
|
141962
|
-
_initOpts$delegateTo = initOpts.delegateTo, delegateTo = _initOpts$delegateTo === void 0 ?
|
|
141963
|
-
if (!(
|
|
141964
|
-
|
|
142065
|
+
options = _arguments14.length > 1 && _arguments14[1] !== undefined ? _arguments14[1] : {};
|
|
142066
|
+
_initOpts$delegateTo = initOpts.delegateTo, delegateTo = _initOpts$delegateTo === void 0 ? _this31.client.representatives[0].key : _initOpts$delegateTo, addSupplyAmount = initOpts.addSupplyAmount, _initOpts$voteSerial = initOpts.voteSerial, voteSerial = _initOpts$voteSerial === void 0 ? BigInt(0) : _initOpts$voteSerial;
|
|
142067
|
+
if (!(_this31.signer === null)) {
|
|
142068
|
+
_context39.next = 4;
|
|
141965
142069
|
break;
|
|
141966
142070
|
}
|
|
141967
142071
|
throw new Error('May not initialize chain with a read-only UserClient (signer is null)');
|
|
141968
142072
|
case 4:
|
|
141969
|
-
|
|
142073
|
+
_context39.next = 6;
|
|
141970
142074
|
return client_generateInitialVoteStaple({
|
|
141971
|
-
network:
|
|
141972
|
-
initialTrustedAccount:
|
|
142075
|
+
network: _this31.network,
|
|
142076
|
+
initialTrustedAccount: _this31.signer,
|
|
141973
142077
|
voteSerial: voteSerial,
|
|
141974
142078
|
addSupply: {
|
|
141975
142079
|
delegate: true,
|
|
141976
142080
|
delegateTo: delegateTo,
|
|
141977
|
-
recipient: client_client_assertClassBrand(client_UserClient_brand,
|
|
142081
|
+
recipient: client_client_assertClassBrand(client_UserClient_brand, _this31, client_getAccount).call(_this31, options).assertAccount(),
|
|
141978
142082
|
amount: addSupplyAmount
|
|
141979
142083
|
}
|
|
141980
142084
|
});
|
|
141981
142085
|
case 6:
|
|
141982
|
-
_yield$generateInitia =
|
|
142086
|
+
_yield$generateInitia = _context39.sent;
|
|
141983
142087
|
voteStaple = _yield$generateInitia.voteStaple;
|
|
141984
|
-
|
|
141985
|
-
return
|
|
142088
|
+
_context39.next = 10;
|
|
142089
|
+
return _this31.client.transmitStaple(voteStaple);
|
|
141986
142090
|
case 10:
|
|
141987
|
-
return
|
|
142091
|
+
return _context39.abrupt("return", _context39.sent);
|
|
141988
142092
|
case 11:
|
|
141989
142093
|
case "end":
|
|
141990
|
-
return
|
|
142094
|
+
return _context39.stop();
|
|
141991
142095
|
}
|
|
141992
|
-
},
|
|
142096
|
+
}, _callee37);
|
|
141993
142097
|
}))();
|
|
141994
142098
|
}
|
|
141995
142099
|
|
|
@@ -142007,15 +142111,15 @@ class src_client_UserClient {
|
|
|
142007
142111
|
* @return The vote staple that was generated and whether it was able to be published
|
|
142008
142112
|
*/
|
|
142009
142113
|
modTokenSupplyAndBalance(amount, token) {
|
|
142010
|
-
var
|
|
142011
|
-
|
|
142012
|
-
return client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function
|
|
142114
|
+
var _arguments15 = arguments,
|
|
142115
|
+
_this32 = this;
|
|
142116
|
+
return client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function _callee38() {
|
|
142013
142117
|
var options, builder, negative, retval;
|
|
142014
|
-
return client_client_regeneratorRuntime().wrap(function
|
|
142015
|
-
while (1) switch (
|
|
142118
|
+
return client_client_regeneratorRuntime().wrap(function _callee38$(_context40) {
|
|
142119
|
+
while (1) switch (_context40.prev = _context40.next) {
|
|
142016
142120
|
case 0:
|
|
142017
|
-
options =
|
|
142018
|
-
builder =
|
|
142121
|
+
options = _arguments15.length > 2 && _arguments15[2] !== undefined ? _arguments15[2] : {};
|
|
142122
|
+
builder = _this32.initBuilder(options); // If amount is negative then reduce account balance before modifying token supply otherwise increase in reverse order
|
|
142019
142123
|
negative = amount < BigInt(0);
|
|
142020
142124
|
if (negative) {
|
|
142021
142125
|
builder.modifyTokenBalance(token, amount, false, {
|
|
@@ -142030,16 +142134,16 @@ class src_client_UserClient {
|
|
|
142030
142134
|
account: options.account
|
|
142031
142135
|
});
|
|
142032
142136
|
}
|
|
142033
|
-
|
|
142034
|
-
return
|
|
142137
|
+
_context40.next = 8;
|
|
142138
|
+
return _this32.publishBuilder(builder);
|
|
142035
142139
|
case 8:
|
|
142036
|
-
retval =
|
|
142037
|
-
return
|
|
142140
|
+
retval = _context40.sent;
|
|
142141
|
+
return _context40.abrupt("return", retval);
|
|
142038
142142
|
case 10:
|
|
142039
142143
|
case "end":
|
|
142040
|
-
return
|
|
142144
|
+
return _context40.stop();
|
|
142041
142145
|
}
|
|
142042
|
-
},
|
|
142146
|
+
}, _callee38);
|
|
142043
142147
|
}))();
|
|
142044
142148
|
}
|
|
142045
142149
|
|
|
@@ -142088,20 +142192,20 @@ class src_client_UserClient {
|
|
|
142088
142192
|
* @deprecated Use {@link UserClientBuilder.computeBlocks} instead
|
|
142089
142193
|
*/
|
|
142090
142194
|
computeBuilderBlocks(builder) {
|
|
142091
|
-
var
|
|
142092
|
-
return client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function
|
|
142093
|
-
return client_client_regeneratorRuntime().wrap(function
|
|
142094
|
-
while (1) switch (
|
|
142195
|
+
var _this33 = this;
|
|
142196
|
+
return client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function _callee39() {
|
|
142197
|
+
return client_client_regeneratorRuntime().wrap(function _callee39$(_context41) {
|
|
142198
|
+
while (1) switch (_context41.prev = _context41.next) {
|
|
142095
142199
|
case 0:
|
|
142096
|
-
|
|
142097
|
-
return client_client_classPrivateFieldGet(client_client,
|
|
142200
|
+
_context41.next = 2;
|
|
142201
|
+
return client_client_classPrivateFieldGet(client_client, _this33).computeBuilderBlocks(_this33.network, builder);
|
|
142098
142202
|
case 2:
|
|
142099
|
-
return
|
|
142203
|
+
return _context41.abrupt("return", _context41.sent);
|
|
142100
142204
|
case 3:
|
|
142101
142205
|
case "end":
|
|
142102
|
-
return
|
|
142206
|
+
return _context41.stop();
|
|
142103
142207
|
}
|
|
142104
|
-
},
|
|
142208
|
+
}, _callee39);
|
|
142105
142209
|
}))();
|
|
142106
142210
|
}
|
|
142107
142211
|
|
|
@@ -142118,38 +142222,38 @@ class src_client_UserClient {
|
|
|
142118
142222
|
* @return The vote staple that was generated and whether it was able to be published
|
|
142119
142223
|
*/
|
|
142120
142224
|
publishBuilder(builder) {
|
|
142121
|
-
var
|
|
142122
|
-
return client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function
|
|
142225
|
+
var _this34 = this;
|
|
142226
|
+
return client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function _callee40() {
|
|
142123
142227
|
var retval;
|
|
142124
|
-
return client_client_regeneratorRuntime().wrap(function
|
|
142125
|
-
while (1) switch (
|
|
142228
|
+
return client_client_regeneratorRuntime().wrap(function _callee40$(_context42) {
|
|
142229
|
+
while (1) switch (_context42.prev = _context42.next) {
|
|
142126
142230
|
case 0:
|
|
142127
|
-
if (client_client_classPrivateFieldGet(client_client_config,
|
|
142128
|
-
|
|
142231
|
+
if (client_client_classPrivateFieldGet(client_client_config, _this34).usePublishAid) {
|
|
142232
|
+
_context42.next = 4;
|
|
142129
142233
|
break;
|
|
142130
142234
|
}
|
|
142131
|
-
|
|
142132
|
-
return client_client_classPrivateFieldGet(client_client,
|
|
142235
|
+
_context42.next = 3;
|
|
142236
|
+
return client_client_classPrivateFieldGet(client_client, _this34).transmit(builder, _this34.network);
|
|
142133
142237
|
case 3:
|
|
142134
|
-
return
|
|
142238
|
+
return _context42.abrupt("return", _context42.sent);
|
|
142135
142239
|
case 4:
|
|
142136
|
-
|
|
142137
|
-
return client_client_classPrivateFieldGet(client_client,
|
|
142240
|
+
_context42.next = 6;
|
|
142241
|
+
return client_client_classPrivateFieldGet(client_client, _this34).computeBuilderBlocks(_this34.network, builder);
|
|
142138
142242
|
case 6:
|
|
142139
|
-
|
|
142140
|
-
return client_client_assertClassBrand(client_UserClient_brand,
|
|
142243
|
+
_context42.next = 8;
|
|
142244
|
+
return client_client_assertClassBrand(client_UserClient_brand, _this34, client_publishWithPublishAid).call(_this34, builder.blocks);
|
|
142141
142245
|
case 8:
|
|
142142
|
-
retval =
|
|
142143
|
-
return
|
|
142246
|
+
retval = _context42.sent;
|
|
142247
|
+
return _context42.abrupt("return", {
|
|
142144
142248
|
blocks: builder.blocks,
|
|
142145
142249
|
publish: retval.publish,
|
|
142146
142250
|
from: 'publish-aid'
|
|
142147
142251
|
});
|
|
142148
142252
|
case 10:
|
|
142149
142253
|
case "end":
|
|
142150
|
-
return
|
|
142254
|
+
return _context42.stop();
|
|
142151
142255
|
}
|
|
142152
|
-
},
|
|
142256
|
+
}, _callee40);
|
|
142153
142257
|
}))();
|
|
142154
142258
|
}
|
|
142155
142259
|
|
|
@@ -142162,25 +142266,25 @@ class src_client_UserClient {
|
|
|
142162
142266
|
* @return The vote staple that was generated and whether it was able to be published
|
|
142163
142267
|
*/
|
|
142164
142268
|
setInfo(info) {
|
|
142165
|
-
var
|
|
142166
|
-
|
|
142167
|
-
return client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function
|
|
142269
|
+
var _arguments16 = arguments,
|
|
142270
|
+
_this35 = this;
|
|
142271
|
+
return client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function _callee41() {
|
|
142168
142272
|
var options, builder;
|
|
142169
|
-
return client_client_regeneratorRuntime().wrap(function
|
|
142170
|
-
while (1) switch (
|
|
142273
|
+
return client_client_regeneratorRuntime().wrap(function _callee41$(_context43) {
|
|
142274
|
+
while (1) switch (_context43.prev = _context43.next) {
|
|
142171
142275
|
case 0:
|
|
142172
|
-
options =
|
|
142173
|
-
builder =
|
|
142276
|
+
options = _arguments16.length > 1 && _arguments16[1] !== undefined ? _arguments16[1] : {};
|
|
142277
|
+
builder = _this35.initBuilder(options);
|
|
142174
142278
|
builder.setInfo(info);
|
|
142175
|
-
|
|
142176
|
-
return
|
|
142279
|
+
_context43.next = 5;
|
|
142280
|
+
return _this35.publishBuilder(builder);
|
|
142177
142281
|
case 5:
|
|
142178
|
-
return
|
|
142282
|
+
return _context43.abrupt("return", _context43.sent);
|
|
142179
142283
|
case 6:
|
|
142180
142284
|
case "end":
|
|
142181
|
-
return
|
|
142285
|
+
return _context43.stop();
|
|
142182
142286
|
}
|
|
142183
|
-
},
|
|
142287
|
+
}, _callee41);
|
|
142184
142288
|
}))();
|
|
142185
142289
|
}
|
|
142186
142290
|
|
|
@@ -142196,62 +142300,63 @@ class src_client_UserClient {
|
|
|
142196
142300
|
* @param token The token to send
|
|
142197
142301
|
* @param external The external identifier to use for the transaction
|
|
142198
142302
|
* @param options The options to use for the request
|
|
142199
|
-
* @param retries The number of times
|
|
142303
|
+
* @param retries The number of times the request has been retried
|
|
142200
142304
|
* @return The vote staple that was generated and whether it was able to be published
|
|
142201
142305
|
*/
|
|
142202
142306
|
send(to, amount, token, external) {
|
|
142203
|
-
var
|
|
142204
|
-
|
|
142205
|
-
return client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function
|
|
142307
|
+
var _arguments17 = arguments,
|
|
142308
|
+
_this36 = this;
|
|
142309
|
+
return client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function _callee42() {
|
|
142206
142310
|
var options, retries, builder, error, staple;
|
|
142207
|
-
return client_client_regeneratorRuntime().wrap(function
|
|
142208
|
-
while (1) switch (
|
|
142311
|
+
return client_client_regeneratorRuntime().wrap(function _callee42$(_context44) {
|
|
142312
|
+
while (1) switch (_context44.prev = _context44.next) {
|
|
142209
142313
|
case 0:
|
|
142210
|
-
options =
|
|
142211
|
-
retries =
|
|
142212
|
-
|
|
142213
|
-
builder =
|
|
142314
|
+
options = _arguments17.length > 4 && _arguments17[4] !== undefined ? _arguments17[4] : {};
|
|
142315
|
+
retries = _arguments17.length > 5 && _arguments17[5] !== undefined ? _arguments17[5] : 0;
|
|
142316
|
+
_context44.prev = 2;
|
|
142317
|
+
builder = _this36.initBuilder(options);
|
|
142214
142318
|
builder.send(client_lib_account.toAccount(to), BigInt(amount), client_lib_account.toAccount(token), external);
|
|
142215
|
-
|
|
142216
|
-
return
|
|
142319
|
+
_context44.next = 7;
|
|
142320
|
+
return _this36.publishBuilder(builder);
|
|
142217
142321
|
case 7:
|
|
142218
|
-
|
|
142219
|
-
|
|
142220
|
-
|
|
142221
|
-
|
|
142222
|
-
_context43.t0 = _context43["catch"](2);
|
|
142322
|
+
return _context44.abrupt("return", _context44.sent);
|
|
142323
|
+
case 10:
|
|
142324
|
+
_context44.prev = 10;
|
|
142325
|
+
_context44.t0 = _context44["catch"](2);
|
|
142223
142326
|
error = true;
|
|
142224
142327
|
if (!(retries < 2)) {
|
|
142225
|
-
|
|
142328
|
+
_context44.next = 23;
|
|
142226
142329
|
break;
|
|
142227
142330
|
}
|
|
142228
|
-
if (!(src_client_KeetaNetError.isInstance(
|
|
142229
|
-
|
|
142331
|
+
if (!(src_client_KeetaNetError.isInstance(_context44.t0) && _context44.t0.code === 'LEDGER_SUCCESSOR_VOTE_EXISTS')) {
|
|
142332
|
+
_context44.next = 23;
|
|
142230
142333
|
break;
|
|
142231
142334
|
}
|
|
142232
|
-
|
|
142233
|
-
return
|
|
142234
|
-
case
|
|
142235
|
-
staple =
|
|
142335
|
+
_context44.next = 17;
|
|
142336
|
+
return _this36.recover(true, options);
|
|
142337
|
+
case 17:
|
|
142338
|
+
staple = _context44.sent;
|
|
142236
142339
|
if (!staple) {
|
|
142237
|
-
|
|
142340
|
+
_context44.next = 23;
|
|
142238
142341
|
break;
|
|
142239
142342
|
}
|
|
142240
|
-
|
|
142241
|
-
return
|
|
142242
|
-
case 20:
|
|
142243
|
-
error = false;
|
|
142343
|
+
_context44.next = 21;
|
|
142344
|
+
return _this36.send(to, amount, token, external, options, retries + 1);
|
|
142244
142345
|
case 21:
|
|
142346
|
+
return _context44.abrupt("return", _context44.sent);
|
|
142347
|
+
case 23:
|
|
142245
142348
|
if (!error) {
|
|
142246
|
-
|
|
142349
|
+
_context44.next = 25;
|
|
142247
142350
|
break;
|
|
142248
142351
|
}
|
|
142249
|
-
throw
|
|
142250
|
-
case
|
|
142352
|
+
throw _context44.t0;
|
|
142353
|
+
case 25:
|
|
142354
|
+
throw new Error('Unreachable code reached in UserClient.send');
|
|
142355
|
+
case 26:
|
|
142251
142356
|
case "end":
|
|
142252
|
-
return
|
|
142357
|
+
return _context44.stop();
|
|
142253
142358
|
}
|
|
142254
|
-
},
|
|
142359
|
+
}, _callee42, null, [[2, 10]]);
|
|
142255
142360
|
}))();
|
|
142256
142361
|
}
|
|
142257
142362
|
|
|
@@ -142263,25 +142368,25 @@ class src_client_UserClient {
|
|
|
142263
142368
|
* @return The identifier that was generated
|
|
142264
142369
|
*/
|
|
142265
142370
|
generateIdentifier(type) {
|
|
142266
|
-
var
|
|
142267
|
-
|
|
142268
|
-
return client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function
|
|
142371
|
+
var _arguments18 = arguments,
|
|
142372
|
+
_this37 = this;
|
|
142373
|
+
return client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function _callee43() {
|
|
142269
142374
|
var options, builder, generated;
|
|
142270
|
-
return client_client_regeneratorRuntime().wrap(function
|
|
142271
|
-
while (1) switch (
|
|
142375
|
+
return client_client_regeneratorRuntime().wrap(function _callee43$(_context45) {
|
|
142376
|
+
while (1) switch (_context45.prev = _context45.next) {
|
|
142272
142377
|
case 0:
|
|
142273
|
-
options =
|
|
142274
|
-
builder =
|
|
142378
|
+
options = _arguments18.length > 1 && _arguments18[1] !== undefined ? _arguments18[1] : {};
|
|
142379
|
+
builder = _this37.initBuilder(options);
|
|
142275
142380
|
generated = builder.generateIdentifier(type);
|
|
142276
|
-
|
|
142277
|
-
return
|
|
142381
|
+
_context45.next = 5;
|
|
142382
|
+
return _this37.publishBuilder(builder);
|
|
142278
142383
|
case 5:
|
|
142279
|
-
return
|
|
142384
|
+
return _context45.abrupt("return", generated);
|
|
142280
142385
|
case 6:
|
|
142281
142386
|
case "end":
|
|
142282
|
-
return
|
|
142387
|
+
return _context45.stop();
|
|
142283
142388
|
}
|
|
142284
|
-
},
|
|
142389
|
+
}, _callee43);
|
|
142285
142390
|
}))();
|
|
142286
142391
|
}
|
|
142287
142392
|
|
|
@@ -142297,25 +142402,25 @@ class src_client_UserClient {
|
|
|
142297
142402
|
* @return The vote staple that was generated and whether it was able to be published
|
|
142298
142403
|
*/
|
|
142299
142404
|
updatePermissions(principal, permissions, target, method) {
|
|
142300
|
-
var
|
|
142301
|
-
|
|
142302
|
-
return client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function
|
|
142405
|
+
var _arguments19 = arguments,
|
|
142406
|
+
_this38 = this;
|
|
142407
|
+
return client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function _callee44() {
|
|
142303
142408
|
var options, builder;
|
|
142304
|
-
return client_client_regeneratorRuntime().wrap(function
|
|
142305
|
-
while (1) switch (
|
|
142409
|
+
return client_client_regeneratorRuntime().wrap(function _callee44$(_context46) {
|
|
142410
|
+
while (1) switch (_context46.prev = _context46.next) {
|
|
142306
142411
|
case 0:
|
|
142307
|
-
options =
|
|
142308
|
-
builder =
|
|
142412
|
+
options = _arguments19.length > 4 && _arguments19[4] !== undefined ? _arguments19[4] : {};
|
|
142413
|
+
builder = _this38.initBuilder(options);
|
|
142309
142414
|
builder.updatePermissions(client_lib_account.toAccount(principal), permissions, client_lib_account.toAccount(target), method, options);
|
|
142310
|
-
|
|
142311
|
-
return
|
|
142415
|
+
_context46.next = 5;
|
|
142416
|
+
return _this38.publishBuilder(builder);
|
|
142312
142417
|
case 5:
|
|
142313
|
-
return
|
|
142418
|
+
return _context46.abrupt("return", _context46.sent);
|
|
142314
142419
|
case 6:
|
|
142315
142420
|
case "end":
|
|
142316
|
-
return
|
|
142421
|
+
return _context46.stop();
|
|
142317
142422
|
}
|
|
142318
|
-
},
|
|
142423
|
+
}, _callee44);
|
|
142319
142424
|
}))();
|
|
142320
142425
|
}
|
|
142321
142426
|
|
|
@@ -142327,23 +142432,23 @@ class src_client_UserClient {
|
|
|
142327
142432
|
* @return The balances for the account
|
|
142328
142433
|
*/
|
|
142329
142434
|
allBalances() {
|
|
142330
|
-
var
|
|
142331
|
-
|
|
142332
|
-
return client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function
|
|
142435
|
+
var _arguments20 = arguments,
|
|
142436
|
+
_this39 = this;
|
|
142437
|
+
return client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function _callee45() {
|
|
142333
142438
|
var options;
|
|
142334
|
-
return client_client_regeneratorRuntime().wrap(function
|
|
142335
|
-
while (1) switch (
|
|
142439
|
+
return client_client_regeneratorRuntime().wrap(function _callee45$(_context47) {
|
|
142440
|
+
while (1) switch (_context47.prev = _context47.next) {
|
|
142336
142441
|
case 0:
|
|
142337
|
-
options =
|
|
142338
|
-
|
|
142339
|
-
return client_client_classPrivateFieldGet(client_client,
|
|
142442
|
+
options = _arguments20.length > 0 && _arguments20[0] !== undefined ? _arguments20[0] : {};
|
|
142443
|
+
_context47.next = 3;
|
|
142444
|
+
return client_client_classPrivateFieldGet(client_client, _this39).getAllBalances(client_client_assertClassBrand(client_UserClient_brand, _this39, client_getAccount).call(_this39, options));
|
|
142340
142445
|
case 3:
|
|
142341
|
-
return
|
|
142446
|
+
return _context47.abrupt("return", _context47.sent);
|
|
142342
142447
|
case 4:
|
|
142343
142448
|
case "end":
|
|
142344
|
-
return
|
|
142449
|
+
return _context47.stop();
|
|
142345
142450
|
}
|
|
142346
|
-
},
|
|
142451
|
+
}, _callee45);
|
|
142347
142452
|
}))();
|
|
142348
142453
|
}
|
|
142349
142454
|
|
|
@@ -142356,23 +142461,23 @@ class src_client_UserClient {
|
|
|
142356
142461
|
* @return The balance for the account of the given token
|
|
142357
142462
|
*/
|
|
142358
142463
|
balance(token) {
|
|
142359
|
-
var
|
|
142360
|
-
|
|
142361
|
-
return client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function
|
|
142464
|
+
var _arguments21 = arguments,
|
|
142465
|
+
_this40 = this;
|
|
142466
|
+
return client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function _callee46() {
|
|
142362
142467
|
var options;
|
|
142363
|
-
return client_client_regeneratorRuntime().wrap(function
|
|
142364
|
-
while (1) switch (
|
|
142468
|
+
return client_client_regeneratorRuntime().wrap(function _callee46$(_context48) {
|
|
142469
|
+
while (1) switch (_context48.prev = _context48.next) {
|
|
142365
142470
|
case 0:
|
|
142366
|
-
options =
|
|
142367
|
-
|
|
142368
|
-
return client_client_classPrivateFieldGet(client_client,
|
|
142471
|
+
options = _arguments21.length > 1 && _arguments21[1] !== undefined ? _arguments21[1] : {};
|
|
142472
|
+
_context48.next = 3;
|
|
142473
|
+
return client_client_classPrivateFieldGet(client_client, _this40).getBalance(client_client_assertClassBrand(client_UserClient_brand, _this40, client_getAccount).call(_this40, options), token);
|
|
142369
142474
|
case 3:
|
|
142370
|
-
return
|
|
142475
|
+
return _context48.abrupt("return", _context48.sent);
|
|
142371
142476
|
case 4:
|
|
142372
142477
|
case "end":
|
|
142373
|
-
return
|
|
142478
|
+
return _context48.stop();
|
|
142374
142479
|
}
|
|
142375
|
-
},
|
|
142480
|
+
}, _callee46);
|
|
142376
142481
|
}))();
|
|
142377
142482
|
}
|
|
142378
142483
|
|
|
@@ -142386,31 +142491,31 @@ class src_client_UserClient {
|
|
|
142386
142491
|
* if the account has no blocks
|
|
142387
142492
|
*/
|
|
142388
142493
|
head() {
|
|
142389
|
-
var
|
|
142390
|
-
|
|
142391
|
-
return client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function
|
|
142392
|
-
var options, _yield$
|
|
142393
|
-
return client_client_regeneratorRuntime().wrap(function
|
|
142394
|
-
while (1) switch (
|
|
142494
|
+
var _arguments22 = arguments,
|
|
142495
|
+
_this41 = this;
|
|
142496
|
+
return client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function _callee47() {
|
|
142497
|
+
var options, _yield$_this41$state, currentHeadBlock;
|
|
142498
|
+
return client_client_regeneratorRuntime().wrap(function _callee47$(_context49) {
|
|
142499
|
+
while (1) switch (_context49.prev = _context49.next) {
|
|
142395
142500
|
case 0:
|
|
142396
|
-
options =
|
|
142397
|
-
|
|
142398
|
-
return
|
|
142501
|
+
options = _arguments22.length > 0 && _arguments22[0] !== undefined ? _arguments22[0] : {};
|
|
142502
|
+
_context49.next = 3;
|
|
142503
|
+
return _this41.state(options);
|
|
142399
142504
|
case 3:
|
|
142400
|
-
_yield$
|
|
142401
|
-
currentHeadBlock = _yield$
|
|
142505
|
+
_yield$_this41$state = _context49.sent;
|
|
142506
|
+
currentHeadBlock = _yield$_this41$state.currentHeadBlock;
|
|
142402
142507
|
if (!(currentHeadBlock === null)) {
|
|
142403
|
-
|
|
142508
|
+
_context49.next = 7;
|
|
142404
142509
|
break;
|
|
142405
142510
|
}
|
|
142406
|
-
return
|
|
142511
|
+
return _context49.abrupt("return", currentHeadBlock);
|
|
142407
142512
|
case 7:
|
|
142408
|
-
return
|
|
142513
|
+
return _context49.abrupt("return", new client_lib_block.Hash(currentHeadBlock));
|
|
142409
142514
|
case 8:
|
|
142410
142515
|
case "end":
|
|
142411
|
-
return
|
|
142516
|
+
return _context49.stop();
|
|
142412
142517
|
}
|
|
142413
|
-
},
|
|
142518
|
+
}, _callee47);
|
|
142414
142519
|
}))();
|
|
142415
142520
|
}
|
|
142416
142521
|
|
|
@@ -142422,20 +142527,20 @@ class src_client_UserClient {
|
|
|
142422
142527
|
* @return The block if it is known to the network or null if it is not
|
|
142423
142528
|
*/
|
|
142424
142529
|
block(blockhash) {
|
|
142425
|
-
var
|
|
142426
|
-
return client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function
|
|
142427
|
-
return client_client_regeneratorRuntime().wrap(function
|
|
142428
|
-
while (1) switch (
|
|
142530
|
+
var _this42 = this;
|
|
142531
|
+
return client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function _callee48() {
|
|
142532
|
+
return client_client_regeneratorRuntime().wrap(function _callee48$(_context50) {
|
|
142533
|
+
while (1) switch (_context50.prev = _context50.next) {
|
|
142429
142534
|
case 0:
|
|
142430
|
-
|
|
142431
|
-
return client_client_classPrivateFieldGet(client_client,
|
|
142535
|
+
_context50.next = 2;
|
|
142536
|
+
return client_client_classPrivateFieldGet(client_client, _this42).getBlock(blockhash);
|
|
142432
142537
|
case 2:
|
|
142433
|
-
return
|
|
142538
|
+
return _context50.abrupt("return", _context50.sent);
|
|
142434
142539
|
case 3:
|
|
142435
142540
|
case "end":
|
|
142436
|
-
return
|
|
142541
|
+
return _context50.stop();
|
|
142437
142542
|
}
|
|
142438
|
-
},
|
|
142543
|
+
}, _callee48);
|
|
142439
142544
|
}))();
|
|
142440
142545
|
}
|
|
142441
142546
|
|
|
@@ -142448,23 +142553,23 @@ class src_client_UserClient {
|
|
|
142448
142553
|
* @return The chain for the account, paginated
|
|
142449
142554
|
*/
|
|
142450
142555
|
chain(query) {
|
|
142451
|
-
var
|
|
142452
|
-
|
|
142453
|
-
return client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function
|
|
142556
|
+
var _arguments23 = arguments,
|
|
142557
|
+
_this43 = this;
|
|
142558
|
+
return client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function _callee49() {
|
|
142454
142559
|
var options;
|
|
142455
|
-
return client_client_regeneratorRuntime().wrap(function
|
|
142456
|
-
while (1) switch (
|
|
142560
|
+
return client_client_regeneratorRuntime().wrap(function _callee49$(_context51) {
|
|
142561
|
+
while (1) switch (_context51.prev = _context51.next) {
|
|
142457
142562
|
case 0:
|
|
142458
|
-
options =
|
|
142459
|
-
|
|
142460
|
-
return client_client_classPrivateFieldGet(client_client,
|
|
142563
|
+
options = _arguments23.length > 1 && _arguments23[1] !== undefined ? _arguments23[1] : {};
|
|
142564
|
+
_context51.next = 3;
|
|
142565
|
+
return client_client_classPrivateFieldGet(client_client, _this43).getChain(client_client_assertClassBrand(client_UserClient_brand, _this43, client_getAccount).call(_this43, options), query);
|
|
142461
142566
|
case 3:
|
|
142462
|
-
return
|
|
142567
|
+
return _context51.abrupt("return", _context51.sent);
|
|
142463
142568
|
case 4:
|
|
142464
142569
|
case "end":
|
|
142465
|
-
return
|
|
142570
|
+
return _context51.stop();
|
|
142466
142571
|
}
|
|
142467
|
-
},
|
|
142572
|
+
}, _callee49);
|
|
142468
142573
|
}))();
|
|
142469
142574
|
}
|
|
142470
142575
|
|
|
@@ -142477,23 +142582,23 @@ class src_client_UserClient {
|
|
|
142477
142582
|
* @return The history for the account, paginated
|
|
142478
142583
|
*/
|
|
142479
142584
|
history(query) {
|
|
142480
|
-
var
|
|
142481
|
-
|
|
142482
|
-
return client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function
|
|
142585
|
+
var _arguments24 = arguments,
|
|
142586
|
+
_this44 = this;
|
|
142587
|
+
return client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function _callee50() {
|
|
142483
142588
|
var options, voteStapleEntries, initialTrustedAccount, retval;
|
|
142484
|
-
return client_client_regeneratorRuntime().wrap(function
|
|
142485
|
-
while (1) switch (
|
|
142589
|
+
return client_client_regeneratorRuntime().wrap(function _callee50$(_context52) {
|
|
142590
|
+
while (1) switch (_context52.prev = _context52.next) {
|
|
142486
142591
|
case 0:
|
|
142487
|
-
options =
|
|
142488
|
-
|
|
142489
|
-
return client_client_classPrivateFieldGet(client_client,
|
|
142592
|
+
options = _arguments24.length > 1 && _arguments24[1] !== undefined ? _arguments24[1] : {};
|
|
142593
|
+
_context52.next = 3;
|
|
142594
|
+
return client_client_classPrivateFieldGet(client_client, _this44).getHistory(client_client_assertClassBrand(client_UserClient_brand, _this44, client_getAccount).call(_this44, options), query);
|
|
142490
142595
|
case 3:
|
|
142491
|
-
voteStapleEntries =
|
|
142492
|
-
initialTrustedAccount = src_client_UserClient.Config.getDefaultConfig(client_client_classPrivateFieldGet(client_client_config,
|
|
142596
|
+
voteStapleEntries = _context52.sent;
|
|
142597
|
+
initialTrustedAccount = src_client_UserClient.Config.getDefaultConfig(client_client_classPrivateFieldGet(client_client_config, _this44).networkAlias).initialTrustedAccount;
|
|
142493
142598
|
retval = voteStapleEntries.map(voteStapleEntry => {
|
|
142494
142599
|
var effects = client_computeEffectOfBlocks(voteStapleEntry.voteStaple.blocks, {
|
|
142495
|
-
baseToken:
|
|
142496
|
-
networkAddress:
|
|
142600
|
+
baseToken: _this44.baseToken,
|
|
142601
|
+
networkAddress: _this44.networkAddress,
|
|
142497
142602
|
initialTrustedAccount: initialTrustedAccount
|
|
142498
142603
|
});
|
|
142499
142604
|
return {
|
|
@@ -142501,12 +142606,12 @@ class src_client_UserClient {
|
|
|
142501
142606
|
effects: effects
|
|
142502
142607
|
};
|
|
142503
142608
|
});
|
|
142504
|
-
return
|
|
142609
|
+
return _context52.abrupt("return", retval);
|
|
142505
142610
|
case 7:
|
|
142506
142611
|
case "end":
|
|
142507
|
-
return
|
|
142612
|
+
return _context52.stop();
|
|
142508
142613
|
}
|
|
142509
|
-
},
|
|
142614
|
+
}, _callee50);
|
|
142510
142615
|
}))();
|
|
142511
142616
|
}
|
|
142512
142617
|
|
|
@@ -142586,23 +142691,23 @@ class src_client_UserClient {
|
|
|
142586
142691
|
* pending block
|
|
142587
142692
|
*/
|
|
142588
142693
|
pendingBlock() {
|
|
142589
|
-
var
|
|
142590
|
-
|
|
142591
|
-
return client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function
|
|
142694
|
+
var _arguments25 = arguments,
|
|
142695
|
+
_this45 = this;
|
|
142696
|
+
return client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function _callee51() {
|
|
142592
142697
|
var options;
|
|
142593
|
-
return client_client_regeneratorRuntime().wrap(function
|
|
142594
|
-
while (1) switch (
|
|
142698
|
+
return client_client_regeneratorRuntime().wrap(function _callee51$(_context53) {
|
|
142699
|
+
while (1) switch (_context53.prev = _context53.next) {
|
|
142595
142700
|
case 0:
|
|
142596
|
-
options =
|
|
142597
|
-
|
|
142598
|
-
return client_client_classPrivateFieldGet(client_client,
|
|
142701
|
+
options = _arguments25.length > 0 && _arguments25[0] !== undefined ? _arguments25[0] : {};
|
|
142702
|
+
_context53.next = 3;
|
|
142703
|
+
return client_client_classPrivateFieldGet(client_client, _this45).getPendingBlock(client_client_assertClassBrand(client_UserClient_brand, _this45, client_getAccount).call(_this45, options));
|
|
142599
142704
|
case 3:
|
|
142600
|
-
return
|
|
142705
|
+
return _context53.abrupt("return", _context53.sent);
|
|
142601
142706
|
case 4:
|
|
142602
142707
|
case "end":
|
|
142603
|
-
return
|
|
142708
|
+
return _context53.stop();
|
|
142604
142709
|
}
|
|
142605
|
-
},
|
|
142710
|
+
}, _callee51);
|
|
142606
142711
|
}))();
|
|
142607
142712
|
}
|
|
142608
142713
|
|
|
@@ -142614,23 +142719,23 @@ class src_client_UserClient {
|
|
|
142614
142719
|
* @param options User client options (common options)
|
|
142615
142720
|
*/
|
|
142616
142721
|
recover(publish) {
|
|
142617
|
-
var
|
|
142618
|
-
|
|
142619
|
-
return client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function
|
|
142722
|
+
var _arguments26 = arguments,
|
|
142723
|
+
_this46 = this;
|
|
142724
|
+
return client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function _callee52() {
|
|
142620
142725
|
var options;
|
|
142621
|
-
return client_client_regeneratorRuntime().wrap(function
|
|
142622
|
-
while (1) switch (
|
|
142726
|
+
return client_client_regeneratorRuntime().wrap(function _callee52$(_context54) {
|
|
142727
|
+
while (1) switch (_context54.prev = _context54.next) {
|
|
142623
142728
|
case 0:
|
|
142624
|
-
options =
|
|
142625
|
-
|
|
142626
|
-
return client_client_classPrivateFieldGet(client_client,
|
|
142729
|
+
options = _arguments26.length > 1 && _arguments26[1] !== undefined ? _arguments26[1] : {};
|
|
142730
|
+
_context54.next = 3;
|
|
142731
|
+
return client_client_classPrivateFieldGet(client_client, _this46).recoverAccount(client_client_assertClassBrand(client_UserClient_brand, _this46, client_getAccount).call(_this46, options), publish);
|
|
142627
142732
|
case 3:
|
|
142628
|
-
return
|
|
142733
|
+
return _context54.abrupt("return", _context54.sent);
|
|
142629
142734
|
case 4:
|
|
142630
142735
|
case "end":
|
|
142631
|
-
return
|
|
142736
|
+
return _context54.stop();
|
|
142632
142737
|
}
|
|
142633
|
-
},
|
|
142738
|
+
}, _callee52);
|
|
142634
142739
|
}))();
|
|
142635
142740
|
}
|
|
142636
142741
|
|
|
@@ -142640,7 +142745,7 @@ class src_client_UserClient {
|
|
|
142640
142745
|
* Check that parameters of function complies with respective event function
|
|
142641
142746
|
*/
|
|
142642
142747
|
on(event, handler) {
|
|
142643
|
-
var
|
|
142748
|
+
var _this47 = this;
|
|
142644
142749
|
var id = Symbol('callbackID');
|
|
142645
142750
|
|
|
142646
142751
|
// Initialize listeners function array if does not exist
|
|
@@ -142653,25 +142758,25 @@ class src_client_UserClient {
|
|
|
142653
142758
|
switch (event) {
|
|
142654
142759
|
case 'change':
|
|
142655
142760
|
// Setup filtered WebSocket to receive messages signalling a change
|
|
142656
|
-
void client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function
|
|
142657
|
-
return client_client_regeneratorRuntime().wrap(function
|
|
142658
|
-
while (1) switch (
|
|
142761
|
+
void client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function _callee53() {
|
|
142762
|
+
return client_client_regeneratorRuntime().wrap(function _callee53$(_context55) {
|
|
142763
|
+
while (1) switch (_context55.prev = _context55.next) {
|
|
142659
142764
|
case 0:
|
|
142660
|
-
|
|
142661
|
-
|
|
142662
|
-
return client_client_assertClassBrand(client_UserClient_brand,
|
|
142765
|
+
_context55.prev = 0;
|
|
142766
|
+
_context55.next = 3;
|
|
142767
|
+
return client_client_assertClassBrand(client_UserClient_brand, _this47, client_setupFilteredWebSocket).call(_this47);
|
|
142663
142768
|
case 3:
|
|
142664
|
-
|
|
142769
|
+
_context55.next = 8;
|
|
142665
142770
|
break;
|
|
142666
142771
|
case 5:
|
|
142667
|
-
|
|
142668
|
-
|
|
142669
|
-
console.error("Failed to setup filtered websocket ".concat(
|
|
142772
|
+
_context55.prev = 5;
|
|
142773
|
+
_context55.t0 = _context55["catch"](0);
|
|
142774
|
+
console.error("Failed to setup filtered websocket ".concat(_context55.t0));
|
|
142670
142775
|
case 8:
|
|
142671
142776
|
case "end":
|
|
142672
|
-
return
|
|
142777
|
+
return _context55.stop();
|
|
142673
142778
|
}
|
|
142674
|
-
},
|
|
142779
|
+
}, _callee53, null, [[0, 5]]);
|
|
142675
142780
|
}))();
|
|
142676
142781
|
|
|
142677
142782
|
// Setup polling as well
|
|
@@ -142721,69 +142826,69 @@ class src_client_UserClient {
|
|
|
142721
142826
|
* Destroy this instance -- this is required to clean up all resources.
|
|
142722
142827
|
*/
|
|
142723
142828
|
destroy() {
|
|
142724
|
-
var
|
|
142725
|
-
return client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function
|
|
142829
|
+
var _this48 = this;
|
|
142830
|
+
return client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function _callee54() {
|
|
142726
142831
|
var _classPrivateFieldGet3;
|
|
142727
142832
|
var intervalIds, _i2, _intervalIds2, interval, _iterator19, _step19, transientClient, client;
|
|
142728
|
-
return client_client_regeneratorRuntime().wrap(function
|
|
142729
|
-
while (1) switch (
|
|
142833
|
+
return client_client_regeneratorRuntime().wrap(function _callee54$(_context56) {
|
|
142834
|
+
while (1) switch (_context56.prev = _context56.next) {
|
|
142730
142835
|
case 0:
|
|
142731
|
-
|
|
142732
|
-
return
|
|
142836
|
+
_context56.next = 2;
|
|
142837
|
+
return _this48.client.destroy();
|
|
142733
142838
|
case 2:
|
|
142734
|
-
if (!(client_client_classPrivateFieldGet(client_changePromise,
|
|
142735
|
-
|
|
142839
|
+
if (!(client_client_classPrivateFieldGet(client_changePromise, _this48) !== undefined)) {
|
|
142840
|
+
_context56.next = 5;
|
|
142736
142841
|
break;
|
|
142737
142842
|
}
|
|
142738
|
-
|
|
142739
|
-
return client_client_classPrivateFieldGet(client_changePromise,
|
|
142843
|
+
_context56.next = 5;
|
|
142844
|
+
return client_client_classPrivateFieldGet(client_changePromise, _this48);
|
|
142740
142845
|
case 5:
|
|
142741
142846
|
// Get Interval IDs and clear them
|
|
142742
|
-
intervalIds = Object.values(client_client_classPrivateFieldGet(client_intervals2,
|
|
142847
|
+
intervalIds = Object.values(client_client_classPrivateFieldGet(client_intervals2, _this48));
|
|
142743
142848
|
for (_i2 = 0, _intervalIds2 = intervalIds; _i2 < _intervalIds2.length; _i2++) {
|
|
142744
142849
|
interval = _intervalIds2[_i2];
|
|
142745
142850
|
clearInterval(interval);
|
|
142746
142851
|
}
|
|
142747
142852
|
|
|
142748
142853
|
// Clear Variables
|
|
142749
|
-
client_client_classPrivateFieldSet(client_intervals2,
|
|
142750
|
-
client_client_classPrivateFieldSet(client_listeners,
|
|
142751
|
-
client_client_classPrivateFieldSet(client_previousAccountChangeData,
|
|
142752
|
-
(_classPrivateFieldGet3 = client_client_classPrivateFieldGet(client_filteredWebSocket,
|
|
142753
|
-
client_client_classPrivateFieldSet(client_filteredWebSocket,
|
|
142854
|
+
client_client_classPrivateFieldSet(client_intervals2, _this48, {});
|
|
142855
|
+
client_client_classPrivateFieldSet(client_listeners, _this48, {});
|
|
142856
|
+
client_client_classPrivateFieldSet(client_previousAccountChangeData, _this48, undefined);
|
|
142857
|
+
(_classPrivateFieldGet3 = client_client_classPrivateFieldGet(client_filteredWebSocket, _this48)) === null || _classPrivateFieldGet3 === void 0 || _classPrivateFieldGet3.close();
|
|
142858
|
+
client_client_classPrivateFieldSet(client_filteredWebSocket, _this48, undefined);
|
|
142754
142859
|
|
|
142755
142860
|
/* Clean up transient clients */
|
|
142756
|
-
_iterator19 = client_client_createForOfIteratorHelper(client_client_classPrivateFieldGet(client_transientUserClients,
|
|
142757
|
-
|
|
142861
|
+
_iterator19 = client_client_createForOfIteratorHelper(client_client_classPrivateFieldGet(client_transientUserClients, _this48));
|
|
142862
|
+
_context56.prev = 13;
|
|
142758
142863
|
_iterator19.s();
|
|
142759
142864
|
case 15:
|
|
142760
142865
|
if ((_step19 = _iterator19.n()).done) {
|
|
142761
|
-
|
|
142866
|
+
_context56.next = 22;
|
|
142762
142867
|
break;
|
|
142763
142868
|
}
|
|
142764
142869
|
transientClient = _step19.value;
|
|
142765
142870
|
client = transientClient.deref();
|
|
142766
|
-
|
|
142871
|
+
_context56.next = 20;
|
|
142767
142872
|
return client === null || client === void 0 ? void 0 : client.destroy();
|
|
142768
142873
|
case 20:
|
|
142769
|
-
|
|
142874
|
+
_context56.next = 15;
|
|
142770
142875
|
break;
|
|
142771
142876
|
case 22:
|
|
142772
|
-
|
|
142877
|
+
_context56.next = 27;
|
|
142773
142878
|
break;
|
|
142774
142879
|
case 24:
|
|
142775
|
-
|
|
142776
|
-
|
|
142777
|
-
_iterator19.e(
|
|
142880
|
+
_context56.prev = 24;
|
|
142881
|
+
_context56.t0 = _context56["catch"](13);
|
|
142882
|
+
_iterator19.e(_context56.t0);
|
|
142778
142883
|
case 27:
|
|
142779
|
-
|
|
142884
|
+
_context56.prev = 27;
|
|
142780
142885
|
_iterator19.f();
|
|
142781
|
-
return
|
|
142886
|
+
return _context56.finish(27);
|
|
142782
142887
|
case 30:
|
|
142783
142888
|
case "end":
|
|
142784
|
-
return
|
|
142889
|
+
return _context56.stop();
|
|
142785
142890
|
}
|
|
142786
|
-
},
|
|
142891
|
+
}, _callee54, null, [[13, 24, 27, 30]]);
|
|
142787
142892
|
}))();
|
|
142788
142893
|
}
|
|
142789
142894
|
|
|
@@ -142850,8 +142955,8 @@ function client_getAccount() {
|
|
|
142850
142955
|
}
|
|
142851
142956
|
return retval;
|
|
142852
142957
|
}
|
|
142853
|
-
function client_get_publishAidURL(
|
|
142854
|
-
var _classPrivateFieldGet4 = client_client_classPrivateFieldGet(client_client_config,
|
|
142958
|
+
function client_get_publishAidURL(_this30) {
|
|
142959
|
+
var _classPrivateFieldGet4 = client_client_classPrivateFieldGet(client_client_config, _this30),
|
|
142855
142960
|
usePublishAid = _classPrivateFieldGet4.usePublishAid,
|
|
142856
142961
|
publishAidURL = _classPrivateFieldGet4.publishAidURL,
|
|
142857
142962
|
networkAlias = _classPrivateFieldGet4.networkAlias;
|
|
@@ -142864,13 +142969,13 @@ function client_publishWithPublishAid(_x24) {
|
|
|
142864
142969
|
return client_publishWithPublishAid2.apply(this, arguments);
|
|
142865
142970
|
}
|
|
142866
142971
|
function client_publishWithPublishAid2() {
|
|
142867
|
-
client_publishWithPublishAid2 = client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function
|
|
142972
|
+
client_publishWithPublishAid2 = client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function _callee64(blocks) {
|
|
142868
142973
|
var result, json;
|
|
142869
|
-
return client_client_regeneratorRuntime().wrap(function
|
|
142870
|
-
while (1) switch (
|
|
142974
|
+
return client_client_regeneratorRuntime().wrap(function _callee64$(_context67) {
|
|
142975
|
+
while (1) switch (_context67.prev = _context67.next) {
|
|
142871
142976
|
case 0:
|
|
142872
|
-
|
|
142873
|
-
|
|
142977
|
+
_context67.prev = 0;
|
|
142978
|
+
_context67.next = 3;
|
|
142874
142979
|
return client_fetch(client_client_classPrivateGetter(client_UserClient_brand, this, client_get_publishAidURL), {
|
|
142875
142980
|
method: 'POST',
|
|
142876
142981
|
headers: {
|
|
@@ -142883,58 +142988,58 @@ function client_publishWithPublishAid2() {
|
|
|
142883
142988
|
})
|
|
142884
142989
|
});
|
|
142885
142990
|
case 3:
|
|
142886
|
-
result =
|
|
142991
|
+
result = _context67.sent;
|
|
142887
142992
|
if (result.ok) {
|
|
142888
|
-
|
|
142993
|
+
_context67.next = 6;
|
|
142889
142994
|
break;
|
|
142890
142995
|
}
|
|
142891
142996
|
throw new Error("publish error: ".concat(result.statusText));
|
|
142892
142997
|
case 6:
|
|
142893
|
-
|
|
142998
|
+
_context67.next = 8;
|
|
142894
142999
|
return result.json();
|
|
142895
143000
|
case 8:
|
|
142896
|
-
json =
|
|
143001
|
+
json = _context67.sent;
|
|
142897
143002
|
if (!(typeof json !== 'object' || json === null)) {
|
|
142898
|
-
|
|
143003
|
+
_context67.next = 11;
|
|
142899
143004
|
break;
|
|
142900
143005
|
}
|
|
142901
143006
|
throw new src_client_KeetaNetError('CLIENT_PUBLISH_AID_NOT_AVAILABLE', 'Unknown JSON response from publish aid');
|
|
142902
143007
|
case 11:
|
|
142903
143008
|
if (!(!('publish' in json) || typeof json.publish !== 'boolean')) {
|
|
142904
|
-
|
|
143009
|
+
_context67.next = 13;
|
|
142905
143010
|
break;
|
|
142906
143011
|
}
|
|
142907
143012
|
throw new src_client_KeetaNetError('CLIENT_PUBLISH_AID_NOT_AVAILABLE', 'Invalid JSON response from publish aid');
|
|
142908
143013
|
case 13:
|
|
142909
|
-
return
|
|
143014
|
+
return _context67.abrupt("return", {
|
|
142910
143015
|
publish: json.publish
|
|
142911
143016
|
});
|
|
142912
143017
|
case 16:
|
|
142913
|
-
|
|
142914
|
-
|
|
142915
|
-
if (!src_client_KeetaNetError.isInstance(
|
|
142916
|
-
|
|
143018
|
+
_context67.prev = 16;
|
|
143019
|
+
_context67.t0 = _context67["catch"](0);
|
|
143020
|
+
if (!src_client_KeetaNetError.isInstance(_context67.t0)) {
|
|
143021
|
+
_context67.next = 22;
|
|
142917
143022
|
break;
|
|
142918
143023
|
}
|
|
142919
|
-
throw
|
|
143024
|
+
throw _context67.t0;
|
|
142920
143025
|
case 22:
|
|
142921
|
-
if (!(
|
|
142922
|
-
|
|
143026
|
+
if (!(_context67.t0 instanceof Error)) {
|
|
143027
|
+
_context67.next = 26;
|
|
142923
143028
|
break;
|
|
142924
143029
|
}
|
|
142925
|
-
throw new src_client_KeetaNetError('CLIENT_PUBLISH_AID_NOT_AVAILABLE', "Publish Aid not available: ".concat(
|
|
143030
|
+
throw new src_client_KeetaNetError('CLIENT_PUBLISH_AID_NOT_AVAILABLE', "Publish Aid not available: ".concat(_context67.t0.message));
|
|
142926
143031
|
case 26:
|
|
142927
143032
|
throw new src_client_KeetaNetError('CLIENT_PUBLISH_AID_NOT_AVAILABLE', 'Publish Aid not available (unknown error)');
|
|
142928
143033
|
case 27:
|
|
142929
143034
|
case "end":
|
|
142930
|
-
return
|
|
143035
|
+
return _context67.stop();
|
|
142931
143036
|
}
|
|
142932
|
-
},
|
|
143037
|
+
}, _callee64, this, [[0, 16]]);
|
|
142933
143038
|
}));
|
|
142934
143039
|
return client_publishWithPublishAid2.apply(this, arguments);
|
|
142935
143040
|
}
|
|
142936
143041
|
function client_reconnectWebSocket() {
|
|
142937
|
-
var
|
|
143042
|
+
var _this50 = this;
|
|
142938
143043
|
if (!client_client_classPrivateFieldGet(client_filteredWebSocket, this) || !Object.values(client_client_classPrivateFieldGet(client_listeners, this)).some(listener => listener.size > 0)) {
|
|
142939
143044
|
return;
|
|
142940
143045
|
}
|
|
@@ -142942,36 +143047,36 @@ function client_reconnectWebSocket() {
|
|
|
142942
143047
|
|
|
142943
143048
|
// Exponential backoff
|
|
142944
143049
|
var timeout = client_client_classPrivateFieldGet(client_RECONNECT_TIMEOUT, this) * Math.pow(2, client_client_classPrivateFieldGet(client_reconnectAttempts, this));
|
|
142945
|
-
setTimeout(/*#__PURE__*/client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function
|
|
143050
|
+
setTimeout(/*#__PURE__*/client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function _callee56() {
|
|
142946
143051
|
var _this$reconnectAttemp, _this$reconnectAttemp2;
|
|
142947
|
-
return client_client_regeneratorRuntime().wrap(function
|
|
142948
|
-
while (1) switch (
|
|
143052
|
+
return client_client_regeneratorRuntime().wrap(function _callee56$(_context58) {
|
|
143053
|
+
while (1) switch (_context58.prev = _context58.next) {
|
|
142949
143054
|
case 0:
|
|
142950
|
-
client_client_classPrivateFieldSet(client_reconnectAttempts,
|
|
142951
|
-
|
|
142952
|
-
return client_client_assertClassBrand(client_UserClient_brand,
|
|
143055
|
+
client_client_classPrivateFieldSet(client_reconnectAttempts, _this50, (_this$reconnectAttemp = client_client_classPrivateFieldGet(client_reconnectAttempts, _this50), _this$reconnectAttemp2 = _this$reconnectAttemp++, _this$reconnectAttemp)), _this$reconnectAttemp2;
|
|
143056
|
+
_context58.next = 3;
|
|
143057
|
+
return client_client_assertClassBrand(client_UserClient_brand, _this50, client_setupFilteredWebSocket).call(_this50);
|
|
142953
143058
|
case 3:
|
|
142954
143059
|
case "end":
|
|
142955
|
-
return
|
|
143060
|
+
return _context58.stop();
|
|
142956
143061
|
}
|
|
142957
|
-
},
|
|
143062
|
+
}, _callee56);
|
|
142958
143063
|
})), timeout);
|
|
142959
143064
|
}
|
|
142960
143065
|
function client_setupFilteredWebSocket() {
|
|
142961
143066
|
return client_setupFilteredWebSocket2.apply(this, arguments);
|
|
142962
143067
|
}
|
|
142963
143068
|
function client_setupFilteredWebSocket2() {
|
|
142964
|
-
client_setupFilteredWebSocket2 = client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function
|
|
142965
|
-
var
|
|
143069
|
+
client_setupFilteredWebSocket2 = client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function _callee66() {
|
|
143070
|
+
var _this52 = this;
|
|
142966
143071
|
var p2pEndpoint, ws, filter, greeting, socket;
|
|
142967
|
-
return client_client_regeneratorRuntime().wrap(function
|
|
142968
|
-
while (1) switch (
|
|
143072
|
+
return client_client_regeneratorRuntime().wrap(function _callee66$(_context69) {
|
|
143073
|
+
while (1) switch (_context69.prev = _context69.next) {
|
|
142969
143074
|
case 0:
|
|
142970
143075
|
if (!client_client_classPrivateFieldGet(client_socketPromise, this)) {
|
|
142971
|
-
|
|
143076
|
+
_context69.next = 2;
|
|
142972
143077
|
break;
|
|
142973
143078
|
}
|
|
142974
|
-
return
|
|
143079
|
+
return _context69.abrupt("return");
|
|
142975
143080
|
case 2:
|
|
142976
143081
|
p2pEndpoint = client_client_classPrivateFieldGet(client_client, this).representatives[0].endpoints.p2p;
|
|
142977
143082
|
ws = new client_isomorphic_ws_browser(p2pEndpoint);
|
|
@@ -143009,61 +143114,61 @@ function client_setupFilteredWebSocket2() {
|
|
|
143009
143114
|
};
|
|
143010
143115
|
};
|
|
143011
143116
|
}));
|
|
143012
|
-
|
|
143013
|
-
|
|
143117
|
+
_context69.prev = 7;
|
|
143118
|
+
_context69.next = 10;
|
|
143014
143119
|
return client_client_classPrivateFieldGet(client_socketPromise, this);
|
|
143015
143120
|
case 10:
|
|
143016
|
-
socket =
|
|
143121
|
+
socket = _context69.sent;
|
|
143017
143122
|
client_client_classPrivateFieldSet(client_reconnectAttempts, this, 0);
|
|
143018
143123
|
socket.onclose = () => {
|
|
143019
143124
|
client_client_assertClassBrand(client_UserClient_brand, this, client_reconnectWebSocket).call(this);
|
|
143020
143125
|
};
|
|
143021
143126
|
socket.onmessage = /*#__PURE__*/function () {
|
|
143022
|
-
var _ref12 = client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function
|
|
143127
|
+
var _ref12 = client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function _callee65(event) {
|
|
143023
143128
|
var messageString, messageObj;
|
|
143024
|
-
return client_client_regeneratorRuntime().wrap(function
|
|
143025
|
-
while (1) switch (
|
|
143129
|
+
return client_client_regeneratorRuntime().wrap(function _callee65$(_context68) {
|
|
143130
|
+
while (1) switch (_context68.prev = _context68.next) {
|
|
143026
143131
|
case 0:
|
|
143027
|
-
|
|
143132
|
+
_context68.prev = 0;
|
|
143028
143133
|
messageString = event.data.toString('utf-8'); // const messageString = Buffer.from(rawData, 'utf-8').toString();
|
|
143029
143134
|
messageObj = JSON.parse(messageString); // We are only interested in the add message
|
|
143030
143135
|
if (!messageObj.add) {
|
|
143031
|
-
|
|
143136
|
+
_context68.next = 6;
|
|
143032
143137
|
break;
|
|
143033
143138
|
}
|
|
143034
|
-
|
|
143035
|
-
return client_client_assertClassBrand(client_UserClient_brand,
|
|
143139
|
+
_context68.next = 6;
|
|
143140
|
+
return client_client_assertClassBrand(client_UserClient_brand, _this52, client_emitAccountInfoIfChanged).call(_this52);
|
|
143036
143141
|
case 6:
|
|
143037
|
-
|
|
143142
|
+
_context68.next = 11;
|
|
143038
143143
|
break;
|
|
143039
143144
|
case 8:
|
|
143040
|
-
|
|
143041
|
-
|
|
143042
|
-
console.error('Error processing WebSocket message:',
|
|
143145
|
+
_context68.prev = 8;
|
|
143146
|
+
_context68.t0 = _context68["catch"](0);
|
|
143147
|
+
console.error('Error processing WebSocket message:', _context68.t0);
|
|
143043
143148
|
case 11:
|
|
143044
143149
|
case "end":
|
|
143045
|
-
return
|
|
143150
|
+
return _context68.stop();
|
|
143046
143151
|
}
|
|
143047
|
-
},
|
|
143152
|
+
}, _callee65, null, [[0, 8]]);
|
|
143048
143153
|
}));
|
|
143049
143154
|
return function (_x26) {
|
|
143050
143155
|
return _ref12.apply(this, arguments);
|
|
143051
143156
|
};
|
|
143052
143157
|
}();
|
|
143053
143158
|
client_client_classPrivateFieldSet(client_filteredWebSocket, this, socket);
|
|
143054
|
-
|
|
143159
|
+
_context69.next = 20;
|
|
143055
143160
|
break;
|
|
143056
143161
|
case 17:
|
|
143057
|
-
|
|
143058
|
-
|
|
143162
|
+
_context69.prev = 17;
|
|
143163
|
+
_context69.t0 = _context69["catch"](7);
|
|
143059
143164
|
client_client_assertClassBrand(client_UserClient_brand, this, client_reconnectWebSocket).call(this);
|
|
143060
143165
|
case 20:
|
|
143061
143166
|
client_client_classPrivateFieldSet(client_socketPromise, this, undefined);
|
|
143062
143167
|
case 21:
|
|
143063
143168
|
case "end":
|
|
143064
|
-
return
|
|
143169
|
+
return _context69.stop();
|
|
143065
143170
|
}
|
|
143066
|
-
},
|
|
143171
|
+
}, _callee66, this, [[7, 17]]);
|
|
143067
143172
|
}));
|
|
143068
143173
|
return client_setupFilteredWebSocket2.apply(this, arguments);
|
|
143069
143174
|
}
|
|
@@ -143100,15 +143205,15 @@ function client_emitAccountInfoIfChanged() {
|
|
|
143100
143205
|
return client_emitAccountInfoIfChanged2.apply(this, arguments);
|
|
143101
143206
|
}
|
|
143102
143207
|
function client_emitAccountInfoIfChanged2() {
|
|
143103
|
-
client_emitAccountInfoIfChanged2 = client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function
|
|
143208
|
+
client_emitAccountInfoIfChanged2 = client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function _callee67() {
|
|
143104
143209
|
var accountInfo, objectBuffer, accountHashBuffer, accountHashString;
|
|
143105
|
-
return client_client_regeneratorRuntime().wrap(function
|
|
143106
|
-
while (1) switch (
|
|
143210
|
+
return client_client_regeneratorRuntime().wrap(function _callee67$(_context70) {
|
|
143211
|
+
while (1) switch (_context70.prev = _context70.next) {
|
|
143107
143212
|
case 0:
|
|
143108
|
-
|
|
143213
|
+
_context70.next = 2;
|
|
143109
143214
|
return client_client_classPrivateFieldGet(client_client, this).getAccountInfo(this.account);
|
|
143110
143215
|
case 2:
|
|
143111
|
-
accountInfo =
|
|
143216
|
+
accountInfo = _context70.sent;
|
|
143112
143217
|
objectBuffer = client_conversion_objectToBuffer(accountInfo);
|
|
143113
143218
|
accountHashBuffer = client_hash_Hash(objectBuffer);
|
|
143114
143219
|
accountHashString = accountHashBuffer.toString();
|
|
@@ -143119,9 +143224,9 @@ function client_emitAccountInfoIfChanged2() {
|
|
|
143119
143224
|
}
|
|
143120
143225
|
case 7:
|
|
143121
143226
|
case "end":
|
|
143122
|
-
return
|
|
143227
|
+
return _context70.stop();
|
|
143123
143228
|
}
|
|
143124
|
-
},
|
|
143229
|
+
}, _callee67, this);
|
|
143125
143230
|
}));
|
|
143126
143231
|
return client_emitAccountInfoIfChanged2.apply(this, arguments);
|
|
143127
143232
|
}
|
|
@@ -143138,7 +143243,7 @@ function client_blockGenerator(_x7, _x8, _x9) {
|
|
|
143138
143243
|
|
|
143139
143244
|
/** @hidden */
|
|
143140
143245
|
function src_client_blockGenerator() {
|
|
143141
|
-
src_client_blockGenerator = client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function
|
|
143246
|
+
src_client_blockGenerator = client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function _callee57(seed, index, transactionCount) {
|
|
143142
143247
|
var network,
|
|
143143
143248
|
acct,
|
|
143144
143249
|
operations,
|
|
@@ -143150,11 +143255,11 @@ function src_client_blockGenerator() {
|
|
|
143150
143255
|
expiry,
|
|
143151
143256
|
vote,
|
|
143152
143257
|
staple,
|
|
143153
|
-
|
|
143154
|
-
return client_client_regeneratorRuntime().wrap(function
|
|
143155
|
-
while (1) switch (
|
|
143258
|
+
_args59 = arguments;
|
|
143259
|
+
return client_client_regeneratorRuntime().wrap(function _callee57$(_context59) {
|
|
143260
|
+
while (1) switch (_context59.prev = _context59.next) {
|
|
143156
143261
|
case 0:
|
|
143157
|
-
network =
|
|
143262
|
+
network = _args59.length > 3 && _args59[3] !== undefined ? _args59[3] : BigInt(1413829460);
|
|
143158
143263
|
acct = client_src_lib.Account.fromSeed(seed, index);
|
|
143159
143264
|
operations = [];
|
|
143160
143265
|
_Account$generateBase = client_lib_account.generateBaseAddresses(network), baseToken = _Account$generateBase.baseToken;
|
|
@@ -143166,7 +143271,7 @@ function src_client_blockGenerator() {
|
|
|
143166
143271
|
amount: BigInt(1)
|
|
143167
143272
|
});
|
|
143168
143273
|
}
|
|
143169
|
-
|
|
143274
|
+
_context59.next = 7;
|
|
143170
143275
|
return new client_src_lib.Block.Builder({
|
|
143171
143276
|
previous: client_src_lib.Block.NO_PREVIOUS,
|
|
143172
143277
|
account: acct,
|
|
@@ -143174,22 +143279,22 @@ function src_client_blockGenerator() {
|
|
|
143174
143279
|
operations: operations
|
|
143175
143280
|
}).seal();
|
|
143176
143281
|
case 7:
|
|
143177
|
-
block =
|
|
143282
|
+
block = _context59.sent;
|
|
143178
143283
|
voteWIP = new client_src_lib.Vote.Builder(acct);
|
|
143179
143284
|
voteWIP.addBlock(block);
|
|
143180
143285
|
expiry = new Date();
|
|
143181
143286
|
expiry.setUTCFullYear(expiry.getUTCFullYear() + 1000);
|
|
143182
|
-
|
|
143287
|
+
_context59.next = 14;
|
|
143183
143288
|
return voteWIP.seal(BigInt(1000 + index), expiry);
|
|
143184
143289
|
case 14:
|
|
143185
|
-
vote =
|
|
143290
|
+
vote = _context59.sent;
|
|
143186
143291
|
staple = client_src_lib.Vote.Staple.fromVotesAndBlocks([vote], [block]);
|
|
143187
|
-
return
|
|
143292
|
+
return _context59.abrupt("return", staple);
|
|
143188
143293
|
case 17:
|
|
143189
143294
|
case "end":
|
|
143190
|
-
return
|
|
143295
|
+
return _context59.stop();
|
|
143191
143296
|
}
|
|
143192
|
-
},
|
|
143297
|
+
}, _callee57);
|
|
143193
143298
|
}));
|
|
143194
143299
|
return src_client_blockGenerator.apply(this, arguments);
|
|
143195
143300
|
}
|
|
@@ -143203,43 +143308,43 @@ function client_emitBlocks(_x10, _x11, _x12, _x13, _x14) {
|
|
|
143203
143308
|
* Utilities needed for working with KeetaNet
|
|
143204
143309
|
*/
|
|
143205
143310
|
function src_client_emitBlocks() {
|
|
143206
|
-
src_client_emitBlocks = client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function
|
|
143311
|
+
src_client_emitBlocks = client_client_asyncToGenerator(/*#__PURE__*/client_client_regeneratorRuntime().mark(function _callee58(client, blocks, seed, index, transactionCount) {
|
|
143207
143312
|
var network,
|
|
143208
143313
|
_x25,
|
|
143209
143314
|
staple,
|
|
143210
|
-
|
|
143211
|
-
return client_client_regeneratorRuntime().wrap(function
|
|
143212
|
-
while (1) switch (
|
|
143315
|
+
_args60 = arguments;
|
|
143316
|
+
return client_client_regeneratorRuntime().wrap(function _callee58$(_context60) {
|
|
143317
|
+
while (1) switch (_context60.prev = _context60.next) {
|
|
143213
143318
|
case 0:
|
|
143214
|
-
network =
|
|
143319
|
+
network = _args60.length > 5 && _args60[5] !== undefined ? _args60[5] : BigInt(1413829460);
|
|
143215
143320
|
_x25 = 0;
|
|
143216
143321
|
case 2:
|
|
143217
143322
|
if (!(_x25 < blocks)) {
|
|
143218
|
-
|
|
143323
|
+
_context60.next = 16;
|
|
143219
143324
|
break;
|
|
143220
143325
|
}
|
|
143221
|
-
|
|
143326
|
+
_context60.next = 5;
|
|
143222
143327
|
return client_blockGenerator(seed, index + _x25, transactionCount, network);
|
|
143223
143328
|
case 5:
|
|
143224
|
-
staple =
|
|
143225
|
-
|
|
143226
|
-
|
|
143329
|
+
staple = _context60.sent;
|
|
143330
|
+
_context60.prev = 6;
|
|
143331
|
+
_context60.next = 9;
|
|
143227
143332
|
return client.transmitStaple(staple);
|
|
143228
143333
|
case 9:
|
|
143229
|
-
|
|
143334
|
+
_context60.next = 13;
|
|
143230
143335
|
break;
|
|
143231
143336
|
case 11:
|
|
143232
|
-
|
|
143233
|
-
|
|
143337
|
+
_context60.prev = 11;
|
|
143338
|
+
_context60.t0 = _context60["catch"](6);
|
|
143234
143339
|
case 13:
|
|
143235
143340
|
_x25++;
|
|
143236
|
-
|
|
143341
|
+
_context60.next = 2;
|
|
143237
143342
|
break;
|
|
143238
143343
|
case 16:
|
|
143239
143344
|
case "end":
|
|
143240
|
-
return
|
|
143345
|
+
return _context60.stop();
|
|
143241
143346
|
}
|
|
143242
|
-
},
|
|
143347
|
+
}, _callee58, null, [[6, 11]]);
|
|
143243
143348
|
}));
|
|
143244
143349
|
return src_client_emitBlocks.apply(this, arguments);
|
|
143245
143350
|
}
|