@compass-labs/api-sdk 2.2.104 → 2.2.105-rc.0

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 (159) hide show
  1. package/README.md +3 -13
  2. package/codeSamples_typescript.yaml +0 -18
  3. package/dist/commonjs/models/components/index.d.ts +0 -6
  4. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  5. package/dist/commonjs/models/components/index.js +0 -6
  6. package/dist/commonjs/models/components/index.js.map +1 -1
  7. package/dist/commonjs/models/errors/index.d.ts +0 -1
  8. package/dist/commonjs/models/errors/index.d.ts.map +1 -1
  9. package/dist/commonjs/models/errors/index.js +0 -1
  10. package/dist/commonjs/models/errors/index.js.map +1 -1
  11. package/dist/commonjs/models/operations/index.d.ts +0 -1
  12. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  13. package/dist/commonjs/models/operations/index.js +0 -1
  14. package/dist/commonjs/models/operations/index.js.map +1 -1
  15. package/dist/commonjs/sdk/sdk.d.ts +0 -3
  16. package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
  17. package/dist/commonjs/sdk/sdk.js +0 -4
  18. package/dist/commonjs/sdk/sdk.js.map +1 -1
  19. package/dist/esm/models/components/index.d.ts +0 -6
  20. package/dist/esm/models/components/index.d.ts.map +1 -1
  21. package/dist/esm/models/components/index.js +0 -6
  22. package/dist/esm/models/components/index.js.map +1 -1
  23. package/dist/esm/models/errors/index.d.ts +0 -1
  24. package/dist/esm/models/errors/index.d.ts.map +1 -1
  25. package/dist/esm/models/errors/index.js +0 -1
  26. package/dist/esm/models/errors/index.js.map +1 -1
  27. package/dist/esm/models/operations/index.d.ts +0 -1
  28. package/dist/esm/models/operations/index.d.ts.map +1 -1
  29. package/dist/esm/models/operations/index.js +0 -1
  30. package/dist/esm/models/operations/index.js.map +1 -1
  31. package/dist/esm/sdk/sdk.d.ts +0 -3
  32. package/dist/esm/sdk/sdk.d.ts.map +1 -1
  33. package/dist/esm/sdk/sdk.js +0 -4
  34. package/dist/esm/sdk/sdk.js.map +1 -1
  35. package/openapi_prepped_for_speakeasy.json +0 -539
  36. package/package.json +1 -1
  37. package/src/models/components/index.ts +0 -6
  38. package/src/models/errors/index.ts +0 -1
  39. package/src/models/operations/index.ts +0 -1
  40. package/src/sdk/sdk.ts +0 -6
  41. package/dist/commonjs/funcs/onrampOnrampCreate.d.ts +0 -38
  42. package/dist/commonjs/funcs/onrampOnrampCreate.d.ts.map +0 -1
  43. package/dist/commonjs/funcs/onrampOnrampCreate.js +0 -139
  44. package/dist/commonjs/funcs/onrampOnrampCreate.js.map +0 -1
  45. package/dist/commonjs/funcs/onrampOnrampQuote.d.ts +0 -27
  46. package/dist/commonjs/funcs/onrampOnrampQuote.d.ts.map +0 -1
  47. package/dist/commonjs/funcs/onrampOnrampQuote.js +0 -128
  48. package/dist/commonjs/funcs/onrampOnrampQuote.js.map +0 -1
  49. package/dist/commonjs/funcs/onrampOnrampStatus.d.ts +0 -31
  50. package/dist/commonjs/funcs/onrampOnrampStatus.d.ts.map +0 -1
  51. package/dist/commonjs/funcs/onrampOnrampStatus.js +0 -135
  52. package/dist/commonjs/funcs/onrampOnrampStatus.js.map +0 -1
  53. package/dist/commonjs/models/components/onrampcreate.d.ts +0 -59
  54. package/dist/commonjs/models/components/onrampcreate.d.ts.map +0 -1
  55. package/dist/commonjs/models/components/onrampcreate.js +0 -75
  56. package/dist/commonjs/models/components/onrampcreate.js.map +0 -1
  57. package/dist/commonjs/models/components/onrampcreaterequest.d.ts +0 -40
  58. package/dist/commonjs/models/components/onrampcreaterequest.d.ts.map +0 -1
  59. package/dist/commonjs/models/components/onrampcreaterequest.js +0 -60
  60. package/dist/commonjs/models/components/onrampcreaterequest.js.map +0 -1
  61. package/dist/commonjs/models/components/onrampfees.d.ts +0 -29
  62. package/dist/commonjs/models/components/onrampfees.d.ts.map +0 -1
  63. package/dist/commonjs/models/components/onrampfees.js +0 -59
  64. package/dist/commonjs/models/components/onrampfees.js.map +0 -1
  65. package/dist/commonjs/models/components/onrampquote.d.ts +0 -58
  66. package/dist/commonjs/models/components/onrampquote.d.ts.map +0 -1
  67. package/dist/commonjs/models/components/onrampquote.js +0 -73
  68. package/dist/commonjs/models/components/onrampquote.js.map +0 -1
  69. package/dist/commonjs/models/components/onrampquoterequest.d.ts +0 -34
  70. package/dist/commonjs/models/components/onrampquoterequest.d.ts.map +0 -1
  71. package/dist/commonjs/models/components/onrampquoterequest.js +0 -58
  72. package/dist/commonjs/models/components/onrampquoterequest.js.map +0 -1
  73. package/dist/commonjs/models/components/onrampstatus.d.ts +0 -57
  74. package/dist/commonjs/models/components/onrampstatus.d.ts.map +0 -1
  75. package/dist/commonjs/models/components/onrampstatus.js +0 -75
  76. package/dist/commonjs/models/components/onrampstatus.js.map +0 -1
  77. package/dist/commonjs/models/errors/onramperrorresponse.d.ts +0 -44
  78. package/dist/commonjs/models/errors/onramperrorresponse.d.ts.map +0 -1
  79. package/dist/commonjs/models/errors/onramperrorresponse.js +0 -75
  80. package/dist/commonjs/models/errors/onramperrorresponse.js.map +0 -1
  81. package/dist/commonjs/models/operations/v2onrampstatus.d.ts +0 -15
  82. package/dist/commonjs/models/operations/v2onrampstatus.d.ts.map +0 -1
  83. package/dist/commonjs/models/operations/v2onrampstatus.js +0 -54
  84. package/dist/commonjs/models/operations/v2onrampstatus.js.map +0 -1
  85. package/dist/commonjs/sdk/onramp.d.ts +0 -68
  86. package/dist/commonjs/sdk/onramp.d.ts.map +0 -1
  87. package/dist/commonjs/sdk/onramp.js +0 -83
  88. package/dist/commonjs/sdk/onramp.js.map +0 -1
  89. package/dist/esm/funcs/onrampOnrampCreate.d.ts +0 -38
  90. package/dist/esm/funcs/onrampOnrampCreate.d.ts.map +0 -1
  91. package/dist/esm/funcs/onrampOnrampCreate.js +0 -103
  92. package/dist/esm/funcs/onrampOnrampCreate.js.map +0 -1
  93. package/dist/esm/funcs/onrampOnrampQuote.d.ts +0 -27
  94. package/dist/esm/funcs/onrampOnrampQuote.d.ts.map +0 -1
  95. package/dist/esm/funcs/onrampOnrampQuote.js +0 -92
  96. package/dist/esm/funcs/onrampOnrampQuote.js.map +0 -1
  97. package/dist/esm/funcs/onrampOnrampStatus.d.ts +0 -31
  98. package/dist/esm/funcs/onrampOnrampStatus.d.ts.map +0 -1
  99. package/dist/esm/funcs/onrampOnrampStatus.js +0 -99
  100. package/dist/esm/funcs/onrampOnrampStatus.js.map +0 -1
  101. package/dist/esm/models/components/onrampcreate.d.ts +0 -59
  102. package/dist/esm/models/components/onrampcreate.d.ts.map +0 -1
  103. package/dist/esm/models/components/onrampcreate.js +0 -38
  104. package/dist/esm/models/components/onrampcreate.js.map +0 -1
  105. package/dist/esm/models/components/onrampcreaterequest.d.ts +0 -40
  106. package/dist/esm/models/components/onrampcreaterequest.d.ts.map +0 -1
  107. package/dist/esm/models/components/onrampcreaterequest.js +0 -23
  108. package/dist/esm/models/components/onrampcreaterequest.js.map +0 -1
  109. package/dist/esm/models/components/onrampfees.d.ts +0 -29
  110. package/dist/esm/models/components/onrampfees.d.ts.map +0 -1
  111. package/dist/esm/models/components/onrampfees.js +0 -22
  112. package/dist/esm/models/components/onrampfees.js.map +0 -1
  113. package/dist/esm/models/components/onrampquote.d.ts +0 -58
  114. package/dist/esm/models/components/onrampquote.d.ts.map +0 -1
  115. package/dist/esm/models/components/onrampquote.js +0 -36
  116. package/dist/esm/models/components/onrampquote.js.map +0 -1
  117. package/dist/esm/models/components/onrampquoterequest.d.ts +0 -34
  118. package/dist/esm/models/components/onrampquoterequest.d.ts.map +0 -1
  119. package/dist/esm/models/components/onrampquoterequest.js +0 -21
  120. package/dist/esm/models/components/onrampquoterequest.js.map +0 -1
  121. package/dist/esm/models/components/onrampstatus.d.ts +0 -57
  122. package/dist/esm/models/components/onrampstatus.d.ts.map +0 -1
  123. package/dist/esm/models/components/onrampstatus.js +0 -38
  124. package/dist/esm/models/components/onrampstatus.js.map +0 -1
  125. package/dist/esm/models/errors/onramperrorresponse.d.ts +0 -44
  126. package/dist/esm/models/errors/onramperrorresponse.d.ts.map +0 -1
  127. package/dist/esm/models/errors/onramperrorresponse.js +0 -38
  128. package/dist/esm/models/errors/onramperrorresponse.js.map +0 -1
  129. package/dist/esm/models/operations/v2onrampstatus.d.ts +0 -15
  130. package/dist/esm/models/operations/v2onrampstatus.d.ts.map +0 -1
  131. package/dist/esm/models/operations/v2onrampstatus.js +0 -17
  132. package/dist/esm/models/operations/v2onrampstatus.js.map +0 -1
  133. package/dist/esm/sdk/onramp.d.ts +0 -68
  134. package/dist/esm/sdk/onramp.d.ts.map +0 -1
  135. package/dist/esm/sdk/onramp.js +0 -79
  136. package/dist/esm/sdk/onramp.js.map +0 -1
  137. package/docs/models/components/onrampcreate.md +0 -43
  138. package/docs/models/components/onrampcreaterequest.md +0 -29
  139. package/docs/models/components/onrampcreatestatus.md +0 -17
  140. package/docs/models/components/onrampfees.md +0 -26
  141. package/docs/models/components/onrampquote.md +0 -36
  142. package/docs/models/components/onrampquoterequest.md +0 -27
  143. package/docs/models/components/onrampstatus.md +0 -28
  144. package/docs/models/components/onrampstatusstatus.md +0 -17
  145. package/docs/models/errors/onramperrorresponse.md +0 -21
  146. package/docs/models/operations/v2onrampstatusrequest.md +0 -17
  147. package/docs/sdks/onramp/README.md +0 -283
  148. package/src/funcs/onrampOnrampCreate.ts +0 -192
  149. package/src/funcs/onrampOnrampQuote.ts +0 -181
  150. package/src/funcs/onrampOnrampStatus.ts +0 -189
  151. package/src/models/components/onrampcreate.ts +0 -97
  152. package/src/models/components/onrampcreaterequest.ts +0 -70
  153. package/src/models/components/onrampfees.ts +0 -59
  154. package/src/models/components/onrampquote.ts +0 -101
  155. package/src/models/components/onrampquoterequest.ts +0 -62
  156. package/src/models/components/onrampstatus.ts +0 -96
  157. package/src/models/errors/onramperrorresponse.ts +0 -75
  158. package/src/models/operations/v2onrampstatus.ts +0 -39
  159. package/src/sdk/onramp.ts +0 -105
@@ -1,75 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod/v3";
6
- import { CompassAPISDKError } from "./compassapisdkerror.js";
7
-
8
- /**
9
- * Standard error envelope returned by every non-2xx on-ramp response.
10
- *
11
- * @remarks
12
- *
13
- * Surfaced in OpenAPI ``responses`` declarations so SDK consumers can decode
14
- * failures uniformly without inspecting per-status-code shapes.
15
- */
16
- export type OnrampErrorResponseData = {
17
- /**
18
- * Short human-readable error label (e.g. `Payment not found.`, `On-ramp provider unavailable`, `Identity verification required`).
19
- */
20
- error: string;
21
- /**
22
- * Human-readable explanation.
23
- */
24
- message: string;
25
- };
26
-
27
- /**
28
- * Standard error envelope returned by every non-2xx on-ramp response.
29
- *
30
- * @remarks
31
- *
32
- * Surfaced in OpenAPI ``responses`` declarations so SDK consumers can decode
33
- * failures uniformly without inspecting per-status-code shapes.
34
- */
35
- export class OnrampErrorResponse extends CompassAPISDKError {
36
- /**
37
- * Short human-readable error label (e.g. `Payment not found.`, `On-ramp provider unavailable`, `Identity verification required`).
38
- */
39
- error: string;
40
-
41
- /** The original data that was passed to this error instance. */
42
- data$: OnrampErrorResponseData;
43
-
44
- constructor(
45
- err: OnrampErrorResponseData,
46
- httpMeta: { response: Response; request: Request; body: string },
47
- ) {
48
- const message = err.message || `API error occurred: ${JSON.stringify(err)}`;
49
- super(message, httpMeta);
50
- this.data$ = err;
51
- this.error = err.error;
52
-
53
- this.name = "OnrampErrorResponse";
54
- }
55
- }
56
-
57
- /** @internal */
58
- export const OnrampErrorResponse$inboundSchema: z.ZodType<
59
- OnrampErrorResponse,
60
- z.ZodTypeDef,
61
- unknown
62
- > = z.object({
63
- error: z.string(),
64
- message: z.string(),
65
- request$: z.instanceof(Request),
66
- response$: z.instanceof(Response),
67
- body$: z.string(),
68
- })
69
- .transform((v) => {
70
- return new OnrampErrorResponse(v, {
71
- request: v.request$,
72
- response: v.response$,
73
- body: v.body$,
74
- });
75
- });
@@ -1,39 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod/v3";
6
- import { remap as remap$ } from "../../lib/primitives.js";
7
-
8
- export type V2OnrampStatusRequest = {
9
- /**
10
- * The `payment_id` returned by `POST /v2/onramp/create`.
11
- */
12
- paymentId: string;
13
- };
14
-
15
- /** @internal */
16
- export type V2OnrampStatusRequest$Outbound = {
17
- payment_id: string;
18
- };
19
-
20
- /** @internal */
21
- export const V2OnrampStatusRequest$outboundSchema: z.ZodType<
22
- V2OnrampStatusRequest$Outbound,
23
- z.ZodTypeDef,
24
- V2OnrampStatusRequest
25
- > = z.object({
26
- paymentId: z.string(),
27
- }).transform((v) => {
28
- return remap$(v, {
29
- paymentId: "payment_id",
30
- });
31
- });
32
-
33
- export function v2OnrampStatusRequestToJSON(
34
- v2OnrampStatusRequest: V2OnrampStatusRequest,
35
- ): string {
36
- return JSON.stringify(
37
- V2OnrampStatusRequest$outboundSchema.parse(v2OnrampStatusRequest),
38
- );
39
- }
package/src/sdk/onramp.ts DELETED
@@ -1,105 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import { onrampOnrampCreate } from "../funcs/onrampOnrampCreate.js";
6
- import { onrampOnrampQuote } from "../funcs/onrampOnrampQuote.js";
7
- import { onrampOnrampStatus } from "../funcs/onrampOnrampStatus.js";
8
- import { ClientSDK, RequestOptions } from "../lib/sdks.js";
9
- import * as components from "../models/components/index.js";
10
- import * as operations from "../models/operations/index.js";
11
- import { unwrapAsync } from "../types/fp.js";
12
-
13
- export class Onramp extends ClientSDK {
14
- /**
15
- * Get a fiat on-ramp quote (card -> USDC on Ethereum)
16
- *
17
- * @remarks
18
- * Get an indicative quote for buying USDC on Ethereum with a card.
19
- *
20
- * Returns the estimated USDC the user will receive for a given fiat amount,
21
- * the exchange rate, fee breakdown (`business_fees` is `0`), and the provider
22
- * min/max limits. The output is always **USDC on Ethereum** delivered to the
23
- * `destination_address` — this is a non-custodial on-ramp, so Compass never
24
- * holds the funds.
25
- *
26
- * This quote is indicative and may expire (`expires_at`). To actually start a
27
- * payment, call `POST /v2/onramp/create`.
28
- */
29
- async onrampQuote(
30
- request: components.OnrampQuoteRequest,
31
- options?: RequestOptions,
32
- ): Promise<components.OnrampQuote> {
33
- return unwrapAsync(onrampOnrampQuote(
34
- this,
35
- request,
36
- options,
37
- ));
38
- }
39
-
40
- /**
41
- * Create a fiat on-ramp payment + get the checkout link
42
- *
43
- * @remarks
44
- * Create a fiat on-ramp payment and return the browser-checkout handoff.
45
- *
46
- * A fiat card + identity-verification flow can only render in a browser, so
47
- * this endpoint returns a **`checkout_url`** (a Compass-hosted page) together
48
- * with `payment_id`, the one-time-wallet `deposit_address`, an initial
49
- * `status`, and a `user_instructions` string.
50
- *
51
- * **How to drive this (CLI / MCP agent / UI):**
52
- *
53
- * 1. **Present `checkout_url` to the user and open it in a browser.** It
54
- * renders the card payment + identity verification and delivers USDC on
55
- * Ethereum to the destination wallet. (An MCP agent cannot open a browser
56
- * itself — show the link and ask the user to open it.)
57
- * 2. **Poll `GET /v2/onramp/status?payment_id=...`** until `status` becomes
58
- * `delivered` (or `failed`). `pending` = awaiting payment, `processing` =
59
- * payment received and bridging/swapping to USDC.
60
- * 3. Once `delivered`, the USDC is in the user's own wallet — continue with
61
- * the tokenized buy.
62
- *
63
- * Funds are never held by Compass: the `deposit_address` is a one-time wallet
64
- * owned solely by the user's wallet.
65
- */
66
- async onrampCreate(
67
- request: components.OnrampCreateRequest,
68
- options?: RequestOptions,
69
- ): Promise<components.OnrampCreate> {
70
- return unwrapAsync(onrampOnrampCreate(
71
- this,
72
- request,
73
- options,
74
- ));
75
- }
76
-
77
- /**
78
- * Get the status of a fiat on-ramp payment
79
- *
80
- * @remarks
81
- * Get the current status of a fiat on-ramp payment.
82
- *
83
- * Poll this after `create` until `status` is `delivered`. The `status` field
84
- * is one of:
85
- *
86
- * - `pending` — awaiting the card payment in the hosted checkout.
87
- * - `processing` — payment received; bridging/swapping the proceeds to USDC.
88
- * - `delivered` — USDC has been delivered to the destination wallet
89
- * (`delivery_tx_hash` and `output_amount_delivered` are populated).
90
- * - `failed` — the payment failed, expired, or was refunded.
91
- *
92
- * State is re-read live from the on-ramp provider on every call — Compass
93
- * stores nothing of its own.
94
- */
95
- async onrampStatus(
96
- request: operations.V2OnrampStatusRequest,
97
- options?: RequestOptions,
98
- ): Promise<components.OnrampStatus> {
99
- return unwrapAsync(onrampOnrampStatus(
100
- this,
101
- request,
102
- options,
103
- ));
104
- }
105
- }