viem 2.0.0-beta.0 → 2.0.0-beta.1
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/CHANGELOG.md +62 -0
- package/README.md +4 -0
- package/_cjs/actions/index.js.map +1 -1
- package/_cjs/actions/public/getBlockNumber.js +2 -2
- package/_cjs/actions/public/getBlockNumber.js.map +1 -1
- package/_cjs/actions/public/watchContractEvent.js +2 -1
- package/_cjs/actions/public/watchContractEvent.js.map +1 -1
- package/_cjs/chains/celo/formatters.js +23 -35
- package/_cjs/chains/celo/formatters.js.map +1 -1
- package/_cjs/chains/celo/serializers.js +20 -38
- package/_cjs/chains/celo/serializers.js.map +1 -1
- package/_cjs/chains/celo/utils.js +44 -0
- package/_cjs/chains/celo/utils.js.map +1 -0
- package/_cjs/chains/definitions/astar.js +29 -0
- package/_cjs/chains/definitions/astar.js.map +1 -0
- package/_cjs/chains/definitions/gnosis.js +4 -1
- package/_cjs/chains/definitions/gnosis.js.map +1 -1
- package/_cjs/chains/definitions/gnosisChiado.js +10 -1
- package/_cjs/chains/definitions/gnosisChiado.js.map +1 -1
- package/_cjs/chains/definitions/kava.js +29 -0
- package/_cjs/chains/definitions/kava.js.map +1 -0
- package/_cjs/chains/definitions/kavaTestnet.js +32 -0
- package/_cjs/chains/definitions/kavaTestnet.js.map +1 -0
- package/_cjs/chains/definitions/neonDevnet.js +1 -1
- package/_cjs/chains/definitions/neonDevnet.js.map +1 -1
- package/_cjs/chains/definitions/neonMainnet.js +27 -0
- package/_cjs/chains/definitions/neonMainnet.js.map +1 -0
- package/_cjs/chains/definitions/scrollSepolia.js +0 -1
- package/_cjs/chains/definitions/scrollSepolia.js.map +1 -1
- package/_cjs/chains/definitions/tenet.js +23 -0
- package/_cjs/chains/definitions/tenet.js.map +1 -0
- package/_cjs/chains/index.js +14 -4
- package/_cjs/chains/index.js.map +1 -1
- package/_cjs/chains/zksync/formatters.js +6 -2
- package/_cjs/chains/zksync/formatters.js.map +1 -1
- package/_cjs/errors/contract.js +1 -1
- package/_cjs/errors/contract.js.map +1 -1
- package/_cjs/errors/encoding.js +1 -37
- package/_cjs/errors/encoding.js.map +1 -1
- package/_cjs/errors/estimateGas.js +1 -1
- package/_cjs/errors/estimateGas.js.map +1 -1
- package/_cjs/errors/node.js +11 -11
- package/_cjs/errors/node.js.map +1 -1
- package/_cjs/errors/rpc.js +18 -18
- package/_cjs/errors/rpc.js.map +1 -1
- package/_cjs/errors/transaction.js +1 -1
- package/_cjs/errors/transaction.js.map +1 -1
- package/_cjs/errors/version.js +1 -1
- package/_cjs/index.js +5 -9
- package/_cjs/index.js.map +1 -1
- package/_cjs/utils/hash/getFunctionSignature.js +9 -9
- package/_cjs/utils/hash/getFunctionSignature.js.map +1 -1
- package/_cjs/utils/hash/normalizeSignature.js +48 -0
- package/_cjs/utils/hash/normalizeSignature.js.map +1 -0
- package/_cjs/utils/index.js +3 -10
- package/_cjs/utils/index.js.map +1 -1
- package/_cjs/utils/transaction/serializeTransaction.js +14 -5
- package/_cjs/utils/transaction/serializeTransaction.js.map +1 -1
- package/_esm/actions/index.js.map +1 -1
- package/_esm/actions/public/getBlockNumber.js +2 -2
- package/_esm/actions/public/getBlockNumber.js.map +1 -1
- package/_esm/actions/public/watchContractEvent.js +2 -1
- package/_esm/actions/public/watchContractEvent.js.map +1 -1
- package/_esm/chains/celo/formatters.js +23 -35
- package/_esm/chains/celo/formatters.js.map +1 -1
- package/_esm/chains/celo/serializers.js +19 -44
- package/_esm/chains/celo/serializers.js.map +1 -1
- package/_esm/chains/celo/utils.js +39 -0
- package/_esm/chains/celo/utils.js.map +1 -0
- package/_esm/chains/definitions/astar.js +26 -0
- package/_esm/chains/definitions/astar.js.map +1 -0
- package/_esm/chains/definitions/gnosis.js +4 -1
- package/_esm/chains/definitions/gnosis.js.map +1 -1
- package/_esm/chains/definitions/gnosisChiado.js +10 -1
- package/_esm/chains/definitions/gnosisChiado.js.map +1 -1
- package/_esm/chains/definitions/kava.js +26 -0
- package/_esm/chains/definitions/kava.js.map +1 -0
- package/_esm/chains/definitions/kavaTestnet.js +29 -0
- package/_esm/chains/definitions/kavaTestnet.js.map +1 -0
- package/_esm/chains/definitions/neonDevnet.js +1 -1
- package/_esm/chains/definitions/neonDevnet.js.map +1 -1
- package/_esm/chains/definitions/neonMainnet.js +24 -0
- package/_esm/chains/definitions/neonMainnet.js.map +1 -0
- package/_esm/chains/definitions/scrollSepolia.js +0 -1
- package/_esm/chains/definitions/scrollSepolia.js.map +1 -1
- package/_esm/chains/definitions/tenet.js +20 -0
- package/_esm/chains/definitions/tenet.js.map +1 -0
- package/_esm/chains/index.js +5 -0
- package/_esm/chains/index.js.map +1 -1
- package/_esm/chains/zksync/formatters.js +6 -2
- package/_esm/chains/zksync/formatters.js.map +1 -1
- package/_esm/errors/contract.js +1 -1
- package/_esm/errors/contract.js.map +1 -1
- package/_esm/errors/encoding.js +0 -36
- package/_esm/errors/encoding.js.map +1 -1
- package/_esm/errors/estimateGas.js +1 -1
- package/_esm/errors/estimateGas.js.map +1 -1
- package/_esm/errors/node.js +11 -22
- package/_esm/errors/node.js.map +1 -1
- package/_esm/errors/rpc.js +18 -36
- package/_esm/errors/rpc.js.map +1 -1
- package/_esm/errors/transaction.js +1 -1
- package/_esm/errors/transaction.js.map +1 -1
- package/_esm/errors/version.js +1 -1
- package/_esm/index.js +2 -4
- package/_esm/index.js.map +1 -1
- package/_esm/utils/hash/getFunctionSignature.js +9 -9
- package/_esm/utils/hash/getFunctionSignature.js.map +1 -1
- package/_esm/utils/hash/normalizeSignature.js +51 -0
- package/_esm/utils/hash/normalizeSignature.js.map +1 -0
- package/_esm/utils/index.js +1 -7
- package/_esm/utils/index.js.map +1 -1
- package/_esm/utils/transaction/serializeTransaction.js +17 -5
- package/_esm/utils/transaction/serializeTransaction.js.map +1 -1
- package/_types/actions/index.d.ts +1 -5
- package/_types/actions/index.d.ts.map +1 -1
- package/_types/actions/public/getBlockNumber.d.ts +1 -3
- package/_types/actions/public/getBlockNumber.d.ts.map +1 -1
- package/_types/actions/public/watchContractEvent.d.ts.map +1 -1
- package/_types/chains/celo/formatters.d.ts +6 -6
- package/_types/chains/celo/formatters.d.ts.map +1 -1
- package/_types/chains/celo/serializers.d.ts +3 -2
- package/_types/chains/celo/serializers.d.ts.map +1 -1
- package/_types/chains/celo/types.d.ts +13 -9
- package/_types/chains/celo/types.d.ts.map +1 -1
- package/_types/chains/celo/utils.d.ts +7 -0
- package/_types/chains/celo/utils.d.ts.map +1 -0
- package/_types/chains/definitions/astar.d.ts +36 -0
- package/_types/chains/definitions/astar.d.ts.map +1 -0
- package/_types/chains/definitions/celo.d.ts +7 -7
- package/_types/chains/definitions/celoAlfajores.d.ts +7 -7
- package/_types/chains/definitions/celoCannoli.d.ts +7 -7
- package/_types/chains/definitions/gnosis.d.ts +1 -0
- package/_types/chains/definitions/gnosis.d.ts.map +1 -1
- package/_types/chains/definitions/gnosisChiado.d.ts +7 -8
- package/_types/chains/definitions/gnosisChiado.d.ts.map +1 -1
- package/_types/chains/definitions/kava.d.ts +36 -0
- package/_types/chains/definitions/kava.d.ts.map +1 -0
- package/_types/chains/definitions/kavaTestnet.d.ts +36 -0
- package/_types/chains/definitions/kavaTestnet.d.ts.map +1 -0
- package/_types/chains/definitions/neonDevnet.d.ts +1 -1
- package/_types/chains/definitions/neonMainnet.d.ts +31 -0
- package/_types/chains/definitions/neonMainnet.d.ts.map +1 -0
- package/_types/chains/definitions/scrollSepolia.d.ts +0 -1
- package/_types/chains/definitions/scrollSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/tenet.d.ts +38 -0
- package/_types/chains/definitions/tenet.d.ts.map +1 -0
- package/_types/chains/index.d.ts +5 -0
- package/_types/chains/index.d.ts.map +1 -1
- package/_types/chains/zksync/formatters.d.ts.map +1 -1
- package/_types/chains/zksync/types.d.ts +7 -7
- package/_types/chains/zksync/types.d.ts.map +1 -1
- package/_types/errors/encoding.d.ts +0 -33
- package/_types/errors/encoding.d.ts.map +1 -1
- package/_types/errors/version.d.ts +1 -1
- package/_types/index.d.ts +5 -25
- package/_types/index.d.ts.map +1 -1
- package/_types/types/contract.d.ts +5 -6
- package/_types/types/contract.d.ts.map +1 -1
- package/_types/utils/hash/getFunctionSignature.d.ts +4 -5
- package/_types/utils/hash/getFunctionSignature.d.ts.map +1 -1
- package/_types/utils/hash/normalizeSignature.d.ts +6 -0
- package/_types/utils/hash/normalizeSignature.d.ts.map +1 -0
- package/_types/utils/index.d.ts +1 -7
- package/_types/utils/index.d.ts.map +1 -1
- package/actions/index.ts +0 -4
- package/actions/public/getBlockNumber.ts +2 -4
- package/actions/public/watchContractEvent.ts +2 -1
- package/chains/celo/formatters.ts +24 -37
- package/chains/celo/serializers.ts +23 -59
- package/chains/celo/types.ts +30 -21
- package/chains/celo/utils.ts +68 -0
- package/chains/definitions/astar.ts +26 -0
- package/chains/definitions/gnosis.ts +4 -1
- package/chains/definitions/gnosisChiado.ts +10 -1
- package/chains/definitions/kava.ts +26 -0
- package/chains/definitions/kavaTestnet.ts +29 -0
- package/chains/definitions/neonDevnet.ts +1 -1
- package/chains/definitions/neonMainnet.ts +24 -0
- package/chains/definitions/scrollSepolia.ts +0 -1
- package/chains/definitions/tenet.ts +20 -0
- package/chains/index.ts +5 -0
- package/chains/zksync/formatters.ts +6 -2
- package/chains/zksync/types.ts +7 -7
- package/errors/contract.ts +1 -1
- package/errors/encoding.ts +0 -43
- package/errors/estimateGas.ts +1 -1
- package/errors/transaction.ts +1 -1
- package/errors/version.ts +1 -1
- package/index.ts +0 -26
- package/package.json +2 -1
- package/types/contract.ts +2 -20
- package/utils/hash/getFunctionSignature.ts +11 -21
- package/utils/hash/normalizeSignature.ts +64 -0
- package/utils/index.ts +0 -15
- package/utils/transaction/serializeTransaction.ts +17 -4
- package/_cjs/utils/contract/extractFunctionParts.js +0 -31
- package/_cjs/utils/contract/extractFunctionParts.js.map +0 -1
- package/_esm/utils/contract/extractFunctionParts.js +0 -24
- package/_esm/utils/contract/extractFunctionParts.js.map +0 -1
- package/_types/utils/contract/extractFunctionParts.d.ts +0 -18
- package/_types/utils/contract/extractFunctionParts.d.ts.map +0 -1
- package/utils/contract/extractFunctionParts.ts +0 -37
@@ -73,11 +73,20 @@ function serializeTransactionLegacy(transaction, signature) {
|
|
73
73
|
data ?? '0x',
|
74
74
|
];
|
75
75
|
if (signature) {
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
76
|
+
const v = (() => {
|
77
|
+
if (chainId > 0)
|
78
|
+
return BigInt(chainId * 2) + BigInt(35n + signature.v - 27n);
|
79
|
+
if (signature.v >= 35n) {
|
80
|
+
const inferredChainId = (signature.v - 35n) / 2n;
|
81
|
+
if (inferredChainId > 0)
|
82
|
+
return signature.v;
|
83
|
+
return 27n + (signature.v === 35n ? 0n : 1n);
|
84
|
+
}
|
85
|
+
const v = 27n + (signature.v === 27n ? 0n : 1n);
|
86
|
+
if (signature.v !== v)
|
87
|
+
throw new transaction_js_1.InvalidLegacyVError({ v: signature.v });
|
88
|
+
return v;
|
89
|
+
})();
|
81
90
|
serializedTransaction = [
|
82
91
|
...serializedTransaction,
|
83
92
|
(0, toHex_js_1.toHex)(v),
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"serializeTransaction.js","sourceRoot":"","sources":["../../../utils/transaction/serializeTransaction.ts"],"names":[],"mappings":";;;AAAA,gEAGoC;AAcpC,iDAAsE;AACtE,6CAAsC;AACtC,mDAAiE;AACjE,mDAAiE;AAEjE,iEAO+B;AAC/B,mEAIgC;AAChC,qEAGiC;AAkBjC,SAAgB,oBAAoB,CAGlC,WAAqC,EACrC,SAAqB;IAErB,MAAM,IAAI,GAAG,IAAA,0CAAkB,EAAC,WAAW,CAAuB,CAAA;IAElE,IAAI,IAAI,KAAK,SAAS;QACpB,OAAO,2BAA2B,CAChC,WAA6C,EAC7C,SAAS,CACmD,CAAA;IAEhE,IAAI,IAAI,KAAK,SAAS;QACpB,OAAO,2BAA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C,CAAC;AASD,SAAS,0BAA0B,CACjC,WAA0C,EAC1C,SAAqB;IAErB,MAAM,EAAE,OAAO,GAAG,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,WAAW,CAAA;IAE1E,IAAA,8CAAuB,EAAC,WAAW,CAAC,CAAA;IAEpC,IAAI,qBAAqB,GAAG;QAC1B,KAAK,CAAC,CAAC,CAAC,IAAA,gBAAK,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI;QAC3B,QAAQ,CAAC,CAAC,CAAC,IAAA,gBAAK,EAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI;QACjC,GAAG,CAAC,CAAC,CAAC,IAAA,gBAAK,EAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI;QACvB,EAAE,IAAI,IAAI;QACV,KAAK,CAAC,CAAC,CAAC,IAAA,gBAAK,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI;QAC3B,IAAI,IAAI,IAAI;KACb,CAAA;IAED,IAAI,SAAS,EAAE;QACb,
|
1
|
+
{"version":3,"file":"serializeTransaction.js","sourceRoot":"","sources":["../../../utils/transaction/serializeTransaction.ts"],"names":[],"mappings":";;;AAAA,gEAGoC;AAcpC,iDAAsE;AACtE,6CAAsC;AACtC,mDAAiE;AACjE,mDAAiE;AAEjE,iEAO+B;AAC/B,mEAIgC;AAChC,qEAGiC;AAkBjC,SAAgB,oBAAoB,CAGlC,WAAqC,EACrC,SAAqB;IAErB,MAAM,IAAI,GAAG,IAAA,0CAAkB,EAAC,WAAW,CAAuB,CAAA;IAElE,IAAI,IAAI,KAAK,SAAS;QACpB,OAAO,2BAA2B,CAChC,WAA6C,EAC7C,SAAS,CACmD,CAAA;IAEhE,IAAI,IAAI,KAAK,SAAS;QACpB,OAAO,2BAA2B,CAChC,WAA6C,EAC7C,SAAS,CACmD,CAAA;IAEhE,OAAO,0BAA0B,CAC/B,W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CAAA;AACrE,OAAO,EAIL,WAAW,GACZ,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAIL,aAAa,GACd,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAIL,gBAAgB,GACjB,MAAM,8BAA8B,CAAA;AACrC,OAAO,EAGL,wBAAwB,GACzB,MAAM,oCAAoC,CAAA;AAC3C,OAAO,EAGL,WAAW,GACZ,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAIL,eAAe,GAChB,MAAM,6BAA6B,CAAA;AACpC,OAAO,EAIL,UAAU,GACX,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAIL,aAAa,GACd,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAIL,eAAe,GAChB,MAAM,6BAA6B,CAAA;AACpC,OAAO,EAIL,UAAU,GACX,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAIL,kBAAkB,GACnB,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAIL,aAAa,GACd,MAAM,2BAA2B,CAAA"}
|
@@ -26,10 +26,10 @@ export function getBlockNumberCache(id) {
|
|
26
26
|
* const blockNumber = await getBlockNumber(client)
|
27
27
|
* // 69420n
|
28
28
|
*/
|
29
|
-
export async function getBlockNumber(client, { cacheTime = client.cacheTime
|
29
|
+
export async function getBlockNumber(client, { cacheTime = client.cacheTime } = {}) {
|
30
30
|
const blockNumberHex = await withCache(() => client.request({
|
31
31
|
method: 'eth_blockNumber',
|
32
|
-
}), { cacheKey: cacheKey(client.uid), cacheTime
|
32
|
+
}), { cacheKey: cacheKey(client.uid), cacheTime });
|
33
33
|
return BigInt(blockNumberHex);
|
34
34
|
}
|
35
35
|
//# sourceMappingURL=getBlockNumber.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getBlockNumber.js","sourceRoot":"","sources":["../../../actions/public/getBlockNumber.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAA;
|
1
|
+
{"version":3,"file":"getBlockNumber.js","sourceRoot":"","sources":["../../../actions/public/getBlockNumber.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAA;AAWtE,MAAM,QAAQ,GAAG,CAAC,EAAU,EAAE,EAAE,CAAC,eAAe,EAAE,EAAE,CAAA;AAEpD,MAAM,UAAU,mBAAmB,CAAC,EAAU;IAC5C,OAAO,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAA;AAC/B,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,MAAiC,EACjC,EAAE,SAAS,GAAG,MAAM,CAAC,SAAS,KAA+B,EAAE;IAE/D,MAAM,cAAc,GAAG,MAAM,SAAS,CACpC,GAAG,EAAE,CACH,MAAM,CAAC,OAAO,CAAC;QACb,MAAM,EAAE,iBAAiB;KAC1B,CAAC,EACJ,EAAE,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,SAAS,EAAE,CAC9C,CAAA;IACD,OAAO,MAAM,CAAC,cAAc,CAAC,CAAA;AAC/B,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"watchContractEvent.js","sourceRoot":"","sources":["../../../actions/public/watchContractEvent.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAQ1D,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAA;AAClE,OAAO,EAEL,iBAAiB,GAClB,MAAM,sCAAsC,CAAA;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAA;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAyB,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAC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,CAAA;YAEvB,MAAM,OAAO,GAAG,IAAI,CAClB,KAAK,IAAI,EAAE;gBACT,IAAI,CAAC,WAAW,EAAE;oBAChB,IAAI;wBACF,MAAM,GAAG,CAAC,MAAM,SAAS,CACvB,MAAM,EACN,yBAAyB,CAC1B,CAAC;4BACA,GAAG;4BACH,OAAO;4BACP,IAAI,EAAE,IAAW;4BACjB,SAAS,EAAE,SAAgB;4BAC3B,MAAM,EAAE,MAAa;yBACtB,CAAC,CAAoC,CAAA;qBACvC;oBAAC,MAAM,GAAE;oBACV,WAAW,GAAG,IAAI,CAAA;oBAClB,OAAM;iBACP;gBAED,IAAI;oBACF,IAAI,IAAW,CAAA;oBACf,IAAI,MAAM,EAAE;wBACV,IAAI,GAAG,MAAM,SAAS,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAA;qBAC7D;yBAAM;wBACL,mEAAmE;wBACnE,0EAA0E;wBAE1E,+CAA+C;wBAC/C,MAAM,WAAW,GAAG,MAAM,SAAS,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,EAAE,CAAC,CAAA;wBAE/D,mEAAmE;wBACnE,kFAAkF;wBAClF,2BAA2B;wBAC3B,IAAI,mBAAmB,IAAI,mBAAmB,KAAK,WAAW,EAAE;4BAC9D,IAAI,GAAG,MAAM,SAAS,CACpB,MAAM,EACN,iBAAiB,CAClB,CAAC;gCACA,GAAG;gCACH,OAAO;gCACP,IAAI,
|
1
|
+
{"version":3,"file":"watchContractEvent.js","sourceRoot":"","sources":["../../../actions/public/watchContractEvent.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAQ1D,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAA;AAClE,OAAO,EAEL,iBAAiB,GAClB,MAAM,sCAAsC,CAAA;AAC7C,OAA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oBACD,OAAO,CAAC,KAAY;wBAClB,OAAO,EAAE,CAAC,KAAK,CAAC,CAAA;oBAClB,CAAC;iBACF,CAAC,CAAA;gBACF,WAAW,GAAG,YAAY,CAAA;gBAC1B,IAAI,CAAC,MAAM;oBAAE,WAAW,EAAE,CAAA;aAC3B;YAAC,OAAO,GAAG,EAAE;gBACZ,OAAO,EAAE,CAAC,GAAY,CAAC,CAAA;aACxB;QACH,CAAC,CAAC,EAAE,CAAA;QACJ,OAAO,WAAW,CAAA;IACpB,CAAC,CAAA;IAED,OAAO,aAAa,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAC,CAAC,CAAC,sBAAsB,EAAE,CAAA;AACvE,CAAC"}
|
@@ -5,22 +5,7 @@ import { defineBlock } from '../../utils/formatters/block.js';
|
|
5
5
|
import { defineTransaction, formatTransaction, } from '../../utils/formatters/transaction.js';
|
6
6
|
import { defineTransactionReceipt } from '../../utils/formatters/transactionReceipt.js';
|
7
7
|
import { defineTransactionRequest } from '../../utils/formatters/transactionRequest.js';
|
8
|
-
|
9
|
-
if (args.type === 'cip64')
|
10
|
-
return true;
|
11
|
-
if (args.type)
|
12
|
-
return false;
|
13
|
-
return ('feeCurrency' in args &&
|
14
|
-
args.gatewayFee === undefined &&
|
15
|
-
args.gatewayFeeRecipient === undefined);
|
16
|
-
}
|
17
|
-
function isTransactionRequestCIP42(args) {
|
18
|
-
if (args.type === 'cip42')
|
19
|
-
return true;
|
20
|
-
if (args.type)
|
21
|
-
return false;
|
22
|
-
return args.gatewayFee !== undefined || args.gatewayFeeRecipient !== undefined;
|
23
|
-
}
|
8
|
+
import { isCIP42, isCIP64 } from './utils.js';
|
24
9
|
export const formattersCelo = {
|
25
10
|
block: /*#__PURE__*/ defineBlock({
|
26
11
|
exclude: ['difficulty', 'gasLimit', 'mixHash', 'nonce', 'uncles'],
|
@@ -49,15 +34,18 @@ export const formattersCelo = {
|
|
49
34
|
}),
|
50
35
|
transaction: /*#__PURE__*/ defineTransaction({
|
51
36
|
format(args) {
|
37
|
+
const transaction = { feeCurrency: args.feeCurrency };
|
52
38
|
if (args.type === '0x7b')
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
39
|
+
transaction.type = 'cip64';
|
40
|
+
else {
|
41
|
+
if (args.type === '0x7c')
|
42
|
+
transaction.type = 'cip42';
|
43
|
+
transaction.gatewayFee = args.gatewayFee
|
44
|
+
? hexToBigInt(args.gatewayFee)
|
45
|
+
: null;
|
46
|
+
transaction.gatewayFeeRecipient = args.gatewayFeeRecipient;
|
47
|
+
}
|
48
|
+
return transaction;
|
61
49
|
},
|
62
50
|
}),
|
63
51
|
transactionReceipt: /*#__PURE__*/ defineTransactionReceipt({
|
@@ -71,20 +59,20 @@ export const formattersCelo = {
|
|
71
59
|
}),
|
72
60
|
transactionRequest: /*#__PURE__*/ defineTransactionRequest({
|
73
61
|
format(args) {
|
74
|
-
if (isTransactionRequestCIP64(args))
|
75
|
-
return {
|
76
|
-
type: '0x7b',
|
77
|
-
feeCurrency: args.feeCurrency,
|
78
|
-
};
|
79
62
|
const request = {
|
80
63
|
feeCurrency: args.feeCurrency,
|
81
|
-
gatewayFee: typeof args.gatewayFee !== 'undefined'
|
82
|
-
? numberToHex(args.gatewayFee)
|
83
|
-
: undefined,
|
84
|
-
gatewayFeeRecipient: args.gatewayFeeRecipient,
|
85
64
|
};
|
86
|
-
if (
|
87
|
-
request.type = '
|
65
|
+
if (isCIP64(args))
|
66
|
+
request.type = '0x7b';
|
67
|
+
else {
|
68
|
+
if (isCIP42(args))
|
69
|
+
request.type = '0x7c';
|
70
|
+
request.gatewayFee =
|
71
|
+
typeof args.gatewayFee !== 'undefined'
|
72
|
+
? numberToHex(args.gatewayFee)
|
73
|
+
: undefined;
|
74
|
+
request.gatewayFeeRecipient = args.gatewayFeeRecipient;
|
75
|
+
}
|
88
76
|
return request;
|
89
77
|
},
|
90
78
|
}),
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"formatters.js","sourceRoot":"","sources":["../../../chains/celo/formatters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,MAAM,sBAAsB,CAAA;AAG3D,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAA;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAA;AAC7D,OAAO,EACL,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,uCAAuC,CAAA;AAC9C,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAA;AACvF,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAA;
|
1
|
+
{"version":3,"file":"formatters.js","sourceRoot":"","sources":["../../../chains/celo/formatters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,MAAM,sBAAsB,CAAA;AAG3D,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAA;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAA;AAC7D,OAAO,EACL,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,uCAAuC,CAAA;AAC9C,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAA;AACvF,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAA;AAUvF,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAE7C,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,KAAK,EAAE,aAAa,CAAC,WAAW,CAAC;QAC/B,OAAO,EAAE,CAAC,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,CAAC;QACjE,MAAM,CACJ,IAEC;YAID,MAAM,YAAY,GAAG,IAAI,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE;g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,EAAE,IAAI,CAAC,WAAW;gBAC7B,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI;gBACjE,mBAAmB,EAAE,IAAI,CAAC,mBAAmB;aAC9C,CAAA;QACH,CAAC;KACF,CAAC;IAEF,kBAAkB,EAAE,aAAa,CAAC,wBAAwB,CAAC;QACzD,MAAM,CAAC,IAA4B;YACjC,MAAM,OAAO,GAAG;gBACd,WAAW,EAAE,IAAI,CAAC,WAAW;aACD,CAAA;YAE9B,IAAI,OAAO,CAAC,IAAI,CAAC;gBAAE,OAAO,CAAC,IAAI,GAAG,MAAM,CAAA;iBACnC;gBACH,IAAI,OAAO,CAAC,IAAI,CAAC;oBAAE,OAAO,CAAC,IAAI,GAAG,MAAM,CAAA;gBAExC,OAAO,CAAC,UAAU;oBAChB,OAAO,IAAI,CAAC,UAAU,KAAK,WAAW;wBACpC,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC;wBAC9B,CAAC,CAAC,SAAS,CAAA;gBACf,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC,mBAAmB,CAAA;aACvD;YAED,OAAO,OAAO,CAAA;QAChB,CAAC;KACF,CAAC;CACgC,CAAA"}
|
@@ -9,6 +9,7 @@ import { toHex } from '../../utils/encoding/toHex.js';
|
|
9
9
|
import { toRlp } from '../../utils/encoding/toRlp.js';
|
10
10
|
import { serializeAccessList } from '../../utils/transaction/serializeAccessList.js';
|
11
11
|
import { serializeTransaction, } from '../../utils/transaction/serializeTransaction.js';
|
12
|
+
import { isCIP42, isCIP64, isEmpty, isPresent } from './utils.js';
|
12
13
|
export const serializeTransactionCelo = (tx, signature) => {
|
13
14
|
if (isCIP64(tx)) {
|
14
15
|
return serializeTransactionCIP64(tx, signature);
|
@@ -65,7 +66,7 @@ function serializeTransactionCIP64(transaction, signature) {
|
|
65
66
|
value ? toHex(value) : '0x',
|
66
67
|
data ?? '0x',
|
67
68
|
serializeAccessList(accessList),
|
68
|
-
feeCurrency
|
69
|
+
feeCurrency,
|
69
70
|
];
|
70
71
|
if (signature) {
|
71
72
|
serializedTransaction.push(signature.v === 27n ? '0x' : toHex(1), // yParity
|
@@ -76,37 +77,8 @@ function serializeTransactionCIP64(transaction, signature) {
|
|
76
77
|
toRlp(serializedTransaction),
|
77
78
|
]);
|
78
79
|
}
|
79
|
-
|
80
|
-
|
81
|
-
// process as CIP42 if any of these fields are present. realistically gatewayfee is not used but is part of spec
|
82
|
-
function isCIP42(transaction) {
|
83
|
-
if (transaction.type === 'cip42')
|
84
|
-
return true;
|
85
|
-
// if the type is defined as anything else, assume it is *not* cip42
|
86
|
-
if (transaction.type)
|
87
|
-
return false;
|
88
|
-
// if the type is undefined, check if the fields match the expectations for cip42
|
89
|
-
return ('maxFeePerGas' in transaction &&
|
90
|
-
'maxPriorityFeePerGas' in transaction &&
|
91
|
-
('feeCurrency' in transaction ||
|
92
|
-
'gatewayFee' in transaction ||
|
93
|
-
'gatewayFeeRecipient' in transaction));
|
94
|
-
}
|
95
|
-
function isCIP64(transaction) {
|
96
|
-
if (transaction.type === 'cip64')
|
97
|
-
return true;
|
98
|
-
// if the type is defined as anything else, assume it is *not* cip64
|
99
|
-
if (transaction.type)
|
100
|
-
return false;
|
101
|
-
// if the type is undefined, check if the fields match the expectations for cip64
|
102
|
-
return ('maxFeePerGas' in transaction &&
|
103
|
-
'maxPriorityFeePerGas' in transaction &&
|
104
|
-
'feeCurrency' in transaction &&
|
105
|
-
!('gatewayFee' in transaction) &&
|
106
|
-
!('gatewayFeeRecipient' in transaction));
|
107
|
-
}
|
108
|
-
// maxFeePerGas must be less than 2^256 - 1: however writing like that caused exceptions to be raised
|
109
|
-
const MAX_MAX_FEE_PER_GAS = 115792089237316195423570985008687907853269984665640564039457584007913129639935n;
|
80
|
+
// maxFeePerGas must be less than 2^256 - 1
|
81
|
+
const MAX_MAX_FEE_PER_GAS = 2n ** 256n - 1n;
|
110
82
|
export function assertTransactionCIP42(transaction) {
|
111
83
|
const { chainId, maxPriorityFeePerGas, gasPrice, maxFeePerGas, to, feeCurrency, gatewayFee, gatewayFeeRecipient, } = transaction;
|
112
84
|
if (chainId <= 0)
|
@@ -115,20 +87,23 @@ export function assertTransactionCIP42(transaction) {
|
|
115
87
|
throw new InvalidAddressError({ address: to });
|
116
88
|
if (gasPrice)
|
117
89
|
throw new BaseError('`gasPrice` is not a valid CIP-42 Transaction attribute.');
|
118
|
-
if (maxFeePerGas && maxFeePerGas > MAX_MAX_FEE_PER_GAS)
|
90
|
+
if (isPresent(maxFeePerGas) && maxFeePerGas > MAX_MAX_FEE_PER_GAS)
|
119
91
|
throw new FeeCapTooHighError({ maxFeePerGas });
|
120
|
-
if (maxPriorityFeePerGas &&
|
121
|
-
maxFeePerGas &&
|
92
|
+
if (isPresent(maxPriorityFeePerGas) &&
|
93
|
+
isPresent(maxFeePerGas) &&
|
122
94
|
maxPriorityFeePerGas > maxFeePerGas)
|
123
95
|
throw new TipAboveFeeCapError({ maxFeePerGas, maxPriorityFeePerGas });
|
124
|
-
if ((gatewayFee &&
|
125
|
-
(gatewayFeeRecipient &&
|
96
|
+
if ((isPresent(gatewayFee) && isEmpty(gatewayFeeRecipient)) ||
|
97
|
+
(isPresent(gatewayFeeRecipient) && isEmpty(gatewayFee))) {
|
126
98
|
throw new BaseError('`gatewayFee` and `gatewayFeeRecipient` must be provided together.');
|
127
99
|
}
|
128
|
-
if (feeCurrency && !feeCurrency
|
100
|
+
if (isPresent(feeCurrency) && !isAddress(feeCurrency)) {
|
129
101
|
throw new BaseError('`feeCurrency` MUST be a token address for CIP-42 transactions.');
|
130
102
|
}
|
131
|
-
if (
|
103
|
+
if (isPresent(gatewayFeeRecipient) && !isAddress(gatewayFeeRecipient)) {
|
104
|
+
throw new InvalidAddressError(gatewayFeeRecipient);
|
105
|
+
}
|
106
|
+
if (isEmpty(feeCurrency) && isEmpty(gatewayFeeRecipient)) {
|
132
107
|
throw new BaseError('Either `feeCurrency` or `gatewayFeeRecipient` must be provided for CIP-42 transactions.');
|
133
108
|
}
|
134
109
|
}
|
@@ -140,16 +115,16 @@ export function assertTransactionCIP64(transaction) {
|
|
140
115
|
throw new InvalidAddressError({ address: to });
|
141
116
|
if (gasPrice)
|
142
117
|
throw new BaseError('`gasPrice` is not a valid CIP-64 Transaction attribute.');
|
143
|
-
if (maxFeePerGas && maxFeePerGas > MAX_MAX_FEE_PER_GAS)
|
118
|
+
if (isPresent(maxFeePerGas) && maxFeePerGas > MAX_MAX_FEE_PER_GAS)
|
144
119
|
throw new FeeCapTooHighError({ maxFeePerGas });
|
145
|
-
if (maxPriorityFeePerGas &&
|
146
|
-
maxFeePerGas &&
|
120
|
+
if (isPresent(maxPriorityFeePerGas) &&
|
121
|
+
isPresent(maxFeePerGas) &&
|
147
122
|
maxPriorityFeePerGas > maxFeePerGas)
|
148
123
|
throw new TipAboveFeeCapError({ maxFeePerGas, maxPriorityFeePerGas });
|
149
|
-
if (feeCurrency && !feeCurrency?.startsWith('0x')) {
|
124
|
+
if (isPresent(feeCurrency) && !feeCurrency?.startsWith('0x')) {
|
150
125
|
throw new BaseError('`feeCurrency` MUST be a token address for CIP-64 transactions.');
|
151
126
|
}
|
152
|
-
if (
|
127
|
+
if (isEmpty(feeCurrency)) {
|
153
128
|
throw new BaseError('`feeCurrency` must be provided for CIP-64 transactions.');
|
154
129
|
}
|
155
130
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"serializers.js","sourceRoot":"","sources":["../../../chains/celo/serializers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAI9E,O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B,oBAAoB,GAAG,YAAY;QAEnC,MAAM,IAAI,mBAAmB,CAAC,EAAE,YAAY,EAAE,oBAAoB,EAAE,CAAC,CAAA;IAEvE,IAAI,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,IAAI,CAAC,EAAE;QAC5D,MAAM,IAAI,SAAS,CACjB,gEAAgE,CACjE,CAAA;KACF;IAED,IAAI,OAAO,CAAC,WAAW,CAAC,EAAE;QACxB,MAAM,IAAI,SAAS,CACjB,yDAAyD,CAC1D,CAAA;KACF;AACH,CAAC"}
|
@@ -0,0 +1,39 @@
|
|
1
|
+
import { trim } from '../../utils/data/trim.js';
|
2
|
+
export function isEmpty(value) {
|
3
|
+
return (value === 0 ||
|
4
|
+
value === 0n ||
|
5
|
+
value === undefined ||
|
6
|
+
value === null ||
|
7
|
+
value === '0' ||
|
8
|
+
value === '' ||
|
9
|
+
(typeof value === 'string' &&
|
10
|
+
(trim(value).toLowerCase() === '0x' ||
|
11
|
+
trim(value).toLowerCase() === '0x00')));
|
12
|
+
}
|
13
|
+
export function isPresent(value) {
|
14
|
+
return !isEmpty(value);
|
15
|
+
}
|
16
|
+
export function isEIP1559(transaction) {
|
17
|
+
return (isPresent(transaction.maxFeePerGas) &&
|
18
|
+
isPresent(transaction.maxPriorityFeePerGas));
|
19
|
+
}
|
20
|
+
// process as CIP42 if any of these fields are present. realistically gatewayfee is not used but is part of spec
|
21
|
+
export function isCIP42(transaction) {
|
22
|
+
// Enable end-user to force the tx to be considered as a cip42
|
23
|
+
if (transaction.type)
|
24
|
+
return transaction.type === 'cip42';
|
25
|
+
return (isEIP1559(transaction) &&
|
26
|
+
(isPresent(transaction.feeCurrency) ||
|
27
|
+
isPresent(transaction.gatewayFeeRecipient) ||
|
28
|
+
isPresent(transaction.gatewayFee)));
|
29
|
+
}
|
30
|
+
export function isCIP64(transaction) {
|
31
|
+
// Enable end-user to force the tx to be considered as a cip64
|
32
|
+
if (transaction.type)
|
33
|
+
return transaction.type === 'cip64';
|
34
|
+
return (isEIP1559(transaction) &&
|
35
|
+
isPresent(transaction.feeCurrency) &&
|
36
|
+
isEmpty(transaction.gatewayFee) &&
|
37
|
+
isEmpty(transaction.gatewayFeeRecipient));
|
38
|
+
}
|
39
|
+
//# sourceMappingURL=utils.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../chains/celo/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAA;AAQ/C,MAAM,UAAU,OAAO,CACrB,KAA2C;IAE3C,OAAO,CACL,KAAK,KAAK,CAAC;QACX,KAAK,KAAK,EAAE;QACZ,KAAK,KAAK,SAAS;QACnB,KAAK,KAAK,IAAI;QACd,KAAK,KAAK,GAAG;QACb,KAAK,KAAK,EAAE;QACZ,CAAC,OAAO,KAAK,KAAK,QAAQ;YACxB,CAAC,IAAI,CAAC,KAAgB,CAAC,CAAC,WAAW,EAAE,KAAK,IAAI;gBAC5C,IAAI,CAAC,KAAgB,CAAC,CAAC,WAAW,EAAE,KAAK,MAAM,CAAC,CAAC,CACtD,CAAA;AACH,CAAC;AAED,MAAM,UAAU,SAAS,CACvB,KAA2C;IAE3C,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;AACxB,CAAC;AAED,MAAM,UAAU,SAAS,CACvB,WAAiE;IAEjE,OAAO,CACL,SAAS,CAAC,WAAW,CAAC,YAAY,CAAC;QACnC,SAAS,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAC5C,CAAA;AACH,CAAC;AAED,gHAAgH;AAChH,MAAM,UAAU,OAAO,CACrB,WAAiE;IAEjE,8DAA8D;IAC9D,IAAI,WAAW,CAAC,IAAI;QAAE,OAAO,WAAW,CAAC,IAAI,KAAK,OAAO,CAAA;IAEzD,OAAO,CACL,SAAS,CAAC,WAAW,CAAC;QACtB,CAAC,SAAS,CAAC,WAAW,CAAC,WAAW,CAAC;YACjC,SAAS,CAAC,WAAW,CAAC,mBAAmB,CAAC;YAC1C,SAAS,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC,CACrC,CAAA;AACH,CAAC;AAED,MAAM,UAAU,OAAO,CACrB,WAAiE;IAEjE,8DAA8D;IAC9D,IAAI,WAAW,CAAC,IAAI;QAAE,OAAO,WAAW,CAAC,IAAI,KAAK,OAAO,CAAA;IAEzD,OAAO,CACL,SAAS,CAAC,WAAW,CAAC;QACtB,SAAS,CAAC,WAAW,CAAC,WAAW,CAAC;QAClC,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC;QAC/B,OAAO,CAAC,WAAW,CAAC,mBAAmB,CAAC,CACzC,CAAA;AACH,CAAC"}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import { defineChain } from '../../utils/chain/defineChain.js';
|
2
|
+
export const astar = /*#__PURE__*/ defineChain({
|
3
|
+
id: 592,
|
4
|
+
name: 'Astar',
|
5
|
+
network: 'astar-mainnet',
|
6
|
+
nativeCurrency: {
|
7
|
+
name: 'Astar',
|
8
|
+
symbol: 'ASTR',
|
9
|
+
decimals: 18,
|
10
|
+
},
|
11
|
+
rpcUrls: {
|
12
|
+
public: { http: ['https://astar.api.onfinality.io/public'] },
|
13
|
+
default: { http: ['https://astar.api.onfinality.io/public'] },
|
14
|
+
},
|
15
|
+
blockExplorers: {
|
16
|
+
default: { name: 'Astar Subscan', url: 'https://astar.subscan.io' },
|
17
|
+
},
|
18
|
+
contracts: {
|
19
|
+
multicall3: {
|
20
|
+
address: '0xca11bde05977b3631167028862be2a173976ca11',
|
21
|
+
blockCreated: 761794,
|
22
|
+
},
|
23
|
+
},
|
24
|
+
testnet: false,
|
25
|
+
});
|
26
|
+
//# sourceMappingURL=astar.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"astar.js","sourceRoot":"","sources":["../../../chains/definitions/astar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAE9D,MAAM,CAAC,MAAM,KAAK,GAAG,aAAa,CAAC,WAAW,CAAC;IAC7C,EAAE,EAAE,GAAG;IACP,IAAI,EAAE,OAAO;IACb,OAAO,EAAE,eAAe;IACxB,cAAc,EAAE;QACd,IAAI,EAAE,OAAO;QACb,MAAM,EAAE,MAAM;QACd,QAAQ,EAAE,EAAE;KACb;IACD,OAAO,EAAE;QACP,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,wCAAwC,CAAC,EAAE;QAC5D,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,wCAAwC,CAAC,EAAE;KAC9D;IACD,cAAc,EAAE;QACd,OAAO,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,GAAG,EAAE,0BAA0B,EAAE;KACpE;IACD,SAAS,EAAE;QACT,UAAU,EAAE;YACV,OAAO,EAAE,4CAA4C;YACrD,YAAY,EAAE,MAAM;SACrB;KACF;IACD,OAAO,EAAE,KAAK;CACf,CAAC,CAAA"}
|
@@ -8,7 +8,10 @@ export const gnosis = /*#__PURE__*/ defineChain({
|
|
8
8
|
symbol: 'xDAI',
|
9
9
|
},
|
10
10
|
rpcUrls: {
|
11
|
-
default: {
|
11
|
+
default: {
|
12
|
+
http: ['https://rpc.gnosischain.com'],
|
13
|
+
webSocket: ['wss://rpc.gnosischain.com/wss'],
|
14
|
+
},
|
12
15
|
},
|
13
16
|
blockExplorers: {
|
14
17
|
default: {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"gnosis.js","sourceRoot":"","sources":["../../../chains/definitions/gnosis.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAE9D,MAAM,CAAC,MAAM,MAAM,GAAG,aAAa,CAAC,WAAW,CAAC;IAC9C,EAAE,EAAE,GAAG;IACP,IAAI,EAAE,QAAQ;IACd,cAAc,EAAE;QACd,QAAQ,EAAE,EAAE;QACZ,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,MAAM;KACf;IACD,OAAO,EAAE;QACP,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"gnosis.js","sourceRoot":"","sources":["../../../chains/definitions/gnosis.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAE9D,MAAM,CAAC,MAAM,MAAM,GAAG,aAAa,CAAC,WAAW,CAAC;IAC9C,EAAE,EAAE,GAAG;IACP,IAAI,EAAE,QAAQ;IACd,cAAc,EAAE;QACd,QAAQ,EAAE,EAAE;QACZ,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,MAAM;KACf;IACD,OAAO,EAAE;QACP,OAAO,EAAE;YACP,IAAI,EAAE,CAAC,6BAA6B,CAAC;YACrC,SAAS,EAAE,CAAC,+BAA+B,CAAC;SAC7C;KACF;IACD,cAAc,EAAE;QACd,OAAO,EAAE;YACP,IAAI,EAAE,uBAAuB;YAC7B,GAAG,EAAE,qCAAqC;SAC3C;KACF;IACD,SAAS,EAAE;QACT,UAAU,EAAE;YACV,OAAO,EAAE,4CAA4C;YACrD,YAAY,EAAE,QAAQ;SACvB;KACF;CACF,CAAC,CAAA"}
|
@@ -8,7 +8,10 @@ export const gnosisChiado = /*#__PURE__*/ defineChain({
|
|
8
8
|
symbol: 'xDAI',
|
9
9
|
},
|
10
10
|
rpcUrls: {
|
11
|
-
default: {
|
11
|
+
default: {
|
12
|
+
http: ['https://rpc.chiadochain.net'],
|
13
|
+
webSocket: ['wss://rpc.chiadochain.net/wss'],
|
14
|
+
},
|
12
15
|
},
|
13
16
|
blockExplorers: {
|
14
17
|
default: {
|
@@ -16,6 +19,12 @@ export const gnosisChiado = /*#__PURE__*/ defineChain({
|
|
16
19
|
url: 'https://blockscout.chiadochain.net',
|
17
20
|
},
|
18
21
|
},
|
22
|
+
contracts: {
|
23
|
+
multicall3: {
|
24
|
+
address: '0xcA11bde05977b3631167028862bE2a173976CA11',
|
25
|
+
blockCreated: 4967313,
|
26
|
+
},
|
27
|
+
},
|
19
28
|
testnet: true,
|
20
29
|
});
|
21
30
|
//# sourceMappingURL=gnosisChiado.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"gnosisChiado.js","sourceRoot":"","sources":["../../../chains/definitions/gnosisChiado.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAE9D,MAAM,CAAC,MAAM,YAAY,GAAG,aAAa,CAAC,WAAW,CAAC;IACpD,EAAE,EAAE,KAAM;IACV,IAAI,EAAE,eAAe;IACrB,cAAc,EAAE;QACd,QAAQ,EAAE,EAAE;QACZ,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,MAAM;KACf;IACD,OAAO,EAAE;QACP,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"gnosisChiado.js","sourceRoot":"","sources":["../../../chains/definitions/gnosisChiado.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAE9D,MAAM,CAAC,MAAM,YAAY,GAAG,aAAa,CAAC,WAAW,CAAC;IACpD,EAAE,EAAE,KAAM;IACV,IAAI,EAAE,eAAe;IACrB,cAAc,EAAE;QACd,QAAQ,EAAE,EAAE;QACZ,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,MAAM;KACf;IACD,OAAO,EAAE;QACP,OAAO,EAAE;YACP,IAAI,EAAE,CAAC,6BAA6B,CAAC;YACrC,SAAS,EAAE,CAAC,+BAA+B,CAAC;SAC7C;KACF;IACD,cAAc,EAAE;QACd,OAAO,EAAE;YACP,IAAI,EAAE,YAAY;YAClB,GAAG,EAAE,oCAAoC;SAC1C;KACF;IACD,SAAS,EAAE;QACT,UAAU,EAAE;YACV,OAAO,EAAE,4CAA4C;YACrD,YAAY,EAAE,OAAO;SACtB;KACF;IACD,OAAO,EAAE,IAAI;CACd,CAAC,CAAA"}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import { defineChain } from '../../utils/chain/defineChain.js';
|
2
|
+
export const kava = /*#__PURE__*/ defineChain({
|
3
|
+
id: 2222,
|
4
|
+
name: 'Kava EVM',
|
5
|
+
network: 'kava-mainnet',
|
6
|
+
nativeCurrency: {
|
7
|
+
name: 'Kava',
|
8
|
+
symbol: 'KAVA',
|
9
|
+
decimals: 18,
|
10
|
+
},
|
11
|
+
rpcUrls: {
|
12
|
+
public: { http: ['https://evm.kava.io'] },
|
13
|
+
default: { http: ['https://evm.kava.io'] },
|
14
|
+
},
|
15
|
+
blockExplorers: {
|
16
|
+
default: { name: 'Kava EVM Explorer', url: 'https://kavascan.com' },
|
17
|
+
},
|
18
|
+
contracts: {
|
19
|
+
multicall3: {
|
20
|
+
address: '0xca11bde05977b3631167028862be2a173976ca11',
|
21
|
+
blockCreated: 3661165,
|
22
|
+
},
|
23
|
+
},
|
24
|
+
testnet: false,
|
25
|
+
});
|
26
|
+
//# sourceMappingURL=kava.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"kava.js","sourceRoot":"","sources":["../../../chains/definitions/kava.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAE9D,MAAM,CAAC,MAAM,IAAI,GAAG,aAAa,CAAC,WAAW,CAAC;IAC5C,EAAE,EAAE,IAAI;IACR,IAAI,EAAE,UAAU;IAChB,OAAO,EAAE,cAAc;IACvB,cAAc,EAAE;QACd,IAAI,EAAE,MAAM;QACZ,MAAM,EAAE,MAAM;QACd,QAAQ,EAAE,EAAE;KACb;IACD,OAAO,EAAE;QACP,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,qBAAqB,CAAC,EAAE;QACzC,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,qBAAqB,CAAC,EAAE;KAC3C;IACD,cAAc,EAAE;QACd,OAAO,EAAE,EAAE,IAAI,EAAE,mBAAmB,EAAE,GAAG,EAAE,sBAAsB,EAAE;KACpE;IACD,SAAS,EAAE;QACT,UAAU,EAAE;YACV,OAAO,EAAE,4CAA4C;YACrD,YAAY,EAAE,OAAO;SACtB;KACF;IACD,OAAO,EAAE,KAAK;CACf,CAAC,CAAA"}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import { defineChain } from '../../utils/chain/defineChain.js';
|
2
|
+
export const kavaTestnet = /*#__PURE__*/ defineChain({
|
3
|
+
id: 2221,
|
4
|
+
name: 'Kava EVM Testnet',
|
5
|
+
network: 'kava-testnet',
|
6
|
+
nativeCurrency: {
|
7
|
+
name: 'Kava',
|
8
|
+
symbol: 'KAVA',
|
9
|
+
decimals: 18,
|
10
|
+
},
|
11
|
+
rpcUrls: {
|
12
|
+
public: { http: ['https://evm.testnet.kava.io'] },
|
13
|
+
default: { http: ['https://evm.testnet.kava.io'] },
|
14
|
+
},
|
15
|
+
blockExplorers: {
|
16
|
+
default: {
|
17
|
+
name: 'Kava EVM Testnet Explorer',
|
18
|
+
url: 'https://testnet.kavascan.com/',
|
19
|
+
},
|
20
|
+
},
|
21
|
+
contracts: {
|
22
|
+
multicall3: {
|
23
|
+
address: '0xDf1D724A7166261eEB015418fe8c7679BBEa7fd6',
|
24
|
+
blockCreated: 7242179,
|
25
|
+
},
|
26
|
+
},
|
27
|
+
testnet: true,
|
28
|
+
});
|
29
|
+
//# sourceMappingURL=kavaTestnet.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"kavaTestnet.js","sourceRoot":"","sources":["../../../chains/definitions/kavaTestnet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAE9D,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAC,WAAW,CAAC;IACnD,EAAE,EAAE,IAAI;IACR,IAAI,EAAE,kBAAkB;IACxB,OAAO,EAAE,cAAc;IACvB,cAAc,EAAE;QACd,IAAI,EAAE,MAAM;QACZ,MAAM,EAAE,MAAM;QACd,QAAQ,EAAE,EAAE;KACb;IACD,OAAO,EAAE;QACP,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,6BAA6B,CAAC,EAAE;QACjD,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,6BAA6B,CAAC,EAAE;KACnD;IACD,cAAc,EAAE;QACd,OAAO,EAAE;YACP,IAAI,EAAE,2BAA2B;YACjC,GAAG,EAAE,+BAA+B;SACrC;KACF;IACD,SAAS,EAAE;QACT,UAAU,EAAE;YACV,OAAO,EAAE,4CAA4C;YACrD,YAAY,EAAE,OAAO;SACtB;KACF;IACD,OAAO,EAAE,IAAI;CACd,CAAC,CAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"neonDevnet.js","sourceRoot":"","sources":["../../../chains/definitions/neonDevnet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAE9D,MAAM,CAAC,MAAM,UAAU,GAAG,aAAa,CAAC,WAAW,CAAC;IAClD,EAAE,EAAE,SAAW;IACf,IAAI,EAAE,iBAAiB;IACvB,cAAc,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC9D,OAAO,EAAE;QACP,OAAO,EAAE;YACP,IAAI,EAAE,CAAC,4BAA4B,CAAC;SACrC;KACF;IACD,cAAc,EAAE;QACd,OAAO,EAAE;YACP,IAAI,EAAE,UAAU;YAChB,GAAG,EAAE,
|
1
|
+
{"version":3,"file":"neonDevnet.js","sourceRoot":"","sources":["../../../chains/definitions/neonDevnet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAE9D,MAAM,CAAC,MAAM,UAAU,GAAG,aAAa,CAAC,WAAW,CAAC;IAClD,EAAE,EAAE,SAAW;IACf,IAAI,EAAE,iBAAiB;IACvB,cAAc,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC9D,OAAO,EAAE;QACP,OAAO,EAAE;YACP,IAAI,EAAE,CAAC,4BAA4B,CAAC;SACrC;KACF;IACD,cAAc,EAAE;QACd,OAAO,EAAE;YACP,IAAI,EAAE,UAAU;YAChB,GAAG,EAAE,6BAA6B;SACnC;KACF;IACD,SAAS,EAAE;QACT,UAAU,EAAE;YACV,OAAO,EAAE,4CAA4C;YACrD,YAAY,EAAE,SAAS;SACxB;KACF;IACD,OAAO,EAAE,IAAI;CACd,CAAC,CAAA"}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import { defineChain } from '../../utils/chain/defineChain.js';
|
2
|
+
export const neonMainnet = /*#__PURE__*/ defineChain({
|
3
|
+
id: 245022934,
|
4
|
+
network: 'neonMainnet',
|
5
|
+
name: 'Neon EVM MainNet',
|
6
|
+
nativeCurrency: { name: 'NEON', symbol: 'NEON', decimals: 18 },
|
7
|
+
rpcUrls: {
|
8
|
+
default: {
|
9
|
+
http: ['https://neon-proxy-mainnet.solana.p2p.org'],
|
10
|
+
},
|
11
|
+
public: {
|
12
|
+
http: ['https://neon-proxy-mainnet.solana.p2p.org'],
|
13
|
+
},
|
14
|
+
},
|
15
|
+
blockExplorers: {
|
16
|
+
default: {
|
17
|
+
name: 'Neonscan',
|
18
|
+
url: 'https://neonscan.org',
|
19
|
+
},
|
20
|
+
},
|
21
|
+
contracts: {},
|
22
|
+
testnet: false,
|
23
|
+
});
|
24
|
+
//# sourceMappingURL=neonMainnet.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"neonMainnet.js","sourceRoot":"","sources":["../../../chains/definitions/neonMainnet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAE9D,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAC,WAAW,CAAC;IACnD,EAAE,EAAE,SAAW;IACf,OAAO,EAAE,aAAa;IACtB,IAAI,EAAE,kBAAkB;IACxB,cAAc,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC9D,OAAO,EAAE;QACP,OAAO,EAAE;YACP,IAAI,EAAE,CAAC,2CAA2C,CAAC;SACpD;QACD,MAAM,EAAE;YACN,IAAI,EAAE,CAAC,2CAA2C,CAAC;SACpD;KACF;IACD,cAAc,EAAE;QACd,OAAO,EAAE;YACP,IAAI,EAAE,UAAU;YAChB,GAAG,EAAE,sBAAsB;SAC5B;KACF;IACD,SAAS,EAAE,EAAE;IACb,OAAO,EAAE,KAAK;CACf,CAAC,CAAA"}
|