@leofcoin/chain 1.10.14 → 1.10.15
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/beacon-envelope.js +1 -1
- package/exports/browser/beacon-epoch.js +1 -1
- package/exports/browser/beacon-lifecycle.js +1 -1
- package/exports/browser/beacon-round.js +1 -1
- package/exports/browser/beacon-wire.js +2 -2
- package/exports/browser/beacon.js +1 -1
- package/exports/browser/{browser-DvU1xNFS-BJCQsckZ.js → browser-DvU1xNFS-DmmNUdE-.js} +3 -3
- package/exports/browser/{browser-crypto-Yk_e6OHw.js → browser-crypto-B9N9KlL4.js} +1 -1
- package/exports/browser/chain.js +3 -3
- package/exports/browser/{client-DDC8C510-CUi3_3uT.js → client-DDC8C510-3uaB70KL.js} +4 -4
- package/exports/browser/{connection-monitor-BjXI0nBP.js → connection-monitor-GPztgSSJ.js} +2 -1
- package/exports/browser/{index-Bxr5Iztg-AmkW0EHS.js → index-Bxr5Iztg-WbFIosyf.js} +3 -3
- package/exports/browser/{index-C_RakUAS.js → index-Ccn5sExe.js} +1 -1
- package/exports/browser/{messages-DH0tgNM9-CZwrcL37.js → messages-DH0tgNM9-C2CtyLsf.js} +3 -3
- package/exports/browser/{node-browser-CQugE1WZ.js → node-browser-BYi7D_oa.js} +5 -5
- package/exports/browser/node-browser.js +3 -3
- package/exports/browser/workers/machine-worker.js +16 -4
- package/exports/node.js +5 -0
- package/exports/workers/machine-worker.js +16 -4
- package/package.json +5 -1
- package/exports/browser/browser-DvU1xNFS-4-PGqr4c.js +0 -151
- package/exports/browser/browser-DvU1xNFS-D9eSzJGJ.js +0 -151
- package/exports/browser/browser-crypto-BHeOz9rj.js +0 -8893
- package/exports/browser/browser-crypto-CTP3Yk4M.js +0 -8893
- package/exports/browser/client-DDC8C510-DbIdQjhy.js +0 -2225
- package/exports/browser/client-DDC8C510-ZN_MLo1Y.js +0 -2225
- package/exports/browser/connection-monitor-Cf0vNDCA.js +0 -453
- package/exports/browser/connection-monitor-pdopeM1I.js +0 -453
- package/exports/browser/hkdf-B9AXp_7K.js +0 -222
- package/exports/browser/index-Bxr5Iztg-Bdpw_E83.js +0 -40
- package/exports/browser/index-Bxr5Iztg-CxXVYm3t.js +0 -40
- package/exports/browser/index-CPQ5yvZ2.js +0 -4995
- package/exports/browser/index-uFaocBqT.js +0 -4995
- package/exports/browser/messages-DH0tgNM9-BRp0gcJh.js +0 -208
- package/exports/browser/messages-DH0tgNM9-DkNnpePH.js +0 -208
- package/exports/browser/node-browser-1VSuCeew.js +0 -17880
- package/exports/browser/node-browser-wDmRaOEo.js +0 -17880
- package/exports/browser/sha2-Dkoic3vb.js +0 -602
- package/exports/browser/weierstrass-HGdA_prK.js +0 -2156
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { H as Hash, h as hash, t as toBytes, e as exists, b as bytes, w as weierstrass, r as randomBytes, c as concatBytes, F as Field, m as mod, p as pow2, s as sha256 } from './weierstrass-
|
|
1
|
+
import { H as Hash, h as hash, t as toBytes, e as exists, b as bytes, w as weierstrass, r as randomBytes, c as concatBytes, F as Field, m as mod, p as pow2, s as sha256 } from './weierstrass-Q0QND1ZT.js';
|
|
2
2
|
import { h as hkdf } from './hkdf-CnZvwpZ9.js';
|
|
3
3
|
import { s as sha256$1 } from './sha2-piimb6xL.js';
|
|
4
4
|
|
|
@@ -2,7 +2,7 @@ import { s as sha256 } from './sha2-piimb6xL.js';
|
|
|
2
2
|
import { t as toBase58, f as fromBase58 } from './index-CvKt4UDE.js';
|
|
3
3
|
import { deriveBeaconGroupPublicKey } from './beacon.js';
|
|
4
4
|
import { q as quorumThreshold } from './quorum-S_qdgiAY.js';
|
|
5
|
-
import './weierstrass-
|
|
5
|
+
import './weierstrass-Q0QND1ZT.js';
|
|
6
6
|
|
|
7
7
|
const encoder = new TextEncoder();
|
|
8
8
|
const lengthPrefix = (bytes) => {
|
|
@@ -3,7 +3,7 @@ import { s as sha256 } from './sha2-piimb6xL.js';
|
|
|
3
3
|
import { canonicalBeaconEpochConfig, beaconEpochDigest } from './beacon-epoch.js';
|
|
4
4
|
import './index-CvKt4UDE.js';
|
|
5
5
|
import './beacon.js';
|
|
6
|
-
import './weierstrass-
|
|
6
|
+
import './weierstrass-Q0QND1ZT.js';
|
|
7
7
|
import './quorum-S_qdgiAY.js';
|
|
8
8
|
|
|
9
9
|
const encoder = new TextEncoder();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { f as fromBase58, t as toBase58 } from './index-CvKt4UDE.js';
|
|
2
2
|
import { beaconMessage, deriveBeaconPublicShare, verifyBeaconSignatureShare, reconstructBeaconSignature, verifyBeaconProof, beaconRandomness } from './beacon.js';
|
|
3
3
|
import { canonicalBeaconEpochConfig, beaconParticipants, beaconEpochGroupPublicKey } from './beacon-epoch.js';
|
|
4
|
-
import './weierstrass-
|
|
4
|
+
import './weierstrass-Q0QND1ZT.js';
|
|
5
5
|
import './sha2-piimb6xL.js';
|
|
6
6
|
import './quorum-S_qdgiAY.js';
|
|
7
7
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { s as signTransaction, c as MultiWallet, d as createTransactionHash } from './index-
|
|
1
|
+
import { s as signTransaction, c as MultiWallet, d as createTransactionHash } from './index-Ccn5sExe.js';
|
|
2
2
|
import { f as fromBase58 } from './index-CvKt4UDE.js';
|
|
3
|
-
import './browser-crypto-
|
|
3
|
+
import './browser-crypto-B9N9KlL4.js';
|
|
4
4
|
import './sha2-piimb6xL.js';
|
|
5
5
|
|
|
6
6
|
const validInteger = (value, minimum = 0n) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { v as validateObject, m as mod, u as utf8ToBytes, a as concatBytes, d as bytesToNumberBE, f as bitLen, g as weierstrassPoints, i as getMinHashLength, j as mapHashToField, k as bitGet, l as ensureBytes, F as Field, s as sha256, n as FpInvertBatch, o as FpPow, q as bitMask, x as mapToCurveSimpleSWU, y as bitSet, r as randomBytes, z as bytesToHex, A as numberToBytesBE } from './weierstrass-
|
|
1
|
+
import { v as validateObject, m as mod, u as utf8ToBytes, a as concatBytes, d as bytesToNumberBE, f as bitLen, g as weierstrassPoints, i as getMinHashLength, j as mapHashToField, k as bitGet, l as ensureBytes, F as Field, s as sha256, n as FpInvertBatch, o as FpPow, q as bitMask, x as mapToCurveSimpleSWU, y as bitSet, r as randomBytes, z as bytesToHex, A as numberToBytesBE } from './weierstrass-Q0QND1ZT.js';
|
|
2
2
|
import { s as sha256$1 } from './sha2-piimb6xL.js';
|
|
3
3
|
|
|
4
4
|
function validateDST(dst) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { g as getDefaultExportFromCjs } from './node-browser-
|
|
2
|
-
import './browser-crypto-
|
|
1
|
+
import { g as getDefaultExportFromCjs } from './node-browser-BYi7D_oa.js';
|
|
2
|
+
import './browser-crypto-B9N9KlL4.js';
|
|
3
3
|
import './index-CvKt4UDE.js';
|
|
4
4
|
import './sha2-piimb6xL.js';
|
|
5
|
-
import './connection-monitor-
|
|
5
|
+
import './connection-monitor-GPztgSSJ.js';
|
|
6
6
|
|
|
7
7
|
function _mergeNamespaces$1(n, m) {
|
|
8
8
|
m.forEach(function (e) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as index$4, b as base58$1, i as index$5, f as fromBase58, c as fromHex, d as fromArrayLike, e as toBase32, t as toBase58, g as toHex } from './index-CvKt4UDE.js';
|
|
2
|
-
import { s as sha256 } from './sha2-
|
|
2
|
+
import { s as sha256 } from './sha2-piimb6xL.js';
|
|
3
3
|
|
|
4
4
|
var isHex = string => /^[A-F0-9]+$/i.test(
|
|
5
5
|
string.startsWith('0x') ?
|
package/exports/browser/chain.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { F as FormatInterface, p as proto, a as proto$1, b as proto$2, T as TransactionMessage, j as jsonStringifyBigInt, c as jsonParseBigInt, C as ContractMessage, d as Codec } from './browser-crypto-
|
|
2
|
-
import { B as BlockMessage, L as LastBlockMessage, P as PROTOCOL_VERSION, R as REACHED_ONE_ZERO_ZERO, C as ConnectionMonitor, a as BWMessage, S as StateMessage } from './connection-monitor-
|
|
3
|
-
import { M as MAX_TRANSACTION_BYTES, a as MAX_BLOCK_TRANSACTION_BYTES, b as MAX_BLOCK_TRANSACTIONS, c as MultiWallet, d as createTransactionHash, e as calculateFee, f as createContractMessage, s as signTransaction, r as randombytes, g as distributeTransactionFee, h as supportsTransactionFees, i as supportsMonetaryPolicy, v as validateBlockResourceLimits, j as calculateMonetaryPolicy, k as distributeAmount, l as aggregateValidatorFees, m as MONETARY_POLICY_AUTHORITY, n as contractFactoryMessage, o as nativeTokenMessage, p as validatorsMessage, q as nameServiceMessage, t as parseUnits, u as formatUnits } from './index-
|
|
1
|
+
import { F as FormatInterface, p as proto, a as proto$1, b as proto$2, T as TransactionMessage, j as jsonStringifyBigInt, c as jsonParseBigInt, C as ContractMessage, d as Codec } from './browser-crypto-B9N9KlL4.js';
|
|
2
|
+
import { B as BlockMessage, L as LastBlockMessage, P as PROTOCOL_VERSION, R as REACHED_ONE_ZERO_ZERO, C as ConnectionMonitor, a as BWMessage, S as StateMessage } from './connection-monitor-GPztgSSJ.js';
|
|
3
|
+
import { M as MAX_TRANSACTION_BYTES, a as MAX_BLOCK_TRANSACTION_BYTES, b as MAX_BLOCK_TRANSACTIONS, c as MultiWallet, d as createTransactionHash, e as calculateFee, f as createContractMessage, s as signTransaction, r as randombytes, g as distributeTransactionFee, h as supportsTransactionFees, i as supportsMonetaryPolicy, v as validateBlockResourceLimits, j as calculateMonetaryPolicy, k as distributeAmount, l as aggregateValidatorFees, m as MONETARY_POLICY_AUTHORITY, n as contractFactoryMessage, o as nativeTokenMessage, p as validatorsMessage, q as nameServiceMessage, t as parseUnits, u as formatUnits } from './index-Ccn5sExe.js';
|
|
4
4
|
import { f as fromBase58 } from './index-CvKt4UDE.js';
|
|
5
5
|
import { q as quorumThreshold } from './quorum-S_qdgiAY.js';
|
|
6
6
|
import './sha2-piimb6xL.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as inflate_1, c as createDebugger, d as deflate_1, L as LittlePubSub } from './node-browser-
|
|
2
|
-
import './browser-crypto-
|
|
3
|
-
import './connection-monitor-
|
|
1
|
+
import { i as inflate_1, c as createDebugger, d as deflate_1, L as LittlePubSub } from './node-browser-BYi7D_oa.js';
|
|
2
|
+
import './browser-crypto-B9N9KlL4.js';
|
|
3
|
+
import './connection-monitor-GPztgSSJ.js';
|
|
4
4
|
import './index-CvKt4UDE.js';
|
|
5
5
|
import './sha2-piimb6xL.js';
|
|
6
6
|
|
|
@@ -233,7 +233,7 @@ class SocketRequestClient {
|
|
|
233
233
|
const init = async () => {
|
|
234
234
|
// @ts-ignore
|
|
235
235
|
if (!globalThis.WebSocket && !this.#experimentalWebsocket)
|
|
236
|
-
globalThis.WebSocket = (await import('./browser-DvU1xNFS-
|
|
236
|
+
globalThis.WebSocket = (await import('./browser-DvU1xNFS-DmmNUdE-.js').then(function (n) { return n.b; })).default.w3cwebsocket;
|
|
237
237
|
const client = new WebSocket(this.#url, this.#protocol);
|
|
238
238
|
if (this.#experimentalWebsocket) {
|
|
239
239
|
client.addEventListener('error', this.onerror);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as FormatInterface, o as proto$2, q as proto$3, i as index, f as index$1, r as proto$4 } from './browser-crypto-
|
|
1
|
+
import { F as FormatInterface, o as proto$2, q as proto$3, i as index, f as index$1, r as proto$4 } from './browser-crypto-B9N9KlL4.js';
|
|
2
2
|
|
|
3
3
|
class ValidatorMessage extends FormatInterface {
|
|
4
4
|
get messageName() {
|
|
@@ -103,6 +103,7 @@ var networks = {
|
|
|
103
103
|
// todo webrtc and bittorent stars
|
|
104
104
|
},
|
|
105
105
|
peach: {
|
|
106
|
+
faucet: "https://remote.leofcoin.org/faucet",
|
|
106
107
|
port: 44444,
|
|
107
108
|
description: "Main testnet: latest step before merging into main",
|
|
108
109
|
versionHash: "1",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { M as MultiWallet, e as encrypt, b as base58$1 } from './node-browser-
|
|
2
|
-
import './browser-crypto-
|
|
3
|
-
import './connection-monitor-
|
|
1
|
+
import { M as MultiWallet, e as encrypt, b as base58$1 } from './node-browser-BYi7D_oa.js';
|
|
2
|
+
import './browser-crypto-B9N9KlL4.js';
|
|
3
|
+
import './connection-monitor-GPztgSSJ.js';
|
|
4
4
|
import './index-CvKt4UDE.js';
|
|
5
5
|
import './sha2-piimb6xL.js';
|
|
6
6
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as FormatInterface, e as proto, T as TransactionMessage, C as ContractMessage, i as index$1, f as index$2, g as createRIPEMD160, h as createHMAC, k as createSHA512, l as createKeccak, m as index$3, n as createHash$1 } from './browser-crypto-
|
|
1
|
+
import { F as FormatInterface, e as proto, T as TransactionMessage, C as ContractMessage, i as index$1, f as index$2, g as createRIPEMD160, h as createHMAC, k as createSHA512, l as createKeccak, m as index$3, n as createHash$1 } from './browser-crypto-B9N9KlL4.js';
|
|
2
2
|
import { t as toBase58, b as base58$1, i as index$4 } from './index-CvKt4UDE.js';
|
|
3
3
|
|
|
4
4
|
/* Do NOT modify this file; see /src.ts/_admin/update-version.ts */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { F as FormatInterface } from './node-browser-
|
|
2
|
-
import './browser-crypto-
|
|
3
|
-
import './connection-monitor-
|
|
1
|
+
import { F as FormatInterface } from './node-browser-BYi7D_oa.js';
|
|
2
|
+
import './browser-crypto-B9N9KlL4.js';
|
|
3
|
+
import './connection-monitor-GPztgSSJ.js';
|
|
4
4
|
import './index-CvKt4UDE.js';
|
|
5
5
|
import './sha2-piimb6xL.js';
|
|
6
6
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as FormatInterface$2, T as TransactionMessage, C as ContractMessage, n as createHash$1 } from './browser-crypto-
|
|
2
|
-
import { B as BlockMessage, a as BWMessage, V as ValidatorMessage, S as StateMessage, L as LastBlockMessage, D as DEFAULT_NODE_OPTIONS, g as guardPeerMessages } from './connection-monitor-
|
|
1
|
+
import { F as FormatInterface$2, T as TransactionMessage, C as ContractMessage, n as createHash$1 } from './browser-crypto-B9N9KlL4.js';
|
|
2
|
+
import { B as BlockMessage, a as BWMessage, V as ValidatorMessage, S as StateMessage, L as LastBlockMessage, D as DEFAULT_NODE_OPTIONS, g as guardPeerMessages } from './connection-monitor-GPztgSSJ.js';
|
|
3
3
|
import './index-CvKt4UDE.js';
|
|
4
4
|
|
|
5
5
|
var proto = {};
|
|
@@ -8390,7 +8390,7 @@ class Identity {
|
|
|
8390
8390
|
this.selectedAccount = new TextDecoder().decode(selected);
|
|
8391
8391
|
}
|
|
8392
8392
|
else {
|
|
8393
|
-
const importee = await import(/* webpackChunkName: "generate-account" */ './index-Bxr5Iztg-
|
|
8393
|
+
const importee = await import(/* webpackChunkName: "generate-account" */ './index-Bxr5Iztg-WbFIosyf.js');
|
|
8394
8394
|
const { identity, accounts } = await importee.default(password, this.network);
|
|
8395
8395
|
if (fresh) {
|
|
8396
8396
|
await globalThis.accountStore.clear();
|
|
@@ -17139,7 +17139,7 @@ class Peernet {
|
|
|
17139
17139
|
await getAddress();
|
|
17140
17140
|
this.storePrefix = options.storePrefix;
|
|
17141
17141
|
this.root = options.root;
|
|
17142
|
-
const { RequestMessage, ResponseMessage, PeerMessage, PeerMessageResponse, PeernetMessage, DHTMessage, DHTMessageResponse, DataMessage, DataMessageResponse, PsMessage, ChatMessage, PeernetFile } = await import(/* webpackChunkName: "messages" */ './messages-DH0tgNM9-
|
|
17142
|
+
const { RequestMessage, ResponseMessage, PeerMessage, PeerMessageResponse, PeernetMessage, DHTMessage, DHTMessageResponse, DataMessage, DataMessageResponse, PsMessage, ChatMessage, PeernetFile } = await import(/* webpackChunkName: "messages" */ './messages-DH0tgNM9-C2CtyLsf.js');
|
|
17143
17143
|
/**
|
|
17144
17144
|
* proto Object containing protos
|
|
17145
17145
|
* @type {Object}
|
|
@@ -17186,7 +17186,7 @@ class Peernet {
|
|
|
17186
17186
|
if (this.#starting || this.#started)
|
|
17187
17187
|
return;
|
|
17188
17188
|
this.#starting = true;
|
|
17189
|
-
const importee = await import('./client-DDC8C510-
|
|
17189
|
+
const importee = await import('./client-DDC8C510-3uaB70KL.js');
|
|
17190
17190
|
/**
|
|
17191
17191
|
* @access public
|
|
17192
17192
|
* @type {PeernetClient}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { N as default } from './node-browser-
|
|
2
|
-
import './browser-crypto-
|
|
3
|
-
import './connection-monitor-
|
|
1
|
+
export { N as default } from './node-browser-BYi7D_oa.js';
|
|
2
|
+
import './browser-crypto-B9N9KlL4.js';
|
|
3
|
+
import './connection-monitor-GPztgSSJ.js';
|
|
4
4
|
import './index-CvKt4UDE.js';
|
|
5
5
|
import './sha2-piimb6xL.js';
|
|
@@ -6503,6 +6503,16 @@ const aobject = (value, label) => {
|
|
|
6503
6503
|
if (value === null || typeof value !== 'object' || Array.isArray(value))
|
|
6504
6504
|
throw new TypeError((label === 'object' ? '' : `"${label}" `) + 'expected object, got type=' + typeof value);
|
|
6505
6505
|
};
|
|
6506
|
+
const aopts = (value, label) => {
|
|
6507
|
+
aobject(value, label);
|
|
6508
|
+
const proto = Object.getPrototypeOf(value);
|
|
6509
|
+
if (proto !== Object.prototype && proto !== null)
|
|
6510
|
+
throw new TypeError(`"${label}" expected plain object`);
|
|
6511
|
+
// Object.assign() treats an own "__proto__" source key as a write to the target's legacy
|
|
6512
|
+
// prototype setter. Reject it before merging so inherited option values cannot be injected.
|
|
6513
|
+
if (Object.hasOwn(value, '__proto__'))
|
|
6514
|
+
throw new TypeError(`"${label}.__proto__" is not allowed`);
|
|
6515
|
+
};
|
|
6506
6516
|
/**
|
|
6507
6517
|
* Asserts a hash instance has not been destroyed or finished.
|
|
6508
6518
|
* @param instance - hash instance to validate
|
|
@@ -6596,7 +6606,7 @@ function rotr(word, shift) {
|
|
|
6596
6606
|
* @param defaults - base option object
|
|
6597
6607
|
* @param opts - user overrides
|
|
6598
6608
|
* @param title - label included in thrown override errors
|
|
6599
|
-
* @returns
|
|
6609
|
+
* @returns Fresh merged option object with a null prototype.
|
|
6600
6610
|
* @throws On wrong argument types. {@link TypeError}
|
|
6601
6611
|
* @example
|
|
6602
6612
|
* Merge user overrides onto default options.
|
|
@@ -6605,10 +6615,12 @@ function rotr(word, shift) {
|
|
|
6605
6615
|
* ```
|
|
6606
6616
|
*/
|
|
6607
6617
|
function checkOpts(defaults, opts, title = 'opts') {
|
|
6608
|
-
|
|
6618
|
+
aopts(defaults, 'defaults');
|
|
6609
6619
|
if (opts !== undefined)
|
|
6610
|
-
|
|
6611
|
-
|
|
6620
|
+
aopts(opts, title);
|
|
6621
|
+
// Callers read optional fields directly, so omitted values must not fall through to ambient
|
|
6622
|
+
// Object.prototype pollution (for example a forged `dkLen` changing SHAKE's default output).
|
|
6623
|
+
const merged = Object.assign(Object.create(null), defaults, opts);
|
|
6612
6624
|
return merged;
|
|
6613
6625
|
}
|
|
6614
6626
|
/**
|
package/exports/node.js
CHANGED
|
@@ -11,6 +11,11 @@ class Node {
|
|
|
11
11
|
}
|
|
12
12
|
async _init(config = { autoStart: false }, password) {
|
|
13
13
|
config = { ...DEFAULT_NODE_OPTIONS, ...config };
|
|
14
|
+
const backend = config.transport?.webrtc?.backend || process.env.NETPEER_SWARM_WRTC_BACKEND || "vandeurenglenn";
|
|
15
|
+
if (backend === "vandeurenglenn" && !globalThis.RTCPeerConnection && !globalThis.wrtc) {
|
|
16
|
+
globalThis.wrtc = await import('@vandeurenglenn/wrtc');
|
|
17
|
+
globalThis.__swarmWrtcImpl = backend;
|
|
18
|
+
}
|
|
14
19
|
if (config.storeNamespace && !config.root) {
|
|
15
20
|
const [network, networkVersion] = config.network.split(":");
|
|
16
21
|
config.root = `.${network}/${networkVersion || config.networkVersion}/${config.storeNamespace}`;
|
|
@@ -6503,6 +6503,16 @@ const aobject = (value, label) => {
|
|
|
6503
6503
|
if (value === null || typeof value !== 'object' || Array.isArray(value))
|
|
6504
6504
|
throw new TypeError((label === 'object' ? '' : `"${label}" `) + 'expected object, got type=' + typeof value);
|
|
6505
6505
|
};
|
|
6506
|
+
const aopts = (value, label) => {
|
|
6507
|
+
aobject(value, label);
|
|
6508
|
+
const proto = Object.getPrototypeOf(value);
|
|
6509
|
+
if (proto !== Object.prototype && proto !== null)
|
|
6510
|
+
throw new TypeError(`"${label}" expected plain object`);
|
|
6511
|
+
// Object.assign() treats an own "__proto__" source key as a write to the target's legacy
|
|
6512
|
+
// prototype setter. Reject it before merging so inherited option values cannot be injected.
|
|
6513
|
+
if (Object.hasOwn(value, '__proto__'))
|
|
6514
|
+
throw new TypeError(`"${label}.__proto__" is not allowed`);
|
|
6515
|
+
};
|
|
6506
6516
|
/**
|
|
6507
6517
|
* Asserts a hash instance has not been destroyed or finished.
|
|
6508
6518
|
* @param instance - hash instance to validate
|
|
@@ -6596,7 +6606,7 @@ function rotr(word, shift) {
|
|
|
6596
6606
|
* @param defaults - base option object
|
|
6597
6607
|
* @param opts - user overrides
|
|
6598
6608
|
* @param title - label included in thrown override errors
|
|
6599
|
-
* @returns
|
|
6609
|
+
* @returns Fresh merged option object with a null prototype.
|
|
6600
6610
|
* @throws On wrong argument types. {@link TypeError}
|
|
6601
6611
|
* @example
|
|
6602
6612
|
* Merge user overrides onto default options.
|
|
@@ -6605,10 +6615,12 @@ function rotr(word, shift) {
|
|
|
6605
6615
|
* ```
|
|
6606
6616
|
*/
|
|
6607
6617
|
function checkOpts(defaults, opts, title = 'opts') {
|
|
6608
|
-
|
|
6618
|
+
aopts(defaults, 'defaults');
|
|
6609
6619
|
if (opts !== undefined)
|
|
6610
|
-
|
|
6611
|
-
|
|
6620
|
+
aopts(opts, title);
|
|
6621
|
+
// Callers read optional fields directly, so omitted values must not fall through to ambient
|
|
6622
|
+
// Object.prototype pollution (for example a forged `dkLen` changing SHAKE's default output).
|
|
6623
|
+
const merged = Object.assign(Object.create(null), defaults, opts);
|
|
6612
6624
|
return merged;
|
|
6613
6625
|
}
|
|
6614
6626
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leofcoin/chain",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.15",
|
|
4
4
|
"description": "Official javascript implementation",
|
|
5
5
|
"private": false,
|
|
6
6
|
"exports": {
|
|
@@ -47,6 +47,9 @@
|
|
|
47
47
|
"./workers/machine-worker": "./exports/workers/machine-worker.js"
|
|
48
48
|
},
|
|
49
49
|
"type": "module",
|
|
50
|
+
"engines": {
|
|
51
|
+
"node": ">=24.15.0"
|
|
52
|
+
},
|
|
50
53
|
"files": [
|
|
51
54
|
"./exports",
|
|
52
55
|
"./types",
|
|
@@ -87,6 +90,7 @@
|
|
|
87
90
|
"tslib": "^2.8.1"
|
|
88
91
|
},
|
|
89
92
|
"dependencies": {
|
|
93
|
+
"@vandeurenglenn/wrtc": "^0.7.2",
|
|
90
94
|
"@noble/curves": "^1.2.0",
|
|
91
95
|
"@noble/hashes": "^2.3.0",
|
|
92
96
|
"@leofcoin/addresses": "^1.0.62",
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
import { g as getDefaultExportFromCjs } from './node-browser-1VSuCeew.js';
|
|
2
|
-
import './browser-crypto-BHeOz9rj.js';
|
|
3
|
-
import './index-CvKt4UDE.js';
|
|
4
|
-
import './sha2-Dkoic3vb.js';
|
|
5
|
-
import './connection-monitor-BjXI0nBP.js';
|
|
6
|
-
|
|
7
|
-
function _mergeNamespaces$1(n, m) {
|
|
8
|
-
m.forEach(function (e) {
|
|
9
|
-
e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
|
|
10
|
-
if (k !== 'default' && !(k in n)) {
|
|
11
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
12
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () { return e[k]; }
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
});
|
|
19
|
-
return Object.freeze(n);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
var global;
|
|
23
|
-
var hasRequiredGlobal;
|
|
24
|
-
|
|
25
|
-
function requireGlobal () {
|
|
26
|
-
if (hasRequiredGlobal) return global;
|
|
27
|
-
hasRequiredGlobal = 1;
|
|
28
|
-
var naiveFallback = function () {
|
|
29
|
-
if (typeof self === "object" && self) return self;
|
|
30
|
-
if (typeof window === "object" && window) return window;
|
|
31
|
-
throw new Error("Unable to resolve global `this`");
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
global = (function () {
|
|
35
|
-
if (this) return this;
|
|
36
|
-
|
|
37
|
-
// Unexpected strict mode (may happen if e.g. bundled into ESM module)
|
|
38
|
-
|
|
39
|
-
// Fallback to standard globalThis if available
|
|
40
|
-
if (typeof globalThis === "object" && globalThis) return globalThis;
|
|
41
|
-
|
|
42
|
-
// Thanks @mathiasbynens -> https://mathiasbynens.be/notes/globalthis
|
|
43
|
-
// In all ES5+ engines global object inherits from Object.prototype
|
|
44
|
-
// (if you approached one that doesn't please report)
|
|
45
|
-
try {
|
|
46
|
-
Object.defineProperty(Object.prototype, "__global__", {
|
|
47
|
-
get: function () { return this; },
|
|
48
|
-
configurable: true
|
|
49
|
-
});
|
|
50
|
-
} catch (error) {
|
|
51
|
-
// Unfortunate case of updates to Object.prototype being restricted
|
|
52
|
-
// via preventExtensions, seal or freeze
|
|
53
|
-
return naiveFallback();
|
|
54
|
-
}
|
|
55
|
-
try {
|
|
56
|
-
// Safari case (window.__global__ works, but __global__ does not)
|
|
57
|
-
if (!__global__) return naiveFallback();
|
|
58
|
-
return __global__;
|
|
59
|
-
} finally {
|
|
60
|
-
delete Object.prototype.__global__;
|
|
61
|
-
}
|
|
62
|
-
})();
|
|
63
|
-
return global;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
var version$1 = "1.0.35";
|
|
67
|
-
var require$$0 = {
|
|
68
|
-
version: version$1};
|
|
69
|
-
|
|
70
|
-
var version;
|
|
71
|
-
var hasRequiredVersion;
|
|
72
|
-
|
|
73
|
-
function requireVersion () {
|
|
74
|
-
if (hasRequiredVersion) return version;
|
|
75
|
-
hasRequiredVersion = 1;
|
|
76
|
-
version = require$$0.version;
|
|
77
|
-
return version;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
var browser$2;
|
|
81
|
-
var hasRequiredBrowser;
|
|
82
|
-
|
|
83
|
-
function requireBrowser () {
|
|
84
|
-
if (hasRequiredBrowser) return browser$2;
|
|
85
|
-
hasRequiredBrowser = 1;
|
|
86
|
-
var _globalThis;
|
|
87
|
-
if (typeof globalThis === 'object') {
|
|
88
|
-
_globalThis = globalThis;
|
|
89
|
-
} else {
|
|
90
|
-
try {
|
|
91
|
-
_globalThis = requireGlobal();
|
|
92
|
-
} catch (error) {
|
|
93
|
-
} finally {
|
|
94
|
-
if (!_globalThis && typeof window !== 'undefined') { _globalThis = window; }
|
|
95
|
-
if (!_globalThis) { throw new Error('Could not determine global this'); }
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
var NativeWebSocket = _globalThis.WebSocket || _globalThis.MozWebSocket;
|
|
100
|
-
var websocket_version = requireVersion();
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* Expose a W3C WebSocket class with just one or two arguments.
|
|
105
|
-
*/
|
|
106
|
-
function W3CWebSocket(uri, protocols) {
|
|
107
|
-
var native_instance;
|
|
108
|
-
|
|
109
|
-
if (protocols) {
|
|
110
|
-
native_instance = new NativeWebSocket(uri, protocols);
|
|
111
|
-
}
|
|
112
|
-
else {
|
|
113
|
-
native_instance = new NativeWebSocket(uri);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* 'native_instance' is an instance of nativeWebSocket (the browser's WebSocket
|
|
118
|
-
* class). Since it is an Object it will be returned as it is when creating an
|
|
119
|
-
* instance of W3CWebSocket via 'new W3CWebSocket()'.
|
|
120
|
-
*
|
|
121
|
-
* ECMAScript 5: http://bclary.com/2004/11/07/#a-13.2.2
|
|
122
|
-
*/
|
|
123
|
-
return native_instance;
|
|
124
|
-
}
|
|
125
|
-
if (NativeWebSocket) {
|
|
126
|
-
['CONNECTING', 'OPEN', 'CLOSING', 'CLOSED'].forEach(function(prop) {
|
|
127
|
-
Object.defineProperty(W3CWebSocket, prop, {
|
|
128
|
-
get: function() { return NativeWebSocket[prop]; }
|
|
129
|
-
});
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* Module exports.
|
|
135
|
-
*/
|
|
136
|
-
browser$2 = {
|
|
137
|
-
'w3cwebsocket' : NativeWebSocket ? W3CWebSocket : null,
|
|
138
|
-
'version' : websocket_version
|
|
139
|
-
};
|
|
140
|
-
return browser$2;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
var browserExports = requireBrowser();
|
|
144
|
-
var browser = /*@__PURE__*/getDefaultExportFromCjs(browserExports);
|
|
145
|
-
|
|
146
|
-
var browser$1 = /*#__PURE__*/_mergeNamespaces$1({
|
|
147
|
-
__proto__: null,
|
|
148
|
-
default: browser
|
|
149
|
-
}, [browserExports]);
|
|
150
|
-
|
|
151
|
-
export { browser$1 as b };
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
import { g as getDefaultExportFromCjs } from './node-browser-wDmRaOEo.js';
|
|
2
|
-
import './browser-crypto-Yk_e6OHw.js';
|
|
3
|
-
import './index-CvKt4UDE.js';
|
|
4
|
-
import './sha2-Dkoic3vb.js';
|
|
5
|
-
import './connection-monitor-Cf0vNDCA.js';
|
|
6
|
-
|
|
7
|
-
function _mergeNamespaces$1(n, m) {
|
|
8
|
-
m.forEach(function (e) {
|
|
9
|
-
e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
|
|
10
|
-
if (k !== 'default' && !(k in n)) {
|
|
11
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
12
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () { return e[k]; }
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
});
|
|
19
|
-
return Object.freeze(n);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
var global;
|
|
23
|
-
var hasRequiredGlobal;
|
|
24
|
-
|
|
25
|
-
function requireGlobal () {
|
|
26
|
-
if (hasRequiredGlobal) return global;
|
|
27
|
-
hasRequiredGlobal = 1;
|
|
28
|
-
var naiveFallback = function () {
|
|
29
|
-
if (typeof self === "object" && self) return self;
|
|
30
|
-
if (typeof window === "object" && window) return window;
|
|
31
|
-
throw new Error("Unable to resolve global `this`");
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
global = (function () {
|
|
35
|
-
if (this) return this;
|
|
36
|
-
|
|
37
|
-
// Unexpected strict mode (may happen if e.g. bundled into ESM module)
|
|
38
|
-
|
|
39
|
-
// Fallback to standard globalThis if available
|
|
40
|
-
if (typeof globalThis === "object" && globalThis) return globalThis;
|
|
41
|
-
|
|
42
|
-
// Thanks @mathiasbynens -> https://mathiasbynens.be/notes/globalthis
|
|
43
|
-
// In all ES5+ engines global object inherits from Object.prototype
|
|
44
|
-
// (if you approached one that doesn't please report)
|
|
45
|
-
try {
|
|
46
|
-
Object.defineProperty(Object.prototype, "__global__", {
|
|
47
|
-
get: function () { return this; },
|
|
48
|
-
configurable: true
|
|
49
|
-
});
|
|
50
|
-
} catch (error) {
|
|
51
|
-
// Unfortunate case of updates to Object.prototype being restricted
|
|
52
|
-
// via preventExtensions, seal or freeze
|
|
53
|
-
return naiveFallback();
|
|
54
|
-
}
|
|
55
|
-
try {
|
|
56
|
-
// Safari case (window.__global__ works, but __global__ does not)
|
|
57
|
-
if (!__global__) return naiveFallback();
|
|
58
|
-
return __global__;
|
|
59
|
-
} finally {
|
|
60
|
-
delete Object.prototype.__global__;
|
|
61
|
-
}
|
|
62
|
-
})();
|
|
63
|
-
return global;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
var version$1 = "1.0.35";
|
|
67
|
-
var require$$0 = {
|
|
68
|
-
version: version$1};
|
|
69
|
-
|
|
70
|
-
var version;
|
|
71
|
-
var hasRequiredVersion;
|
|
72
|
-
|
|
73
|
-
function requireVersion () {
|
|
74
|
-
if (hasRequiredVersion) return version;
|
|
75
|
-
hasRequiredVersion = 1;
|
|
76
|
-
version = require$$0.version;
|
|
77
|
-
return version;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
var browser$2;
|
|
81
|
-
var hasRequiredBrowser;
|
|
82
|
-
|
|
83
|
-
function requireBrowser () {
|
|
84
|
-
if (hasRequiredBrowser) return browser$2;
|
|
85
|
-
hasRequiredBrowser = 1;
|
|
86
|
-
var _globalThis;
|
|
87
|
-
if (typeof globalThis === 'object') {
|
|
88
|
-
_globalThis = globalThis;
|
|
89
|
-
} else {
|
|
90
|
-
try {
|
|
91
|
-
_globalThis = requireGlobal();
|
|
92
|
-
} catch (error) {
|
|
93
|
-
} finally {
|
|
94
|
-
if (!_globalThis && typeof window !== 'undefined') { _globalThis = window; }
|
|
95
|
-
if (!_globalThis) { throw new Error('Could not determine global this'); }
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
var NativeWebSocket = _globalThis.WebSocket || _globalThis.MozWebSocket;
|
|
100
|
-
var websocket_version = requireVersion();
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* Expose a W3C WebSocket class with just one or two arguments.
|
|
105
|
-
*/
|
|
106
|
-
function W3CWebSocket(uri, protocols) {
|
|
107
|
-
var native_instance;
|
|
108
|
-
|
|
109
|
-
if (protocols) {
|
|
110
|
-
native_instance = new NativeWebSocket(uri, protocols);
|
|
111
|
-
}
|
|
112
|
-
else {
|
|
113
|
-
native_instance = new NativeWebSocket(uri);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* 'native_instance' is an instance of nativeWebSocket (the browser's WebSocket
|
|
118
|
-
* class). Since it is an Object it will be returned as it is when creating an
|
|
119
|
-
* instance of W3CWebSocket via 'new W3CWebSocket()'.
|
|
120
|
-
*
|
|
121
|
-
* ECMAScript 5: http://bclary.com/2004/11/07/#a-13.2.2
|
|
122
|
-
*/
|
|
123
|
-
return native_instance;
|
|
124
|
-
}
|
|
125
|
-
if (NativeWebSocket) {
|
|
126
|
-
['CONNECTING', 'OPEN', 'CLOSING', 'CLOSED'].forEach(function(prop) {
|
|
127
|
-
Object.defineProperty(W3CWebSocket, prop, {
|
|
128
|
-
get: function() { return NativeWebSocket[prop]; }
|
|
129
|
-
});
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* Module exports.
|
|
135
|
-
*/
|
|
136
|
-
browser$2 = {
|
|
137
|
-
'w3cwebsocket' : NativeWebSocket ? W3CWebSocket : null,
|
|
138
|
-
'version' : websocket_version
|
|
139
|
-
};
|
|
140
|
-
return browser$2;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
var browserExports = requireBrowser();
|
|
144
|
-
var browser = /*@__PURE__*/getDefaultExportFromCjs(browserExports);
|
|
145
|
-
|
|
146
|
-
var browser$1 = /*#__PURE__*/_mergeNamespaces$1({
|
|
147
|
-
__proto__: null,
|
|
148
|
-
default: browser
|
|
149
|
-
}, [browserExports]);
|
|
150
|
-
|
|
151
|
-
export { browser$1 as b };
|