@compass-labs/api-sdk 2.2.69 → 2.2.70-rc.1
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.
- package/README.md +13 -3
- package/codeSamples_typescript.yaml +18 -0
- package/dist/commonjs/funcs/onrampOnrampCreate.d.ts +38 -0
- package/dist/commonjs/funcs/onrampOnrampCreate.d.ts.map +1 -0
- package/dist/commonjs/funcs/onrampOnrampCreate.js +139 -0
- package/dist/commonjs/funcs/onrampOnrampCreate.js.map +1 -0
- package/dist/commonjs/funcs/onrampOnrampQuote.d.ts +27 -0
- package/dist/commonjs/funcs/onrampOnrampQuote.d.ts.map +1 -0
- package/dist/commonjs/funcs/onrampOnrampQuote.js +128 -0
- package/dist/commonjs/funcs/onrampOnrampQuote.js.map +1 -0
- package/dist/commonjs/funcs/onrampOnrampStatus.d.ts +31 -0
- package/dist/commonjs/funcs/onrampOnrampStatus.d.ts.map +1 -0
- package/dist/commonjs/funcs/onrampOnrampStatus.js +135 -0
- package/dist/commonjs/funcs/onrampOnrampStatus.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/models/components/index.d.ts +6 -0
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +6 -0
- package/dist/commonjs/models/components/index.js.map +1 -1
- package/dist/commonjs/models/components/onrampcreate.d.ts +59 -0
- package/dist/commonjs/models/components/onrampcreate.d.ts.map +1 -0
- package/dist/commonjs/models/components/onrampcreate.js +75 -0
- package/dist/commonjs/models/components/onrampcreate.js.map +1 -0
- package/dist/commonjs/models/components/onrampcreaterequest.d.ts +40 -0
- package/dist/commonjs/models/components/onrampcreaterequest.d.ts.map +1 -0
- package/dist/commonjs/models/components/onrampcreaterequest.js +60 -0
- package/dist/commonjs/models/components/onrampcreaterequest.js.map +1 -0
- package/dist/commonjs/models/components/onrampfees.d.ts +29 -0
- package/dist/commonjs/models/components/onrampfees.d.ts.map +1 -0
- package/dist/commonjs/models/components/onrampfees.js +59 -0
- package/dist/commonjs/models/components/onrampfees.js.map +1 -0
- package/dist/commonjs/models/components/onrampquote.d.ts +58 -0
- package/dist/commonjs/models/components/onrampquote.d.ts.map +1 -0
- package/dist/commonjs/models/components/onrampquote.js +73 -0
- package/dist/commonjs/models/components/onrampquote.js.map +1 -0
- package/dist/commonjs/models/components/onrampquoterequest.d.ts +34 -0
- package/dist/commonjs/models/components/onrampquoterequest.d.ts.map +1 -0
- package/dist/commonjs/models/components/onrampquoterequest.js +58 -0
- package/dist/commonjs/models/components/onrampquoterequest.js.map +1 -0
- package/dist/commonjs/models/components/onrampstatus.d.ts +57 -0
- package/dist/commonjs/models/components/onrampstatus.d.ts.map +1 -0
- package/dist/commonjs/models/components/onrampstatus.js +75 -0
- package/dist/commonjs/models/components/onrampstatus.js.map +1 -0
- package/dist/commonjs/models/components/orderstatus.d.ts +4 -4
- package/dist/commonjs/models/components/orderstatus.d.ts.map +1 -1
- package/dist/commonjs/models/components/orderstatus.js +4 -5
- package/dist/commonjs/models/components/orderstatus.js.map +1 -1
- package/dist/commonjs/models/errors/index.d.ts +1 -0
- package/dist/commonjs/models/errors/index.d.ts.map +1 -1
- package/dist/commonjs/models/errors/index.js +1 -0
- package/dist/commonjs/models/errors/index.js.map +1 -1
- package/dist/commonjs/models/errors/onramperrorresponse.d.ts +44 -0
- package/dist/commonjs/models/errors/onramperrorresponse.d.ts.map +1 -0
- package/dist/commonjs/models/errors/onramperrorresponse.js +75 -0
- package/dist/commonjs/models/errors/onramperrorresponse.js.map +1 -0
- package/dist/commonjs/models/operations/index.d.ts +1 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +1 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/operations/v2onrampstatus.d.ts +15 -0
- package/dist/commonjs/models/operations/v2onrampstatus.d.ts.map +1 -0
- package/dist/commonjs/models/operations/v2onrampstatus.js +54 -0
- package/dist/commonjs/models/operations/v2onrampstatus.js.map +1 -0
- package/dist/commonjs/sdk/onramp.d.ts +68 -0
- package/dist/commonjs/sdk/onramp.d.ts.map +1 -0
- package/dist/commonjs/sdk/onramp.js +83 -0
- package/dist/commonjs/sdk/onramp.js.map +1 -0
- package/dist/commonjs/sdk/sdk.d.ts +3 -0
- package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
- package/dist/commonjs/sdk/sdk.js +4 -0
- package/dist/commonjs/sdk/sdk.js.map +1 -1
- package/dist/esm/funcs/onrampOnrampCreate.d.ts +38 -0
- package/dist/esm/funcs/onrampOnrampCreate.d.ts.map +1 -0
- package/dist/esm/funcs/onrampOnrampCreate.js +103 -0
- package/dist/esm/funcs/onrampOnrampCreate.js.map +1 -0
- package/dist/esm/funcs/onrampOnrampQuote.d.ts +27 -0
- package/dist/esm/funcs/onrampOnrampQuote.d.ts.map +1 -0
- package/dist/esm/funcs/onrampOnrampQuote.js +92 -0
- package/dist/esm/funcs/onrampOnrampQuote.js.map +1 -0
- package/dist/esm/funcs/onrampOnrampStatus.d.ts +31 -0
- package/dist/esm/funcs/onrampOnrampStatus.d.ts.map +1 -0
- package/dist/esm/funcs/onrampOnrampStatus.js +99 -0
- package/dist/esm/funcs/onrampOnrampStatus.js.map +1 -0
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/models/components/index.d.ts +6 -0
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +6 -0
- package/dist/esm/models/components/index.js.map +1 -1
- package/dist/esm/models/components/onrampcreate.d.ts +59 -0
- package/dist/esm/models/components/onrampcreate.d.ts.map +1 -0
- package/dist/esm/models/components/onrampcreate.js +38 -0
- package/dist/esm/models/components/onrampcreate.js.map +1 -0
- package/dist/esm/models/components/onrampcreaterequest.d.ts +40 -0
- package/dist/esm/models/components/onrampcreaterequest.d.ts.map +1 -0
- package/dist/esm/models/components/onrampcreaterequest.js +23 -0
- package/dist/esm/models/components/onrampcreaterequest.js.map +1 -0
- package/dist/esm/models/components/onrampfees.d.ts +29 -0
- package/dist/esm/models/components/onrampfees.d.ts.map +1 -0
- package/dist/esm/models/components/onrampfees.js +22 -0
- package/dist/esm/models/components/onrampfees.js.map +1 -0
- package/dist/esm/models/components/onrampquote.d.ts +58 -0
- package/dist/esm/models/components/onrampquote.d.ts.map +1 -0
- package/dist/esm/models/components/onrampquote.js +36 -0
- package/dist/esm/models/components/onrampquote.js.map +1 -0
- package/dist/esm/models/components/onrampquoterequest.d.ts +34 -0
- package/dist/esm/models/components/onrampquoterequest.d.ts.map +1 -0
- package/dist/esm/models/components/onrampquoterequest.js +21 -0
- package/dist/esm/models/components/onrampquoterequest.js.map +1 -0
- package/dist/esm/models/components/onrampstatus.d.ts +57 -0
- package/dist/esm/models/components/onrampstatus.d.ts.map +1 -0
- package/dist/esm/models/components/onrampstatus.js +38 -0
- package/dist/esm/models/components/onrampstatus.js.map +1 -0
- package/dist/esm/models/components/orderstatus.d.ts +4 -4
- package/dist/esm/models/components/orderstatus.d.ts.map +1 -1
- package/dist/esm/models/components/orderstatus.js +3 -4
- package/dist/esm/models/components/orderstatus.js.map +1 -1
- package/dist/esm/models/errors/index.d.ts +1 -0
- package/dist/esm/models/errors/index.d.ts.map +1 -1
- package/dist/esm/models/errors/index.js +1 -0
- package/dist/esm/models/errors/index.js.map +1 -1
- package/dist/esm/models/errors/onramperrorresponse.d.ts +44 -0
- package/dist/esm/models/errors/onramperrorresponse.d.ts.map +1 -0
- package/dist/esm/models/errors/onramperrorresponse.js +38 -0
- package/dist/esm/models/errors/onramperrorresponse.js.map +1 -0
- package/dist/esm/models/operations/index.d.ts +1 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +1 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/operations/v2onrampstatus.d.ts +15 -0
- package/dist/esm/models/operations/v2onrampstatus.d.ts.map +1 -0
- package/dist/esm/models/operations/v2onrampstatus.js +17 -0
- package/dist/esm/models/operations/v2onrampstatus.js.map +1 -0
- package/dist/esm/sdk/onramp.d.ts +68 -0
- package/dist/esm/sdk/onramp.d.ts.map +1 -0
- package/dist/esm/sdk/onramp.js +79 -0
- package/dist/esm/sdk/onramp.js.map +1 -0
- package/dist/esm/sdk/sdk.d.ts +3 -0
- package/dist/esm/sdk/sdk.d.ts.map +1 -1
- package/dist/esm/sdk/sdk.js +4 -0
- package/dist/esm/sdk/sdk.js.map +1 -1
- package/docs/models/components/onrampcreate.md +43 -0
- package/docs/models/components/onrampcreaterequest.md +29 -0
- package/docs/models/components/onrampcreatestatus.md +17 -0
- package/docs/models/components/onrampfees.md +26 -0
- package/docs/models/components/onrampquote.md +36 -0
- package/docs/models/components/onrampquoterequest.md +27 -0
- package/docs/models/components/onrampstatus.md +28 -0
- package/docs/models/components/onrampstatusstatus.md +17 -0
- package/docs/models/components/orderstatus.md +1 -1
- package/docs/models/components/{status.md → orderstatusstatus.md} +3 -3
- package/docs/models/errors/onramperrorresponse.md +21 -0
- package/docs/models/operations/v2onrampstatusrequest.md +17 -0
- package/docs/sdks/onramp/README.md +283 -0
- package/openapi_prepped_for_speakeasy.json +539 -0
- package/package.json +1 -1
- package/src/funcs/onrampOnrampCreate.ts +192 -0
- package/src/funcs/onrampOnrampQuote.ts +181 -0
- package/src/funcs/onrampOnrampStatus.ts +189 -0
- package/src/lib/config.ts +2 -2
- package/src/models/components/index.ts +6 -0
- package/src/models/components/onrampcreate.ts +97 -0
- package/src/models/components/onrampcreaterequest.ts +70 -0
- package/src/models/components/onrampfees.ts +59 -0
- package/src/models/components/onrampquote.ts +101 -0
- package/src/models/components/onrampquoterequest.ts +62 -0
- package/src/models/components/onrampstatus.ts +96 -0
- package/src/models/components/orderstatus.ts +7 -6
- package/src/models/errors/index.ts +1 -0
- package/src/models/errors/onramperrorresponse.ts +75 -0
- package/src/models/operations/index.ts +1 -0
- package/src/models/operations/v2onrampstatus.ts +39 -0
- package/src/sdk/onramp.ts +105 -0
- package/src/sdk/sdk.ts +6 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# OnrampFees
|
|
2
|
+
|
|
3
|
+
Fee breakdown for an on-ramp quote.
|
|
4
|
+
|
|
5
|
+
``business_fees`` is a fixed ``"0"`` for now — monetization is a single
|
|
6
|
+
future lever and is intentionally not charged.
|
|
7
|
+
|
|
8
|
+
## Example Usage
|
|
9
|
+
|
|
10
|
+
```typescript
|
|
11
|
+
import { OnrampFees } from "@compass-labs/api-sdk/models/components";
|
|
12
|
+
|
|
13
|
+
let value: OnrampFees = {
|
|
14
|
+
providerFee: "<value>",
|
|
15
|
+
networkFee: "<value>",
|
|
16
|
+
businessFees: "0",
|
|
17
|
+
};
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Fields
|
|
21
|
+
|
|
22
|
+
| Field | Type | Required | Description | Example |
|
|
23
|
+
| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- |
|
|
24
|
+
| `providerFee` | *string* | :heavy_check_mark: | Fee charged by the on-ramp provider, in fiat. | |
|
|
25
|
+
| `networkFee` | *string* | :heavy_check_mark: | Estimated network/gas fee, in fiat. | |
|
|
26
|
+
| `businessFees` | *string* | :heavy_minus_sign: | Compass business fee, in fiat. Always `0` for now. | 0 |
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# OnrampQuote
|
|
2
|
+
|
|
3
|
+
An indicative fiat -> USDC-on-Ethereum quote.
|
|
4
|
+
|
|
5
|
+
## Example Usage
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import { OnrampQuote } from "@compass-labs/api-sdk/models/components";
|
|
9
|
+
|
|
10
|
+
let value: OnrampQuote = {
|
|
11
|
+
fiatAmount: "<value>",
|
|
12
|
+
fiatCurrency: "<value>",
|
|
13
|
+
outputAmount: "<value>",
|
|
14
|
+
exchangeRate: "<value>",
|
|
15
|
+
fees: {
|
|
16
|
+
providerFee: "<value>",
|
|
17
|
+
networkFee: "<value>",
|
|
18
|
+
businessFees: "0",
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Fields
|
|
24
|
+
|
|
25
|
+
| Field | Type | Required | Description | Example |
|
|
26
|
+
| ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
27
|
+
| `fiatAmount` | *string* | :heavy_check_mark: | Fiat amount to spend. | |
|
|
28
|
+
| `fiatCurrency` | *string* | :heavy_check_mark: | ISO-4217 fiat currency code. | |
|
|
29
|
+
| `outputAmount` | *string* | :heavy_check_mark: | Estimated USDC delivered, human-readable (6-decimal token). | |
|
|
30
|
+
| `outputAsset` | *"USDC"* | :heavy_minus_sign: | Delivered asset. Always USDC for this on-ramp. | USDC |
|
|
31
|
+
| `outputChain` | *"ethereum"* | :heavy_minus_sign: | Delivery chain. Always Ethereum for this on-ramp. | ethereum |
|
|
32
|
+
| `exchangeRate` | *string* | :heavy_check_mark: | USDC received per unit of fiat. | |
|
|
33
|
+
| `fees` | [components.OnrampFees](../../models/components/onrampfees.md) | :heavy_check_mark: | Fee breakdown for an on-ramp quote.<br/><br/>``business_fees`` is a fixed ``"0"`` for now — monetization is a single<br/>future lever and is intentionally not charged. | |
|
|
34
|
+
| `minAmount` | *string* | :heavy_minus_sign: | Minimum fiat amount accepted, if advertised by the provider. | |
|
|
35
|
+
| `maxAmount` | *string* | :heavy_minus_sign: | Maximum fiat amount accepted, if advertised by the provider. | |
|
|
36
|
+
| `expiresAt` | *string* | :heavy_minus_sign: | ISO-8601 timestamp after which this quote is stale, if any. | |
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# OnrampQuoteRequest
|
|
2
|
+
|
|
3
|
+
An indicative fiat -> USDC-on-Ethereum quote request.
|
|
4
|
+
|
|
5
|
+
The output asset and chain are fixed to USDC on Ethereum and are not
|
|
6
|
+
user-supplied — this product group delivers only USDC to the user's own
|
|
7
|
+
wallet (non-custodial).
|
|
8
|
+
|
|
9
|
+
## Example Usage
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
import { OnrampQuoteRequest } from "@compass-labs/api-sdk/models/components";
|
|
13
|
+
|
|
14
|
+
let value: OnrampQuoteRequest = {
|
|
15
|
+
fiatAmount: "<value>",
|
|
16
|
+
fiatCurrency: "USD",
|
|
17
|
+
destinationAddress: "<value>",
|
|
18
|
+
};
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Fields
|
|
22
|
+
|
|
23
|
+
| Field | Type | Required | Description | Example |
|
|
24
|
+
| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
|
|
25
|
+
| `fiatAmount` | *string* | :heavy_check_mark: | Amount of fiat to spend, as a decimal string (e.g. `100`). | |
|
|
26
|
+
| `fiatCurrency` | *string* | :heavy_minus_sign: | ISO-4217 fiat currency code. Defaults to `USD`. | USD |
|
|
27
|
+
| `destinationAddress` | *string* | :heavy_check_mark: | The wallet that will receive the USDC on Ethereum. Funds are delivered here directly — Compass never holds them. | |
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# OnrampStatus
|
|
2
|
+
|
|
3
|
+
Current state of a fiat on-ramp payment.
|
|
4
|
+
|
|
5
|
+
Re-read on demand from Halliday (the system of record) — Compass holds no
|
|
6
|
+
state of its own.
|
|
7
|
+
|
|
8
|
+
## Example Usage
|
|
9
|
+
|
|
10
|
+
```typescript
|
|
11
|
+
import { OnrampStatus } from "@compass-labs/api-sdk/models/components";
|
|
12
|
+
|
|
13
|
+
let value: OnrampStatus = {
|
|
14
|
+
paymentId: "<id>",
|
|
15
|
+
status: "processing",
|
|
16
|
+
};
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Fields
|
|
20
|
+
|
|
21
|
+
| Field | Type | Required | Description |
|
|
22
|
+
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
23
|
+
| `paymentId` | *string* | :heavy_check_mark: | Halliday's payment id, echoed straight through. |
|
|
24
|
+
| `status` | [components.OnrampStatusStatus](../../models/components/onrampstatusstatus.md) | :heavy_check_mark: | Lifecycle state: `pending` (awaiting card payment), `processing` (payment received, bridging/swapping to USDC), `delivered` (USDC received in the destination wallet), or `failed`. |
|
|
25
|
+
| `outputAmountDelivered` | *string* | :heavy_minus_sign: | USDC delivered so far, human-readable. Set once delivered. |
|
|
26
|
+
| `deliveryTxHash` | *string* | :heavy_minus_sign: | Ethereum tx hash of the USDC delivery, once available. |
|
|
27
|
+
| `destinationAddress` | *string* | :heavy_minus_sign: | The wallet the USDC is delivered to. |
|
|
28
|
+
| `updatedAt` | *string* | :heavy_minus_sign: | ISO-8601 timestamp of the last status change, if provided. |
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# OnrampStatusStatus
|
|
2
|
+
|
|
3
|
+
Lifecycle state: `pending` (awaiting card payment), `processing` (payment received, bridging/swapping to USDC), `delivered` (USDC received in the destination wallet), or `failed`.
|
|
4
|
+
|
|
5
|
+
## Example Usage
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import { OnrampStatusStatus } from "@compass-labs/api-sdk/models/components";
|
|
9
|
+
|
|
10
|
+
let value: OnrampStatusStatus = "pending";
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Values
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
"pending" | "processing" | "delivered" | "failed"
|
|
17
|
+
```
|
|
@@ -19,7 +19,7 @@ let value: OrderStatus = {
|
|
|
19
19
|
| Field | Type | Required | Description |
|
|
20
20
|
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
21
21
|
| `orderHash` | *string* | :heavy_check_mark: | On-chain order hash. |
|
|
22
|
-
| `status` | [components.
|
|
22
|
+
| `status` | [components.OrderStatusStatus](../../models/components/orderstatusstatus.md) | :heavy_check_mark: | Order lifecycle state. One of `pending`, `filled`, `expired`, or `cancelled`. Upstream protocol states beyond these four (e.g. `partially-filled`, `refunded`) are mapped onto this set. |
|
|
23
23
|
| `fillTxHash` | *string* | :heavy_minus_sign: | Transaction hash of the most recent fill. Populated for fully filled orders and for partial fills while `status` is still `pending`. |
|
|
24
24
|
| `fillPriceUsd` | *string* | :heavy_minus_sign: | Implied USD execution rate per unit of the received token, derived from filled amounts and the input token's USD price. For USDC → equity buys, this is the USD paid per equity unit. Omitted when token decimals or pricing are not available. |
|
|
25
25
|
| `filledAmount` | *string* | :heavy_minus_sign: | Total amount filled so far, expressed as a raw integer in the input token's decimals. Populated for partial fills while `status` is still `pending`, and for fully filled orders. |
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
#
|
|
1
|
+
# OrderStatusStatus
|
|
2
2
|
|
|
3
3
|
Order lifecycle state. One of `pending`, `filled`, `expired`, or `cancelled`. Upstream protocol states beyond these four (e.g. `partially-filled`, `refunded`) are mapped onto this set.
|
|
4
4
|
|
|
5
5
|
## Example Usage
|
|
6
6
|
|
|
7
7
|
```typescript
|
|
8
|
-
import {
|
|
8
|
+
import { OrderStatusStatus } from "@compass-labs/api-sdk/models/components";
|
|
9
9
|
|
|
10
|
-
let value:
|
|
10
|
+
let value: OrderStatusStatus = "filled";
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
## Values
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# OnrampErrorResponse
|
|
2
|
+
|
|
3
|
+
Standard error envelope returned by every non-2xx on-ramp response.
|
|
4
|
+
|
|
5
|
+
Surfaced in OpenAPI ``responses`` declarations so SDK consumers can decode
|
|
6
|
+
failures uniformly without inspecting per-status-code shapes.
|
|
7
|
+
|
|
8
|
+
## Example Usage
|
|
9
|
+
|
|
10
|
+
```typescript
|
|
11
|
+
import { OnrampErrorResponse } from "@compass-labs/api-sdk/models/errors";
|
|
12
|
+
|
|
13
|
+
// No examples available for this model
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Fields
|
|
17
|
+
|
|
18
|
+
| Field | Type | Required | Description |
|
|
19
|
+
| ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
|
|
20
|
+
| `error` | *string* | :heavy_check_mark: | Short human-readable error label (e.g. `Payment not found.`, `On-ramp provider unavailable`, `Identity verification required`). |
|
|
21
|
+
| `message` | *string* | :heavy_check_mark: | Human-readable explanation. |
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# V2OnrampStatusRequest
|
|
2
|
+
|
|
3
|
+
## Example Usage
|
|
4
|
+
|
|
5
|
+
```typescript
|
|
6
|
+
import { V2OnrampStatusRequest } from "@compass-labs/api-sdk/models/operations";
|
|
7
|
+
|
|
8
|
+
let value: V2OnrampStatusRequest = {
|
|
9
|
+
paymentId: "<id>",
|
|
10
|
+
};
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Fields
|
|
14
|
+
|
|
15
|
+
| Field | Type | Required | Description |
|
|
16
|
+
| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ |
|
|
17
|
+
| `paymentId` | *string* | :heavy_check_mark: | The `payment_id` returned by `POST /v2/onramp/create`. |
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
# Onramp
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
### Available Operations
|
|
6
|
+
|
|
7
|
+
* [onrampQuote](#onrampquote) - Get a fiat on-ramp quote (card -> USDC on Ethereum)
|
|
8
|
+
* [onrampCreate](#onrampcreate) - Create a fiat on-ramp payment + get the checkout link
|
|
9
|
+
* [onrampStatus](#onrampstatus) - Get the status of a fiat on-ramp payment
|
|
10
|
+
|
|
11
|
+
## onrampQuote
|
|
12
|
+
|
|
13
|
+
Get an indicative quote for buying USDC on Ethereum with a card.
|
|
14
|
+
|
|
15
|
+
Returns the estimated USDC the user will receive for a given fiat amount,
|
|
16
|
+
the exchange rate, fee breakdown (`business_fees` is `0`), and the provider
|
|
17
|
+
min/max limits. The output is always **USDC on Ethereum** delivered to the
|
|
18
|
+
`destination_address` — this is a non-custodial on-ramp, so Compass never
|
|
19
|
+
holds the funds.
|
|
20
|
+
|
|
21
|
+
This quote is indicative and may expire (`expires_at`). To actually start a
|
|
22
|
+
payment, call `POST /v2/onramp/create`.
|
|
23
|
+
|
|
24
|
+
### Example Usage
|
|
25
|
+
|
|
26
|
+
<!-- UsageSnippet language="typescript" operationID="v2_onramp_quote" method="post" path="/v2/onramp/quote" -->
|
|
27
|
+
```typescript
|
|
28
|
+
import { CompassApiSDK } from "@compass-labs/api-sdk";
|
|
29
|
+
|
|
30
|
+
const compassApiSDK = new CompassApiSDK({
|
|
31
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
async function run() {
|
|
35
|
+
const result = await compassApiSDK.onramp.onrampQuote({
|
|
36
|
+
fiatAmount: "<value>",
|
|
37
|
+
fiatCurrency: "USD",
|
|
38
|
+
destinationAddress: "<value>",
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
console.log(result);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
run();
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Standalone function
|
|
48
|
+
|
|
49
|
+
The standalone function version of this method:
|
|
50
|
+
|
|
51
|
+
```typescript
|
|
52
|
+
import { CompassApiSDKCore } from "@compass-labs/api-sdk/core.js";
|
|
53
|
+
import { onrampOnrampQuote } from "@compass-labs/api-sdk/funcs/onrampOnrampQuote.js";
|
|
54
|
+
|
|
55
|
+
// Use `CompassApiSDKCore` for best tree-shaking performance.
|
|
56
|
+
// You can create one instance of it to use across an application.
|
|
57
|
+
const compassApiSDK = new CompassApiSDKCore({
|
|
58
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
async function run() {
|
|
62
|
+
const res = await onrampOnrampQuote(compassApiSDK, {
|
|
63
|
+
fiatAmount: "<value>",
|
|
64
|
+
fiatCurrency: "USD",
|
|
65
|
+
destinationAddress: "<value>",
|
|
66
|
+
});
|
|
67
|
+
if (res.ok) {
|
|
68
|
+
const { value: result } = res;
|
|
69
|
+
console.log(result);
|
|
70
|
+
} else {
|
|
71
|
+
console.log("onrampOnrampQuote failed:", res.error);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
run();
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Parameters
|
|
79
|
+
|
|
80
|
+
| Parameter | Type | Required | Description |
|
|
81
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
82
|
+
| `request` | [components.OnrampQuoteRequest](../../models/components/onrampquoterequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
83
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
84
|
+
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
85
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
86
|
+
|
|
87
|
+
### Response
|
|
88
|
+
|
|
89
|
+
**Promise\<[components.OnrampQuote](../../models/components/onrampquote.md)\>**
|
|
90
|
+
|
|
91
|
+
### Errors
|
|
92
|
+
|
|
93
|
+
| Error Type | Status Code | Content Type |
|
|
94
|
+
| -------------------------- | -------------------------- | -------------------------- |
|
|
95
|
+
| errors.OnrampErrorResponse | 400, 422 | application/json |
|
|
96
|
+
| errors.OnrampErrorResponse | 502 | application/json |
|
|
97
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
98
|
+
|
|
99
|
+
## onrampCreate
|
|
100
|
+
|
|
101
|
+
Create a fiat on-ramp payment and return the browser-checkout handoff.
|
|
102
|
+
|
|
103
|
+
A fiat card + identity-verification flow can only render in a browser, so
|
|
104
|
+
this endpoint returns a **`checkout_url`** (a Compass-hosted page) together
|
|
105
|
+
with `payment_id`, the one-time-wallet `deposit_address`, an initial
|
|
106
|
+
`status`, and a `user_instructions` string.
|
|
107
|
+
|
|
108
|
+
**How to drive this (CLI / MCP agent / UI):**
|
|
109
|
+
|
|
110
|
+
1. **Present `checkout_url` to the user and open it in a browser.** It
|
|
111
|
+
renders the card payment + identity verification and delivers USDC on
|
|
112
|
+
Ethereum to the destination wallet. (An MCP agent cannot open a browser
|
|
113
|
+
itself — show the link and ask the user to open it.)
|
|
114
|
+
2. **Poll `GET /v2/onramp/status?payment_id=...`** until `status` becomes
|
|
115
|
+
`delivered` (or `failed`). `pending` = awaiting payment, `processing` =
|
|
116
|
+
payment received and bridging/swapping to USDC.
|
|
117
|
+
3. Once `delivered`, the USDC is in the user's own wallet — continue with
|
|
118
|
+
the tokenized buy.
|
|
119
|
+
|
|
120
|
+
Funds are never held by Compass: the `deposit_address` is a one-time wallet
|
|
121
|
+
owned solely by the user's wallet.
|
|
122
|
+
|
|
123
|
+
### Example Usage
|
|
124
|
+
|
|
125
|
+
<!-- UsageSnippet language="typescript" operationID="v2_onramp_create" method="post" path="/v2/onramp/create" -->
|
|
126
|
+
```typescript
|
|
127
|
+
import { CompassApiSDK } from "@compass-labs/api-sdk";
|
|
128
|
+
|
|
129
|
+
const compassApiSDK = new CompassApiSDK({
|
|
130
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
async function run() {
|
|
134
|
+
const result = await compassApiSDK.onramp.onrampCreate({
|
|
135
|
+
fiatAmount: "<value>",
|
|
136
|
+
fiatCurrency: "USD",
|
|
137
|
+
destinationAddress: "<value>",
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
console.log(result);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
run();
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### Standalone function
|
|
147
|
+
|
|
148
|
+
The standalone function version of this method:
|
|
149
|
+
|
|
150
|
+
```typescript
|
|
151
|
+
import { CompassApiSDKCore } from "@compass-labs/api-sdk/core.js";
|
|
152
|
+
import { onrampOnrampCreate } from "@compass-labs/api-sdk/funcs/onrampOnrampCreate.js";
|
|
153
|
+
|
|
154
|
+
// Use `CompassApiSDKCore` for best tree-shaking performance.
|
|
155
|
+
// You can create one instance of it to use across an application.
|
|
156
|
+
const compassApiSDK = new CompassApiSDKCore({
|
|
157
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
async function run() {
|
|
161
|
+
const res = await onrampOnrampCreate(compassApiSDK, {
|
|
162
|
+
fiatAmount: "<value>",
|
|
163
|
+
fiatCurrency: "USD",
|
|
164
|
+
destinationAddress: "<value>",
|
|
165
|
+
});
|
|
166
|
+
if (res.ok) {
|
|
167
|
+
const { value: result } = res;
|
|
168
|
+
console.log(result);
|
|
169
|
+
} else {
|
|
170
|
+
console.log("onrampOnrampCreate failed:", res.error);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
run();
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### Parameters
|
|
178
|
+
|
|
179
|
+
| Parameter | Type | Required | Description |
|
|
180
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
181
|
+
| `request` | [components.OnrampCreateRequest](../../models/components/onrampcreaterequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
182
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
183
|
+
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
184
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
185
|
+
|
|
186
|
+
### Response
|
|
187
|
+
|
|
188
|
+
**Promise\<[components.OnrampCreate](../../models/components/onrampcreate.md)\>**
|
|
189
|
+
|
|
190
|
+
### Errors
|
|
191
|
+
|
|
192
|
+
| Error Type | Status Code | Content Type |
|
|
193
|
+
| -------------------------- | -------------------------- | -------------------------- |
|
|
194
|
+
| errors.OnrampErrorResponse | 400, 402, 410, 422 | application/json |
|
|
195
|
+
| errors.OnrampErrorResponse | 502 | application/json |
|
|
196
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
197
|
+
|
|
198
|
+
## onrampStatus
|
|
199
|
+
|
|
200
|
+
Get the current status of a fiat on-ramp payment.
|
|
201
|
+
|
|
202
|
+
Poll this after `create` until `status` is `delivered`. The `status` field
|
|
203
|
+
is one of:
|
|
204
|
+
|
|
205
|
+
- `pending` — awaiting the card payment in the hosted checkout.
|
|
206
|
+
- `processing` — payment received; bridging/swapping the proceeds to USDC.
|
|
207
|
+
- `delivered` — USDC has been delivered to the destination wallet
|
|
208
|
+
(`delivery_tx_hash` and `output_amount_delivered` are populated).
|
|
209
|
+
- `failed` — the payment failed, expired, or was refunded.
|
|
210
|
+
|
|
211
|
+
State is re-read live from the on-ramp provider on every call — Compass
|
|
212
|
+
stores nothing of its own.
|
|
213
|
+
|
|
214
|
+
### Example Usage
|
|
215
|
+
|
|
216
|
+
<!-- UsageSnippet language="typescript" operationID="v2_onramp_status" method="get" path="/v2/onramp/status" -->
|
|
217
|
+
```typescript
|
|
218
|
+
import { CompassApiSDK } from "@compass-labs/api-sdk";
|
|
219
|
+
|
|
220
|
+
const compassApiSDK = new CompassApiSDK({
|
|
221
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
async function run() {
|
|
225
|
+
const result = await compassApiSDK.onramp.onrampStatus({
|
|
226
|
+
paymentId: "<id>",
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
console.log(result);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
run();
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
### Standalone function
|
|
236
|
+
|
|
237
|
+
The standalone function version of this method:
|
|
238
|
+
|
|
239
|
+
```typescript
|
|
240
|
+
import { CompassApiSDKCore } from "@compass-labs/api-sdk/core.js";
|
|
241
|
+
import { onrampOnrampStatus } from "@compass-labs/api-sdk/funcs/onrampOnrampStatus.js";
|
|
242
|
+
|
|
243
|
+
// Use `CompassApiSDKCore` for best tree-shaking performance.
|
|
244
|
+
// You can create one instance of it to use across an application.
|
|
245
|
+
const compassApiSDK = new CompassApiSDKCore({
|
|
246
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
async function run() {
|
|
250
|
+
const res = await onrampOnrampStatus(compassApiSDK, {
|
|
251
|
+
paymentId: "<id>",
|
|
252
|
+
});
|
|
253
|
+
if (res.ok) {
|
|
254
|
+
const { value: result } = res;
|
|
255
|
+
console.log(result);
|
|
256
|
+
} else {
|
|
257
|
+
console.log("onrampOnrampStatus failed:", res.error);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
run();
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
### Parameters
|
|
265
|
+
|
|
266
|
+
| Parameter | Type | Required | Description |
|
|
267
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
268
|
+
| `request` | [operations.V2OnrampStatusRequest](../../models/operations/v2onrampstatusrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
269
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
270
|
+
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
271
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
272
|
+
|
|
273
|
+
### Response
|
|
274
|
+
|
|
275
|
+
**Promise\<[components.OnrampStatus](../../models/components/onrampstatus.md)\>**
|
|
276
|
+
|
|
277
|
+
### Errors
|
|
278
|
+
|
|
279
|
+
| Error Type | Status Code | Content Type |
|
|
280
|
+
| -------------------------- | -------------------------- | -------------------------- |
|
|
281
|
+
| errors.OnrampErrorResponse | 404, 422 | application/json |
|
|
282
|
+
| errors.OnrampErrorResponse | 502 | application/json |
|
|
283
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|