@0xmonaco/core 1.1.8 → 1.1.9

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.
@@ -25,7 +25,7 @@
25
25
  * const quote = await sdk.rfq.upsertQuote(rfqId, { expectedVersion: 0, ask: { price: "65001", capacity: "10" } });
26
26
  * ```
27
27
  */
28
- import type { AcceptRfqParams, CancelRfqParams, CreateRfqParams, GetRfqCapabilitiesResponse, RespondRfqLastLookParams, RespondRfqLastLookResponse, RfqAPI, RfqQuoteVersion, RfqStatus, UpsertRfqQuoteParams, WithdrawRfqQuoteParams, WithdrawRfqQuoteResponse } from "@0xmonaco/types";
28
+ import type { AcceptRfqParams, CancelRfqParams, CreateRfqParams, GetRfqCapabilitiesResponse, ListRfqsParams, ListRfqsResponse, RespondRfqLastLookParams, RespondRfqLastLookResponse, RfqAPI, RfqQuoteVersion, RfqStatus, UpsertRfqQuoteParams, WithdrawRfqQuoteParams, WithdrawRfqQuoteResponse } from "@0xmonaco/types";
29
29
  import { BaseAPI } from "../base";
30
30
  export declare class RfqAPIImpl extends BaseAPI implements RfqAPI {
31
31
  /** Your RFQ limits and the markets RFQ is offered on. */
@@ -44,6 +44,12 @@ export declare class RfqAPIImpl extends BaseAPI implements RfqAPI {
44
44
  * and, once selected, `ownSelection` for last look.
45
45
  */
46
46
  getRfq(rfqId: string): Promise<RfqStatus>;
47
+ /**
48
+ * Your RFQs as the taker, newest first, in every state (those that filled
49
+ * nothing included). Each is as `getRfq` gives it, without the live `view`.
50
+ * Follow `nextPageToken` until it is empty.
51
+ */
52
+ listRfqs(params?: ListRfqsParams): Promise<ListRfqsResponse>;
47
53
  /**
48
54
  * Accept one side of the view you last saw. Binding: the selected makers'
49
55
  * last look follows, and silence executes. A newer view refuses an older
@@ -25,7 +25,7 @@
25
25
  * const quote = await sdk.rfq.upsertQuote(rfqId, { expectedVersion: 0, ask: { price: "65001", capacity: "10" } });
26
26
  * ```
27
27
  */
28
- import { AcceptRfqSchema, CancelRfqSchema, CreateRfqSchema, RespondRfqLastLookSchema, UpsertRfqQuoteSchema, UUIDSchema, validate, WithdrawRfqQuoteSchema, } from "@0xmonaco/types";
28
+ import { AcceptRfqSchema, CancelRfqSchema, CreateRfqSchema, ListRfqsSchema, RespondRfqLastLookSchema, UpsertRfqQuoteSchema, UUIDSchema, validate, WithdrawRfqQuoteSchema, } from "@0xmonaco/types";
29
29
  import { BaseAPI } from "../base";
30
30
  const BASE = "/api/v1/rfqs";
31
31
  /** The RFQ path for a validated RFQ id. */
@@ -67,6 +67,21 @@ export class RfqAPIImpl extends BaseAPI {
67
67
  async getRfq(rfqId) {
68
68
  return await this.makeAuthenticatedRequest(rfqPath(rfqId), { method: "GET" });
69
69
  }
70
+ /**
71
+ * Your RFQs as the taker, newest first, in every state (those that filled
72
+ * nothing included). Each is as `getRfq` gives it, without the live `view`.
73
+ * Follow `nextPageToken` until it is empty.
74
+ */
75
+ async listRfqs(params) {
76
+ const { pageSize, pageToken } = validate(ListRfqsSchema, params ?? {});
77
+ const searchParams = new URLSearchParams();
78
+ if (pageSize !== undefined)
79
+ searchParams.append("pageSize", pageSize.toString());
80
+ if (pageToken !== undefined)
81
+ searchParams.append("pageToken", pageToken);
82
+ const query = searchParams.toString();
83
+ return await this.makeAuthenticatedRequest(query ? `${BASE}?${query}` : BASE, { method: "GET" });
84
+ }
70
85
  /**
71
86
  * Accept one side of the view you last saw. Binding: the selected makers'
72
87
  * last look follows, and silence executes. A newer view refuses an older
@@ -30,6 +30,7 @@ export declare const COVERED: {
30
30
  get_rfq_capabilities: string;
31
31
  create_rfq: string;
32
32
  get_rfq: string;
33
+ list_rfqs: string;
33
34
  accept_rfq: string;
34
35
  cancel_rfq: string;
35
36
  upsert_rfq_quote: string;
package/dist/coverage.js CHANGED
@@ -30,6 +30,7 @@ export const COVERED = {
30
30
  get_rfq_capabilities: "rfq.getCapabilities",
31
31
  create_rfq: "rfq.createRfq",
32
32
  get_rfq: "rfq.getRfq",
33
+ list_rfqs: "rfq.listRfqs",
33
34
  accept_rfq: "rfq.acceptRfq",
34
35
  cancel_rfq: "rfq.cancelRfq",
35
36
  upsert_rfq_quote: "rfq.upsertQuote",
@@ -673,6 +673,14 @@ function getErrorSuggestion(statusCode, message, responseBody) {
673
673
  retryable: false,
674
674
  };
675
675
  }
676
+ // A transfer stopped partway: its first moves stand, and sending it again would
677
+ // move the money again. Check BEFORE the generic 409.
678
+ if (responseBody?.code === "COLLATERAL_TRANSFER_STOPPED_PARTWAY") {
679
+ return {
680
+ suggestion: "The transfer stopped partway and the amount is where this message says. Do not retry it: move the amount from there.",
681
+ retryable: false,
682
+ };
683
+ }
676
684
  // Conflict (409) - check BEFORE 500+ to avoid being shadowed
677
685
  if (statusCode === StatusCodes.CONFLICT) {
678
686
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0xmonaco/core",
3
- "version": "1.1.8",
3
+ "version": "1.1.9",
4
4
  "type": "module",
5
5
  "homepage": "https://docs.0xmonaco.com/sdk/typescript",
6
6
  "main": "./dist/index.js",
@@ -19,8 +19,8 @@
19
19
  "viem": "^2.45.2"
20
20
  },
21
21
  "dependencies": {
22
- "@0xmonaco/contracts": "1.1.8",
23
- "@0xmonaco/types": "1.1.8",
22
+ "@0xmonaco/contracts": "1.1.9",
23
+ "@0xmonaco/types": "1.1.9",
24
24
  "@noble/curves": "^2.4.0",
25
25
  "@noble/hashes": "^2.4.0",
26
26
  "http-status-codes": "^2.3.0"