viem 2.21.33 → 2.21.35
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +26 -0
- package/_cjs/actions/public/waitForTransactionReceipt.js +94 -91
- package/_cjs/actions/public/waitForTransactionReceipt.js.map +1 -1
- package/_cjs/chains/definitions/base.js +5 -0
- package/_cjs/chains/definitions/base.js.map +1 -1
- package/_cjs/chains/definitions/genesys.js +24 -0
- package/_cjs/chains/definitions/genesys.js.map +1 -0
- package/_cjs/chains/definitions/iota.js +6 -0
- package/_cjs/chains/definitions/iota.js.map +1 -1
- package/_cjs/chains/definitions/unichainSepolia.js +18 -0
- package/_cjs/chains/definitions/unichainSepolia.js.map +1 -1
- package/_cjs/chains/definitions/velas.js +22 -0
- package/_cjs/chains/definitions/velas.js.map +1 -0
- package/_cjs/chains/definitions/worldchain.js +38 -1
- package/_cjs/chains/definitions/worldchain.js.map +1 -1
- package/_cjs/chains/definitions/worldchainSepolia.js +37 -1
- package/_cjs/chains/definitions/worldchainSepolia.js.map +1 -1
- package/_cjs/chains/definitions/xdc.js +5 -5
- package/_cjs/chains/definitions/xdc.js.map +1 -1
- package/_cjs/chains/index.js +11 -7
- package/_cjs/chains/index.js.map +1 -1
- package/_cjs/errors/typedData.js +10 -1
- package/_cjs/errors/typedData.js.map +1 -1
- package/_cjs/errors/version.js +1 -1
- package/_cjs/index.js +5 -4
- package/_cjs/index.js.map +1 -1
- package/_cjs/linea/actions/estimateGas.js +1 -4
- package/_cjs/linea/actions/estimateGas.js.map +1 -1
- package/_cjs/op-stack/chains.js +7 -1
- package/_cjs/op-stack/chains.js.map +1 -1
- package/_cjs/utils/promise/createBatchScheduler.js +8 -11
- package/_cjs/utils/promise/createBatchScheduler.js.map +1 -1
- package/_cjs/utils/promise/withResolvers.js +13 -0
- package/_cjs/utils/promise/withResolvers.js.map +1 -0
- package/_cjs/utils/typedData.js +6 -2
- package/_cjs/utils/typedData.js.map +1 -1
- package/_esm/actions/public/waitForTransactionReceipt.js +109 -106
- package/_esm/actions/public/waitForTransactionReceipt.js.map +1 -1
- package/_esm/chains/definitions/base.js +5 -0
- package/_esm/chains/definitions/base.js.map +1 -1
- package/_esm/chains/definitions/genesys.js +21 -0
- package/_esm/chains/definitions/genesys.js.map +1 -0
- package/_esm/chains/definitions/iota.js +6 -0
- package/_esm/chains/definitions/iota.js.map +1 -1
- package/_esm/chains/definitions/unichainSepolia.js +18 -0
- package/_esm/chains/definitions/unichainSepolia.js.map +1 -1
- package/_esm/chains/definitions/velas.js +19 -0
- package/_esm/chains/definitions/velas.js.map +1 -0
- package/_esm/chains/definitions/worldchain.js +38 -1
- package/_esm/chains/definitions/worldchain.js.map +1 -1
- package/_esm/chains/definitions/worldchainSepolia.js +37 -1
- package/_esm/chains/definitions/worldchainSepolia.js.map +1 -1
- package/_esm/chains/definitions/xdc.js +5 -5
- package/_esm/chains/definitions/xdc.js.map +1 -1
- package/_esm/chains/index.js +2 -0
- package/_esm/chains/index.js.map +1 -1
- package/_esm/errors/typedData.js +8 -0
- package/_esm/errors/typedData.js.map +1 -1
- package/_esm/errors/version.js +1 -1
- package/_esm/index.js +1 -1
- package/_esm/index.js.map +1 -1
- package/_esm/linea/actions/estimateGas.js +1 -4
- package/_esm/linea/actions/estimateGas.js.map +1 -1
- package/_esm/op-stack/chains.js +3 -0
- package/_esm/op-stack/chains.js.map +1 -1
- package/_esm/utils/promise/createBatchScheduler.js +8 -11
- package/_esm/utils/promise/createBatchScheduler.js.map +1 -1
- package/_esm/utils/promise/withResolvers.js +11 -0
- package/_esm/utils/promise/withResolvers.js.map +1 -0
- package/_esm/utils/typedData.js +7 -3
- package/_esm/utils/typedData.js.map +1 -1
- package/_types/actions/public/waitForTransactionReceipt.d.ts.map +1 -1
- package/_types/chains/definitions/base.d.ts +5 -0
- package/_types/chains/definitions/base.d.ts.map +1 -1
- package/_types/chains/definitions/genesys.d.ts +37 -0
- package/_types/chains/definitions/genesys.d.ts.map +1 -0
- package/_types/chains/definitions/iota.d.ts +6 -10
- package/_types/chains/definitions/iota.d.ts.map +1 -1
- package/_types/chains/definitions/unichainSepolia.d.ts +267 -2
- package/_types/chains/definitions/unichainSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/velas.d.ts +37 -0
- package/_types/chains/definitions/velas.d.ts.map +1 -0
- package/_types/chains/definitions/worldchain.d.ts +286 -14
- package/_types/chains/definitions/worldchain.d.ts.map +1 -1
- package/_types/chains/definitions/worldchainSepolia.d.ts +285 -14
- package/_types/chains/definitions/worldchainSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/xdc.d.ts +5 -5
- package/_types/chains/index.d.ts +2 -0
- package/_types/chains/index.d.ts.map +1 -1
- package/_types/errors/typedData.d.ts +10 -0
- package/_types/errors/typedData.d.ts.map +1 -1
- package/_types/errors/version.d.ts +1 -1
- package/_types/index.d.ts +1 -1
- package/_types/index.d.ts.map +1 -1
- package/_types/linea/actions/estimateGas.d.ts.map +1 -1
- package/_types/op-stack/chains.d.ts +3 -0
- package/_types/op-stack/chains.d.ts.map +1 -1
- package/_types/utils/promise/createBatchScheduler.d.ts.map +1 -1
- package/_types/utils/promise/withResolvers.d.ts +9 -0
- package/_types/utils/promise/withResolvers.d.ts.map +1 -0
- package/_types/utils/typedData.d.ts.map +1 -1
- package/actions/public/waitForTransactionReceipt.ts +162 -156
- package/chains/definitions/base.ts +5 -0
- package/chains/definitions/genesys.ts +21 -0
- package/chains/definitions/iota.ts +6 -0
- package/chains/definitions/unichainSepolia.ts +18 -0
- package/chains/definitions/velas.ts +19 -0
- package/chains/definitions/worldchain.ts +39 -1
- package/chains/definitions/worldchainSepolia.ts +38 -1
- package/chains/definitions/xdc.ts +5 -5
- package/chains/index.ts +2 -0
- package/errors/typedData.ts +20 -0
- package/errors/version.ts +1 -1
- package/index.ts +2 -0
- package/linea/actions/estimateGas.ts +1 -11
- package/op-stack/chains.ts +3 -0
- package/package.json +1 -1
- package/utils/promise/createBatchScheduler.ts +12 -16
- package/utils/promise/withResolvers.ts +19 -0
- package/utils/typedData.ts +8 -2
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"estimateGas.d.ts","sourceRoot":"","sources":["../../../linea/actions/estimateGas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAEtD,OAAO,KAAK,EAAE,qBAAqB,IAAI,0BAA0B,EAAE,MAAM,qCAAqC,CAAA;
|
1
|
+
{"version":3,"file":"estimateGas.d.ts","sourceRoot":"","sources":["../../../linea/actions/estimateGas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAEtD,OAAO,KAAK,EAAE,qBAAqB,IAAI,0BAA0B,EAAE,MAAM,qCAAqC,CAAA;AAC9G,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAA;AAG5E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AACjE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAajD,MAAM,MAAM,qBAAqB,CAC/B,KAAK,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACnD,OAAO,SAAS,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,IACvD,0BAA0B,CAAC,KAAK,CAAC,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAA;AAEpE,MAAM,MAAM,qBAAqB,GAAG;IAClC,QAAQ,EAAE,MAAM,CAAA;IAChB,aAAa,EAAE,MAAM,CAAA;IACrB,iBAAiB,EAAE,MAAM,CAAA;CAC1B,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAsB,WAAW,CAC/B,KAAK,SAAS,KAAK,GAAG,SAAS,EAC/B,OAAO,SAAS,OAAO,GAAG,SAAS,EAEnC,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,KAAK,EAAE,OAAO,CAAC,EACzC,IAAI,EAAE,qBAAqB,CAAC,KAAK,CAAC,GACjC,OAAO,CAAC,qBAAqB,CAAC,CAkEhC"}
|
@@ -15,6 +15,9 @@ export { shape } from '../chains/definitions/shape.js';
|
|
15
15
|
export { snax } from '../chains/definitions/snax.js';
|
16
16
|
export { snaxTestnet } from '../chains/definitions/snaxTestnet.js';
|
17
17
|
export { soneiumMinato } from '../chains/definitions/soneiumMinato.js';
|
18
|
+
export { unichainSepolia } from '../chains/definitions/unichainSepolia.js';
|
19
|
+
export { worldchain } from '../chains/definitions/worldchain.js';
|
20
|
+
export { worldchainSepolia } from '../chains/definitions/worldchainSepolia.js';
|
18
21
|
export { zora } from '../chains/definitions/zora.js';
|
19
22
|
export { zoraSepolia } from '../chains/definitions/zoraSepolia.js';
|
20
23
|
export { zoraTestnet } from '../chains/definitions/zoraTestnet.js';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"chains.d.ts","sourceRoot":"","sources":["../../op-stack/chains.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAA;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAA;AAC1E,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAA;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAA;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAA;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAA;AACxE,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAA;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAA;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAA;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAA;AAC1E,OAAO,EAAE,GAAG,EAAE,MAAM,8BAA8B,CAAA;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAA;AAChE,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAA;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAA;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAA;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAA;AACtE,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAA;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAA;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAA"}
|
1
|
+
{"version":3,"file":"chains.d.ts","sourceRoot":"","sources":["../../op-stack/chains.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAA;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAA;AAC1E,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAA;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAA;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAA;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAA;AACxE,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAA;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAA;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAA;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAA;AAC1E,OAAO,EAAE,GAAG,EAAE,MAAM,8BAA8B,CAAA;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAA;AAChE,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAA;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAA;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAA;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAA;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAA;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAA;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAA;AAC9E,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAA;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAA;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"createBatchScheduler.d.ts","sourceRoot":"","sources":["../../../utils/promise/createBatchScheduler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;
|
1
|
+
{"version":3,"file":"createBatchScheduler.d.ts","sourceRoot":"","sources":["../../../utils/promise/createBatchScheduler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAGtD,KAAK,QAAQ,CAAC,UAAU,SAAS,SAAS,OAAO,EAAE,GAAG,GAAG,IAAI;IAC3D,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC;IAC1B,OAAO,EAAE,UAAU;CACpB,CAAA;AAQD,KAAK,qBAAqB,CAAC,MAAM,GAAG,OAAO,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,MAAM,CAAA;AAE/E,KAAK,6BAA6B,CAChC,UAAU,GAAG,OAAO,EACpB,UAAU,SAAS,SAAS,OAAO,EAAE,GAAG,SAAS,OAAO,EAAE,IACxD;IACF,EAAE,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,OAAO,CAAC,UAAU,CAAC,CAAA;IAC/C,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;IACnB,gBAAgB,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,OAAO,CAAC,GAAG,SAAS,CAAA;IAChE,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACzB,IAAI,CAAC,EAAE,qBAAqB,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,GAAG,SAAS,CAAA;CAC7D,CAAA;AAED,KAAK,8BAA8B,CACjC,UAAU,GAAG,OAAO,EACpB,UAAU,SAAS,SAAS,OAAO,EAAE,GAAG,SAAS,OAAO,EAAE,IACxD;IACF,KAAK,EAAE,MAAM,IAAI,CAAA;IACjB,QAAQ,EAAE,UAAU,SAAS,SAAS,GAClC,CAAC,IAAI,CAAC,EAAE,UAAU,GAAG,SAAS,KAAK,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,GAChE,CAAC,IAAI,EAAE,UAAU,KAAK,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAA;CACxD,CAAA;AAED,MAAM,MAAM,6BAA6B,GAAG,SAAS,CAAA;AAIrD,gBAAgB;AAChB,wBAAgB,oBAAoB,CAClC,UAAU,EACV,UAAU,SAAS,SAAS,OAAO,EAAE,EACrC,EACA,EAAE,EACF,EAAE,EACF,gBAAgB,EAChB,IAAQ,EACR,IAAI,GACL,EAAE,6BAA6B,CAC9B,UAAU,EACV,UAAU,CACX,GAAG,8BAA8B,CAAC,UAAU,EAAE,UAAU,CAAC,CAuDzD"}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
/** @internal */
|
2
|
+
export type PromiseWithResolvers<type> = {
|
3
|
+
promise: Promise<type>;
|
4
|
+
resolve: (value: type | PromiseLike<type>) => void;
|
5
|
+
reject: (reason?: unknown) => void;
|
6
|
+
};
|
7
|
+
/** @internal */
|
8
|
+
export declare function withResolvers<type>(): PromiseWithResolvers<type>;
|
9
|
+
//# sourceMappingURL=withResolvers.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"withResolvers.d.ts","sourceRoot":"","sources":["../../../utils/promise/withResolvers.ts"],"names":[],"mappings":"AAAA,gBAAgB;AAChB,MAAM,MAAM,oBAAoB,CAAC,IAAI,IAAI;IACvC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,CAAA;IACtB,OAAO,EAAE,CAAC,KAAK,EAAE,IAAI,GAAG,WAAW,CAAC,IAAI,CAAC,KAAK,IAAI,CAAA;IAClD,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,OAAO,KAAK,IAAI,CAAA;CACnC,CAAA;AAED,gBAAgB;AAChB,wBAAgB,aAAa,CAAC,IAAI,KAAK,oBAAoB,CAAC,IAAI,CAAC,CAUhE"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"typedData.d.ts","sourceRoot":"","sources":["../../utils/typedData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;
|
1
|
+
{"version":3,"file":"typedData.d.ts","sourceRoot":"","sources":["../../utils/typedData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAQ7E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AACnD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AAC3C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAChE,OAAO,EAAE,KAAK,kBAAkB,EAAa,MAAM,wBAAwB,CAAA;AAC3E,OAAO,EAAE,KAAK,aAAa,EAAQ,MAAM,gBAAgB,CAAA;AACzD,OAAO,EAAE,KAAK,oBAAoB,EAAe,MAAM,qBAAqB,CAAA;AAE5E,OAAO,EACL,KAAK,mBAAmB,EAEzB,MAAM,8BAA8B,CAAA;AAGrC,MAAM,MAAM,2BAA2B,GACnC,mBAAmB,GACnB,kBAAkB,GAClB,oBAAoB,GACpB,aAAa,GACb,SAAS,CAAA;AAEb,wBAAgB,kBAAkB,CAChC,KAAK,CAAC,SAAS,SAAS,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC3D,WAAW,SAAS,MAAM,SAAS,GAAG,cAAc,EACpD,UAAU,EAAE,mBAAmB,CAAC,SAAS,EAAE,WAAW,CAAC,UAgCxD;AAED,MAAM,MAAM,0BAA0B,GAClC,mBAAmB,GACnB,kBAAkB,GAClB,oBAAoB,GACpB,aAAa,GACb,SAAS,CAAA;AAEb,wBAAgB,iBAAiB,CAC/B,KAAK,CAAC,SAAS,SAAS,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC3D,WAAW,SAAS,MAAM,SAAS,GAAG,cAAc,EACpD,UAAU,EAAE,mBAAmB,CAAC,SAAS,EAAE,WAAW,CAAC,QAuDxD;AAED,MAAM,MAAM,gCAAgC,GAAG,SAAS,CAAA;AAExD,wBAAgB,uBAAuB,CAAC,EACtC,MAAM,GACP,EAAE;IAAE,MAAM,CAAC,EAAE,eAAe,GAAG,SAAS,CAAA;CAAE,GAAG,kBAAkB,EAAE,CAcjE;AAED,MAAM,MAAM,wBAAwB,GAChC,gCAAgC,GAChC,mBAAmB,GACnB,SAAS,CAAA;AAEb,wBAAgB,eAAe,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,eAAe,CAAA;CAAE,GAAG,GAAG,CAO5E"}
|
@@ -12,6 +12,7 @@ import type { Hash } from '../../types/misc.js'
|
|
12
12
|
import type { Transaction } from '../../types/transaction.js'
|
13
13
|
import { getAction } from '../../utils/getAction.js'
|
14
14
|
import { type ObserveErrorType, observe } from '../../utils/observe.js'
|
15
|
+
import { withResolvers } from '../../utils/promise/withResolvers.js'
|
15
16
|
import {
|
16
17
|
type WithRetryParameters,
|
17
18
|
withRetry,
|
@@ -149,189 +150,194 @@ export async function waitForTransactionReceipt<
|
|
149
150
|
let receipt: GetTransactionReceiptReturnType<chain>
|
150
151
|
let retrying = false
|
151
152
|
|
152
|
-
|
153
|
-
|
154
|
-
|
153
|
+
const { promise, resolve, reject } =
|
154
|
+
withResolvers<WaitForTransactionReceiptReturnType<chain>>()
|
155
|
+
|
156
|
+
const timer = timeout
|
157
|
+
? setTimeout(
|
155
158
|
() => reject(new WaitForTransactionReceiptTimeoutError({ hash })),
|
156
159
|
timeout,
|
157
160
|
)
|
161
|
+
: undefined
|
162
|
+
|
163
|
+
const _unobserve = observe(
|
164
|
+
observerId,
|
165
|
+
{ onReplaced, resolve, reject },
|
166
|
+
(emit) => {
|
167
|
+
const _unwatch = getAction(
|
168
|
+
client,
|
169
|
+
watchBlockNumber,
|
170
|
+
'watchBlockNumber',
|
171
|
+
)({
|
172
|
+
emitMissed: true,
|
173
|
+
emitOnBegin: true,
|
174
|
+
poll: true,
|
175
|
+
pollingInterval,
|
176
|
+
async onBlockNumber(blockNumber_) {
|
177
|
+
const done = (fn: () => void) => {
|
178
|
+
clearTimeout(timer)
|
179
|
+
_unwatch()
|
180
|
+
fn()
|
181
|
+
_unobserve()
|
182
|
+
}
|
183
|
+
|
184
|
+
let blockNumber = blockNumber_
|
185
|
+
|
186
|
+
if (retrying) return
|
187
|
+
|
188
|
+
try {
|
189
|
+
// If we already have a valid receipt, let's check if we have enough
|
190
|
+
// confirmations. If we do, then we can resolve.
|
191
|
+
if (receipt) {
|
192
|
+
if (
|
193
|
+
confirmations > 1 &&
|
194
|
+
(!receipt.blockNumber ||
|
195
|
+
blockNumber - receipt.blockNumber + 1n < confirmations)
|
196
|
+
)
|
197
|
+
return
|
158
198
|
|
159
|
-
|
160
|
-
|
161
|
-
{ onReplaced, resolve, reject },
|
162
|
-
(emit) => {
|
163
|
-
const _unwatch = getAction(
|
164
|
-
client,
|
165
|
-
watchBlockNumber,
|
166
|
-
'watchBlockNumber',
|
167
|
-
)({
|
168
|
-
emitMissed: true,
|
169
|
-
emitOnBegin: true,
|
170
|
-
poll: true,
|
171
|
-
pollingInterval,
|
172
|
-
async onBlockNumber(blockNumber_) {
|
173
|
-
const done = (fn: () => void) => {
|
174
|
-
_unwatch()
|
175
|
-
fn()
|
176
|
-
_unobserve()
|
199
|
+
done(() => emit.resolve(receipt))
|
200
|
+
return
|
177
201
|
}
|
178
202
|
|
179
|
-
|
203
|
+
// Get the transaction to check if it's been replaced.
|
204
|
+
// We need to retry as some RPC Providers may be slow to sync
|
205
|
+
// up mined transactions.
|
206
|
+
if (!transaction) {
|
207
|
+
retrying = true
|
208
|
+
await withRetry(
|
209
|
+
async () => {
|
210
|
+
transaction = (await getAction(
|
211
|
+
client,
|
212
|
+
getTransaction,
|
213
|
+
'getTransaction',
|
214
|
+
)({ hash })) as GetTransactionReturnType<chain>
|
215
|
+
if (transaction.blockNumber)
|
216
|
+
blockNumber = transaction.blockNumber
|
217
|
+
},
|
218
|
+
{
|
219
|
+
delay: retryDelay,
|
220
|
+
retryCount,
|
221
|
+
},
|
222
|
+
)
|
223
|
+
retrying = false
|
224
|
+
}
|
180
225
|
|
181
|
-
if
|
226
|
+
// Get the receipt to check if it's been processed.
|
227
|
+
receipt = await getAction(
|
228
|
+
client,
|
229
|
+
getTransactionReceipt,
|
230
|
+
'getTransactionReceipt',
|
231
|
+
)({ hash })
|
182
232
|
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
blockNumber - receipt.blockNumber + 1n < confirmations)
|
191
|
-
)
|
192
|
-
return
|
233
|
+
// Check if we have enough confirmations. If not, continue polling.
|
234
|
+
if (
|
235
|
+
confirmations > 1 &&
|
236
|
+
(!receipt.blockNumber ||
|
237
|
+
blockNumber - receipt.blockNumber + 1n < confirmations)
|
238
|
+
)
|
239
|
+
return
|
193
240
|
|
194
|
-
|
241
|
+
done(() => emit.resolve(receipt))
|
242
|
+
} catch (err) {
|
243
|
+
// If the receipt is not found, the transaction will be pending.
|
244
|
+
// We need to check if it has potentially been replaced.
|
245
|
+
if (
|
246
|
+
err instanceof TransactionNotFoundError ||
|
247
|
+
err instanceof TransactionReceiptNotFoundError
|
248
|
+
) {
|
249
|
+
if (!transaction) {
|
250
|
+
retrying = false
|
195
251
|
return
|
196
252
|
}
|
197
253
|
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
254
|
+
try {
|
255
|
+
replacedTransaction = transaction
|
256
|
+
|
257
|
+
// Let's retrieve the transactions from the current block.
|
258
|
+
// We need to retry as some RPC Providers may be slow to sync
|
259
|
+
// up mined blocks.
|
202
260
|
retrying = true
|
203
|
-
await withRetry(
|
204
|
-
|
205
|
-
|
261
|
+
const block = await withRetry(
|
262
|
+
() =>
|
263
|
+
getAction(
|
206
264
|
client,
|
207
|
-
|
208
|
-
'
|
209
|
-
)({
|
210
|
-
|
211
|
-
|
212
|
-
|
265
|
+
getBlock,
|
266
|
+
'getBlock',
|
267
|
+
)({
|
268
|
+
blockNumber,
|
269
|
+
includeTransactions: true,
|
270
|
+
}),
|
213
271
|
{
|
214
272
|
delay: retryDelay,
|
215
273
|
retryCount,
|
274
|
+
shouldRetry: ({ error }) =>
|
275
|
+
error instanceof BlockNotFoundError,
|
216
276
|
},
|
217
277
|
)
|
218
278
|
retrying = false
|
219
|
-
}
|
220
|
-
|
221
|
-
// Get the receipt to check if it's been processed.
|
222
|
-
receipt = await getAction(
|
223
|
-
client,
|
224
|
-
getTransactionReceipt,
|
225
|
-
'getTransactionReceipt',
|
226
|
-
)({ hash })
|
227
279
|
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
done(() => emit.resolve(receipt))
|
237
|
-
} catch (err) {
|
238
|
-
// If the receipt is not found, the transaction will be pending.
|
239
|
-
// We need to check if it has potentially been replaced.
|
240
|
-
if (
|
241
|
-
err instanceof TransactionNotFoundError ||
|
242
|
-
err instanceof TransactionReceiptNotFoundError
|
243
|
-
) {
|
244
|
-
if (!transaction) {
|
245
|
-
retrying = false
|
246
|
-
return
|
247
|
-
}
|
248
|
-
|
249
|
-
try {
|
250
|
-
replacedTransaction = transaction
|
251
|
-
|
252
|
-
// Let's retrieve the transactions from the current block.
|
253
|
-
// We need to retry as some RPC Providers may be slow to sync
|
254
|
-
// up mined blocks.
|
255
|
-
retrying = true
|
256
|
-
const block = await withRetry(
|
257
|
-
() =>
|
258
|
-
getAction(
|
259
|
-
client,
|
260
|
-
getBlock,
|
261
|
-
'getBlock',
|
262
|
-
)({
|
263
|
-
blockNumber,
|
264
|
-
includeTransactions: true,
|
265
|
-
}),
|
266
|
-
{
|
267
|
-
delay: retryDelay,
|
268
|
-
retryCount,
|
269
|
-
shouldRetry: ({ error }) =>
|
270
|
-
error instanceof BlockNotFoundError,
|
271
|
-
},
|
272
|
-
)
|
273
|
-
retrying = false
|
274
|
-
|
275
|
-
const replacementTransaction = (
|
276
|
-
block.transactions as {} as Transaction[]
|
277
|
-
).find(
|
278
|
-
({ from, nonce }) =>
|
279
|
-
from === replacedTransaction!.from &&
|
280
|
-
nonce === replacedTransaction!.nonce,
|
281
|
-
)
|
280
|
+
const replacementTransaction = (
|
281
|
+
block.transactions as {} as Transaction[]
|
282
|
+
).find(
|
283
|
+
({ from, nonce }) =>
|
284
|
+
from === replacedTransaction!.from &&
|
285
|
+
nonce === replacedTransaction!.nonce,
|
286
|
+
)
|
282
287
|
|
283
|
-
|
284
|
-
|
288
|
+
// If we couldn't find a replacement transaction, continue polling.
|
289
|
+
if (!replacementTransaction) return
|
285
290
|
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
291
|
+
// If we found a replacement transaction, return it's receipt.
|
292
|
+
receipt = await getAction(
|
293
|
+
client,
|
294
|
+
getTransactionReceipt,
|
295
|
+
'getTransactionReceipt',
|
296
|
+
)({
|
297
|
+
hash: replacementTransaction.hash,
|
298
|
+
})
|
294
299
|
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
300
|
+
// Check if we have enough confirmations. If not, continue polling.
|
301
|
+
if (
|
302
|
+
confirmations > 1 &&
|
303
|
+
(!receipt.blockNumber ||
|
304
|
+
blockNumber - receipt.blockNumber + 1n < confirmations)
|
305
|
+
)
|
306
|
+
return
|
302
307
|
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
308
|
+
let reason: ReplacementReason = 'replaced'
|
309
|
+
if (
|
310
|
+
replacementTransaction.to === replacedTransaction.to &&
|
311
|
+
replacementTransaction.value === replacedTransaction.value
|
312
|
+
) {
|
313
|
+
reason = 'repriced'
|
314
|
+
} else if (
|
315
|
+
replacementTransaction.from === replacementTransaction.to &&
|
316
|
+
replacementTransaction.value === 0n
|
317
|
+
) {
|
318
|
+
reason = 'cancelled'
|
319
|
+
}
|
315
320
|
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
})
|
323
|
-
emit.resolve(receipt)
|
321
|
+
done(() => {
|
322
|
+
emit.onReplaced?.({
|
323
|
+
reason,
|
324
|
+
replacedTransaction: replacedTransaction! as any,
|
325
|
+
transaction: replacementTransaction,
|
326
|
+
transactionReceipt: receipt,
|
324
327
|
})
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
done(() => emit.reject(err))
|
328
|
+
emit.resolve(receipt)
|
329
|
+
})
|
330
|
+
} catch (err_) {
|
331
|
+
done(() => emit.reject(err_))
|
330
332
|
}
|
333
|
+
} else {
|
334
|
+
done(() => emit.reject(err))
|
331
335
|
}
|
332
|
-
}
|
333
|
-
}
|
334
|
-
}
|
335
|
-
|
336
|
-
|
336
|
+
}
|
337
|
+
},
|
338
|
+
})
|
339
|
+
},
|
340
|
+
)
|
341
|
+
|
342
|
+
return promise
|
337
343
|
}
|
@@ -22,6 +22,11 @@ export const base = /*#__PURE__*/ defineChain({
|
|
22
22
|
},
|
23
23
|
contracts: {
|
24
24
|
...chainConfig.contracts,
|
25
|
+
disputeGameFactory: {
|
26
|
+
[sourceId]: {
|
27
|
+
address: '0x43edB88C4B80fDD2AdFF2412A7BebF9dF42cB40e',
|
28
|
+
},
|
29
|
+
},
|
25
30
|
l2OutputOracle: {
|
26
31
|
[sourceId]: {
|
27
32
|
address: '0x56315b90c40730925ec5485cf004d835058518A0',
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import { defineChain } from '../../utils/chain/defineChain.js'
|
2
|
+
|
3
|
+
export const genesys = /*#__PURE__*/ defineChain({
|
4
|
+
id: 16507,
|
5
|
+
name: 'Genesys Mainnet',
|
6
|
+
nativeCurrency: {
|
7
|
+
decimals: 18,
|
8
|
+
name: 'GSYS',
|
9
|
+
symbol: 'GSYS',
|
10
|
+
},
|
11
|
+
rpcUrls: {
|
12
|
+
default: { http: ['https://rpc.genesys.network'] },
|
13
|
+
},
|
14
|
+
blockExplorers: {
|
15
|
+
default: {
|
16
|
+
name: 'Genesys Explorer',
|
17
|
+
url: 'https://gchainexplorer.genesys.network',
|
18
|
+
},
|
19
|
+
},
|
20
|
+
testnet: false,
|
21
|
+
})
|
@@ -1,8 +1,10 @@
|
|
1
|
+
import { chainConfig } from '../../op-stack/chainConfig.js'
|
1
2
|
import { defineChain } from '../../utils/chain/defineChain.js'
|
2
3
|
|
3
4
|
const sourceId = 11_155_111 // sepolia
|
4
5
|
|
5
6
|
export const unichainSepolia = /*#__PURE__*/ defineChain({
|
7
|
+
...chainConfig,
|
6
8
|
id: 1301,
|
7
9
|
name: 'Unichain Sepolia',
|
8
10
|
nativeCurrency: {
|
@@ -23,10 +25,26 @@ export const unichainSepolia = /*#__PURE__*/ defineChain({
|
|
23
25
|
},
|
24
26
|
},
|
25
27
|
contracts: {
|
28
|
+
...chainConfig.contracts,
|
26
29
|
multicall3: {
|
27
30
|
address: '0xca11bde05977b3631167028862be2a173976ca11',
|
28
31
|
blockCreated: 0,
|
29
32
|
},
|
33
|
+
portal: {
|
34
|
+
[sourceId]: {
|
35
|
+
address: '0x0d83dab629f0e0F9d36c0Cbc89B69a489f0751bD',
|
36
|
+
},
|
37
|
+
},
|
38
|
+
l1StandardBridge: {
|
39
|
+
[sourceId]: {
|
40
|
+
address: '0xea58fcA6849d79EAd1f26608855c2D6407d54Ce2',
|
41
|
+
},
|
42
|
+
},
|
43
|
+
disputeGameFactory: {
|
44
|
+
[sourceId]: {
|
45
|
+
address: '0xeff73e5aa3B9AEC32c659Aa3E00444d20a84394b',
|
46
|
+
},
|
47
|
+
},
|
30
48
|
},
|
31
49
|
testnet: true,
|
32
50
|
sourceId,
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import { defineChain } from '../../utils/chain/defineChain.js'
|
2
|
+
|
3
|
+
export const velas = /*#__PURE__*/ defineChain({
|
4
|
+
id: 106,
|
5
|
+
name: 'Velas EVM Mainnet',
|
6
|
+
nativeCurrency: { name: 'VLX', symbol: 'VLX', decimals: 18 },
|
7
|
+
rpcUrls: {
|
8
|
+
default: {
|
9
|
+
http: ['https://evmexplorer.velas.com/rpc'],
|
10
|
+
},
|
11
|
+
},
|
12
|
+
blockExplorers: {
|
13
|
+
default: {
|
14
|
+
name: 'Velas Explorer',
|
15
|
+
url: 'https://evmexplorer.velas.com',
|
16
|
+
},
|
17
|
+
},
|
18
|
+
testnet: false,
|
19
|
+
})
|
@@ -1,6 +1,10 @@
|
|
1
|
+
import { chainConfig } from '../../op-stack/chainConfig.js'
|
1
2
|
import { defineChain } from '../../utils/chain/defineChain.js'
|
2
3
|
|
4
|
+
const sourceId = 1 // mainnet
|
5
|
+
|
3
6
|
export const worldchain = /*#__PURE__*/ defineChain({
|
7
|
+
...chainConfig,
|
4
8
|
id: 480,
|
5
9
|
name: 'World Chain',
|
6
10
|
network: 'worldchain',
|
@@ -10,9 +14,43 @@ export const worldchain = /*#__PURE__*/ defineChain({
|
|
10
14
|
},
|
11
15
|
blockExplorers: {
|
12
16
|
default: {
|
13
|
-
name: '
|
17
|
+
name: 'Worldscan',
|
18
|
+
url: 'https://worldscan.org',
|
19
|
+
apiUrl: 'https://api.worldscan.org/api',
|
20
|
+
},
|
21
|
+
blockscout: {
|
22
|
+
name: 'Blockscout',
|
14
23
|
url: 'https://worldchain-mainnet.explorer.alchemy.com',
|
24
|
+
apiUrl: 'https://worldchain-mainnet.explorer.alchemy.com/api',
|
25
|
+
},
|
26
|
+
},
|
27
|
+
contracts: {
|
28
|
+
...chainConfig.contracts,
|
29
|
+
multicall3: {
|
30
|
+
address: '0xca11bde05977b3631167028862be2a173976ca11',
|
31
|
+
blockCreated: 0,
|
32
|
+
},
|
33
|
+
disputeGameFactory: {
|
34
|
+
[sourceId]: {
|
35
|
+
address: '0x0E90dCAFBC242D2C861A20Bb20EC8E7182965a52',
|
36
|
+
},
|
37
|
+
},
|
38
|
+
l2OutputOracle: {
|
39
|
+
[sourceId]: {
|
40
|
+
address: '0x19A6d1E9034596196295CF148509796978343c5D',
|
41
|
+
},
|
42
|
+
},
|
43
|
+
portal: {
|
44
|
+
[sourceId]: {
|
45
|
+
address: '0xd5ec14a83B7d95BE1E2Ac12523e2dEE12Cbeea6C',
|
46
|
+
},
|
47
|
+
},
|
48
|
+
l1StandardBridge: {
|
49
|
+
[sourceId]: {
|
50
|
+
address: '0x470458C91978D2d929704489Ad730DC3E3001113',
|
51
|
+
},
|
15
52
|
},
|
16
53
|
},
|
17
54
|
testnet: false,
|
55
|
+
sourceId,
|
18
56
|
})
|
@@ -1,6 +1,10 @@
|
|
1
|
+
import { chainConfig } from '../../op-stack/chainConfig.js'
|
1
2
|
import { defineChain } from '../../utils/chain/defineChain.js'
|
2
3
|
|
4
|
+
const sourceId = 11_155_111 // sepolia
|
5
|
+
|
3
6
|
export const worldchainSepolia = /*#__PURE__*/ defineChain({
|
7
|
+
...chainConfig,
|
4
8
|
id: 4801,
|
5
9
|
name: 'World Chain Sepolia',
|
6
10
|
network: 'worldchain-sepolia',
|
@@ -11,9 +15,42 @@ export const worldchainSepolia = /*#__PURE__*/ defineChain({
|
|
11
15
|
},
|
12
16
|
blockExplorers: {
|
13
17
|
default: {
|
14
|
-
name: '
|
18
|
+
name: 'Worldscan Sepolia',
|
19
|
+
url: 'https://sepolia.worldscan.org',
|
20
|
+
},
|
21
|
+
blockscout: {
|
22
|
+
name: 'Blockscout',
|
15
23
|
url: 'https://worldchain-sepolia.explorer.alchemy.com',
|
24
|
+
apiUrl: 'https://worldchain-sepolia.explorer.alchemy.com/api',
|
25
|
+
},
|
26
|
+
},
|
27
|
+
contracts: {
|
28
|
+
...chainConfig.contracts,
|
29
|
+
multicall3: {
|
30
|
+
address: '0xca11bde05977b3631167028862be2a173976ca11',
|
31
|
+
blockCreated: 0,
|
32
|
+
},
|
33
|
+
disputeGameFactory: {
|
34
|
+
[sourceId]: {
|
35
|
+
address: '0x8cF97Ee616C986a070F5020d973b456D0120C253',
|
36
|
+
},
|
37
|
+
},
|
38
|
+
l2OutputOracle: {
|
39
|
+
[sourceId]: {
|
40
|
+
address: '0xc8886f8BAb6Eaeb215aDB5f1c686BF699248300e',
|
41
|
+
},
|
42
|
+
},
|
43
|
+
portal: {
|
44
|
+
[sourceId]: {
|
45
|
+
address: '0xFf6EBa109271fe6d4237EeeD4bAb1dD9A77dD1A4',
|
46
|
+
},
|
47
|
+
},
|
48
|
+
l1StandardBridge: {
|
49
|
+
[sourceId]: {
|
50
|
+
address: '0xd7DF54b3989855eb66497301a4aAEc33Dbb3F8DE',
|
51
|
+
},
|
16
52
|
},
|
17
53
|
},
|
18
54
|
testnet: true,
|
55
|
+
sourceId,
|
19
56
|
})
|
@@ -9,18 +9,18 @@ export const xdc = /*#__PURE__*/ defineChain({
|
|
9
9
|
symbol: 'XDC',
|
10
10
|
},
|
11
11
|
rpcUrls: {
|
12
|
-
default: { http: ['https://rpc.
|
12
|
+
default: { http: ['https://rpc.xdcrpc.com'] },
|
13
13
|
},
|
14
14
|
blockExplorers: {
|
15
15
|
default: {
|
16
|
-
name: '
|
17
|
-
url: 'https://
|
16
|
+
name: 'XDCScan',
|
17
|
+
url: 'https://xdcscan.com',
|
18
18
|
},
|
19
19
|
},
|
20
20
|
contracts: {
|
21
21
|
multicall3: {
|
22
|
-
address: '
|
23
|
-
blockCreated:
|
22
|
+
address: '0x0B1795ccA8E4eC4df02346a082df54D437F8D9aF',
|
23
|
+
blockCreated: 75884020,
|
24
24
|
},
|
25
25
|
},
|
26
26
|
})
|