@leofcoin/chain 1.4.82 → 1.4.84

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 (30) hide show
  1. package/exports/browser/chain.js +72 -52
  2. package/exports/browser/client-c8558012-c8558012.js +10727 -0
  3. package/exports/browser/{index-6311966e-b5f647d8.js → index-ed6cbdf7-eb75dc7a.js} +2 -2
  4. package/exports/browser/{index-c3f4012c.js → index-f4429da1.js} +200 -210
  5. package/exports/browser/{messages-54aa3cad-5309745b.js → messages-35d069e1-9413ac70.js} +2 -2
  6. package/exports/browser/{node-browser-3cbee72b.js → node-browser-504c804a.js} +509 -600
  7. package/exports/browser/node-browser.js +2 -2
  8. package/exports/browser/workers/block-worker.js +200 -210
  9. package/exports/browser/workers/machine-worker.js +219 -212
  10. package/exports/chain.js +49 -35
  11. package/exports/types/config/main.d.ts +5 -0
  12. package/exports/{typings → types}/config/protocol.d.ts +1 -1
  13. package/exports/{typings → types}/contract.d.ts +1 -1
  14. package/exports/{typings → types}/fee/config.d.ts +1 -1
  15. package/exports/{typings → types}/machine.d.ts +8 -7
  16. package/exports/{typings → types}/node-browser.d.ts +1 -1
  17. package/exports/{typings → types}/node.d.ts +3 -3
  18. package/exports/workers/block-worker.js +6035 -0
  19. package/exports/workers/machine-worker.js +6298 -0
  20. package/package.json +18 -10
  21. package/exports/browser/client-6072af1a-6072af1a.js +0 -41092
  22. package/exports/typings/config/main.d.ts +0 -5
  23. /package/exports/{typings → types}/config/config.d.ts +0 -0
  24. /package/exports/{typings → types}/jobs/jobber.d.ts +0 -0
  25. /package/exports/{typings → types}/machine-state.d.ts +0 -0
  26. /package/exports/{typings → types}/protocol.d.ts +0 -0
  27. /package/exports/{typings → types}/sync-controller.d.ts +0 -0
  28. /package/exports/{typings → types}/transaction.d.ts +0 -0
  29. /package/exports/{typings → types}/typer.d.ts +0 -0
  30. /package/exports/{typings → types}/types.d.ts +0 -0
@@ -1,2 +1,2 @@
1
- export { N as default } from './node-browser-3cbee72b.js';
2
- import './index-c3f4012c.js';
1
+ export { N as default } from './node-browser-504c804a.js';
2
+ import './index-f4429da1.js';
@@ -4514,216 +4514,206 @@ var index$2 = {
4514
4514
  isBase64
4515
4515
  };
4516
4516
 
4517
- const isTypedArrayCompatible = (possibleUint8Array) => {
4518
- if (typeof possibleUint8Array === 'string') {
4519
- possibleUint8Array = possibleUint8Array.split(',').map(number => Number(number));
4520
- for (const number of possibleUint8Array) {
4521
- if (isNaN(number))
4522
- return false;
4523
- }
4524
- }
4525
- for (const number of possibleUint8Array) {
4526
- if (isNaN(number))
4527
- return false;
4528
- }
4529
- return true;
4530
- };
4531
- /**
4532
- * Returns a String as Uint8Array
4533
- * @param string string to encode to Uint8Array
4534
- * @returns Uint8Array
4535
- */
4536
- const fromString$1 = (string) => new TextEncoder().encode(string);
4537
- /**
4538
- * Returns a Uint8Array as String
4539
- * @param uint8Array Uint8Array to encode to String
4540
- * @returns String
4541
- */
4542
- const toString$1 = (uint8Array) => new TextDecoder().decode(uint8Array);
4543
- /**
4544
- * Returns a String as Uint8Array
4545
- * @param string string to encode to Uint8Array
4546
- * @returns Uint8Array
4547
- */
4548
- const fromUintArrayString = (string) => Uint8Array.from(string.split(',').map(string => Number(string)));
4549
- /**
4550
- * Returns a Uint8Array as String
4551
- * @param uint8Array Uint8Array to encode to String
4552
- * @returns String
4553
- */
4554
- const toUintArrayString = (uint8Array) => uint8Array.toString();
4555
- /**
4556
- * hexString -> uint8Array
4557
- * @param string hex encoded string
4558
- * @returns UintArray
4559
- */
4560
- const fromHex = (string) => Uint8Array.from(string.match(/.{1,2}/g).map((byte) => parseInt(byte, 16)));
4561
- /**
4562
- * uint8Array -> hexString
4563
- * @param bytes number[]
4564
- * @returns hexString
4565
- */
4566
- const toHex = (bytes) => bytes.reduce((string, byte) => string + byte.toString(16).padStart(2, '0'), '');
4567
- /**
4568
- * number[] -> Uint8Array
4569
- * @param array number[]
4570
- * @returns Uint8Array
4571
- */
4572
- const fromArrayLike = (array) => Uint8Array.from(array);
4573
- /**
4574
- * Uint8Array -> number[]
4575
- * @param uint8Array Uint8Array
4576
- * @returns Uint8Array
4577
- */
4578
- const toArrayLike = (uint8Array) => [...uint8Array.values()];
4579
- const toBase64 = (uint8Array) => index$2.encode(uint8Array);
4580
- const fromBase64 = (string) => index$2.decode(string);
4581
- const toBase58 = (uint8Array) => base58$1.encode(uint8Array);
4582
- const fromBase58 = (string) => base58$1.decode(string);
4583
- const toBase32 = (uint8Array) => index$7.encode(uint8Array);
4584
- const fromBase32 = (string) => index$7.decode(string);
4585
- const toBase16 = (uint8Array) => index$3.encode(uint8Array);
4586
- const fromBase16 = (string) => index$3.decode(string);
4587
- let FormatInterface$2 = class FormatInterface {
4588
- encoded;
4589
- constructor(input) {
4590
- if (input) {
4591
- if (index$3.isBase16(input))
4592
- this.encoded = this.fromBase16(input);
4593
- else if (index$7.isBase32(input))
4594
- this.encoded = this.fromBase32(input);
4595
- else if (base58$1.isBase58(input))
4596
- this.encoded = this.fromBase58(input);
4597
- else if (index$2.isBase64(input))
4598
- this.encoded = this.fromBase64(input);
4599
- else if (typeof input === 'string') {
4600
- let isCompatible = isTypedArrayCompatible(input);
4601
- if (isCompatible)
4602
- this.encoded = fromUintArrayString(input);
4603
- else
4604
- this.encoded = this.fromString(input); // normal string
4605
- }
4606
- else if (typeof input === 'object')
4607
- this.encoded = this.fromObject(input);
4608
- else if (input instanceof Uint8Array)
4609
- this.encoded = input;
4610
- else if (Array.isArray(input) && isTypedArrayCompatible(input))
4611
- this.encoded = this.fromArrayLike(input);
4612
- }
4613
- }
4614
- /**
4615
- * Returns a String as Uint8Array
4616
- * @param string string to encode to Uint8Array
4617
- * @returns Uint8Array
4618
- */
4619
- fromString(string) {
4620
- return new TextEncoder().encode(string);
4621
- }
4622
- /**
4623
- * Returns a Uint8Array as String
4624
- * @param uint8Array Uint8Array to encode to String
4625
- * @returns String
4626
- */
4627
- toString(uint8Array) {
4628
- return new TextDecoder().decode(uint8Array);
4629
- }
4630
- /**
4631
- * Returns a String as Uint8Array
4632
- * @param string string to encode to Uint8Array
4633
- * @returns Uint8Array
4634
- */
4635
- fromUintArrayString(string) {
4636
- return Uint8Array.from(string.split(',').map(string => Number(string)));
4637
- }
4638
- /**
4639
- * Returns a Uint8Array as String
4640
- * @param uint8Array Uint8Array to encode to String
4641
- * @returns String
4642
- */
4643
- toUintArrayString(uint8Array) {
4644
- return uint8Array.toString();
4645
- }
4646
- /**
4647
- * hexString -> uint8Array
4648
- * @param string hex encoded string
4649
- * @returns UintArray
4650
- */
4651
- fromHex(string) {
4652
- return Uint8Array.from(string.match(/.{1,2}/g).map((byte) => parseInt(byte, 16)));
4653
- }
4654
- /**
4655
- * uint8Array -> hexString
4656
- * @param bytes number[]
4657
- * @returns hexString
4658
- */
4659
- toHex(bytes) {
4660
- return bytes.reduce((string, byte) => string + byte.toString(16).padStart(2, '0'), '');
4661
- }
4662
- /**
4663
- * number[] -> Uint8Array
4664
- * @param array number[]
4665
- * @returns Uint8Array
4666
- */
4667
- fromArrayLike(array) {
4668
- return Uint8Array.from(array);
4669
- }
4670
- /**
4671
- * Uint8Array -> number[]
4672
- * @param uint8Array Uint8Array
4673
- * @returns Uint8Array
4674
- */
4675
- toArrayLike(uint8Array) {
4676
- return [...uint8Array.values()];
4677
- }
4678
- fromObject(object) {
4679
- return new TextEncoder().encode(JSON.stringify(object));
4680
- }
4681
- toObject(uint8Array) {
4682
- return JSON.parse(new TextDecoder().decode(uint8Array));
4683
- }
4684
- toBase64(uint8Array) {
4685
- return index$2.encode(uint8Array);
4686
- }
4687
- fromBase64(string) {
4688
- return index$2.decode(string);
4689
- }
4690
- toBase58(uint8Array) {
4691
- return base58$1.encode(uint8Array);
4692
- }
4693
- fromBase58(string) {
4694
- return base58$1.decode(string);
4695
- }
4696
- toBase32(uint8Array) {
4697
- return index$7.encode(uint8Array);
4698
- }
4699
- fromBase32(string) {
4700
- return index$7.decode(string);
4701
- }
4702
- toBase16(uint8Array) {
4703
- return index$3.encode(uint8Array);
4704
- }
4705
- fromBase16(string) {
4706
- return index$3.decode(string);
4707
- }
4708
- };
4709
- var index$1 = {
4710
- fromString: fromString$1,
4711
- toString: toString$1,
4712
- fromHex,
4713
- toHex,
4714
- fromArrayLike,
4715
- toArrayLike,
4716
- fromUintArrayString,
4717
- toUintArrayString,
4718
- toBase64,
4719
- fromBase64,
4720
- toBase58,
4721
- fromBase58,
4722
- toBase32,
4723
- fromBase32,
4724
- toBase16,
4725
- fromBase16,
4726
- FormatInterface: FormatInterface$2
4517
+ /**
4518
+ * Returns a hex string as Binary string
4519
+ * @param string string to encode to binary
4520
+ * @returns binaryString
4521
+ */
4522
+ const hexToBinary = (hex) => (parseInt(hex, 16).toString(2)).padStart(8, '0');
4523
+ const isTypedArrayCompatible = (possibleUint8Array) => {
4524
+ if (typeof possibleUint8Array === 'string') {
4525
+ possibleUint8Array = possibleUint8Array.split(',').map(number => Number(number));
4526
+ for (const number of possibleUint8Array) {
4527
+ if (isNaN(number))
4528
+ return false;
4529
+ }
4530
+ }
4531
+ for (const number of possibleUint8Array) {
4532
+ if (isNaN(number))
4533
+ return false;
4534
+ }
4535
+ return true;
4536
+ };
4537
+ /**
4538
+ * Returns a String as Uint8Array
4539
+ * @param string string to encode to Uint8Array
4540
+ * @returns Uint8Array
4541
+ */
4542
+ const fromString$1 = (string) => new TextEncoder().encode(string);
4543
+ /**
4544
+ * Returns a Uint8Array as String
4545
+ * @param uint8Array Uint8Array to encode to String
4546
+ * @returns String
4547
+ */
4548
+ const toString$1 = (uint8Array) => new TextDecoder().decode(uint8Array);
4549
+ /**
4550
+ * Returns a String as Uint8Array
4551
+ * @param string string to encode to Uint8Array
4552
+ * @returns Uint8Array
4553
+ */
4554
+ const fromUintArrayString = (string) => Uint8Array.from(string.split(',').map(string => Number(string)));
4555
+ /**
4556
+ * Returns a Uint8Array as String
4557
+ * @param uint8Array Uint8Array to encode to String
4558
+ * @returns String
4559
+ */
4560
+ const toUintArrayString = (uint8Array) => uint8Array.toString();
4561
+ /**
4562
+ * hexString -> uint8Array
4563
+ * @param string hex encoded string
4564
+ * @returns UintArray
4565
+ */
4566
+ const fromHex = (string) => Uint8Array.from(string.match(/.{1,2}/g).map((byte) => parseInt(byte, 16)));
4567
+ /**
4568
+ * uint8Array -> hexString
4569
+ * @param bytes number[]
4570
+ * @returns hexString
4571
+ */
4572
+ const toHex = (bytes) => bytes.reduce((string, byte) => string + byte.toString(16).padStart(2, '0'), '');
4573
+ /**
4574
+ * number[] -> Uint8Array
4575
+ * @param array number[]
4576
+ * @returns Uint8Array
4577
+ */
4578
+ const fromArrayLike = (array) => Uint8Array.from(array);
4579
+ /**
4580
+ * Uint8Array -> number[]
4581
+ * @param uint8Array Uint8Array
4582
+ * @returns Uint8Array
4583
+ */
4584
+ const toArrayLike = (uint8Array) => [...uint8Array.values()];
4585
+ /**
4586
+ * object -> Uint8Array
4587
+ * @param object any
4588
+ * @returns Uint8Array
4589
+ */
4590
+ const fromObject = (object) => new TextEncoder().encode(JSON.stringify(object));
4591
+ /**
4592
+ * Uint8Array -> Object
4593
+ * @param uint8Array Uint8Array
4594
+ * @returns Object
4595
+ */
4596
+ const toObject = (uint8Array) => JSON.parse(new TextDecoder().decode(uint8Array));
4597
+ const fromBinary = (string) => fromHex(parseInt(string, 2).toString(16).toUpperCase());
4598
+ const toBinary = (uint8Array) => hexToBinary(toHex(uint8Array));
4599
+ const toBase64 = (uint8Array) => index$2.encode(uint8Array);
4600
+ const fromBase64 = (string) => index$2.decode(string);
4601
+ const toBase58 = (uint8Array) => base58$1.encode(uint8Array);
4602
+ const fromBase58 = (string) => base58$1.decode(string);
4603
+ const toBase32 = (uint8Array) => index$7.encode(uint8Array);
4604
+ const fromBase32 = (string) => index$7.decode(string);
4605
+ const toBase16 = (uint8Array) => index$3.encode(uint8Array);
4606
+ const fromBase16 = (string) => index$3.decode(string);
4607
+ let FormatInterface$2 = class FormatInterface {
4608
+ encoded;
4609
+ decoded;
4610
+ constructor(input) {
4611
+ if (input) {
4612
+ if (index$3.isBase16(input))
4613
+ this.encoded = this.fromBase16(input);
4614
+ else if (index$7.isBase32(input))
4615
+ this.encoded = this.fromBase32(input);
4616
+ else if (base58$1.isBase58(input))
4617
+ this.encoded = this.fromBase58(input);
4618
+ else if (index$2.isBase64(input))
4619
+ this.encoded = this.fromBase64(input);
4620
+ else if (typeof input === 'string') {
4621
+ let isCompatible = isTypedArrayCompatible(input);
4622
+ if (isCompatible)
4623
+ this.encoded = fromUintArrayString(input);
4624
+ else
4625
+ this.encoded = this.fromString(input); // normal string
4626
+ }
4627
+ else if (typeof input === 'object')
4628
+ this.encoded = this.fromObject(input);
4629
+ else if (input instanceof Uint8Array)
4630
+ this.encoded = input;
4631
+ else if (Array.isArray(input) && isTypedArrayCompatible(input))
4632
+ this.encoded = this.fromArrayLike(input);
4633
+ }
4634
+ }
4635
+ /**
4636
+ * Returns a String as Uint8Array
4637
+ * @param string string to encode to Uint8Array
4638
+ * @returns Uint8Array
4639
+ */
4640
+ fromString = (string) => this.encoded = fromString$1(string);
4641
+ /**
4642
+ * Returns a Uint8Array as String
4643
+ * @param uint8Array Uint8Array to encode to String
4644
+ * @returns String
4645
+ */
4646
+ toString = (uint8Array) => this.decoded = toString$1(uint8Array);
4647
+ /**
4648
+ * Returns a String as Uint8Array
4649
+ * @param string string to encode to Uint8Array
4650
+ * @returns Uint8Array
4651
+ */
4652
+ fromUintArrayString = (string) => this.encoded = fromUintArrayString(string);
4653
+ /**
4654
+ * Returns a Uint8Array as String
4655
+ * @param uint8Array Uint8Array to encode to String
4656
+ * @returns String
4657
+ */
4658
+ toUintArrayString = (uint8Array) => this.decoded = uint8Array.toString();
4659
+ /**
4660
+ * hexString -> uint8Array
4661
+ * @param string hex encoded string
4662
+ * @returns UintArray
4663
+ */
4664
+ fromHex = (string) => this.encoded = fromHex(string);
4665
+ /**
4666
+ * uint8Array -> hexString
4667
+ * @param bytes ArrayLike
4668
+ * @returns hexString
4669
+ */
4670
+ toHex = (arrayLike) => this.decoded = toHex(arrayLike);
4671
+ /**
4672
+ * number[] -> Uint8Array
4673
+ * @param array number[]
4674
+ * @returns Uint8Array
4675
+ */
4676
+ fromArrayLike = (array) => this.encoded = Uint8Array.from(array);
4677
+ /**
4678
+ * Uint8Array -> number[]
4679
+ * @param uint8Array Uint8Array
4680
+ * @returns Uint8Array
4681
+ */
4682
+ toArrayLike = (uint8Array) => this.decoded = [...uint8Array.values()];
4683
+ fromObject = (object) => this.encoded = fromObject(object);
4684
+ toBinary = (uint8Array) => this.decoded = hexToBinary(toHex(uint8Array));
4685
+ fromBinary = (binary) => this.encoded = fromBinary(binary);
4686
+ toObject = (uint8Array) => this.decoded = toObject(uint8Array);
4687
+ toBase64 = (uint8Array) => this.decoded = index$2.encode(uint8Array);
4688
+ fromBase64 = (string) => this.encoded = index$2.decode(string);
4689
+ toBase58 = (uint8Array) => this.decoded = base58$1.encode(uint8Array);
4690
+ fromBase58 = (string) => this.encoded = base58$1.decode(string);
4691
+ toBase32 = (uint8Array) => this.decoded = index$7.encode(uint8Array);
4692
+ fromBase32 = (string) => this.encoded = index$7.decode(string);
4693
+ toBase16 = (uint8Array) => this.decoded = index$3.encode(uint8Array);
4694
+ fromBase16 = (string) => this.decoded = index$3.decode(string);
4695
+ };
4696
+ var index$1 = {
4697
+ fromString: fromString$1,
4698
+ toString: toString$1,
4699
+ fromHex,
4700
+ toHex,
4701
+ fromArrayLike,
4702
+ toArrayLike,
4703
+ fromUintArrayString,
4704
+ toUintArrayString,
4705
+ toObject,
4706
+ toBinary,
4707
+ fromBinary,
4708
+ toBase64,
4709
+ fromBase64,
4710
+ toBase58,
4711
+ fromBase58,
4712
+ toBase32,
4713
+ fromBase32,
4714
+ toBase16,
4715
+ fromBase16,
4716
+ FormatInterface: FormatInterface$2
4727
4717
  };
4728
4718
 
4729
4719
  const { fromString, toString } = index$1;