@0xmonaco/types 0.8.14 → 0.8.15

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.
@@ -4,7 +4,7 @@ import type { BaseAPI } from "../api";
4
4
  * Request body for `POST /api/v1/withdrawals`.
5
5
  *
6
6
  * Initiating a withdrawal debits the caller's balance via the matching engine
7
- * and allocates a `withdrawal_index`. The executable calldata is fetched
7
+ * and allocates a `withdrawalIndex`. The executable calldata is fetched
8
8
  * separately once the withdrawal root is confirmed on-chain. Master accounts
9
9
  * with the withdraw permission only.
10
10
  */
@@ -27,14 +27,14 @@ export interface InitiateWithdrawalRequest {
27
27
  }
28
28
  /**
29
29
  * Response shape shared by `POST /api/v1/withdrawals` and
30
- * `GET /api/v1/withdrawals/{withdrawalIndex}`. Field names match the wire
31
- * (snake_case) form returned by the gateway.
30
+ * `GET /api/v1/withdrawals/{withdrawalIndex}`. Field names match the camelCase
31
+ * wire form returned by the gateway.
32
32
  */
33
33
  export interface WithdrawalResponse {
34
34
  /** Allocated withdrawal index — matches `executeWithdrawal.index` on-chain. */
35
- withdrawal_index: number;
35
+ withdrawalIndex: number;
36
36
  /** 0x-prefixed lowercase address of the vault contract the calldata is submitted to. */
37
- vault_address: Address;
37
+ vaultAddress: Address;
38
38
  /**
39
39
  * 0x-prefixed ABI-encoded `executeWithdrawal(...)` calldata; submit as
40
40
  * `tx.data`. Empty from `initiateWithdrawal` (the merkle proof is not
@@ -58,4 +58,57 @@ export interface WithdrawalsAPI extends BaseAPI {
58
58
  * while the proof is not yet available.
59
59
  */
60
60
  getWithdrawal(withdrawalIndex: number): Promise<WithdrawalResponse>;
61
+ /**
62
+ * List the caller's pending withdrawals (those still awaiting on-chain root
63
+ * confirmation). Authenticated and scoped to the caller. Newest first, paged.
64
+ */
65
+ listPendingWithdrawals(params?: ListPendingWithdrawalsParams): Promise<ListPendingWithdrawalsResponse>;
66
+ }
67
+ /** Query parameters for {@link WithdrawalsAPI.listPendingWithdrawals}. */
68
+ export interface ListPendingWithdrawalsParams {
69
+ /** Page number, 1-based. Defaults to 1. */
70
+ page?: number;
71
+ /** Items per page (1–100). Defaults to 20. */
72
+ pageSize?: number;
73
+ }
74
+ /**
75
+ * A single pending withdrawal in a {@link ListPendingWithdrawalsResponse}. A
76
+ * lightweight summary — the executable calldata is not included (it does not
77
+ * exist until the withdrawal is confirmed on-chain; fetch it via
78
+ * {@link WithdrawalsAPI.getWithdrawal} once ready).
79
+ */
80
+ export interface PendingWithdrawal {
81
+ /** Allocated withdrawal index — matches `executeWithdrawal.index` on-chain. */
82
+ withdrawalIndex: number;
83
+ /** UUID of the withdrawn asset. */
84
+ assetId: string;
85
+ /** Ticker symbol of the withdrawn asset. */
86
+ assetSymbol: string;
87
+ /**
88
+ * Raw token amount in the smallest unit (e.g. wei) as a stringified positive
89
+ * integer.
90
+ */
91
+ amount: string;
92
+ /** On-chain address that will receive the withdrawal. */
93
+ destination: Address;
94
+ /** Withdrawal lifecycle status; always `"pending"` for entries in this list. */
95
+ status: string;
96
+ /** RFC 3339 timestamp of when the withdrawal was initiated. */
97
+ createdAt: string;
98
+ }
99
+ /**
100
+ * Response for `GET /api/v1/withdrawals` — a page of the caller's pending
101
+ * withdrawals plus pagination metadata.
102
+ */
103
+ export interface ListPendingWithdrawalsResponse {
104
+ /** The page of pending withdrawals, newest first. */
105
+ withdrawals: PendingWithdrawal[];
106
+ /** Total number of pending withdrawals for the caller. */
107
+ total: number;
108
+ /** Current page number. */
109
+ page: number;
110
+ /** Items per page. */
111
+ pageSize: number;
112
+ /** Total number of pages. */
113
+ totalPages: number;
61
114
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0xmonaco/types",
3
- "version": "0.8.14",
3
+ "version": "0.8.15",
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.14",
23
+ "@0xmonaco/contracts": "0.8.15",
24
24
  "zod": "^4.1.12"
25
25
  },
26
26
  "peerDependencies": {