diff --git a/src/pages/docs/routes/fx.mdx b/src/pages/docs/routes/fx.mdx index 8c06fe5b..9515291e 100644 --- a/src/pages/docs/routes/fx.mdx +++ b/src/pages/docs/routes/fx.mdx @@ -68,9 +68,13 @@ 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. - + Show the source amount, the destination amount, and `destinationAmountMin`. Create the transfer before `quote.expiresAt`. @@ -78,7 +82,25 @@ Show the source amount, the destination amount, and `destinationAmountMin`. Crea Send the same inputs with an [idempotency key](/docs/routes/api-setup#set-idempotency-keys). - +```bash [Terminal] +curl 'https://api.tempo.xyz/v1/routes/transfers' \ + --request POST \ + --header "tempo-api-key: $TEMPO_API_KEY" \ + --header 'idempotency-key: ' \ + --header 'Content-Type: application/json' \ + --data '{ + "sourceChain": "tempo", + "sourceToken": "0x20c0000000000000000000006a37da5c996874be", + "destinationChain": "tempo", + "destinationToken": "0x20c0000000000000000000001621e21f71cf12fb", + "sender": "", + "recipient": "", + "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. @@ -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": "", - "action": { - "type": "setMembers", - "tokens": ["", ""], - "accounts": [""], - "allowed": true - } -} +```bash [Terminal] +curl 'https://api.tempo.xyz/v1/prop-amms//access/prepare' \ + --request POST \ + --header "tempo-api-key: $TEMPO_API_KEY" \ + --header 'Content-Type: application/json' \ + --data '{ + "sender": "", + "action": { + "type": "setMembers", + "tokens": ["", ""], + "accounts": [""], + "allowed": true + } + }' ``` - - 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`.