@0xmonaco/types 0.8.7-develop.34bd452 → 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.
Files changed (54) hide show
  1. package/README.md +5 -3
  2. package/dist/api/index.d.ts +7 -0
  3. package/dist/applications/index.d.ts +47 -5
  4. package/dist/applications/index.js +2 -1
  5. package/dist/applications/requests.d.ts +78 -0
  6. package/dist/applications/requests.js +7 -0
  7. package/dist/applications/responses.d.ts +211 -1
  8. package/dist/applications/responses.js +3 -1
  9. package/dist/auth/index.d.ts +6 -12
  10. package/dist/auth/index.js +2 -2
  11. package/dist/auth/responses.d.ts +0 -11
  12. package/dist/delegated-agents/index.d.ts +17 -1
  13. package/dist/faucet/index.d.ts +54 -0
  14. package/dist/faucet/index.js +10 -0
  15. package/dist/index.d.ts +4 -0
  16. package/dist/index.js +4 -0
  17. package/dist/margin-accounts/index.d.ts +52 -16
  18. package/dist/market/index.d.ts +123 -4
  19. package/dist/positions/index.d.ts +23 -0
  20. package/dist/profile/index.d.ts +90 -1
  21. package/dist/sdk/index.d.ts +21 -0
  22. package/dist/sub-accounts/index.d.ts +145 -0
  23. package/dist/sub-accounts/index.js +9 -0
  24. package/dist/trading/index.d.ts +6 -6
  25. package/dist/trading/responses.d.ts +8 -27
  26. package/dist/validation/margin-accounts.d.ts +50 -10
  27. package/dist/validation/margin-accounts.js +36 -12
  28. package/dist/validation/positions.d.ts +4 -0
  29. package/dist/validation/positions.js +4 -0
  30. package/dist/validation/profile.d.ts +7 -0
  31. package/dist/validation/profile.js +7 -0
  32. package/dist/validation/trading.d.ts +8 -33
  33. package/dist/validation/trading.js +42 -33
  34. package/dist/validation/vault.d.ts +8 -0
  35. package/dist/validation/vault.js +3 -0
  36. package/dist/vault/index.d.ts +44 -12
  37. package/dist/vault/responses.d.ts +23 -8
  38. package/dist/whitelist/index.d.ts +44 -0
  39. package/dist/whitelist/index.js +10 -0
  40. package/dist/wire/assert.d.ts +54 -0
  41. package/dist/wire/assert.js +0 -0
  42. package/dist/wire/audit.d.ts +47 -0
  43. package/dist/wire/audit.js +43 -0
  44. package/dist/wire/coverage.d.ts +1 -0
  45. package/dist/wire/coverage.js +0 -0
  46. package/dist/wire/index.d.ts +21 -0
  47. package/dist/wire/index.js +2 -0
  48. package/dist/wire/operations.d.ts +15 -0
  49. package/dist/wire/operations.js +100 -0
  50. package/dist/wire/schema.d.ts +8810 -0
  51. package/dist/wire/schema.js +4 -0
  52. package/dist/withdrawals/index.d.ts +60 -0
  53. package/dist/withdrawals/index.js +0 -0
  54. package/package.json +6 -2
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by openapi-typescript.
3
+ * Do not make direct changes to the file.
4
+ */
@@ -0,0 +1,60 @@
1
+ import type { BaseAPI } from "../api";
2
+ /**
3
+ * Request body for `POST /api/v1/withdrawals`.
4
+ *
5
+ * Initiating a withdrawal debits the caller's balance via the matching engine
6
+ * and allocates a `withdrawal_index`. The executable calldata is fetched
7
+ * separately once the withdrawal root is confirmed on-chain. Master accounts
8
+ * with the withdraw permission only.
9
+ */
10
+ export interface InitiateWithdrawalRequest {
11
+ /** UUID of the asset to withdraw. */
12
+ assetId: string;
13
+ /**
14
+ * Raw token amount in the smallest unit (e.g. wei) as a stringified positive
15
+ * integer.
16
+ */
17
+ amount: string;
18
+ /** On-chain address that will receive the withdrawal (EVM, 0x-prefixed). */
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";
26
+ }
27
+ /**
28
+ * Response shape shared by `POST /api/v1/withdrawals` and
29
+ * `GET /api/v1/withdrawals/{withdrawalIndex}`. Field names match the wire
30
+ * (snake_case) form returned by the gateway.
31
+ */
32
+ export interface WithdrawalResponse {
33
+ /** Allocated withdrawal index — matches `executeWithdrawal.index` on-chain. */
34
+ withdrawal_index: number;
35
+ /** 0x-prefixed lowercase address of the vault contract the calldata is submitted to. */
36
+ vault_address: string;
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
+ */
43
+ calldata: string;
44
+ }
45
+ /**
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.
50
+ */
51
+ export interface WithdrawalsAPI extends BaseAPI {
52
+ /** Initiate a withdrawal and return its index. Authenticated. */
53
+ initiateWithdrawal(request: InitiateWithdrawalRequest): Promise<WithdrawalResponse>;
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
+ */
59
+ getWithdrawal(withdrawalIndex: number): Promise<WithdrawalResponse>;
60
+ }
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0xmonaco/types",
3
- "version": "0.8.7-develop.34bd452",
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.34bd452",
23
+ "@0xmonaco/contracts": "0.8.7-develop.a107b34",
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
  }