@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.
Files changed (35) hide show
  1. package/exports/browser/chain.js +3932 -4500
  2. package/exports/browser/{constants-M3qbPwZp.js → constants-BCaq9RBn.js} +408 -426
  3. package/exports/browser/node-browser.js +50 -57
  4. package/exports/chain.js +3185 -3567
  5. package/exports/constants-C83ZCYKa.js +12 -0
  6. package/exports/node.js +19 -24
  7. package/package.json +2 -1
  8. package/exports/chain.d.ts +0 -73
  9. package/exports/config/config.d.ts +0 -1
  10. package/exports/config/main.d.ts +0 -5
  11. package/exports/config/protocol.d.ts +0 -6
  12. package/exports/connection-monitor.d.ts +0 -14
  13. package/exports/consensus/consensus.d.ts +0 -1
  14. package/exports/consensus/helpers/sort-transactions.d.ts +0 -1
  15. package/exports/constants-eo0U5-D_.js +0 -12
  16. package/exports/constants.d.ts +0 -15
  17. package/exports/contract-registry.d.ts +0 -106
  18. package/exports/contract-utils.d.ts +0 -49
  19. package/exports/contract.d.ts +0 -90
  20. package/exports/examples/contract-inheritance-example.d.ts +0 -58
  21. package/exports/examples/hash-based-contracts.d.ts +0 -82
  22. package/exports/fee/config.d.ts +0 -4
  23. package/exports/helpers/contract.d.ts +0 -4
  24. package/exports/jobs/jobber.d.ts +0 -7
  25. package/exports/machine-state.d.ts +0 -6
  26. package/exports/machine.d.ts +0 -64
  27. package/exports/node-browser.d.ts +0 -6
  28. package/exports/node.d.ts +0 -8
  29. package/exports/protocol.d.ts +0 -15
  30. package/exports/simplifiers/state.d.ts +0 -3
  31. package/exports/state.d.ts +0 -66
  32. package/exports/sync-controller.d.ts +0 -14
  33. package/exports/transaction.d.ts +0 -41
  34. package/exports/types.d.ts +0 -24
  35. package/exports/version-control.d.ts +0 -7
@@ -7570,236 +7570,236 @@ class BasicInterface {
7570
7570
  }
7571
7571
 
7572
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
- }
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
- 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
- }
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
- name: 'pubsub-request',
7669
- codec: '0x70737271',
7670
- hashAlg: 'keccak-256'
7671
- },
7672
- {
7673
- name: 'pubsub-response',
7674
- codec: '0x707372',
7675
- hashAlg: 'keccak-256'
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
- name: 'chat-message',
7681
- codec: '0x70636d',
7682
- hashAlg: 'dbl-keccak-256'
7683
- }
7679
+ {
7680
+ name: "chat-message",
7681
+ codec: "0x70636d",
7682
+ hashAlg: "dbl-keccak-256"
7683
+ }
7684
7684
  ];
7685
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
- }
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
- ...internalCodecs,
7754
- ...blockchainCodecs,
7755
- ...consensusCodecs,
7756
- ...socialCodecs,
7757
- ...peernetCodecs
7753
+ ...internalCodecs,
7754
+ ...blockchainCodecs,
7755
+ ...consensusCodecs,
7756
+ ...socialCodecs,
7757
+ ...peernetCodecs
7758
7758
  ];
7759
7759
 
7760
7760
  const registry = {};
7761
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
- };
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
- addCodec(codec);
7770
+ addCodec(codec);
7771
7771
  }
7772
7772
  const getCodecByName = (name) => registry[name];
7773
7773
  const getCodecName = (codec) => {
7774
- return Object.keys(registry).reduce((p, c) => {
7775
- return registry[c].codec === codec ? c : p;
7776
- }, undefined);
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
- if (typeof name === 'number')
7780
- return name;
7781
- return getCodecByName(name).codec;
7779
+ if (typeof name === "number")
7780
+ return name;
7781
+ return getCodecByName(name).codec;
7782
7782
  };
7783
7783
  const getHashAlg = (name) => {
7784
- if (typeof name === 'number')
7785
- return getCodecByName(getCodecName(name)).hashAlg;
7786
- return getCodecByName(name).hashAlg;
7784
+ if (typeof name === "number")
7785
+ return getCodecByName(getCodecName(name)).hashAlg;
7786
+ return getCodecByName(name).hashAlg;
7787
7787
  };
7788
7788
  const isCodec = (codec) => {
7789
- return codec.codec !== undefined && !!codec.hashAlg;
7789
+ return codec.codec !== void 0 && !!codec.hashAlg;
7790
7790
  };
7791
7791
  const validateCodec = (codec) => {
7792
- if (codec.codec === undefined || codec.hashAlg === undefined || codec.name === undefined)
7793
- throw new Error(`invalid codecInput: ${codec}`);
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
- isCodec,
7797
- addCodec,
7798
- getCodec,
7799
- getHashAlg,
7800
- getCodecName,
7801
- validateCodec,
7802
- codecs: registry
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
- address: String(),
8771
- reward: BigInt(0)
8770
+ address: String(),
8771
+ reward: BigInt(0)
8772
8772
  };
8773
-
8774
8773
  class ValidatorMessage extends FormatInterface {
8775
- get messageName() {
8776
- return 'ValidatorMessage';
8777
- }
8778
- constructor(buffer) {
8779
- if (buffer instanceof ValidatorMessage)
8780
- return buffer;
8781
- const name = 'validator-message';
8782
- super(buffer, proto$b, { name });
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
- index: BigInt(0),
8788
- previousHash: String(),
8789
- timestamp: Number(),
8790
- reward: BigInt(0),
8791
- fees: BigInt(0),
8792
- transactions: Array(),
8793
- validators: new Uint8Array(),
8794
- producer: String(),
8795
- producerProof: String(),
8796
- protocolVersion: String()
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
- get messageName() {
8801
- return 'BlockMessage';
8802
- }
8803
- constructor(buffer) {
8804
- if (buffer instanceof BlockMessage)
8805
- return buffer;
8806
- const name = 'block-message';
8807
- super(buffer, proto$a, { name });
8808
- }
8809
- encode(decoded) {
8810
- decoded = decoded || this.decoded;
8811
- const validators = [];
8812
- for (const validator of decoded.validators) {
8813
- if (validator instanceof ValidatorMessage)
8814
- validators.push(validator.encode());
8815
- else
8816
- validators.push(new ValidatorMessage(validator).encode());
8817
- }
8818
- return super.encode({
8819
- ...decoded,
8820
- validators: index$3(validators)
8821
- });
8822
- }
8823
- decode(encoded) {
8824
- encoded = encoded || this.encoded;
8825
- super.decode(encoded);
8826
- // @ts-ignore
8827
- this.decoded.validators = index$2(this.decoded.validators).map((validator) => new ValidatorMessage(validator).decoded);
8828
- return this.decoded;
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
- up: Number(),
8834
- down: Number()
8830
+ up: Number(),
8831
+ down: Number()
8835
8832
  };
8836
-
8837
8833
  class BWMessage extends FormatInterface {
8838
- get messageName() {
8839
- return 'BWMessage';
8840
- }
8841
- constructor(buffer) {
8842
- if (buffer instanceof BWMessage)
8843
- return buffer;
8844
- const name = 'bw-message';
8845
- super(buffer, proto$9, { name });
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
- get messageName() {
8853
- return 'BWRequestMessage';
8854
- }
8855
- constructor(buffer) {
8856
- if (buffer instanceof BWRequestMessage)
8857
- return buffer;
8858
- const name = 'bw-request-message';
8859
- super(buffer, proto$8, { name });
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
- creator: String(),
8865
- contract: new Uint8Array(),
8866
- constructorParameters: Array()
8859
+ creator: String(),
8860
+ contract: new Uint8Array(),
8861
+ constructorParameters: Array()
8867
8862
  };
8868
-
8869
8863
  class ContractMessage extends FormatInterface {
8870
- get messageName() {
8871
- return 'ContractMessage';
8872
- }
8873
- constructor(buffer) {
8874
- if (buffer instanceof ContractMessage)
8875
- return buffer;
8876
- super(buffer, proto$7, { name: 'contract-message' });
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
- hash: String(),
8882
- index: BigInt(0)
8875
+ hash: String(),
8876
+ index: BigInt(0)
8883
8877
  };
8884
-
8885
8878
  class LastBlockMessage extends FormatInterface {
8886
- get messageName() {
8887
- return 'LastBlockMessage';
8888
- }
8889
- constructor(buffer) {
8890
- if (buffer instanceof LastBlockMessage)
8891
- return buffer;
8892
- const name = 'last-block-message';
8893
- super(buffer, proto$6, { name });
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
- timestamp: Number(),
8899
- from: String(),
8900
- to: String(),
8901
- method: String(),
8902
- params: Array(),
8903
- signature: String(),
8904
- 'nonce?': Number(),
8905
- 'dependsOn?': Array(),
8906
- 'priority?': Boolean()
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
- get messageName() {
8911
- return 'TransactionMessage';
8912
- }
8913
- constructor(buffer) {
8914
- if (buffer instanceof TransactionMessage)
8915
- return buffer;
8916
- const name = 'transaction-message';
8917
- super(buffer, proto$5, { name });
8918
- }
8919
- beforeHashing(decoded) {
8920
- decoded = super.beforeHashing(decoded);
8921
- delete decoded.signature;
8922
- delete decoded.priority;
8923
- delete decoded.dependsOn;
8924
- return decoded;
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
- lastblock: Object(),
8930
- values: Object()
8921
+ lastblock: Object(),
8922
+ values: Object()
8931
8923
  };
8932
-
8933
8924
  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
- }
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
- timestamp: Number(),
8947
- from: String(),
8948
- to: String(),
8949
- method: String(),
8950
- params: Array(),
8951
- 'nonce?': Number()
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
- get messageName() {
8956
- return 'RawTransactionMessage';
8957
- }
8958
- constructor(buffer) {
8959
- if (buffer instanceof RawTransactionMessage)
8960
- return buffer;
8961
- const name = 'raw-transaction-message';
8962
- super(buffer, proto$3, { name });
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
- blockHash: String(),
8968
- index: BigInt(0),
8969
- round: BigInt(0),
8970
- from: String()
8956
+ blockHash: String(),
8957
+ index: BigInt(0),
8958
+ round: BigInt(0),
8959
+ from: String()
8971
8960
  };
8972
-
8973
8961
  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
- }
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
- blockHash: String(),
8987
- index: BigInt(0),
8988
- round: BigInt(0),
8989
- from: String()
8973
+ blockHash: String(),
8974
+ index: BigInt(0),
8975
+ round: BigInt(0),
8976
+ from: String()
8990
8977
  };
8991
-
8992
8978
  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
- }
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
- blockHash: String(),
9006
- index: BigInt(0),
9007
- round: BigInt(0),
9008
- from: String()
8990
+ blockHash: String(),
8991
+ index: BigInt(0),
8992
+ round: BigInt(0),
8993
+ from: String()
9009
8994
  };
9010
-
9011
8995
  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';
9019
- super(buffer, proto, { name });
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
- leofcoin: {
9029
- mainnet: {
9030
- // 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?
9031
- port: 44444,
9032
- // todo a versionhash would be nice to have as a double check?
9033
- versionHash: '0',
9034
- // a short description identifying the version
9035
- description: 'Main net current version',
9036
- stars: ['wss://star.leofcoin.org'] // todo webrtc and bittorent stars
9037
- },
9038
- peach: {
9039
- port: 44444,
9040
- description: 'Main testnet: latest step before merging into main',
9041
- versionHash: '1',
9042
- stars: ['wss://star.leofcoin.org'] // todo webrtc and bittorent stars
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 = '0.1.1';
9053
- const REACHED_ONE_ZERO_ZERO = false; // set to true when protocol reaches v1.0.0
9034
+ const PROTOCOL_VERSION = "0.1.1";
9035
+ const REACHED_ONE_ZERO_ZERO = false;
9054
9036
  const DEFAULT_NODE_OPTIONS = {
9055
- network: 'leofcoin:peach',
9056
- networkVersion: 'peach',
9057
- version: PROTOCOL_VERSION,
9058
- stars: networks.leofcoin.peach.stars
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, utils as u };
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 };