@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,189 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import { CompassApiSDKCore } from "../core.js";
6
- import { encodeFormQuery } from "../lib/encodings.js";
7
- import { matchStatusCode } from "../lib/http.js";
8
- import * as M from "../lib/matchers.js";
9
- import { compactMap } from "../lib/primitives.js";
10
- import { safeParse } from "../lib/schemas.js";
11
- import { RequestOptions } from "../lib/sdks.js";
12
- import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
13
- import { pathToFunc } from "../lib/url.js";
14
- import * as components from "../models/components/index.js";
15
- import { CompassAPISDKError } from "../models/errors/compassapisdkerror.js";
16
- import {
17
- ConnectionError,
18
- InvalidRequestError,
19
- RequestAbortedError,
20
- RequestTimeoutError,
21
- UnexpectedClientError,
22
- } from "../models/errors/httpclienterrors.js";
23
- import * as errors from "../models/errors/index.js";
24
- import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
25
- import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
26
- import * as operations from "../models/operations/index.js";
27
- import { APICall, APIPromise } from "../types/async.js";
28
- import { Result } from "../types/fp.js";
29
-
30
- /**
31
- * Get the status of a fiat on-ramp payment
32
- *
33
- * @remarks
34
- * Get the current status of a fiat on-ramp payment.
35
- *
36
- * Poll this after `create` until `status` is `delivered`. The `status` field
37
- * is one of:
38
- *
39
- * - `pending` — awaiting the card payment in the hosted checkout.
40
- * - `processing` — payment received; bridging/swapping the proceeds to USDC.
41
- * - `delivered` — USDC has been delivered to the destination wallet
42
- * (`delivery_tx_hash` and `output_amount_delivered` are populated).
43
- * - `failed` — the payment failed, expired, or was refunded.
44
- *
45
- * State is re-read live from the on-ramp provider on every call — Compass
46
- * stores nothing of its own.
47
- */
48
- export function onrampOnrampStatus(
49
- client: CompassApiSDKCore,
50
- request: operations.V2OnrampStatusRequest,
51
- options?: RequestOptions,
52
- ): APIPromise<
53
- Result<
54
- components.OnrampStatus,
55
- | errors.OnrampErrorResponse
56
- | CompassAPISDKError
57
- | ResponseValidationError
58
- | ConnectionError
59
- | RequestAbortedError
60
- | RequestTimeoutError
61
- | InvalidRequestError
62
- | UnexpectedClientError
63
- | SDKValidationError
64
- >
65
- > {
66
- return new APIPromise($do(
67
- client,
68
- request,
69
- options,
70
- ));
71
- }
72
-
73
- async function $do(
74
- client: CompassApiSDKCore,
75
- request: operations.V2OnrampStatusRequest,
76
- options?: RequestOptions,
77
- ): Promise<
78
- [
79
- Result<
80
- components.OnrampStatus,
81
- | errors.OnrampErrorResponse
82
- | CompassAPISDKError
83
- | ResponseValidationError
84
- | ConnectionError
85
- | RequestAbortedError
86
- | RequestTimeoutError
87
- | InvalidRequestError
88
- | UnexpectedClientError
89
- | SDKValidationError
90
- >,
91
- APICall,
92
- ]
93
- > {
94
- const parsed = safeParse(
95
- request,
96
- (value) => operations.V2OnrampStatusRequest$outboundSchema.parse(value),
97
- "Input validation failed",
98
- );
99
- if (!parsed.ok) {
100
- return [parsed, { status: "invalid" }];
101
- }
102
- const payload = parsed.value;
103
- const body = null;
104
-
105
- const path = pathToFunc("/v2/onramp/status")();
106
-
107
- const query = encodeFormQuery({
108
- "payment_id": payload.payment_id,
109
- });
110
-
111
- const headers = new Headers(compactMap({
112
- Accept: "application/json",
113
- }));
114
-
115
- const secConfig = await extractSecurity(client._options.apiKeyAuth);
116
- const securityInput = secConfig == null ? {} : { apiKeyAuth: secConfig };
117
- const requestSecurity = resolveGlobalSecurity(securityInput);
118
-
119
- const context = {
120
- options: client._options,
121
- baseURL: options?.serverURL ?? client._baseURL ?? "",
122
- operationID: "v2_onramp_status",
123
- oAuth2Scopes: null,
124
-
125
- resolvedSecurity: requestSecurity,
126
-
127
- securitySource: client._options.apiKeyAuth,
128
- retryConfig: options?.retries
129
- || client._options.retryConfig
130
- || { strategy: "none" },
131
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
132
- };
133
-
134
- const requestRes = client._createRequest(context, {
135
- security: requestSecurity,
136
- method: "GET",
137
- baseURL: options?.serverURL,
138
- path: path,
139
- headers: headers,
140
- query: query,
141
- body: body,
142
- userAgent: client._options.userAgent,
143
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
144
- }, options);
145
- if (!requestRes.ok) {
146
- return [requestRes, { status: "invalid" }];
147
- }
148
- const req = requestRes.value;
149
-
150
- const doResult = await client._do(req, {
151
- context,
152
- isErrorStatusCode: (statusCode: number) =>
153
- matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
154
- retryConfig: context.retryConfig,
155
- retryCodes: context.retryCodes,
156
- });
157
- if (!doResult.ok) {
158
- return [doResult, { status: "request-error", request: req }];
159
- }
160
- const response = doResult.value;
161
-
162
- const responseFields = {
163
- HttpMeta: { Response: response, Request: req },
164
- };
165
-
166
- const [result] = await M.match<
167
- components.OnrampStatus,
168
- | errors.OnrampErrorResponse
169
- | CompassAPISDKError
170
- | ResponseValidationError
171
- | ConnectionError
172
- | RequestAbortedError
173
- | RequestTimeoutError
174
- | InvalidRequestError
175
- | UnexpectedClientError
176
- | SDKValidationError
177
- >(
178
- M.json(200, components.OnrampStatus$inboundSchema),
179
- M.jsonErr([404, 422], errors.OnrampErrorResponse$inboundSchema),
180
- M.jsonErr(502, errors.OnrampErrorResponse$inboundSchema),
181
- M.fail("4XX"),
182
- M.fail("5XX"),
183
- )(response, req, { extraFields: responseFields });
184
- if (!result.ok) {
185
- return [result, { status: "complete", request: req, response }];
186
- }
187
-
188
- return [result, { status: "complete", request: req, response }];
189
- }
@@ -1,97 +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
- import { safeParse } from "../../lib/schemas.js";
8
- import { ClosedEnum } from "../../types/enums.js";
9
- import { Result as SafeParseResult } from "../../types/fp.js";
10
- import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
- import { OnrampQuote, OnrampQuote$inboundSchema } from "./onrampquote.js";
12
-
13
- /**
14
- * Initial lifecycle state (typically `pending`).
15
- */
16
- export const OnrampCreateStatus = {
17
- Pending: "pending",
18
- Processing: "processing",
19
- Delivered: "delivered",
20
- Failed: "failed",
21
- } as const;
22
- /**
23
- * Initial lifecycle state (typically `pending`).
24
- */
25
- export type OnrampCreateStatus = ClosedEnum<typeof OnrampCreateStatus>;
26
-
27
- /**
28
- * A created on-ramp payment, with the browser-handoff affordances.
29
- *
30
- * @remarks
31
- *
32
- * The caller (CLI / MCP agent / UI) presents ``checkout_url`` to the user to
33
- * pay by card and complete identity verification, then polls
34
- * ``GET /v2/onramp/status`` until ``status`` is ``delivered``.
35
- */
36
- export type OnrampCreate = {
37
- /**
38
- * Halliday's payment id. Use it to poll status.
39
- */
40
- paymentId: string;
41
- /**
42
- * The one-time-wallet (OTW) deposit address for this payment, owned solely by the user's wallet (non-custodial).
43
- */
44
- depositAddress: string;
45
- /**
46
- * Compass-hosted checkout page to open in a browser. It renders the card + identity-verification flow and delivers USDC to the destination wallet.
47
- */
48
- checkoutUrl: string;
49
- /**
50
- * Short, agent-actionable guidance: open the checkout link, pay, then poll status until delivered.
51
- */
52
- userInstructions: string;
53
- /**
54
- * Initial lifecycle state (typically `pending`).
55
- */
56
- status: OnrampCreateStatus;
57
- /**
58
- * An indicative fiat -> USDC-on-Ethereum quote.
59
- */
60
- quote: OnrampQuote;
61
- };
62
-
63
- /** @internal */
64
- export const OnrampCreateStatus$inboundSchema: z.ZodNativeEnum<
65
- typeof OnrampCreateStatus
66
- > = z.nativeEnum(OnrampCreateStatus);
67
-
68
- /** @internal */
69
- export const OnrampCreate$inboundSchema: z.ZodType<
70
- OnrampCreate,
71
- z.ZodTypeDef,
72
- unknown
73
- > = z.object({
74
- payment_id: z.string(),
75
- deposit_address: z.string(),
76
- checkout_url: z.string(),
77
- user_instructions: z.string(),
78
- status: OnrampCreateStatus$inboundSchema,
79
- quote: OnrampQuote$inboundSchema,
80
- }).transform((v) => {
81
- return remap$(v, {
82
- "payment_id": "paymentId",
83
- "deposit_address": "depositAddress",
84
- "checkout_url": "checkoutUrl",
85
- "user_instructions": "userInstructions",
86
- });
87
- });
88
-
89
- export function onrampCreateFromJSON(
90
- jsonString: string,
91
- ): SafeParseResult<OnrampCreate, SDKValidationError> {
92
- return safeParse(
93
- jsonString,
94
- (x) => OnrampCreate$inboundSchema.parse(JSON.parse(x)),
95
- `Failed to parse 'OnrampCreate' from JSON`,
96
- );
97
- }
@@ -1,70 +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
- /**
9
- * Create a fiat on-ramp payment delivering USDC on Ethereum.
10
- *
11
- * @remarks
12
- *
13
- * Carries the same fields as the quote (a quote is implicit — we do not
14
- * persist a quote handle). ``quote_id`` is optional and only echoed upstream
15
- * if Halliday's ``/payments/confirm`` requires a previously-issued quote
16
- * handle; omit it to confirm against a fresh quote.
17
- */
18
- export type OnrampCreateRequest = {
19
- /**
20
- * Amount of fiat to spend, as a decimal string (e.g. `100`).
21
- */
22
- fiatAmount: string;
23
- /**
24
- * ISO-4217 fiat currency code. Defaults to `USD`.
25
- */
26
- fiatCurrency?: string | undefined;
27
- /**
28
- * The wallet that will receive the USDC on Ethereum. Funds are delivered here directly — Compass never holds them.
29
- */
30
- destinationAddress: string;
31
- /**
32
- * Optional Halliday quote handle to confirm against. Omit to confirm against a fresh quote derived from the amount and currency.
33
- */
34
- quoteId?: string | null | undefined;
35
- };
36
-
37
- /** @internal */
38
- export type OnrampCreateRequest$Outbound = {
39
- fiat_amount: string;
40
- fiat_currency?: string | undefined;
41
- destination_address: string;
42
- quote_id?: string | null | undefined;
43
- };
44
-
45
- /** @internal */
46
- export const OnrampCreateRequest$outboundSchema: z.ZodType<
47
- OnrampCreateRequest$Outbound,
48
- z.ZodTypeDef,
49
- OnrampCreateRequest
50
- > = z.object({
51
- fiatAmount: z.string(),
52
- fiatCurrency: z.string().optional(),
53
- destinationAddress: z.string(),
54
- quoteId: z.nullable(z.string()).optional(),
55
- }).transform((v) => {
56
- return remap$(v, {
57
- fiatAmount: "fiat_amount",
58
- fiatCurrency: "fiat_currency",
59
- destinationAddress: "destination_address",
60
- quoteId: "quote_id",
61
- });
62
- });
63
-
64
- export function onrampCreateRequestToJSON(
65
- onrampCreateRequest: OnrampCreateRequest,
66
- ): string {
67
- return JSON.stringify(
68
- OnrampCreateRequest$outboundSchema.parse(onrampCreateRequest),
69
- );
70
- }
@@ -1,59 +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
- import { safeParse } from "../../lib/schemas.js";
8
- import { Result as SafeParseResult } from "../../types/fp.js";
9
- import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
-
11
- /**
12
- * Fee breakdown for an on-ramp quote.
13
- *
14
- * @remarks
15
- *
16
- * ``business_fees`` is a fixed ``"0"`` for now — monetization is a single
17
- * future lever and is intentionally not charged.
18
- */
19
- export type OnrampFees = {
20
- /**
21
- * Fee charged by the on-ramp provider, in fiat.
22
- */
23
- providerFee: string;
24
- /**
25
- * Estimated network/gas fee, in fiat.
26
- */
27
- networkFee: string;
28
- /**
29
- * Compass business fee, in fiat. Always `0` for now.
30
- */
31
- businessFees?: string | undefined;
32
- };
33
-
34
- /** @internal */
35
- export const OnrampFees$inboundSchema: z.ZodType<
36
- OnrampFees,
37
- z.ZodTypeDef,
38
- unknown
39
- > = z.object({
40
- provider_fee: z.string(),
41
- network_fee: z.string(),
42
- business_fees: z.string().optional(),
43
- }).transform((v) => {
44
- return remap$(v, {
45
- "provider_fee": "providerFee",
46
- "network_fee": "networkFee",
47
- "business_fees": "businessFees",
48
- });
49
- });
50
-
51
- export function onrampFeesFromJSON(
52
- jsonString: string,
53
- ): SafeParseResult<OnrampFees, SDKValidationError> {
54
- return safeParse(
55
- jsonString,
56
- (x) => OnrampFees$inboundSchema.parse(JSON.parse(x)),
57
- `Failed to parse 'OnrampFees' from JSON`,
58
- );
59
- }
@@ -1,101 +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
- import { safeParse } from "../../lib/schemas.js";
8
- import { Result as SafeParseResult } from "../../types/fp.js";
9
- import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
- import { OnrampFees, OnrampFees$inboundSchema } from "./onrampfees.js";
11
-
12
- /**
13
- * An indicative fiat -> USDC-on-Ethereum quote.
14
- */
15
- export type OnrampQuote = {
16
- /**
17
- * Fiat amount to spend.
18
- */
19
- fiatAmount: string;
20
- /**
21
- * ISO-4217 fiat currency code.
22
- */
23
- fiatCurrency: string;
24
- /**
25
- * Estimated USDC delivered, human-readable (6-decimal token).
26
- */
27
- outputAmount: string;
28
- /**
29
- * Delivered asset. Always USDC for this on-ramp.
30
- */
31
- outputAsset?: "USDC" | undefined;
32
- /**
33
- * Delivery chain. Always Ethereum for this on-ramp.
34
- */
35
- outputChain?: "ethereum" | undefined;
36
- /**
37
- * USDC received per unit of fiat.
38
- */
39
- exchangeRate: string;
40
- /**
41
- * Fee breakdown for an on-ramp quote.
42
- *
43
- * @remarks
44
- *
45
- * ``business_fees`` is a fixed ``"0"`` for now — monetization is a single
46
- * future lever and is intentionally not charged.
47
- */
48
- fees: OnrampFees;
49
- /**
50
- * Minimum fiat amount accepted, if advertised by the provider.
51
- */
52
- minAmount?: string | null | undefined;
53
- /**
54
- * Maximum fiat amount accepted, if advertised by the provider.
55
- */
56
- maxAmount?: string | null | undefined;
57
- /**
58
- * ISO-8601 timestamp after which this quote is stale, if any.
59
- */
60
- expiresAt?: string | null | undefined;
61
- };
62
-
63
- /** @internal */
64
- export const OnrampQuote$inboundSchema: z.ZodType<
65
- OnrampQuote,
66
- z.ZodTypeDef,
67
- unknown
68
- > = z.object({
69
- fiat_amount: z.string(),
70
- fiat_currency: z.string(),
71
- output_amount: z.string(),
72
- output_asset: z.literal("USDC").optional(),
73
- output_chain: z.literal("ethereum").optional(),
74
- exchange_rate: z.string(),
75
- fees: OnrampFees$inboundSchema,
76
- min_amount: z.nullable(z.string()).optional(),
77
- max_amount: z.nullable(z.string()).optional(),
78
- expires_at: z.nullable(z.string()).optional(),
79
- }).transform((v) => {
80
- return remap$(v, {
81
- "fiat_amount": "fiatAmount",
82
- "fiat_currency": "fiatCurrency",
83
- "output_amount": "outputAmount",
84
- "output_asset": "outputAsset",
85
- "output_chain": "outputChain",
86
- "exchange_rate": "exchangeRate",
87
- "min_amount": "minAmount",
88
- "max_amount": "maxAmount",
89
- "expires_at": "expiresAt",
90
- });
91
- });
92
-
93
- export function onrampQuoteFromJSON(
94
- jsonString: string,
95
- ): SafeParseResult<OnrampQuote, SDKValidationError> {
96
- return safeParse(
97
- jsonString,
98
- (x) => OnrampQuote$inboundSchema.parse(JSON.parse(x)),
99
- `Failed to parse 'OnrampQuote' from JSON`,
100
- );
101
- }
@@ -1,62 +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
- /**
9
- * An indicative fiat -> USDC-on-Ethereum quote request.
10
- *
11
- * @remarks
12
- *
13
- * The output asset and chain are fixed to USDC on Ethereum and are not
14
- * user-supplied — this product group delivers only USDC to the user's own
15
- * wallet (non-custodial).
16
- */
17
- export type OnrampQuoteRequest = {
18
- /**
19
- * Amount of fiat to spend, as a decimal string (e.g. `100`).
20
- */
21
- fiatAmount: string;
22
- /**
23
- * ISO-4217 fiat currency code. Defaults to `USD`.
24
- */
25
- fiatCurrency?: string | undefined;
26
- /**
27
- * The wallet that will receive the USDC on Ethereum. Funds are delivered here directly — Compass never holds them.
28
- */
29
- destinationAddress: string;
30
- };
31
-
32
- /** @internal */
33
- export type OnrampQuoteRequest$Outbound = {
34
- fiat_amount: string;
35
- fiat_currency?: string | undefined;
36
- destination_address: string;
37
- };
38
-
39
- /** @internal */
40
- export const OnrampQuoteRequest$outboundSchema: z.ZodType<
41
- OnrampQuoteRequest$Outbound,
42
- z.ZodTypeDef,
43
- OnrampQuoteRequest
44
- > = z.object({
45
- fiatAmount: z.string(),
46
- fiatCurrency: z.string().optional(),
47
- destinationAddress: z.string(),
48
- }).transform((v) => {
49
- return remap$(v, {
50
- fiatAmount: "fiat_amount",
51
- fiatCurrency: "fiat_currency",
52
- destinationAddress: "destination_address",
53
- });
54
- });
55
-
56
- export function onrampQuoteRequestToJSON(
57
- onrampQuoteRequest: OnrampQuoteRequest,
58
- ): string {
59
- return JSON.stringify(
60
- OnrampQuoteRequest$outboundSchema.parse(onrampQuoteRequest),
61
- );
62
- }
@@ -1,96 +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
- import { safeParse } from "../../lib/schemas.js";
8
- import { ClosedEnum } from "../../types/enums.js";
9
- import { Result as SafeParseResult } from "../../types/fp.js";
10
- import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
-
12
- /**
13
- * Lifecycle state: `pending` (awaiting card payment), `processing` (payment received, bridging/swapping to USDC), `delivered` (USDC received in the destination wallet), or `failed`.
14
- */
15
- export const OnrampStatusStatus = {
16
- Pending: "pending",
17
- Processing: "processing",
18
- Delivered: "delivered",
19
- Failed: "failed",
20
- } as const;
21
- /**
22
- * Lifecycle state: `pending` (awaiting card payment), `processing` (payment received, bridging/swapping to USDC), `delivered` (USDC received in the destination wallet), or `failed`.
23
- */
24
- export type OnrampStatusStatus = ClosedEnum<typeof OnrampStatusStatus>;
25
-
26
- /**
27
- * Current state of a fiat on-ramp payment.
28
- *
29
- * @remarks
30
- *
31
- * Re-read on demand from Halliday (the system of record) — Compass holds no
32
- * state of its own.
33
- */
34
- export type OnrampStatus = {
35
- /**
36
- * Halliday's payment id, echoed straight through.
37
- */
38
- paymentId: string;
39
- /**
40
- * Lifecycle state: `pending` (awaiting card payment), `processing` (payment received, bridging/swapping to USDC), `delivered` (USDC received in the destination wallet), or `failed`.
41
- */
42
- status: OnrampStatusStatus;
43
- /**
44
- * USDC delivered so far, human-readable. Set once delivered.
45
- */
46
- outputAmountDelivered?: string | null | undefined;
47
- /**
48
- * Ethereum tx hash of the USDC delivery, once available.
49
- */
50
- deliveryTxHash?: string | null | undefined;
51
- /**
52
- * The wallet the USDC is delivered to.
53
- */
54
- destinationAddress?: string | null | undefined;
55
- /**
56
- * ISO-8601 timestamp of the last status change, if provided.
57
- */
58
- updatedAt?: string | null | undefined;
59
- };
60
-
61
- /** @internal */
62
- export const OnrampStatusStatus$inboundSchema: z.ZodNativeEnum<
63
- typeof OnrampStatusStatus
64
- > = z.nativeEnum(OnrampStatusStatus);
65
-
66
- /** @internal */
67
- export const OnrampStatus$inboundSchema: z.ZodType<
68
- OnrampStatus,
69
- z.ZodTypeDef,
70
- unknown
71
- > = z.object({
72
- payment_id: z.string(),
73
- status: OnrampStatusStatus$inboundSchema,
74
- output_amount_delivered: z.nullable(z.string()).optional(),
75
- delivery_tx_hash: z.nullable(z.string()).optional(),
76
- destination_address: z.nullable(z.string()).optional(),
77
- updated_at: z.nullable(z.string()).optional(),
78
- }).transform((v) => {
79
- return remap$(v, {
80
- "payment_id": "paymentId",
81
- "output_amount_delivered": "outputAmountDelivered",
82
- "delivery_tx_hash": "deliveryTxHash",
83
- "destination_address": "destinationAddress",
84
- "updated_at": "updatedAt",
85
- });
86
- });
87
-
88
- export function onrampStatusFromJSON(
89
- jsonString: string,
90
- ): SafeParseResult<OnrampStatus, SDKValidationError> {
91
- return safeParse(
92
- jsonString,
93
- (x) => OnrampStatus$inboundSchema.parse(JSON.parse(x)),
94
- `Failed to parse 'OnrampStatus' from JSON`,
95
- );
96
- }