@matterlabs/zksync-js 0.0.3 → 0.0.6
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/README.md +1 -3
- package/dist/adapters/ethers/client.js +1 -1
- package/dist/adapters/ethers/index.cjs +23 -1
- package/dist/adapters/ethers/index.cjs.map +1 -1
- package/dist/adapters/ethers/index.js +4 -4
- package/dist/adapters/ethers/resources/withdrawals/index.d.ts +11 -0
- package/dist/adapters/ethers/sdk.cjs +23 -1
- package/dist/adapters/ethers/sdk.cjs.map +1 -1
- package/dist/adapters/ethers/sdk.js +2 -2
- package/dist/adapters/viem/index.cjs +23 -1
- package/dist/adapters/viem/index.cjs.map +1 -1
- package/dist/adapters/viem/index.js +3 -3
- package/dist/adapters/viem/resources/withdrawals/index.d.ts +11 -0
- package/dist/adapters/viem/sdk.cjs +23 -1
- package/dist/adapters/viem/sdk.cjs.map +1 -1
- package/dist/adapters/viem/sdk.js +1 -1
- package/dist/{chunk-JXUFGIJG.js → chunk-2MDK3GLO.js} +23 -1
- package/dist/{chunk-5YWP4CZP.js → chunk-WU2LOG2A.js} +24 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,8 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
_TypeScript SDK for deposits, withdrawals, and RPC access across the Elastic Network_
|
|
6
6
|
|
|
7
|
-
**Note**: This repository is a successor to the original ZKsync SDK, which can be found at **[dutterbutter/zksync-sdk](https://github.com/dutterbutter/zksync-sdk)**.
|
|
8
|
-
|
|
9
7
|
[](https://github.com/matter-labs/zksync-js/actions/workflows/ci-check.yaml)
|
|
10
8
|
[](https://github.com/matter-labs/zksync-js/releases/latest)
|
|
11
9
|
[](LICENSE)
|
|
@@ -107,7 +105,7 @@ await sdk.deposits.wait(handle, { for: 'l2' });
|
|
|
107
105
|
console.log('Deposit complete ✅');
|
|
108
106
|
```
|
|
109
107
|
|
|
110
|
-
> See [Quickstart docs](https://matter-labs.github.io/zksync-js/quickstart/) for full examples.
|
|
108
|
+
> See [Quickstart docs](https://matter-labs.github.io/zksync-js/latest/quickstart/index.html) for full examples.
|
|
111
109
|
|
|
112
110
|
## 📚 Documentation
|
|
113
111
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { createEthersClient } from '../../chunk-3MRGU4HV.js';
|
|
2
2
|
import '../../chunk-XRE7H466.js';
|
|
3
|
-
import '../../chunk-6K6VJQAL.js';
|
|
4
3
|
import '../../chunk-NCAIVYBR.js';
|
|
4
|
+
import '../../chunk-6K6VJQAL.js';
|
|
5
5
|
import '../../chunk-M5J2MM2U.js';
|
|
6
6
|
import '../../chunk-F2ENUV3A.js';
|
|
@@ -7843,6 +7843,27 @@ function createWithdrawalsResource(client, tokens, contracts) {
|
|
|
7843
7843
|
message: "Internal error while attempting to tryFinalize withdrawal.",
|
|
7844
7844
|
ctx: { l2TxHash, where: "withdrawals.tryFinalize" }
|
|
7845
7845
|
});
|
|
7846
|
+
const tryWait = (h, opts) => toResult2(
|
|
7847
|
+
OP_WITHDRAWALS.tryWait,
|
|
7848
|
+
async () => {
|
|
7849
|
+
const v = await wait(h, opts);
|
|
7850
|
+
if (v) return v;
|
|
7851
|
+
throw createError("STATE", {
|
|
7852
|
+
resource: "withdrawals",
|
|
7853
|
+
operation: "withdrawals.tryWait",
|
|
7854
|
+
message: opts.for === "l2" ? "No L2 receipt yet; the withdrawal has not executed on L2." : "No L1 receipt yet; the withdrawal has not been included on L1.",
|
|
7855
|
+
context: {
|
|
7856
|
+
for: opts.for,
|
|
7857
|
+
l2TxHash: typeof h === "string" ? h : "l2TxHash" in h ? h.l2TxHash : void 0,
|
|
7858
|
+
where: "withdrawals.tryWait"
|
|
7859
|
+
}
|
|
7860
|
+
});
|
|
7861
|
+
},
|
|
7862
|
+
{
|
|
7863
|
+
message: "Internal error while waiting for withdrawal.",
|
|
7864
|
+
ctx: { input: h, for: opts?.for, where: "withdrawals.tryWait" }
|
|
7865
|
+
}
|
|
7866
|
+
);
|
|
7846
7867
|
return {
|
|
7847
7868
|
quote,
|
|
7848
7869
|
tryQuote,
|
|
@@ -7853,7 +7874,8 @@ function createWithdrawalsResource(client, tokens, contracts) {
|
|
|
7853
7874
|
status,
|
|
7854
7875
|
wait,
|
|
7855
7876
|
finalize,
|
|
7856
|
-
tryFinalize
|
|
7877
|
+
tryFinalize,
|
|
7878
|
+
tryWait
|
|
7857
7879
|
};
|
|
7858
7880
|
}
|
|
7859
7881
|
|