@leofcoin/chain 1.7.55 → 1.7.66
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/{browser-DQJ6xf_F-BqXoTvHj.js → browser-DQJ6xf_F-D0onvbt2.js} +2 -2
- package/exports/browser/chain.js +2560 -6094
- package/exports/browser/{client-Depp28gl-CAZHe8Gn.js → client-Depp28gl-DItJEEYa.js} +4 -4
- package/exports/browser/{index-BeqbCwUk-CO_3tWk0.js → index-BeqbCwUk-DfNb2uRP.js} +2 -2
- package/exports/browser/{index-jJAWNcIz.js → index-CM4QYC3g.js} +217 -192
- package/exports/browser/{index-DqPlTtAJ-C6Al_ebv.js → index-DqPlTtAJ-Bczd-x6k.js} +2 -2
- package/exports/browser/{messages-RYLqPGkg-B8phafAq.js → messages-RYLqPGkg-Da9CI_ow.js} +2 -2
- package/exports/browser/{node-browser-CDiT4wAl.js → node-browser-DewO13hB.js} +4 -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 +73 -10
- package/exports/browser/workers/{worker-2Vk145X_-2Vk145X_.js → worker-4K8uC3xq-4K8uC3xq.js} +217 -192
- package/exports/chain.js +24 -16
- package/exports/helpers/contract.d.ts +4 -0
- package/exports/workers/block-worker.js +1 -1
- package/exports/workers/machine-worker.js +73 -10
- package/exports/workers/{worker-2Vk145X_-2Vk145X_.js → worker-4K8uC3xq-4K8uC3xq.js} +217 -192
- package/package.json +14 -14
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { L as LittlePubSub } from './node-browser-
|
|
2
|
-
import './index-
|
|
1
|
+
import { L as LittlePubSub } from './node-browser-DewO13hB.js';
|
|
2
|
+
import './index-CM4QYC3g.js';
|
|
3
3
|
|
|
4
4
|
class Api {
|
|
5
5
|
_pubsub;
|
|
@@ -209,7 +209,7 @@ class SocketRequestClient {
|
|
|
209
209
|
const init = async () => {
|
|
210
210
|
// @ts-ignore
|
|
211
211
|
if (!globalThis.WebSocket && !this.#experimentalWebsocket)
|
|
212
|
-
globalThis.WebSocket = (await import('./browser-DQJ6xf_F-
|
|
212
|
+
globalThis.WebSocket = (await import('./browser-DQJ6xf_F-D0onvbt2.js').then(function (n) { return n.b; })).default.w3cwebsocket;
|
|
213
213
|
const client = new WebSocket(this.#url, this.#protocol);
|
|
214
214
|
if (this.#experimentalWebsocket) {
|
|
215
215
|
client.addEventListener('error', this.onerror);
|
|
@@ -313,7 +313,7 @@ const iceServers = [
|
|
|
313
313
|
credential: 'openrelayproject'
|
|
314
314
|
}
|
|
315
315
|
];
|
|
316
|
-
const SimplePeer = (await import('./index-DqPlTtAJ-
|
|
316
|
+
const SimplePeer = (await import('./index-DqPlTtAJ-Bczd-x6k.js').then(function (n) { return n.i; })).default;
|
|
317
317
|
class Peer extends SimplePeer {
|
|
318
318
|
peerId;
|
|
319
319
|
channelName;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { M as MultiWallet, e as encrypt, b as base58$1 } from './node-browser-
|
|
2
|
-
import './index-
|
|
1
|
+
import { M as MultiWallet, e as encrypt, b as base58$1 } from './node-browser-DewO13hB.js';
|
|
2
|
+
import './index-CM4QYC3g.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* @params {String} network
|
|
@@ -7458,6 +7458,9 @@ var pako = {
|
|
|
7458
7458
|
constants: constants_1
|
|
7459
7459
|
};
|
|
7460
7460
|
|
|
7461
|
+
const jsonStringifyBigInt$1 = (key, value) => (typeof value === 'bigint' ? { $bigint: value.toString() } : value);
|
|
7462
|
+
const jsonParseBigInt$1 = (key, value) => typeof value === 'object' && value.$bigint ? BigInt(value.$bigint) : value;
|
|
7463
|
+
|
|
7461
7464
|
const { fromString, toString } = index$1;
|
|
7462
7465
|
const isJson = (type) => type === 'object' || 'array';
|
|
7463
7466
|
const isString = (type) => type === 'string';
|
|
@@ -7493,7 +7496,7 @@ const toType = (data) => {
|
|
|
7493
7496
|
return new TextEncoder().encode(data);
|
|
7494
7497
|
// returns the object as UintArray
|
|
7495
7498
|
if (typeof data === 'object')
|
|
7496
|
-
return new TextEncoder().encode(JSON.stringify(data));
|
|
7499
|
+
return new TextEncoder().encode(JSON.stringify(data, jsonStringifyBigInt$1));
|
|
7497
7500
|
// returns the number as UintArray
|
|
7498
7501
|
if (typeof data === 'number' || typeof data === 'boolean')
|
|
7499
7502
|
return new TextEncoder().encode(data.toString());
|
|
@@ -7539,7 +7542,7 @@ const decode = (proto, uint8Array, compressed) => {
|
|
|
7539
7542
|
else if (isBigInt(token.type))
|
|
7540
7543
|
output[token.key] = BigInt(new TextDecoder().decode(deconcated[i]));
|
|
7541
7544
|
else if (isJson(token.type))
|
|
7542
|
-
output[token.key] = JSON.parse(new TextDecoder().decode(deconcated[i]));
|
|
7545
|
+
output[token.key] = JSON.parse(new TextDecoder().decode(deconcated[i]), jsonParseBigInt$1);
|
|
7543
7546
|
if (token.optional) {
|
|
7544
7547
|
if (!output[token.key] || output[token.key].length === 0)
|
|
7545
7548
|
delete output[token.key];
|
|
@@ -7554,6 +7557,8 @@ var index = {
|
|
|
7554
7557
|
decode
|
|
7555
7558
|
};
|
|
7556
7559
|
|
|
7560
|
+
const jsonStringifyBigInt = (key, value) => typeof value === 'bigint' ? { $bigint: value.toString() } : value;
|
|
7561
|
+
const jsonParseBigInt = (key, value) => typeof value === 'object' && value.$bigint ? BigInt(value.$bigint) : value;
|
|
7557
7562
|
class BasicInterface {
|
|
7558
7563
|
#encoded;
|
|
7559
7564
|
#decoded;
|
|
@@ -7670,195 +7675,209 @@ class BasicInterface {
|
|
|
7670
7675
|
}
|
|
7671
7676
|
}
|
|
7672
7677
|
|
|
7673
|
-
const blockchainCodecs = [
|
|
7674
|
-
{
|
|
7675
|
-
name: 'leofcoin-block',
|
|
7676
|
-
codec: '0x6c62',
|
|
7677
|
-
hashAlg: 'dbl-keccak-512',
|
|
7678
|
-
},
|
|
7679
|
-
{
|
|
7680
|
-
name: 'leofcoin-tx',
|
|
7681
|
-
codec: '0x6c74',
|
|
7682
|
-
hashAlg: 'dbl-keccak-512',
|
|
7683
|
-
},
|
|
7684
|
-
{
|
|
7685
|
-
name: 'leofcoin-itx',
|
|
7686
|
-
codec: '0x6c69',
|
|
7687
|
-
hashAlg: 'keccak-512',
|
|
7688
|
-
},
|
|
7689
|
-
{
|
|
7690
|
-
name: 'leofcoin-pr',
|
|
7691
|
-
codec: '0x6c70',
|
|
7692
|
-
hashAlg: 'keccak-256',
|
|
7693
|
-
},
|
|
7694
|
-
{
|
|
7695
|
-
name: 'contract-message',
|
|
7696
|
-
codec: '0x63636d',
|
|
7697
|
-
hashAlg: 'keccak-256'
|
|
7698
|
-
},
|
|
7699
|
-
{
|
|
7700
|
-
name: 'transaction-message',
|
|
7701
|
-
codec: '0x746d',
|
|
7702
|
-
hashAlg: 'keccak-256'
|
|
7703
|
-
},
|
|
7704
|
-
{
|
|
7705
|
-
name: 'raw-transaction-message',
|
|
7706
|
-
codec: '0x772746d',
|
|
7707
|
-
hashAlg: 'keccak-256'
|
|
7708
|
-
},
|
|
7709
|
-
{
|
|
7710
|
-
name: 'block-message',
|
|
7711
|
-
codec: '0x626d',
|
|
7712
|
-
hashAlg: 'keccak-256'
|
|
7713
|
-
},
|
|
7714
|
-
{
|
|
7715
|
-
name: 'bw-message',
|
|
7716
|
-
codec: '0x62776d',
|
|
7717
|
-
hashAlg: 'keccak-256'
|
|
7718
|
-
},
|
|
7719
|
-
{
|
|
7720
|
-
name: 'bw-request-message',
|
|
7721
|
-
codec: '0x6277726d',
|
|
7722
|
-
hashAlg: 'keccak-256'
|
|
7723
|
-
},
|
|
7724
|
-
{
|
|
7725
|
-
name: 'validator-message',
|
|
7726
|
-
codec: '0x766d',
|
|
7727
|
-
hashAlg: 'keccak-256'
|
|
7728
|
-
}
|
|
7678
|
+
const blockchainCodecs = [
|
|
7679
|
+
{
|
|
7680
|
+
name: 'leofcoin-block',
|
|
7681
|
+
codec: '0x6c62',
|
|
7682
|
+
hashAlg: 'dbl-keccak-512',
|
|
7683
|
+
},
|
|
7684
|
+
{
|
|
7685
|
+
name: 'leofcoin-tx',
|
|
7686
|
+
codec: '0x6c74',
|
|
7687
|
+
hashAlg: 'dbl-keccak-512',
|
|
7688
|
+
},
|
|
7689
|
+
{
|
|
7690
|
+
name: 'leofcoin-itx',
|
|
7691
|
+
codec: '0x6c69',
|
|
7692
|
+
hashAlg: 'keccak-512',
|
|
7693
|
+
},
|
|
7694
|
+
{
|
|
7695
|
+
name: 'leofcoin-pr',
|
|
7696
|
+
codec: '0x6c70',
|
|
7697
|
+
hashAlg: 'keccak-256',
|
|
7698
|
+
},
|
|
7699
|
+
{
|
|
7700
|
+
name: 'contract-message',
|
|
7701
|
+
codec: '0x63636d',
|
|
7702
|
+
hashAlg: 'keccak-256'
|
|
7703
|
+
},
|
|
7704
|
+
{
|
|
7705
|
+
name: 'transaction-message',
|
|
7706
|
+
codec: '0x746d',
|
|
7707
|
+
hashAlg: 'keccak-256'
|
|
7708
|
+
},
|
|
7709
|
+
{
|
|
7710
|
+
name: 'raw-transaction-message',
|
|
7711
|
+
codec: '0x772746d',
|
|
7712
|
+
hashAlg: 'keccak-256'
|
|
7713
|
+
},
|
|
7714
|
+
{
|
|
7715
|
+
name: 'block-message',
|
|
7716
|
+
codec: '0x626d',
|
|
7717
|
+
hashAlg: 'keccak-256'
|
|
7718
|
+
},
|
|
7719
|
+
{
|
|
7720
|
+
name: 'bw-message',
|
|
7721
|
+
codec: '0x62776d',
|
|
7722
|
+
hashAlg: 'keccak-256'
|
|
7723
|
+
},
|
|
7724
|
+
{
|
|
7725
|
+
name: 'bw-request-message',
|
|
7726
|
+
codec: '0x6277726d',
|
|
7727
|
+
hashAlg: 'keccak-256'
|
|
7728
|
+
},
|
|
7729
|
+
{
|
|
7730
|
+
name: 'validator-message',
|
|
7731
|
+
codec: '0x766d',
|
|
7732
|
+
hashAlg: 'keccak-256'
|
|
7733
|
+
}
|
|
7729
7734
|
];
|
|
7730
7735
|
|
|
7731
|
-
const internalCodecs = [
|
|
7732
|
-
{
|
|
7733
|
-
name: '
|
|
7734
|
-
codec: '
|
|
7735
|
-
hashAlg: '
|
|
7736
|
-
},
|
|
7737
|
-
{
|
|
7738
|
-
name: '
|
|
7739
|
-
codec: '
|
|
7740
|
-
hashAlg: 'keccak-256'
|
|
7741
|
-
}
|
|
7742
|
-
{
|
|
7743
|
-
name: 'peernet-peer',
|
|
7744
|
-
codec: '0x7070',
|
|
7745
|
-
hashAlg: 'keccak-256',
|
|
7746
|
-
},
|
|
7747
|
-
{
|
|
7748
|
-
name: 'peernet-dht',
|
|
7749
|
-
codec: '0x706468',
|
|
7750
|
-
hashAlg: 'keccak-256',
|
|
7751
|
-
},
|
|
7752
|
-
{
|
|
7753
|
-
name: 'peernet-dht-response',
|
|
7754
|
-
codec: '0x706472',
|
|
7755
|
-
hashAlg: 'keccak-256',
|
|
7756
|
-
},
|
|
7757
|
-
{
|
|
7758
|
-
name: 'peernet-data',
|
|
7759
|
-
codec: '0x706461',
|
|
7760
|
-
hashAlg: 'keccak-256',
|
|
7761
|
-
},
|
|
7762
|
-
{
|
|
7763
|
-
name: 'peernet-data-response',
|
|
7764
|
-
codec: '0x70646172',
|
|
7765
|
-
hashAlg: 'keccak-256',
|
|
7766
|
-
},
|
|
7767
|
-
{
|
|
7768
|
-
name: 'peernet-message',
|
|
7769
|
-
codec: '0x706d65',
|
|
7770
|
-
hashAlg: 'keccak-256',
|
|
7771
|
-
},
|
|
7772
|
-
{
|
|
7773
|
-
name: 'peernet-ps',
|
|
7774
|
-
codec: '707073',
|
|
7775
|
-
hashAlg: 'keccak-256',
|
|
7776
|
-
},
|
|
7777
|
-
{
|
|
7778
|
-
name: 'peernet-response',
|
|
7779
|
-
codec: '0x7072',
|
|
7780
|
-
hashAlg: 'keccak-256',
|
|
7781
|
-
},
|
|
7782
|
-
{
|
|
7783
|
-
name: 'peernet-request',
|
|
7784
|
-
codec: '0x707271',
|
|
7785
|
-
hashAlg: 'keccak-256',
|
|
7786
|
-
},
|
|
7787
|
-
{
|
|
7788
|
-
name: 'peernet-file',
|
|
7789
|
-
codec: '0x7066',
|
|
7790
|
-
hashAlg: 'keccak-256',
|
|
7791
|
-
},
|
|
7792
|
-
{
|
|
7793
|
-
name: 'peernet-file-response',
|
|
7794
|
-
codec: '0x706672',
|
|
7795
|
-
hashAlg: 'keccak-256',
|
|
7796
|
-
}
|
|
7736
|
+
const internalCodecs = [
|
|
7737
|
+
{
|
|
7738
|
+
name: 'pubsub-request',
|
|
7739
|
+
codec: '0x70737271',
|
|
7740
|
+
hashAlg: 'keccak-256'
|
|
7741
|
+
},
|
|
7742
|
+
{
|
|
7743
|
+
name: 'pubsub-response',
|
|
7744
|
+
codec: '0x707372',
|
|
7745
|
+
hashAlg: 'keccak-256'
|
|
7746
|
+
}
|
|
7797
7747
|
];
|
|
7798
7748
|
|
|
7799
|
-
var social = [{
|
|
7800
|
-
name: 'chat-message',
|
|
7801
|
-
codec: '0x70636d',
|
|
7802
|
-
hashAlg: 'dbl-keccak-256',
|
|
7749
|
+
var social = [{
|
|
7750
|
+
name: 'chat-message',
|
|
7751
|
+
codec: '0x70636d',
|
|
7752
|
+
hashAlg: 'dbl-keccak-256',
|
|
7803
7753
|
}];
|
|
7804
7754
|
|
|
7805
|
-
const
|
|
7806
|
-
|
|
7807
|
-
|
|
7808
|
-
|
|
7755
|
+
const peernetCodecs = [
|
|
7756
|
+
{
|
|
7757
|
+
name: 'disco-hash',
|
|
7758
|
+
codec: '0x30',
|
|
7759
|
+
hashAlg: 'dbl-keccak-256',
|
|
7760
|
+
},
|
|
7761
|
+
{
|
|
7762
|
+
name: 'peernet-peer-response',
|
|
7763
|
+
codec: '0x707072',
|
|
7764
|
+
hashAlg: 'keccak-256',
|
|
7765
|
+
},
|
|
7766
|
+
{
|
|
7767
|
+
name: 'peernet-peer',
|
|
7768
|
+
codec: '0x7070',
|
|
7769
|
+
hashAlg: 'keccak-256',
|
|
7770
|
+
},
|
|
7771
|
+
{
|
|
7772
|
+
name: 'peernet-dht',
|
|
7773
|
+
codec: '0x706468',
|
|
7774
|
+
hashAlg: 'keccak-256',
|
|
7775
|
+
},
|
|
7776
|
+
{
|
|
7777
|
+
name: 'peernet-dht-response',
|
|
7778
|
+
codec: '0x706472',
|
|
7779
|
+
hashAlg: 'keccak-256',
|
|
7780
|
+
},
|
|
7781
|
+
{
|
|
7782
|
+
name: 'peernet-data',
|
|
7783
|
+
codec: '0x706461',
|
|
7784
|
+
hashAlg: 'keccak-256',
|
|
7785
|
+
},
|
|
7786
|
+
{
|
|
7787
|
+
name: 'peernet-data-response',
|
|
7788
|
+
codec: '0x70646172',
|
|
7789
|
+
hashAlg: 'keccak-256',
|
|
7790
|
+
},
|
|
7791
|
+
{
|
|
7792
|
+
name: 'peernet-message',
|
|
7793
|
+
codec: '0x706d65',
|
|
7794
|
+
hashAlg: 'keccak-256',
|
|
7795
|
+
},
|
|
7796
|
+
{
|
|
7797
|
+
name: 'peernet-ps',
|
|
7798
|
+
codec: '707073',
|
|
7799
|
+
hashAlg: 'keccak-256',
|
|
7800
|
+
},
|
|
7801
|
+
{
|
|
7802
|
+
name: 'peernet-response',
|
|
7803
|
+
codec: '0x7072',
|
|
7804
|
+
hashAlg: 'keccak-256',
|
|
7805
|
+
},
|
|
7806
|
+
{
|
|
7807
|
+
name: 'peernet-request',
|
|
7808
|
+
codec: '0x707271',
|
|
7809
|
+
hashAlg: 'keccak-256',
|
|
7810
|
+
},
|
|
7811
|
+
{
|
|
7812
|
+
name: 'peernet-file',
|
|
7813
|
+
codec: '0x7066',
|
|
7814
|
+
hashAlg: 'keccak-256',
|
|
7815
|
+
},
|
|
7816
|
+
{
|
|
7817
|
+
name: 'peernet-file-response',
|
|
7818
|
+
codec: '0x706672',
|
|
7819
|
+
hashAlg: 'keccak-256',
|
|
7820
|
+
}
|
|
7809
7821
|
];
|
|
7810
7822
|
|
|
7811
|
-
|
|
7812
|
-
|
|
7813
|
-
|
|
7814
|
-
|
|
7815
|
-
|
|
7816
|
-
|
|
7817
|
-
|
|
7818
|
-
|
|
7819
|
-
|
|
7820
|
-
|
|
7821
|
-
if (
|
|
7822
|
-
|
|
7823
|
-
|
|
7824
|
-
|
|
7825
|
-
|
|
7826
|
-
|
|
7827
|
-
|
|
7828
|
-
|
|
7829
|
-
|
|
7830
|
-
|
|
7831
|
-
|
|
7832
|
-
|
|
7833
|
-
|
|
7834
|
-
|
|
7835
|
-
const
|
|
7836
|
-
|
|
7837
|
-
|
|
7838
|
-
|
|
7839
|
-
|
|
7840
|
-
|
|
7841
|
-
|
|
7842
|
-
|
|
7843
|
-
|
|
7844
|
-
|
|
7845
|
-
const
|
|
7846
|
-
if (
|
|
7847
|
-
|
|
7848
|
-
|
|
7849
|
-
|
|
7850
|
-
|
|
7851
|
-
|
|
7852
|
-
|
|
7853
|
-
|
|
7854
|
-
|
|
7855
|
-
|
|
7856
|
-
|
|
7857
|
-
|
|
7858
|
-
|
|
7859
|
-
|
|
7860
|
-
|
|
7861
|
-
|
|
7823
|
+
const codecs$1 = [
|
|
7824
|
+
...internalCodecs,
|
|
7825
|
+
...blockchainCodecs,
|
|
7826
|
+
...social,
|
|
7827
|
+
...peernetCodecs
|
|
7828
|
+
];
|
|
7829
|
+
|
|
7830
|
+
const codecs = {};
|
|
7831
|
+
const addCodec = (codecInput) => {
|
|
7832
|
+
let { hashAlg, codec, name } = codecInput;
|
|
7833
|
+
if (!codecs[name])
|
|
7834
|
+
codecs[name] = {
|
|
7835
|
+
hashAlg,
|
|
7836
|
+
codec: typeof codec === 'string' ? parseInt(codec, 16) : codec
|
|
7837
|
+
};
|
|
7838
|
+
};
|
|
7839
|
+
for (const codec of codecs$1) {
|
|
7840
|
+
addCodec(codec);
|
|
7841
|
+
}
|
|
7842
|
+
const getCodec = (name) => {
|
|
7843
|
+
if (typeof name === 'number')
|
|
7844
|
+
return name;
|
|
7845
|
+
return getCodecByName(name).codec;
|
|
7846
|
+
};
|
|
7847
|
+
const getCodecName = (codec) => {
|
|
7848
|
+
return Object.keys(codecs).reduce((p, c) => {
|
|
7849
|
+
const item = codecs[c];
|
|
7850
|
+
if (item.codec === codec)
|
|
7851
|
+
return c;
|
|
7852
|
+
else
|
|
7853
|
+
return p;
|
|
7854
|
+
}, undefined);
|
|
7855
|
+
};
|
|
7856
|
+
const getCodecByName = (name) => codecs[name];
|
|
7857
|
+
const getHashAlg = (name) => {
|
|
7858
|
+
if (typeof name === 'number')
|
|
7859
|
+
return getCodecByName(getCodecName(name)).hashAlg;
|
|
7860
|
+
return getCodecByName(name).hashAlg;
|
|
7861
|
+
};
|
|
7862
|
+
const isCodec = (codec) => {
|
|
7863
|
+
if (codec.codec !== undefined && codec.hashAlg)
|
|
7864
|
+
return true;
|
|
7865
|
+
return false;
|
|
7866
|
+
};
|
|
7867
|
+
const validateCodec = (codec) => {
|
|
7868
|
+
if (codec.codec === undefined ||
|
|
7869
|
+
codec.hashAlg === undefined ||
|
|
7870
|
+
codec.name === undefined)
|
|
7871
|
+
throw new Error(`invalid codecInput: ${codec}`);
|
|
7872
|
+
};
|
|
7873
|
+
var utils = {
|
|
7874
|
+
isCodec,
|
|
7875
|
+
addCodec,
|
|
7876
|
+
getCodec,
|
|
7877
|
+
getHashAlg,
|
|
7878
|
+
getCodecName,
|
|
7879
|
+
validateCodec,
|
|
7880
|
+
codecs: codecs
|
|
7862
7881
|
};
|
|
7863
7882
|
|
|
7864
7883
|
class Codec extends BasicInterface {
|
|
@@ -7965,20 +7984,21 @@ class Codec extends BasicInterface {
|
|
|
7965
7984
|
class CodecHash extends BasicInterface {
|
|
7966
7985
|
codec;
|
|
7967
7986
|
discoCodec;
|
|
7968
|
-
|
|
7987
|
+
size;
|
|
7988
|
+
constructor(buffer, options) {
|
|
7969
7989
|
super();
|
|
7970
|
-
if (options
|
|
7990
|
+
if (options?.name)
|
|
7971
7991
|
this.name = options.name;
|
|
7972
7992
|
else
|
|
7973
7993
|
this.name = 'disco-hash';
|
|
7974
|
-
if (options
|
|
7994
|
+
if (options?.codecs)
|
|
7975
7995
|
this.codecs = options.codecs;
|
|
7976
7996
|
return this.init(buffer);
|
|
7977
7997
|
}
|
|
7978
7998
|
async init(uint8Array) {
|
|
7979
7999
|
if (uint8Array) {
|
|
7980
8000
|
if (uint8Array instanceof Uint8Array) {
|
|
7981
|
-
this.discoCodec = new Codec(uint8Array
|
|
8001
|
+
this.discoCodec = new Codec(uint8Array);
|
|
7982
8002
|
const name = this.discoCodec.name;
|
|
7983
8003
|
if (name) {
|
|
7984
8004
|
this.name = name;
|
|
@@ -8020,7 +8040,7 @@ class CodecHash extends BasicInterface {
|
|
|
8020
8040
|
return this.encoded;
|
|
8021
8041
|
}
|
|
8022
8042
|
fromJSON(json) {
|
|
8023
|
-
return this.encode(new TextEncoder().encode(JSON.stringify(json)));
|
|
8043
|
+
return this.encode(new TextEncoder().encode(JSON.stringify(json, jsonStringifyBigInt)));
|
|
8024
8044
|
}
|
|
8025
8045
|
async encode(buffer, name) {
|
|
8026
8046
|
if (!this.name && name)
|
|
@@ -8094,7 +8114,7 @@ class CodecHash extends BasicInterface {
|
|
|
8094
8114
|
name: this.name,
|
|
8095
8115
|
size: this.size,
|
|
8096
8116
|
length: this.length,
|
|
8097
|
-
digest: this.digest
|
|
8117
|
+
digest: this.digest
|
|
8098
8118
|
};
|
|
8099
8119
|
}
|
|
8100
8120
|
}
|
|
@@ -8218,13 +8238,13 @@ let FormatInterface$1 = class FormatInterface extends BasicInterface {
|
|
|
8218
8238
|
this.encoded = buffer;
|
|
8219
8239
|
return this.hasCodec()
|
|
8220
8240
|
? this.decode()
|
|
8221
|
-
: this.create(JSON.parse(new TextDecoder().decode(this.encoded)));
|
|
8241
|
+
: this.create(JSON.parse(new TextDecoder().decode(this.encoded), jsonParseBigInt));
|
|
8222
8242
|
}
|
|
8223
8243
|
fromArrayBuffer(buffer) {
|
|
8224
8244
|
this.encoded = new Uint8Array(buffer, buffer.byteOffset, buffer.byteLength);
|
|
8225
8245
|
return this.hasCodec()
|
|
8226
8246
|
? this.decode()
|
|
8227
|
-
: this.create(JSON.parse(new TextDecoder().decode(this.encoded)));
|
|
8247
|
+
: this.create(JSON.parse(new TextDecoder().decode(this.encoded), jsonParseBigInt));
|
|
8228
8248
|
}
|
|
8229
8249
|
/**
|
|
8230
8250
|
* @param {Object} data
|
|
@@ -8264,7 +8284,7 @@ class ValidatorMessage extends FormatInterface {
|
|
|
8264
8284
|
}
|
|
8265
8285
|
|
|
8266
8286
|
var proto$5 = {
|
|
8267
|
-
index:
|
|
8287
|
+
index: BigInt(0),
|
|
8268
8288
|
previousHash: String(),
|
|
8269
8289
|
timestamp: Number(),
|
|
8270
8290
|
reward: BigInt(0),
|
|
@@ -8354,6 +8374,11 @@ class ContractMessage extends FormatInterface {
|
|
|
8354
8374
|
}
|
|
8355
8375
|
}
|
|
8356
8376
|
|
|
8377
|
+
({
|
|
8378
|
+
hash: String(),
|
|
8379
|
+
index: BigInt(0)
|
|
8380
|
+
});
|
|
8381
|
+
|
|
8357
8382
|
var proto$1 = {
|
|
8358
8383
|
timestamp: Number(),
|
|
8359
8384
|
from: String(),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as inherits_browserExports, c as commonjsGlobal, g as getDefaultExportFromCjs, r as require$$3 } from './node-browser-
|
|
2
|
-
import './index-
|
|
1
|
+
import { i as inherits_browserExports, c as commonjsGlobal, g as getDefaultExportFromCjs, r as require$$3 } from './node-browser-DewO13hB.js';
|
|
2
|
+
import './index-CM4QYC3g.js';
|
|
3
3
|
|
|
4
4
|
var browser$2 = {exports: {}};
|
|
5
5
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as FormatInterface$3, C as ContractMessage, T as TransactionMessage, B as BlockMessage, a as BWMessage, b as BWRequestMessage, V as ValidatorMessage } from './index-
|
|
1
|
+
import { F as FormatInterface$3, C as ContractMessage, T as TransactionMessage, B as BlockMessage, a as BWMessage, b as BWRequestMessage, V as ValidatorMessage } from './index-CM4QYC3g.js';
|
|
2
2
|
|
|
3
3
|
var proto = {
|
|
4
4
|
lastblock: Object(),
|
|
@@ -16678,7 +16678,7 @@ class Identity {
|
|
|
16678
16678
|
this.selectedAccount = new TextDecoder().decode(selected);
|
|
16679
16679
|
}
|
|
16680
16680
|
else {
|
|
16681
|
-
const importee = await import(/* webpackChunkName: "generate-account" */ './index-BeqbCwUk-
|
|
16681
|
+
const importee = await import(/* webpackChunkName: "generate-account" */ './index-BeqbCwUk-DfNb2uRP.js');
|
|
16682
16682
|
const { identity, accounts } = await importee.default(password, this.network);
|
|
16683
16683
|
await globalThis.accountStore.put('public', JSON.stringify({ walletId: identity.walletId }));
|
|
16684
16684
|
await globalThis.walletStore.put('version', String(1));
|
|
@@ -29434,7 +29434,7 @@ class Peernet {
|
|
|
29434
29434
|
this.root = options.root;
|
|
29435
29435
|
const { RequestMessage, ResponseMessage, PeerMessage, PeerMessageResponse, PeernetMessage, DHTMessage, DHTMessageResponse, DataMessage, DataMessageResponse, PsMessage, ChatMessage, PeernetFile
|
|
29436
29436
|
// FolderMessageResponse
|
|
29437
|
-
} = await import(/* webpackChunkName: "messages" */ './messages-RYLqPGkg-
|
|
29437
|
+
} = await import(/* webpackChunkName: "messages" */ './messages-RYLqPGkg-Da9CI_ow.js');
|
|
29438
29438
|
/**
|
|
29439
29439
|
* proto Object containing protos
|
|
29440
29440
|
* @type {Object}
|
|
@@ -29528,7 +29528,7 @@ class Peernet {
|
|
|
29528
29528
|
if (this.#starting || this.#started)
|
|
29529
29529
|
return;
|
|
29530
29530
|
this.#starting = true;
|
|
29531
|
-
const importee = await import('./client-Depp28gl-
|
|
29531
|
+
const importee = await import('./client-Depp28gl-DItJEEYa.js');
|
|
29532
29532
|
/**
|
|
29533
29533
|
* @access public
|
|
29534
29534
|
* @type {PeernetClient}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { N as default } from './node-browser-
|
|
2
|
-
import './index-
|
|
1
|
+
export { N as default } from './node-browser-DewO13hB.js';
|
|
2
|
+
import './index-CM4QYC3g.js';
|