@0xmonaco/core 0.8.14 → 0.8.16

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.
@@ -338,7 +338,7 @@ export class VaultAPIImpl extends BaseAPI {
338
338
  const deadline = Date.now() + timeoutMs;
339
339
  for (;;) {
340
340
  try {
341
- const { vault_address: vaultAddress, calldata } = await this.makePublicRequest(`/api/v1/withdrawals/${withdrawalIndex}`);
341
+ const { vaultAddress, calldata } = await this.makePublicRequest(`/api/v1/withdrawals/${withdrawalIndex}`);
342
342
  // Ready: non-empty calldata. (Defensively treat an empty/`0x` body as
343
343
  // not-ready too, though the gateway returns an error in that case.)
344
344
  if (calldata && calldata !== "0x") {
@@ -428,13 +428,13 @@ export class VaultAPIImpl extends BaseAPI {
428
428
  const source = typeof sourceOrRetry === "string" ? sourceOrRetry : "spot";
429
429
  const retryOptions = typeof sourceOrRetry === "string" ? retry : sourceOrRetry;
430
430
  validate(WithdrawSchema, { assetId, amount, destination, autoWait, source });
431
- // 1. Gateway allocates the withdrawal_index and debits the balance. No
431
+ // 1. Gateway allocates the withdrawalIndex and debits the balance. No
432
432
  // executable calldata yet — it needs the merkle proof, available only once
433
433
  // the withdrawal root is confirmed on-chain.
434
- const { withdrawal_index: withdrawalIndex } = await this.makeAuthenticatedRequest("/api/v1/withdrawals", {
434
+ const { withdrawalIndex } = await this.makeAuthenticatedRequest("/api/v1/withdrawals", {
435
435
  method: "POST",
436
436
  body: JSON.stringify({
437
- asset_id: assetId,
437
+ assetId: assetId,
438
438
  amount: amount.toString(),
439
439
  destination,
440
440
  source,
@@ -8,8 +8,8 @@
8
8
  *
9
9
  * @example
10
10
  * ```typescript
11
- * const { message, user_id } = await sdk.whitelist.submit({
12
- * wallet_address: "0x...",
11
+ * const { message, userId } = await sdk.whitelist.submit({
12
+ * walletAddress: "0x...",
13
13
  * email: "user@example.com",
14
14
  * });
15
15
  * ```
@@ -8,8 +8,8 @@
8
8
  *
9
9
  * @example
10
10
  * ```typescript
11
- * const { message, user_id } = await sdk.whitelist.submit({
12
- * wallet_address: "0x...",
11
+ * const { message, userId } = await sdk.whitelist.submit({
12
+ * walletAddress: "0x...",
13
13
  * email: "user@example.com",
14
14
  * });
15
15
  * ```
@@ -1,10 +1,10 @@
1
- import type { InitiateWithdrawalRequest, WithdrawalResponse, WithdrawalsAPI } from "@0xmonaco/types";
1
+ import type { InitiateWithdrawalRequest, ListPendingWithdrawalsParams, ListPendingWithdrawalsResponse, WithdrawalResponse, WithdrawalsAPI } from "@0xmonaco/types";
2
2
  import { BaseAPI } from "../base";
3
3
  /**
4
4
  * Low-level withdrawals client.
5
5
  *
6
6
  * `initiateWithdrawal` debits the caller's balance via the matching engine and
7
- * allocates a `withdrawal_index` (its `calldata` is empty — the proof is not
7
+ * allocates a `withdrawalIndex` (its `calldata` is empty — the proof is not
8
8
  * available until the withdrawal root is confirmed on-chain). `getWithdrawal`
9
9
  * returns the `executeWithdrawal` calldata once that proof is ready, and throws
10
10
  * an `APIError` (404 not-persisted-yet / 409 not-confirmed-yet) while it is not.
@@ -14,4 +14,5 @@ import { BaseAPI } from "../base";
14
14
  export declare class WithdrawalsAPIImpl extends BaseAPI implements WithdrawalsAPI {
15
15
  initiateWithdrawal(request: InitiateWithdrawalRequest): Promise<WithdrawalResponse>;
16
16
  getWithdrawal(withdrawalIndex: number): Promise<WithdrawalResponse>;
17
+ listPendingWithdrawals(params?: ListPendingWithdrawalsParams): Promise<ListPendingWithdrawalsResponse>;
17
18
  }
@@ -4,7 +4,7 @@ import { perpRoutes } from "../perp";
4
4
  * Low-level withdrawals client.
5
5
  *
6
6
  * `initiateWithdrawal` debits the caller's balance via the matching engine and
7
- * allocates a `withdrawal_index` (its `calldata` is empty — the proof is not
7
+ * allocates a `withdrawalIndex` (its `calldata` is empty — the proof is not
8
8
  * available until the withdrawal root is confirmed on-chain). `getWithdrawal`
9
9
  * returns the `executeWithdrawal` calldata once that proof is ready, and throws
10
10
  * an `APIError` (404 not-persisted-yet / 409 not-confirmed-yet) while it is not.
@@ -16,7 +16,7 @@ export class WithdrawalsAPIImpl extends BaseAPI {
16
16
  return this.makeAuthenticatedRequest(perpRoutes.withdrawals.initiate(), {
17
17
  method: "POST",
18
18
  body: JSON.stringify({
19
- asset_id: request.assetId,
19
+ assetId: request.assetId,
20
20
  amount: request.amount,
21
21
  destination: request.destination,
22
22
  source: request.source ?? "spot",
@@ -27,4 +27,9 @@ export class WithdrawalsAPIImpl extends BaseAPI {
27
27
  // Public lookup — no auth required.
28
28
  return this.makePublicRequest(perpRoutes.withdrawals.byIndex(withdrawalIndex));
29
29
  }
30
+ async listPendingWithdrawals(params) {
31
+ // The gateway serves camelCase (the REST wire format), which matches the
32
+ // public surface, so the response is returned directly with no remapping.
33
+ return this.makeAuthenticatedRequest(perpRoutes.withdrawals.list({ page: params?.page, pageSize: params?.pageSize }));
34
+ }
30
35
  }
@@ -51,6 +51,7 @@ export declare const COVERED: {
51
51
  get_user_trades: string;
52
52
  get_withdrawal: string;
53
53
  initiate_withdrawal: string;
54
+ list_pending_withdrawals: string;
54
55
  list_application_balances: string;
55
56
  list_application_movements: string;
56
57
  list_application_orders: string;
package/dist/coverage.js CHANGED
@@ -51,6 +51,7 @@ export const COVERED = {
51
51
  get_user_trades: "getUserTrades",
52
52
  get_withdrawal: "getWithdrawal",
53
53
  initiate_withdrawal: "initiateWithdrawal",
54
+ list_pending_withdrawals: "listPendingWithdrawals",
54
55
  list_application_balances: "listApplicationBalances",
55
56
  list_application_movements: "listApplicationMovements",
56
57
  list_application_orders: "listApplicationOrders",
package/dist/sdk.js CHANGED
@@ -242,10 +242,10 @@ export class MonacoSDKImpl {
242
242
  this.authState = {
243
243
  sessionPublicKey: session.publicKey,
244
244
  sessionPrivateKey: session.privateKey,
245
- expiresAt: delegatedSession.expires_at,
245
+ expiresAt: delegatedSession.expiresAt,
246
246
  user: {
247
- id: delegatedSession.owner_user_id,
248
- address: delegatedSession.agent_address,
247
+ id: delegatedSession.ownerUserId,
248
+ address: delegatedSession.agentAddress,
249
249
  },
250
250
  };
251
251
  this.propagateSession(this.sessionFromAuthState(this.authState));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0xmonaco/core",
3
- "version": "0.8.14",
3
+ "version": "0.8.16",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -23,8 +23,8 @@
23
23
  "viem": "^2.45.2"
24
24
  },
25
25
  "dependencies": {
26
- "@0xmonaco/contracts": "0.8.14",
27
- "@0xmonaco/types": "0.8.14",
26
+ "@0xmonaco/contracts": "0.8.16",
27
+ "@0xmonaco/types": "0.8.16",
28
28
  "@noble/curves": "^1.9.1",
29
29
  "@noble/hashes": "^1.8.0",
30
30
  "http-status-codes": "^2.3.0"