@compass-labs/api-sdk 2.2.62-rc.0 → 2.2.63-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 +6 -0
- package/dist/commonjs/funcs/tokenizedAssetsTokenizedAssetsTransfer.d.ts +35 -0
- package/dist/commonjs/funcs/tokenizedAssetsTokenizedAssetsTransfer.d.ts.map +1 -0
- package/dist/commonjs/funcs/tokenizedAssetsTokenizedAssetsTransfer.js +136 -0
- package/dist/commonjs/funcs/tokenizedAssetsTokenizedAssetsTransfer.js.map +1 -0
- 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/tokenizedassetstransferrequest.d.ts +69 -0
- package/dist/commonjs/models/components/tokenizedassetstransferrequest.d.ts.map +1 -0
- package/dist/commonjs/models/components/tokenizedassetstransferrequest.js +76 -0
- package/dist/commonjs/models/components/tokenizedassetstransferrequest.js.map +1 -0
- package/dist/commonjs/models/components/tokenizedassetstransferresponse.d.ts +27 -0
- package/dist/commonjs/models/components/tokenizedassetstransferresponse.d.ts.map +1 -0
- package/dist/commonjs/models/components/tokenizedassetstransferresponse.js +71 -0
- package/dist/commonjs/models/components/tokenizedassetstransferresponse.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/tokenizedAssetsTokenizedAssetsTransfer.d.ts +35 -0
- package/dist/esm/funcs/tokenizedAssetsTokenizedAssetsTransfer.d.ts.map +1 -0
- package/dist/esm/funcs/tokenizedAssetsTokenizedAssetsTransfer.js +100 -0
- package/dist/esm/funcs/tokenizedAssetsTokenizedAssetsTransfer.js.map +1 -0
- 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/tokenizedassetstransferrequest.d.ts +69 -0
- package/dist/esm/models/components/tokenizedassetstransferrequest.d.ts.map +1 -0
- package/dist/esm/models/components/tokenizedassetstransferrequest.js +38 -0
- package/dist/esm/models/components/tokenizedassetstransferrequest.js.map +1 -0
- package/dist/esm/models/components/tokenizedassetstransferresponse.d.ts +27 -0
- package/dist/esm/models/components/tokenizedassetstransferresponse.d.ts.map +1 -0
- package/dist/esm/models/components/tokenizedassetstransferresponse.js +33 -0
- package/dist/esm/models/components/tokenizedassetstransferresponse.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/tokenizedassetstransferrequest.md +27 -0
- package/docs/models/components/tokenizedassetstransferrequestaction.md +17 -0
- package/docs/models/components/tokenizedassetstransferrequestamount.md +19 -0
- package/docs/models/components/tokenizedassetstransferresponse.md +76 -0
- package/docs/models/components/tokenizedassetstransferresponseeip712.md +99 -0
- package/docs/sdks/tokenizedassets/README.md +101 -0
- package/openapi_prepped_for_speakeasy.json +164 -0
- package/package.json +1 -1
- package/src/funcs/tokenizedAssetsTokenizedAssetsTransfer.ts +193 -0
- package/src/models/components/index.ts +2 -0
- package/src/models/components/tokenizedassetstransferrequest.ts +124 -0
- package/src/models/components/tokenizedassetstransferresponse.ts +93 -0
- package/src/sdk/tokenizedassets.ts +35 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# TokenizedAssetsTransferRequest
|
|
2
|
+
|
|
3
|
+
## Example Usage
|
|
4
|
+
|
|
5
|
+
```typescript
|
|
6
|
+
import { TokenizedAssetsTransferRequest } from "@compass-labs/api-sdk/models/components";
|
|
7
|
+
|
|
8
|
+
let value: TokenizedAssetsTransferRequest = {
|
|
9
|
+
owner: "0x9bDC45AA15FdFFc52E103EA05c260c494A5638f7",
|
|
10
|
+
chain: "ethereum",
|
|
11
|
+
token: "USDC",
|
|
12
|
+
amount: 100,
|
|
13
|
+
action: "DEPOSIT",
|
|
14
|
+
};
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Fields
|
|
18
|
+
|
|
19
|
+
| Field | Type | Required | Description | Example |
|
|
20
|
+
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
21
|
+
| `owner` | *string* | :heavy_check_mark: | The owner's wallet address (EOA). | 0x9bDC45AA15FdFFc52E103EA05c260c494A5638f7 |
|
|
22
|
+
| `chain` | [components.Chain](../../models/components/chain.md) | :heavy_minus_sign: | The chain to use. | |
|
|
23
|
+
| `token` | *string* | :heavy_check_mark: | The token to transfer. Tokenized-asset orders settle in USDC. | USDC |
|
|
24
|
+
| `amount` | *components.TokenizedAssetsTransferRequestAmount* | :heavy_check_mark: | The amount of tokens to transfer (in token units, not wei). | 100 |
|
|
25
|
+
| `action` | [components.TokenizedAssetsTransferRequestAction](../../models/components/tokenizedassetstransferrequestaction.md) | :heavy_check_mark: | Whether you are depositing to or withdrawing from your Tokenized Assets Account. | DEPOSIT |
|
|
26
|
+
| `gasSponsorship` | *boolean* | :heavy_minus_sign: | Optionally request gas sponsorship. If set to `true`, EIP-712 signature data will be returned that must be signed by the `owner` and submitted to the `/gas_sponsorship/prepare` endpoint. | false |
|
|
27
|
+
| `spender` | *string* | :heavy_minus_sign: | The address that will call Permit2's permitTransferFrom to execute the transfer. When `action` is 'DEPOSIT' and `gas_sponsorship` is `true`: - If provided, the signature will authorize this address (typically a gas sponsor) to pull tokens. - If not provided, defaults to the Tokenized Assets Account (Safe) address, allowing the transfer to be included in a bundle transaction where the Safe pulls the tokens itself. | |
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# TokenizedAssetsTransferRequestAction
|
|
2
|
+
|
|
3
|
+
Whether you are depositing to or withdrawing from your Tokenized Assets Account.
|
|
4
|
+
|
|
5
|
+
## Example Usage
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import { TokenizedAssetsTransferRequestAction } from "@compass-labs/api-sdk/models/components";
|
|
9
|
+
|
|
10
|
+
let value: TokenizedAssetsTransferRequestAction = "DEPOSIT";
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Values
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
"DEPOSIT" | "WITHDRAW"
|
|
17
|
+
```
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# TokenizedAssetsTransferRequestAmount
|
|
2
|
+
|
|
3
|
+
The amount of tokens to transfer (in token units, not wei).
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Supported Types
|
|
7
|
+
|
|
8
|
+
### `number`
|
|
9
|
+
|
|
10
|
+
```typescript
|
|
11
|
+
const value: number = 100;
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
### `string`
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
const value: string = "<value>";
|
|
18
|
+
```
|
|
19
|
+
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# TokenizedAssetsTransferResponse
|
|
2
|
+
|
|
3
|
+
## Example Usage
|
|
4
|
+
|
|
5
|
+
```typescript
|
|
6
|
+
import { TokenizedAssetsTransferResponse } from "@compass-labs/api-sdk/models/components";
|
|
7
|
+
|
|
8
|
+
let value: TokenizedAssetsTransferResponse = {
|
|
9
|
+
eip712: {
|
|
10
|
+
types: {
|
|
11
|
+
eip712Domain: [
|
|
12
|
+
{
|
|
13
|
+
name: "name",
|
|
14
|
+
type: "string",
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: "chainId",
|
|
18
|
+
type: "uint256",
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: "verifyingContract",
|
|
22
|
+
type: "address",
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
tokenPermissions: [
|
|
26
|
+
{
|
|
27
|
+
name: "token",
|
|
28
|
+
type: "address",
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: "amount",
|
|
32
|
+
type: "uint256",
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
permitTransferFrom: [
|
|
36
|
+
{
|
|
37
|
+
name: "permitted",
|
|
38
|
+
type: "TokenPermissions",
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: "spender",
|
|
42
|
+
type: "address",
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: "nonce",
|
|
46
|
+
type: "uint256",
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: "deadline",
|
|
50
|
+
type: "uint256",
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
},
|
|
54
|
+
domain: {
|
|
55
|
+
chainId: 659817,
|
|
56
|
+
verifyingContract: "<value>",
|
|
57
|
+
},
|
|
58
|
+
message: {
|
|
59
|
+
permitted: {
|
|
60
|
+
token: "<value>",
|
|
61
|
+
amount: 387057,
|
|
62
|
+
},
|
|
63
|
+
spender: "<value>",
|
|
64
|
+
nonce: 382019,
|
|
65
|
+
deadline: 22738,
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Fields
|
|
72
|
+
|
|
73
|
+
| Field | Type | Required | Description |
|
|
74
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
75
|
+
| `transaction` | [components.UnsignedTransaction](../../models/components/unsignedtransaction.md) | :heavy_minus_sign: | Unsigned transaction for direct execution. Present when `gas_sponsorship=false`. |
|
|
76
|
+
| `eip712` | *components.TokenizedAssetsTransferResponseEip712* | :heavy_minus_sign: | EIP-712 typed data for gas-sponsored execution. Present when `gas_sponsorship=true`. A Permit2 `PermitTransferFrom` for DEPOSIT, or a Safe transaction for WITHDRAW. The owner signs it and submits to `/v2/gas_sponsorship/prepare`. |
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# TokenizedAssetsTransferResponseEip712
|
|
2
|
+
|
|
3
|
+
EIP-712 typed data for gas-sponsored execution. Present when `gas_sponsorship=true`. A Permit2 `PermitTransferFrom` for DEPOSIT, or a Safe transaction for WITHDRAW. The owner signs it and submits to `/v2/gas_sponsorship/prepare`.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Supported Types
|
|
7
|
+
|
|
8
|
+
### `components.BatchedSafeOperationsResponseOutput`
|
|
9
|
+
|
|
10
|
+
```typescript
|
|
11
|
+
const value: components.BatchedSafeOperationsResponseOutput = {
|
|
12
|
+
domain: {
|
|
13
|
+
chainId: 359509,
|
|
14
|
+
verifyingContract: "<value>",
|
|
15
|
+
},
|
|
16
|
+
types: {
|
|
17
|
+
eip712Domain: [],
|
|
18
|
+
safeTx: [],
|
|
19
|
+
},
|
|
20
|
+
primaryType: "SafeTx",
|
|
21
|
+
message: {
|
|
22
|
+
to: "<value>",
|
|
23
|
+
value: "<value>",
|
|
24
|
+
data: "<value>",
|
|
25
|
+
operation: 0,
|
|
26
|
+
safeTxGas: "<value>",
|
|
27
|
+
baseGas: "<value>",
|
|
28
|
+
gasPrice: "<value>",
|
|
29
|
+
gasToken: "<value>",
|
|
30
|
+
refundReceiver: "<value>",
|
|
31
|
+
nonce: "<value>",
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### `components.Permit2TypedDataOutput`
|
|
37
|
+
|
|
38
|
+
```typescript
|
|
39
|
+
const value: components.Permit2TypedDataOutput = {
|
|
40
|
+
types: {
|
|
41
|
+
eip712Domain: [
|
|
42
|
+
{
|
|
43
|
+
name: "name",
|
|
44
|
+
type: "string",
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: "chainId",
|
|
48
|
+
type: "uint256",
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: "verifyingContract",
|
|
52
|
+
type: "address",
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
tokenPermissions: [
|
|
56
|
+
{
|
|
57
|
+
name: "token",
|
|
58
|
+
type: "address",
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: "amount",
|
|
62
|
+
type: "uint256",
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
permitTransferFrom: [
|
|
66
|
+
{
|
|
67
|
+
name: "permitted",
|
|
68
|
+
type: "TokenPermissions",
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
name: "spender",
|
|
72
|
+
type: "address",
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: "nonce",
|
|
76
|
+
type: "uint256",
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: "deadline",
|
|
80
|
+
type: "uint256",
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
},
|
|
84
|
+
domain: {
|
|
85
|
+
chainId: 659817,
|
|
86
|
+
verifyingContract: "<value>",
|
|
87
|
+
},
|
|
88
|
+
message: {
|
|
89
|
+
permitted: {
|
|
90
|
+
token: "<value>",
|
|
91
|
+
amount: 387057,
|
|
92
|
+
},
|
|
93
|
+
spender: "<value>",
|
|
94
|
+
nonce: 382019,
|
|
95
|
+
deadline: 22738,
|
|
96
|
+
},
|
|
97
|
+
};
|
|
98
|
+
```
|
|
99
|
+
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* [tokenizedAssetsPositions](#tokenizedassetspositions) - Get tokenized-asset positions for an owner
|
|
10
10
|
* [tokenizedAssetsOrderOrderHash](#tokenizedassetsorderorderhash) - Get order status
|
|
11
11
|
* [tokenizedAssetsCreateAccount](#tokenizedassetscreateaccount) - Create a Tokenized Assets Account
|
|
12
|
+
* [tokenizedAssetsTransfer](#tokenizedassetstransfer) - Deposit to / withdraw from a Tokenized Assets Account
|
|
12
13
|
* [tokenizedAssetsQuote](#tokenizedassetsquote) - Preview a buy/sell quote
|
|
13
14
|
* [tokenizedAssetsOrder](#tokenizedassetsorder) - Build a buy/sell order
|
|
14
15
|
* [tokenizedAssetsOrderSubmit](#tokenizedassetsordersubmit) - Submit a signed order
|
|
@@ -447,6 +448,106 @@ run();
|
|
|
447
448
|
| errors.HTTPValidationError | 422 | application/json |
|
|
448
449
|
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
449
450
|
|
|
451
|
+
## tokenizedAssetsTransfer
|
|
452
|
+
|
|
453
|
+
Move tokens between the owner's wallet and their Tokenized Assets Account.
|
|
454
|
+
|
|
455
|
+
Use `DEPOSIT` to fund the account from the owner's wallet, or `WITHDRAW` to
|
|
456
|
+
send tokens from the account back to the owner. Equity orders settle in
|
|
457
|
+
USDC; RWA yield assets trade against USDC on Ethereum and Base.
|
|
458
|
+
|
|
459
|
+
With `gas_sponsorship=true` the response is EIP-712 typed data the owner
|
|
460
|
+
signs off-chain, then submits to `POST /v2/gas_sponsorship/prepare` so the
|
|
461
|
+
sponsor broadcasts and pays the gas:
|
|
462
|
+
|
|
463
|
+
- **DEPOSIT** returns a Permit2 `PermitTransferFrom`. The owner must first
|
|
464
|
+
grant a one-time token->Permit2 allowance (gaslessly via
|
|
465
|
+
`POST /v2/gas_sponsorship/approve_transfer`).
|
|
466
|
+
- **WITHDRAW** returns a Safe transaction the account executes.
|
|
467
|
+
|
|
468
|
+
With `gas_sponsorship=false` a DEPOSIT returns an unsigned ERC-20 transfer
|
|
469
|
+
the owner broadcasts directly, and a WITHDRAW returns an unsigned Safe
|
|
470
|
+
`execTransaction` the owner signs and broadcasts.
|
|
471
|
+
|
|
472
|
+
### Example Usage
|
|
473
|
+
|
|
474
|
+
<!-- UsageSnippet language="typescript" operationID="v2_tokenized_assets_transfer" method="post" path="/v2/tokenized_assets/transfer" -->
|
|
475
|
+
```typescript
|
|
476
|
+
import { CompassApiSDK } from "@compass-labs/api-sdk";
|
|
477
|
+
|
|
478
|
+
const compassApiSDK = new CompassApiSDK({
|
|
479
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
480
|
+
});
|
|
481
|
+
|
|
482
|
+
async function run() {
|
|
483
|
+
const result = await compassApiSDK.tokenizedAssets.tokenizedAssetsTransfer({
|
|
484
|
+
owner: "0x9bDC45AA15FdFFc52E103EA05c260c494A5638f7",
|
|
485
|
+
chain: "ethereum",
|
|
486
|
+
token: "USDC",
|
|
487
|
+
amount: 100,
|
|
488
|
+
action: "DEPOSIT",
|
|
489
|
+
});
|
|
490
|
+
|
|
491
|
+
console.log(result);
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
run();
|
|
495
|
+
```
|
|
496
|
+
|
|
497
|
+
### Standalone function
|
|
498
|
+
|
|
499
|
+
The standalone function version of this method:
|
|
500
|
+
|
|
501
|
+
```typescript
|
|
502
|
+
import { CompassApiSDKCore } from "@compass-labs/api-sdk/core.js";
|
|
503
|
+
import { tokenizedAssetsTokenizedAssetsTransfer } from "@compass-labs/api-sdk/funcs/tokenizedAssetsTokenizedAssetsTransfer.js";
|
|
504
|
+
|
|
505
|
+
// Use `CompassApiSDKCore` for best tree-shaking performance.
|
|
506
|
+
// You can create one instance of it to use across an application.
|
|
507
|
+
const compassApiSDK = new CompassApiSDKCore({
|
|
508
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
509
|
+
});
|
|
510
|
+
|
|
511
|
+
async function run() {
|
|
512
|
+
const res = await tokenizedAssetsTokenizedAssetsTransfer(compassApiSDK, {
|
|
513
|
+
owner: "0x9bDC45AA15FdFFc52E103EA05c260c494A5638f7",
|
|
514
|
+
chain: "ethereum",
|
|
515
|
+
token: "USDC",
|
|
516
|
+
amount: 100,
|
|
517
|
+
action: "DEPOSIT",
|
|
518
|
+
});
|
|
519
|
+
if (res.ok) {
|
|
520
|
+
const { value: result } = res;
|
|
521
|
+
console.log(result);
|
|
522
|
+
} else {
|
|
523
|
+
console.log("tokenizedAssetsTokenizedAssetsTransfer failed:", res.error);
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
run();
|
|
528
|
+
```
|
|
529
|
+
|
|
530
|
+
### Parameters
|
|
531
|
+
|
|
532
|
+
| Parameter | Type | Required | Description |
|
|
533
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
534
|
+
| `request` | [components.TokenizedAssetsTransferRequest](../../models/components/tokenizedassetstransferrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
535
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
536
|
+
| `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. |
|
|
537
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
538
|
+
|
|
539
|
+
### Response
|
|
540
|
+
|
|
541
|
+
**Promise\<[components.TokenizedAssetsTransferResponse](../../models/components/tokenizedassetstransferresponse.md)\>**
|
|
542
|
+
|
|
543
|
+
### Errors
|
|
544
|
+
|
|
545
|
+
| Error Type | Status Code | Content Type |
|
|
546
|
+
| ----------------------------------- | ----------------------------------- | ----------------------------------- |
|
|
547
|
+
| errors.TokenizedAssetsErrorResponse | 400 | application/json |
|
|
548
|
+
| errors.HTTPValidationError | 422 | application/json |
|
|
549
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
550
|
+
|
|
450
551
|
## tokenizedAssetsQuote
|
|
451
552
|
|
|
452
553
|
Preview the input/output amounts, fees, and slippage tolerance for an order.
|
|
@@ -7460,6 +7460,59 @@
|
|
|
7460
7460
|
"x-speakeasy-name-override": "tokenized_assets_create_account"
|
|
7461
7461
|
}
|
|
7462
7462
|
},
|
|
7463
|
+
"/v2/tokenized_assets/transfer": {
|
|
7464
|
+
"post": {
|
|
7465
|
+
"tags": [
|
|
7466
|
+
"Tokenized Assets"
|
|
7467
|
+
],
|
|
7468
|
+
"summary": "Deposit to / withdraw from a Tokenized Assets Account",
|
|
7469
|
+
"description": "Move tokens between the owner's wallet and their Tokenized Assets Account.\n\nUse `DEPOSIT` to fund the account from the owner's wallet, or `WITHDRAW` to\nsend tokens from the account back to the owner. Equity orders settle in\nUSDC; RWA yield assets trade against USDC on Ethereum and Base.\n\nWith `gas_sponsorship=true` the response is EIP-712 typed data the owner\nsigns off-chain, then submits to `POST /v2/gas_sponsorship/prepare` so the\nsponsor broadcasts and pays the gas:\n\n- **DEPOSIT** returns a Permit2 `PermitTransferFrom`. The owner must first\n grant a one-time token->Permit2 allowance (gaslessly via\n `POST /v2/gas_sponsorship/approve_transfer`).\n- **WITHDRAW** returns a Safe transaction the account executes.\n\nWith `gas_sponsorship=false` a DEPOSIT returns an unsigned ERC-20 transfer\nthe owner broadcasts directly, and a WITHDRAW returns an unsigned Safe\n`execTransaction` the owner signs and broadcasts.",
|
|
7470
|
+
"operationId": "v2_tokenized_assets_transfer",
|
|
7471
|
+
"requestBody": {
|
|
7472
|
+
"content": {
|
|
7473
|
+
"application/json": {
|
|
7474
|
+
"schema": {
|
|
7475
|
+
"$ref": "#/components/schemas/TokenizedAssetsTransferRequest"
|
|
7476
|
+
}
|
|
7477
|
+
}
|
|
7478
|
+
},
|
|
7479
|
+
"required": true
|
|
7480
|
+
},
|
|
7481
|
+
"responses": {
|
|
7482
|
+
"200": {
|
|
7483
|
+
"description": "Successful Response",
|
|
7484
|
+
"content": {
|
|
7485
|
+
"application/json": {
|
|
7486
|
+
"schema": {
|
|
7487
|
+
"$ref": "#/components/schemas/TokenizedAssetsTransferResponse"
|
|
7488
|
+
}
|
|
7489
|
+
}
|
|
7490
|
+
}
|
|
7491
|
+
},
|
|
7492
|
+
"400": {
|
|
7493
|
+
"description": "`ACCOUNT_NOT_DEPLOYED` \u2014 the `owner` has no Tokenized Assets Account yet (call `POST /v2/tokenized_assets/create_account` first), insufficient balance, or insufficient Permit2 allowance for a gas-sponsored deposit.",
|
|
7494
|
+
"content": {
|
|
7495
|
+
"application/json": {
|
|
7496
|
+
"schema": {
|
|
7497
|
+
"$ref": "#/components/schemas/TokenizedAssetsErrorResponse"
|
|
7498
|
+
}
|
|
7499
|
+
}
|
|
7500
|
+
}
|
|
7501
|
+
},
|
|
7502
|
+
"422": {
|
|
7503
|
+
"description": "Validation Error",
|
|
7504
|
+
"content": {
|
|
7505
|
+
"application/json": {
|
|
7506
|
+
"schema": {
|
|
7507
|
+
"$ref": "#/components/schemas/HTTPValidationError"
|
|
7508
|
+
}
|
|
7509
|
+
}
|
|
7510
|
+
}
|
|
7511
|
+
}
|
|
7512
|
+
},
|
|
7513
|
+
"x-speakeasy-name-override": "tokenized_assets_transfer"
|
|
7514
|
+
}
|
|
7515
|
+
},
|
|
7463
7516
|
"/v2/tokenized_assets/quote": {
|
|
7464
7517
|
"post": {
|
|
7465
7518
|
"tags": [
|
|
@@ -21938,6 +21991,117 @@
|
|
|
21938
21991
|
"title": "TokenizedAssetsTradeResponse",
|
|
21939
21992
|
"description": "Unsigned trade execution for the owner to sign.\n\nExactly one of `transaction` (gas_sponsorship=false) or `eip_712`\n(gas_sponsorship=true) is set."
|
|
21940
21993
|
},
|
|
21994
|
+
"TokenizedAssetsTransferRequest": {
|
|
21995
|
+
"properties": {
|
|
21996
|
+
"owner": {
|
|
21997
|
+
"type": "string",
|
|
21998
|
+
"title": "Owner",
|
|
21999
|
+
"description": "The owner's wallet address (EOA).",
|
|
22000
|
+
"example": "0x9bDC45AA15FdFFc52E103EA05c260c494A5638f7"
|
|
22001
|
+
},
|
|
22002
|
+
"chain": {
|
|
22003
|
+
"$ref": "#/components/schemas/Chain",
|
|
22004
|
+
"description": "Network to transfer on (defaults to Ethereum). Equities settle on Ethereum; RWA yield assets also trade on Base.",
|
|
22005
|
+
"example": "ethereum"
|
|
22006
|
+
},
|
|
22007
|
+
"token": {
|
|
22008
|
+
"type": "string",
|
|
22009
|
+
"title": "Token",
|
|
22010
|
+
"description": "The token to transfer. Tokenized-asset orders settle in USDC.",
|
|
22011
|
+
"example": "USDC"
|
|
22012
|
+
},
|
|
22013
|
+
"amount": {
|
|
22014
|
+
"anyOf": [
|
|
22015
|
+
{
|
|
22016
|
+
"type": "number",
|
|
22017
|
+
"exclusiveMinimum": 0.0
|
|
22018
|
+
},
|
|
22019
|
+
{
|
|
22020
|
+
"type": "string",
|
|
22021
|
+
"pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
|
|
22022
|
+
}
|
|
22023
|
+
],
|
|
22024
|
+
"title": "Amount",
|
|
22025
|
+
"description": "The amount of tokens to transfer (in token units, not wei).",
|
|
22026
|
+
"example": 100
|
|
22027
|
+
},
|
|
22028
|
+
"action": {
|
|
22029
|
+
"type": "string",
|
|
22030
|
+
"enum": [
|
|
22031
|
+
"DEPOSIT",
|
|
22032
|
+
"WITHDRAW"
|
|
22033
|
+
],
|
|
22034
|
+
"title": "Action",
|
|
22035
|
+
"description": "Whether you are depositing to or withdrawing from your Tokenized Assets Account.",
|
|
22036
|
+
"example": "DEPOSIT"
|
|
22037
|
+
},
|
|
22038
|
+
"gas_sponsorship": {
|
|
22039
|
+
"type": "boolean",
|
|
22040
|
+
"title": "Gas Sponsorship",
|
|
22041
|
+
"description": "Optionally request gas sponsorship. If set to `true`, EIP-712 signature data will be returned that must be signed by the `owner` and submitted to the `/gas_sponsorship/prepare` endpoint.",
|
|
22042
|
+
"example": false
|
|
22043
|
+
},
|
|
22044
|
+
"spender": {
|
|
22045
|
+
"anyOf": [
|
|
22046
|
+
{
|
|
22047
|
+
"type": "string"
|
|
22048
|
+
},
|
|
22049
|
+
{
|
|
22050
|
+
"type": "null"
|
|
22051
|
+
}
|
|
22052
|
+
],
|
|
22053
|
+
"title": "Spender",
|
|
22054
|
+
"description": "The address that will call Permit2's permitTransferFrom to execute the transfer. When `action` is 'DEPOSIT' and `gas_sponsorship` is `true`: - If provided, the signature will authorize this address (typically a gas sponsor) to pull tokens. - If not provided, defaults to the Tokenized Assets Account (Safe) address, allowing the transfer to be included in a bundle transaction where the Safe pulls the tokens itself."
|
|
22055
|
+
}
|
|
22056
|
+
},
|
|
22057
|
+
"type": "object",
|
|
22058
|
+
"required": [
|
|
22059
|
+
"owner",
|
|
22060
|
+
"token",
|
|
22061
|
+
"amount",
|
|
22062
|
+
"action"
|
|
22063
|
+
],
|
|
22064
|
+
"title": "TokenizedAssetsTransferRequest",
|
|
22065
|
+
"example": {
|
|
22066
|
+
"owner": "0x9bDC45AA15FdFFc52E103EA05c260c494A5638f7",
|
|
22067
|
+
"chain": "ethereum",
|
|
22068
|
+
"token": "USDC",
|
|
22069
|
+
"amount": 100,
|
|
22070
|
+
"action": "DEPOSIT"
|
|
22071
|
+
}
|
|
22072
|
+
},
|
|
22073
|
+
"TokenizedAssetsTransferResponse": {
|
|
22074
|
+
"properties": {
|
|
22075
|
+
"transaction": {
|
|
22076
|
+
"anyOf": [
|
|
22077
|
+
{
|
|
22078
|
+
"$ref": "#/components/schemas/UnsignedTransaction"
|
|
22079
|
+
},
|
|
22080
|
+
{
|
|
22081
|
+
"type": "null"
|
|
22082
|
+
}
|
|
22083
|
+
],
|
|
22084
|
+
"description": "Unsigned transaction for direct execution. Present when `gas_sponsorship=false`."
|
|
22085
|
+
},
|
|
22086
|
+
"eip_712": {
|
|
22087
|
+
"anyOf": [
|
|
22088
|
+
{
|
|
22089
|
+
"$ref": "#/components/schemas/BatchedSafeOperationsResponse-Output"
|
|
22090
|
+
},
|
|
22091
|
+
{
|
|
22092
|
+
"$ref": "#/components/schemas/Permit2TypedData-Output"
|
|
22093
|
+
},
|
|
22094
|
+
{
|
|
22095
|
+
"type": "null"
|
|
22096
|
+
}
|
|
22097
|
+
],
|
|
22098
|
+
"title": "Eip 712",
|
|
22099
|
+
"description": "EIP-712 typed data for gas-sponsored execution. Present when `gas_sponsorship=true`. A Permit2 `PermitTransferFrom` for DEPOSIT, or a Safe transaction for WITHDRAW. The owner signs it and submits to `/v2/gas_sponsorship/prepare`."
|
|
22100
|
+
}
|
|
22101
|
+
},
|
|
22102
|
+
"type": "object",
|
|
22103
|
+
"title": "TokenizedAssetsTransferResponse"
|
|
22104
|
+
},
|
|
21941
22105
|
"TransactionResponse": {
|
|
21942
22106
|
"properties": {
|
|
21943
22107
|
"transaction": {
|