viem 2.21.33 → 2.21.34
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +10 -0
- package/_cjs/actions/public/waitForTransactionReceipt.js +94 -91
- package/_cjs/actions/public/waitForTransactionReceipt.js.map +1 -1
- package/_cjs/chains/definitions/worldchain.js +37 -1
- package/_cjs/chains/definitions/worldchain.js.map +1 -1
- package/_cjs/chains/definitions/worldchainSepolia.js +36 -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/errors/version.js +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 +5 -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/_esm/actions/public/waitForTransactionReceipt.js +109 -106
- package/_esm/actions/public/waitForTransactionReceipt.js.map +1 -1
- package/_esm/chains/definitions/worldchain.js +37 -1
- package/_esm/chains/definitions/worldchain.js.map +1 -1
- package/_esm/chains/definitions/worldchainSepolia.js +36 -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/errors/version.js +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 +2 -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/_types/actions/public/waitForTransactionReceipt.d.ts.map +1 -1
- package/_types/chains/definitions/worldchain.d.ts +52 -12
- package/_types/chains/definitions/worldchain.d.ts.map +1 -1
- package/_types/chains/definitions/worldchainSepolia.d.ts +51 -12
- package/_types/chains/definitions/worldchainSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/xdc.d.ts +5 -5
- package/_types/errors/version.d.ts +1 -1
- package/_types/linea/actions/estimateGas.d.ts.map +1 -1
- package/_types/op-stack/chains.d.ts +2 -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/actions/public/waitForTransactionReceipt.ts +162 -156
- package/chains/definitions/worldchain.ts +38 -1
- package/chains/definitions/worldchainSepolia.ts +37 -1
- package/chains/definitions/xdc.ts +5 -5
- package/errors/version.ts +1 -1
- package/linea/actions/estimateGas.ts +1 -11
- package/op-stack/chains.ts +2 -0
- package/package.json +1 -1
- package/utils/promise/createBatchScheduler.ts +12 -16
- package/utils/promise/withResolvers.ts +19 -0
@@ -2,6 +2,7 @@ import { BlockNotFoundError } from '../../errors/block.js';
|
|
2
2
|
import { TransactionNotFoundError, TransactionReceiptNotFoundError, WaitForTransactionReceiptTimeoutError, } from '../../errors/transaction.js';
|
3
3
|
import { getAction } from '../../utils/getAction.js';
|
4
4
|
import { observe } from '../../utils/observe.js';
|
5
|
+
import { withResolvers } from '../../utils/promise/withResolvers.js';
|
5
6
|
import { withRetry, } from '../../utils/promise/withRetry.js';
|
6
7
|
import { stringify } from '../../utils/stringify.js';
|
7
8
|
import { getBlock } from './getBlock.js';
|
@@ -53,127 +54,129 @@ timeout = 180_000, }) {
|
|
53
54
|
let replacedTransaction;
|
54
55
|
let receipt;
|
55
56
|
let retrying = false;
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
57
|
+
const { promise, resolve, reject } = withResolvers();
|
58
|
+
const timer = timeout
|
59
|
+
? setTimeout(() => reject(new WaitForTransactionReceiptTimeoutError({ hash })), timeout)
|
60
|
+
: undefined;
|
61
|
+
const _unobserve = observe(observerId, { onReplaced, resolve, reject }, (emit) => {
|
62
|
+
const _unwatch = getAction(client, watchBlockNumber, 'watchBlockNumber')({
|
63
|
+
emitMissed: true,
|
64
|
+
emitOnBegin: true,
|
65
|
+
poll: true,
|
66
|
+
pollingInterval,
|
67
|
+
async onBlockNumber(blockNumber_) {
|
68
|
+
const done = (fn) => {
|
69
|
+
clearTimeout(timer);
|
70
|
+
_unwatch();
|
71
|
+
fn();
|
72
|
+
_unobserve();
|
73
|
+
};
|
74
|
+
let blockNumber = blockNumber_;
|
75
|
+
if (retrying)
|
76
|
+
return;
|
77
|
+
try {
|
78
|
+
// If we already have a valid receipt, let's check if we have enough
|
79
|
+
// confirmations. If we do, then we can resolve.
|
80
|
+
if (receipt) {
|
81
|
+
if (confirmations > 1 &&
|
82
|
+
(!receipt.blockNumber ||
|
83
|
+
blockNumber - receipt.blockNumber + 1n < confirmations))
|
84
|
+
return;
|
85
|
+
done(() => emit.resolve(receipt));
|
73
86
|
return;
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
87
|
+
}
|
88
|
+
// Get the transaction to check if it's been replaced.
|
89
|
+
// We need to retry as some RPC Providers may be slow to sync
|
90
|
+
// up mined transactions.
|
91
|
+
if (!transaction) {
|
92
|
+
retrying = true;
|
93
|
+
await withRetry(async () => {
|
94
|
+
transaction = (await getAction(client, getTransaction, 'getTransaction')({ hash }));
|
95
|
+
if (transaction.blockNumber)
|
96
|
+
blockNumber = transaction.blockNumber;
|
97
|
+
}, {
|
98
|
+
delay: retryDelay,
|
99
|
+
retryCount,
|
100
|
+
});
|
101
|
+
retrying = false;
|
102
|
+
}
|
103
|
+
// Get the receipt to check if it's been processed.
|
104
|
+
receipt = await getAction(client, getTransactionReceipt, 'getTransactionReceipt')({ hash });
|
105
|
+
// Check if we have enough confirmations. If not, continue polling.
|
106
|
+
if (confirmations > 1 &&
|
107
|
+
(!receipt.blockNumber ||
|
108
|
+
blockNumber - receipt.blockNumber + 1n < confirmations))
|
109
|
+
return;
|
110
|
+
done(() => emit.resolve(receipt));
|
111
|
+
}
|
112
|
+
catch (err) {
|
113
|
+
// If the receipt is not found, the transaction will be pending.
|
114
|
+
// We need to check if it has potentially been replaced.
|
115
|
+
if (err instanceof TransactionNotFoundError ||
|
116
|
+
err instanceof TransactionReceiptNotFoundError) {
|
117
|
+
if (!transaction) {
|
118
|
+
retrying = false;
|
83
119
|
return;
|
84
120
|
}
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
121
|
+
try {
|
122
|
+
replacedTransaction = transaction;
|
123
|
+
// Let's retrieve the transactions from the current block.
|
124
|
+
// We need to retry as some RPC Providers may be slow to sync
|
125
|
+
// up mined blocks.
|
89
126
|
retrying = true;
|
90
|
-
await withRetry(
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
}, {
|
127
|
+
const block = await withRetry(() => getAction(client, getBlock, 'getBlock')({
|
128
|
+
blockNumber,
|
129
|
+
includeTransactions: true,
|
130
|
+
}), {
|
95
131
|
delay: retryDelay,
|
96
132
|
retryCount,
|
133
|
+
shouldRetry: ({ error }) => error instanceof BlockNotFoundError,
|
97
134
|
});
|
98
135
|
retrying = false;
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
if (confirmations > 1 &&
|
104
|
-
(!receipt.blockNumber ||
|
105
|
-
blockNumber - receipt.blockNumber + 1n < confirmations))
|
106
|
-
return;
|
107
|
-
done(() => emit.resolve(receipt));
|
108
|
-
}
|
109
|
-
catch (err) {
|
110
|
-
// If the receipt is not found, the transaction will be pending.
|
111
|
-
// We need to check if it has potentially been replaced.
|
112
|
-
if (err instanceof TransactionNotFoundError ||
|
113
|
-
err instanceof TransactionReceiptNotFoundError) {
|
114
|
-
if (!transaction) {
|
115
|
-
retrying = false;
|
136
|
+
const replacementTransaction = block.transactions.find(({ from, nonce }) => from === replacedTransaction.from &&
|
137
|
+
nonce === replacedTransaction.nonce);
|
138
|
+
// If we couldn't find a replacement transaction, continue polling.
|
139
|
+
if (!replacementTransaction)
|
116
140
|
return;
|
141
|
+
// If we found a replacement transaction, return it's receipt.
|
142
|
+
receipt = await getAction(client, getTransactionReceipt, 'getTransactionReceipt')({
|
143
|
+
hash: replacementTransaction.hash,
|
144
|
+
});
|
145
|
+
// Check if we have enough confirmations. If not, continue polling.
|
146
|
+
if (confirmations > 1 &&
|
147
|
+
(!receipt.blockNumber ||
|
148
|
+
blockNumber - receipt.blockNumber + 1n < confirmations))
|
149
|
+
return;
|
150
|
+
let reason = 'replaced';
|
151
|
+
if (replacementTransaction.to === replacedTransaction.to &&
|
152
|
+
replacementTransaction.value === replacedTransaction.value) {
|
153
|
+
reason = 'repriced';
|
117
154
|
}
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
// We need to retry as some RPC Providers may be slow to sync
|
122
|
-
// up mined blocks.
|
123
|
-
retrying = true;
|
124
|
-
const block = await withRetry(() => getAction(client, getBlock, 'getBlock')({
|
125
|
-
blockNumber,
|
126
|
-
includeTransactions: true,
|
127
|
-
}), {
|
128
|
-
delay: retryDelay,
|
129
|
-
retryCount,
|
130
|
-
shouldRetry: ({ error }) => error instanceof BlockNotFoundError,
|
131
|
-
});
|
132
|
-
retrying = false;
|
133
|
-
const replacementTransaction = block.transactions.find(({ from, nonce }) => from === replacedTransaction.from &&
|
134
|
-
nonce === replacedTransaction.nonce);
|
135
|
-
// If we couldn't find a replacement transaction, continue polling.
|
136
|
-
if (!replacementTransaction)
|
137
|
-
return;
|
138
|
-
// If we found a replacement transaction, return it's receipt.
|
139
|
-
receipt = await getAction(client, getTransactionReceipt, 'getTransactionReceipt')({
|
140
|
-
hash: replacementTransaction.hash,
|
141
|
-
});
|
142
|
-
// Check if we have enough confirmations. If not, continue polling.
|
143
|
-
if (confirmations > 1 &&
|
144
|
-
(!receipt.blockNumber ||
|
145
|
-
blockNumber - receipt.blockNumber + 1n < confirmations))
|
146
|
-
return;
|
147
|
-
let reason = 'replaced';
|
148
|
-
if (replacementTransaction.to === replacedTransaction.to &&
|
149
|
-
replacementTransaction.value === replacedTransaction.value) {
|
150
|
-
reason = 'repriced';
|
151
|
-
}
|
152
|
-
else if (replacementTransaction.from === replacementTransaction.to &&
|
153
|
-
replacementTransaction.value === 0n) {
|
154
|
-
reason = 'cancelled';
|
155
|
-
}
|
156
|
-
done(() => {
|
157
|
-
emit.onReplaced?.({
|
158
|
-
reason,
|
159
|
-
replacedTransaction: replacedTransaction,
|
160
|
-
transaction: replacementTransaction,
|
161
|
-
transactionReceipt: receipt,
|
162
|
-
});
|
163
|
-
emit.resolve(receipt);
|
164
|
-
});
|
165
|
-
}
|
166
|
-
catch (err_) {
|
167
|
-
done(() => emit.reject(err_));
|
155
|
+
else if (replacementTransaction.from === replacementTransaction.to &&
|
156
|
+
replacementTransaction.value === 0n) {
|
157
|
+
reason = 'cancelled';
|
168
158
|
}
|
159
|
+
done(() => {
|
160
|
+
emit.onReplaced?.({
|
161
|
+
reason,
|
162
|
+
replacedTransaction: replacedTransaction,
|
163
|
+
transaction: replacementTransaction,
|
164
|
+
transactionReceipt: receipt,
|
165
|
+
});
|
166
|
+
emit.resolve(receipt);
|
167
|
+
});
|
169
168
|
}
|
170
|
-
|
171
|
-
done(() => emit.reject(
|
169
|
+
catch (err_) {
|
170
|
+
done(() => emit.reject(err_));
|
172
171
|
}
|
173
172
|
}
|
174
|
-
|
175
|
-
|
173
|
+
else {
|
174
|
+
done(() => emit.reject(err));
|
175
|
+
}
|
176
|
+
}
|
177
|
+
},
|
176
178
|
});
|
177
179
|
});
|
180
|
+
return promise;
|
178
181
|
}
|
179
182
|
//# sourceMappingURL=waitForTransactionReceipt.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"waitForTransactionReceipt.js","sourceRoot":"","sources":["../../../actions/public/waitForTransactionReceipt.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAC1D,OAAO,EACL,wBAAwB,EACxB,+BAA+B,EAC/B,qCAAqC,GACtC,MAAM,6BAA6B,CAAA;AAKpC,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAyB,OAAO,EAAE,MAAM,wBAAwB,CAAA;AACvE,OAAO,EAEL,SAAS,GACV,MAAM,kCAAkC,CAAA;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AAEpD,OAAO,EAA0B,QAAQ,EAAE,MAAM,eAAe,CAAA;AAChE,OAAO,EAGL,cAAc,GACf,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAGL,qBAAqB,GACtB,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAEL,gBAAgB,GACjB,MAAM,uBAAuB,CAAA;AA0D9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAG7C,MAAgC,EAChC,EACE,aAAa,GAAG,CAAC,EACjB,IAAI,EACJ,UAAU,EACV,eAAe,GAAG,MAAM,CAAC,eAAe,EACxC,UAAU,GAAG,CAAC,EACd,UAAU,GAAG,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,GAAG,GAAG,EAAE,sBAAsB;AACxE,OAAO,GAAG,OAAO,GAC0B;IAE7C,MAAM,UAAU,GAAG,SAAS,CAAC,CAAC,2BAA2B,EAAE,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAA;IAE7E,IAAI,WAAwD,CAAA;IAC5D,IAAI,mBAAgE,CAAA;IACpE,IAAI,OAA+C,CAAA;IACnD,IAAI,QAAQ,GAAG,KAAK,CAAA;IAEpB,
|
1
|
+
{"version":3,"file":"waitForTransactionReceipt.js","sourceRoot":"","sources":["../../../actions/public/waitForTransactionReceipt.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAC1D,OAAO,EACL,wBAAwB,EACxB,+BAA+B,EAC/B,qCAAqC,GACtC,MAAM,6BAA6B,CAAA;AAKpC,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAyB,OAAO,EAAE,MAAM,wBAAwB,CAAA;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAA;AACpE,OAAO,EAEL,SAAS,GACV,MAAM,kCAAkC,CAAA;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AAEpD,OAAO,EAA0B,QAAQ,EAAE,MAAM,eAAe,CAAA;AAChE,OAAO,EAGL,cAAc,GACf,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAGL,qBAAqB,GACtB,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAEL,gBAAgB,GACjB,MAAM,uBAAuB,CAAA;AA0D9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAG7C,MAAgC,EAChC,EACE,aAAa,GAAG,CAAC,EACjB,IAAI,EACJ,UAAU,EACV,eAAe,GAAG,MAAM,CAAC,eAAe,EACxC,UAAU,GAAG,CAAC,EACd,UAAU,GAAG,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,GAAG,GAAG,EAAE,sBAAsB;AACxE,OAAO,GAAG,OAAO,GAC0B;IAE7C,MAAM,UAAU,GAAG,SAAS,CAAC,CAAC,2BAA2B,EAAE,MAAM,CAAC,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,sBAAsB,CAAC,IAAI,KAAK,sBAAsB,CAAC,EAAE;gCACzD,sBAAsB,CAAC,KAAK,KAAK,EAAE,EACnC,CAAC;gCACD,MAAM,GAAG,WAAW,CAAA;4BACtB,CAAC;4BAED,IAAI,CAAC,GAAG,EAAE;gCACR,IAAI,CAAC,UAAU,EAAE,CAAC;oCAChB,MAAM;oCACN,mBAAmB,EAAE,mBAA2B;oCAChD,WAAW,EAAE,sBAAsB;oCACnC,kBAAkB,EAAE,OAAO;iCAC5B,CAAC,CAAA;gCACF,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;4BACvB,CAAC,CAAC,CAAA;wBACJ,CAAC;wBAAC,OAAO,IAAI,EAAE,CAAC;4BACd,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAA;wBAC/B,CAAC;oBACH,CAAC;yBAAM,CAAC;wBACN,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAA;oBAC9B,CAAC;gBACH,CAAC;YACH,CAAC;SACF,CAAC,CAAA;IACJ,CAAC,CACF,CAAA;IAED,OAAO,OAAO,CAAA;AAChB,CAAC"}
|
@@ -1,4 +1,6 @@
|
|
1
|
+
import { chainConfig } from '../../op-stack/chainConfig.js';
|
1
2
|
import { defineChain } from '../../utils/chain/defineChain.js';
|
3
|
+
const sourceId = 1; // mainnet
|
2
4
|
export const worldchain = /*#__PURE__*/ defineChain({
|
3
5
|
id: 480,
|
4
6
|
name: 'World Chain',
|
@@ -9,10 +11,44 @@ export const worldchain = /*#__PURE__*/ defineChain({
|
|
9
11
|
},
|
10
12
|
blockExplorers: {
|
11
13
|
default: {
|
12
|
-
name: '
|
14
|
+
name: 'Worldscan',
|
15
|
+
url: 'https://worldscan.org',
|
16
|
+
apiUrl: 'https://api.worldscan.org/api',
|
17
|
+
},
|
18
|
+
blockscout: {
|
19
|
+
name: 'Blockscout',
|
13
20
|
url: 'https://worldchain-mainnet.explorer.alchemy.com',
|
21
|
+
apiUrl: 'https://worldchain-mainnet.explorer.alchemy.com/api',
|
22
|
+
},
|
23
|
+
},
|
24
|
+
contracts: {
|
25
|
+
...chainConfig.contracts,
|
26
|
+
multicall3: {
|
27
|
+
address: '0xca11bde05977b3631167028862be2a173976ca11',
|
28
|
+
blockCreated: 0,
|
29
|
+
},
|
30
|
+
disputeGameFactory: {
|
31
|
+
[sourceId]: {
|
32
|
+
address: '0x0E90dCAFBC242D2C861A20Bb20EC8E7182965a52',
|
33
|
+
},
|
34
|
+
},
|
35
|
+
l2OutputOracle: {
|
36
|
+
[sourceId]: {
|
37
|
+
address: '0x19A6d1E9034596196295CF148509796978343c5D',
|
38
|
+
},
|
39
|
+
},
|
40
|
+
portal: {
|
41
|
+
[sourceId]: {
|
42
|
+
address: '0xd5ec14a83B7d95BE1E2Ac12523e2dEE12Cbeea6C',
|
43
|
+
},
|
44
|
+
},
|
45
|
+
l1StandardBridge: {
|
46
|
+
[sourceId]: {
|
47
|
+
address: '0x470458C91978D2d929704489Ad730DC3E3001113',
|
48
|
+
},
|
14
49
|
},
|
15
50
|
},
|
16
51
|
testnet: false,
|
52
|
+
sourceId,
|
17
53
|
});
|
18
54
|
//# sourceMappingURL=worldchain.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"worldchain.js","sourceRoot":"","sources":["../../../chains/definitions/worldchain.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAE9D,MAAM,CAAC,MAAM,UAAU,GAAG,aAAa,CAAC,WAAW,CAAC;IAClD,EAAE,EAAE,GAAG;IACP,IAAI,EAAE,aAAa;IACnB,OAAO,EAAE,YAAY;IACrB,cAAc,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC9D,OAAO,EAAE;QACP,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,iDAAiD,CAAC,EAAE;KACvE;IACD,cAAc,EAAE;QACd,OAAO,EAAE;YACP,IAAI,EAAE,
|
1
|
+
{"version":3,"file":"worldchain.js","sourceRoot":"","sources":["../../../chains/definitions/worldchain.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAE9D,MAAM,QAAQ,GAAG,CAAC,CAAA,CAAC,UAAU;AAE7B,MAAM,CAAC,MAAM,UAAU,GAAG,aAAa,CAAC,WAAW,CAAC;IAClD,EAAE,EAAE,GAAG;IACP,IAAI,EAAE,aAAa;IACnB,OAAO,EAAE,YAAY;IACrB,cAAc,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC9D,OAAO,EAAE;QACP,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,iDAAiD,CAAC,EAAE;KACvE;IACD,cAAc,EAAE;QACd,OAAO,EAAE;YACP,IAAI,EAAE,WAAW;YACjB,GAAG,EAAE,uBAAuB;YAC5B,MAAM,EAAE,+BAA+B;SACxC;QACD,UAAU,EAAE;YACV,IAAI,EAAE,YAAY;YAClB,GAAG,EAAE,iDAAiD;YACtD,MAAM,EAAE,qDAAqD;SAC9D;KACF;IACD,SAAS,EAAE;QACT,GAAG,WAAW,CAAC,SAAS;QACxB,UAAU,EAAE;YACV,OAAO,EAAE,4CAA4C;YACrD,YAAY,EAAE,CAAC;SAChB;QACD,kBAAkB,EAAE;YAClB,CAAC,QAAQ,CAAC,EAAE;gBACV,OAAO,EAAE,4CAA4C;aACtD;SACF;QACD,cAAc,EAAE;YACd,CAAC,QAAQ,CAAC,EAAE;gBACV,OAAO,EAAE,4CAA4C;aACtD;SACF;QACD,MAAM,EAAE;YACN,CAAC,QAAQ,CAAC,EAAE;gBACV,OAAO,EAAE,4CAA4C;aACtD;SACF;QACD,gBAAgB,EAAE;YAChB,CAAC,QAAQ,CAAC,EAAE;gBACV,OAAO,EAAE,4CAA4C;aACtD;SACF;KACF;IACD,OAAO,EAAE,KAAK;IACd,QAAQ;CACT,CAAC,CAAA"}
|
@@ -1,4 +1,6 @@
|
|
1
|
+
import { chainConfig } from '../../op-stack/chainConfig.js';
|
1
2
|
import { defineChain } from '../../utils/chain/defineChain.js';
|
3
|
+
const sourceId = 11_155_111; // sepolia
|
2
4
|
export const worldchainSepolia = /*#__PURE__*/ defineChain({
|
3
5
|
id: 4801,
|
4
6
|
name: 'World Chain Sepolia',
|
@@ -10,10 +12,43 @@ export const worldchainSepolia = /*#__PURE__*/ defineChain({
|
|
10
12
|
},
|
11
13
|
blockExplorers: {
|
12
14
|
default: {
|
13
|
-
name: '
|
15
|
+
name: 'Worldscan Sepolia',
|
16
|
+
url: 'https://sepolia.worldscan.org',
|
17
|
+
},
|
18
|
+
blockscout: {
|
19
|
+
name: 'Blockscout',
|
14
20
|
url: 'https://worldchain-sepolia.explorer.alchemy.com',
|
21
|
+
apiUrl: 'https://worldchain-sepolia.explorer.alchemy.com/api',
|
22
|
+
},
|
23
|
+
},
|
24
|
+
contracts: {
|
25
|
+
...chainConfig.contracts,
|
26
|
+
multicall3: {
|
27
|
+
address: '0xca11bde05977b3631167028862be2a173976ca11',
|
28
|
+
blockCreated: 0,
|
29
|
+
},
|
30
|
+
disputeGameFactory: {
|
31
|
+
[sourceId]: {
|
32
|
+
address: '0x8cF97Ee616C986a070F5020d973b456D0120C253',
|
33
|
+
},
|
34
|
+
},
|
35
|
+
l2OutputOracle: {
|
36
|
+
[sourceId]: {
|
37
|
+
address: '0xc8886f8BAb6Eaeb215aDB5f1c686BF699248300e',
|
38
|
+
},
|
39
|
+
},
|
40
|
+
portal: {
|
41
|
+
[sourceId]: {
|
42
|
+
address: '0xFf6EBa109271fe6d4237EeeD4bAb1dD9A77dD1A4',
|
43
|
+
},
|
44
|
+
},
|
45
|
+
l1StandardBridge: {
|
46
|
+
[sourceId]: {
|
47
|
+
address: '0xd7DF54b3989855eb66497301a4aAEc33Dbb3F8DE',
|
48
|
+
},
|
15
49
|
},
|
16
50
|
},
|
17
51
|
testnet: true,
|
52
|
+
sourceId,
|
18
53
|
});
|
19
54
|
//# sourceMappingURL=worldchainSepolia.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"worldchainSepolia.js","sourceRoot":"","sources":["../../../chains/definitions/worldchainSepolia.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAE9D,MAAM,CAAC,MAAM,iBAAiB,GAAG,aAAa,CAAC,WAAW,CAAC;IACzD,EAAE,EAAE,IAAI;IACR,IAAI,EAAE,qBAAqB;IAC3B,OAAO,EAAE,oBAAoB;IAC7B,cAAc,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC9D,OAAO,EAAE;QACP,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,iDAAiD,CAAC,EAAE;QACtE,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,iDAAiD,CAAC,EAAE;KACtE;IACD,cAAc,EAAE;QACd,OAAO,EAAE;YACP,IAAI,EAAE,
|
1
|
+
{"version":3,"file":"worldchainSepolia.js","sourceRoot":"","sources":["../../../chains/definitions/worldchainSepolia.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAE9D,MAAM,QAAQ,GAAG,UAAU,CAAA,CAAC,UAAU;AAEtC,MAAM,CAAC,MAAM,iBAAiB,GAAG,aAAa,CAAC,WAAW,CAAC;IACzD,EAAE,EAAE,IAAI;IACR,IAAI,EAAE,qBAAqB;IAC3B,OAAO,EAAE,oBAAoB;IAC7B,cAAc,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC9D,OAAO,EAAE;QACP,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,iDAAiD,CAAC,EAAE;QACtE,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,iDAAiD,CAAC,EAAE;KACtE;IACD,cAAc,EAAE;QACd,OAAO,EAAE;YACP,IAAI,EAAE,mBAAmB;YACzB,GAAG,EAAE,+BAA+B;SACrC;QACD,UAAU,EAAE;YACV,IAAI,EAAE,YAAY;YAClB,GAAG,EAAE,iDAAiD;YACtD,MAAM,EAAE,qDAAqD;SAC9D;KACF;IACD,SAAS,EAAE;QACT,GAAG,WAAW,CAAC,SAAS;QACxB,UAAU,EAAE;YACV,OAAO,EAAE,4CAA4C;YACrD,YAAY,EAAE,CAAC;SAChB;QACD,kBAAkB,EAAE;YAClB,CAAC,QAAQ,CAAC,EAAE;gBACV,OAAO,EAAE,4CAA4C;aACtD;SACF;QACD,cAAc,EAAE;YACd,CAAC,QAAQ,CAAC,EAAE;gBACV,OAAO,EAAE,4CAA4C;aACtD;SACF;QACD,MAAM,EAAE;YACN,CAAC,QAAQ,CAAC,EAAE;gBACV,OAAO,EAAE,4CAA4C;aACtD;SACF;QACD,gBAAgB,EAAE;YAChB,CAAC,QAAQ,CAAC,EAAE;gBACV,OAAO,EAAE,4CAA4C;aACtD;SACF;KACF;IACD,OAAO,EAAE,IAAI;IACb,QAAQ;CACT,CAAC,CAAA"}
|
@@ -8,18 +8,18 @@ export const xdc = /*#__PURE__*/ defineChain({
|
|
8
8
|
symbol: 'XDC',
|
9
9
|
},
|
10
10
|
rpcUrls: {
|
11
|
-
default: { http: ['https://rpc.
|
11
|
+
default: { http: ['https://rpc.xdcrpc.com'] },
|
12
12
|
},
|
13
13
|
blockExplorers: {
|
14
14
|
default: {
|
15
|
-
name: '
|
16
|
-
url: 'https://
|
15
|
+
name: 'XDCScan',
|
16
|
+
url: 'https://xdcscan.com',
|
17
17
|
},
|
18
18
|
},
|
19
19
|
contracts: {
|
20
20
|
multicall3: {
|
21
|
-
address: '
|
22
|
-
blockCreated:
|
21
|
+
address: '0x0B1795ccA8E4eC4df02346a082df54D437F8D9aF',
|
22
|
+
blockCreated: 75884020,
|
23
23
|
},
|
24
24
|
},
|
25
25
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"xdc.js","sourceRoot":"","sources":["../../../chains/definitions/xdc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAE9D,MAAM,CAAC,MAAM,GAAG,GAAG,aAAa,CAAC,WAAW,CAAC;IAC3C,EAAE,EAAE,EAAE;IACN,IAAI,EAAE,gBAAgB;IACtB,cAAc,EAAE;QACd,QAAQ,EAAE,EAAE;QACZ,IAAI,EAAE,KAAK;QACX,MAAM,EAAE,KAAK;KACd;IACD,OAAO,EAAE;QACP,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,
|
1
|
+
{"version":3,"file":"xdc.js","sourceRoot":"","sources":["../../../chains/definitions/xdc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAE9D,MAAM,CAAC,MAAM,GAAG,GAAG,aAAa,CAAC,WAAW,CAAC;IAC3C,EAAE,EAAE,EAAE;IACN,IAAI,EAAE,gBAAgB;IACtB,cAAc,EAAE;QACd,QAAQ,EAAE,EAAE;QACZ,IAAI,EAAE,KAAK;QACX,MAAM,EAAE,KAAK;KACd;IACD,OAAO,EAAE;QACP,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,wBAAwB,CAAC,EAAE;KAC9C;IACD,cAAc,EAAE;QACd,OAAO,EAAE;YACP,IAAI,EAAE,SAAS;YACf,GAAG,EAAE,qBAAqB;SAC3B;KACF;IACD,SAAS,EAAE;QACT,UAAU,EAAE;YACV,OAAO,EAAE,4CAA4C;YACrD,YAAY,EAAE,QAAQ;SACvB;KACF;CACF,CAAC,CAAA"}
|
package/_esm/errors/version.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export const version = '2.21.
|
1
|
+
export const version = '2.21.34';
|
2
2
|
//# sourceMappingURL=version.js.map
|
@@ -1,5 +1,4 @@
|
|
1
1
|
import { parseAccount } from '../../accounts/utils/parseAccount.js';
|
2
|
-
import { prepareTransactionRequest, } from '../../actions/wallet/prepareTransactionRequest.js';
|
3
2
|
import { AccountNotFoundError } from '../../errors/account.js';
|
4
3
|
import { numberToHex } from '../../utils/encoding/toHex.js';
|
5
4
|
import { getCallError } from '../../utils/errors/getCallError.js';
|
@@ -34,9 +33,7 @@ export async function estimateGas(client, args) {
|
|
34
33
|
throw new AccountNotFoundError();
|
35
34
|
const account = parseAccount(account_);
|
36
35
|
try {
|
37
|
-
const { accessList, blockNumber, blockTag, data, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to, value, ...rest } =
|
38
|
-
? (await prepareTransactionRequest(client, args))
|
39
|
-
: args;
|
36
|
+
const { accessList, blockNumber, blockTag, data, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to, value, ...rest } = args;
|
40
37
|
const blockNumberHex = blockNumber ? numberToHex(blockNumber) : undefined;
|
41
38
|
const block = blockNumberHex || blockTag;
|
42
39
|
assertRequest(args);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"estimateGas.js","sourceRoot":"","sources":["../../../linea/actions/estimateGas.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAA;
|
1
|
+
{"version":3,"file":"estimateGas.js","sourceRoot":"","sources":["../../../linea/actions/estimateGas.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAA;AAInE,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAM9D,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,EAAE,YAAY,EAAE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oBAAoB;YACpB,KAAK;YACL,EAAE;YACF,KAAK;SACgB,CAAC,CAAA;QAMxB,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,iBAAiB,EAAE,GAClD,MAAM,MAAM,CAAC,OAAO,CAAyB;YAC3C,MAAM,EAAE,mBAAmB;YAC3B,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;SAC7C,CAAC,CAAA;QACJ,OAAO;YACL,aAAa,EAAE,MAAM,CAAC,aAAa,CAAC;YACpC,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC;YAC1B,iBAAiB,EAAE,MAAM,CAAC,iBAAiB,CAAC;SAC7C,CAAA;IACH,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,YAAY,CAAC,GAAgB,EAAE;YACnC,GAAG,IAAI;YACP,OAAO;YACP,KAAK,EAAE,MAAM,CAAC,KAAK;SACpB,CAAC,CAAA;IACJ,CAAC;AACH,CAAC"}
|
package/_esm/op-stack/chains.js
CHANGED
@@ -16,6 +16,8 @@ export { shape } from '../chains/definitions/shape.js';
|
|
16
16
|
export { snax } from '../chains/definitions/snax.js';
|
17
17
|
export { snaxTestnet } from '../chains/definitions/snaxTestnet.js';
|
18
18
|
export { soneiumMinato } from '../chains/definitions/soneiumMinato.js';
|
19
|
+
export { worldchain } from '../chains/definitions/worldchain.js';
|
20
|
+
export { worldchainSepolia } from '../chains/definitions/worldchainSepolia.js';
|
19
21
|
export { zora } from '../chains/definitions/zora.js';
|
20
22
|
export { zoraSepolia } from '../chains/definitions/zoraSepolia.js';
|
21
23
|
export { zoraTestnet } from '../chains/definitions/zoraTestnet.js';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"chains.js","sourceRoot":"","sources":["../../op-stack/chains.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,C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AAE,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,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,3 +1,4 @@
|
|
1
|
+
import { withResolvers } from './withResolvers.js';
|
1
2
|
const schedulerCache = /*#__PURE__*/ new Map();
|
2
3
|
/** @internal */
|
3
4
|
export function createBatchScheduler({ fn, id, shouldSplitBatch, wait = 0, sort, }) {
|
@@ -12,14 +13,14 @@ export function createBatchScheduler({ fn, id, shouldSplitBatch, wait = 0, sort,
|
|
12
13
|
if (sort && Array.isArray(data))
|
13
14
|
data.sort(sort);
|
14
15
|
for (let i = 0; i < scheduler.length; i++) {
|
15
|
-
const {
|
16
|
-
|
16
|
+
const { resolve } = scheduler[i];
|
17
|
+
resolve?.([data[i], data]);
|
17
18
|
}
|
18
19
|
})
|
19
20
|
.catch((err) => {
|
20
21
|
for (let i = 0; i < scheduler.length; i++) {
|
21
|
-
const {
|
22
|
-
|
22
|
+
const { reject } = scheduler[i];
|
23
|
+
reject?.(err);
|
23
24
|
}
|
24
25
|
});
|
25
26
|
};
|
@@ -30,20 +31,16 @@ export function createBatchScheduler({ fn, id, shouldSplitBatch, wait = 0, sort,
|
|
30
31
|
return {
|
31
32
|
flush,
|
32
33
|
async schedule(args) {
|
33
|
-
const
|
34
|
-
const promise = new Promise((resolve, reject) => {
|
35
|
-
pendingPromise.resolve = resolve;
|
36
|
-
pendingPromise.reject = reject;
|
37
|
-
});
|
34
|
+
const { promise, resolve, reject } = withResolvers();
|
38
35
|
const split = shouldSplitBatch?.([...getBatchedArgs(), args]);
|
39
36
|
if (split)
|
40
37
|
exec();
|
41
38
|
const hasActiveScheduler = getScheduler().length > 0;
|
42
39
|
if (hasActiveScheduler) {
|
43
|
-
setScheduler({ args,
|
40
|
+
setScheduler({ args, resolve, reject });
|
44
41
|
return promise;
|
45
42
|
}
|
46
|
-
setScheduler({ args,
|
43
|
+
setScheduler({ args, resolve, reject });
|
47
44
|
setTimeout(exec, wait);
|
48
45
|
return promise;
|
49
46
|
},
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"createBatchScheduler.js","sourceRoot":"","sources":["../../../utils/promise/createBatchScheduler.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"createBatchScheduler.js","sourceRoot":"","sources":["../../../utils/promise/createBatchScheduler.ts"],"names":[],"mappings":"AACA,OAAO,EAA6B,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAsC7E,MAAM,cAAc,GAAG,aAAa,CAAC,IAAI,GAAG,EAAoC,CAAA;AAEhF,gBAAgB;AA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AA;IAE7C,MAAM,cAAc,GAAG,GAAG,EAAE,CAC1B,YAAY,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAiB,CAAA;IAExD,MAAM,YAAY,GAAG,GAAG,EAAE,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,CAAA;IAEvD,MAAM,YAAY,GAAG,CAAC,IAAmB,EAAE,EAAE,CAC3C,cAAc,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,GAAG,YAAY,EAAE,EAAE,IAAI,CAAC,CAAC,CAAA;IAEnD,OAAO;QACL,KAAK;QACL,KAAK,CAAC,QAAQ,CAAC,IAAgB;YAC7B,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,aAAa,EAAE,CAAA;YAEpD,MAAM,KAAK,GAAG,gBAAgB,EAAE,CAAC,CAAC,GAAG,cAAc,EAAE,EAAE,IAAI,CAAC,CAAC,CAAA;YAE7D,IAAI,KAAK;gBAAE,IAAI,EAAE,CAAA;YAEjB,MAAM,kBAAkB,GAAG,YAAY,EAAE,CAAC,MAAM,GAAG,CAAC,CAAA;YACpD,IAAI,kBAAkB,EAAE,CAAC;gBACvB,YAAY,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAA;gBACvC,OAAO,OAAO,CAAA;YAChB,CAAC;YAED,YAAY,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAA;YACvC,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;YACtB,OAAO,OAAO,CAAA;QAChB,CAAC;KACmE,CAAA;AACxE,CAAC"}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
/** @internal */
|
2
|
+
export function withResolvers() {
|
3
|
+
let resolve = () => undefined;
|
4
|
+
let reject = () => undefined;
|
5
|
+
const promise = new Promise((resolve_, reject_) => {
|
6
|
+
resolve = resolve_;
|
7
|
+
reject = reject_;
|
8
|
+
});
|
9
|
+
return { promise, resolve, reject };
|
10
|
+
}
|
11
|
+
//# sourceMappingURL=withResolvers.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"withResolvers.js","sourceRoot":"","sources":["../../../utils/promise/withResolvers.ts"],"names":[],"mappings":"AAOA,gBAAgB;AAChB,MAAM,UAAU,aAAa;IAC3B,IAAI,OAAO,GAA0C,GAAG,EAAE,CAAC,SAAS,CAAA;IACpE,IAAI,MAAM,GAAyC,GAAG,EAAE,CAAC,SAAS,CAAA;IAElE,MAAM,OAAO,GAAG,IAAI,OAAO,CAAO,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE;QACtD,OAAO,GAAG,QAAQ,CAAA;QAClB,MAAM,GAAG,OAAO,CAAA;IAClB,CAAC,CAAC,CAAA;IAEF,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,CAAA;AACrC,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"waitForTransactionReceipt.d.ts","sourceRoot":"","sources":["../../../actions/public/waitForTransactionReceipt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAA;AAO5E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAE7D,OAAO,EAAE,KAAK,gBAAgB,EAAW,MAAM,wBAAwB,CAAA;
|
1
|
+
{"version":3,"file":"waitForTransactionReceipt.d.ts","sourceRoot":"","sources":["../../../actions/public/waitForTransactionReceipt.ts"],"names":[],"mappings":"AAAA,OAAO,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