@0xmonaco/types 0.8.7-develop.0e951a5 → 0.8.7-develop.0f12336
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/api/index.d.ts +7 -0
- package/dist/applications/index.d.ts +47 -5
- package/dist/applications/index.js +2 -1
- package/dist/applications/requests.d.ts +78 -0
- package/dist/applications/requests.js +7 -0
- package/dist/applications/responses.d.ts +213 -2
- package/dist/applications/responses.js +3 -1
- package/dist/auth/index.d.ts +6 -12
- package/dist/auth/index.js +2 -2
- package/dist/auth/responses.d.ts +2 -12
- package/dist/contracts/balances.d.ts +1 -1
- package/dist/delegated-agents/index.d.ts +35 -18
- package/dist/faucet/index.d.ts +54 -0
- package/dist/faucet/index.js +10 -0
- package/dist/fees/index.d.ts +4 -4
- package/dist/fees/responses.d.ts +17 -17
- package/dist/fees/responses.js +20 -20
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/margin-accounts/index.d.ts +91 -55
- package/dist/market/index.d.ts +214 -95
- package/dist/positions/index.d.ts +67 -44
- package/dist/profile/index.d.ts +156 -70
- package/dist/sdk/index.d.ts +24 -3
- package/dist/sub-accounts/index.d.ts +146 -0
- package/dist/sub-accounts/index.js +9 -0
- package/dist/trading/index.d.ts +8 -8
- package/dist/trading/orders.d.ts +20 -20
- package/dist/trading/responses.d.ts +81 -100
- package/dist/validation/margin-accounts.d.ts +53 -13
- package/dist/validation/margin-accounts.js +38 -14
- package/dist/validation/market.d.ts +1 -1
- package/dist/validation/market.js +1 -1
- package/dist/validation/positions.d.ts +11 -7
- package/dist/validation/positions.js +10 -6
- package/dist/validation/profile.d.ts +13 -6
- package/dist/validation/profile.js +13 -6
- package/dist/validation/trading.d.ts +17 -42
- package/dist/validation/trading.js +51 -42
- 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/whitelist/index.d.ts +44 -0
- package/dist/whitelist/index.js +10 -0
- package/dist/wire/assert.d.ts +54 -0
- package/dist/wire/assert.js +0 -0
- package/dist/wire/audit.d.ts +47 -0
- package/dist/wire/audit.js +43 -0
- package/dist/wire/coverage.d.ts +1 -0
- package/dist/wire/coverage.js +0 -0
- package/dist/wire/index.d.ts +21 -0
- package/dist/wire/index.js +2 -0
- package/dist/wire/operations.d.ts +15 -0
- package/dist/wire/operations.js +101 -0
- package/dist/wire/schema.d.ts +8930 -0
- package/dist/wire/schema.js +4 -0
- package/dist/withdrawals/index.d.ts +114 -0
- package/dist/withdrawals/index.js +0 -0
- package/package.json +6 -2
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import type { Address } from "viem";
|
|
2
|
+
import type { BaseAPI } from "../api";
|
|
3
|
+
/**
|
|
4
|
+
* Request body for `POST /api/v1/withdrawals`.
|
|
5
|
+
*
|
|
6
|
+
* Initiating a withdrawal debits the caller's balance via the matching engine
|
|
7
|
+
* and allocates a `withdrawalIndex`. The executable calldata is fetched
|
|
8
|
+
* separately once the withdrawal root is confirmed on-chain. Master accounts
|
|
9
|
+
* with the withdraw permission only.
|
|
10
|
+
*/
|
|
11
|
+
export interface InitiateWithdrawalRequest {
|
|
12
|
+
/** UUID of the asset to withdraw. */
|
|
13
|
+
assetId: string;
|
|
14
|
+
/**
|
|
15
|
+
* Raw token amount in the smallest unit (e.g. wei) as a stringified positive
|
|
16
|
+
* integer.
|
|
17
|
+
*/
|
|
18
|
+
amount: string;
|
|
19
|
+
/** On-chain address that will receive the withdrawal (EVM, 0x-prefixed). */
|
|
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";
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Response shape shared by `POST /api/v1/withdrawals` and
|
|
30
|
+
* `GET /api/v1/withdrawals/{withdrawalIndex}`. Field names match the camelCase
|
|
31
|
+
* wire form returned by the gateway.
|
|
32
|
+
*/
|
|
33
|
+
export interface WithdrawalResponse {
|
|
34
|
+
/** Allocated withdrawal index — matches `executeWithdrawal.index` on-chain. */
|
|
35
|
+
withdrawalIndex: number;
|
|
36
|
+
/** 0x-prefixed lowercase address of the vault contract the calldata is submitted to. */
|
|
37
|
+
vaultAddress: 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
|
+
*/
|
|
44
|
+
calldata: string;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
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.
|
|
51
|
+
*/
|
|
52
|
+
export interface WithdrawalsAPI extends BaseAPI {
|
|
53
|
+
/** Initiate a withdrawal and return its index. Authenticated. */
|
|
54
|
+
initiateWithdrawal(request: InitiateWithdrawalRequest): Promise<WithdrawalResponse>;
|
|
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
|
+
*/
|
|
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;
|
|
114
|
+
}
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xmonaco/types",
|
|
3
|
-
"version": "0.8.7-develop.
|
|
3
|
+
"version": "0.8.7-develop.0f12336",
|
|
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.
|
|
23
|
+
"@0xmonaco/contracts": "0.8.7-develop.0f12336",
|
|
24
24
|
"zod": "^4.1.12"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
@@ -30,6 +30,10 @@
|
|
|
30
30
|
".": {
|
|
31
31
|
"types": "./dist/index.d.ts",
|
|
32
32
|
"default": "./dist/index.js"
|
|
33
|
+
},
|
|
34
|
+
"./wire": {
|
|
35
|
+
"types": "./dist/wire/index.d.ts",
|
|
36
|
+
"default": "./dist/wire/index.js"
|
|
33
37
|
}
|
|
34
38
|
}
|
|
35
39
|
}
|