@0xmonaco/types 0.8.7-develop.5d0e403 → 0.8.7-develop.a107b34

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.
@@ -3,7 +3,8 @@ import type { BaseAPI } from "../api";
3
3
  * Request body for `POST /api/v1/withdrawals`.
4
4
  *
5
5
  * Initiating a withdrawal debits the caller's balance via the matching engine
6
- * and returns pre-signed `executeSignedWithdrawal` calldata. Master accounts
6
+ * and allocates a `withdrawal_index`. The executable calldata is fetched
7
+ * separately once the withdrawal root is confirmed on-chain. Master accounts
7
8
  * with the withdraw permission only.
8
9
  */
9
10
  export interface InitiateWithdrawalRequest {
@@ -16,6 +17,12 @@ export interface InitiateWithdrawalRequest {
16
17
  amount: string;
17
18
  /** On-chain address that will receive the withdrawal (EVM, 0x-prefixed). */
18
19
  destination: string;
20
+ /**
21
+ * Source ledger for the withdrawal. Defaults to `"spot"` when omitted.
22
+ * `"margin"` directly debits withdrawable collateral from the parent margin
23
+ * account.
24
+ */
25
+ source?: "spot" | "margin";
19
26
  }
20
27
  /**
21
28
  * Response shape shared by `POST /api/v1/withdrawals` and
@@ -23,21 +30,31 @@ export interface InitiateWithdrawalRequest {
23
30
  * (snake_case) form returned by the gateway.
24
31
  */
25
32
  export interface WithdrawalResponse {
26
- /** Allocated withdrawal index — matches `executeSignedWithdrawal.index` on-chain. */
33
+ /** Allocated withdrawal index — matches `executeWithdrawal.index` on-chain. */
27
34
  withdrawal_index: number;
28
35
  /** 0x-prefixed lowercase address of the vault contract the calldata is submitted to. */
29
36
  vault_address: string;
30
- /** 0x-prefixed ABI-encoded, signed `executeSignedWithdrawal(...)` calldata; submit as `tx.data`. */
37
+ /**
38
+ * 0x-prefixed ABI-encoded `executeWithdrawal(...)` calldata; submit as
39
+ * `tx.data`. Empty from `initiateWithdrawal` (the merkle proof is not
40
+ * available until the withdrawal root is confirmed on-chain) — fetch it from
41
+ * `getWithdrawal` once ready.
42
+ */
31
43
  calldata: string;
32
44
  }
33
45
  /**
34
- * Low-level withdrawals API: allocate a withdrawal and fetch its signed
35
- * calldata. Does not submit on-chain — see the vault API for the high-level
36
- * flow that also broadcasts the transaction.
46
+ * Low-level withdrawals API: allocate a withdrawal and fetch its
47
+ * `executeWithdrawal` calldata. Does not submit on-chain — see the vault API
48
+ * for the high-level flow that polls for the calldata and broadcasts the
49
+ * transaction.
37
50
  */
38
51
  export interface WithdrawalsAPI extends BaseAPI {
39
- /** Initiate a withdrawal and return the signed calldata. Authenticated. */
52
+ /** Initiate a withdrawal and return its index. Authenticated. */
40
53
  initiateWithdrawal(request: InitiateWithdrawalRequest): Promise<WithdrawalResponse>;
41
- /** Re-fetch a previously-initiated withdrawal's signed calldata. Public — no auth. */
54
+ /**
55
+ * Fetch a withdrawal's `executeWithdrawal` calldata by index. Public — no
56
+ * auth. Throws an `APIError` (404 not-persisted-yet / 409 not-confirmed-yet)
57
+ * while the proof is not yet available.
58
+ */
42
59
  getWithdrawal(withdrawalIndex: number): Promise<WithdrawalResponse>;
43
60
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0xmonaco/types",
3
- "version": "0.8.7-develop.5d0e403",
3
+ "version": "0.8.7-develop.a107b34",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -20,7 +20,7 @@
20
20
  "lint": "biome lint ."
21
21
  },
22
22
  "dependencies": {
23
- "@0xmonaco/contracts": "0.8.7-develop.5d0e403",
23
+ "@0xmonaco/contracts": "0.8.7-develop.a107b34",
24
24
  "zod": "^4.1.12"
25
25
  },
26
26
  "peerDependencies": {