@leofcoin/chain 1.9.3 → 1.9.4
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/chain.js +57 -72
- package/exports/browser/{constants-BTdMMS4w.js → constants-D_XqG46B.js} +316 -214
- package/exports/browser/node-browser.js +1 -18
- package/exports/browser/workers/block-worker.js +1 -1
- package/exports/browser/workers/machine-worker.js +1 -1
- package/exports/browser/workers/{worker-BrtyXRJ7-BrtyXRJ7.js → worker-Bsi6vKgF-Bsi6vKgF.js} +238 -198
- package/exports/chain.d.ts +0 -1
- package/exports/chain.js +56 -72
- package/exports/workers/block-worker.js +1 -1
- package/exports/workers/machine-worker.js +1 -1
- package/exports/workers/{worker-BrtyXRJ7-BrtyXRJ7.js → worker-Bsi6vKgF-Bsi6vKgF.js} +238 -198
- package/package.json +2 -2
|
@@ -7569,209 +7569,237 @@ class BasicInterface {
|
|
|
7569
7569
|
}
|
|
7570
7570
|
}
|
|
7571
7571
|
|
|
7572
|
-
const blockchainCodecs = [
|
|
7573
|
-
{
|
|
7574
|
-
name: 'leofcoin-block',
|
|
7575
|
-
codec: '0x6c62',
|
|
7576
|
-
hashAlg: 'dbl-keccak-512'
|
|
7577
|
-
},
|
|
7578
|
-
{
|
|
7579
|
-
name: 'leofcoin-tx',
|
|
7580
|
-
codec: '0x6c74',
|
|
7581
|
-
hashAlg: 'dbl-keccak-512'
|
|
7582
|
-
},
|
|
7583
|
-
{
|
|
7584
|
-
name: 'leofcoin-itx',
|
|
7585
|
-
codec: '0x6c69',
|
|
7586
|
-
hashAlg: 'keccak-512'
|
|
7587
|
-
},
|
|
7588
|
-
{
|
|
7589
|
-
name: 'leofcoin-pr',
|
|
7590
|
-
codec: '0x6c70',
|
|
7591
|
-
hashAlg: 'keccak-256'
|
|
7592
|
-
},
|
|
7593
|
-
{
|
|
7594
|
-
name: 'contract-message',
|
|
7595
|
-
codec: '0x63636d',
|
|
7596
|
-
hashAlg: 'keccak-256'
|
|
7597
|
-
},
|
|
7598
|
-
{
|
|
7599
|
-
name: 'transaction-message',
|
|
7600
|
-
codec: '0x746d',
|
|
7601
|
-
hashAlg: 'keccak-256'
|
|
7602
|
-
},
|
|
7603
|
-
{
|
|
7604
|
-
name: 'raw-transaction-message',
|
|
7605
|
-
codec: '0x772746d',
|
|
7606
|
-
hashAlg: 'keccak-256'
|
|
7607
|
-
},
|
|
7608
|
-
{
|
|
7609
|
-
name: 'block-message',
|
|
7610
|
-
codec: '0x626d',
|
|
7611
|
-
hashAlg: 'keccak-256'
|
|
7612
|
-
},
|
|
7613
|
-
{
|
|
7614
|
-
name: 'bw-message',
|
|
7615
|
-
codec: '0x62776d',
|
|
7616
|
-
hashAlg: 'keccak-256'
|
|
7617
|
-
},
|
|
7618
|
-
{
|
|
7619
|
-
name: 'bw-request-message',
|
|
7620
|
-
codec: '0x6277726d',
|
|
7621
|
-
hashAlg: 'keccak-256'
|
|
7622
|
-
},
|
|
7623
|
-
{
|
|
7624
|
-
name: 'validator-message',
|
|
7625
|
-
codec: '0x766d',
|
|
7626
|
-
hashAlg: 'keccak-256'
|
|
7627
|
-
}
|
|
7572
|
+
const blockchainCodecs = [
|
|
7573
|
+
{
|
|
7574
|
+
name: 'leofcoin-block',
|
|
7575
|
+
codec: '0x6c62',
|
|
7576
|
+
hashAlg: 'dbl-keccak-512'
|
|
7577
|
+
},
|
|
7578
|
+
{
|
|
7579
|
+
name: 'leofcoin-tx',
|
|
7580
|
+
codec: '0x6c74',
|
|
7581
|
+
hashAlg: 'dbl-keccak-512'
|
|
7582
|
+
},
|
|
7583
|
+
{
|
|
7584
|
+
name: 'leofcoin-itx',
|
|
7585
|
+
codec: '0x6c69',
|
|
7586
|
+
hashAlg: 'keccak-512'
|
|
7587
|
+
},
|
|
7588
|
+
{
|
|
7589
|
+
name: 'leofcoin-pr',
|
|
7590
|
+
codec: '0x6c70',
|
|
7591
|
+
hashAlg: 'keccak-256'
|
|
7592
|
+
},
|
|
7593
|
+
{
|
|
7594
|
+
name: 'contract-message',
|
|
7595
|
+
codec: '0x63636d',
|
|
7596
|
+
hashAlg: 'keccak-256'
|
|
7597
|
+
},
|
|
7598
|
+
{
|
|
7599
|
+
name: 'transaction-message',
|
|
7600
|
+
codec: '0x746d',
|
|
7601
|
+
hashAlg: 'keccak-256'
|
|
7602
|
+
},
|
|
7603
|
+
{
|
|
7604
|
+
name: 'raw-transaction-message',
|
|
7605
|
+
codec: '0x772746d',
|
|
7606
|
+
hashAlg: 'keccak-256'
|
|
7607
|
+
},
|
|
7608
|
+
{
|
|
7609
|
+
name: 'block-message',
|
|
7610
|
+
codec: '0x626d',
|
|
7611
|
+
hashAlg: 'keccak-256'
|
|
7612
|
+
},
|
|
7613
|
+
{
|
|
7614
|
+
name: 'bw-message',
|
|
7615
|
+
codec: '0x62776d',
|
|
7616
|
+
hashAlg: 'keccak-256'
|
|
7617
|
+
},
|
|
7618
|
+
{
|
|
7619
|
+
name: 'bw-request-message',
|
|
7620
|
+
codec: '0x6277726d',
|
|
7621
|
+
hashAlg: 'keccak-256'
|
|
7622
|
+
},
|
|
7623
|
+
{
|
|
7624
|
+
name: 'validator-message',
|
|
7625
|
+
codec: '0x766d',
|
|
7626
|
+
hashAlg: 'keccak-256'
|
|
7627
|
+
},
|
|
7628
|
+
{
|
|
7629
|
+
name: 'last-block-message',
|
|
7630
|
+
codec: '0x6c626d',
|
|
7631
|
+
hashAlg: 'keccak-256'
|
|
7632
|
+
},
|
|
7633
|
+
{
|
|
7634
|
+
name: 'last-block-request-message',
|
|
7635
|
+
codec: '0x6c62726d',
|
|
7636
|
+
hashAlg: 'keccak-256'
|
|
7637
|
+
},
|
|
7638
|
+
{
|
|
7639
|
+
name: 'state-message',
|
|
7640
|
+
codec: '0x73746d',
|
|
7641
|
+
hashAlg: 'keccak-256'
|
|
7642
|
+
},
|
|
7643
|
+
{
|
|
7644
|
+
name: 'publish-message',
|
|
7645
|
+
codec: '0x70626d',
|
|
7646
|
+
hashAlg: 'keccak-256'
|
|
7647
|
+
}
|
|
7628
7648
|
];
|
|
7629
|
-
|
|
7630
|
-
|
|
7631
|
-
|
|
7632
|
-
|
|
7633
|
-
|
|
7634
|
-
|
|
7635
|
-
|
|
7636
|
-
|
|
7637
|
-
|
|
7638
|
-
|
|
7639
|
-
|
|
7640
|
-
|
|
7649
|
+
const consensusCodecs = [
|
|
7650
|
+
{
|
|
7651
|
+
name: 'proposal-message',
|
|
7652
|
+
codec: '0x70726d',
|
|
7653
|
+
hashAlg: 'keccak-256'
|
|
7654
|
+
},
|
|
7655
|
+
{
|
|
7656
|
+
name: 'prevote-message',
|
|
7657
|
+
codec: '0x70766d',
|
|
7658
|
+
hashAlg: 'keccak-256'
|
|
7659
|
+
},
|
|
7660
|
+
{
|
|
7661
|
+
name: 'precommit-message',
|
|
7662
|
+
codec: '0x7063636d',
|
|
7663
|
+
hashAlg: 'keccak-256'
|
|
7664
|
+
}
|
|
7641
7665
|
];
|
|
7642
|
-
|
|
7643
|
-
|
|
7644
|
-
name: '
|
|
7645
|
-
codec: '
|
|
7646
|
-
hashAlg: '
|
|
7647
|
-
}
|
|
7648
|
-
|
|
7649
|
-
|
|
7650
|
-
|
|
7651
|
-
|
|
7652
|
-
|
|
7653
|
-
hashAlg: 'dbl-keccak-256',
|
|
7654
|
-
},
|
|
7655
|
-
{
|
|
7656
|
-
name: 'peernet-peer-response',
|
|
7657
|
-
codec: '0x707072',
|
|
7658
|
-
hashAlg: 'keccak-256',
|
|
7659
|
-
},
|
|
7660
|
-
{
|
|
7661
|
-
name: 'peernet-peer',
|
|
7662
|
-
codec: '0x7070',
|
|
7663
|
-
hashAlg: 'keccak-256',
|
|
7664
|
-
},
|
|
7665
|
-
{
|
|
7666
|
-
name: 'peernet-dht',
|
|
7667
|
-
codec: '0x706468',
|
|
7668
|
-
hashAlg: 'keccak-256',
|
|
7669
|
-
},
|
|
7670
|
-
{
|
|
7671
|
-
name: 'peernet-dht-response',
|
|
7672
|
-
codec: '0x706472',
|
|
7673
|
-
hashAlg: 'keccak-256',
|
|
7674
|
-
},
|
|
7675
|
-
{
|
|
7676
|
-
name: 'peernet-data',
|
|
7677
|
-
codec: '0x706461',
|
|
7678
|
-
hashAlg: 'keccak-256',
|
|
7679
|
-
},
|
|
7680
|
-
{
|
|
7681
|
-
name: 'peernet-data-response',
|
|
7682
|
-
codec: '0x70646172',
|
|
7683
|
-
hashAlg: 'keccak-256',
|
|
7684
|
-
},
|
|
7685
|
-
{
|
|
7686
|
-
name: 'peernet-message',
|
|
7687
|
-
codec: '0x706d65',
|
|
7688
|
-
hashAlg: 'keccak-256',
|
|
7689
|
-
},
|
|
7690
|
-
{
|
|
7691
|
-
name: 'peernet-ps',
|
|
7692
|
-
codec: '707073',
|
|
7693
|
-
hashAlg: 'keccak-256',
|
|
7694
|
-
},
|
|
7695
|
-
{
|
|
7696
|
-
name: 'peernet-response',
|
|
7697
|
-
codec: '0x7072',
|
|
7698
|
-
hashAlg: 'keccak-256',
|
|
7699
|
-
},
|
|
7700
|
-
{
|
|
7701
|
-
name: 'peernet-request',
|
|
7702
|
-
codec: '0x707271',
|
|
7703
|
-
hashAlg: 'keccak-256',
|
|
7704
|
-
},
|
|
7705
|
-
{
|
|
7706
|
-
name: 'peernet-file',
|
|
7707
|
-
codec: '0x7066',
|
|
7708
|
-
hashAlg: 'keccak-256',
|
|
7709
|
-
},
|
|
7710
|
-
{
|
|
7711
|
-
name: 'peernet-file-response',
|
|
7712
|
-
codec: '0x706672',
|
|
7713
|
-
hashAlg: 'keccak-256',
|
|
7714
|
-
}
|
|
7666
|
+
const internalCodecs = [
|
|
7667
|
+
{
|
|
7668
|
+
name: 'pubsub-request',
|
|
7669
|
+
codec: '0x70737271',
|
|
7670
|
+
hashAlg: 'keccak-256'
|
|
7671
|
+
},
|
|
7672
|
+
{
|
|
7673
|
+
name: 'pubsub-response',
|
|
7674
|
+
codec: '0x707372',
|
|
7675
|
+
hashAlg: 'keccak-256'
|
|
7676
|
+
}
|
|
7715
7677
|
];
|
|
7716
|
-
|
|
7717
|
-
|
|
7718
|
-
|
|
7719
|
-
|
|
7720
|
-
|
|
7721
|
-
|
|
7678
|
+
const socialCodecs = [
|
|
7679
|
+
{
|
|
7680
|
+
name: 'chat-message',
|
|
7681
|
+
codec: '0x70636d',
|
|
7682
|
+
hashAlg: 'dbl-keccak-256'
|
|
7683
|
+
}
|
|
7684
|
+
];
|
|
7685
|
+
const peernetCodecs = [
|
|
7686
|
+
{
|
|
7687
|
+
name: 'disco-hash',
|
|
7688
|
+
codec: '0x30',
|
|
7689
|
+
hashAlg: 'dbl-keccak-256'
|
|
7690
|
+
},
|
|
7691
|
+
{
|
|
7692
|
+
name: 'peernet-peer-response',
|
|
7693
|
+
codec: '0x707072',
|
|
7694
|
+
hashAlg: 'keccak-256'
|
|
7695
|
+
},
|
|
7696
|
+
{
|
|
7697
|
+
name: 'peernet-peer',
|
|
7698
|
+
codec: '0x7070',
|
|
7699
|
+
hashAlg: 'keccak-256'
|
|
7700
|
+
},
|
|
7701
|
+
{
|
|
7702
|
+
name: 'peernet-dht',
|
|
7703
|
+
codec: '0x706468',
|
|
7704
|
+
hashAlg: 'keccak-256'
|
|
7705
|
+
},
|
|
7706
|
+
{
|
|
7707
|
+
name: 'peernet-dht-response',
|
|
7708
|
+
codec: '0x706472',
|
|
7709
|
+
hashAlg: 'keccak-256'
|
|
7710
|
+
},
|
|
7711
|
+
{
|
|
7712
|
+
name: 'peernet-data',
|
|
7713
|
+
codec: '0x706461',
|
|
7714
|
+
hashAlg: 'keccak-256'
|
|
7715
|
+
},
|
|
7716
|
+
{
|
|
7717
|
+
name: 'peernet-data-response',
|
|
7718
|
+
codec: '0x70646172',
|
|
7719
|
+
hashAlg: 'keccak-256'
|
|
7720
|
+
},
|
|
7721
|
+
{
|
|
7722
|
+
name: 'peernet-message',
|
|
7723
|
+
codec: '0x706d65',
|
|
7724
|
+
hashAlg: 'keccak-256'
|
|
7725
|
+
},
|
|
7726
|
+
{
|
|
7727
|
+
name: 'peernet-ps',
|
|
7728
|
+
codec: '707073',
|
|
7729
|
+
hashAlg: 'keccak-256'
|
|
7730
|
+
},
|
|
7731
|
+
{
|
|
7732
|
+
name: 'peernet-response',
|
|
7733
|
+
codec: '0x7072',
|
|
7734
|
+
hashAlg: 'keccak-256'
|
|
7735
|
+
},
|
|
7736
|
+
{
|
|
7737
|
+
name: 'peernet-request',
|
|
7738
|
+
codec: '0x707271',
|
|
7739
|
+
hashAlg: 'keccak-256'
|
|
7740
|
+
},
|
|
7741
|
+
{
|
|
7742
|
+
name: 'peernet-file',
|
|
7743
|
+
codec: '0x7066',
|
|
7744
|
+
hashAlg: 'keccak-256'
|
|
7745
|
+
},
|
|
7746
|
+
{
|
|
7747
|
+
name: 'peernet-file-response',
|
|
7748
|
+
codec: '0x706672',
|
|
7749
|
+
hashAlg: 'keccak-256'
|
|
7750
|
+
}
|
|
7751
|
+
];
|
|
7752
|
+
const codecs = [
|
|
7753
|
+
...internalCodecs,
|
|
7754
|
+
...blockchainCodecs,
|
|
7755
|
+
...consensusCodecs,
|
|
7756
|
+
...socialCodecs,
|
|
7757
|
+
...peernetCodecs
|
|
7722
7758
|
];
|
|
7723
7759
|
|
|
7724
|
-
const
|
|
7725
|
-
const addCodec = (codecInput) => {
|
|
7726
|
-
|
|
7727
|
-
if (!
|
|
7728
|
-
|
|
7729
|
-
hashAlg,
|
|
7730
|
-
codec: typeof codec === 'string' ? parseInt(codec, 16) : codec
|
|
7731
|
-
};
|
|
7732
|
-
};
|
|
7733
|
-
for (const codec of codecs
|
|
7734
|
-
addCodec(codec);
|
|
7735
|
-
}
|
|
7736
|
-
const
|
|
7737
|
-
|
|
7738
|
-
|
|
7739
|
-
|
|
7740
|
-
};
|
|
7741
|
-
|
|
7742
|
-
|
|
7743
|
-
|
|
7744
|
-
|
|
7745
|
-
|
|
7746
|
-
|
|
7747
|
-
|
|
7748
|
-
|
|
7749
|
-
|
|
7750
|
-
|
|
7751
|
-
|
|
7752
|
-
|
|
7753
|
-
|
|
7754
|
-
|
|
7755
|
-
|
|
7756
|
-
|
|
7757
|
-
|
|
7758
|
-
|
|
7759
|
-
|
|
7760
|
-
|
|
7761
|
-
|
|
7762
|
-
|
|
7763
|
-
|
|
7764
|
-
|
|
7765
|
-
|
|
7766
|
-
|
|
7767
|
-
var utils = {
|
|
7768
|
-
isCodec,
|
|
7769
|
-
addCodec,
|
|
7770
|
-
getCodec,
|
|
7771
|
-
getHashAlg,
|
|
7772
|
-
getCodecName,
|
|
7773
|
-
validateCodec,
|
|
7774
|
-
codecs: codecs
|
|
7760
|
+
const registry = {};
|
|
7761
|
+
const addCodec = (codecInput) => {
|
|
7762
|
+
const { hashAlg, codec, name } = codecInput;
|
|
7763
|
+
if (!registry[name])
|
|
7764
|
+
registry[name] = {
|
|
7765
|
+
hashAlg,
|
|
7766
|
+
codec: typeof codec === 'string' ? parseInt(codec, 16) : codec
|
|
7767
|
+
};
|
|
7768
|
+
};
|
|
7769
|
+
for (const codec of codecs) {
|
|
7770
|
+
addCodec(codec);
|
|
7771
|
+
}
|
|
7772
|
+
const getCodecByName = (name) => registry[name];
|
|
7773
|
+
const getCodecName = (codec) => {
|
|
7774
|
+
return Object.keys(registry).reduce((p, c) => {
|
|
7775
|
+
return registry[c].codec === codec ? c : p;
|
|
7776
|
+
}, undefined);
|
|
7777
|
+
};
|
|
7778
|
+
const getCodec = (name) => {
|
|
7779
|
+
if (typeof name === 'number')
|
|
7780
|
+
return name;
|
|
7781
|
+
return getCodecByName(name).codec;
|
|
7782
|
+
};
|
|
7783
|
+
const getHashAlg = (name) => {
|
|
7784
|
+
if (typeof name === 'number')
|
|
7785
|
+
return getCodecByName(getCodecName(name)).hashAlg;
|
|
7786
|
+
return getCodecByName(name).hashAlg;
|
|
7787
|
+
};
|
|
7788
|
+
const isCodec = (codec) => {
|
|
7789
|
+
return codec.codec !== undefined && !!codec.hashAlg;
|
|
7790
|
+
};
|
|
7791
|
+
const validateCodec = (codec) => {
|
|
7792
|
+
if (codec.codec === undefined || codec.hashAlg === undefined || codec.name === undefined)
|
|
7793
|
+
throw new Error(`invalid codecInput: ${codec}`);
|
|
7794
|
+
};
|
|
7795
|
+
const utils = {
|
|
7796
|
+
isCodec,
|
|
7797
|
+
addCodec,
|
|
7798
|
+
getCodec,
|
|
7799
|
+
getHashAlg,
|
|
7800
|
+
getCodecName,
|
|
7801
|
+
validateCodec,
|
|
7802
|
+
codecs: registry
|
|
7775
7803
|
};
|
|
7776
7804
|
|
|
7777
7805
|
class Codec extends BasicInterface {
|
|
@@ -8738,7 +8766,7 @@ let FormatInterface$1 = class FormatInterface extends BasicInterface {
|
|
|
8738
8766
|
*/
|
|
8739
8767
|
const FormatInterface = FormatInterface$1;
|
|
8740
8768
|
|
|
8741
|
-
var proto$
|
|
8769
|
+
var proto$b = {
|
|
8742
8770
|
address: String(),
|
|
8743
8771
|
reward: BigInt(0)
|
|
8744
8772
|
};
|
|
@@ -8751,11 +8779,11 @@ class ValidatorMessage extends FormatInterface {
|
|
|
8751
8779
|
if (buffer instanceof ValidatorMessage)
|
|
8752
8780
|
return buffer;
|
|
8753
8781
|
const name = 'validator-message';
|
|
8754
|
-
super(buffer, proto$
|
|
8782
|
+
super(buffer, proto$b, { name });
|
|
8755
8783
|
}
|
|
8756
8784
|
}
|
|
8757
8785
|
|
|
8758
|
-
var proto$
|
|
8786
|
+
var proto$a = {
|
|
8759
8787
|
index: BigInt(0),
|
|
8760
8788
|
previousHash: String(),
|
|
8761
8789
|
timestamp: Number(),
|
|
@@ -8776,7 +8804,7 @@ class BlockMessage extends FormatInterface {
|
|
|
8776
8804
|
if (buffer instanceof BlockMessage)
|
|
8777
8805
|
return buffer;
|
|
8778
8806
|
const name = 'block-message';
|
|
8779
|
-
super(buffer, proto$
|
|
8807
|
+
super(buffer, proto$a, { name });
|
|
8780
8808
|
}
|
|
8781
8809
|
encode(decoded) {
|
|
8782
8810
|
decoded = decoded || this.decoded;
|
|
@@ -8801,7 +8829,7 @@ class BlockMessage extends FormatInterface {
|
|
|
8801
8829
|
}
|
|
8802
8830
|
}
|
|
8803
8831
|
|
|
8804
|
-
var proto$
|
|
8832
|
+
var proto$9 = {
|
|
8805
8833
|
up: Number(),
|
|
8806
8834
|
down: Number()
|
|
8807
8835
|
};
|
|
@@ -8814,11 +8842,11 @@ class BWMessage extends FormatInterface {
|
|
|
8814
8842
|
if (buffer instanceof BWMessage)
|
|
8815
8843
|
return buffer;
|
|
8816
8844
|
const name = 'bw-message';
|
|
8817
|
-
super(buffer, proto$
|
|
8845
|
+
super(buffer, proto$9, { name });
|
|
8818
8846
|
}
|
|
8819
8847
|
}
|
|
8820
8848
|
|
|
8821
|
-
var proto$
|
|
8849
|
+
var proto$8 = {};
|
|
8822
8850
|
|
|
8823
8851
|
class BWRequestMessage extends FormatInterface {
|
|
8824
8852
|
get messageName() {
|
|
@@ -8828,11 +8856,11 @@ class BWRequestMessage extends FormatInterface {
|
|
|
8828
8856
|
if (buffer instanceof BWRequestMessage)
|
|
8829
8857
|
return buffer;
|
|
8830
8858
|
const name = 'bw-request-message';
|
|
8831
|
-
super(buffer, proto$
|
|
8859
|
+
super(buffer, proto$8, { name });
|
|
8832
8860
|
}
|
|
8833
8861
|
}
|
|
8834
8862
|
|
|
8835
|
-
var proto$
|
|
8863
|
+
var proto$7 = {
|
|
8836
8864
|
creator: String(),
|
|
8837
8865
|
contract: new Uint8Array(),
|
|
8838
8866
|
constructorParameters: Array()
|
|
@@ -8845,11 +8873,11 @@ class ContractMessage extends FormatInterface {
|
|
|
8845
8873
|
constructor(buffer) {
|
|
8846
8874
|
if (buffer instanceof ContractMessage)
|
|
8847
8875
|
return buffer;
|
|
8848
|
-
super(buffer, proto$
|
|
8876
|
+
super(buffer, proto$7, { name: 'contract-message' });
|
|
8849
8877
|
}
|
|
8850
8878
|
}
|
|
8851
8879
|
|
|
8852
|
-
var proto$
|
|
8880
|
+
var proto$6 = {
|
|
8853
8881
|
hash: String(),
|
|
8854
8882
|
index: BigInt(0)
|
|
8855
8883
|
};
|
|
@@ -8862,11 +8890,11 @@ class LastBlockMessage extends FormatInterface {
|
|
|
8862
8890
|
if (buffer instanceof LastBlockMessage)
|
|
8863
8891
|
return buffer;
|
|
8864
8892
|
const name = 'last-block-message';
|
|
8865
|
-
super(buffer, proto$
|
|
8893
|
+
super(buffer, proto$6, { name });
|
|
8866
8894
|
}
|
|
8867
8895
|
}
|
|
8868
8896
|
|
|
8869
|
-
var proto$
|
|
8897
|
+
var proto$5 = {
|
|
8870
8898
|
timestamp: Number(),
|
|
8871
8899
|
from: String(),
|
|
8872
8900
|
to: String(),
|
|
@@ -8886,7 +8914,7 @@ class TransactionMessage extends FormatInterface {
|
|
|
8886
8914
|
if (buffer instanceof TransactionMessage)
|
|
8887
8915
|
return buffer;
|
|
8888
8916
|
const name = 'transaction-message';
|
|
8889
|
-
super(buffer, proto$
|
|
8917
|
+
super(buffer, proto$5, { name });
|
|
8890
8918
|
}
|
|
8891
8919
|
beforeHashing(decoded) {
|
|
8892
8920
|
decoded = super.beforeHashing(decoded);
|
|
@@ -8897,7 +8925,24 @@ class TransactionMessage extends FormatInterface {
|
|
|
8897
8925
|
}
|
|
8898
8926
|
}
|
|
8899
8927
|
|
|
8900
|
-
var proto = {
|
|
8928
|
+
var proto$4 = {
|
|
8929
|
+
lastblock: Object(),
|
|
8930
|
+
values: Object()
|
|
8931
|
+
};
|
|
8932
|
+
|
|
8933
|
+
class StateMessage extends FormatInterface {
|
|
8934
|
+
get messageName() {
|
|
8935
|
+
return 'StateMessage';
|
|
8936
|
+
}
|
|
8937
|
+
constructor(buffer) {
|
|
8938
|
+
if (buffer instanceof StateMessage)
|
|
8939
|
+
return buffer;
|
|
8940
|
+
const name = 'state-message';
|
|
8941
|
+
super(buffer, proto$4, { name });
|
|
8942
|
+
}
|
|
8943
|
+
}
|
|
8944
|
+
|
|
8945
|
+
var proto$3 = {
|
|
8901
8946
|
timestamp: Number(),
|
|
8902
8947
|
from: String(),
|
|
8903
8948
|
to: String(),
|
|
@@ -8914,6 +8959,63 @@ class RawTransactionMessage extends FormatInterface {
|
|
|
8914
8959
|
if (buffer instanceof RawTransactionMessage)
|
|
8915
8960
|
return buffer;
|
|
8916
8961
|
const name = 'raw-transaction-message';
|
|
8962
|
+
super(buffer, proto$3, { name });
|
|
8963
|
+
}
|
|
8964
|
+
}
|
|
8965
|
+
|
|
8966
|
+
var proto$2 = {
|
|
8967
|
+
blockHash: String(),
|
|
8968
|
+
index: BigInt(0),
|
|
8969
|
+
round: BigInt(0),
|
|
8970
|
+
from: String()
|
|
8971
|
+
};
|
|
8972
|
+
|
|
8973
|
+
class PrevoteMessage extends FormatInterface {
|
|
8974
|
+
get messageName() {
|
|
8975
|
+
return 'PrevoteMessage';
|
|
8976
|
+
}
|
|
8977
|
+
constructor(buffer) {
|
|
8978
|
+
if (buffer instanceof PrevoteMessage)
|
|
8979
|
+
return buffer;
|
|
8980
|
+
const name = 'prevote-message';
|
|
8981
|
+
super(buffer, proto$2, { name });
|
|
8982
|
+
}
|
|
8983
|
+
}
|
|
8984
|
+
|
|
8985
|
+
var proto$1 = {
|
|
8986
|
+
blockHash: String(),
|
|
8987
|
+
index: BigInt(0),
|
|
8988
|
+
round: BigInt(0),
|
|
8989
|
+
from: String()
|
|
8990
|
+
};
|
|
8991
|
+
|
|
8992
|
+
class PrecommitMessage extends FormatInterface {
|
|
8993
|
+
get messageName() {
|
|
8994
|
+
return 'PrecommitMessage';
|
|
8995
|
+
}
|
|
8996
|
+
constructor(buffer) {
|
|
8997
|
+
if (buffer instanceof PrecommitMessage)
|
|
8998
|
+
return buffer;
|
|
8999
|
+
const name = 'precommit-message';
|
|
9000
|
+
super(buffer, proto$1, { name });
|
|
9001
|
+
}
|
|
9002
|
+
}
|
|
9003
|
+
|
|
9004
|
+
var proto = {
|
|
9005
|
+
blockHash: String(),
|
|
9006
|
+
index: BigInt(0),
|
|
9007
|
+
round: BigInt(0),
|
|
9008
|
+
from: String()
|
|
9009
|
+
};
|
|
9010
|
+
|
|
9011
|
+
class ProposalMessage extends FormatInterface {
|
|
9012
|
+
get messageName() {
|
|
9013
|
+
return 'ProposalMessage';
|
|
9014
|
+
}
|
|
9015
|
+
constructor(buffer) {
|
|
9016
|
+
if (buffer instanceof ProposalMessage)
|
|
9017
|
+
return buffer;
|
|
9018
|
+
const name = 'proposal-message';
|
|
8917
9019
|
super(buffer, proto, { name });
|
|
8918
9020
|
}
|
|
8919
9021
|
}
|
|
@@ -8956,4 +9058,4 @@ const DEFAULT_NODE_OPTIONS = {
|
|
|
8956
9058
|
stars: networks.leofcoin.peach.stars
|
|
8957
9059
|
};
|
|
8958
9060
|
|
|
8959
|
-
export { BlockMessage as B, ContractMessage as C, DEFAULT_NODE_OPTIONS as D,
|
|
9061
|
+
export { BlockMessage as B, ContractMessage as C, DEFAULT_NODE_OPTIONS as D, LastBlockMessage as L, PROTOCOL_VERSION as P, RawTransactionMessage as R, StateMessage as S, TransactionMessage as T, ValidatorMessage as V, REACHED_ONE_ZERO_ZERO as a, PrevoteMessage as b, PrecommitMessage as c, ProposalMessage as d, BWMessage as e, BWRequestMessage as f, networks$1 as n, toBase58 as t };
|
|
@@ -1,22 +1,5 @@
|
|
|
1
1
|
import Peernet from '@leofcoin/peernet/browser';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
var proto = {
|
|
5
|
-
lastblock: Object(),
|
|
6
|
-
values: Object()
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
class StateMessage extends FormatInterface {
|
|
10
|
-
get messageName() {
|
|
11
|
-
return 'StateMessage';
|
|
12
|
-
}
|
|
13
|
-
constructor(buffer) {
|
|
14
|
-
if (buffer instanceof StateMessage)
|
|
15
|
-
return buffer;
|
|
16
|
-
const name = 'state-message';
|
|
17
|
-
super(buffer, proto, { name });
|
|
18
|
-
}
|
|
19
|
-
}
|
|
2
|
+
import { T as TransactionMessage, C as ContractMessage, B as BlockMessage, e as BWMessage, f as BWRequestMessage, V as ValidatorMessage, S as StateMessage, L as LastBlockMessage, D as DEFAULT_NODE_OPTIONS } from './constants-D_XqG46B.js';
|
|
20
3
|
|
|
21
4
|
var nodeConfig = async (config = {
|
|
22
5
|
network: 'leofcoin:peach',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as EasyWorker, C as ContractMessage, T as TransactionMessage } from './worker-
|
|
1
|
+
import { E as EasyWorker, C as ContractMessage, T as TransactionMessage } from './worker-Bsi6vKgF-Bsi6vKgF.js';
|
|
2
2
|
|
|
3
3
|
/* Do NOT modify this file; see /src.ts/_admin/update-version.ts */
|
|
4
4
|
/**
|