diff --git a/pages/bundler-api/actions/_meta.json b/pages/bundler-api/actions/_meta.json index 4c865bc..7dfca96 100644 --- a/pages/bundler-api/actions/_meta.json +++ b/pages/bundler-api/actions/_meta.json @@ -1,13 +1,13 @@ { "route": "Route", "deposit": "Deposit", + "approve": "Approve", + "transfer": "Transfer", + "transferFrom": "TransferFrom", + "permitTransferFrom": "Permit TransferFrom", "harvest": "Harvest", "borrow": "Borrow", "repay": "Repay", "redeem": "Redeem", - "swap": "Swap", - "transfer": "Transfer", - "withdraw": "Withdraw", - "approve": "Approve", - "permitTransferFrom": "Permit TransferFrom" + "withdraw": "Withdraw" } diff --git a/pages/bundler-api/actions/approve.mdx b/pages/bundler-api/actions/approve.mdx index 4f0f61c..0c3c754 100644 --- a/pages/bundler-api/actions/approve.mdx +++ b/pages/bundler-api/actions/approve.mdx @@ -1,3 +1,48 @@ # Approve -Available in endpoint. Docs coming soon... \ No newline at end of file +Approve an address to spend tokens + +Arguments: +| name | Description | Example | +| ------- | --------------- | -------------------------- | +| `token` | Address of the token to approve | token=0x6b175474e8909... | +| `spender` | Address of the spender | spender=0x6b175474e8909... | +| `amount` | Raw amount to approve | amount=100000000000 | + +## Example + +Body: + +```json +[ + { + "action": "approve", + "args": { + "token": "0xd26114cd6EE289AccF82350c8d8487fedB8A0C07", + "spender": "0x80eba3855878739f4710233a8a19d89bdd2ffb8e", + "amount": "1000000000000000000000000" + } + } +] +``` + +Curl: + +```bash copy +curl -X 'POST' \ + 'https://api.enso.finance/api/v1/shortcuts/bundle?chainId=1&fromAddress=0xd8da6bf26964af9d7eed9e03e53415d37aa96045' \ + -H 'accept: */*' \ + -H 'Content-Type: application/json' \ + -d '[ + { + "protocol": "enso", + "action": "approve", + "args": { + "token": "0xd26114cd6EE289AccF82350c8d8487fedB8A0C07", + "spender": "0x80eba3855878739f4710233a8a19d89bdd2ffb8e", + "amount": "1000000000000000000000000" + } + } +]' +``` + diff --git a/pages/bundler-api/actions/permitTransferFrom.mdx b/pages/bundler-api/actions/permitTransferFrom.mdx index 8037423..cf78ebd 100644 --- a/pages/bundler-api/actions/permitTransferFrom.mdx +++ b/pages/bundler-api/actions/permitTransferFrom.mdx @@ -1,3 +1,33 @@ # Permit TransferFrom -Available in endpoint. Docs coming soon... \ No newline at end of file +Approve and transfer a token that supports permit to a specific address. +A permit signature needs to be generated offchain and passed to the API. + +Arguments: +| name | Description | Example | +| ------- | --------------- | -------------------------- | +| `token` | Address of the token to approve | token=0x6b175474e8909... | +| `nonce` | The nonce to prevent signature replays | nonce=1 | +| `deadline` | The deadline on the permit signature | deadline=1710150268| +| `signature` | The permit signature| | +| `amount` | Raw amount to transfer | amount=100000000000 | + +## Example + +Body: + +```json +[ + { + "action": "transfer", + "args": { + "token": "0xd26114cd6EE289AccF82350c8d8487fedB8A0C07", + "nonce": "1", + "deadline": "1710150268", + "signature": "0x..", + "amount": "1000000000000000000000000" + } + } +] +``` + diff --git a/pages/bundler-api/actions/transfer.mdx b/pages/bundler-api/actions/transfer.mdx index dabf19c..b83c723 100644 --- a/pages/bundler-api/actions/transfer.mdx +++ b/pages/bundler-api/actions/transfer.mdx @@ -1,3 +1,49 @@ # Transfer -Available in endpoint. Docs coming soon... +Transfer one or more tokens to a specific address. + +Arguments: +| name | Description | Example | +| ------- | --------------- | -------------------------- | +| `token` | Address of the token | token=0x6b175474e8909... | +| `recipient` | Address of the recipient | spender=0x6b175474e8909... | +| `amount` | Raw amount to transfer | amount=100000000000 | + + +## Example + +Body: + +```json +[ + { + "action": "transfer", + "args": { + "token": "0xd26114cd6EE289AccF82350c8d8487fedB8A0C07", + "recipient": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045", + "amount": "1000000000000000000000000" + } + } +] +``` + +Curl: + +```bash copy +curl -X 'POST' \ + 'https://api.enso.finance/api/v1/shortcuts/bundle?chainId=1&fromAddress=0xd8da6bf26964af9d7eed9e03e53415d37aa96045' \ + -H 'accept: */*' \ + -H 'Content-Type: application/json' \ + -d '[ + { + "protocol": "enso", + "action": "transfer", + "args": { + "token": "0xd26114cd6EE289AccF82350c8d8487fedB8A0C07", + "recipient": "0x80eba3855878739f4710233a8a19d89bdd2ffb8e", + "amount": "1000000000000000000000000" + } + } +]' +``` + diff --git a/pages/bundler-api/actions/transferFrom.mdx b/pages/bundler-api/actions/transferFrom.mdx new file mode 100644 index 0000000..ada5e03 --- /dev/null +++ b/pages/bundler-api/actions/transferFrom.mdx @@ -0,0 +1,52 @@ +# Transfer From + +TransferFrom one or more tokens to a specific address. + +Arguments: +| name | Description | Example | +| ------- | --------------- | -------------------------- | +| `token` | Address of the token | token=0x6b175474e8909... | +| `spender` | Address of the spender | token=0x6b175474e8909... | +| `recipient` | Address of the recipient | spender=0x6b175474e8909... | +| `amount` | Raw amount to transfer | amount=100000000000 | + +Note: Spender must have approved the amount to be transferred. +## Example + +Body: + +```json +[ + { + "action": "transfer", + "args": { + "token": "0xd26114cd6EE289AccF82350c8d8487fedB8A0C07", + "recipient": "0x93621DCA56fE26Cdee86e4F6B18E116e9758Ff11", + "spender": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045", + "amount": "1000000000000000000000000" + } + } +] +``` + +Curl: + +```bash copy +curl -X 'POST' \ + 'https://api.enso.finance/api/v1/shortcuts/bundle?chainId=1&fromAddress=0xd8da6bf26964af9d7eed9e03e53415d37aa96045' \ + -H 'accept: */*' \ + -H 'Content-Type: application/json' \ + -d '[ + { + "protocol": "enso", + "action": "transfer", + "args": { + "token": "0xd26114cd6EE289AccF82350c8d8487fedB8A0C07", + "recipient": "0x93621DCA56fE26Cdee86e4F6B18E116e9758Ff11", + "spender": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045", + "amount": "1000000000000000000000000" + } + } +]' +``` +