@compass-labs/api-sdk 2.2.46 → 2.2.47-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.
- package/README.md +4 -2
- package/codeSamples_typescript.yaml +7 -1
- package/dist/commonjs/funcs/tokenizedAssetsTokenizedAssetsQuote.d.ts +35 -0
- package/dist/commonjs/funcs/tokenizedAssetsTokenizedAssetsQuote.d.ts.map +1 -0
- package/dist/commonjs/funcs/tokenizedAssetsTokenizedAssetsQuote.js +136 -0
- package/dist/commonjs/funcs/tokenizedAssetsTokenizedAssetsQuote.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/lib/config.js.map +1 -1
- package/dist/commonjs/models/components/index.d.ts +2 -0
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +2 -0
- package/dist/commonjs/models/components/index.js.map +1 -1
- package/dist/commonjs/models/components/tokenizedassetsbuildorderrequest.d.ts +8 -2
- package/dist/commonjs/models/components/tokenizedassetsbuildorderrequest.d.ts.map +1 -1
- package/dist/commonjs/models/components/tokenizedassetsbuildorderrequest.js +2 -0
- package/dist/commonjs/models/components/tokenizedassetsbuildorderrequest.js.map +1 -1
- package/dist/commonjs/models/components/tokenizedassetsquoterequest.d.ts +47 -0
- package/dist/commonjs/models/components/tokenizedassetsquoterequest.d.ts.map +1 -0
- package/dist/commonjs/models/components/tokenizedassetsquoterequest.js +60 -0
- package/dist/commonjs/models/components/tokenizedassetsquoterequest.js.map +1 -0
- package/dist/commonjs/models/components/tokenizedassetsquoteresponse.d.ts +25 -0
- package/dist/commonjs/models/components/tokenizedassetsquoteresponse.d.ts.map +1 -0
- package/dist/commonjs/models/components/tokenizedassetsquoteresponse.js +59 -0
- package/dist/commonjs/models/components/tokenizedassetsquoteresponse.js.map +1 -0
- package/dist/commonjs/sdk/tokenizedassets.d.ts +24 -0
- package/dist/commonjs/sdk/tokenizedassets.d.ts.map +1 -1
- package/dist/commonjs/sdk/tokenizedassets.js +27 -0
- package/dist/commonjs/sdk/tokenizedassets.js.map +1 -1
- package/dist/esm/funcs/tokenizedAssetsTokenizedAssetsQuote.d.ts +35 -0
- package/dist/esm/funcs/tokenizedAssetsTokenizedAssetsQuote.d.ts.map +1 -0
- package/dist/esm/funcs/tokenizedAssetsTokenizedAssetsQuote.js +100 -0
- package/dist/esm/funcs/tokenizedAssetsTokenizedAssetsQuote.js.map +1 -0
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/lib/config.js.map +1 -1
- package/dist/esm/models/components/index.d.ts +2 -0
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +2 -0
- package/dist/esm/models/components/index.js.map +1 -1
- package/dist/esm/models/components/tokenizedassetsbuildorderrequest.d.ts +8 -2
- package/dist/esm/models/components/tokenizedassetsbuildorderrequest.d.ts.map +1 -1
- package/dist/esm/models/components/tokenizedassetsbuildorderrequest.js +2 -0
- package/dist/esm/models/components/tokenizedassetsbuildorderrequest.js.map +1 -1
- package/dist/esm/models/components/tokenizedassetsquoterequest.d.ts +47 -0
- package/dist/esm/models/components/tokenizedassetsquoterequest.d.ts.map +1 -0
- package/dist/esm/models/components/tokenizedassetsquoterequest.js +23 -0
- package/dist/esm/models/components/tokenizedassetsquoterequest.js.map +1 -0
- package/dist/esm/models/components/tokenizedassetsquoteresponse.d.ts +25 -0
- package/dist/esm/models/components/tokenizedassetsquoteresponse.d.ts.map +1 -0
- package/dist/esm/models/components/tokenizedassetsquoteresponse.js +22 -0
- package/dist/esm/models/components/tokenizedassetsquoteresponse.js.map +1 -0
- package/dist/esm/sdk/tokenizedassets.d.ts +24 -0
- package/dist/esm/sdk/tokenizedassets.d.ts.map +1 -1
- package/dist/esm/sdk/tokenizedassets.js +27 -0
- package/dist/esm/sdk/tokenizedassets.js.map +1 -1
- package/docs/models/components/quote.md +2 -2
- package/docs/models/components/tokenizedassetsbuildorderrequest.md +10 -8
- package/docs/models/components/tokenizedassetsbuildorderresponse.md +4 -4
- package/docs/models/components/tokenizedassetsquoterequest.md +33 -0
- package/docs/models/components/tokenizedassetsquoteresponse.md +36 -0
- package/docs/sdks/tokenizedassets/README.md +106 -2
- package/package.json +1 -1
- package/src/funcs/tokenizedAssetsTokenizedAssetsQuote.ts +197 -0
- package/src/lib/config.ts +2 -2
- package/src/models/components/index.ts +2 -0
- package/src/models/components/tokenizedassetsbuildorderrequest.ts +9 -2
- package/src/models/components/tokenizedassetsquoterequest.ts +78 -0
- package/src/models/components/tokenizedassetsquoteresponse.ts +54 -0
- package/src/sdk/tokenizedassets.ts +35 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokenizedassets.d.ts","sourceRoot":"","sources":["../../../src/sdk/tokenizedassets.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tokenizedassets.d.ts","sourceRoot":"","sources":["../../../src/sdk/tokenizedassets.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAG5D,qBAAa,eAAgB,SAAQ,SAAS;IAC5C;;;;;;;;;;;;;OAaG;IACG,sBAAsB,CAC1B,OAAO,EAAE,UAAU,CAAC,+BAA+B,EACnD,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,kCAAkC,CAAC;IAQzD;;;;;;;;;;;;;;;;;;;OAmBG;IACG,4BAA4B,CAChC,OAAO,EAAE,UAAU,CAAC,qCAAqC,EACzD,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC;IAQnC;;;;;;;;;;;;;;OAcG;IACG,wBAAwB,CAC5B,OAAO,EAAE,UAAU,CAAC,iCAAiC,EACrD,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,gCAAgC,CAAC;IAQvD;;;;;;;;;;;;;OAaG;IACG,6BAA6B,CACjC,OAAO,EAAE,UAAU,CAAC,sCAAsC,EAC1D,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC;IAQlC;;;;;;;;;;;;;;;;;;;;;OAqBG;IACG,4BAA4B,CAChC,OAAO,EAAE,UAAU,CAAC,mCAAmC,EACvD,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,oCAAoC,CAAC;IAQ3D;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACG,oBAAoB,CACxB,OAAO,EAAE,UAAU,CAAC,2BAA2B,EAC/C,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,4BAA4B,CAAC;IAQnD;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACG,oBAAoB,CACxB,OAAO,EAAE,UAAU,CAAC,gCAAgC,EACpD,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,iCAAiC,CAAC;IAQxD;;;;;;;;;;;;;;;OAeG;IACG,0BAA0B,CAC9B,OAAO,EAAE,UAAU,CAAC,iCAAiC,EACrD,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,kCAAkC,CAAC;IAQzD;;;;;;;;;;;;;;;OAeG;IACG,mCAAmC,CACvC,OAAO,EAAE,UAAU,CAAC,4CAA4C,EAChE,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,kCAAkC,CAAC;CAO1D"}
|
|
@@ -9,6 +9,7 @@ import { tokenizedAssetsTokenizedAssetsOrderOrderHash } from "../funcs/tokenized
|
|
|
9
9
|
import { tokenizedAssetsTokenizedAssetsOrderOrderHashCancel } from "../funcs/tokenizedAssetsTokenizedAssetsOrderOrderHashCancel.js";
|
|
10
10
|
import { tokenizedAssetsTokenizedAssetsOrderSubmit } from "../funcs/tokenizedAssetsTokenizedAssetsOrderSubmit.js";
|
|
11
11
|
import { tokenizedAssetsTokenizedAssetsPositions } from "../funcs/tokenizedAssetsTokenizedAssetsPositions.js";
|
|
12
|
+
import { tokenizedAssetsTokenizedAssetsQuote } from "../funcs/tokenizedAssetsTokenizedAssetsQuote.js";
|
|
12
13
|
import { ClientSDK } from "../lib/sdks.js";
|
|
13
14
|
import { unwrapAsync } from "../types/fp.js";
|
|
14
15
|
export class TokenizedAssets extends ClientSDK {
|
|
@@ -112,6 +113,32 @@ export class TokenizedAssets extends ClientSDK {
|
|
|
112
113
|
async tokenizedAssetsCreateAccount(request, options) {
|
|
113
114
|
return unwrapAsync(tokenizedAssetsTokenizedAssetsCreateAccount(this, request, options));
|
|
114
115
|
}
|
|
116
|
+
/**
|
|
117
|
+
* Preview a buy/sell quote
|
|
118
|
+
*
|
|
119
|
+
* @remarks
|
|
120
|
+
* Preview the input/output amounts, fees, and slippage tolerance for an order.
|
|
121
|
+
*
|
|
122
|
+
* Read-only relative to Fusion: hits ``/quote/receive`` only and does not
|
|
123
|
+
* consume a ``quote_id`` or commit an order. Pair with `POST /order`:
|
|
124
|
+
* surface this preview to the user, and on confirm pass the body plus
|
|
125
|
+
* ``recommended_slippage_bps`` to `/order`.
|
|
126
|
+
*
|
|
127
|
+
* The response carries:
|
|
128
|
+
*
|
|
129
|
+
* - **`quote`** — input/output token amounts, fees, and an
|
|
130
|
+
* ``est_fill_seconds`` upper bound.
|
|
131
|
+
* - **`recommended_slippage_bps`** — system-derived slippage tolerance
|
|
132
|
+
* that clears Fusion's current auction floor; pass back as
|
|
133
|
+
* ``slippage_bps`` on `/order` so the build call validates against the
|
|
134
|
+
* same floor the user was shown.
|
|
135
|
+
* - **`auction_range_bps`** — worst-case bps gap between the auction
|
|
136
|
+
* end amount and the reference quote amount. Use to surface a
|
|
137
|
+
* thin-liquidity warning to the user.
|
|
138
|
+
*/
|
|
139
|
+
async tokenizedAssetsQuote(request, options) {
|
|
140
|
+
return unwrapAsync(tokenizedAssetsTokenizedAssetsQuote(this, request, options));
|
|
141
|
+
}
|
|
115
142
|
/**
|
|
116
143
|
* Build a buy/sell order
|
|
117
144
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokenizedassets.js","sourceRoot":"","sources":["../../../src/sdk/tokenizedassets.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,2CAA2C,EAAE,MAAM,yDAAyD,CAAC;AACtH,OAAO,EAAE,qCAAqC,EAAE,MAAM,mDAAmD,CAAC;AAC1G,OAAO,EAAE,2CAA2C,EAAE,MAAM,yDAAyD,CAAC;AACtH,OAAO,EAAE,mCAAmC,EAAE,MAAM,iDAAiD,CAAC;AACtG,OAAO,EAAE,4CAA4C,EAAE,MAAM,0DAA0D,CAAC;AACxH,OAAO,EAAE,kDAAkD,EAAE,MAAM,gEAAgE,CAAC;AACpI,OAAO,EAAE,yCAAyC,EAAE,MAAM,uDAAuD,CAAC;AAClH,OAAO,EAAE,uCAAuC,EAAE,MAAM,qDAAqD,CAAC;AAC9G,OAAO,EAAE,SAAS,EAAkB,MAAM,gBAAgB,CAAC;AAG3D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,OAAO,eAAgB,SAAQ,SAAS;IAC5C;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,sBAAsB,CAC1B,OAAmD,EACnD,OAAwB;QAExB,OAAO,WAAW,CAAC,qCAAqC,CACtD,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,KAAK,CAAC,4BAA4B,CAChC,OAAyD,EACzD,OAAwB;QAExB,OAAO,WAAW,CAAC,2CAA2C,CAC5D,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,KAAK,CAAC,wBAAwB,CAC5B,OAAqD,EACrD,OAAwB;QAExB,OAAO,WAAW,CAAC,uCAAuC,CACxD,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,6BAA6B,CACjC,OAA0D,EAC1D,OAAwB;QAExB,OAAO,WAAW,CAAC,4CAA4C,CAC7D,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,KAAK,CAAC,4BAA4B,CAChC,OAAuD,EACvD,OAAwB;QAExB,OAAO,WAAW,CAAC,2CAA2C,CAC5D,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,KAAK,CAAC,oBAAoB,CACxB,OAAoD,EACpD,OAAwB;QAExB,OAAO,WAAW,CAAC,mCAAmC,CACpD,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACH,KAAK,CAAC,0BAA0B,CAC9B,OAAqD,EACrD,OAAwB;QAExB,OAAO,WAAW,CAAC,yCAAyC,CAC1D,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACH,KAAK,CAAC,mCAAmC,CACvC,OAAgE,EAChE,OAAwB;QAExB,OAAO,WAAW,CAAC,kDAAkD,CACnE,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
1
|
+
{"version":3,"file":"tokenizedassets.js","sourceRoot":"","sources":["../../../src/sdk/tokenizedassets.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,2CAA2C,EAAE,MAAM,yDAAyD,CAAC;AACtH,OAAO,EAAE,qCAAqC,EAAE,MAAM,mDAAmD,CAAC;AAC1G,OAAO,EAAE,2CAA2C,EAAE,MAAM,yDAAyD,CAAC;AACtH,OAAO,EAAE,mCAAmC,EAAE,MAAM,iDAAiD,CAAC;AACtG,OAAO,EAAE,4CAA4C,EAAE,MAAM,0DAA0D,CAAC;AACxH,OAAO,EAAE,kDAAkD,EAAE,MAAM,gEAAgE,CAAC;AACpI,OAAO,EAAE,yCAAyC,EAAE,MAAM,uDAAuD,CAAC;AAClH,OAAO,EAAE,uCAAuC,EAAE,MAAM,qDAAqD,CAAC;AAC9G,OAAO,EAAE,mCAAmC,EAAE,MAAM,iDAAiD,CAAC;AACtG,OAAO,EAAE,SAAS,EAAkB,MAAM,gBAAgB,CAAC;AAG3D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,OAAO,eAAgB,SAAQ,SAAS;IAC5C;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,sBAAsB,CAC1B,OAAmD,EACnD,OAAwB;QAExB,OAAO,WAAW,CAAC,qCAAqC,CACtD,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,KAAK,CAAC,4BAA4B,CAChC,OAAyD,EACzD,OAAwB;QAExB,OAAO,WAAW,CAAC,2CAA2C,CAC5D,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,KAAK,CAAC,wBAAwB,CAC5B,OAAqD,EACrD,OAAwB;QAExB,OAAO,WAAW,CAAC,uCAAuC,CACxD,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,6BAA6B,CACjC,OAA0D,EAC1D,OAAwB;QAExB,OAAO,WAAW,CAAC,4CAA4C,CAC7D,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,KAAK,CAAC,4BAA4B,CAChC,OAAuD,EACvD,OAAwB;QAExB,OAAO,WAAW,CAAC,2CAA2C,CAC5D,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,KAAK,CAAC,oBAAoB,CACxB,OAA+C,EAC/C,OAAwB;QAExB,OAAO,WAAW,CAAC,mCAAmC,CACpD,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,KAAK,CAAC,oBAAoB,CACxB,OAAoD,EACpD,OAAwB;QAExB,OAAO,WAAW,CAAC,mCAAmC,CACpD,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACH,KAAK,CAAC,0BAA0B,CAC9B,OAAqD,EACrD,OAAwB;QAExB,OAAO,WAAW,CAAC,yCAAyC,CAC1D,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACH,KAAK,CAAC,mCAAmC,CACvC,OAAgE,EAChE,OAAwB;QAExB,OAAO,WAAW,CAAC,kDAAkD,CACnE,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -11,12 +11,12 @@ let value: Quote = {
|
|
|
11
11
|
input: {
|
|
12
12
|
symbol: "<value>",
|
|
13
13
|
contractAddress: "<value>",
|
|
14
|
-
amount: "
|
|
14
|
+
amount: "967.52",
|
|
15
15
|
},
|
|
16
16
|
output: {
|
|
17
17
|
symbol: "<value>",
|
|
18
18
|
contractAddress: "<value>",
|
|
19
|
-
amount: "
|
|
19
|
+
amount: "902.30",
|
|
20
20
|
},
|
|
21
21
|
fee: {},
|
|
22
22
|
estFillSeconds: 739502,
|
|
@@ -8,9 +8,10 @@ Build a buy or sell order for a tokenized equity.
|
|
|
8
8
|
import { TokenizedAssetsBuildOrderRequest } from "@compass-labs/api-sdk/models/components";
|
|
9
9
|
|
|
10
10
|
let value: TokenizedAssetsBuildOrderRequest = {
|
|
11
|
+
chain: "ethereum",
|
|
11
12
|
fromToken: "<value>",
|
|
12
13
|
toToken: "<value>",
|
|
13
|
-
amount: "
|
|
14
|
+
amount: "605.31",
|
|
14
15
|
owner: "<value>",
|
|
15
16
|
slippageBps: 50,
|
|
16
17
|
};
|
|
@@ -18,10 +19,11 @@ let value: TokenizedAssetsBuildOrderRequest = {
|
|
|
18
19
|
|
|
19
20
|
## Fields
|
|
20
21
|
|
|
21
|
-
| Field
|
|
22
|
-
|
|
|
23
|
-
| `
|
|
24
|
-
| `
|
|
25
|
-
| `
|
|
26
|
-
| `
|
|
27
|
-
| `
|
|
22
|
+
| Field | Type | Required | Description | Example |
|
|
23
|
+
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
24
|
+
| `chain` | [components.Chain](../../models/components/chain.md) | :heavy_check_mark: | The chain to use. | |
|
|
25
|
+
| `fromToken` | *string* | :heavy_check_mark: | Token the sender is paying. Either an on-chain symbol (e.g. `TSLAon`), the literal `USDC`, or a 0x-prefixed token address. | |
|
|
26
|
+
| `toToken` | *string* | :heavy_check_mark: | Token the sender is receiving. Same accepted forms as `from_token`. | |
|
|
27
|
+
| `amount` | *string* | :heavy_check_mark: | Human-readable amount of `from_token` to swap (decimal string). Decimals are applied server-side. | |
|
|
28
|
+
| `owner` | *string* | :heavy_check_mark: | Wallet that owns the Tokenized Assets Account. The product account address is derived deterministically from this owner. The owner signs the EIP-712 payloads returned by this endpoint (the optional approval and the order itself). | |
|
|
29
|
+
| `slippageBps` | *number* | :heavy_minus_sign: | Max acceptable slippage in basis points (1 bp = 0.01%). Range 1-5000 (0.01%-50%); defaults to 50 (0.5%). The upper bound is intentionally wide so callers can clear the wide auction floors quoted for thinly-traded tokenized stocks. | 50 |
|
|
@@ -12,19 +12,19 @@ let value: TokenizedAssetsBuildOrderResponse = {
|
|
|
12
12
|
input: {
|
|
13
13
|
symbol: "<value>",
|
|
14
14
|
contractAddress: "<value>",
|
|
15
|
-
amount: "
|
|
15
|
+
amount: "967.52",
|
|
16
16
|
},
|
|
17
17
|
output: {
|
|
18
18
|
symbol: "<value>",
|
|
19
19
|
contractAddress: "<value>",
|
|
20
|
-
amount: "
|
|
20
|
+
amount: "902.30",
|
|
21
21
|
},
|
|
22
22
|
fee: {},
|
|
23
|
-
estFillSeconds:
|
|
23
|
+
estFillSeconds: 193846,
|
|
24
24
|
},
|
|
25
25
|
order: {
|
|
26
26
|
orderHash: "<value>",
|
|
27
|
-
extension: "
|
|
27
|
+
extension: "html",
|
|
28
28
|
quoteId: "<id>",
|
|
29
29
|
orderMessage: {
|
|
30
30
|
"key": "<value>",
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# TokenizedAssetsQuoteRequest
|
|
2
|
+
|
|
3
|
+
Preview a buy or sell quote for a tokenized equity.
|
|
4
|
+
|
|
5
|
+
Read-only relative to Fusion: this hits ``/quote/receive`` only and does
|
|
6
|
+
not consume a ``quote_id`` or commit an order. Use it to surface expected
|
|
7
|
+
output, fees, and a thin-liquidity warning before the user confirms; pass
|
|
8
|
+
the same body (plus ``slippage_bps``) to ``POST /tokenized_assets/order``
|
|
9
|
+
when they do.
|
|
10
|
+
|
|
11
|
+
## Example Usage
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { TokenizedAssetsQuoteRequest } from "@compass-labs/api-sdk/models/components";
|
|
15
|
+
|
|
16
|
+
let value: TokenizedAssetsQuoteRequest = {
|
|
17
|
+
chain: "arbitrum",
|
|
18
|
+
fromToken: "<value>",
|
|
19
|
+
toToken: "<value>",
|
|
20
|
+
amount: "255.15",
|
|
21
|
+
owner: "<value>",
|
|
22
|
+
};
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Fields
|
|
26
|
+
|
|
27
|
+
| Field | Type | Required | Description |
|
|
28
|
+
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
29
|
+
| `chain` | [components.Chain](../../models/components/chain.md) | :heavy_check_mark: | The chain to use. |
|
|
30
|
+
| `fromToken` | *string* | :heavy_check_mark: | Token the sender is paying. Either an on-chain symbol (e.g. `TSLAon`), the literal `USDC`, or a 0x-prefixed token address. |
|
|
31
|
+
| `toToken` | *string* | :heavy_check_mark: | Token the sender is receiving. Same accepted forms as `from_token`. |
|
|
32
|
+
| `amount` | *string* | :heavy_check_mark: | Human-readable amount of `from_token` to swap (decimal string). Decimals are applied server-side. |
|
|
33
|
+
| `owner` | *string* | :heavy_check_mark: | Wallet that owns the Tokenized Assets Account. Used to verify the account is deployed before quoting; the account address is derived deterministically from this owner. |
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# TokenizedAssetsQuoteResponse
|
|
2
|
+
|
|
3
|
+
Preview of input/output amounts plus auction-derived risk hints.
|
|
4
|
+
|
|
5
|
+
## Example Usage
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import { TokenizedAssetsQuoteResponse } from "@compass-labs/api-sdk/models/components";
|
|
9
|
+
|
|
10
|
+
let value: TokenizedAssetsQuoteResponse = {
|
|
11
|
+
quote: {
|
|
12
|
+
input: {
|
|
13
|
+
symbol: "<value>",
|
|
14
|
+
contractAddress: "<value>",
|
|
15
|
+
amount: "967.52",
|
|
16
|
+
},
|
|
17
|
+
output: {
|
|
18
|
+
symbol: "<value>",
|
|
19
|
+
contractAddress: "<value>",
|
|
20
|
+
amount: "902.30",
|
|
21
|
+
},
|
|
22
|
+
fee: {},
|
|
23
|
+
estFillSeconds: 193846,
|
|
24
|
+
},
|
|
25
|
+
recommendedSlippageBps: 519301,
|
|
26
|
+
auctionRangeBps: 674904,
|
|
27
|
+
};
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Fields
|
|
31
|
+
|
|
32
|
+
| Field | Type | Required | Description |
|
|
33
|
+
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
34
|
+
| `quote` | [components.Quote](../../models/components/quote.md) | :heavy_check_mark: | Quote preview returned alongside an order. |
|
|
35
|
+
| `recommendedSlippageBps` | *number* | :heavy_check_mark: | Slippage tolerance in basis points (1 bp = 0.01%) the UI should echo back as `slippage_bps` on `POST /tokenized_assets/order`. Derived from Fusion's Dutch auction range (`auctionEndAmount` vs `toTokenAmount`) plus a small buffer; capped at 5000 bps. |
|
|
36
|
+
| `auctionRangeBps` | *number* | :heavy_check_mark: | Worst-case basis-points gap between the auction's end amount and the reference quote amount. Surfaces as a thin-liquidity warning before the user signs. |
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* [tokenizedAssetsPositions](#tokenizedassetspositions) - Get tokenized-asset positions for a wallet
|
|
10
10
|
* [tokenizedAssetsOrderOrderHash](#tokenizedassetsorderorderhash) - Get order status
|
|
11
11
|
* [tokenizedAssetsCreateAccount](#tokenizedassetscreateaccount) - Create a Tokenized Assets Account
|
|
12
|
+
* [tokenizedAssetsQuote](#tokenizedassetsquote) - Preview a buy/sell quote
|
|
12
13
|
* [tokenizedAssetsOrder](#tokenizedassetsorder) - Build a buy/sell order
|
|
13
14
|
* [tokenizedAssetsOrderSubmit](#tokenizedassetsordersubmit) - Submit a signed order
|
|
14
15
|
* [tokenizedAssetsOrderOrderHashCancel](#tokenizedassetsorderorderhashcancel) - Cancel an unfilled order
|
|
@@ -444,6 +445,107 @@ run();
|
|
|
444
445
|
| errors.HTTPValidationError | 422 | application/json |
|
|
445
446
|
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
446
447
|
|
|
448
|
+
## tokenizedAssetsQuote
|
|
449
|
+
|
|
450
|
+
Preview the input/output amounts, fees, and slippage tolerance for an order.
|
|
451
|
+
|
|
452
|
+
Read-only relative to Fusion: hits ``/quote/receive`` only and does not
|
|
453
|
+
consume a ``quote_id`` or commit an order. Pair with `POST /order`:
|
|
454
|
+
surface this preview to the user, and on confirm pass the body plus
|
|
455
|
+
``recommended_slippage_bps`` to `/order`.
|
|
456
|
+
|
|
457
|
+
The response carries:
|
|
458
|
+
|
|
459
|
+
- **`quote`** — input/output token amounts, fees, and an
|
|
460
|
+
``est_fill_seconds`` upper bound.
|
|
461
|
+
- **`recommended_slippage_bps`** — system-derived slippage tolerance
|
|
462
|
+
that clears Fusion's current auction floor; pass back as
|
|
463
|
+
``slippage_bps`` on `/order` so the build call validates against the
|
|
464
|
+
same floor the user was shown.
|
|
465
|
+
- **`auction_range_bps`** — worst-case bps gap between the auction
|
|
466
|
+
end amount and the reference quote amount. Use to surface a
|
|
467
|
+
thin-liquidity warning to the user.
|
|
468
|
+
|
|
469
|
+
### Example Usage
|
|
470
|
+
|
|
471
|
+
<!-- UsageSnippet language="typescript" operationID="v2_tokenized_assets_quote" method="post" path="/v2/tokenized_assets/quote" -->
|
|
472
|
+
```typescript
|
|
473
|
+
import { CompassApiSDK } from "@compass-labs/api-sdk";
|
|
474
|
+
|
|
475
|
+
const compassApiSDK = new CompassApiSDK({
|
|
476
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
477
|
+
});
|
|
478
|
+
|
|
479
|
+
async function run() {
|
|
480
|
+
const result = await compassApiSDK.tokenizedAssets.tokenizedAssetsQuote({
|
|
481
|
+
chain: "base",
|
|
482
|
+
fromToken: "<value>",
|
|
483
|
+
toToken: "<value>",
|
|
484
|
+
amount: "226.42",
|
|
485
|
+
owner: "<value>",
|
|
486
|
+
});
|
|
487
|
+
|
|
488
|
+
console.log(result);
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
run();
|
|
492
|
+
```
|
|
493
|
+
|
|
494
|
+
### Standalone function
|
|
495
|
+
|
|
496
|
+
The standalone function version of this method:
|
|
497
|
+
|
|
498
|
+
```typescript
|
|
499
|
+
import { CompassApiSDKCore } from "@compass-labs/api-sdk/core.js";
|
|
500
|
+
import { tokenizedAssetsTokenizedAssetsQuote } from "@compass-labs/api-sdk/funcs/tokenizedAssetsTokenizedAssetsQuote.js";
|
|
501
|
+
|
|
502
|
+
// Use `CompassApiSDKCore` for best tree-shaking performance.
|
|
503
|
+
// You can create one instance of it to use across an application.
|
|
504
|
+
const compassApiSDK = new CompassApiSDKCore({
|
|
505
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
506
|
+
});
|
|
507
|
+
|
|
508
|
+
async function run() {
|
|
509
|
+
const res = await tokenizedAssetsTokenizedAssetsQuote(compassApiSDK, {
|
|
510
|
+
chain: "base",
|
|
511
|
+
fromToken: "<value>",
|
|
512
|
+
toToken: "<value>",
|
|
513
|
+
amount: "226.42",
|
|
514
|
+
owner: "<value>",
|
|
515
|
+
});
|
|
516
|
+
if (res.ok) {
|
|
517
|
+
const { value: result } = res;
|
|
518
|
+
console.log(result);
|
|
519
|
+
} else {
|
|
520
|
+
console.log("tokenizedAssetsTokenizedAssetsQuote failed:", res.error);
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
run();
|
|
525
|
+
```
|
|
526
|
+
|
|
527
|
+
### Parameters
|
|
528
|
+
|
|
529
|
+
| Parameter | Type | Required | Description |
|
|
530
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
531
|
+
| `request` | [components.TokenizedAssetsQuoteRequest](../../models/components/tokenizedassetsquoterequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
532
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
533
|
+
| `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. |
|
|
534
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
535
|
+
|
|
536
|
+
### Response
|
|
537
|
+
|
|
538
|
+
**Promise\<[components.TokenizedAssetsQuoteResponse](../../models/components/tokenizedassetsquoteresponse.md)\>**
|
|
539
|
+
|
|
540
|
+
### Errors
|
|
541
|
+
|
|
542
|
+
| Error Type | Status Code | Content Type |
|
|
543
|
+
| ----------------------------------- | ----------------------------------- | ----------------------------------- |
|
|
544
|
+
| errors.TokenizedAssetsErrorResponse | 400, 404, 409 | application/json |
|
|
545
|
+
| errors.HTTPValidationError | 422 | application/json |
|
|
546
|
+
| errors.TokenizedAssetsErrorResponse | 502 | application/json |
|
|
547
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
548
|
+
|
|
447
549
|
## tokenizedAssetsOrder
|
|
448
550
|
|
|
449
551
|
Build a buy or sell order whose maker is the Tokenized Assets Account.
|
|
@@ -478,9 +580,10 @@ const compassApiSDK = new CompassApiSDK({
|
|
|
478
580
|
|
|
479
581
|
async function run() {
|
|
480
582
|
const result = await compassApiSDK.tokenizedAssets.tokenizedAssetsOrder({
|
|
583
|
+
chain: "arbitrum",
|
|
481
584
|
fromToken: "<value>",
|
|
482
585
|
toToken: "<value>",
|
|
483
|
-
amount: "
|
|
586
|
+
amount: "853.30",
|
|
484
587
|
owner: "<value>",
|
|
485
588
|
slippageBps: 50,
|
|
486
589
|
});
|
|
@@ -507,9 +610,10 @@ const compassApiSDK = new CompassApiSDKCore({
|
|
|
507
610
|
|
|
508
611
|
async function run() {
|
|
509
612
|
const res = await tokenizedAssetsTokenizedAssetsOrder(compassApiSDK, {
|
|
613
|
+
chain: "arbitrum",
|
|
510
614
|
fromToken: "<value>",
|
|
511
615
|
toToken: "<value>",
|
|
512
|
-
amount: "
|
|
616
|
+
amount: "853.30",
|
|
513
617
|
owner: "<value>",
|
|
514
618
|
slippageBps: 50,
|
|
515
619
|
});
|
package/package.json
CHANGED
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { CompassApiSDKCore } from "../core.js";
|
|
6
|
+
import { encodeJSON } 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 { APICall, APIPromise } from "../types/async.js";
|
|
27
|
+
import { Result } from "../types/fp.js";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Preview a buy/sell quote
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Preview the input/output amounts, fees, and slippage tolerance for an order.
|
|
34
|
+
*
|
|
35
|
+
* Read-only relative to Fusion: hits ``/quote/receive`` only and does not
|
|
36
|
+
* consume a ``quote_id`` or commit an order. Pair with `POST /order`:
|
|
37
|
+
* surface this preview to the user, and on confirm pass the body plus
|
|
38
|
+
* ``recommended_slippage_bps`` to `/order`.
|
|
39
|
+
*
|
|
40
|
+
* The response carries:
|
|
41
|
+
*
|
|
42
|
+
* - **`quote`** — input/output token amounts, fees, and an
|
|
43
|
+
* ``est_fill_seconds`` upper bound.
|
|
44
|
+
* - **`recommended_slippage_bps`** — system-derived slippage tolerance
|
|
45
|
+
* that clears Fusion's current auction floor; pass back as
|
|
46
|
+
* ``slippage_bps`` on `/order` so the build call validates against the
|
|
47
|
+
* same floor the user was shown.
|
|
48
|
+
* - **`auction_range_bps`** — worst-case bps gap between the auction
|
|
49
|
+
* end amount and the reference quote amount. Use to surface a
|
|
50
|
+
* thin-liquidity warning to the user.
|
|
51
|
+
*/
|
|
52
|
+
export function tokenizedAssetsTokenizedAssetsQuote(
|
|
53
|
+
client: CompassApiSDKCore,
|
|
54
|
+
request: components.TokenizedAssetsQuoteRequest,
|
|
55
|
+
options?: RequestOptions,
|
|
56
|
+
): APIPromise<
|
|
57
|
+
Result<
|
|
58
|
+
components.TokenizedAssetsQuoteResponse,
|
|
59
|
+
| errors.TokenizedAssetsErrorResponse
|
|
60
|
+
| errors.HTTPValidationError
|
|
61
|
+
| CompassAPISDKError
|
|
62
|
+
| ResponseValidationError
|
|
63
|
+
| ConnectionError
|
|
64
|
+
| RequestAbortedError
|
|
65
|
+
| RequestTimeoutError
|
|
66
|
+
| InvalidRequestError
|
|
67
|
+
| UnexpectedClientError
|
|
68
|
+
| SDKValidationError
|
|
69
|
+
>
|
|
70
|
+
> {
|
|
71
|
+
return new APIPromise($do(
|
|
72
|
+
client,
|
|
73
|
+
request,
|
|
74
|
+
options,
|
|
75
|
+
));
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
async function $do(
|
|
79
|
+
client: CompassApiSDKCore,
|
|
80
|
+
request: components.TokenizedAssetsQuoteRequest,
|
|
81
|
+
options?: RequestOptions,
|
|
82
|
+
): Promise<
|
|
83
|
+
[
|
|
84
|
+
Result<
|
|
85
|
+
components.TokenizedAssetsQuoteResponse,
|
|
86
|
+
| errors.TokenizedAssetsErrorResponse
|
|
87
|
+
| errors.HTTPValidationError
|
|
88
|
+
| CompassAPISDKError
|
|
89
|
+
| ResponseValidationError
|
|
90
|
+
| ConnectionError
|
|
91
|
+
| RequestAbortedError
|
|
92
|
+
| RequestTimeoutError
|
|
93
|
+
| InvalidRequestError
|
|
94
|
+
| UnexpectedClientError
|
|
95
|
+
| SDKValidationError
|
|
96
|
+
>,
|
|
97
|
+
APICall,
|
|
98
|
+
]
|
|
99
|
+
> {
|
|
100
|
+
const parsed = safeParse(
|
|
101
|
+
request,
|
|
102
|
+
(value) =>
|
|
103
|
+
components.TokenizedAssetsQuoteRequest$outboundSchema.parse(value),
|
|
104
|
+
"Input validation failed",
|
|
105
|
+
);
|
|
106
|
+
if (!parsed.ok) {
|
|
107
|
+
return [parsed, { status: "invalid" }];
|
|
108
|
+
}
|
|
109
|
+
const payload = parsed.value;
|
|
110
|
+
const body = encodeJSON("body", payload, { explode: true });
|
|
111
|
+
|
|
112
|
+
const path = pathToFunc("/v2/tokenized_assets/quote")();
|
|
113
|
+
|
|
114
|
+
const headers = new Headers(compactMap({
|
|
115
|
+
"Content-Type": "application/json",
|
|
116
|
+
Accept: "application/json",
|
|
117
|
+
}));
|
|
118
|
+
|
|
119
|
+
const secConfig = await extractSecurity(client._options.apiKeyAuth);
|
|
120
|
+
const securityInput = secConfig == null ? {} : { apiKeyAuth: secConfig };
|
|
121
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
122
|
+
|
|
123
|
+
const context = {
|
|
124
|
+
options: client._options,
|
|
125
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
126
|
+
operationID: "v2_tokenized_assets_quote",
|
|
127
|
+
oAuth2Scopes: null,
|
|
128
|
+
|
|
129
|
+
resolvedSecurity: requestSecurity,
|
|
130
|
+
|
|
131
|
+
securitySource: client._options.apiKeyAuth,
|
|
132
|
+
retryConfig: options?.retries
|
|
133
|
+
|| client._options.retryConfig
|
|
134
|
+
|| { strategy: "none" },
|
|
135
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
const requestRes = client._createRequest(context, {
|
|
139
|
+
security: requestSecurity,
|
|
140
|
+
method: "POST",
|
|
141
|
+
baseURL: options?.serverURL,
|
|
142
|
+
path: path,
|
|
143
|
+
headers: headers,
|
|
144
|
+
body: body,
|
|
145
|
+
userAgent: client._options.userAgent,
|
|
146
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
147
|
+
}, options);
|
|
148
|
+
if (!requestRes.ok) {
|
|
149
|
+
return [requestRes, { status: "invalid" }];
|
|
150
|
+
}
|
|
151
|
+
const req = requestRes.value;
|
|
152
|
+
|
|
153
|
+
const doResult = await client._do(req, {
|
|
154
|
+
context,
|
|
155
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
156
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
157
|
+
retryConfig: context.retryConfig,
|
|
158
|
+
retryCodes: context.retryCodes,
|
|
159
|
+
});
|
|
160
|
+
if (!doResult.ok) {
|
|
161
|
+
return [doResult, { status: "request-error", request: req }];
|
|
162
|
+
}
|
|
163
|
+
const response = doResult.value;
|
|
164
|
+
|
|
165
|
+
const responseFields = {
|
|
166
|
+
HttpMeta: { Response: response, Request: req },
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
const [result] = await M.match<
|
|
170
|
+
components.TokenizedAssetsQuoteResponse,
|
|
171
|
+
| errors.TokenizedAssetsErrorResponse
|
|
172
|
+
| errors.HTTPValidationError
|
|
173
|
+
| CompassAPISDKError
|
|
174
|
+
| ResponseValidationError
|
|
175
|
+
| ConnectionError
|
|
176
|
+
| RequestAbortedError
|
|
177
|
+
| RequestTimeoutError
|
|
178
|
+
| InvalidRequestError
|
|
179
|
+
| UnexpectedClientError
|
|
180
|
+
| SDKValidationError
|
|
181
|
+
>(
|
|
182
|
+
M.json(200, components.TokenizedAssetsQuoteResponse$inboundSchema),
|
|
183
|
+
M.jsonErr(
|
|
184
|
+
[400, 404, 409],
|
|
185
|
+
errors.TokenizedAssetsErrorResponse$inboundSchema,
|
|
186
|
+
),
|
|
187
|
+
M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
|
|
188
|
+
M.jsonErr(502, errors.TokenizedAssetsErrorResponse$inboundSchema),
|
|
189
|
+
M.fail("4XX"),
|
|
190
|
+
M.fail("5XX"),
|
|
191
|
+
)(response, req, { extraFields: responseFields });
|
|
192
|
+
if (!result.ok) {
|
|
193
|
+
return [result, { status: "complete", request: req, response }];
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
return [result, { status: "complete", request: req, response }];
|
|
197
|
+
}
|
package/src/lib/config.ts
CHANGED
|
@@ -62,7 +62,7 @@ export const SDK_METADATA = {
|
|
|
62
62
|
language: "typescript",
|
|
63
63
|
openapiDocVersion: "0.0.1",
|
|
64
64
|
sdkVersion: "2.0.0",
|
|
65
|
-
genVersion: "2.
|
|
65
|
+
genVersion: "2.882.0",
|
|
66
66
|
userAgent:
|
|
67
|
-
"speakeasy-sdk/typescript 2.0.0 2.
|
|
67
|
+
"speakeasy-sdk/typescript 2.0.0 2.882.0 0.0.1 @compass-labs/api-sdk",
|
|
68
68
|
} as const;
|
|
@@ -260,6 +260,8 @@ export * from "./tokenizedassetsmarketslistresponse.js";
|
|
|
260
260
|
export * from "./tokenizedassetsohlcinterval.js";
|
|
261
261
|
export * from "./tokenizedassetsohlcrange.js";
|
|
262
262
|
export * from "./tokenizedassetspositionsresponse.js";
|
|
263
|
+
export * from "./tokenizedassetsquoterequest.js";
|
|
264
|
+
export * from "./tokenizedassetsquoteresponse.js";
|
|
263
265
|
export * from "./tokenizedassetssubmitorderrequest.js";
|
|
264
266
|
export * from "./tokenizedassetssubmitorderresponse.js";
|
|
265
267
|
export * from "./tokenlistresponse.js";
|