@0xmonaco/types 0.8.8 → 0.8.11

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 (51) 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 +18 -14
  18. package/dist/market/index.d.ts +116 -0
  19. package/dist/positions/index.d.ts +1 -0
  20. package/dist/profile/index.d.ts +88 -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 +7 -9
  27. package/dist/validation/margin-accounts.js +7 -9
  28. package/dist/validation/profile.d.ts +7 -0
  29. package/dist/validation/profile.js +7 -0
  30. package/dist/validation/trading.d.ts +8 -33
  31. package/dist/validation/trading.js +42 -33
  32. package/dist/validation/vault.d.ts +4 -0
  33. package/dist/validation/vault.js +2 -0
  34. package/dist/vault/index.d.ts +13 -1
  35. package/dist/whitelist/index.d.ts +44 -0
  36. package/dist/whitelist/index.js +10 -0
  37. package/dist/wire/assert.d.ts +54 -0
  38. package/dist/wire/assert.js +0 -0
  39. package/dist/wire/audit.d.ts +47 -0
  40. package/dist/wire/audit.js +43 -0
  41. package/dist/wire/coverage.d.ts +1 -0
  42. package/dist/wire/coverage.js +0 -0
  43. package/dist/wire/index.d.ts +21 -0
  44. package/dist/wire/index.js +2 -0
  45. package/dist/wire/operations.d.ts +15 -0
  46. package/dist/wire/operations.js +94 -0
  47. package/dist/wire/schema.d.ts +8460 -0
  48. package/dist/wire/schema.js +4 -0
  49. package/dist/withdrawals/index.d.ts +43 -0
  50. package/dist/withdrawals/index.js +0 -0
  51. package/package.json +6 -2
package/README.md CHANGED
@@ -22,7 +22,7 @@ import { MonacoSDK, SDKConfig } from "@0xmonaco/types";
22
22
  // SDK configuration
23
23
  interface SDKConfig {
24
24
  walletClient?: WalletClient; // Wallet client for signing operations
25
- network: Network; // Network preset: "local", "development", "staging", or "mainnet"
25
+ network: Network; // Use "staging" for public testnet or "mainnet" for production
26
26
  seiRpcUrl: string; // RPC URL for Sei blockchain interactions
27
27
  }
28
28
 
@@ -293,7 +293,7 @@ Types for network configuration:
293
293
  ```typescript
294
294
  import { Network, NetworkEndpoints } from "@0xmonaco/types";
295
295
 
296
- type Network = "mainnet" | "development" | "staging" | "local";
296
+ const publicNetwork: Network = "staging";
297
297
 
298
298
  interface NetworkEndpoints {
299
299
  rpcUrl: string;
@@ -301,13 +301,15 @@ interface NetworkEndpoints {
301
301
  }
302
302
  ```
303
303
 
304
+ For public integrations, use `"staging"` or `"mainnet"`.
305
+
304
306
  ## Type Reference
305
307
 
306
308
  ### SDK Types
307
309
 
308
310
  - `MonacoSDK`: Main SDK interface with all API modules
309
311
  - `SDKConfig`: Configuration options for the Monaco SDK
310
- - `Network`: Network type ("mainnet" | "development" | "staging" | "local")
312
+ - `Network`: SDK network preset type. Public integrations should use `"staging"` or `"mainnet"`.
311
313
  - `AuthState`: Authentication state information
312
314
 
313
315
  ### Vault Types
@@ -16,4 +16,11 @@ export interface BaseAPI {
16
16
  * @param credentials - Hex-encoded session keypair, or `undefined` to clear.
17
17
  */
18
18
  setSessionKeypair(credentials: SessionCredentials | undefined): void;
19
+ /**
20
+ * Set (or clear) the application secret key used for backend-authenticated
21
+ * requests. When set, it is sent in the `x-server-key` header.
22
+ *
23
+ * @param serverKey - The application secret key (`sk_...`), or `undefined` to clear.
24
+ */
25
+ setServerKey(serverKey: string | undefined): void;
19
26
  }
@@ -1,23 +1,65 @@
1
1
  /**
2
2
  * Applications Types
3
3
  *
4
- * Types for application configuration operations.
4
+ * Types for application configuration and the backend-authenticated
5
+ * application reporting endpoints.
5
6
  */
6
7
  import type { BaseAPI } from "../api";
7
- import type { ApplicationConfigResponse } from "./responses";
8
+ import type { GetAppStatsParams, ListAppBalancesParams, ListAppMovementsParams, ListAppOrdersParams, ListAppUsersParams } from "./requests";
9
+ import type { ApplicationConfigResponse, GetAppStatsResponse, ListAppBalancesResponse, ListAppMovementsResponse, ListAppOrdersResponse, ListAppUsersResponse } from "./responses";
8
10
  /**
9
11
  * Applications API interface.
10
- * Provides methods for retrieving application configuration.
12
+ *
13
+ * `getApplicationConfig` is session-authenticated (signed with the session
14
+ * key). The reporting methods are backend-authenticated: set the application's
15
+ * secret key with {@link BaseAPI.setServerKey} before calling them — each
16
+ * request sends it in the `x-server-key` header.
11
17
  */
12
18
  export interface ApplicationsAPI extends BaseAPI {
13
19
  /**
14
20
  * Gets the configuration for the authenticated application.
15
21
  *
16
22
  * Returns the application's configuration including allowed origins,
17
- * webhook URL, and other settings. Requires valid authentication.
23
+ * webhook URL, and other settings. Requires valid session authentication.
18
24
  *
19
25
  * @returns Promise resolving to the application configuration
20
26
  */
21
27
  getApplicationConfig(): Promise<ApplicationConfigResponse>;
28
+ /**
29
+ * Lists orders placed by the application's users. Backend-authenticated.
30
+ *
31
+ * @param params - Pagination and filter options
32
+ * @returns Promise resolving to a paginated list of orders
33
+ */
34
+ listApplicationOrders(params?: ListAppOrdersParams): Promise<ListAppOrdersResponse>;
35
+ /**
36
+ * Lists the application's users. Backend-authenticated.
37
+ *
38
+ * @param params - Pagination and filter options
39
+ * @returns Promise resolving to a paginated list of users
40
+ */
41
+ listApplicationUsers(params?: ListAppUsersParams): Promise<ListAppUsersResponse>;
42
+ /**
43
+ * Lists ledger movements for the application's users. Backend-authenticated.
44
+ *
45
+ * @param params - Pagination and filter options
46
+ * @returns Promise resolving to a paginated list of movements
47
+ */
48
+ listApplicationMovements(params?: ListAppMovementsParams): Promise<ListAppMovementsResponse>;
49
+ /**
50
+ * Lists user balances held within the application. Backend-authenticated.
51
+ *
52
+ * @param params - Pagination and filter options
53
+ * @returns Promise resolving to a paginated list of balances
54
+ */
55
+ listApplicationBalances(params?: ListAppBalancesParams): Promise<ListAppBalancesResponse>;
56
+ /**
57
+ * Gets aggregate volume and fee stats for the application. Backend-authenticated.
58
+ *
59
+ * @param params - Optional `since` filter
60
+ * @returns Promise resolving to the application stats
61
+ */
62
+ getApplicationStats(params?: GetAppStatsParams): Promise<GetAppStatsResponse>;
22
63
  }
23
- export type { ApplicationConfigResponse } from "./responses";
64
+ export type { GetAppStatsParams, ListAppBalancesParams, ListAppMovementsParams, ListAppOrdersParams, ListAppUsersParams } from "./requests";
65
+ export type { AppBalance, ApplicationConfigResponse, AppMovement, AppOrder, AppUser, GetAppStatsResponse, ListAppBalancesResponse, ListAppMovementsResponse, ListAppOrdersResponse, ListAppUsersResponse, } from "./responses";
@@ -1,5 +1,6 @@
1
1
  /**
2
2
  * Applications Types
3
3
  *
4
- * Types for application configuration operations.
4
+ * Types for application configuration and the backend-authenticated
5
+ * application reporting endpoints.
5
6
  */
@@ -0,0 +1,78 @@
1
+ /**
2
+ * Applications Request Types
3
+ *
4
+ * Query parameters for the backend-authenticated application reporting
5
+ * endpoints. Field names match the wire (snake_case) so they can be passed
6
+ * straight through to the query string.
7
+ */
8
+ /**
9
+ * Query parameters for listing application orders.
10
+ */
11
+ export interface ListAppOrdersParams {
12
+ /** Page number (starts from 1) */
13
+ page?: number;
14
+ /** Items per page (max 100) */
15
+ page_size?: number;
16
+ /** Filter by order status (e.g. SUBMITTED, PARTIALLY_FILLED, FILLED, SETTLED, CANCELLED, EXPIRED, REJECTED) */
17
+ status?: string;
18
+ /** Filter by user UUID */
19
+ user_id?: string;
20
+ /** Filter by trading pair UUID */
21
+ trading_pair_id?: string;
22
+ /** Filter by order side: BUY or SELL */
23
+ side?: string;
24
+ /** Filter by order type (e.g. LIMIT, MARKET, STOP_LOSS, TAKE_PROFIT, STOP_LIMIT, TRAILING_STOP) */
25
+ order_type?: string;
26
+ }
27
+ /**
28
+ * Query parameters for listing application users.
29
+ */
30
+ export interface ListAppUsersParams {
31
+ /** Page number (starts from 1) */
32
+ page?: number;
33
+ /** Items per page (max 100) */
34
+ page_size?: number;
35
+ /** Filter by active status */
36
+ is_active?: boolean;
37
+ /** Filter by account type: master or sub */
38
+ account_type?: string;
39
+ /** Filter by wallet address (partial match, case-insensitive) */
40
+ address?: string;
41
+ }
42
+ /**
43
+ * Query parameters for listing application movements.
44
+ */
45
+ export interface ListAppMovementsParams {
46
+ /** Page number (starts from 1) */
47
+ page?: number;
48
+ /** Items per page (max 100) */
49
+ page_size?: number;
50
+ /** Filter by user UUID */
51
+ user_id?: string;
52
+ /** Filter by transaction type (e.g. DEPOSIT, WITHDRAWAL, TRADE, FEE, FUNDING, LIQUIDATION, INTEREST, REWARD) */
53
+ transaction_type?: string;
54
+ /** Filter by entry type (e.g. CREDIT, DEBIT, LOCK, UNLOCK, FEE) */
55
+ entry_type?: string;
56
+ /** Filter by asset UUID */
57
+ asset_id?: string;
58
+ }
59
+ /**
60
+ * Query parameters for listing application balances.
61
+ */
62
+ export interface ListAppBalancesParams {
63
+ /** Page number (starts from 1) */
64
+ page?: number;
65
+ /** Items per page (max 100) */
66
+ page_size?: number;
67
+ /** Filter by user UUID */
68
+ user_id?: string;
69
+ /** Filter by asset UUID */
70
+ asset_id?: string;
71
+ }
72
+ /**
73
+ * Query parameters for application stats.
74
+ */
75
+ export interface GetAppStatsParams {
76
+ /** ISO 8601 datetime to filter stats from (e.g. 2026-01-01T00:00:00Z). Omit for all-time. */
77
+ since?: string;
78
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Applications Request Types
3
+ *
4
+ * Query parameters for the backend-authenticated application reporting
5
+ * endpoints. Field names match the wire (snake_case) so they can be passed
6
+ * straight through to the query string.
7
+ */
@@ -1,7 +1,9 @@
1
1
  /**
2
2
  * Applications Response Types
3
3
  *
4
- * Response types for application configuration operations.
4
+ * Response types for application configuration operations and the
5
+ * backend-authenticated application reporting endpoints. Reporting types use
6
+ * the wire shape (snake_case); optional fields are `null` rather than omitted.
5
7
  */
6
8
  /**
7
9
  * Response to an application configuration request.
@@ -20,3 +22,211 @@ export interface ApplicationConfigResponse {
20
22
  /** Application client ID, embedded in on-chain deposit calls */
21
23
  clientId: string;
22
24
  }
25
+ /**
26
+ * One order belonging to an application's users.
27
+ */
28
+ export interface AppOrder {
29
+ /** Order UUID */
30
+ id: string;
31
+ /** User UUID who placed the order */
32
+ user_id: string;
33
+ /** Trading pair UUID */
34
+ trading_pair_id: string;
35
+ /** Order type: LIMIT, MARKET, STOP_LOSS, TAKE_PROFIT, STOP_LIMIT, or TRAILING_STOP */
36
+ order_type: string;
37
+ /** Order side: BUY or SELL */
38
+ side: string;
39
+ /** Order price (null for market orders) */
40
+ price: string | null;
41
+ /** Order quantity (normalized for display) */
42
+ quantity: string;
43
+ /** Order quantity in raw format (for precision) */
44
+ quantity_raw: string;
45
+ /** Filled quantity (normalized for display) */
46
+ filled_quantity: string | null;
47
+ /** Filled quantity in raw format */
48
+ filled_quantity_raw: string | null;
49
+ /** Volume-weighted average fill price */
50
+ average_fill_price: string | null;
51
+ /** Order status */
52
+ status: string;
53
+ /** Trading mode: SPOT or MARGIN */
54
+ trading_mode: string;
55
+ /** Time in force: GTC, IOC, or FOK */
56
+ time_in_force: string | null;
57
+ /** Order creation timestamp (ISO 8601) */
58
+ created_at: string | null;
59
+ /** Order last update timestamp (ISO 8601) */
60
+ updated_at: string | null;
61
+ }
62
+ /**
63
+ * One user belonging to an application.
64
+ */
65
+ export interface AppUser {
66
+ /** User UUID */
67
+ id: string;
68
+ /** Wallet address */
69
+ address: string;
70
+ /** Display username */
71
+ username: string | null;
72
+ /** Account type: master or sub */
73
+ account_type: string;
74
+ /** Whether the user is allowed to withdraw */
75
+ can_withdraw: boolean;
76
+ /** Account creation timestamp (ISO 8601) */
77
+ created_at: string | null;
78
+ /** Email address */
79
+ email: string | null;
80
+ /** Whether the user account is active */
81
+ is_active: boolean | null;
82
+ /** Whether the user is banned */
83
+ is_banned: boolean | null;
84
+ /** Master account ID (for sub-accounts) */
85
+ master_account_id: string | null;
86
+ /** Last update timestamp (ISO 8601) */
87
+ updated_at: string | null;
88
+ }
89
+ /**
90
+ * One ledger movement (deposit, withdrawal, trade, etc.) for an application.
91
+ */
92
+ export interface AppMovement {
93
+ /** Transaction amount */
94
+ amount: string;
95
+ /** Balance after this transaction */
96
+ balance_after: string | null;
97
+ /** Balance before this transaction */
98
+ balance_before: string | null;
99
+ /** Balance UUID this movement affects */
100
+ balance_id: string;
101
+ /** Blockchain block number */
102
+ block_number: number | null;
103
+ /** Transaction timestamp (ISO 8601) */
104
+ created_at: string | null;
105
+ /** Human readable description */
106
+ description: string | null;
107
+ /** Type of ledger entry */
108
+ entry_type: string;
109
+ /** Movement UUID */
110
+ id: string;
111
+ /** Locked balance after transaction */
112
+ locked_after: string | null;
113
+ /** Locked balance before transaction */
114
+ locked_before: string | null;
115
+ /** Reference identifier for related operations */
116
+ reference_id: string | null;
117
+ /** Reference type */
118
+ reference_type: string | null;
119
+ /** Token address */
120
+ token: string;
121
+ /** Type of transaction */
122
+ transaction_type: string;
123
+ /** Blockchain transaction hash */
124
+ tx_hash: string | null;
125
+ /** User UUID who owns this movement */
126
+ user_id: string;
127
+ }
128
+ /**
129
+ * One user balance held within an application.
130
+ */
131
+ export interface AppBalance {
132
+ /** Available balance for trading */
133
+ available_balance: string;
134
+ /** Balance creation timestamp (ISO 8601) */
135
+ created_at: string | null;
136
+ /** Token decimals */
137
+ decimals: number;
138
+ /** Balance UUID */
139
+ id: string;
140
+ /** Last sync timestamp (ISO 8601) */
141
+ last_sync_at: string | null;
142
+ /** Last sync block number */
143
+ last_sync_block: number | null;
144
+ /** Locked balance */
145
+ locked_balance: string;
146
+ /** On-chain balance */
147
+ on_chain_balance: string;
148
+ /** Token symbol */
149
+ symbol: string | null;
150
+ /** Token address */
151
+ token: string;
152
+ /** Total balance */
153
+ total_balance: string;
154
+ /** Balance last update timestamp (ISO 8601) */
155
+ updated_at: string | null;
156
+ /** User UUID who owns this balance */
157
+ user_id: string;
158
+ }
159
+ /**
160
+ * Paginated list of application orders.
161
+ */
162
+ export interface ListAppOrdersResponse {
163
+ orders: AppOrder[];
164
+ /** Total matching orders */
165
+ total: number;
166
+ /** Current page number */
167
+ page: number;
168
+ /** Items per page */
169
+ page_size: number;
170
+ /** Total number of pages */
171
+ total_pages: number;
172
+ }
173
+ /**
174
+ * Paginated list of application users.
175
+ */
176
+ export interface ListAppUsersResponse {
177
+ users: AppUser[];
178
+ /** Total number of users */
179
+ total: number;
180
+ /** Current page number */
181
+ page: number;
182
+ /** Items per page */
183
+ page_size: number;
184
+ /** Total number of pages */
185
+ total_pages: number;
186
+ }
187
+ /**
188
+ * Paginated list of application movements.
189
+ */
190
+ export interface ListAppMovementsResponse {
191
+ movements: AppMovement[];
192
+ /** Total matching movements */
193
+ total: number;
194
+ /** Current page number */
195
+ page: number;
196
+ /** Items per page */
197
+ page_size: number;
198
+ /** Total number of pages */
199
+ total_pages: number;
200
+ }
201
+ /**
202
+ * Paginated list of application balances.
203
+ */
204
+ export interface ListAppBalancesResponse {
205
+ balances: AppBalance[];
206
+ /** Total matching balances */
207
+ total: number;
208
+ /** Current page number */
209
+ page: number;
210
+ /** Items per page */
211
+ page_size: number;
212
+ /** Total number of pages */
213
+ total_pages: number;
214
+ }
215
+ /**
216
+ * Aggregate volume and fee stats for an application.
217
+ *
218
+ * Stats are scoped to trades where the application's users were the taker.
219
+ * All monetary values are normalized (human-readable quote token units).
220
+ */
221
+ export interface GetAppStatsResponse {
222
+ /** Total quote volume for trades where this application's users were the taker */
223
+ volume: string;
224
+ /** Total maker fees collected */
225
+ maker_fee: string;
226
+ /** Total taker fees collected */
227
+ taker_fee: string;
228
+ /** Application revenue share from taker fees */
229
+ application_taker_fee: string;
230
+ /** Total number of trades */
231
+ trade_count: number;
232
+ }
@@ -1,5 +1,7 @@
1
1
  /**
2
2
  * Applications Response Types
3
3
  *
4
- * Response types for application configuration operations.
4
+ * Response types for application configuration operations and the
5
+ * backend-authenticated application reporting endpoints. Reporting types use
6
+ * the wire shape (snake_case); optional fields are `null` rather than omitted.
5
7
  */
@@ -1,15 +1,15 @@
1
1
  /**
2
2
  * Auth Types
3
3
  *
4
- * Types for authentication operations including challenge creation,
5
- * signature verification, and backend authentication.
4
+ * Types for wallet authentication operations including challenge creation,
5
+ * signature verification, and session lifecycle.
6
6
  */
7
7
  import type { BaseAPI } from "../api";
8
- import type { AuthState, BackendAuthResponse, ChallengeResponse, SessionCredentials, SessionRefreshResponse } from "./responses";
8
+ import type { AuthState, ChallengeResponse, SessionCredentials, SessionRefreshResponse } from "./responses";
9
9
  /**
10
10
  * Auth API interface.
11
- * Provides methods for frontend and backend authentication.
12
- * Handles challenge creation, signature verification, and backend auth.
11
+ * Provides methods for wallet-based authentication.
12
+ * Handles challenge creation, signature verification, and session lifecycle.
13
13
  */
14
14
  export interface AuthAPI extends BaseAPI {
15
15
  /**
@@ -57,12 +57,6 @@ export interface AuthAPI extends BaseAPI {
57
57
  * @returns Promise resolving to the authentication state
58
58
  */
59
59
  verifySignature(address: string, signature: string, nonce: string, clientId: string, session: SessionCredentials): Promise<AuthState>;
60
- /**
61
- * Authenticates a backend service using a secret key.
62
- * @param secretKey - Secret key of the application
63
- * @returns Promise resolving to the backend auth response
64
- */
65
- authenticateBackend(secretKey: string): Promise<BackendAuthResponse>;
66
60
  /**
67
61
  * Extends the current session's expiry. The request is signed with the
68
62
  * active session key (set via {@link setSessionKeypair}).
@@ -82,4 +76,4 @@ export interface AuthAPI extends BaseAPI {
82
76
  */
83
77
  setWalletClient(walletClient: unknown): void;
84
78
  }
85
- export type { ApplicationInfo, AuthState, BackendAuthResponse, ChallengeResponse, SessionCredentials, SessionRefreshResponse, User, } from "./responses";
79
+ export type { ApplicationInfo, AuthState, ChallengeResponse, SessionCredentials, SessionRefreshResponse, User, } from "./responses";
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Auth Types
3
3
  *
4
- * Types for authentication operations including challenge creation,
5
- * signature verification, and backend authentication.
4
+ * Types for wallet authentication operations including challenge creation,
5
+ * signature verification, and session lifecycle.
6
6
  */
@@ -51,17 +51,6 @@ export interface ApplicationInfo {
51
51
  /** Client ID for frontend authentication */
52
52
  clientId: string;
53
53
  }
54
- /**
55
- * Response to a backend authentication request.
56
- */
57
- export interface BackendAuthResponse {
58
- /** JWT access token for authenticated requests */
59
- accessToken: string;
60
- /** Unix timestamp when the access token expires */
61
- expiresAt: number;
62
- /** Information about the application */
63
- application: ApplicationInfo;
64
- }
65
54
  /**
66
55
  * A session keypair, hex-encoded. The private key is used to sign requests;
67
56
  * the public key identifies the session server-side.
@@ -33,11 +33,26 @@ export interface DelegatedAgent {
33
33
  export interface ListDelegatedAgentsResponse {
34
34
  agents: DelegatedAgent[];
35
35
  }
36
+ export interface DelegatedAgentOwner {
37
+ owner_user_id: string;
38
+ delegation_id: string;
39
+ name?: string;
40
+ is_active: boolean;
41
+ expires_at?: string;
42
+ }
43
+ export interface ListDelegatedOwnersResponse {
44
+ owners: DelegatedAgentOwner[];
45
+ }
36
46
  export interface CreateDelegatedSessionRequest {
37
47
  ownerUserId: string;
48
+ /**
49
+ * Lowercase-hex (64 chars) ed25519 public key the agent generated for this
50
+ * delegated session. Required: subsequent requests acting on the owner's
51
+ * behalf are signed with the matching private key.
52
+ */
53
+ sessionPublicKey: string;
38
54
  }
39
55
  export interface CreateDelegatedSessionResponse {
40
- access_token: string;
41
56
  expires_at: number;
42
57
  delegation_id: string;
43
58
  owner_user_id: string;
@@ -46,6 +61,7 @@ export interface CreateDelegatedSessionResponse {
46
61
  export interface DelegatedAgentsAPI extends BaseAPI {
47
62
  upsertDelegatedAgent(request: UpsertDelegatedAgentRequest): Promise<DelegatedAgent>;
48
63
  listDelegatedAgents(): Promise<ListDelegatedAgentsResponse>;
64
+ listDelegatedOwners(): Promise<ListDelegatedOwnersResponse>;
49
65
  revokeDelegatedAgent(delegatedAgentId: string): Promise<{
50
66
  status: "REVOKED";
51
67
  }>;
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Faucet Types
3
+ *
4
+ * Types for the testnet token faucet. Wire shapes are snake_case.
5
+ *
6
+ * NOTE: The faucet is **testnet-only** and performs real on-chain mints from a
7
+ * backend-operator-funded signer. It is disabled (returns an error) if the
8
+ * gateway operator has not configured a signer; the SDK caller has no control
9
+ * over that. It is rate-limited per user (default 1 request / 24h).
10
+ */
11
+ import type { BaseAPI } from "../api";
12
+ /** A token successfully minted by the faucet. */
13
+ export interface MintedToken {
14
+ /** Asset UUID */
15
+ asset_id: string;
16
+ /** Token symbol */
17
+ symbol: string;
18
+ /** Amount minted in token units */
19
+ amount: string;
20
+ /** On-chain transaction hash */
21
+ tx_hash: string;
22
+ }
23
+ /** A token the faucet failed to mint. */
24
+ export interface FailedMint {
25
+ /** Asset UUID */
26
+ asset_id: string;
27
+ /** Token symbol */
28
+ symbol: string;
29
+ /** Error message describing why the mint failed */
30
+ error: string;
31
+ }
32
+ /** Result of a faucet mint request. */
33
+ export interface MintTokensResponse {
34
+ /** Tokens that were successfully minted */
35
+ minted: MintedToken[];
36
+ /** Tokens that failed to mint */
37
+ failed: FailedMint[];
38
+ /** Remaining faucet requests in the next 24h */
39
+ remaining_requests_24h: number;
40
+ }
41
+ /**
42
+ * Faucet API interface. Session-authenticated.
43
+ */
44
+ export interface FaucetAPI extends BaseAPI {
45
+ /**
46
+ * Mints the full set of testnet tokens to the authenticated user.
47
+ *
48
+ * Testnet-only and rate-limited; see the module note. Partial success is
49
+ * possible — inspect `minted` and `failed` in the response.
50
+ *
51
+ * @returns Promise resolving to the minted/failed tokens and remaining quota
52
+ */
53
+ mint(): Promise<MintTokensResponse>;
54
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Faucet Types
3
+ *
4
+ * Types for the testnet token faucet. Wire shapes are snake_case.
5
+ *
6
+ * NOTE: The faucet is **testnet-only** and performs real on-chain mints from a
7
+ * backend-operator-funded signer. It is disabled (returns an error) if the
8
+ * gateway operator has not configured a signer; the SDK caller has no control
9
+ * over that. It is rate-limited per user (default 1 request / 24h).
10
+ */
package/dist/index.d.ts CHANGED
@@ -9,13 +9,17 @@ export * from "./applications";
9
9
  export * from "./auth";
10
10
  export * from "./contracts";
11
11
  export * from "./delegated-agents";
12
+ export * from "./faucet";
12
13
  export * from "./fees";
13
14
  export * from "./margin-accounts";
14
15
  export * from "./market";
15
16
  export * from "./positions";
16
17
  export * from "./profile";
17
18
  export * from "./sdk";
19
+ export * from "./sub-accounts";
18
20
  export * from "./trading";
19
21
  export * from "./validation";
20
22
  export * from "./vault";
21
23
  export * from "./websocket";
24
+ export * from "./whitelist";
25
+ export * from "./withdrawals";
package/dist/index.js CHANGED
@@ -10,13 +10,17 @@ export * from "./applications";
10
10
  export * from "./auth";
11
11
  export * from "./contracts";
12
12
  export * from "./delegated-agents";
13
+ export * from "./faucet";
13
14
  export * from "./fees";
14
15
  export * from "./margin-accounts";
15
16
  export * from "./market";
16
17
  export * from "./positions";
17
18
  export * from "./profile";
18
19
  export * from "./sdk";
20
+ export * from "./sub-accounts";
19
21
  export * from "./trading";
20
22
  export * from "./validation";
21
23
  export * from "./vault";
22
24
  export * from "./websocket";
25
+ export * from "./whitelist";
26
+ export * from "./withdrawals";