@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.
- package/exports/browser/chain.js +72 -52
- package/exports/browser/client-c8558012-c8558012.js +10727 -0
- package/exports/browser/{index-6311966e-b5f647d8.js → index-ed6cbdf7-eb75dc7a.js} +2 -2
- package/exports/browser/{index-c3f4012c.js → index-f4429da1.js} +200 -210
- package/exports/browser/{messages-54aa3cad-5309745b.js → messages-35d069e1-9413ac70.js} +2 -2
- package/exports/browser/{node-browser-3cbee72b.js → node-browser-504c804a.js} +509 -600
- package/exports/browser/node-browser.js +2 -2
- package/exports/browser/workers/block-worker.js +200 -210
- package/exports/browser/workers/machine-worker.js +219 -212
- package/exports/chain.js +49 -35
- package/exports/types/config/main.d.ts +5 -0
- package/exports/{typings → types}/config/protocol.d.ts +1 -1
- package/exports/{typings → types}/contract.d.ts +1 -1
- package/exports/{typings → types}/fee/config.d.ts +1 -1
- package/exports/{typings → types}/machine.d.ts +8 -7
- package/exports/{typings → types}/node-browser.d.ts +1 -1
- package/exports/{typings → types}/node.d.ts +3 -3
- package/exports/workers/block-worker.js +6035 -0
- package/exports/workers/machine-worker.js +6298 -0
- package/package.json +18 -10
- package/exports/browser/client-6072af1a-6072af1a.js +0 -41092
- package/exports/typings/config/main.d.ts +0 -5
- /package/exports/{typings → types}/config/config.d.ts +0 -0
- /package/exports/{typings → types}/jobs/jobber.d.ts +0 -0
- /package/exports/{typings → types}/machine-state.d.ts +0 -0
- /package/exports/{typings → types}/protocol.d.ts +0 -0
- /package/exports/{typings → types}/sync-controller.d.ts +0 -0
- /package/exports/{typings → types}/transaction.d.ts +0 -0
- /package/exports/{typings → types}/typer.d.ts +0 -0
- /package/exports/{typings → types}/types.d.ts +0 -0
|
@@ -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-504c804a.js';
|
|
2
|
+
import './index-f4429da1.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* @params {String} network
|
|
@@ -4581,216 +4581,206 @@ var index$2 = {
|
|
|
4581
4581
|
isBase64
|
|
4582
4582
|
};
|
|
4583
4583
|
|
|
4584
|
-
|
|
4585
|
-
|
|
4586
|
-
|
|
4587
|
-
|
|
4588
|
-
|
|
4589
|
-
|
|
4590
|
-
|
|
4591
|
-
|
|
4592
|
-
|
|
4593
|
-
|
|
4594
|
-
|
|
4595
|
-
|
|
4596
|
-
|
|
4597
|
-
}
|
|
4598
|
-
|
|
4599
|
-
|
|
4600
|
-
|
|
4601
|
-
|
|
4602
|
-
|
|
4603
|
-
|
|
4604
|
-
/**
|
|
4605
|
-
* Returns a
|
|
4606
|
-
* @param
|
|
4607
|
-
* @returns
|
|
4608
|
-
*/
|
|
4609
|
-
const
|
|
4610
|
-
/**
|
|
4611
|
-
* Returns a
|
|
4612
|
-
* @param
|
|
4613
|
-
* @returns
|
|
4614
|
-
*/
|
|
4615
|
-
const
|
|
4616
|
-
/**
|
|
4617
|
-
* Returns a
|
|
4618
|
-
* @param
|
|
4619
|
-
* @returns
|
|
4620
|
-
*/
|
|
4621
|
-
const
|
|
4622
|
-
/**
|
|
4623
|
-
*
|
|
4624
|
-
* @param
|
|
4625
|
-
* @returns
|
|
4626
|
-
*/
|
|
4627
|
-
const
|
|
4628
|
-
/**
|
|
4629
|
-
*
|
|
4630
|
-
* @param
|
|
4631
|
-
* @returns
|
|
4632
|
-
*/
|
|
4633
|
-
const
|
|
4634
|
-
/**
|
|
4635
|
-
*
|
|
4636
|
-
* @param
|
|
4637
|
-
* @returns
|
|
4638
|
-
*/
|
|
4639
|
-
const
|
|
4640
|
-
/**
|
|
4641
|
-
*
|
|
4642
|
-
* @param
|
|
4643
|
-
* @returns Uint8Array
|
|
4644
|
-
*/
|
|
4645
|
-
const
|
|
4646
|
-
|
|
4647
|
-
|
|
4648
|
-
|
|
4649
|
-
|
|
4650
|
-
|
|
4651
|
-
const
|
|
4652
|
-
|
|
4653
|
-
|
|
4654
|
-
|
|
4655
|
-
|
|
4656
|
-
|
|
4657
|
-
|
|
4658
|
-
|
|
4659
|
-
|
|
4660
|
-
|
|
4661
|
-
|
|
4662
|
-
|
|
4663
|
-
|
|
4664
|
-
|
|
4665
|
-
|
|
4666
|
-
|
|
4667
|
-
|
|
4668
|
-
|
|
4669
|
-
|
|
4670
|
-
|
|
4671
|
-
|
|
4672
|
-
|
|
4673
|
-
|
|
4674
|
-
|
|
4675
|
-
|
|
4676
|
-
|
|
4677
|
-
|
|
4678
|
-
|
|
4679
|
-
|
|
4680
|
-
|
|
4681
|
-
|
|
4682
|
-
|
|
4683
|
-
|
|
4684
|
-
|
|
4685
|
-
|
|
4686
|
-
|
|
4687
|
-
|
|
4688
|
-
|
|
4689
|
-
|
|
4690
|
-
|
|
4691
|
-
|
|
4692
|
-
|
|
4693
|
-
|
|
4694
|
-
|
|
4695
|
-
|
|
4696
|
-
|
|
4697
|
-
|
|
4698
|
-
|
|
4699
|
-
|
|
4700
|
-
|
|
4701
|
-
|
|
4702
|
-
|
|
4703
|
-
|
|
4704
|
-
|
|
4705
|
-
|
|
4706
|
-
|
|
4707
|
-
|
|
4708
|
-
|
|
4709
|
-
|
|
4710
|
-
|
|
4711
|
-
|
|
4712
|
-
|
|
4713
|
-
|
|
4714
|
-
|
|
4715
|
-
*
|
|
4716
|
-
* @
|
|
4717
|
-
|
|
4718
|
-
|
|
4719
|
-
|
|
4720
|
-
|
|
4721
|
-
|
|
4722
|
-
* uint8Array
|
|
4723
|
-
* @
|
|
4724
|
-
|
|
4725
|
-
|
|
4726
|
-
|
|
4727
|
-
|
|
4728
|
-
|
|
4729
|
-
|
|
4730
|
-
|
|
4731
|
-
|
|
4732
|
-
|
|
4733
|
-
|
|
4734
|
-
|
|
4735
|
-
|
|
4736
|
-
|
|
4737
|
-
|
|
4738
|
-
|
|
4739
|
-
*
|
|
4740
|
-
* @
|
|
4741
|
-
|
|
4742
|
-
|
|
4743
|
-
|
|
4744
|
-
|
|
4745
|
-
|
|
4746
|
-
|
|
4747
|
-
|
|
4748
|
-
|
|
4749
|
-
|
|
4750
|
-
|
|
4751
|
-
|
|
4752
|
-
|
|
4753
|
-
|
|
4754
|
-
|
|
4755
|
-
|
|
4756
|
-
|
|
4757
|
-
|
|
4758
|
-
|
|
4759
|
-
|
|
4760
|
-
|
|
4761
|
-
|
|
4762
|
-
|
|
4763
|
-
|
|
4764
|
-
|
|
4765
|
-
|
|
4766
|
-
|
|
4767
|
-
|
|
4768
|
-
|
|
4769
|
-
|
|
4770
|
-
|
|
4771
|
-
|
|
4772
|
-
|
|
4773
|
-
|
|
4774
|
-
|
|
4775
|
-
|
|
4776
|
-
|
|
4777
|
-
|
|
4778
|
-
|
|
4779
|
-
|
|
4780
|
-
|
|
4781
|
-
|
|
4782
|
-
|
|
4783
|
-
|
|
4784
|
-
toUintArrayString,
|
|
4785
|
-
toBase64,
|
|
4786
|
-
fromBase64,
|
|
4787
|
-
toBase58,
|
|
4788
|
-
fromBase58,
|
|
4789
|
-
toBase32,
|
|
4790
|
-
fromBase32,
|
|
4791
|
-
toBase16,
|
|
4792
|
-
fromBase16,
|
|
4793
|
-
FormatInterface: FormatInterface$2
|
|
4584
|
+
/**
|
|
4585
|
+
* Returns a hex string as Binary string
|
|
4586
|
+
* @param string string to encode to binary
|
|
4587
|
+
* @returns binaryString
|
|
4588
|
+
*/
|
|
4589
|
+
const hexToBinary = (hex) => (parseInt(hex, 16).toString(2)).padStart(8, '0');
|
|
4590
|
+
const isTypedArrayCompatible = (possibleUint8Array) => {
|
|
4591
|
+
if (typeof possibleUint8Array === 'string') {
|
|
4592
|
+
possibleUint8Array = possibleUint8Array.split(',').map(number => Number(number));
|
|
4593
|
+
for (const number of possibleUint8Array) {
|
|
4594
|
+
if (isNaN(number))
|
|
4595
|
+
return false;
|
|
4596
|
+
}
|
|
4597
|
+
}
|
|
4598
|
+
for (const number of possibleUint8Array) {
|
|
4599
|
+
if (isNaN(number))
|
|
4600
|
+
return false;
|
|
4601
|
+
}
|
|
4602
|
+
return true;
|
|
4603
|
+
};
|
|
4604
|
+
/**
|
|
4605
|
+
* Returns a String as Uint8Array
|
|
4606
|
+
* @param string string to encode to Uint8Array
|
|
4607
|
+
* @returns Uint8Array
|
|
4608
|
+
*/
|
|
4609
|
+
const fromString$1 = (string) => new TextEncoder().encode(string);
|
|
4610
|
+
/**
|
|
4611
|
+
* Returns a Uint8Array as String
|
|
4612
|
+
* @param uint8Array Uint8Array to encode to String
|
|
4613
|
+
* @returns String
|
|
4614
|
+
*/
|
|
4615
|
+
const toString$1 = (uint8Array) => new TextDecoder().decode(uint8Array);
|
|
4616
|
+
/**
|
|
4617
|
+
* Returns a String as Uint8Array
|
|
4618
|
+
* @param string string to encode to Uint8Array
|
|
4619
|
+
* @returns Uint8Array
|
|
4620
|
+
*/
|
|
4621
|
+
const fromUintArrayString = (string) => Uint8Array.from(string.split(',').map(string => Number(string)));
|
|
4622
|
+
/**
|
|
4623
|
+
* Returns a Uint8Array as String
|
|
4624
|
+
* @param uint8Array Uint8Array to encode to String
|
|
4625
|
+
* @returns String
|
|
4626
|
+
*/
|
|
4627
|
+
const toUintArrayString = (uint8Array) => uint8Array.toString();
|
|
4628
|
+
/**
|
|
4629
|
+
* hexString -> uint8Array
|
|
4630
|
+
* @param string hex encoded string
|
|
4631
|
+
* @returns UintArray
|
|
4632
|
+
*/
|
|
4633
|
+
const fromHex = (string) => Uint8Array.from(string.match(/.{1,2}/g).map((byte) => parseInt(byte, 16)));
|
|
4634
|
+
/**
|
|
4635
|
+
* uint8Array -> hexString
|
|
4636
|
+
* @param bytes number[]
|
|
4637
|
+
* @returns hexString
|
|
4638
|
+
*/
|
|
4639
|
+
const toHex = (bytes) => bytes.reduce((string, byte) => string + byte.toString(16).padStart(2, '0'), '');
|
|
4640
|
+
/**
|
|
4641
|
+
* number[] -> Uint8Array
|
|
4642
|
+
* @param array number[]
|
|
4643
|
+
* @returns Uint8Array
|
|
4644
|
+
*/
|
|
4645
|
+
const fromArrayLike = (array) => Uint8Array.from(array);
|
|
4646
|
+
/**
|
|
4647
|
+
* Uint8Array -> number[]
|
|
4648
|
+
* @param uint8Array Uint8Array
|
|
4649
|
+
* @returns Uint8Array
|
|
4650
|
+
*/
|
|
4651
|
+
const toArrayLike = (uint8Array) => [...uint8Array.values()];
|
|
4652
|
+
/**
|
|
4653
|
+
* object -> Uint8Array
|
|
4654
|
+
* @param object any
|
|
4655
|
+
* @returns Uint8Array
|
|
4656
|
+
*/
|
|
4657
|
+
const fromObject = (object) => new TextEncoder().encode(JSON.stringify(object));
|
|
4658
|
+
/**
|
|
4659
|
+
* Uint8Array -> Object
|
|
4660
|
+
* @param uint8Array Uint8Array
|
|
4661
|
+
* @returns Object
|
|
4662
|
+
*/
|
|
4663
|
+
const toObject = (uint8Array) => JSON.parse(new TextDecoder().decode(uint8Array));
|
|
4664
|
+
const fromBinary = (string) => fromHex(parseInt(string, 2).toString(16).toUpperCase());
|
|
4665
|
+
const toBinary = (uint8Array) => hexToBinary(toHex(uint8Array));
|
|
4666
|
+
const toBase64 = (uint8Array) => index$2.encode(uint8Array);
|
|
4667
|
+
const fromBase64 = (string) => index$2.decode(string);
|
|
4668
|
+
const toBase58 = (uint8Array) => base58$1.encode(uint8Array);
|
|
4669
|
+
const fromBase58 = (string) => base58$1.decode(string);
|
|
4670
|
+
const toBase32 = (uint8Array) => index$7.encode(uint8Array);
|
|
4671
|
+
const fromBase32 = (string) => index$7.decode(string);
|
|
4672
|
+
const toBase16 = (uint8Array) => index$3.encode(uint8Array);
|
|
4673
|
+
const fromBase16 = (string) => index$3.decode(string);
|
|
4674
|
+
let FormatInterface$2 = class FormatInterface {
|
|
4675
|
+
encoded;
|
|
4676
|
+
decoded;
|
|
4677
|
+
constructor(input) {
|
|
4678
|
+
if (input) {
|
|
4679
|
+
if (index$3.isBase16(input))
|
|
4680
|
+
this.encoded = this.fromBase16(input);
|
|
4681
|
+
else if (index$7.isBase32(input))
|
|
4682
|
+
this.encoded = this.fromBase32(input);
|
|
4683
|
+
else if (base58$1.isBase58(input))
|
|
4684
|
+
this.encoded = this.fromBase58(input);
|
|
4685
|
+
else if (index$2.isBase64(input))
|
|
4686
|
+
this.encoded = this.fromBase64(input);
|
|
4687
|
+
else if (typeof input === 'string') {
|
|
4688
|
+
let isCompatible = isTypedArrayCompatible(input);
|
|
4689
|
+
if (isCompatible)
|
|
4690
|
+
this.encoded = fromUintArrayString(input);
|
|
4691
|
+
else
|
|
4692
|
+
this.encoded = this.fromString(input); // normal string
|
|
4693
|
+
}
|
|
4694
|
+
else if (typeof input === 'object')
|
|
4695
|
+
this.encoded = this.fromObject(input);
|
|
4696
|
+
else if (input instanceof Uint8Array)
|
|
4697
|
+
this.encoded = input;
|
|
4698
|
+
else if (Array.isArray(input) && isTypedArrayCompatible(input))
|
|
4699
|
+
this.encoded = this.fromArrayLike(input);
|
|
4700
|
+
}
|
|
4701
|
+
}
|
|
4702
|
+
/**
|
|
4703
|
+
* Returns a String as Uint8Array
|
|
4704
|
+
* @param string string to encode to Uint8Array
|
|
4705
|
+
* @returns Uint8Array
|
|
4706
|
+
*/
|
|
4707
|
+
fromString = (string) => this.encoded = fromString$1(string);
|
|
4708
|
+
/**
|
|
4709
|
+
* Returns a Uint8Array as String
|
|
4710
|
+
* @param uint8Array Uint8Array to encode to String
|
|
4711
|
+
* @returns String
|
|
4712
|
+
*/
|
|
4713
|
+
toString = (uint8Array) => this.decoded = toString$1(uint8Array);
|
|
4714
|
+
/**
|
|
4715
|
+
* Returns a String as Uint8Array
|
|
4716
|
+
* @param string string to encode to Uint8Array
|
|
4717
|
+
* @returns Uint8Array
|
|
4718
|
+
*/
|
|
4719
|
+
fromUintArrayString = (string) => this.encoded = fromUintArrayString(string);
|
|
4720
|
+
/**
|
|
4721
|
+
* Returns a Uint8Array as String
|
|
4722
|
+
* @param uint8Array Uint8Array to encode to String
|
|
4723
|
+
* @returns String
|
|
4724
|
+
*/
|
|
4725
|
+
toUintArrayString = (uint8Array) => this.decoded = uint8Array.toString();
|
|
4726
|
+
/**
|
|
4727
|
+
* hexString -> uint8Array
|
|
4728
|
+
* @param string hex encoded string
|
|
4729
|
+
* @returns UintArray
|
|
4730
|
+
*/
|
|
4731
|
+
fromHex = (string) => this.encoded = fromHex(string);
|
|
4732
|
+
/**
|
|
4733
|
+
* uint8Array -> hexString
|
|
4734
|
+
* @param bytes ArrayLike
|
|
4735
|
+
* @returns hexString
|
|
4736
|
+
*/
|
|
4737
|
+
toHex = (arrayLike) => this.decoded = toHex(arrayLike);
|
|
4738
|
+
/**
|
|
4739
|
+
* number[] -> Uint8Array
|
|
4740
|
+
* @param array number[]
|
|
4741
|
+
* @returns Uint8Array
|
|
4742
|
+
*/
|
|
4743
|
+
fromArrayLike = (array) => this.encoded = Uint8Array.from(array);
|
|
4744
|
+
/**
|
|
4745
|
+
* Uint8Array -> number[]
|
|
4746
|
+
* @param uint8Array Uint8Array
|
|
4747
|
+
* @returns Uint8Array
|
|
4748
|
+
*/
|
|
4749
|
+
toArrayLike = (uint8Array) => this.decoded = [...uint8Array.values()];
|
|
4750
|
+
fromObject = (object) => this.encoded = fromObject(object);
|
|
4751
|
+
toBinary = (uint8Array) => this.decoded = hexToBinary(toHex(uint8Array));
|
|
4752
|
+
fromBinary = (binary) => this.encoded = fromBinary(binary);
|
|
4753
|
+
toObject = (uint8Array) => this.decoded = toObject(uint8Array);
|
|
4754
|
+
toBase64 = (uint8Array) => this.decoded = index$2.encode(uint8Array);
|
|
4755
|
+
fromBase64 = (string) => this.encoded = index$2.decode(string);
|
|
4756
|
+
toBase58 = (uint8Array) => this.decoded = base58$1.encode(uint8Array);
|
|
4757
|
+
fromBase58 = (string) => this.encoded = base58$1.decode(string);
|
|
4758
|
+
toBase32 = (uint8Array) => this.decoded = index$7.encode(uint8Array);
|
|
4759
|
+
fromBase32 = (string) => this.encoded = index$7.decode(string);
|
|
4760
|
+
toBase16 = (uint8Array) => this.decoded = index$3.encode(uint8Array);
|
|
4761
|
+
fromBase16 = (string) => this.decoded = index$3.decode(string);
|
|
4762
|
+
};
|
|
4763
|
+
var index$1 = {
|
|
4764
|
+
fromString: fromString$1,
|
|
4765
|
+
toString: toString$1,
|
|
4766
|
+
fromHex,
|
|
4767
|
+
toHex,
|
|
4768
|
+
fromArrayLike,
|
|
4769
|
+
toArrayLike,
|
|
4770
|
+
fromUintArrayString,
|
|
4771
|
+
toUintArrayString,
|
|
4772
|
+
toObject,
|
|
4773
|
+
toBinary,
|
|
4774
|
+
fromBinary,
|
|
4775
|
+
toBase64,
|
|
4776
|
+
fromBase64,
|
|
4777
|
+
toBase58,
|
|
4778
|
+
fromBase58,
|
|
4779
|
+
toBase32,
|
|
4780
|
+
fromBase32,
|
|
4781
|
+
toBase16,
|
|
4782
|
+
fromBase16,
|
|
4783
|
+
FormatInterface: FormatInterface$2
|
|
4794
4784
|
};
|
|
4795
4785
|
|
|
4796
4786
|
const { fromString, toString } = index$1;
|