@compass-labs/api-sdk 2.2.46-rc.0 → 2.2.46
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 +8 -8
- package/dist/commonjs/funcs/tokenizedAssetsTokenizedAssetsCreateAccount.d.ts +12 -8
- package/dist/commonjs/funcs/tokenizedAssetsTokenizedAssetsCreateAccount.d.ts.map +1 -1
- package/dist/commonjs/funcs/tokenizedAssetsTokenizedAssetsCreateAccount.js +12 -8
- package/dist/commonjs/funcs/tokenizedAssetsTokenizedAssetsCreateAccount.js.map +1 -1
- package/dist/commonjs/funcs/tokenizedAssetsTokenizedAssetsMarkets.d.ts +9 -4
- package/dist/commonjs/funcs/tokenizedAssetsTokenizedAssetsMarkets.d.ts.map +1 -1
- package/dist/commonjs/funcs/tokenizedAssetsTokenizedAssetsMarkets.js +9 -4
- package/dist/commonjs/funcs/tokenizedAssetsTokenizedAssetsMarkets.js.map +1 -1
- package/dist/commonjs/funcs/tokenizedAssetsTokenizedAssetsMarketsSymbol.d.ts +13 -5
- package/dist/commonjs/funcs/tokenizedAssetsTokenizedAssetsMarketsSymbol.d.ts.map +1 -1
- package/dist/commonjs/funcs/tokenizedAssetsTokenizedAssetsMarketsSymbol.js +13 -5
- package/dist/commonjs/funcs/tokenizedAssetsTokenizedAssetsMarketsSymbol.js.map +1 -1
- package/dist/commonjs/funcs/tokenizedAssetsTokenizedAssetsOrder.d.ts +16 -15
- package/dist/commonjs/funcs/tokenizedAssetsTokenizedAssetsOrder.d.ts.map +1 -1
- package/dist/commonjs/funcs/tokenizedAssetsTokenizedAssetsOrder.js +16 -15
- package/dist/commonjs/funcs/tokenizedAssetsTokenizedAssetsOrder.js.map +1 -1
- package/dist/commonjs/funcs/tokenizedAssetsTokenizedAssetsOrderOrderHash.d.ts +8 -4
- package/dist/commonjs/funcs/tokenizedAssetsTokenizedAssetsOrderOrderHash.d.ts.map +1 -1
- package/dist/commonjs/funcs/tokenizedAssetsTokenizedAssetsOrderOrderHash.js +8 -4
- package/dist/commonjs/funcs/tokenizedAssetsTokenizedAssetsOrderOrderHash.js.map +1 -1
- package/dist/commonjs/funcs/tokenizedAssetsTokenizedAssetsOrderOrderHashCancel.d.ts +9 -11
- package/dist/commonjs/funcs/tokenizedAssetsTokenizedAssetsOrderOrderHashCancel.d.ts.map +1 -1
- package/dist/commonjs/funcs/tokenizedAssetsTokenizedAssetsOrderOrderHashCancel.js +9 -11
- package/dist/commonjs/funcs/tokenizedAssetsTokenizedAssetsOrderOrderHashCancel.js.map +1 -1
- package/dist/commonjs/funcs/tokenizedAssetsTokenizedAssetsOrderSubmit.d.ts +10 -11
- package/dist/commonjs/funcs/tokenizedAssetsTokenizedAssetsOrderSubmit.d.ts.map +1 -1
- package/dist/commonjs/funcs/tokenizedAssetsTokenizedAssetsOrderSubmit.js +10 -11
- package/dist/commonjs/funcs/tokenizedAssetsTokenizedAssetsOrderSubmit.js.map +1 -1
- package/dist/commonjs/funcs/tokenizedAssetsTokenizedAssetsPositions.d.ts +10 -5
- package/dist/commonjs/funcs/tokenizedAssetsTokenizedAssetsPositions.d.ts.map +1 -1
- package/dist/commonjs/funcs/tokenizedAssetsTokenizedAssetsPositions.js +10 -5
- package/dist/commonjs/funcs/tokenizedAssetsTokenizedAssetsPositions.js.map +1 -1
- package/dist/commonjs/models/components/compassapibackendv2modelstokenizedassetsmarketmarket.d.ts +4 -4
- package/dist/commonjs/models/components/compassapibackendv2modelstokenizedassetsmarketmarket.js +1 -1
- package/dist/commonjs/models/components/marketdetail.d.ts +5 -5
- package/dist/commonjs/models/components/marketdetail.js +1 -1
- package/dist/commonjs/models/components/ohlccandle.d.ts +1 -1
- package/dist/commonjs/models/components/orderstatus.d.ts +8 -8
- package/dist/commonjs/models/components/orderstatus.js +1 -1
- package/dist/commonjs/models/components/ordertosign.d.ts +9 -10
- package/dist/commonjs/models/components/ordertosign.d.ts.map +1 -1
- package/dist/commonjs/models/components/ordertosign.js.map +1 -1
- package/dist/commonjs/models/components/quote.d.ts +2 -2
- package/dist/commonjs/models/components/quotefee.d.ts +2 -2
- package/dist/commonjs/models/components/tokenizedassetsbuildorderrequest.d.ts +3 -3
- package/dist/commonjs/models/components/tokenizedassetsbuildorderresponse.d.ts +7 -8
- package/dist/commonjs/models/components/tokenizedassetsbuildorderresponse.d.ts.map +1 -1
- package/dist/commonjs/models/components/tokenizedassetsbuildorderresponse.js.map +1 -1
- package/dist/commonjs/models/components/tokenizedassetscancelorderrequest.d.ts +1 -1
- package/dist/commonjs/models/components/tokenizedassetssubmitorderrequest.d.ts +8 -10
- package/dist/commonjs/models/components/tokenizedassetssubmitorderrequest.d.ts.map +1 -1
- package/dist/commonjs/models/components/tokenizedassetssubmitorderrequest.js.map +1 -1
- package/dist/commonjs/sdk/tokenizedassets.d.ts +94 -70
- package/dist/commonjs/sdk/tokenizedassets.d.ts.map +1 -1
- package/dist/commonjs/sdk/tokenizedassets.js +94 -70
- package/dist/commonjs/sdk/tokenizedassets.js.map +1 -1
- package/dist/esm/funcs/tokenizedAssetsTokenizedAssetsCreateAccount.d.ts +12 -8
- package/dist/esm/funcs/tokenizedAssetsTokenizedAssetsCreateAccount.d.ts.map +1 -1
- package/dist/esm/funcs/tokenizedAssetsTokenizedAssetsCreateAccount.js +12 -8
- package/dist/esm/funcs/tokenizedAssetsTokenizedAssetsCreateAccount.js.map +1 -1
- package/dist/esm/funcs/tokenizedAssetsTokenizedAssetsMarkets.d.ts +9 -4
- package/dist/esm/funcs/tokenizedAssetsTokenizedAssetsMarkets.d.ts.map +1 -1
- package/dist/esm/funcs/tokenizedAssetsTokenizedAssetsMarkets.js +9 -4
- package/dist/esm/funcs/tokenizedAssetsTokenizedAssetsMarkets.js.map +1 -1
- package/dist/esm/funcs/tokenizedAssetsTokenizedAssetsMarketsSymbol.d.ts +13 -5
- package/dist/esm/funcs/tokenizedAssetsTokenizedAssetsMarketsSymbol.d.ts.map +1 -1
- package/dist/esm/funcs/tokenizedAssetsTokenizedAssetsMarketsSymbol.js +13 -5
- package/dist/esm/funcs/tokenizedAssetsTokenizedAssetsMarketsSymbol.js.map +1 -1
- package/dist/esm/funcs/tokenizedAssetsTokenizedAssetsOrder.d.ts +16 -15
- package/dist/esm/funcs/tokenizedAssetsTokenizedAssetsOrder.d.ts.map +1 -1
- package/dist/esm/funcs/tokenizedAssetsTokenizedAssetsOrder.js +16 -15
- package/dist/esm/funcs/tokenizedAssetsTokenizedAssetsOrder.js.map +1 -1
- package/dist/esm/funcs/tokenizedAssetsTokenizedAssetsOrderOrderHash.d.ts +8 -4
- package/dist/esm/funcs/tokenizedAssetsTokenizedAssetsOrderOrderHash.d.ts.map +1 -1
- package/dist/esm/funcs/tokenizedAssetsTokenizedAssetsOrderOrderHash.js +8 -4
- package/dist/esm/funcs/tokenizedAssetsTokenizedAssetsOrderOrderHash.js.map +1 -1
- package/dist/esm/funcs/tokenizedAssetsTokenizedAssetsOrderOrderHashCancel.d.ts +9 -11
- package/dist/esm/funcs/tokenizedAssetsTokenizedAssetsOrderOrderHashCancel.d.ts.map +1 -1
- package/dist/esm/funcs/tokenizedAssetsTokenizedAssetsOrderOrderHashCancel.js +9 -11
- package/dist/esm/funcs/tokenizedAssetsTokenizedAssetsOrderOrderHashCancel.js.map +1 -1
- package/dist/esm/funcs/tokenizedAssetsTokenizedAssetsOrderSubmit.d.ts +10 -11
- package/dist/esm/funcs/tokenizedAssetsTokenizedAssetsOrderSubmit.d.ts.map +1 -1
- package/dist/esm/funcs/tokenizedAssetsTokenizedAssetsOrderSubmit.js +10 -11
- package/dist/esm/funcs/tokenizedAssetsTokenizedAssetsOrderSubmit.js.map +1 -1
- package/dist/esm/funcs/tokenizedAssetsTokenizedAssetsPositions.d.ts +10 -5
- package/dist/esm/funcs/tokenizedAssetsTokenizedAssetsPositions.d.ts.map +1 -1
- package/dist/esm/funcs/tokenizedAssetsTokenizedAssetsPositions.js +10 -5
- package/dist/esm/funcs/tokenizedAssetsTokenizedAssetsPositions.js.map +1 -1
- package/dist/esm/models/components/compassapibackendv2modelstokenizedassetsmarketmarket.d.ts +4 -4
- package/dist/esm/models/components/compassapibackendv2modelstokenizedassetsmarketmarket.js +1 -1
- package/dist/esm/models/components/marketdetail.d.ts +5 -5
- package/dist/esm/models/components/marketdetail.js +1 -1
- package/dist/esm/models/components/ohlccandle.d.ts +1 -1
- package/dist/esm/models/components/orderstatus.d.ts +8 -8
- package/dist/esm/models/components/orderstatus.js +1 -1
- package/dist/esm/models/components/ordertosign.d.ts +9 -10
- package/dist/esm/models/components/ordertosign.d.ts.map +1 -1
- package/dist/esm/models/components/ordertosign.js.map +1 -1
- package/dist/esm/models/components/quote.d.ts +2 -2
- package/dist/esm/models/components/quotefee.d.ts +2 -2
- package/dist/esm/models/components/tokenizedassetsbuildorderrequest.d.ts +3 -3
- package/dist/esm/models/components/tokenizedassetsbuildorderresponse.d.ts +7 -8
- package/dist/esm/models/components/tokenizedassetsbuildorderresponse.d.ts.map +1 -1
- package/dist/esm/models/components/tokenizedassetsbuildorderresponse.js.map +1 -1
- package/dist/esm/models/components/tokenizedassetscancelorderrequest.d.ts +1 -1
- package/dist/esm/models/components/tokenizedassetssubmitorderrequest.d.ts +8 -10
- package/dist/esm/models/components/tokenizedassetssubmitorderrequest.d.ts.map +1 -1
- package/dist/esm/models/components/tokenizedassetssubmitorderrequest.js.map +1 -1
- package/dist/esm/sdk/tokenizedassets.d.ts +94 -70
- package/dist/esm/sdk/tokenizedassets.d.ts.map +1 -1
- package/dist/esm/sdk/tokenizedassets.js +94 -70
- package/dist/esm/sdk/tokenizedassets.js.map +1 -1
- package/docs/models/components/compassapibackendv2modelstokenizedassetsmarketmarket.md +2 -2
- package/docs/models/components/compassapibackendv2modelstokenizedassetsmarketmarketchain.md +1 -1
- package/docs/models/components/marketdetail.md +3 -3
- package/docs/models/components/marketdetailchain.md +1 -1
- package/docs/models/components/ohlccandle.md +1 -1
- package/docs/models/components/orderstatus.md +9 -9
- package/docs/models/components/ordertosign.md +12 -13
- package/docs/models/components/quote.md +6 -6
- package/docs/models/components/quotefee.md +2 -2
- package/docs/models/components/status.md +1 -1
- package/docs/models/components/tokenizedassetsbuildorderrequest.md +8 -8
- package/docs/models/components/tokenizedassetsbuildorderresponse.md +6 -6
- package/docs/models/components/tokenizedassetscancelorderrequest.md +3 -3
- package/docs/models/components/tokenizedassetssubmitorderrequest.md +11 -13
- package/docs/sdks/tokenizedassets/README.md +87 -63
- package/package.json +1 -1
- package/src/funcs/tokenizedAssetsTokenizedAssetsCreateAccount.ts +12 -8
- package/src/funcs/tokenizedAssetsTokenizedAssetsMarkets.ts +9 -4
- package/src/funcs/tokenizedAssetsTokenizedAssetsMarketsSymbol.ts +13 -5
- package/src/funcs/tokenizedAssetsTokenizedAssetsOrder.ts +16 -15
- package/src/funcs/tokenizedAssetsTokenizedAssetsOrderOrderHash.ts +8 -4
- package/src/funcs/tokenizedAssetsTokenizedAssetsOrderOrderHashCancel.ts +9 -11
- package/src/funcs/tokenizedAssetsTokenizedAssetsOrderSubmit.ts +10 -11
- package/src/funcs/tokenizedAssetsTokenizedAssetsPositions.ts +10 -5
- package/src/models/components/compassapibackendv2modelstokenizedassetsmarketmarket.ts +4 -4
- package/src/models/components/marketdetail.ts +5 -5
- package/src/models/components/ohlccandle.ts +1 -1
- package/src/models/components/orderstatus.ts +8 -8
- package/src/models/components/ordertosign.ts +9 -10
- package/src/models/components/quote.ts +2 -2
- package/src/models/components/quotefee.ts +2 -2
- package/src/models/components/tokenizedassetsbuildorderrequest.ts +3 -3
- package/src/models/components/tokenizedassetsbuildorderresponse.ts +7 -8
- package/src/models/components/tokenizedassetscancelorderrequest.ts +1 -1
- package/src/models/components/tokenizedassetssubmitorderrequest.ts +8 -10
- package/src/sdk/tokenizedassets.ts +94 -70
|
@@ -4,21 +4,26 @@
|
|
|
4
4
|
|
|
5
5
|
### Available Operations
|
|
6
6
|
|
|
7
|
-
* [tokenizedAssetsMarkets](#tokenizedassetsmarkets) - List equity markets
|
|
7
|
+
* [tokenizedAssetsMarkets](#tokenizedassetsmarkets) - List tokenized equity markets
|
|
8
8
|
* [tokenizedAssetsMarketsSymbol](#tokenizedassetsmarketssymbol) - Get a single market
|
|
9
|
-
* [tokenizedAssetsPositions](#tokenizedassetspositions) - Get
|
|
9
|
+
* [tokenizedAssetsPositions](#tokenizedassetspositions) - Get tokenized-asset positions for a wallet
|
|
10
10
|
* [tokenizedAssetsOrderOrderHash](#tokenizedassetsorderorderhash) - Get order status
|
|
11
|
-
* [tokenizedAssetsCreateAccount](#tokenizedassetscreateaccount) - Create
|
|
11
|
+
* [tokenizedAssetsCreateAccount](#tokenizedassetscreateaccount) - Create a Tokenized Assets Account
|
|
12
12
|
* [tokenizedAssetsOrder](#tokenizedassetsorder) - Build a buy/sell order
|
|
13
|
-
* [tokenizedAssetsOrderSubmit](#tokenizedassetsordersubmit) - Submit a signed order
|
|
13
|
+
* [tokenizedAssetsOrderSubmit](#tokenizedassetsordersubmit) - Submit a signed order
|
|
14
14
|
* [tokenizedAssetsOrderOrderHashCancel](#tokenizedassetsorderorderhashcancel) - Cancel an unfilled order
|
|
15
15
|
|
|
16
16
|
## tokenizedAssetsMarkets
|
|
17
17
|
|
|
18
|
-
List tokenized equities
|
|
18
|
+
List the tokenized US equities available on Ethereum.
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
Each entry includes the symbol, the underlying ticker, the on-chain
|
|
21
|
+
contract address, the latest USD price, and 24h price change. Filter
|
|
22
|
+
by `category` (sector tag) or `search` (substring match against symbol,
|
|
23
|
+
ticker, or name).
|
|
24
|
+
|
|
25
|
+
Only Ethereum-deployed tokens are returned; assets that exist only on
|
|
26
|
+
other chains are omitted.
|
|
22
27
|
|
|
23
28
|
### Example Usage
|
|
24
29
|
|
|
@@ -89,13 +94,21 @@ run();
|
|
|
89
94
|
|
|
90
95
|
## tokenizedAssetsMarketsSymbol
|
|
91
96
|
|
|
92
|
-
|
|
97
|
+
Get extended detail for a single tokenized equity (e.g. `TSLAon`).
|
|
98
|
+
|
|
99
|
+
Includes 52-week range, volume, market cap, holder count, and tradable
|
|
100
|
+
sessions in addition to the fields returned by `/markets`.
|
|
101
|
+
|
|
102
|
+
**OHLC candles** are opt-in: pass both `interval` and `range` query
|
|
103
|
+
params to include a `candles` array in the response. They must be
|
|
104
|
+
provided together and must form one of the supported pairs:
|
|
93
105
|
|
|
94
|
-
|
|
106
|
+
- `1min` / `5min` / `15min` with `range=1day`
|
|
107
|
+
- `1hour` / `4hour` with `range=1month`
|
|
108
|
+
- `12hour` with `range=3month`
|
|
109
|
+
- `1day` with `range=3month` / `6month` / `1year` / `all`
|
|
95
110
|
|
|
96
|
-
|
|
97
|
-
- Both supplied and forming a valid Ondo pair: 200 with `candles` populated.
|
|
98
|
-
- Exactly one supplied, or both supplied with an invalid pair: 400.
|
|
111
|
+
Omitting both returns the market detail without `candles`.
|
|
99
112
|
|
|
100
113
|
### Example Usage
|
|
101
114
|
|
|
@@ -171,11 +184,16 @@ run();
|
|
|
171
184
|
|
|
172
185
|
## tokenizedAssetsPositions
|
|
173
186
|
|
|
174
|
-
|
|
187
|
+
Get the tokenized-asset holdings for a wallet.
|
|
175
188
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
189
|
+
Returns the balance of every listed tokenized equity at the queried
|
|
190
|
+
address, plus the latest USD price and a USD-valued balance when
|
|
191
|
+
pricing is available. Zero balances are omitted, and a `total_usd`
|
|
192
|
+
aggregate is returned across all priced positions.
|
|
193
|
+
|
|
194
|
+
Pass the **Tokenized Assets Account address** (returned by
|
|
195
|
+
`/create_account`), not the owner's wallet — proceeds from filled
|
|
196
|
+
orders settle into the Tokenized Assets Account.
|
|
179
197
|
|
|
180
198
|
### Example Usage
|
|
181
199
|
|
|
@@ -250,11 +268,15 @@ run();
|
|
|
250
268
|
|
|
251
269
|
## tokenizedAssetsOrderOrderHash
|
|
252
270
|
|
|
253
|
-
|
|
271
|
+
Get the lifecycle state of a submitted order.
|
|
272
|
+
|
|
273
|
+
The `status` field is one of `pending`, `filled`, `expired`, or
|
|
274
|
+
`cancelled`. Partial fills stay in `pending` while `filled_amount` is
|
|
275
|
+
populated as fills come in; once an order fully fills, `fill_tx_hash`
|
|
276
|
+
is also returned.
|
|
254
277
|
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
surface as 502 to alert on schema drift.
|
|
278
|
+
Upstream protocol states beyond these four (e.g. `partially-filled`,
|
|
279
|
+
`refunded`) are mapped onto this set.
|
|
258
280
|
|
|
259
281
|
### Example Usage
|
|
260
282
|
|
|
@@ -332,17 +354,21 @@ run();
|
|
|
332
354
|
|
|
333
355
|
Create a Tokenized Assets Account for a wallet address.
|
|
334
356
|
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
accounts.
|
|
357
|
+
Before placing orders, the owner must create a Tokenized Assets Account.
|
|
358
|
+
Each wallet address has one Tokenized Assets Account, isolated from the
|
|
359
|
+
owner's Earn, Credit, and other product accounts.
|
|
360
|
+
|
|
361
|
+
The account address is deterministic. If it already exists, the
|
|
362
|
+
response returns `transaction: null` and you can skip straight to
|
|
363
|
+
building orders.
|
|
338
364
|
|
|
339
|
-
Returns an unsigned transaction to create the account. The `sender`
|
|
340
|
-
broadcasts this transaction.
|
|
365
|
+
Returns an unsigned transaction to create the account. The `sender`
|
|
366
|
+
signs and broadcasts this transaction.
|
|
341
367
|
|
|
342
368
|
**If owner pays gas:** Set `sender` to the owner's address.
|
|
343
369
|
|
|
344
|
-
**If someone else pays gas:** Set `sender` to the wallet that will
|
|
345
|
-
broadcast the transaction on behalf of the owner.
|
|
370
|
+
**If someone else pays gas:** Set `sender` to the wallet that will
|
|
371
|
+
sign and broadcast the transaction on behalf of the owner.
|
|
346
372
|
|
|
347
373
|
### Example Usage
|
|
348
374
|
|
|
@@ -420,24 +446,25 @@ run();
|
|
|
420
446
|
|
|
421
447
|
## tokenizedAssetsOrder
|
|
422
448
|
|
|
423
|
-
Build a
|
|
449
|
+
Build a buy or sell order whose maker is the Tokenized Assets Account.
|
|
424
450
|
|
|
425
|
-
Returns
|
|
426
|
-
to a relayed Fusion order whose maker is the Tokenized Assets Account.
|
|
427
|
-
The flow is **signing-based, not transaction-based**:
|
|
451
|
+
Returns up to three pieces in a single round-trip:
|
|
428
452
|
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
453
|
+
- **`quote`** — preview of the input/output amounts and fees.
|
|
454
|
+
- **`approval_safe_tx_eip712`** — only present when the account's
|
|
455
|
+
allowance to the settlement contract is below `amount`. The owner
|
|
456
|
+
signs this EIP-712 payload, then it is broadcast via
|
|
457
|
+
`POST /v2/gas_sponsorship/prepare` (or the owner can broadcast
|
|
458
|
+
directly) to set the on-chain allowance. Wait for that transaction
|
|
459
|
+
to confirm before signing the order.
|
|
460
|
+
- **`order`** — the order metadata (`order_hash`, `extension`,
|
|
461
|
+
`quote_id`, `order_message`) plus `safe_message_eip712`, an EIP-712
|
|
462
|
+
payload the owner signs off-chain to authorize the order. The
|
|
463
|
+
signature is submitted to `/order/submit` and is **never** broadcast
|
|
464
|
+
on-chain.
|
|
438
465
|
|
|
439
|
-
The owner never broadcasts
|
|
440
|
-
|
|
466
|
+
The owner never broadcasts the order itself — only the (one-time)
|
|
467
|
+
approval transaction ever hits the chain.
|
|
441
468
|
|
|
442
469
|
### Example Usage
|
|
443
470
|
|
|
@@ -521,18 +548,17 @@ run();
|
|
|
521
548
|
|
|
522
549
|
## tokenizedAssetsOrderSubmit
|
|
523
550
|
|
|
524
|
-
|
|
551
|
+
Submit a signed order to the resolver network.
|
|
525
552
|
|
|
526
|
-
The body
|
|
527
|
-
`
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
is the Tokenized Assets Account, not the EOA owner.
|
|
553
|
+
The body echoes the `order` fields from `/order` (`signed_order`,
|
|
554
|
+
`extension`, `quote_id`, optionally `order_hash`) plus the owner's
|
|
555
|
+
signature over `order.safe_message_eip712`. The maker on the order
|
|
556
|
+
struct is the Tokenized Assets Account, not the owner's wallet —
|
|
557
|
+
pass `signed_order` back unchanged.
|
|
532
558
|
|
|
533
|
-
Returns the order hash and a server-side timestamp.
|
|
534
|
-
`GET /order/{order_hash}` track lifecycle
|
|
535
|
-
`expired` / `cancelled`).
|
|
559
|
+
Returns the order hash and a server-side ISO 8601 timestamp.
|
|
560
|
+
Subsequent calls to `GET /order/{order_hash}` track the lifecycle
|
|
561
|
+
(`pending` → `filled` / `expired` / `cancelled`).
|
|
536
562
|
|
|
537
563
|
### Example Usage
|
|
538
564
|
|
|
@@ -618,19 +644,17 @@ run();
|
|
|
618
644
|
|
|
619
645
|
## tokenizedAssetsOrderOrderHashCancel
|
|
620
646
|
|
|
621
|
-
Build
|
|
647
|
+
Build the EIP-712 payload to cancel an unfilled order on-chain.
|
|
622
648
|
|
|
623
|
-
Returns ``cancel_safe_tx_eip712
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
``
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
directly if not using gas sponsorship.
|
|
649
|
+
Returns ``cancel_safe_tx_eip712``, an EIP-712 payload that authorizes
|
|
650
|
+
the on-chain cancellation. Sign with the Tokenized Assets Account's
|
|
651
|
+
owner via ``wallet.signTypedData(...)`` and relay via
|
|
652
|
+
``POST /v2/gas_sponsorship/prepare`` so the sponsor broadcasts the
|
|
653
|
+
cancellation on the product account. The owner can also broadcast
|
|
654
|
+
the resulting transaction directly without using gas sponsorship.
|
|
630
655
|
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
Mismatches return 403 ``OWNER_NOT_MAKER`` before any on-chain reads.
|
|
656
|
+
Cancellation works on `pending` and `expired` orders only. Only the
|
|
657
|
+
Tokenized Assets Account that placed the order can cancel it.
|
|
634
658
|
|
|
635
659
|
### Example Usage
|
|
636
660
|
|
package/package.json
CHANGED
|
@@ -27,22 +27,26 @@ import { APICall, APIPromise } from "../types/async.js";
|
|
|
27
27
|
import { Result } from "../types/fp.js";
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
|
-
* Create
|
|
30
|
+
* Create a Tokenized Assets Account
|
|
31
31
|
*
|
|
32
32
|
* @remarks
|
|
33
33
|
* Create a Tokenized Assets Account for a wallet address.
|
|
34
34
|
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
* accounts.
|
|
35
|
+
* Before placing orders, the owner must create a Tokenized Assets Account.
|
|
36
|
+
* Each wallet address has one Tokenized Assets Account, isolated from the
|
|
37
|
+
* owner's Earn, Credit, and other product accounts.
|
|
38
38
|
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
39
|
+
* The account address is deterministic. If it already exists, the
|
|
40
|
+
* response returns `transaction: null` and you can skip straight to
|
|
41
|
+
* building orders.
|
|
42
|
+
*
|
|
43
|
+
* Returns an unsigned transaction to create the account. The `sender`
|
|
44
|
+
* signs and broadcasts this transaction.
|
|
41
45
|
*
|
|
42
46
|
* **If owner pays gas:** Set `sender` to the owner's address.
|
|
43
47
|
*
|
|
44
|
-
* **If someone else pays gas:** Set `sender` to the wallet that will
|
|
45
|
-
* broadcast the transaction on behalf of the owner.
|
|
48
|
+
* **If someone else pays gas:** Set `sender` to the wallet that will
|
|
49
|
+
* sign and broadcast the transaction on behalf of the owner.
|
|
46
50
|
*/
|
|
47
51
|
export function tokenizedAssetsTokenizedAssetsCreateAccount(
|
|
48
52
|
client: CompassApiSDKCore,
|
|
@@ -28,13 +28,18 @@ import { APICall, APIPromise } from "../types/async.js";
|
|
|
28
28
|
import { Result } from "../types/fp.js";
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
|
-
* List equity markets
|
|
31
|
+
* List tokenized equity markets
|
|
32
32
|
*
|
|
33
33
|
* @remarks
|
|
34
|
-
* List tokenized equities
|
|
34
|
+
* List the tokenized US equities available on Ethereum.
|
|
35
35
|
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
36
|
+
* Each entry includes the symbol, the underlying ticker, the on-chain
|
|
37
|
+
* contract address, the latest USD price, and 24h price change. Filter
|
|
38
|
+
* by `category` (sector tag) or `search` (substring match against symbol,
|
|
39
|
+
* ticker, or name).
|
|
40
|
+
*
|
|
41
|
+
* Only Ethereum-deployed tokens are returned; assets that exist only on
|
|
42
|
+
* other chains are omitted.
|
|
38
43
|
*/
|
|
39
44
|
export function tokenizedAssetsTokenizedAssetsMarkets(
|
|
40
45
|
client: CompassApiSDKCore,
|
|
@@ -31,13 +31,21 @@ import { Result } from "../types/fp.js";
|
|
|
31
31
|
* Get a single market
|
|
32
32
|
*
|
|
33
33
|
* @remarks
|
|
34
|
-
*
|
|
34
|
+
* Get extended detail for a single tokenized equity (e.g. `TSLAon`).
|
|
35
35
|
*
|
|
36
|
-
*
|
|
36
|
+
* Includes 52-week range, volume, market cap, holder count, and tradable
|
|
37
|
+
* sessions in addition to the fields returned by `/markets`.
|
|
37
38
|
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
39
|
+
* **OHLC candles** are opt-in: pass both `interval` and `range` query
|
|
40
|
+
* params to include a `candles` array in the response. They must be
|
|
41
|
+
* provided together and must form one of the supported pairs:
|
|
42
|
+
*
|
|
43
|
+
* - `1min` / `5min` / `15min` with `range=1day`
|
|
44
|
+
* - `1hour` / `4hour` with `range=1month`
|
|
45
|
+
* - `12hour` with `range=3month`
|
|
46
|
+
* - `1day` with `range=3month` / `6month` / `1year` / `all`
|
|
47
|
+
*
|
|
48
|
+
* Omitting both returns the market detail without `candles`.
|
|
41
49
|
*/
|
|
42
50
|
export function tokenizedAssetsTokenizedAssetsMarketsSymbol(
|
|
43
51
|
client: CompassApiSDKCore,
|
|
@@ -30,24 +30,25 @@ import { Result } from "../types/fp.js";
|
|
|
30
30
|
* Build a buy/sell order
|
|
31
31
|
*
|
|
32
32
|
* @remarks
|
|
33
|
-
* Build a
|
|
33
|
+
* Build a buy or sell order whose maker is the Tokenized Assets Account.
|
|
34
34
|
*
|
|
35
|
-
* Returns
|
|
36
|
-
* to a relayed Fusion order whose maker is the Tokenized Assets Account.
|
|
37
|
-
* The flow is **signing-based, not transaction-based**:
|
|
35
|
+
* Returns up to three pieces in a single round-trip:
|
|
38
36
|
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
37
|
+
* - **`quote`** — preview of the input/output amounts and fees.
|
|
38
|
+
* - **`approval_safe_tx_eip712`** — only present when the account's
|
|
39
|
+
* allowance to the settlement contract is below `amount`. The owner
|
|
40
|
+
* signs this EIP-712 payload, then it is broadcast via
|
|
41
|
+
* `POST /v2/gas_sponsorship/prepare` (or the owner can broadcast
|
|
42
|
+
* directly) to set the on-chain allowance. Wait for that transaction
|
|
43
|
+
* to confirm before signing the order.
|
|
44
|
+
* - **`order`** — the order metadata (`order_hash`, `extension`,
|
|
45
|
+
* `quote_id`, `order_message`) plus `safe_message_eip712`, an EIP-712
|
|
46
|
+
* payload the owner signs off-chain to authorize the order. The
|
|
47
|
+
* signature is submitted to `/order/submit` and is **never** broadcast
|
|
48
|
+
* on-chain.
|
|
48
49
|
*
|
|
49
|
-
* The owner never broadcasts
|
|
50
|
-
*
|
|
50
|
+
* The owner never broadcasts the order itself — only the (one-time)
|
|
51
|
+
* approval transaction ever hits the chain.
|
|
51
52
|
*/
|
|
52
53
|
export function tokenizedAssetsTokenizedAssetsOrder(
|
|
53
54
|
client: CompassApiSDKCore,
|
|
@@ -31,11 +31,15 @@ import { Result } from "../types/fp.js";
|
|
|
31
31
|
* Get order status
|
|
32
32
|
*
|
|
33
33
|
* @remarks
|
|
34
|
-
*
|
|
34
|
+
* Get the lifecycle state of a submitted order.
|
|
35
35
|
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
36
|
+
* The `status` field is one of `pending`, `filled`, `expired`, or
|
|
37
|
+
* `cancelled`. Partial fills stay in `pending` while `filled_amount` is
|
|
38
|
+
* populated as fills come in; once an order fully fills, `fill_tx_hash`
|
|
39
|
+
* is also returned.
|
|
40
|
+
*
|
|
41
|
+
* Upstream protocol states beyond these four (e.g. `partially-filled`,
|
|
42
|
+
* `refunded`) are mapped onto this set.
|
|
39
43
|
*/
|
|
40
44
|
export function tokenizedAssetsTokenizedAssetsOrderOrderHash(
|
|
41
45
|
client: CompassApiSDKCore,
|
|
@@ -31,19 +31,17 @@ import { Result } from "../types/fp.js";
|
|
|
31
31
|
* Cancel an unfilled order
|
|
32
32
|
*
|
|
33
33
|
* @remarks
|
|
34
|
-
* Build
|
|
34
|
+
* Build the EIP-712 payload to cancel an unfilled order on-chain.
|
|
35
35
|
*
|
|
36
|
-
* Returns ``cancel_safe_tx_eip712
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
* ``
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
* directly if not using gas sponsorship.
|
|
36
|
+
* Returns ``cancel_safe_tx_eip712``, an EIP-712 payload that authorizes
|
|
37
|
+
* the on-chain cancellation. Sign with the Tokenized Assets Account's
|
|
38
|
+
* owner via ``wallet.signTypedData(...)`` and relay via
|
|
39
|
+
* ``POST /v2/gas_sponsorship/prepare`` so the sponsor broadcasts the
|
|
40
|
+
* cancellation on the product account. The owner can also broadcast
|
|
41
|
+
* the resulting transaction directly without using gas sponsorship.
|
|
43
42
|
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
* Mismatches return 403 ``OWNER_NOT_MAKER`` before any on-chain reads.
|
|
43
|
+
* Cancellation works on `pending` and `expired` orders only. Only the
|
|
44
|
+
* Tokenized Assets Account that placed the order can cancel it.
|
|
47
45
|
*/
|
|
48
46
|
export function tokenizedAssetsTokenizedAssetsOrderOrderHashCancel(
|
|
49
47
|
client: CompassApiSDKCore,
|
|
@@ -27,21 +27,20 @@ import { APICall, APIPromise } from "../types/async.js";
|
|
|
27
27
|
import { Result } from "../types/fp.js";
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
|
-
* Submit a signed order
|
|
30
|
+
* Submit a signed order
|
|
31
31
|
*
|
|
32
32
|
* @remarks
|
|
33
|
-
*
|
|
33
|
+
* Submit a signed order to the resolver network.
|
|
34
34
|
*
|
|
35
|
-
* The body
|
|
36
|
-
* `
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
* is the Tokenized Assets Account, not the EOA owner.
|
|
35
|
+
* The body echoes the `order` fields from `/order` (`signed_order`,
|
|
36
|
+
* `extension`, `quote_id`, optionally `order_hash`) plus the owner's
|
|
37
|
+
* signature over `order.safe_message_eip712`. The maker on the order
|
|
38
|
+
* struct is the Tokenized Assets Account, not the owner's wallet —
|
|
39
|
+
* pass `signed_order` back unchanged.
|
|
41
40
|
*
|
|
42
|
-
* Returns the order hash and a server-side timestamp.
|
|
43
|
-
* `GET /order/{order_hash}` track lifecycle
|
|
44
|
-
* `expired` / `cancelled`).
|
|
41
|
+
* Returns the order hash and a server-side ISO 8601 timestamp.
|
|
42
|
+
* Subsequent calls to `GET /order/{order_hash}` track the lifecycle
|
|
43
|
+
* (`pending` → `filled` / `expired` / `cancelled`).
|
|
45
44
|
*/
|
|
46
45
|
export function tokenizedAssetsTokenizedAssetsOrderSubmit(
|
|
47
46
|
client: CompassApiSDKCore,
|
|
@@ -28,14 +28,19 @@ import { APICall, APIPromise } from "../types/async.js";
|
|
|
28
28
|
import { Result } from "../types/fp.js";
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
|
-
* Get
|
|
31
|
+
* Get tokenized-asset positions for a wallet
|
|
32
32
|
*
|
|
33
33
|
* @remarks
|
|
34
|
-
*
|
|
34
|
+
* Get the tokenized-asset holdings for a wallet.
|
|
35
35
|
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
36
|
+
* Returns the balance of every listed tokenized equity at the queried
|
|
37
|
+
* address, plus the latest USD price and a USD-valued balance when
|
|
38
|
+
* pricing is available. Zero balances are omitted, and a `total_usd`
|
|
39
|
+
* aggregate is returned across all priced positions.
|
|
40
|
+
*
|
|
41
|
+
* Pass the **Tokenized Assets Account address** (returned by
|
|
42
|
+
* `/create_account`), not the owner's wallet — proceeds from filled
|
|
43
|
+
* orders settle into the Tokenized Assets Account.
|
|
39
44
|
*/
|
|
40
45
|
export function tokenizedAssetsTokenizedAssetsPositions(
|
|
41
46
|
client: CompassApiSDKCore,
|
|
@@ -10,13 +10,13 @@ import { Result as SafeParseResult } from "../../types/fp.js";
|
|
|
10
10
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
* Chain on which the
|
|
13
|
+
* Chain on which the contract is deployed.
|
|
14
14
|
*/
|
|
15
15
|
export const CompassApiBackendV2ModelsTokenizedAssetsMarketMarketChain = {
|
|
16
16
|
Ethereum: "ethereum",
|
|
17
17
|
} as const;
|
|
18
18
|
/**
|
|
19
|
-
* Chain on which the
|
|
19
|
+
* Chain on which the contract is deployed.
|
|
20
20
|
*/
|
|
21
21
|
export type CompassApiBackendV2ModelsTokenizedAssetsMarketMarketChain =
|
|
22
22
|
ClosedEnum<typeof CompassApiBackendV2ModelsTokenizedAssetsMarketMarketChain>;
|
|
@@ -38,7 +38,7 @@ export type CompassApiBackendV2ModelsTokenizedAssetsMarketMarket = {
|
|
|
38
38
|
*/
|
|
39
39
|
name: string;
|
|
40
40
|
/**
|
|
41
|
-
* Chain on which the
|
|
41
|
+
* Chain on which the contract is deployed.
|
|
42
42
|
*/
|
|
43
43
|
chain?: CompassApiBackendV2ModelsTokenizedAssetsMarketMarketChain | undefined;
|
|
44
44
|
/**
|
|
@@ -46,7 +46,7 @@ export type CompassApiBackendV2ModelsTokenizedAssetsMarketMarket = {
|
|
|
46
46
|
*/
|
|
47
47
|
contractAddress: string;
|
|
48
48
|
/**
|
|
49
|
-
* ERC-20 decimals
|
|
49
|
+
* ERC-20 decimals for this token.
|
|
50
50
|
*/
|
|
51
51
|
decimals: number;
|
|
52
52
|
/**
|
|
@@ -12,13 +12,13 @@ import { OhlcCandle, OhlcCandle$inboundSchema } from "./ohlccandle.js";
|
|
|
12
12
|
import { PricePoint, PricePoint$inboundSchema } from "./pricepoint.js";
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
-
* Chain on which the
|
|
15
|
+
* Chain on which the contract is deployed.
|
|
16
16
|
*/
|
|
17
17
|
export const MarketDetailChain = {
|
|
18
18
|
Ethereum: "ethereum",
|
|
19
19
|
} as const;
|
|
20
20
|
/**
|
|
21
|
-
* Chain on which the
|
|
21
|
+
* Chain on which the contract is deployed.
|
|
22
22
|
*/
|
|
23
23
|
export type MarketDetailChain = ClosedEnum<typeof MarketDetailChain>;
|
|
24
24
|
|
|
@@ -39,7 +39,7 @@ export type MarketDetail = {
|
|
|
39
39
|
*/
|
|
40
40
|
name: string;
|
|
41
41
|
/**
|
|
42
|
-
* Chain on which the
|
|
42
|
+
* Chain on which the contract is deployed.
|
|
43
43
|
*/
|
|
44
44
|
chain?: MarketDetailChain | undefined;
|
|
45
45
|
/**
|
|
@@ -47,7 +47,7 @@ export type MarketDetail = {
|
|
|
47
47
|
*/
|
|
48
48
|
contractAddress: string;
|
|
49
49
|
/**
|
|
50
|
-
* ERC-20 decimals
|
|
50
|
+
* ERC-20 decimals for this token.
|
|
51
51
|
*/
|
|
52
52
|
decimals: number;
|
|
53
53
|
/**
|
|
@@ -71,7 +71,7 @@ export type MarketDetail = {
|
|
|
71
71
|
*/
|
|
72
72
|
regionExposure?: Array<string> | undefined;
|
|
73
73
|
/**
|
|
74
|
-
* 24h price sparkline (
|
|
74
|
+
* 24h price sparkline as `(timestamp, price)` samples in chronological order.
|
|
75
75
|
*/
|
|
76
76
|
priceHistory24h?: Array<PricePoint> | undefined;
|
|
77
77
|
/**
|
|
@@ -8,7 +8,7 @@ import { Result as SafeParseResult } from "../../types/fp.js";
|
|
|
8
8
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* A single OHLC candle.
|
|
11
|
+
* A single OHLC candle. Per-candle volume is not provided.
|
|
12
12
|
*/
|
|
13
13
|
export type OhlcCandle = {
|
|
14
14
|
/**
|
|
@@ -10,7 +10,7 @@ import { Result as SafeParseResult } from "../../types/fp.js";
|
|
|
10
10
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* 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.
|
|
14
14
|
*/
|
|
15
15
|
export const Status = {
|
|
16
16
|
Pending: "pending",
|
|
@@ -19,7 +19,7 @@ export const Status = {
|
|
|
19
19
|
Cancelled: "cancelled",
|
|
20
20
|
} as const;
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
22
|
+
* 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
|
*/
|
|
24
24
|
export type Status = ClosedEnum<typeof Status>;
|
|
25
25
|
|
|
@@ -32,27 +32,27 @@ export type OrderStatus = {
|
|
|
32
32
|
*/
|
|
33
33
|
orderHash: string;
|
|
34
34
|
/**
|
|
35
|
-
*
|
|
35
|
+
* 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.
|
|
36
36
|
*/
|
|
37
37
|
status: Status;
|
|
38
38
|
/**
|
|
39
|
-
*
|
|
39
|
+
* Transaction hash of the most recent fill. Populated for fully filled orders and for partial fills while `status` is still `pending`.
|
|
40
40
|
*/
|
|
41
41
|
fillTxHash?: string | null | undefined;
|
|
42
42
|
/**
|
|
43
|
-
* Implied USD execution rate per unit of the
|
|
43
|
+
* 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.
|
|
44
44
|
*/
|
|
45
45
|
fillPriceUsd?: string | null | undefined;
|
|
46
46
|
/**
|
|
47
|
-
*
|
|
47
|
+
* 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.
|
|
48
48
|
*/
|
|
49
49
|
filledAmount?: string | null | undefined;
|
|
50
50
|
/**
|
|
51
|
-
* ISO 8601 UTC timestamp
|
|
51
|
+
* ISO 8601 UTC timestamp at which the order was submitted.
|
|
52
52
|
*/
|
|
53
53
|
submittedAt?: string | null | undefined;
|
|
54
54
|
/**
|
|
55
|
-
* ISO 8601 UTC timestamp
|
|
55
|
+
* ISO 8601 UTC timestamp at which this status was read.
|
|
56
56
|
*/
|
|
57
57
|
updatedAt: string;
|
|
58
58
|
};
|