@leofcoin/chain 1.9.6 → 1.9.8
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 +3932 -4500
- package/exports/browser/{constants-M3qbPwZp.js → constants-BCaq9RBn.js} +408 -426
- package/exports/browser/node-browser.js +50 -57
- package/exports/chain.js +3185 -3567
- package/exports/constants-C83ZCYKa.js +12 -0
- package/exports/node.js +19 -24
- package/package.json +2 -1
- package/exports/chain.d.ts +0 -73
- package/exports/config/config.d.ts +0 -1
- package/exports/config/main.d.ts +0 -5
- package/exports/config/protocol.d.ts +0 -6
- package/exports/connection-monitor.d.ts +0 -14
- package/exports/consensus/consensus.d.ts +0 -1
- package/exports/consensus/helpers/sort-transactions.d.ts +0 -1
- package/exports/constants-eo0U5-D_.js +0 -12
- package/exports/constants.d.ts +0 -15
- package/exports/contract-registry.d.ts +0 -106
- package/exports/contract-utils.d.ts +0 -49
- package/exports/contract.d.ts +0 -90
- package/exports/examples/contract-inheritance-example.d.ts +0 -58
- package/exports/examples/hash-based-contracts.d.ts +0 -82
- package/exports/fee/config.d.ts +0 -4
- package/exports/helpers/contract.d.ts +0 -4
- package/exports/jobs/jobber.d.ts +0 -7
- package/exports/machine-state.d.ts +0 -6
- package/exports/machine.d.ts +0 -64
- package/exports/node-browser.d.ts +0 -6
- package/exports/node.d.ts +0 -8
- package/exports/protocol.d.ts +0 -15
- package/exports/simplifiers/state.d.ts +0 -3
- package/exports/state.d.ts +0 -66
- package/exports/sync-controller.d.ts +0 -14
- package/exports/transaction.d.ts +0 -41
- package/exports/types.d.ts +0 -24
- package/exports/version-control.d.ts +0 -7
|
@@ -7570,236 +7570,236 @@ class BasicInterface {
|
|
|
7570
7570
|
}
|
|
7571
7571
|
|
|
7572
7572
|
const blockchainCodecs = [
|
|
7573
|
-
|
|
7574
|
-
|
|
7575
|
-
|
|
7576
|
-
|
|
7577
|
-
|
|
7578
|
-
|
|
7579
|
-
|
|
7580
|
-
|
|
7581
|
-
|
|
7582
|
-
|
|
7583
|
-
|
|
7584
|
-
|
|
7585
|
-
|
|
7586
|
-
|
|
7587
|
-
|
|
7588
|
-
|
|
7589
|
-
|
|
7590
|
-
|
|
7591
|
-
|
|
7592
|
-
|
|
7593
|
-
|
|
7594
|
-
|
|
7595
|
-
|
|
7596
|
-
|
|
7597
|
-
|
|
7598
|
-
|
|
7599
|
-
|
|
7600
|
-
|
|
7601
|
-
|
|
7602
|
-
|
|
7603
|
-
|
|
7604
|
-
|
|
7605
|
-
|
|
7606
|
-
|
|
7607
|
-
|
|
7608
|
-
|
|
7609
|
-
|
|
7610
|
-
|
|
7611
|
-
|
|
7612
|
-
|
|
7613
|
-
|
|
7614
|
-
|
|
7615
|
-
|
|
7616
|
-
|
|
7617
|
-
|
|
7618
|
-
|
|
7619
|
-
|
|
7620
|
-
|
|
7621
|
-
|
|
7622
|
-
|
|
7623
|
-
|
|
7624
|
-
|
|
7625
|
-
|
|
7626
|
-
|
|
7627
|
-
|
|
7628
|
-
|
|
7629
|
-
|
|
7630
|
-
|
|
7631
|
-
|
|
7632
|
-
|
|
7633
|
-
|
|
7634
|
-
|
|
7635
|
-
|
|
7636
|
-
|
|
7637
|
-
|
|
7638
|
-
|
|
7639
|
-
|
|
7640
|
-
|
|
7641
|
-
|
|
7642
|
-
|
|
7643
|
-
|
|
7644
|
-
|
|
7645
|
-
|
|
7646
|
-
|
|
7647
|
-
|
|
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
|
+
}
|
|
7648
7648
|
];
|
|
7649
7649
|
const consensusCodecs = [
|
|
7650
|
-
|
|
7651
|
-
|
|
7652
|
-
|
|
7653
|
-
|
|
7654
|
-
|
|
7655
|
-
|
|
7656
|
-
|
|
7657
|
-
|
|
7658
|
-
|
|
7659
|
-
|
|
7660
|
-
|
|
7661
|
-
|
|
7662
|
-
|
|
7663
|
-
|
|
7664
|
-
|
|
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
|
+
}
|
|
7665
7665
|
];
|
|
7666
7666
|
const internalCodecs = [
|
|
7667
|
-
|
|
7668
|
-
|
|
7669
|
-
|
|
7670
|
-
|
|
7671
|
-
|
|
7672
|
-
|
|
7673
|
-
|
|
7674
|
-
|
|
7675
|
-
|
|
7676
|
-
|
|
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
|
+
}
|
|
7677
7677
|
];
|
|
7678
7678
|
const socialCodecs = [
|
|
7679
|
-
|
|
7680
|
-
|
|
7681
|
-
|
|
7682
|
-
|
|
7683
|
-
|
|
7679
|
+
{
|
|
7680
|
+
name: "chat-message",
|
|
7681
|
+
codec: "0x70636d",
|
|
7682
|
+
hashAlg: "dbl-keccak-256"
|
|
7683
|
+
}
|
|
7684
7684
|
];
|
|
7685
7685
|
const peernetCodecs = [
|
|
7686
|
-
|
|
7687
|
-
|
|
7688
|
-
|
|
7689
|
-
|
|
7690
|
-
|
|
7691
|
-
|
|
7692
|
-
|
|
7693
|
-
|
|
7694
|
-
|
|
7695
|
-
|
|
7696
|
-
|
|
7697
|
-
|
|
7698
|
-
|
|
7699
|
-
|
|
7700
|
-
|
|
7701
|
-
|
|
7702
|
-
|
|
7703
|
-
|
|
7704
|
-
|
|
7705
|
-
|
|
7706
|
-
|
|
7707
|
-
|
|
7708
|
-
|
|
7709
|
-
|
|
7710
|
-
|
|
7711
|
-
|
|
7712
|
-
|
|
7713
|
-
|
|
7714
|
-
|
|
7715
|
-
|
|
7716
|
-
|
|
7717
|
-
|
|
7718
|
-
|
|
7719
|
-
|
|
7720
|
-
|
|
7721
|
-
|
|
7722
|
-
|
|
7723
|
-
|
|
7724
|
-
|
|
7725
|
-
|
|
7726
|
-
|
|
7727
|
-
|
|
7728
|
-
|
|
7729
|
-
|
|
7730
|
-
|
|
7731
|
-
|
|
7732
|
-
|
|
7733
|
-
|
|
7734
|
-
|
|
7735
|
-
|
|
7736
|
-
|
|
7737
|
-
|
|
7738
|
-
|
|
7739
|
-
|
|
7740
|
-
|
|
7741
|
-
|
|
7742
|
-
|
|
7743
|
-
|
|
7744
|
-
|
|
7745
|
-
|
|
7746
|
-
|
|
7747
|
-
|
|
7748
|
-
|
|
7749
|
-
|
|
7750
|
-
|
|
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
7751
|
];
|
|
7752
7752
|
const codecs = [
|
|
7753
|
-
|
|
7754
|
-
|
|
7755
|
-
|
|
7756
|
-
|
|
7757
|
-
|
|
7753
|
+
...internalCodecs,
|
|
7754
|
+
...blockchainCodecs,
|
|
7755
|
+
...consensusCodecs,
|
|
7756
|
+
...socialCodecs,
|
|
7757
|
+
...peernetCodecs
|
|
7758
7758
|
];
|
|
7759
7759
|
|
|
7760
7760
|
const registry = {};
|
|
7761
7761
|
const addCodec = (codecInput) => {
|
|
7762
|
-
|
|
7763
|
-
|
|
7764
|
-
|
|
7765
|
-
|
|
7766
|
-
|
|
7767
|
-
|
|
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
7768
|
};
|
|
7769
7769
|
for (const codec of codecs) {
|
|
7770
|
-
|
|
7770
|
+
addCodec(codec);
|
|
7771
7771
|
}
|
|
7772
7772
|
const getCodecByName = (name) => registry[name];
|
|
7773
7773
|
const getCodecName = (codec) => {
|
|
7774
|
-
|
|
7775
|
-
|
|
7776
|
-
|
|
7774
|
+
return Object.keys(registry).reduce((p, c) => {
|
|
7775
|
+
return registry[c].codec === codec ? c : p;
|
|
7776
|
+
}, void 0);
|
|
7777
7777
|
};
|
|
7778
7778
|
const getCodec = (name) => {
|
|
7779
|
-
|
|
7780
|
-
|
|
7781
|
-
|
|
7779
|
+
if (typeof name === "number")
|
|
7780
|
+
return name;
|
|
7781
|
+
return getCodecByName(name).codec;
|
|
7782
7782
|
};
|
|
7783
7783
|
const getHashAlg = (name) => {
|
|
7784
|
-
|
|
7785
|
-
|
|
7786
|
-
|
|
7784
|
+
if (typeof name === "number")
|
|
7785
|
+
return getCodecByName(getCodecName(name)).hashAlg;
|
|
7786
|
+
return getCodecByName(name).hashAlg;
|
|
7787
7787
|
};
|
|
7788
7788
|
const isCodec = (codec) => {
|
|
7789
|
-
|
|
7789
|
+
return codec.codec !== void 0 && !!codec.hashAlg;
|
|
7790
7790
|
};
|
|
7791
7791
|
const validateCodec = (codec) => {
|
|
7792
|
-
|
|
7793
|
-
|
|
7792
|
+
if (codec.codec === void 0 || codec.hashAlg === void 0 || codec.name === void 0)
|
|
7793
|
+
throw new Error(`invalid codecInput: ${codec}`);
|
|
7794
7794
|
};
|
|
7795
7795
|
const utils = {
|
|
7796
|
-
|
|
7797
|
-
|
|
7798
|
-
|
|
7799
|
-
|
|
7800
|
-
|
|
7801
|
-
|
|
7802
|
-
|
|
7796
|
+
isCodec,
|
|
7797
|
+
addCodec,
|
|
7798
|
+
getCodec,
|
|
7799
|
+
getHashAlg,
|
|
7800
|
+
getCodecName,
|
|
7801
|
+
validateCodec,
|
|
7802
|
+
codecs: registry
|
|
7803
7803
|
};
|
|
7804
7804
|
|
|
7805
7805
|
class Codec extends BasicInterface {
|
|
@@ -8767,281 +8767,263 @@ let FormatInterface$1 = class FormatInterface extends BasicInterface {
|
|
|
8767
8767
|
const FormatInterface = FormatInterface$1;
|
|
8768
8768
|
|
|
8769
8769
|
var proto$b = {
|
|
8770
|
-
|
|
8771
|
-
|
|
8770
|
+
address: String(),
|
|
8771
|
+
reward: BigInt(0)
|
|
8772
8772
|
};
|
|
8773
|
-
|
|
8774
8773
|
class ValidatorMessage extends FormatInterface {
|
|
8775
|
-
|
|
8776
|
-
|
|
8777
|
-
|
|
8778
|
-
|
|
8779
|
-
|
|
8780
|
-
|
|
8781
|
-
|
|
8782
|
-
|
|
8783
|
-
|
|
8774
|
+
get messageName() {
|
|
8775
|
+
return "ValidatorMessage";
|
|
8776
|
+
}
|
|
8777
|
+
constructor(buffer) {
|
|
8778
|
+
if (buffer instanceof ValidatorMessage)
|
|
8779
|
+
return buffer;
|
|
8780
|
+
const name = "validator-message";
|
|
8781
|
+
super(buffer, proto$b, { name });
|
|
8782
|
+
}
|
|
8784
8783
|
}
|
|
8785
8784
|
|
|
8786
8785
|
var proto$a = {
|
|
8787
|
-
|
|
8788
|
-
|
|
8789
|
-
|
|
8790
|
-
|
|
8791
|
-
|
|
8792
|
-
|
|
8793
|
-
|
|
8794
|
-
|
|
8795
|
-
|
|
8796
|
-
|
|
8786
|
+
index: BigInt(0),
|
|
8787
|
+
previousHash: String(),
|
|
8788
|
+
timestamp: Number(),
|
|
8789
|
+
reward: BigInt(0),
|
|
8790
|
+
fees: BigInt(0),
|
|
8791
|
+
transactions: Array(),
|
|
8792
|
+
validators: new Uint8Array(),
|
|
8793
|
+
producer: String(),
|
|
8794
|
+
producerProof: String(),
|
|
8795
|
+
protocolVersion: String()
|
|
8797
8796
|
};
|
|
8798
|
-
|
|
8799
8797
|
class BlockMessage extends FormatInterface {
|
|
8800
|
-
|
|
8801
|
-
|
|
8802
|
-
|
|
8803
|
-
|
|
8804
|
-
|
|
8805
|
-
|
|
8806
|
-
|
|
8807
|
-
|
|
8808
|
-
|
|
8809
|
-
|
|
8810
|
-
|
|
8811
|
-
|
|
8812
|
-
|
|
8813
|
-
|
|
8814
|
-
|
|
8815
|
-
|
|
8816
|
-
|
|
8817
|
-
|
|
8818
|
-
|
|
8819
|
-
|
|
8820
|
-
|
|
8821
|
-
|
|
8822
|
-
|
|
8823
|
-
|
|
8824
|
-
|
|
8825
|
-
|
|
8826
|
-
|
|
8827
|
-
|
|
8828
|
-
|
|
8829
|
-
}
|
|
8798
|
+
get messageName() {
|
|
8799
|
+
return "BlockMessage";
|
|
8800
|
+
}
|
|
8801
|
+
constructor(buffer) {
|
|
8802
|
+
if (buffer instanceof BlockMessage)
|
|
8803
|
+
return buffer;
|
|
8804
|
+
const name = "block-message";
|
|
8805
|
+
super(buffer, proto$a, { name });
|
|
8806
|
+
}
|
|
8807
|
+
encode(decoded) {
|
|
8808
|
+
decoded = decoded || this.decoded;
|
|
8809
|
+
const validators = [];
|
|
8810
|
+
for (const validator of decoded.validators) {
|
|
8811
|
+
if (validator instanceof ValidatorMessage)
|
|
8812
|
+
validators.push(validator.encode());
|
|
8813
|
+
else
|
|
8814
|
+
validators.push(new ValidatorMessage(validator).encode());
|
|
8815
|
+
}
|
|
8816
|
+
return super.encode({
|
|
8817
|
+
...decoded,
|
|
8818
|
+
validators: index$3(validators)
|
|
8819
|
+
});
|
|
8820
|
+
}
|
|
8821
|
+
decode(encoded) {
|
|
8822
|
+
encoded = encoded || this.encoded;
|
|
8823
|
+
super.decode(encoded);
|
|
8824
|
+
this.decoded.validators = index$2(this.decoded.validators).map((validator) => new ValidatorMessage(validator).decoded);
|
|
8825
|
+
return this.decoded;
|
|
8826
|
+
}
|
|
8830
8827
|
}
|
|
8831
8828
|
|
|
8832
8829
|
var proto$9 = {
|
|
8833
|
-
|
|
8834
|
-
|
|
8830
|
+
up: Number(),
|
|
8831
|
+
down: Number()
|
|
8835
8832
|
};
|
|
8836
|
-
|
|
8837
8833
|
class BWMessage extends FormatInterface {
|
|
8838
|
-
|
|
8839
|
-
|
|
8840
|
-
|
|
8841
|
-
|
|
8842
|
-
|
|
8843
|
-
|
|
8844
|
-
|
|
8845
|
-
|
|
8846
|
-
|
|
8834
|
+
get messageName() {
|
|
8835
|
+
return "BWMessage";
|
|
8836
|
+
}
|
|
8837
|
+
constructor(buffer) {
|
|
8838
|
+
if (buffer instanceof BWMessage)
|
|
8839
|
+
return buffer;
|
|
8840
|
+
const name = "bw-message";
|
|
8841
|
+
super(buffer, proto$9, { name });
|
|
8842
|
+
}
|
|
8847
8843
|
}
|
|
8848
8844
|
|
|
8849
8845
|
var proto$8 = {};
|
|
8850
|
-
|
|
8851
8846
|
class BWRequestMessage extends FormatInterface {
|
|
8852
|
-
|
|
8853
|
-
|
|
8854
|
-
|
|
8855
|
-
|
|
8856
|
-
|
|
8857
|
-
|
|
8858
|
-
|
|
8859
|
-
|
|
8860
|
-
|
|
8847
|
+
get messageName() {
|
|
8848
|
+
return "BWRequestMessage";
|
|
8849
|
+
}
|
|
8850
|
+
constructor(buffer) {
|
|
8851
|
+
if (buffer instanceof BWRequestMessage)
|
|
8852
|
+
return buffer;
|
|
8853
|
+
const name = "bw-request-message";
|
|
8854
|
+
super(buffer, proto$8, { name });
|
|
8855
|
+
}
|
|
8861
8856
|
}
|
|
8862
8857
|
|
|
8863
8858
|
var proto$7 = {
|
|
8864
|
-
|
|
8865
|
-
|
|
8866
|
-
|
|
8859
|
+
creator: String(),
|
|
8860
|
+
contract: new Uint8Array(),
|
|
8861
|
+
constructorParameters: Array()
|
|
8867
8862
|
};
|
|
8868
|
-
|
|
8869
8863
|
class ContractMessage extends FormatInterface {
|
|
8870
|
-
|
|
8871
|
-
|
|
8872
|
-
|
|
8873
|
-
|
|
8874
|
-
|
|
8875
|
-
|
|
8876
|
-
|
|
8877
|
-
|
|
8864
|
+
get messageName() {
|
|
8865
|
+
return "ContractMessage";
|
|
8866
|
+
}
|
|
8867
|
+
constructor(buffer) {
|
|
8868
|
+
if (buffer instanceof ContractMessage)
|
|
8869
|
+
return buffer;
|
|
8870
|
+
super(buffer, proto$7, { name: "contract-message" });
|
|
8871
|
+
}
|
|
8878
8872
|
}
|
|
8879
8873
|
|
|
8880
8874
|
var proto$6 = {
|
|
8881
|
-
|
|
8882
|
-
|
|
8875
|
+
hash: String(),
|
|
8876
|
+
index: BigInt(0)
|
|
8883
8877
|
};
|
|
8884
|
-
|
|
8885
8878
|
class LastBlockMessage extends FormatInterface {
|
|
8886
|
-
|
|
8887
|
-
|
|
8888
|
-
|
|
8889
|
-
|
|
8890
|
-
|
|
8891
|
-
|
|
8892
|
-
|
|
8893
|
-
|
|
8894
|
-
|
|
8879
|
+
get messageName() {
|
|
8880
|
+
return "LastBlockMessage";
|
|
8881
|
+
}
|
|
8882
|
+
constructor(buffer) {
|
|
8883
|
+
if (buffer instanceof LastBlockMessage)
|
|
8884
|
+
return buffer;
|
|
8885
|
+
const name = "last-block-message";
|
|
8886
|
+
super(buffer, proto$6, { name });
|
|
8887
|
+
}
|
|
8895
8888
|
}
|
|
8896
8889
|
|
|
8897
8890
|
var proto$5 = {
|
|
8898
|
-
|
|
8899
|
-
|
|
8900
|
-
|
|
8901
|
-
|
|
8902
|
-
|
|
8903
|
-
|
|
8904
|
-
|
|
8905
|
-
|
|
8906
|
-
|
|
8891
|
+
timestamp: Number(),
|
|
8892
|
+
from: String(),
|
|
8893
|
+
to: String(),
|
|
8894
|
+
method: String(),
|
|
8895
|
+
params: Array(),
|
|
8896
|
+
signature: String(),
|
|
8897
|
+
"nonce?": Number(),
|
|
8898
|
+
"dependsOn?": Array(),
|
|
8899
|
+
"priority?": Boolean()
|
|
8907
8900
|
};
|
|
8908
|
-
|
|
8909
8901
|
class TransactionMessage extends FormatInterface {
|
|
8910
|
-
|
|
8911
|
-
|
|
8912
|
-
|
|
8913
|
-
|
|
8914
|
-
|
|
8915
|
-
|
|
8916
|
-
|
|
8917
|
-
|
|
8918
|
-
|
|
8919
|
-
|
|
8920
|
-
|
|
8921
|
-
|
|
8922
|
-
|
|
8923
|
-
|
|
8924
|
-
|
|
8925
|
-
|
|
8902
|
+
get messageName() {
|
|
8903
|
+
return "TransactionMessage";
|
|
8904
|
+
}
|
|
8905
|
+
constructor(buffer) {
|
|
8906
|
+
if (buffer instanceof TransactionMessage)
|
|
8907
|
+
return buffer;
|
|
8908
|
+
const name = "transaction-message";
|
|
8909
|
+
super(buffer, proto$5, { name });
|
|
8910
|
+
}
|
|
8911
|
+
beforeHashing(decoded) {
|
|
8912
|
+
decoded = super.beforeHashing(decoded);
|
|
8913
|
+
delete decoded.signature;
|
|
8914
|
+
delete decoded.priority;
|
|
8915
|
+
delete decoded.dependsOn;
|
|
8916
|
+
return decoded;
|
|
8917
|
+
}
|
|
8926
8918
|
}
|
|
8927
8919
|
|
|
8928
8920
|
var proto$4 = {
|
|
8929
|
-
|
|
8930
|
-
|
|
8921
|
+
lastblock: Object(),
|
|
8922
|
+
values: Object()
|
|
8931
8923
|
};
|
|
8932
|
-
|
|
8933
8924
|
class StateMessage extends FormatInterface {
|
|
8934
|
-
|
|
8935
|
-
|
|
8936
|
-
|
|
8937
|
-
|
|
8938
|
-
|
|
8939
|
-
|
|
8940
|
-
|
|
8941
|
-
|
|
8942
|
-
|
|
8925
|
+
get messageName() {
|
|
8926
|
+
return "StateMessage";
|
|
8927
|
+
}
|
|
8928
|
+
constructor(buffer) {
|
|
8929
|
+
if (buffer instanceof StateMessage)
|
|
8930
|
+
return buffer;
|
|
8931
|
+
const name = "state-message";
|
|
8932
|
+
super(buffer, proto$4, { name });
|
|
8933
|
+
}
|
|
8943
8934
|
}
|
|
8944
8935
|
|
|
8945
8936
|
var proto$3 = {
|
|
8946
|
-
|
|
8947
|
-
|
|
8948
|
-
|
|
8949
|
-
|
|
8950
|
-
|
|
8951
|
-
|
|
8937
|
+
timestamp: Number(),
|
|
8938
|
+
from: String(),
|
|
8939
|
+
to: String(),
|
|
8940
|
+
method: String(),
|
|
8941
|
+
params: Array(),
|
|
8942
|
+
"nonce?": Number()
|
|
8952
8943
|
};
|
|
8953
|
-
|
|
8954
8944
|
class RawTransactionMessage extends FormatInterface {
|
|
8955
|
-
|
|
8956
|
-
|
|
8957
|
-
|
|
8958
|
-
|
|
8959
|
-
|
|
8960
|
-
|
|
8961
|
-
|
|
8962
|
-
|
|
8963
|
-
|
|
8945
|
+
get messageName() {
|
|
8946
|
+
return "RawTransactionMessage";
|
|
8947
|
+
}
|
|
8948
|
+
constructor(buffer) {
|
|
8949
|
+
if (buffer instanceof RawTransactionMessage)
|
|
8950
|
+
return buffer;
|
|
8951
|
+
const name = "raw-transaction-message";
|
|
8952
|
+
super(buffer, proto$3, { name });
|
|
8953
|
+
}
|
|
8964
8954
|
}
|
|
8965
|
-
|
|
8966
8955
|
var proto$2 = {
|
|
8967
|
-
|
|
8968
|
-
|
|
8969
|
-
|
|
8970
|
-
|
|
8956
|
+
blockHash: String(),
|
|
8957
|
+
index: BigInt(0),
|
|
8958
|
+
round: BigInt(0),
|
|
8959
|
+
from: String()
|
|
8971
8960
|
};
|
|
8972
|
-
|
|
8973
8961
|
class PrevoteMessage extends FormatInterface {
|
|
8974
|
-
|
|
8975
|
-
|
|
8976
|
-
|
|
8977
|
-
|
|
8978
|
-
|
|
8979
|
-
|
|
8980
|
-
|
|
8981
|
-
|
|
8982
|
-
|
|
8962
|
+
get messageName() {
|
|
8963
|
+
return "PrevoteMessage";
|
|
8964
|
+
}
|
|
8965
|
+
constructor(buffer) {
|
|
8966
|
+
if (buffer instanceof PrevoteMessage)
|
|
8967
|
+
return buffer;
|
|
8968
|
+
const name = "prevote-message";
|
|
8969
|
+
super(buffer, proto$2, { name });
|
|
8970
|
+
}
|
|
8983
8971
|
}
|
|
8984
|
-
|
|
8985
8972
|
var proto$1 = {
|
|
8986
|
-
|
|
8987
|
-
|
|
8988
|
-
|
|
8989
|
-
|
|
8973
|
+
blockHash: String(),
|
|
8974
|
+
index: BigInt(0),
|
|
8975
|
+
round: BigInt(0),
|
|
8976
|
+
from: String()
|
|
8990
8977
|
};
|
|
8991
|
-
|
|
8992
8978
|
class PrecommitMessage extends FormatInterface {
|
|
8993
|
-
|
|
8994
|
-
|
|
8995
|
-
|
|
8996
|
-
|
|
8997
|
-
|
|
8998
|
-
|
|
8999
|
-
|
|
9000
|
-
|
|
9001
|
-
|
|
8979
|
+
get messageName() {
|
|
8980
|
+
return "PrecommitMessage";
|
|
8981
|
+
}
|
|
8982
|
+
constructor(buffer) {
|
|
8983
|
+
if (buffer instanceof PrecommitMessage)
|
|
8984
|
+
return buffer;
|
|
8985
|
+
const name = "precommit-message";
|
|
8986
|
+
super(buffer, proto$1, { name });
|
|
8987
|
+
}
|
|
9002
8988
|
}
|
|
9003
|
-
|
|
9004
8989
|
var proto = {
|
|
9005
|
-
|
|
9006
|
-
|
|
9007
|
-
|
|
9008
|
-
|
|
8990
|
+
blockHash: String(),
|
|
8991
|
+
index: BigInt(0),
|
|
8992
|
+
round: BigInt(0),
|
|
8993
|
+
from: String()
|
|
9009
8994
|
};
|
|
9010
|
-
|
|
9011
8995
|
class ProposalMessage extends FormatInterface {
|
|
9012
|
-
|
|
9013
|
-
|
|
9014
|
-
|
|
9015
|
-
|
|
9016
|
-
|
|
9017
|
-
|
|
9018
|
-
|
|
9019
|
-
|
|
9020
|
-
|
|
8996
|
+
get messageName() {
|
|
8997
|
+
return "ProposalMessage";
|
|
8998
|
+
}
|
|
8999
|
+
constructor(buffer) {
|
|
9000
|
+
if (buffer instanceof ProposalMessage)
|
|
9001
|
+
return buffer;
|
|
9002
|
+
const name = "proposal-message";
|
|
9003
|
+
super(buffer, proto, { name });
|
|
9004
|
+
}
|
|
9021
9005
|
}
|
|
9022
9006
|
|
|
9023
|
-
// todo only one star needed, no need to have one for each network
|
|
9024
|
-
// unless we change anything to the star protocol
|
|
9025
|
-
// version differences should be handled in the chain
|
|
9026
|
-
// maybe a good way to handle could be in p2pt-swarm
|
|
9027
9007
|
var networks = {
|
|
9028
|
-
|
|
9029
|
-
|
|
9030
|
-
|
|
9031
|
-
|
|
9032
|
-
|
|
9033
|
-
|
|
9034
|
-
|
|
9035
|
-
|
|
9036
|
-
|
|
9037
|
-
|
|
9038
|
-
|
|
9039
|
-
|
|
9040
|
-
|
|
9041
|
-
|
|
9042
|
-
|
|
9043
|
-
|
|
9008
|
+
leofcoin: {
|
|
9009
|
+
mainnet: {
|
|
9010
|
+
// ports don't really matter since it is favorable to have it begind a ngninx proxy but if we change something to the proto it's easier maybe?
|
|
9011
|
+
port: 44444,
|
|
9012
|
+
// todo a versionhash would be nice to have as a double check?
|
|
9013
|
+
versionHash: "0",
|
|
9014
|
+
// a short description identifying the version
|
|
9015
|
+
description: "Main net current version",
|
|
9016
|
+
stars: ["wss://star.leofcoin.org"]
|
|
9017
|
+
// todo webrtc and bittorent stars
|
|
9018
|
+
},
|
|
9019
|
+
peach: {
|
|
9020
|
+
port: 44444,
|
|
9021
|
+
description: "Main testnet: latest step before merging into main",
|
|
9022
|
+
versionHash: "1",
|
|
9023
|
+
stars: ["wss://star.leofcoin.org"]
|
|
9024
|
+
// todo webrtc and bittorent stars
|
|
9044
9025
|
}
|
|
9026
|
+
}
|
|
9045
9027
|
};
|
|
9046
9028
|
|
|
9047
9029
|
var networks$1 = /*#__PURE__*/Object.freeze({
|
|
@@ -9049,13 +9031,13 @@ var networks$1 = /*#__PURE__*/Object.freeze({
|
|
|
9049
9031
|
default: networks
|
|
9050
9032
|
});
|
|
9051
9033
|
|
|
9052
|
-
const PROTOCOL_VERSION =
|
|
9053
|
-
const REACHED_ONE_ZERO_ZERO = false;
|
|
9034
|
+
const PROTOCOL_VERSION = "0.1.1";
|
|
9035
|
+
const REACHED_ONE_ZERO_ZERO = false;
|
|
9054
9036
|
const DEFAULT_NODE_OPTIONS = {
|
|
9055
|
-
|
|
9056
|
-
|
|
9057
|
-
|
|
9058
|
-
|
|
9037
|
+
network: "leofcoin:peach",
|
|
9038
|
+
networkVersion: "peach",
|
|
9039
|
+
version: PROTOCOL_VERSION,
|
|
9040
|
+
stars: networks.leofcoin.peach.stars
|
|
9059
9041
|
};
|
|
9060
9042
|
|
|
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
|
|
9043
|
+
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 };
|