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