@leofcoin/chain 1.5.67 → 1.5.69
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/exports/browser/{_polyfill-node.child_process-BsjYmFff.js → _polyfill-node.child_process-CblghArn.js} +48 -47
- package/exports/browser/{_polyfill-node.url-Bp9XkJZf.js → _polyfill-node.url-BLK_MhDf.js} +1 -1
- package/exports/browser/{browser-Ei0BXMlu-C1_XUL9Y.js → browser-Ei0BXMlu-C0woTcHa.js} +2 -2
- package/exports/browser/chain.js +139 -70
- package/exports/browser/{client-A009z8av-DQfd3vOY.js → client-A009z8av-Ssch8Yea.js} +4 -4
- package/exports/browser/{index-G74WLzL7-Dt2dwaXq.js → index-G74WLzL7-BnLRqHoy.js} +2 -2
- package/exports/browser/{index-YQrIDBUQ-c7011Ab4.js → index-YQrIDBUQ-APwDgUUG.js} +2 -2
- package/exports/browser/{messages-lWRTai7t-ClhClfC1.js → messages-lWRTai7t-DJnHZSdM.js} +2 -2
- package/exports/browser/{node-browser-DqIklEKv.js → node-browser-CeM_F-HL.js} +23 -4
- package/exports/browser/node-browser.js +2 -2
- package/exports/browser/workers/block-worker.js +1 -1
- package/exports/browser/workers/machine-worker.js +223 -94
- package/exports/browser/workers/{worker-CltAyHf1.js → worker-CbAak_hM.js} +47 -46
- package/exports/chain.js +129 -60
- package/exports/machine.d.ts +8 -0
- package/exports/protocol.d.ts +1 -1
- package/exports/simplifiers/state.d.ts +3 -0
- package/exports/transaction.d.ts +1 -8
- package/exports/workers/block-worker.js +1 -1
- package/exports/workers/machine-worker.js +223 -94
- package/exports/workers/{worker-CltAyHf1.js → worker-CbAak_hM.js} +47 -46
- package/package.json +110 -109
|
@@ -14499,55 +14499,56 @@ class ValidatorMessage extends FormatInterface {
|
|
|
14499
14499
|
}
|
|
14500
14500
|
|
|
14501
14501
|
var proto$4 = {
|
|
14502
|
-
|
|
14503
|
-
|
|
14504
|
-
|
|
14505
|
-
|
|
14506
|
-
|
|
14507
|
-
|
|
14508
|
-
|
|
14502
|
+
index: Number(),
|
|
14503
|
+
previousHash: String(),
|
|
14504
|
+
timestamp: Number(),
|
|
14505
|
+
reward: BigNumber.from(0),
|
|
14506
|
+
fees: BigNumber.from(0),
|
|
14507
|
+
transactions: new Uint8Array(),
|
|
14508
|
+
validators: new Uint8Array()
|
|
14509
14509
|
};
|
|
14510
14510
|
|
|
14511
14511
|
class BlockMessage extends FormatInterface {
|
|
14512
|
-
|
|
14513
|
-
|
|
14514
|
-
|
|
14515
|
-
|
|
14516
|
-
|
|
14517
|
-
|
|
14518
|
-
|
|
14519
|
-
|
|
14520
|
-
|
|
14521
|
-
decoded
|
|
14522
|
-
|
|
14523
|
-
|
|
14524
|
-
|
|
14525
|
-
|
|
14526
|
-
|
|
14527
|
-
|
|
14528
|
-
|
|
14529
|
-
|
|
14530
|
-
|
|
14531
|
-
|
|
14532
|
-
|
|
14533
|
-
|
|
14534
|
-
|
|
14535
|
-
|
|
14536
|
-
|
|
14537
|
-
|
|
14538
|
-
|
|
14539
|
-
|
|
14540
|
-
|
|
14541
|
-
|
|
14542
|
-
|
|
14543
|
-
|
|
14544
|
-
|
|
14545
|
-
|
|
14546
|
-
|
|
14547
|
-
|
|
14548
|
-
|
|
14549
|
-
|
|
14550
|
-
|
|
14512
|
+
get messageName() {
|
|
14513
|
+
return 'BlockMessage';
|
|
14514
|
+
}
|
|
14515
|
+
constructor(buffer) {
|
|
14516
|
+
if (buffer instanceof BlockMessage)
|
|
14517
|
+
return buffer;
|
|
14518
|
+
const name = 'block-message';
|
|
14519
|
+
super(buffer, proto$4, { name });
|
|
14520
|
+
}
|
|
14521
|
+
encode(decoded) {
|
|
14522
|
+
decoded = decoded || this.decoded;
|
|
14523
|
+
const validators = [];
|
|
14524
|
+
const transactions = [];
|
|
14525
|
+
for (const validator of decoded.validators) {
|
|
14526
|
+
if (validator instanceof ValidatorMessage)
|
|
14527
|
+
validators.push(validator.encode());
|
|
14528
|
+
else
|
|
14529
|
+
validators.push(new ValidatorMessage(validator).encode());
|
|
14530
|
+
}
|
|
14531
|
+
for (const transaction of decoded.transactions) {
|
|
14532
|
+
if (transaction instanceof TransactionMessage)
|
|
14533
|
+
transactions.push(transaction.encode());
|
|
14534
|
+
else
|
|
14535
|
+
transactions.push(new TransactionMessage(transaction).encode());
|
|
14536
|
+
}
|
|
14537
|
+
return super.encode({
|
|
14538
|
+
...decoded,
|
|
14539
|
+
validators: index$5(validators),
|
|
14540
|
+
transactions: index$5(transactions)
|
|
14541
|
+
});
|
|
14542
|
+
}
|
|
14543
|
+
decode(encoded) {
|
|
14544
|
+
encoded = encoded || this.encoded;
|
|
14545
|
+
super.decode(encoded);
|
|
14546
|
+
// @ts-ignore
|
|
14547
|
+
this.decoded.transactions = index$4(this.decoded.transactions).map((transaction) => new TransactionMessage(transaction).decoded);
|
|
14548
|
+
// @ts-ignore
|
|
14549
|
+
this.decoded.validators = index$4(this.decoded.validators).map((validator) => new ValidatorMessage(validator).decoded);
|
|
14550
|
+
return this.decoded;
|
|
14551
|
+
}
|
|
14551
14552
|
}
|
|
14552
14553
|
|
|
14553
14554
|
var proto$3 = {
|
|
@@ -14623,4 +14624,4 @@ var _polyfillNode_child_process = /*#__PURE__*/Object.freeze({
|
|
|
14623
14624
|
__proto__: null
|
|
14624
14625
|
});
|
|
14625
14626
|
|
|
14626
|
-
export { BlockMessage as B, ContractMessage as C, Logger as L, RawTransactionMessage as R, TransactionMessage as T, ValidatorMessage as V, _polyfillNode_child_process as _, BWMessage as a, BWRequestMessage as b, BigNumber as c, arrayify as d, isBytes as e, getDefaultExportFromCjs as f, global$1 as g, hexZeroPad as h, isBigNumberish as i, toBase58 as t, version as v };
|
|
14627
|
+
export { BlockMessage as B, ContractMessage as C, FormatInterface as F, Logger as L, RawTransactionMessage as R, TransactionMessage as T, ValidatorMessage as V, _polyfillNode_child_process as _, BWMessage as a, BWRequestMessage as b, BigNumber as c, arrayify as d, isBytes as e, getDefaultExportFromCjs as f, global$1 as g, hexZeroPad as h, isBigNumberish as i, toBase58 as t, version as v };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { g as getDefaultExportFromCjs } from './node-browser-
|
|
2
|
-
import './_polyfill-node.child_process-
|
|
1
|
+
import { g as getDefaultExportFromCjs } from './node-browser-CeM_F-HL.js';
|
|
2
|
+
import './_polyfill-node.child_process-CblghArn.js';
|
|
3
3
|
|
|
4
4
|
var global;
|
|
5
5
|
var hasRequiredGlobal;
|