viem 0.2.0-jxom-local-accounts.20230321T212822 → 0.2.0-jxom-local-accounts.20230327T004031
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/abi.d.ts +3 -3
- package/dist/abi.js +2 -2
- package/dist/abi.mjs +1 -1
- package/dist/accounts/index.d.ts +62 -5
- package/dist/accounts/index.js +79 -16
- package/dist/accounts/index.js.map +1 -1
- package/dist/accounts/index.mjs +74 -11
- package/dist/accounts/index.mjs.map +1 -1
- package/dist/{chain-f8db473f.d.ts → chain-40443542.d.ts} +1 -1
- package/dist/{chain-75b0942e.d.ts → chain-4af995bf.d.ts} +63 -27
- package/dist/chains.d.ts +3 -3
- package/dist/chains.js +63 -63
- package/dist/chains.mjs +1 -1
- package/dist/{chunk-NJSAEA2H.js → chunk-CGTZNR2R.js} +507 -3
- package/dist/chunk-CGTZNR2R.js.map +1 -0
- package/dist/{chunk-IVRML3IK.mjs → chunk-HWVZ6VEQ.mjs} +506 -2
- package/dist/chunk-HWVZ6VEQ.mjs.map +1 -0
- package/dist/{chunk-FNVFGFWN.mjs → chunk-PVK5TA2L.mjs} +2 -2
- package/dist/chunk-PVK5TA2L.mjs.map +1 -0
- package/dist/{chunk-6UKHPIXX.mjs → chunk-UCNDS4FE.mjs} +2 -2
- package/dist/chunk-UCNDS4FE.mjs.map +1 -0
- package/dist/{chunk-LYQKHD7R.js → chunk-VSAG2LPH.js} +19 -19
- package/dist/chunk-VSAG2LPH.js.map +1 -0
- package/dist/{chunk-FQM5MF6U.js → chunk-XLIQDCZW.js} +6 -6
- package/dist/chunk-XLIQDCZW.js.map +1 -0
- package/dist/contract.d.ts +8 -8
- package/dist/contract.js +2 -2
- package/dist/contract.mjs +1 -1
- package/dist/{createClient-f87255c1.d.ts → createClient-1f19be8d.d.ts} +23 -9
- package/dist/{createPublicClient-d2c37c92.d.ts → createPublicClient-b53e3c3d.d.ts} +116 -116
- package/dist/{eip1193-ae706fd8.d.ts → eip1193-210ab776.d.ts} +1 -1
- package/dist/{encodeFunctionResult-4792a6a3.d.ts → encodeFunctionResult-a252fba1.d.ts} +1 -1
- package/dist/{encodePacked-3fcdd54b.d.ts → encodePacked-a9464e97.d.ts} +1 -1
- package/dist/ens.d.ts +5 -5
- package/dist/ens.js +3 -3
- package/dist/ens.mjs +2 -2
- package/dist/ethers.d.ts +3 -3
- package/dist/ethers.js +4 -4
- package/dist/ethers.mjs +2 -2
- package/dist/{formatAbiItem-765ebc53.d.ts → formatAbiItem-6ed70dbd.d.ts} +1 -1
- package/dist/{getAbiItem-693e6e1b.d.ts → getAbiItem-1ff0f41a.d.ts} +1 -1
- package/dist/index.d.ts +21 -15
- package/dist/index.js +127 -102
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +67 -42
- package/dist/index.mjs.map +1 -1
- package/dist/{parseAccount-2d7ea01d.d.ts → parseAccount-8e131c73.d.ts} +1 -1
- package/dist/{parseGwei-377678bc.d.ts → parseGwei-b3a175f7.d.ts} +51 -7
- package/dist/public.d.ts +5 -5
- package/dist/public.js +2 -2
- package/dist/public.mjs +1 -1
- package/dist/test-e28db435.d.ts +198 -0
- package/dist/test.d.ts +11 -11
- package/dist/test.js +2 -2
- package/dist/test.mjs +1 -1
- package/dist/{typedData-ade018d6.d.ts → typedData-848139b1.d.ts} +11 -11
- package/dist/utils/index.d.ts +16 -36
- package/dist/utils/index.js +18 -2
- package/dist/utils/index.mjs +17 -1
- package/dist/wallet.d.ts +5 -5
- package/dist/wallet.js +2 -2
- package/dist/wallet.mjs +1 -1
- package/dist/window.d.ts +2 -2
- package/package.json +1 -1
- package/dist/chunk-6UKHPIXX.mjs.map +0 -1
- package/dist/chunk-FNVFGFWN.mjs.map +0 -1
- package/dist/chunk-FQM5MF6U.js.map +0 -1
- package/dist/chunk-IVRML3IK.mjs.map +0 -1
- package/dist/chunk-LYQKHD7R.js.map +0 -1
- package/dist/chunk-NJSAEA2H.js.map +0 -1
- package/dist/test-98c0b642.d.ts +0 -206
@@ -629,6 +629,12 @@ var ChainNotFoundError = class extends BaseError {
|
|
629
629
|
__publicField(this, "name", "ChainNotFoundError");
|
630
630
|
}
|
631
631
|
};
|
632
|
+
var InvalidChainIdError = class extends BaseError {
|
633
|
+
constructor({ chainId }) {
|
634
|
+
super(`Chain ID "${chainId}" is invalid.`);
|
635
|
+
__publicField(this, "name", "InvalidChainIdError");
|
636
|
+
}
|
637
|
+
};
|
632
638
|
|
633
639
|
// src/constants/abis.ts
|
634
640
|
var multicall3Abi = [
|
@@ -743,6 +749,69 @@ var FeeConflictError = class extends BaseError {
|
|
743
749
|
__publicField(this, "name", "FeeConflictError");
|
744
750
|
}
|
745
751
|
};
|
752
|
+
var InvalidLegacyVError = class extends BaseError {
|
753
|
+
constructor({ v }) {
|
754
|
+
super(`Invalid \`v\` value "${v}". Expected 27 or 28.`);
|
755
|
+
__publicField(this, "name", "InvalidLegacyVError");
|
756
|
+
}
|
757
|
+
};
|
758
|
+
var InvalidSerializableTransactionError = class extends BaseError {
|
759
|
+
constructor({ transaction }) {
|
760
|
+
super("Cannot infer a transaction type from provided transaction.", {
|
761
|
+
metaMessages: [
|
762
|
+
"Provided Transaction:",
|
763
|
+
"{",
|
764
|
+
prettyPrint(transaction),
|
765
|
+
"}",
|
766
|
+
"",
|
767
|
+
"To infer the type, either provide:",
|
768
|
+
"- a `type` to the Transaction, or",
|
769
|
+
"- an EIP-1559 Transaction with `maxFeePerGas`, or",
|
770
|
+
"- an EIP-2930 Transaction with `gasPrice` & `accessList`, or",
|
771
|
+
"- a Legacy Transaction with `gasPrice`"
|
772
|
+
]
|
773
|
+
});
|
774
|
+
__publicField(this, "name", "InvalidSerializableTransactionError");
|
775
|
+
}
|
776
|
+
};
|
777
|
+
var InvalidSerializedTransactionTypeError = class extends BaseError {
|
778
|
+
constructor({ serializedType }) {
|
779
|
+
super(`Serialized transaction type "${serializedType}" is invalid.`);
|
780
|
+
__publicField(this, "name", "InvalidSerializedTransactionType");
|
781
|
+
__publicField(this, "serializedType");
|
782
|
+
this.serializedType = serializedType;
|
783
|
+
}
|
784
|
+
};
|
785
|
+
var InvalidSerializedTransactionError = class extends BaseError {
|
786
|
+
constructor({
|
787
|
+
attributes,
|
788
|
+
serializedTransaction,
|
789
|
+
type
|
790
|
+
}) {
|
791
|
+
const missing = Object.entries(attributes).map(([key, value]) => typeof value === "undefined" ? key : void 0).filter(Boolean);
|
792
|
+
super(`Invalid serialized transaction of type "${type}" was provided.`, {
|
793
|
+
metaMessages: [
|
794
|
+
`Serialized Transaction: "${serializedTransaction}"`,
|
795
|
+
missing.length > 0 ? `Missing Attributes: ${missing.join(", ")}` : ""
|
796
|
+
].filter(Boolean)
|
797
|
+
});
|
798
|
+
__publicField(this, "name", "InvalidSerializedTransactionError");
|
799
|
+
__publicField(this, "serializedTransaction");
|
800
|
+
__publicField(this, "type");
|
801
|
+
this.serializedTransaction = serializedTransaction;
|
802
|
+
this.type = type;
|
803
|
+
}
|
804
|
+
};
|
805
|
+
var InvalidStorageKeySizeError = class extends BaseError {
|
806
|
+
constructor({ storageKey }) {
|
807
|
+
super(
|
808
|
+
`Size for storage key "${storageKey}" is invalid. Expected 32 bytes. Got ${Math.floor(
|
809
|
+
(storageKey.length - 2) / 2
|
810
|
+
)} bytes.`
|
811
|
+
);
|
812
|
+
__publicField(this, "name", "InvalidStorageKeySizeError");
|
813
|
+
}
|
814
|
+
};
|
746
815
|
var TransactionExecutionError = class extends BaseError {
|
747
816
|
constructor(cause, {
|
748
817
|
account,
|
@@ -1858,7 +1927,7 @@ function parse2(value) {
|
|
1858
1927
|
function format2(bytes, to) {
|
1859
1928
|
if (Array.isArray(bytes))
|
1860
1929
|
return bytes.map((b) => format2(b, to));
|
1861
|
-
return to === "hex" ?
|
1930
|
+
return to === "hex" ? bytesToHex(bytes) : bytes;
|
1862
1931
|
}
|
1863
1932
|
function rlpToBytes(bytes, offset = 0) {
|
1864
1933
|
if (bytes.length === 0)
|
@@ -1968,6 +2037,11 @@ var getEventSelector = (event) => hashFunction(event);
|
|
1968
2037
|
// src/utils/hash/getFunctionSelector.ts
|
1969
2038
|
var getFunctionSelector = (fn) => slice(hashFunction(fn), 0, 4);
|
1970
2039
|
|
2040
|
+
// src/utils/hash/isHash.ts
|
2041
|
+
function isHash(hash2) {
|
2042
|
+
return hash2.startsWith("0x") && size(hash2) === 32;
|
2043
|
+
}
|
2044
|
+
|
1971
2045
|
// src/utils/address/isAddress.ts
|
1972
2046
|
var addressRegex = /^0x[a-fA-F0-9]{40}$/;
|
1973
2047
|
function isAddress(address) {
|
@@ -3857,6 +3931,32 @@ function assertRequest(args) {
|
|
3857
3931
|
throw new TipAboveFeeCapError({ maxFeePerGas, maxPriorityFeePerGas });
|
3858
3932
|
}
|
3859
3933
|
|
3934
|
+
// src/utils/transaction/getSerializedTransactionType.ts
|
3935
|
+
function getSerializedTransactionType(serializedTransaction) {
|
3936
|
+
const serializedType = sliceHex(serializedTransaction, 0, 1);
|
3937
|
+
if (serializedType === "0x02")
|
3938
|
+
return "eip1559";
|
3939
|
+
if (serializedType === "0x01")
|
3940
|
+
return "eip2930";
|
3941
|
+
if (serializedType !== "0x" && hexToNumber(serializedType) >= 192)
|
3942
|
+
return "legacy";
|
3943
|
+
throw new InvalidSerializedTransactionTypeError({ serializedType });
|
3944
|
+
}
|
3945
|
+
|
3946
|
+
// src/utils/transaction/getTransactionType.ts
|
3947
|
+
function getTransactionType(transaction) {
|
3948
|
+
if (transaction.type)
|
3949
|
+
return transaction.type;
|
3950
|
+
if ("maxFeePerGas" in transaction || "maxPriorityFeePerGas" in transaction)
|
3951
|
+
return "eip1559";
|
3952
|
+
if ("gasPrice" in transaction) {
|
3953
|
+
if ("accessList" in transaction)
|
3954
|
+
return "eip2930";
|
3955
|
+
return "legacy";
|
3956
|
+
}
|
3957
|
+
throw new InvalidSerializableTransactionError({ transaction });
|
3958
|
+
}
|
3959
|
+
|
3860
3960
|
// src/actions/public/call.ts
|
3861
3961
|
async function call(client, args) {
|
3862
3962
|
const {
|
@@ -5601,6 +5701,400 @@ async function prepareRequest(client, args) {
|
|
5601
5701
|
return request;
|
5602
5702
|
}
|
5603
5703
|
|
5704
|
+
// src/utils/transaction/assertTransaction.ts
|
5705
|
+
function assertTransactionEIP1559(transaction) {
|
5706
|
+
const { chainId, maxPriorityFeePerGas, gasPrice, maxFeePerGas, to } = transaction;
|
5707
|
+
if (chainId <= 0)
|
5708
|
+
throw new InvalidChainIdError({ chainId });
|
5709
|
+
if (to && !isAddress(to))
|
5710
|
+
throw new InvalidAddressError({ address: to });
|
5711
|
+
if (gasPrice)
|
5712
|
+
throw new BaseError(
|
5713
|
+
"`gasPrice` is not a valid EIP-1559 Transaction attribute."
|
5714
|
+
);
|
5715
|
+
if (maxFeePerGas && maxFeePerGas > 2n ** 256n - 1n)
|
5716
|
+
throw new FeeCapTooHighError({ maxFeePerGas });
|
5717
|
+
if (maxPriorityFeePerGas && maxFeePerGas && maxPriorityFeePerGas > maxFeePerGas)
|
5718
|
+
throw new TipAboveFeeCapError({ maxFeePerGas, maxPriorityFeePerGas });
|
5719
|
+
}
|
5720
|
+
function assertTransactionEIP2930(transaction) {
|
5721
|
+
const { chainId, maxPriorityFeePerGas, gasPrice, maxFeePerGas, to } = transaction;
|
5722
|
+
if (chainId <= 0)
|
5723
|
+
throw new InvalidChainIdError({ chainId });
|
5724
|
+
if (to && !isAddress(to))
|
5725
|
+
throw new InvalidAddressError({ address: to });
|
5726
|
+
if (maxPriorityFeePerGas || maxFeePerGas)
|
5727
|
+
throw new BaseError(
|
5728
|
+
"`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute."
|
5729
|
+
);
|
5730
|
+
if (gasPrice && gasPrice > 2n ** 256n - 1n)
|
5731
|
+
throw new FeeCapTooHighError({ maxFeePerGas: gasPrice });
|
5732
|
+
}
|
5733
|
+
function assertTransactionLegacy(transaction) {
|
5734
|
+
const {
|
5735
|
+
chainId,
|
5736
|
+
maxPriorityFeePerGas,
|
5737
|
+
gasPrice,
|
5738
|
+
maxFeePerGas,
|
5739
|
+
to,
|
5740
|
+
accessList
|
5741
|
+
} = transaction;
|
5742
|
+
if (to && !isAddress(to))
|
5743
|
+
throw new InvalidAddressError({ address: to });
|
5744
|
+
if (typeof chainId !== "undefined" && chainId <= 0)
|
5745
|
+
throw new InvalidChainIdError({ chainId });
|
5746
|
+
if (maxPriorityFeePerGas || maxFeePerGas)
|
5747
|
+
throw new BaseError(
|
5748
|
+
"`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute."
|
5749
|
+
);
|
5750
|
+
if (gasPrice && gasPrice > 2n ** 256n - 1n)
|
5751
|
+
throw new FeeCapTooHighError({ maxFeePerGas: gasPrice });
|
5752
|
+
if (accessList)
|
5753
|
+
throw new BaseError(
|
5754
|
+
"`accessList` is not a valid Legacy Transaction attribute."
|
5755
|
+
);
|
5756
|
+
}
|
5757
|
+
|
5758
|
+
// src/utils/transaction/parseTransaction.ts
|
5759
|
+
function parseTransaction(serializedTransaction) {
|
5760
|
+
const type = getSerializedTransactionType(serializedTransaction);
|
5761
|
+
if (type === "eip1559")
|
5762
|
+
return parseTransactionEIP1559(
|
5763
|
+
serializedTransaction
|
5764
|
+
);
|
5765
|
+
if (type === "eip2930")
|
5766
|
+
return parseTransactionEIP2930(
|
5767
|
+
serializedTransaction
|
5768
|
+
);
|
5769
|
+
return parseTransactionLegacy(
|
5770
|
+
serializedTransaction
|
5771
|
+
);
|
5772
|
+
}
|
5773
|
+
function parseTransactionEIP1559(serializedTransaction) {
|
5774
|
+
const transactionArray = fromRlp(
|
5775
|
+
`0x${serializedTransaction.slice(4)}`,
|
5776
|
+
"hex"
|
5777
|
+
);
|
5778
|
+
const [
|
5779
|
+
chainId,
|
5780
|
+
nonce,
|
5781
|
+
maxPriorityFeePerGas,
|
5782
|
+
maxFeePerGas,
|
5783
|
+
gas,
|
5784
|
+
to,
|
5785
|
+
value,
|
5786
|
+
data,
|
5787
|
+
accessList,
|
5788
|
+
v,
|
5789
|
+
r,
|
5790
|
+
s
|
5791
|
+
] = transactionArray;
|
5792
|
+
if (!(transactionArray.length === 9 || transactionArray.length === 12))
|
5793
|
+
throw new InvalidSerializedTransactionError({
|
5794
|
+
attributes: {
|
5795
|
+
chainId,
|
5796
|
+
nonce,
|
5797
|
+
maxPriorityFeePerGas,
|
5798
|
+
maxFeePerGas,
|
5799
|
+
gas,
|
5800
|
+
to,
|
5801
|
+
value,
|
5802
|
+
data,
|
5803
|
+
accessList,
|
5804
|
+
...transactionArray.length > 9 ? {
|
5805
|
+
v,
|
5806
|
+
r,
|
5807
|
+
s
|
5808
|
+
} : {}
|
5809
|
+
},
|
5810
|
+
serializedTransaction,
|
5811
|
+
type: "eip1559"
|
5812
|
+
});
|
5813
|
+
let transaction = {
|
5814
|
+
chainId: hexToNumber(chainId),
|
5815
|
+
type: "eip1559"
|
5816
|
+
};
|
5817
|
+
if (isHex(to) && to !== "0x")
|
5818
|
+
transaction.to = to;
|
5819
|
+
if (isHex(gas) && gas !== "0x")
|
5820
|
+
transaction.gas = hexToBigInt(gas);
|
5821
|
+
if (isHex(data) && data !== "0x")
|
5822
|
+
transaction.data = data;
|
5823
|
+
if (isHex(nonce) && nonce !== "0x")
|
5824
|
+
transaction.nonce = hexToNumber(nonce);
|
5825
|
+
if (isHex(value) && value !== "0x")
|
5826
|
+
transaction.value = hexToBigInt(value);
|
5827
|
+
if (isHex(maxFeePerGas) && maxFeePerGas !== "0x")
|
5828
|
+
transaction.maxFeePerGas = hexToBigInt(maxFeePerGas);
|
5829
|
+
if (isHex(maxPriorityFeePerGas) && maxPriorityFeePerGas !== "0x")
|
5830
|
+
transaction.maxPriorityFeePerGas = hexToBigInt(maxPriorityFeePerGas);
|
5831
|
+
if (accessList.length !== 0 && accessList !== "0x")
|
5832
|
+
transaction.accessList = parseAccessList(accessList);
|
5833
|
+
assertTransactionEIP1559(transaction);
|
5834
|
+
const signature = transactionArray.length === 12 ? parseEIP155Signature(transactionArray) : void 0;
|
5835
|
+
return { ...signature, ...transaction };
|
5836
|
+
}
|
5837
|
+
function parseTransactionEIP2930(serializedTransaction) {
|
5838
|
+
const transactionArray = fromRlp(
|
5839
|
+
`0x${serializedTransaction.slice(4)}`,
|
5840
|
+
"hex"
|
5841
|
+
);
|
5842
|
+
const [chainId, nonce, gasPrice, gas, to, value, data, accessList, v, r, s] = transactionArray;
|
5843
|
+
if (!(transactionArray.length === 8 || transactionArray.length === 11))
|
5844
|
+
throw new InvalidSerializedTransactionError({
|
5845
|
+
attributes: {
|
5846
|
+
chainId,
|
5847
|
+
nonce,
|
5848
|
+
gasPrice,
|
5849
|
+
gas,
|
5850
|
+
to,
|
5851
|
+
value,
|
5852
|
+
data,
|
5853
|
+
accessList,
|
5854
|
+
...transactionArray.length > 8 ? {
|
5855
|
+
v,
|
5856
|
+
r,
|
5857
|
+
s
|
5858
|
+
} : {}
|
5859
|
+
},
|
5860
|
+
serializedTransaction,
|
5861
|
+
type: "eip2930"
|
5862
|
+
});
|
5863
|
+
let transaction = {
|
5864
|
+
chainId: hexToNumber(chainId),
|
5865
|
+
type: "eip2930"
|
5866
|
+
};
|
5867
|
+
if (isHex(to) && to !== "0x")
|
5868
|
+
transaction.to = to;
|
5869
|
+
if (isHex(gas) && gas !== "0x")
|
5870
|
+
transaction.gas = hexToBigInt(gas);
|
5871
|
+
if (isHex(data) && data !== "0x")
|
5872
|
+
transaction.data = data;
|
5873
|
+
if (isHex(nonce) && nonce !== "0x")
|
5874
|
+
transaction.nonce = hexToNumber(nonce);
|
5875
|
+
if (isHex(value) && value !== "0x")
|
5876
|
+
transaction.value = hexToBigInt(value);
|
5877
|
+
if (isHex(gasPrice) && gasPrice !== "0x")
|
5878
|
+
transaction.gasPrice = hexToBigInt(gasPrice);
|
5879
|
+
if (accessList.length !== 0 && accessList !== "0x")
|
5880
|
+
transaction.accessList = parseAccessList(accessList);
|
5881
|
+
assertTransactionEIP2930(transaction);
|
5882
|
+
const signature = transactionArray.length === 11 ? parseEIP155Signature(transactionArray) : void 0;
|
5883
|
+
return { ...signature, ...transaction };
|
5884
|
+
}
|
5885
|
+
function parseTransactionLegacy(serializedTransaction) {
|
5886
|
+
const transactionArray = fromRlp(serializedTransaction, "hex");
|
5887
|
+
const [nonce, gasPrice, gas, to, value, data, chainIdOrV_, r, s] = transactionArray;
|
5888
|
+
if (!(transactionArray.length === 6 || transactionArray.length === 9))
|
5889
|
+
throw new InvalidSerializedTransactionError({
|
5890
|
+
attributes: {
|
5891
|
+
nonce,
|
5892
|
+
gasPrice,
|
5893
|
+
gas,
|
5894
|
+
to,
|
5895
|
+
value,
|
5896
|
+
data,
|
5897
|
+
...transactionArray.length > 6 ? {
|
5898
|
+
v: chainIdOrV_,
|
5899
|
+
r,
|
5900
|
+
s
|
5901
|
+
} : {}
|
5902
|
+
},
|
5903
|
+
serializedTransaction,
|
5904
|
+
type: "legacy"
|
5905
|
+
});
|
5906
|
+
let transaction = {
|
5907
|
+
type: "legacy"
|
5908
|
+
};
|
5909
|
+
if (isHex(to) && to !== "0x")
|
5910
|
+
transaction.to = to;
|
5911
|
+
if (isHex(gas) && gas !== "0x")
|
5912
|
+
transaction.gas = hexToBigInt(gas);
|
5913
|
+
if (isHex(data) && data !== "0x")
|
5914
|
+
transaction.data = data;
|
5915
|
+
if (isHex(nonce) && nonce !== "0x")
|
5916
|
+
transaction.nonce = hexToNumber(nonce);
|
5917
|
+
if (isHex(value) && value !== "0x")
|
5918
|
+
transaction.value = hexToBigInt(value);
|
5919
|
+
if (isHex(gasPrice) && gasPrice !== "0x")
|
5920
|
+
transaction.gasPrice = hexToBigInt(gasPrice);
|
5921
|
+
assertTransactionLegacy(transaction);
|
5922
|
+
if (transactionArray.length === 6)
|
5923
|
+
return transaction;
|
5924
|
+
const chainIdOrV = isHex(chainIdOrV_) && chainIdOrV_ !== "0x" ? hexToBigInt(chainIdOrV_) : 0n;
|
5925
|
+
if (s === "0x" && r === "0x") {
|
5926
|
+
if (chainIdOrV > 0)
|
5927
|
+
transaction.chainId = Number(chainIdOrV);
|
5928
|
+
return transaction;
|
5929
|
+
}
|
5930
|
+
const v = chainIdOrV;
|
5931
|
+
let chainId = Number((v - 35n) / 2n);
|
5932
|
+
if (chainId > 0)
|
5933
|
+
transaction.chainId = chainId;
|
5934
|
+
else if (v !== 27n && v !== 28n)
|
5935
|
+
throw new InvalidLegacyVError({ v });
|
5936
|
+
transaction.v = v;
|
5937
|
+
transaction.s = s;
|
5938
|
+
transaction.r = r;
|
5939
|
+
return transaction;
|
5940
|
+
}
|
5941
|
+
function parseAccessList(accessList_) {
|
5942
|
+
let accessList = [];
|
5943
|
+
for (let i = 0; i < accessList_.length; i++) {
|
5944
|
+
const [address, storageKeys] = accessList_[i];
|
5945
|
+
if (!isAddress(address))
|
5946
|
+
throw new InvalidAddressError({ address });
|
5947
|
+
accessList.push({
|
5948
|
+
address,
|
5949
|
+
storageKeys: storageKeys.map((key) => isHash(key) ? key : trim(key))
|
5950
|
+
});
|
5951
|
+
}
|
5952
|
+
return accessList;
|
5953
|
+
}
|
5954
|
+
function parseEIP155Signature(transactionArray) {
|
5955
|
+
const signature = transactionArray.slice(-3);
|
5956
|
+
const v = signature[0] === "0x" || hexToBigInt(signature[0]) === 0n ? 27n : 28n;
|
5957
|
+
return {
|
5958
|
+
r: padHex(signature[1], { size: 32 }),
|
5959
|
+
s: padHex(signature[2], { size: 32 }),
|
5960
|
+
v,
|
5961
|
+
yParity: v === 27n ? 0 : 1
|
5962
|
+
};
|
5963
|
+
}
|
5964
|
+
|
5965
|
+
// src/utils/transaction/serializeTransaction.ts
|
5966
|
+
function serializeTransaction(transaction, signature) {
|
5967
|
+
const type = getTransactionType(transaction);
|
5968
|
+
if (type === "eip1559")
|
5969
|
+
return serializeTransactionEIP1559(
|
5970
|
+
transaction,
|
5971
|
+
signature
|
5972
|
+
);
|
5973
|
+
if (type === "eip2930")
|
5974
|
+
return serializeTransactionEIP2930(
|
5975
|
+
transaction,
|
5976
|
+
signature
|
5977
|
+
);
|
5978
|
+
return serializeTransactionLegacy(
|
5979
|
+
transaction,
|
5980
|
+
signature
|
5981
|
+
);
|
5982
|
+
}
|
5983
|
+
function serializeTransactionEIP1559(transaction, signature) {
|
5984
|
+
const {
|
5985
|
+
chainId,
|
5986
|
+
gas,
|
5987
|
+
nonce,
|
5988
|
+
to,
|
5989
|
+
value,
|
5990
|
+
maxFeePerGas,
|
5991
|
+
maxPriorityFeePerGas,
|
5992
|
+
accessList,
|
5993
|
+
data
|
5994
|
+
} = transaction;
|
5995
|
+
assertTransactionEIP1559(transaction);
|
5996
|
+
const serializedAccessList = serializeAccessList(accessList);
|
5997
|
+
const serializedTransaction = [
|
5998
|
+
toHex(chainId),
|
5999
|
+
typeof nonce !== "undefined" ? toHex(nonce) : "0x",
|
6000
|
+
typeof maxPriorityFeePerGas !== "undefined" ? toHex(maxPriorityFeePerGas) : "0x",
|
6001
|
+
typeof maxFeePerGas !== "undefined" ? toHex(maxFeePerGas) : "0x",
|
6002
|
+
typeof gas !== "undefined" ? toHex(gas) : "0x",
|
6003
|
+
_nullishCoalesce(to, () => ( "0x")),
|
6004
|
+
typeof value !== "undefined" ? toHex(value) : "0x",
|
6005
|
+
_nullishCoalesce(data, () => ( "0x")),
|
6006
|
+
serializedAccessList
|
6007
|
+
];
|
6008
|
+
if (signature)
|
6009
|
+
serializedTransaction.push(
|
6010
|
+
signature.v === 27n ? "0x" : toHex(1),
|
6011
|
+
// yParity
|
6012
|
+
signature.r,
|
6013
|
+
signature.s
|
6014
|
+
);
|
6015
|
+
return concatHex([
|
6016
|
+
"0x02",
|
6017
|
+
toRlp(serializedTransaction)
|
6018
|
+
]);
|
6019
|
+
}
|
6020
|
+
function serializeTransactionEIP2930(transaction, signature) {
|
6021
|
+
const { chainId, gas, data, nonce, to, value, accessList, gasPrice } = transaction;
|
6022
|
+
assertTransactionEIP2930(transaction);
|
6023
|
+
const serializedAccessList = serializeAccessList(accessList);
|
6024
|
+
const serializedTransaction = [
|
6025
|
+
toHex(chainId),
|
6026
|
+
typeof nonce !== "undefined" ? toHex(nonce) : "0x",
|
6027
|
+
typeof gasPrice !== "undefined" ? toHex(gasPrice) : "0x",
|
6028
|
+
typeof gas !== "undefined" ? toHex(gas) : "0x",
|
6029
|
+
_nullishCoalesce(to, () => ( "0x")),
|
6030
|
+
typeof value !== "undefined" ? toHex(value) : "0x",
|
6031
|
+
_nullishCoalesce(data, () => ( "0x")),
|
6032
|
+
serializedAccessList
|
6033
|
+
];
|
6034
|
+
if (signature)
|
6035
|
+
serializedTransaction.push(
|
6036
|
+
signature.v === 27n ? "0x" : toHex(1),
|
6037
|
+
// yParity
|
6038
|
+
signature.r,
|
6039
|
+
signature.s
|
6040
|
+
);
|
6041
|
+
return concatHex([
|
6042
|
+
"0x01",
|
6043
|
+
toRlp(serializedTransaction)
|
6044
|
+
]);
|
6045
|
+
}
|
6046
|
+
function serializeTransactionLegacy(transaction, signature) {
|
6047
|
+
const { chainId = 0, gas, data, nonce, to, value, gasPrice } = transaction;
|
6048
|
+
assertTransactionLegacy(transaction);
|
6049
|
+
let serializedTransaction = [
|
6050
|
+
typeof nonce !== "undefined" ? toHex(nonce) : "0x",
|
6051
|
+
typeof gasPrice !== "undefined" ? toHex(gasPrice) : "0x",
|
6052
|
+
typeof gas !== "undefined" ? toHex(gas) : "0x",
|
6053
|
+
_nullishCoalesce(to, () => ( "0x")),
|
6054
|
+
typeof value !== "undefined" ? toHex(value) : "0x",
|
6055
|
+
_nullishCoalesce(data, () => ( "0x"))
|
6056
|
+
];
|
6057
|
+
if (signature) {
|
6058
|
+
let v = 27n + (signature.v === 27n ? 0n : 1n);
|
6059
|
+
if (chainId > 0)
|
6060
|
+
v = BigInt(chainId * 2) + BigInt(35n + signature.v - 27n);
|
6061
|
+
else if (signature.v !== v)
|
6062
|
+
throw new InvalidLegacyVError({ v: signature.v });
|
6063
|
+
serializedTransaction = [
|
6064
|
+
...serializedTransaction,
|
6065
|
+
toHex(v),
|
6066
|
+
signature.r,
|
6067
|
+
signature.s
|
6068
|
+
];
|
6069
|
+
} else if (chainId > 0) {
|
6070
|
+
serializedTransaction = [
|
6071
|
+
...serializedTransaction,
|
6072
|
+
toHex(chainId),
|
6073
|
+
"0x",
|
6074
|
+
"0x"
|
6075
|
+
];
|
6076
|
+
}
|
6077
|
+
return toRlp(serializedTransaction);
|
6078
|
+
}
|
6079
|
+
function serializeAccessList(accessList) {
|
6080
|
+
if (!accessList || accessList.length === 0)
|
6081
|
+
return [];
|
6082
|
+
let serializedAccessList = [];
|
6083
|
+
for (let i = 0; i < accessList.length; i++) {
|
6084
|
+
const { address, storageKeys } = accessList[i];
|
6085
|
+
for (let j = 0; j < storageKeys.length; j++) {
|
6086
|
+
if (storageKeys[j].length - 2 !== 64) {
|
6087
|
+
throw new InvalidStorageKeySizeError({ storageKey: storageKeys[j] });
|
6088
|
+
}
|
6089
|
+
}
|
6090
|
+
if (!isAddress(address)) {
|
6091
|
+
throw new InvalidAddressError({ address });
|
6092
|
+
}
|
6093
|
+
serializedAccessList.push([address, storageKeys]);
|
6094
|
+
}
|
6095
|
+
return serializedAccessList;
|
6096
|
+
}
|
6097
|
+
|
5604
6098
|
// src/utils/unit/formatUnits.ts
|
5605
6099
|
function formatUnits(value, decimals) {
|
5606
6100
|
let display = value.toString();
|
@@ -5899,5 +6393,15 @@ function parseEther(ether, unit = "wei") {
|
|
5899
6393
|
|
5900
6394
|
|
5901
6395
|
|
5902
|
-
exports.BaseError = BaseError; exports.AbiConstructorNotFoundError = AbiConstructorNotFoundError; exports.AbiConstructorParamsNotFoundError = AbiConstructorParamsNotFoundError; exports.AbiDecodingDataSizeInvalidError = AbiDecodingDataSizeInvalidError; exports.AbiDecodingZeroDataError = AbiDecodingZeroDataError; exports.AbiEncodingArrayLengthMismatchError = AbiEncodingArrayLengthMismatchError; exports.AbiEncodingLengthMismatchError = AbiEncodingLengthMismatchError; exports.AbiErrorInputsNotFoundError = AbiErrorInputsNotFoundError; exports.AbiErrorNotFoundError = AbiErrorNotFoundError; exports.AbiErrorSignatureNotFoundError = AbiErrorSignatureNotFoundError; exports.AbiEventSignatureEmptyTopicsError = AbiEventSignatureEmptyTopicsError; exports.AbiEventSignatureNotFoundError = AbiEventSignatureNotFoundError; exports.AbiEventNotFoundError = AbiEventNotFoundError; exports.AbiFunctionNotFoundError = AbiFunctionNotFoundError; exports.AbiFunctionOutputsNotFoundError = AbiFunctionOutputsNotFoundError; exports.AbiFunctionSignatureNotFoundError = AbiFunctionSignatureNotFoundError; exports.DecodeLogTopicsMismatch = DecodeLogTopicsMismatch; exports.InvalidAbiEncodingTypeError = InvalidAbiEncodingTypeError; exports.InvalidAbiDecodingTypeError = InvalidAbiDecodingTypeError; exports.InvalidArrayError = InvalidArrayError; exports.InvalidDefinitionTypeError = InvalidDefinitionTypeError; exports.InvalidAddressError = InvalidAddressError; exports.BlockNotFoundError = BlockNotFoundError; exports.ChainDoesNotSupportContract = ChainDoesNotSupportContract; exports.multicall3Abi = multicall3Abi; exports.panicReasons = panicReasons; exports.etherUnits = etherUnits; exports.gweiUnits = gweiUnits; exports.weiUnits = weiUnits; exports.TransactionExecutionError = TransactionExecutionError; exports.TransactionNotFoundError = TransactionNotFoundError; exports.TransactionReceiptNotFoundError = TransactionReceiptNotFoundError; exports.WaitForTransactionReceiptTimeoutError = WaitForTransactionReceiptTimeoutError; exports.CallExecutionError = CallExecutionError; exports.ContractFunctionExecutionError = ContractFunctionExecutionError; exports.ContractFunctionRevertedError = ContractFunctionRevertedError; exports.ContractFunctionZeroDataError = ContractFunctionZeroDataError; exports.RawContractError = RawContractError; exports.SizeExceedsPaddingSizeError = SizeExceedsPaddingSizeError; exports.DataLengthTooLongError = DataLengthTooLongError; exports.DataLengthTooShortError = DataLengthTooShortError; exports.InvalidBytesBooleanError = InvalidBytesBooleanError; exports.InvalidHexBooleanError = InvalidHexBooleanError; exports.InvalidHexValueError = InvalidHexValueError; exports.OffsetOutOfBoundsError = OffsetOutOfBoundsError; exports.EstimateGasExecutionError = EstimateGasExecutionError; exports.FilterTypeNotSupportedError = FilterTypeNotSupportedError; exports.ExecutionRevertedError = ExecutionRevertedError; exports.FeeCapTooHighError = FeeCapTooHighError; exports.FeeCapTooLowError = FeeCapTooLowError; exports.NonceTooHighError = NonceTooHighError; exports.NonceTooLowError = NonceTooLowError; exports.NonceMaxValueError = NonceMaxValueError; exports.InsufficientFundsError = InsufficientFundsError; exports.IntrinsicGasTooHighError = IntrinsicGasTooHighError; exports.IntrinsicGasTooLowError = IntrinsicGasTooLowError; exports.TransactionTypeNotSupportedError = TransactionTypeNotSupportedError; exports.TipAboveFeeCapError = TipAboveFeeCapError; exports.UnknownNodeError = UnknownNodeError; exports.RequestError = RequestError; exports.RpcRequestError = RpcRequestError; exports.ParseRpcError = ParseRpcError; exports.InvalidRequestRpcError = InvalidRequestRpcError; exports.MethodNotFoundRpcError = MethodNotFoundRpcError; exports.InvalidParamsRpcError = InvalidParamsRpcError; exports.InternalRpcError = InternalRpcError; exports.InvalidInputRpcError = InvalidInputRpcError; exports.ResourceNotFoundRpcError = ResourceNotFoundRpcError; exports.ResourceUnavailableRpcError = ResourceUnavailableRpcError; exports.TransactionRejectedRpcError = TransactionRejectedRpcError; exports.MethodNotSupportedRpcError = MethodNotSupportedRpcError; exports.LimitExceededRpcError = LimitExceededRpcError; exports.JsonRpcVersionUnsupportedError = JsonRpcVersionUnsupportedError; exports.UserRejectedRequestError = UserRejectedRequestError; exports.SwitchChainError = SwitchChainError; exports.UnknownRpcError = UnknownRpcError; exports.HttpRequestError = HttpRequestError; exports.WebSocketRequestError = WebSocketRequestError; exports.RpcError = RpcError; exports.TimeoutError = TimeoutError; exports.UrlRequiredError = UrlRequiredError; exports.concat = concat; exports.concatBytes = concatBytes; exports.concatHex = concatHex; exports.isBytes = isBytes; exports.isHex = isHex; exports.pad = pad; exports.padHex = padHex; exports.padBytes = padBytes; exports.trim = trim; exports.size = size; exports.slice = slice; exports.sliceBytes = sliceBytes; exports.sliceHex = sliceHex; exports.boolToHex = boolToHex; exports.bytesToHex = bytesToHex; exports.toHex = toHex; exports.numberToHex = numberToHex; exports.stringToHex = stringToHex; exports.toBytes = toBytes; exports.boolToBytes = boolToBytes; exports.hexToBytes = hexToBytes; exports.numberToBytes = numberToBytes; exports.stringToBytes = stringToBytes; exports.toRlp = toRlp; exports.fromHex = fromHex; exports.hexToBigInt = hexToBigInt; exports.hexToBool = hexToBool; exports.hexToNumber = hexToNumber; exports.hexToString = hexToString; exports.fromBytes = fromBytes; exports.bytesToBigint = bytesToBigint; exports.bytesToBool = bytesToBool; exports.bytesToNumber = bytesToNumber; exports.bytesToString = bytesToString; exports.fromRlp = fromRlp; exports.extractFunctionParts = extractFunctionParts; exports.extractFunctionName = extractFunctionName; exports.extractFunctionParams = extractFunctionParams; exports.extractFunctionType = extractFunctionType; exports.keccak256 = keccak256; exports.getEventSelector = getEventSelector; exports.getFunctionSelector = getFunctionSelector; exports.isAddress = isAddress; exports.checksumAddress = checksumAddress; exports.getAddress = getAddress; exports.getContractAddress = getContractAddress2; exports.getCreateAddress = getCreateAddress; exports.getCreate2Address = getCreate2Address; exports.isAddressEqual = isAddressEqual; exports.encodeAbiParameters = encodeAbiParameters; exports.decodeAbiParameters = decodeAbiParameters; exports.formatAbiItem = formatAbiItem; exports.decodeErrorResult = decodeErrorResult; exports.decodeEventLog = decodeEventLog; exports.decodeFunctionData = decodeFunctionData; exports.getAbiItem = getAbiItem; exports.decodeFunctionResult = decodeFunctionResult; exports.encodeDeployData = encodeDeployData; exports.encodeErrorResult = encodeErrorResult; exports.encodeEventTopics = encodeEventTopics; exports.encodeFunctionData = encodeFunctionData; exports.encodeFunctionResult = encodeFunctionResult; exports.arrayRegex = arrayRegex; exports.bytesRegex = bytesRegex; exports.integerRegex = integerRegex; exports.encodePacked = encodePacked; exports.formatAbiItemWithArgs = formatAbiItemWithArgs; exports.parseAbi = _abitype.parseAbi; exports.parseAbiItem = _abitype.parseAbiItem; exports.parseAbiParameter = _abitype.parseAbiParameter; exports.parseAbiParameters = _abitype.parseAbiParameters; exports.parseAccount = parseAccount; exports.isDeterministicError = isDeterministicError; exports.buildRequest = buildRequest; exports.defineChain = defineChain; exports.getChainContractAddress = getChainContractAddress; exports.format = format3; exports.defineFormatter = defineFormatter; exports.transactionType = transactionType; exports.formatTransaction = formatTransaction; exports.defineTransaction = defineTransaction; exports.formatBlock = formatBlock; exports.defineBlock = defineBlock; exports.extract = extract; exports.defineTransactionReceipt = defineTransactionReceipt; exports.formatTransactionRequest = formatTransactionRequest; exports.defineTransactionRequest = defineTransactionRequest; exports.containsNodeError = containsNodeError; exports.getNodeError = getNodeError; exports.getCallError = getCallError; exports.getContractError = getContractError; exports.getEstimateGasError = getEstimateGasError; exports.getTransactionError = getTransactionError; exports.stringify = stringify; exports.getSocket = getSocket; exports.rpc = rpc; exports.hashMessage = hashMessage; exports.validateTypedData = validateTypedData; exports.hashTypedData = hashTypedData; exports.recoverAddress = recoverAddress; exports.recoverMessageAddress = recoverMessageAddress; exports.recoverTypedDataAddress = recoverTypedDataAddress; exports.verifyMessage = verifyMessage; exports.verifyTypedData = verifyTypedData; exports.assertRequest = assertRequest; exports.call = call; exports.simulateContract = simulateContract; exports.createPendingTransactionFilter = createPendingTransactionFilter; exports.createBlockFilter = createBlockFilter; exports.createEventFilter = createEventFilter; exports.createContractEventFilter = createContractEventFilter; exports.estimateGas = estimateGas; exports.estimateContractGas = estimateContractGas; exports.getBalance = getBalance; exports.getBlock = getBlock; exports.getBlockNumberCache = getBlockNumberCache; exports.getBlockNumber = getBlockNumber; exports.getBlockTransactionCount = getBlockTransactionCount; exports.getBytecode = getBytecode; exports.getChainId = getChainId; exports.getFeeHistory = getFeeHistory; exports.getFilterChanges = getFilterChanges; exports.getFilterLogs = getFilterLogs; exports.getGasPrice = getGasPrice; exports.getLogs = getLogs; exports.getStorageAt = getStorageAt; exports.getTransaction = getTransaction; exports.getTransactionConfirmations = getTransactionConfirmations; exports.getTransactionCount = getTransactionCount; exports.getTransactionReceipt = getTransactionReceipt; exports.readContract = readContract; exports.multicall = multicall; exports.uninstallFilter = uninstallFilter; exports.waitForTransactionReceipt = waitForTransactionReceipt; exports.watchBlockNumber = watchBlockNumber; exports.watchBlocks = watchBlocks; exports.watchContractEvent = watchContractEvent; exports.watchEvent = watchEvent; exports.watchPendingTransactions = watchPendingTransactions; exports.dropTransaction = dropTransaction; exports.getAutomine = getAutomine; exports.getTxpoolContent = getTxpoolContent; exports.getTxpoolStatus = getTxpoolStatus; exports.impersonateAccount = impersonateAccount; exports.increaseTime = increaseTime; exports.inspectTxpool = inspectTxpool; exports.mine = mine; exports.removeBlockTimestampInterval = removeBlockTimestampInterval; exports.reset = reset; exports.revert = revert; exports.sendUnsignedTransaction = sendUnsignedTransaction; exports.setAutomine = setAutomine; exports.setBalance = setBalance; exports.setBlockGasLimit = setBlockGasLimit; exports.setBlockTimestampInterval = setBlockTimestampInterval; exports.setCode = setCode; exports.setCoinbase = setCoinbase; exports.setIntervalMining = setIntervalMining; exports.setLoggingEnabled = setLoggingEnabled; exports.setMinGasPrice = setMinGasPrice; exports.setNextBlockBaseFeePerGas = setNextBlockBaseFeePerGas; exports.setNextBlockTimestamp = setNextBlockTimestamp; exports.setNonce = setNonce; exports.setRpcUrl = setRpcUrl; exports.setStorageAt = setStorageAt; exports.snapshot = snapshot; exports.stopImpersonatingAccount = stopImpersonatingAccount; exports.addChain = addChain; exports.deployContract = deployContract; exports.getAddresses = getAddresses; exports.getPermissions = getPermissions; exports.requestAddresses = requestAddresses; exports.requestPermissions = requestPermissions; exports.sendTransaction = sendTransaction; exports.signMessage = signMessage; exports.signTypedData = signTypedData; exports.switchChain = switchChain; exports.watchAsset = watchAsset; exports.writeContract = writeContract; exports.parseUnits = parseUnits; exports.parseGwei = parseGwei; exports.prepareRequest = prepareRequest; exports.formatUnits = formatUnits; exports.formatEther = formatEther; exports.formatGwei = formatGwei; exports.parseEther = parseEther;
|
5903
|
-
|
6396
|
+
|
6397
|
+
|
6398
|
+
|
6399
|
+
|
6400
|
+
|
6401
|
+
|
6402
|
+
|
6403
|
+
|
6404
|
+
|
6405
|
+
|
6406
|
+
exports.BaseError = BaseError; exports.AbiConstructorNotFoundError = AbiConstructorNotFoundError; exports.AbiConstructorParamsNotFoundError = AbiConstructorParamsNotFoundError; exports.AbiDecodingDataSizeInvalidError = AbiDecodingDataSizeInvalidError; exports.AbiDecodingZeroDataError = AbiDecodingZeroDataError; exports.AbiEncodingArrayLengthMismatchError = AbiEncodingArrayLengthMismatchError; exports.AbiEncodingLengthMismatchError = AbiEncodingLengthMismatchError; exports.AbiErrorInputsNotFoundError = AbiErrorInputsNotFoundError; exports.AbiErrorNotFoundError = AbiErrorNotFoundError; exports.AbiErrorSignatureNotFoundError = AbiErrorSignatureNotFoundError; exports.AbiEventSignatureEmptyTopicsError = AbiEventSignatureEmptyTopicsError; exports.AbiEventSignatureNotFoundError = AbiEventSignatureNotFoundError; exports.AbiEventNotFoundError = AbiEventNotFoundError; exports.AbiFunctionNotFoundError = AbiFunctionNotFoundError; exports.AbiFunctionOutputsNotFoundError = AbiFunctionOutputsNotFoundError; exports.AbiFunctionSignatureNotFoundError = AbiFunctionSignatureNotFoundError; exports.DecodeLogTopicsMismatch = DecodeLogTopicsMismatch; exports.InvalidAbiEncodingTypeError = InvalidAbiEncodingTypeError; exports.InvalidAbiDecodingTypeError = InvalidAbiDecodingTypeError; exports.InvalidArrayError = InvalidArrayError; exports.InvalidDefinitionTypeError = InvalidDefinitionTypeError; exports.InvalidAddressError = InvalidAddressError; exports.BlockNotFoundError = BlockNotFoundError; exports.ChainDoesNotSupportContract = ChainDoesNotSupportContract; exports.InvalidChainIdError = InvalidChainIdError; exports.multicall3Abi = multicall3Abi; exports.panicReasons = panicReasons; exports.etherUnits = etherUnits; exports.gweiUnits = gweiUnits; exports.weiUnits = weiUnits; exports.InvalidLegacyVError = InvalidLegacyVError; exports.TransactionExecutionError = TransactionExecutionError; exports.TransactionNotFoundError = TransactionNotFoundError; exports.TransactionReceiptNotFoundError = TransactionReceiptNotFoundError; exports.WaitForTransactionReceiptTimeoutError = WaitForTransactionReceiptTimeoutError; exports.CallExecutionError = CallExecutionError; exports.ContractFunctionExecutionError = ContractFunctionExecutionError; exports.ContractFunctionRevertedError = ContractFunctionRevertedError; exports.ContractFunctionZeroDataError = ContractFunctionZeroDataError; exports.RawContractError = RawContractError; exports.SizeExceedsPaddingSizeError = SizeExceedsPaddingSizeError; exports.DataLengthTooLongError = DataLengthTooLongError; exports.DataLengthTooShortError = DataLengthTooShortError; exports.InvalidBytesBooleanError = InvalidBytesBooleanError; exports.InvalidHexBooleanError = InvalidHexBooleanError; exports.InvalidHexValueError = InvalidHexValueError; exports.OffsetOutOfBoundsError = OffsetOutOfBoundsError; exports.EstimateGasExecutionError = EstimateGasExecutionError; exports.FilterTypeNotSupportedError = FilterTypeNotSupportedError; exports.ExecutionRevertedError = ExecutionRevertedError; exports.FeeCapTooHighError = FeeCapTooHighError; exports.FeeCapTooLowError = FeeCapTooLowError; exports.NonceTooHighError = NonceTooHighError; exports.NonceTooLowError = NonceTooLowError; exports.NonceMaxValueError = NonceMaxValueError; exports.InsufficientFundsError = InsufficientFundsError; exports.IntrinsicGasTooHighError = IntrinsicGasTooHighError; exports.IntrinsicGasTooLowError = IntrinsicGasTooLowError; exports.TransactionTypeNotSupportedError = TransactionTypeNotSupportedError; exports.TipAboveFeeCapError = TipAboveFeeCapError; exports.UnknownNodeError = UnknownNodeError; exports.RequestError = RequestError; exports.RpcRequestError = RpcRequestError; exports.ParseRpcError = ParseRpcError; exports.InvalidRequestRpcError = InvalidRequestRpcError; exports.MethodNotFoundRpcError = MethodNotFoundRpcError; exports.InvalidParamsRpcError = InvalidParamsRpcError; exports.InternalRpcError = InternalRpcError; exports.InvalidInputRpcError = InvalidInputRpcError; exports.ResourceNotFoundRpcError = ResourceNotFoundRpcError; exports.ResourceUnavailableRpcError = ResourceUnavailableRpcError; exports.TransactionRejectedRpcError = TransactionRejectedRpcError; exports.MethodNotSupportedRpcError = MethodNotSupportedRpcError; exports.LimitExceededRpcError = LimitExceededRpcError; exports.JsonRpcVersionUnsupportedError = JsonRpcVersionUnsupportedError; exports.UserRejectedRequestError = UserRejectedRequestError; exports.SwitchChainError = SwitchChainError; exports.UnknownRpcError = UnknownRpcError; exports.HttpRequestError = HttpRequestError; exports.WebSocketRequestError = WebSocketRequestError; exports.RpcError = RpcError; exports.TimeoutError = TimeoutError; exports.UrlRequiredError = UrlRequiredError; exports.concat = concat; exports.concatBytes = concatBytes; exports.concatHex = concatHex; exports.isBytes = isBytes; exports.isHex = isHex; exports.pad = pad; exports.padHex = padHex; exports.padBytes = padBytes; exports.trim = trim; exports.size = size; exports.slice = slice; exports.sliceBytes = sliceBytes; exports.sliceHex = sliceHex; exports.boolToHex = boolToHex; exports.bytesToHex = bytesToHex; exports.toHex = toHex; exports.numberToHex = numberToHex; exports.stringToHex = stringToHex; exports.toBytes = toBytes; exports.boolToBytes = boolToBytes; exports.hexToBytes = hexToBytes; exports.numberToBytes = numberToBytes; exports.stringToBytes = stringToBytes; exports.toRlp = toRlp; exports.fromHex = fromHex; exports.hexToBigInt = hexToBigInt; exports.hexToBool = hexToBool; exports.hexToNumber = hexToNumber; exports.hexToString = hexToString; exports.fromBytes = fromBytes; exports.bytesToBigint = bytesToBigint; exports.bytesToBool = bytesToBool; exports.bytesToNumber = bytesToNumber; exports.bytesToString = bytesToString; exports.fromRlp = fromRlp; exports.extractFunctionParts = extractFunctionParts; exports.extractFunctionName = extractFunctionName; exports.extractFunctionParams = extractFunctionParams; exports.extractFunctionType = extractFunctionType; exports.keccak256 = keccak256; exports.getEventSelector = getEventSelector; exports.getFunctionSelector = getFunctionSelector; exports.isHash = isHash; exports.isAddress = isAddress; exports.checksumAddress = checksumAddress; exports.getAddress = getAddress; exports.getContractAddress = getContractAddress2; exports.getCreateAddress = getCreateAddress; exports.getCreate2Address = getCreate2Address; exports.isAddressEqual = isAddressEqual; exports.encodeAbiParameters = encodeAbiParameters; exports.decodeAbiParameters = decodeAbiParameters; exports.formatAbiItem = formatAbiItem; exports.decodeErrorResult = decodeErrorResult; exports.decodeEventLog = decodeEventLog; exports.decodeFunctionData = decodeFunctionData; exports.getAbiItem = getAbiItem; exports.decodeFunctionResult = decodeFunctionResult; exports.encodeDeployData = encodeDeployData; exports.encodeErrorResult = encodeErrorResult; exports.encodeEventTopics = encodeEventTopics; exports.encodeFunctionData = encodeFunctionData; exports.encodeFunctionResult = encodeFunctionResult; exports.arrayRegex = arrayRegex; exports.bytesRegex = bytesRegex; exports.integerRegex = integerRegex; exports.encodePacked = encodePacked; exports.formatAbiItemWithArgs = formatAbiItemWithArgs; exports.parseAbi = _abitype.parseAbi; exports.parseAbiItem = _abitype.parseAbiItem; exports.parseAbiParameter = _abitype.parseAbiParameter; exports.parseAbiParameters = _abitype.parseAbiParameters; exports.parseAccount = parseAccount; exports.isDeterministicError = isDeterministicError; exports.buildRequest = buildRequest; exports.defineChain = defineChain; exports.getChainContractAddress = getChainContractAddress; exports.format = format3; exports.defineFormatter = defineFormatter; exports.transactionType = transactionType; exports.formatTransaction = formatTransaction; exports.defineTransaction = defineTransaction; exports.formatBlock = formatBlock; exports.defineBlock = defineBlock; exports.extract = extract; exports.defineTransactionReceipt = defineTransactionReceipt; exports.formatTransactionRequest = formatTransactionRequest; exports.defineTransactionRequest = defineTransactionRequest; exports.containsNodeError = containsNodeError; exports.getNodeError = getNodeError; exports.getCallError = getCallError; exports.getContractError = getContractError; exports.getEstimateGasError = getEstimateGasError; exports.getTransactionError = getTransactionError; exports.stringify = stringify; exports.getSocket = getSocket; exports.rpc = rpc; exports.hashMessage = hashMessage; exports.validateTypedData = validateTypedData; exports.hashTypedData = hashTypedData; exports.recoverAddress = recoverAddress; exports.recoverMessageAddress = recoverMessageAddress; exports.recoverTypedDataAddress = recoverTypedDataAddress; exports.verifyMessage = verifyMessage; exports.verifyTypedData = verifyTypedData; exports.assertRequest = assertRequest; exports.getSerializedTransactionType = getSerializedTransactionType; exports.getTransactionType = getTransactionType; exports.call = call; exports.simulateContract = simulateContract; exports.createPendingTransactionFilter = createPendingTransactionFilter; exports.createBlockFilter = createBlockFilter; exports.createEventFilter = createEventFilter; exports.createContractEventFilter = createContractEventFilter; exports.estimateGas = estimateGas; exports.estimateContractGas = estimateContractGas; exports.getBalance = getBalance; exports.getBlock = getBlock; exports.getBlockNumberCache = getBlockNumberCache; exports.getBlockNumber = getBlockNumber; exports.getBlockTransactionCount = getBlockTransactionCount; exports.getBytecode = getBytecode; exports.getChainId = getChainId; exports.getFeeHistory = getFeeHistory; exports.getFilterChanges = getFilterChanges; exports.getFilterLogs = getFilterLogs; exports.getGasPrice = getGasPrice; exports.getLogs = getLogs; exports.getStorageAt = getStorageAt; exports.getTransaction = getTransaction; exports.getTransactionConfirmations = getTransactionConfirmations; exports.getTransactionCount = getTransactionCount; exports.getTransactionReceipt = getTransactionReceipt; exports.readContract = readContract; exports.multicall = multicall; exports.uninstallFilter = uninstallFilter; exports.waitForTransactionReceipt = waitForTransactionReceipt; exports.watchBlockNumber = watchBlockNumber; exports.watchBlocks = watchBlocks; exports.watchContractEvent = watchContractEvent; exports.watchEvent = watchEvent; exports.watchPendingTransactions = watchPendingTransactions; exports.dropTransaction = dropTransaction; exports.getAutomine = getAutomine; exports.getTxpoolContent = getTxpoolContent; exports.getTxpoolStatus = getTxpoolStatus; exports.impersonateAccount = impersonateAccount; exports.increaseTime = increaseTime; exports.inspectTxpool = inspectTxpool; exports.mine = mine; exports.removeBlockTimestampInterval = removeBlockTimestampInterval; exports.reset = reset; exports.revert = revert; exports.sendUnsignedTransaction = sendUnsignedTransaction; exports.setAutomine = setAutomine; exports.setBalance = setBalance; exports.setBlockGasLimit = setBlockGasLimit; exports.setBlockTimestampInterval = setBlockTimestampInterval; exports.setCode = setCode; exports.setCoinbase = setCoinbase; exports.setIntervalMining = setIntervalMining; exports.setLoggingEnabled = setLoggingEnabled; exports.setMinGasPrice = setMinGasPrice; exports.setNextBlockBaseFeePerGas = setNextBlockBaseFeePerGas; exports.setNextBlockTimestamp = setNextBlockTimestamp; exports.setNonce = setNonce; exports.setRpcUrl = setRpcUrl; exports.setStorageAt = setStorageAt; exports.snapshot = snapshot; exports.stopImpersonatingAccount = stopImpersonatingAccount; exports.addChain = addChain; exports.deployContract = deployContract; exports.getAddresses = getAddresses; exports.getPermissions = getPermissions; exports.requestAddresses = requestAddresses; exports.requestPermissions = requestPermissions; exports.sendTransaction = sendTransaction; exports.signMessage = signMessage; exports.signTypedData = signTypedData; exports.switchChain = switchChain; exports.watchAsset = watchAsset; exports.writeContract = writeContract; exports.parseUnits = parseUnits; exports.parseGwei = parseGwei; exports.prepareRequest = prepareRequest; exports.assertTransactionEIP1559 = assertTransactionEIP1559; exports.assertTransactionEIP2930 = assertTransactionEIP2930; exports.assertTransactionLegacy = assertTransactionLegacy; exports.parseTransaction = parseTransaction; exports.serializeTransaction = serializeTransaction; exports.formatUnits = formatUnits; exports.formatEther = formatEther; exports.formatGwei = formatGwei; exports.parseEther = parseEther;
|
6407
|
+
//# sourceMappingURL=chunk-CGTZNR2R.js.map
|