@hiero-ledger/sdk 2.83.0-beta.1 → 2.83.0-beta.2
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/dist/umd.js +126 -46
- package/dist/umd.js.map +1 -1
- package/dist/umd.min.js +1 -1
- package/dist/umd.min.js.map +1 -1
- package/lib/EthereumTransactionDataEip1559.cjs +25 -8
- package/lib/EthereumTransactionDataEip1559.d.ts +20 -4
- package/lib/EthereumTransactionDataEip1559.js +1 -1
- package/lib/EthereumTransactionDataEip1559.js.map +1 -1
- package/lib/EthereumTransactionDataEip2930.cjs +25 -8
- package/lib/EthereumTransactionDataEip2930.d.ts +20 -4
- package/lib/EthereumTransactionDataEip2930.js +1 -1
- package/lib/EthereumTransactionDataEip2930.js.map +1 -1
- package/lib/EthereumTransactionDataEip7702.cjs +38 -26
- package/lib/EthereumTransactionDataEip7702.d.ts +29 -6
- package/lib/EthereumTransactionDataEip7702.js +1 -1
- package/lib/EthereumTransactionDataEip7702.js.map +1 -1
- package/lib/EthereumTransactionDataLegacy.cjs +2 -3
- package/lib/EthereumTransactionDataLegacy.js.map +1 -1
- package/lib/file/FileAppendTransaction.cjs +7 -0
- package/lib/file/FileAppendTransaction.d.ts +7 -0
- package/lib/file/FileAppendTransaction.js.map +1 -1
- package/lib/version.js +1 -1
- package/package.json +1 -1
- package/src/EthereumTransactionDataEip1559.js +33 -8
- package/src/EthereumTransactionDataEip2930.js +33 -8
- package/src/EthereumTransactionDataEip7702.js +49 -27
- package/src/EthereumTransactionDataLegacy.js +3 -2
- package/src/file/FileAppendTransaction.js +7 -0
package/dist/umd.js
CHANGED
|
@@ -69642,6 +69642,13 @@
|
|
|
69642
69642
|
this._maxChunks = 20;
|
|
69643
69643
|
|
|
69644
69644
|
/**
|
|
69645
|
+
* The default chunk size in bytes for file append operations.
|
|
69646
|
+
*
|
|
69647
|
+
* The network limits total transaction size (SignedTransaction) to 6144 bytes.
|
|
69648
|
+
* Each Ed25519 signature adds ~102 bytes of overhead (pubKeyPrefix + signature + wrapping).
|
|
69649
|
+
* With 4096-byte chunks, transactions fit within the limit for up to ~19 signatures.
|
|
69650
|
+
* For files requiring more signers, callers should use setChunkSize() with a smaller value.
|
|
69651
|
+
*
|
|
69645
69652
|
* @private
|
|
69646
69653
|
* @type {number}
|
|
69647
69654
|
*/
|
|
@@ -74352,8 +74359,9 @@
|
|
|
74352
74359
|
throw new Error("empty bytes");
|
|
74353
74360
|
}
|
|
74354
74361
|
|
|
74355
|
-
|
|
74356
|
-
|
|
74362
|
+
const decoded = /** @type {unknown[]} */ (
|
|
74363
|
+
/** @type {unknown} */ (decodeRlp(bytes))
|
|
74364
|
+
);
|
|
74357
74365
|
|
|
74358
74366
|
if (decoded.length != 9) {
|
|
74359
74367
|
throw new Error("invalid ethereum transaction data");
|
|
@@ -74420,6 +74428,16 @@
|
|
|
74420
74428
|
EthereumTransactionDataLegacy.fromBytes(bytes),
|
|
74421
74429
|
);
|
|
74422
74430
|
|
|
74431
|
+
/**
|
|
74432
|
+
* @typedef {[Uint8Array, Uint8Array[]]} AccessListItem - [address, storageKeys[]]
|
|
74433
|
+
*/
|
|
74434
|
+
|
|
74435
|
+
/**
|
|
74436
|
+
* @typedef {object} AccessListItemJSON
|
|
74437
|
+
* @property {string} address
|
|
74438
|
+
* @property {string[]} storageKeys
|
|
74439
|
+
*/
|
|
74440
|
+
|
|
74423
74441
|
/**
|
|
74424
74442
|
* @typedef {object} EthereumTransactionDataEip1559JSON
|
|
74425
74443
|
* @property {string} chainId
|
|
@@ -74430,7 +74448,7 @@
|
|
|
74430
74448
|
* @property {string} to
|
|
74431
74449
|
* @property {string} value
|
|
74432
74450
|
* @property {string} callData
|
|
74433
|
-
* @property {
|
|
74451
|
+
* @property {AccessListItemJSON[]} accessList
|
|
74434
74452
|
* @property {string} recId
|
|
74435
74453
|
* @property {string} r
|
|
74436
74454
|
* @property {string} s
|
|
@@ -74448,7 +74466,7 @@
|
|
|
74448
74466
|
* @param {Uint8Array} props.to
|
|
74449
74467
|
* @param {Uint8Array} props.value
|
|
74450
74468
|
* @param {Uint8Array} props.callData
|
|
74451
|
-
* @param {
|
|
74469
|
+
* @param {AccessListItem[]} props.accessList
|
|
74452
74470
|
* @param {Uint8Array} props.recId
|
|
74453
74471
|
* @param {Uint8Array} props.r
|
|
74454
74472
|
* @param {Uint8Array} props.s
|
|
@@ -74478,8 +74496,9 @@
|
|
|
74478
74496
|
throw new Error("empty bytes");
|
|
74479
74497
|
}
|
|
74480
74498
|
|
|
74481
|
-
|
|
74482
|
-
|
|
74499
|
+
const decoded = /** @type {unknown[]} */ (
|
|
74500
|
+
/** @type {unknown} */ (decodeRlp(bytes.subarray(1)))
|
|
74501
|
+
);
|
|
74483
74502
|
|
|
74484
74503
|
if (!Array.isArray(decoded)) {
|
|
74485
74504
|
throw new Error("ethereum data is not a list");
|
|
@@ -74499,9 +74518,20 @@
|
|
|
74499
74518
|
to: decode$7(/** @type {string} */ (decoded[5])),
|
|
74500
74519
|
value: decode$7(/** @type {string} */ (decoded[6])),
|
|
74501
74520
|
callData: decode$7(/** @type {string} */ (decoded[7])),
|
|
74502
|
-
|
|
74503
|
-
|
|
74504
|
-
|
|
74521
|
+
accessList: /** @type {AccessListItem[]} */ (
|
|
74522
|
+
/** @type {Array<[string, string[]]>} */ (
|
|
74523
|
+
/** @type {unknown} */ (decoded[8])
|
|
74524
|
+
).map((item) => {
|
|
74525
|
+
if (!Array.isArray(item) || item.length !== 2) {
|
|
74526
|
+
throw new Error(
|
|
74527
|
+
"invalid access list entry: must be [address, storageKeys[]]",
|
|
74528
|
+
);
|
|
74529
|
+
}
|
|
74530
|
+
return [
|
|
74531
|
+
decode$7(item[0]),
|
|
74532
|
+
item[1].map((key) => decode$7(key)),
|
|
74533
|
+
];
|
|
74534
|
+
})
|
|
74505
74535
|
),
|
|
74506
74536
|
recId: decode$7(/** @type {string} */ (decoded[9])),
|
|
74507
74537
|
r: decode$7(/** @type {string} */ (decoded[10])),
|
|
@@ -74550,7 +74580,10 @@
|
|
|
74550
74580
|
to: encode$4(this.to),
|
|
74551
74581
|
value: encode$4(this.value),
|
|
74552
74582
|
callData: encode$4(this.callData),
|
|
74553
|
-
accessList: this.accessList.map((
|
|
74583
|
+
accessList: this.accessList.map(([address, storageKeys]) => ({
|
|
74584
|
+
address: encode$4(address),
|
|
74585
|
+
storageKeys: storageKeys.map((key) => encode$4(key)),
|
|
74586
|
+
})),
|
|
74554
74587
|
recId: encode$4(this.recId),
|
|
74555
74588
|
r: encode$4(this.r),
|
|
74556
74589
|
s: encode$4(this.s),
|
|
@@ -74562,6 +74595,16 @@
|
|
|
74562
74595
|
EthereumTransactionDataEip1559.fromBytes(bytes),
|
|
74563
74596
|
);
|
|
74564
74597
|
|
|
74598
|
+
/**
|
|
74599
|
+
* @typedef {[Uint8Array, Uint8Array[]]} AccessListItem - [address, storageKeys[]]
|
|
74600
|
+
*/
|
|
74601
|
+
|
|
74602
|
+
/**
|
|
74603
|
+
* @typedef {object} AccessListItemJSON
|
|
74604
|
+
* @property {string} address
|
|
74605
|
+
* @property {string[]} storageKeys
|
|
74606
|
+
*/
|
|
74607
|
+
|
|
74565
74608
|
/**
|
|
74566
74609
|
* @typedef {object} EthereumTransactionDataEip2930JSON
|
|
74567
74610
|
* @property {string} chainId
|
|
@@ -74571,7 +74614,7 @@
|
|
|
74571
74614
|
* @property {string} to
|
|
74572
74615
|
* @property {string} value
|
|
74573
74616
|
* @property {string} callData
|
|
74574
|
-
* @property {
|
|
74617
|
+
* @property {AccessListItemJSON[]} accessList
|
|
74575
74618
|
* @property {string} recId
|
|
74576
74619
|
* @property {string} r
|
|
74577
74620
|
* @property {string} s
|
|
@@ -74588,7 +74631,7 @@
|
|
|
74588
74631
|
* @param {Uint8Array} props.to
|
|
74589
74632
|
* @param {Uint8Array} props.value
|
|
74590
74633
|
* @param {Uint8Array} props.callData
|
|
74591
|
-
* @param {
|
|
74634
|
+
* @param {AccessListItem[]} props.accessList
|
|
74592
74635
|
* @param {Uint8Array} props.recId
|
|
74593
74636
|
* @param {Uint8Array} props.r
|
|
74594
74637
|
* @param {Uint8Array} props.s
|
|
@@ -74617,8 +74660,9 @@
|
|
|
74617
74660
|
throw new Error("empty bytes");
|
|
74618
74661
|
}
|
|
74619
74662
|
|
|
74620
|
-
|
|
74621
|
-
|
|
74663
|
+
const decoded = /** @type {unknown[]} */ (
|
|
74664
|
+
/** @type {unknown} */ (decodeRlp(bytes.subarray(1)))
|
|
74665
|
+
);
|
|
74622
74666
|
|
|
74623
74667
|
if (!Array.isArray(decoded)) {
|
|
74624
74668
|
throw new Error("ethereum data is not a list");
|
|
@@ -74637,9 +74681,20 @@
|
|
|
74637
74681
|
to: decode$7(/** @type {string} */ (decoded[4])),
|
|
74638
74682
|
value: decode$7(/** @type {string} */ (decoded[5])),
|
|
74639
74683
|
callData: decode$7(/** @type {string} */ (decoded[6])),
|
|
74640
|
-
|
|
74641
|
-
|
|
74642
|
-
|
|
74684
|
+
accessList: /** @type {AccessListItem[]} */ (
|
|
74685
|
+
/** @type {Array<[string, string[]]>} */ (
|
|
74686
|
+
/** @type {unknown} */ (decoded[7])
|
|
74687
|
+
).map((item) => {
|
|
74688
|
+
if (!Array.isArray(item) || item.length !== 2) {
|
|
74689
|
+
throw new Error(
|
|
74690
|
+
"invalid access list entry: must be [address, storageKeys[]]",
|
|
74691
|
+
);
|
|
74692
|
+
}
|
|
74693
|
+
return [
|
|
74694
|
+
decode$7(item[0]),
|
|
74695
|
+
item[1].map((key) => decode$7(key)),
|
|
74696
|
+
];
|
|
74697
|
+
})
|
|
74643
74698
|
),
|
|
74644
74699
|
recId: decode$7(/** @type {string} */ (decoded[8])),
|
|
74645
74700
|
r: decode$7(/** @type {string} */ (decoded[9])),
|
|
@@ -74686,7 +74741,10 @@
|
|
|
74686
74741
|
to: encode$4(this.to),
|
|
74687
74742
|
value: encode$4(this.value),
|
|
74688
74743
|
callData: encode$4(this.callData),
|
|
74689
|
-
accessList: this.accessList.map((
|
|
74744
|
+
accessList: this.accessList.map(([address, storageKeys]) => ({
|
|
74745
|
+
address: encode$4(address),
|
|
74746
|
+
storageKeys: storageKeys.map((key) => encode$4(key)),
|
|
74747
|
+
})),
|
|
74690
74748
|
recId: encode$4(this.recId),
|
|
74691
74749
|
r: encode$4(this.r),
|
|
74692
74750
|
s: encode$4(this.s),
|
|
@@ -74698,6 +74756,20 @@
|
|
|
74698
74756
|
EthereumTransactionDataEip2930.fromBytes(bytes),
|
|
74699
74757
|
);
|
|
74700
74758
|
|
|
74759
|
+
/**
|
|
74760
|
+
* @typedef {[Uint8Array, Uint8Array[]]} AccessListItem - [address, storageKeys[]]
|
|
74761
|
+
*/
|
|
74762
|
+
|
|
74763
|
+
/**
|
|
74764
|
+
* @typedef {[Uint8Array, Uint8Array, Uint8Array, Uint8Array, Uint8Array, Uint8Array]} AuthorizationItem - [chainId, contractAddress, nonce, yParity, r, s]
|
|
74765
|
+
*/
|
|
74766
|
+
|
|
74767
|
+
/**
|
|
74768
|
+
* @typedef {object} AccessListItemJSON
|
|
74769
|
+
* @property {string} address
|
|
74770
|
+
* @property {string[]} storageKeys
|
|
74771
|
+
*/
|
|
74772
|
+
|
|
74701
74773
|
/**
|
|
74702
74774
|
* @typedef {object} EthereumTransactionDataEip7702JSON
|
|
74703
74775
|
* @property {string} chainId
|
|
@@ -74709,7 +74781,7 @@
|
|
|
74709
74781
|
* @property {string} value
|
|
74710
74782
|
* @property {string} callData
|
|
74711
74783
|
* @property {Array<[string, string, string, string, string, string]>} authorizationList - Array of [chainId, contractAddress, nonce, yParity, r, s] tuples
|
|
74712
|
-
* @property {
|
|
74784
|
+
* @property {AccessListItemJSON[]} accessList
|
|
74713
74785
|
* @property {string} recId
|
|
74714
74786
|
* @property {string} r
|
|
74715
74787
|
* @property {string} s
|
|
@@ -74727,8 +74799,8 @@
|
|
|
74727
74799
|
* @param {Uint8Array} props.to
|
|
74728
74800
|
* @param {Uint8Array} props.value
|
|
74729
74801
|
* @param {Uint8Array} props.callData
|
|
74730
|
-
* @param {
|
|
74731
|
-
* @param {
|
|
74802
|
+
* @param {AuthorizationItem[]} props.authorizationList - Array of [chainId, contractAddress, nonce, yParity, r, s] tuples
|
|
74803
|
+
* @param {AccessListItem[]} props.accessList
|
|
74732
74804
|
* @param {Uint8Array} props.recId
|
|
74733
74805
|
* @param {Uint8Array} props.r
|
|
74734
74806
|
* @param {Uint8Array} props.s
|
|
@@ -74760,8 +74832,9 @@
|
|
|
74760
74832
|
throw new Error("empty bytes");
|
|
74761
74833
|
}
|
|
74762
74834
|
|
|
74763
|
-
|
|
74764
|
-
|
|
74835
|
+
const decoded = /** @type {unknown[]} */ (
|
|
74836
|
+
/** @type {unknown} */ (decodeRlp(bytes.subarray(1)))
|
|
74837
|
+
);
|
|
74765
74838
|
|
|
74766
74839
|
if (!Array.isArray(decoded)) {
|
|
74767
74840
|
throw new Error("ethereum data is not a list");
|
|
@@ -74776,30 +74849,24 @@
|
|
|
74776
74849
|
if (!Array.isArray(decoded[9])) {
|
|
74777
74850
|
throw new Error("authorization list must be an array");
|
|
74778
74851
|
}
|
|
74779
|
-
|
|
74780
|
-
|
|
74781
|
-
|
|
74782
|
-
(authTuple) => {
|
|
74852
|
+
const authorizationList = /** @type {AuthorizationItem[]} */ (
|
|
74853
|
+
/** @type {Array<[string, string, string, string, string, string]>} */ (
|
|
74854
|
+
/** @type {unknown} */ (decoded[9])
|
|
74855
|
+
).map((authTuple) => {
|
|
74783
74856
|
if (!Array.isArray(authTuple) || authTuple.length !== 6) {
|
|
74784
74857
|
throw new Error(
|
|
74785
74858
|
"invalid authorization list entry: must be [chainId, contractAddress, nonce, yParity, r, s]",
|
|
74786
74859
|
);
|
|
74787
74860
|
}
|
|
74788
74861
|
return [
|
|
74789
|
-
//
|
|
74790
|
-
decode$7(
|
|
74791
|
-
//
|
|
74792
|
-
decode$7(
|
|
74793
|
-
//
|
|
74794
|
-
decode$7(
|
|
74795
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
74796
|
-
decode$7(/** @type {string} */ (authTuple[3])), // yParity (0 or 1)
|
|
74797
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
74798
|
-
decode$7(/** @type {string} */ (authTuple[4])), // r (32 bytes)
|
|
74799
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
74800
|
-
decode$7(/** @type {string} */ (authTuple[5])), // s (32 bytes)
|
|
74862
|
+
decode$7(authTuple[0]), // chainId
|
|
74863
|
+
decode$7(authTuple[1]), // contractAddress (20 bytes)
|
|
74864
|
+
decode$7(authTuple[2]), // nonce
|
|
74865
|
+
decode$7(authTuple[3]), // yParity (0 or 1)
|
|
74866
|
+
decode$7(authTuple[4]), // r (32 bytes)
|
|
74867
|
+
decode$7(authTuple[5]), // s (32 bytes)
|
|
74801
74868
|
];
|
|
74802
|
-
}
|
|
74869
|
+
})
|
|
74803
74870
|
);
|
|
74804
74871
|
|
|
74805
74872
|
return new EthereumTransactionDataEip7702({
|
|
@@ -74811,11 +74878,21 @@
|
|
|
74811
74878
|
to: decode$7(/** @type {string} */ (decoded[5])),
|
|
74812
74879
|
value: decode$7(/** @type {string} */ (decoded[6])),
|
|
74813
74880
|
callData: decode$7(/** @type {string} */ (decoded[7])),
|
|
74814
|
-
|
|
74815
|
-
|
|
74816
|
-
|
|
74881
|
+
accessList: /** @type {AccessListItem[]} */ (
|
|
74882
|
+
/** @type {Array<[string, string[]]>} */ (
|
|
74883
|
+
/** @type {unknown} */ (decoded[8])
|
|
74884
|
+
).map((item) => {
|
|
74885
|
+
if (!Array.isArray(item) || item.length !== 2) {
|
|
74886
|
+
throw new Error(
|
|
74887
|
+
"invalid access list entry: must be [address, storageKeys[]]",
|
|
74888
|
+
);
|
|
74889
|
+
}
|
|
74890
|
+
return [
|
|
74891
|
+
decode$7(item[0]),
|
|
74892
|
+
item[1].map((key) => decode$7(key)),
|
|
74893
|
+
];
|
|
74894
|
+
})
|
|
74817
74895
|
),
|
|
74818
|
-
// @ts-ignore
|
|
74819
74896
|
authorizationList: authorizationList,
|
|
74820
74897
|
recId: decode$7(/** @type {string} */ (decoded[10])),
|
|
74821
74898
|
r: decode$7(/** @type {string} */ (decoded[11])),
|
|
@@ -74875,7 +74952,10 @@
|
|
|
74875
74952
|
encode$4(s),
|
|
74876
74953
|
],
|
|
74877
74954
|
),
|
|
74878
|
-
accessList: this.accessList.map((
|
|
74955
|
+
accessList: this.accessList.map(([address, storageKeys]) => ({
|
|
74956
|
+
address: encode$4(address),
|
|
74957
|
+
storageKeys: storageKeys.map((key) => encode$4(key)),
|
|
74958
|
+
})),
|
|
74879
74959
|
recId: encode$4(this.recId),
|
|
74880
74960
|
r: encode$4(this.r),
|
|
74881
74961
|
s: encode$4(this.s),
|
|
@@ -98606,7 +98686,7 @@
|
|
|
98606
98686
|
|
|
98607
98687
|
const SDK_NAME = "hiero-sdk-js";
|
|
98608
98688
|
const SDK_VERSION =
|
|
98609
|
-
"2.83.0-beta.
|
|
98689
|
+
"2.83.0-beta.2" ;
|
|
98610
98690
|
|
|
98611
98691
|
// SPDX-License-Identifier: Apache-2.0
|
|
98612
98692
|
|