Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 39 additions & 15 deletions src/pages/docs/routes/fx.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,39 @@ Without a saved list, the request returns `400` with code `propamm_invalid`. If

### Get a quote

Send the account as both `sender` and `recipient`. Amounts are in base units. Routes quotes under your organization's list, so the request names no pool or list.
Send your listed account as both `sender` and `recipient`, in place of the example's `0x2222…2222`. Amounts are in base units. Routes quotes under your organization's list, so the request names no pool or list.

<OpenApi.Playground operationId="quoteRoutesTransfer" anchors={false} />
<OpenApi.Playground
operationId="quoteRoutesTransfer"
query="sourceChain=tempo&sourceToken=0x20c0000000000000000000006a37da5c996874be&destinationChain=tempo&destinationToken=0x20c0000000000000000000001621e21f71cf12fb&sender=0x2222222222222222222222222222222222222222&recipient=0x2222222222222222222222222222222222222222&amount=1000000&mode=exactSource"
Comment thread
claude[bot] marked this conversation as resolved.
Resolved
anchors={false}
/>

Show the source amount, the destination amount, and `destinationAmountMin`. Create the transfer before `quote.expiresAt`.

### Create the transfer

Send the same inputs with an [idempotency key](/docs/routes/api-setup#set-idempotency-keys).

<OpenApi.Playground operationId="createRoutesTransfer" anchors={false} />
```bash [Terminal]
curl 'https://api.tempo.xyz/v1/routes/transfers' \
--request POST \
--header "tempo-api-key: $TEMPO_API_KEY" \
--header 'idempotency-key: <IDEMPOTENCY_KEY>' \
--header 'Content-Type: application/json' \
--data '{
"sourceChain": "tempo",
"sourceToken": "0x20c0000000000000000000006a37da5c996874be",
"destinationChain": "tempo",
"destinationToken": "0x20c0000000000000000000001621e21f71cf12fb",
"sender": "<ACCOUNT_ADDRESS>",
"recipient": "<ACCOUNT_ADDRESS>",
"amount": "1000000",
"mode": "exactSource"
}'
```

This request swaps 1 OUSD for EURC.e from one account to itself.

Save the transfer `id` and its `action`. For an exact-source swap, `action.calls` holds two calls. The first approves the source stablecoin. The second swaps it.

Expand Down Expand Up @@ -112,20 +134,22 @@ A list has one admin account. The admin adds or removes up to 50 accounts in one

Send the list's admin account as `sender`. Name the pair by its two token addresses, in either order.

```json
{
"sender": "<LIST_ADMIN_ADDRESS>",
"action": {
"type": "setMembers",
"tokens": ["<SOURCE_TOKEN_ADDRESS>", "<DESTINATION_TOKEN_ADDRESS>"],
"accounts": ["<ACCOUNT_ADDRESS>"],
"allowed": true
}
}
```bash [Terminal]
curl 'https://api.tempo.xyz/v1/prop-amms/<POOL_ADDRESS>/access/prepare' \
--request POST \
--header "tempo-api-key: $TEMPO_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"sender": "<LIST_ADMIN_ADDRESS>",
"action": {
"type": "setMembers",
"tokens": ["<SOURCE_TOKEN_ADDRESS>", "<DESTINATION_TOKEN_ADDRESS>"],
"accounts": ["<ACCOUNT_ADDRESS>"],
"allowed": true
}
}'
```

<OpenApi.Playground operationId="preparePropAmmAccess" anchors={false} />

The API applies the change to your organization's saved list. It simulates the change and returns an unsigned `transaction`. `effect` names the resolved pair index and sponsor ID, such as `List 1 account(s) on pair 0 under sponsor 5.`

To remove accounts, send the same request with `"allowed": false`.
Expand Down
Loading