Transactions
Unsigned transactions for the user's own wallet to sign.
#Build a supply transaction
/v1/tx/supplyReturns the unsigned transaction(s) for the user's wallet to send, in order (an ERC-20 approval first when needed). The action is simulated first: if it would revert, the API answers 422 ACTION_NOT_ALLOWED with the reasons instead of handing out a transaction that would fail.
Request body
accountrequired | string the wallet that will sign |
assetrequired | string token address or symbol |
amountrequired | string Token amount in base units |
onBehalfOf | string EVM address |
Response
stepsrequired | object[] Unsigned transactions for the user's wallet, to be sent in order |
steps[].kindrequired | string |
steps[].chainIdrequired | number |
steps[].torequired | string EVM address |
steps[].datarequired | string |
steps[].valuerequired | string |
steps[].descriptionrequired | string |
previewrequired | object |
preview.actionrequired | string |
preview.assetrequired | string EVM address |
preview.symbolrequired | string |
preview.amountrequired | string Token amount in base units |
preview.allowedrequired | boolean |
preview.problemsrequired | string[] why the action would fail, as stable codes |
preview.beforerequired | object |
preview.afterrequired | object |
Errors
curl -X POST "https://aethr-api.vercel.app/v1/tx/supply" \
-H "content-type: application/json" \
-d '{"account":"0x7a3F00000000000000000000000000000000c91E","asset":"WHYPE","amount":"1000000","onBehalfOf":"0x7a3F00000000000000000000000000000000c91E"}'{
"steps": [
{
"kind": "string",
"chainId": 0,
"to": "string",
"data": "0x…",
"value": "string",
"description": "string"
}
],
"preview": {
"action": "string",
"asset": "WHYPE",
"symbol": "WHYPE",
"amount": "1000000",
"allowed": true,
"problems": [
"string"
],
"before": {
"healthFactor": "0.0425",
"status": "no_debt",
"collateralUsd": "62.4317",
"debtUsd": "62.4317",
"borrowLimitUsd": "62.4317",
"liquidationLimitUsd": "62.4317",
"borrowLimitUsedBps": 6000,
"netWorthUsd": "62.4317",
"executableCollateralUsd": "62.4317",
"pricesFresh": true
},
"after": {
"healthFactor": "0.0425",
"status": "no_debt",
"collateralUsd": "62.4317",
"debtUsd": "62.4317",
"borrowLimitUsd": "62.4317",
"liquidationLimitUsd": "62.4317",
"borrowLimitUsedBps": 6000,
"netWorthUsd": "62.4317",
"executableCollateralUsd": "62.4317",
"pricesFresh": true
}
}
}#Build a withdraw transaction
/v1/tx/withdrawReturns the unsigned transaction(s) for the user's wallet to send, in order (an ERC-20 approval first when needed). The action is simulated first: if it would revert, the API answers 422 ACTION_NOT_ALLOWED with the reasons instead of handing out a transaction that would fail. Use "amount": "max" to withdraw everything.
Request body
accountrequired | string the wallet that will sign |
assetrequired | string token address or symbol |
amountrequired | string | "max" Token amount in base units, or "max" for the whole balance |
to | string EVM address |
Response
stepsrequired | object[] Unsigned transactions for the user's wallet, to be sent in order |
steps[].kindrequired | string |
steps[].chainIdrequired | number |
steps[].torequired | string EVM address |
steps[].datarequired | string |
steps[].valuerequired | string |
steps[].descriptionrequired | string |
previewrequired | object |
preview.actionrequired | string |
preview.assetrequired | string EVM address |
preview.symbolrequired | string |
preview.amountrequired | string Token amount in base units |
preview.allowedrequired | boolean |
preview.problemsrequired | string[] why the action would fail, as stable codes |
preview.beforerequired | object |
preview.afterrequired | object |
Errors
curl -X POST "https://aethr-api.vercel.app/v1/tx/withdraw" \
-H "content-type: application/json" \
-d '{"account":"0x7a3F00000000000000000000000000000000c91E","asset":"WHYPE","amount":"1000000","to":"string"}'{
"steps": [
{
"kind": "string",
"chainId": 0,
"to": "string",
"data": "0x…",
"value": "string",
"description": "string"
}
],
"preview": {
"action": "string",
"asset": "WHYPE",
"symbol": "WHYPE",
"amount": "1000000",
"allowed": true,
"problems": [
"string"
],
"before": {
"healthFactor": "0.0425",
"status": "no_debt",
"collateralUsd": "62.4317",
"debtUsd": "62.4317",
"borrowLimitUsd": "62.4317",
"liquidationLimitUsd": "62.4317",
"borrowLimitUsedBps": 6000,
"netWorthUsd": "62.4317",
"executableCollateralUsd": "62.4317",
"pricesFresh": true
},
"after": {
"healthFactor": "0.0425",
"status": "no_debt",
"collateralUsd": "62.4317",
"debtUsd": "62.4317",
"borrowLimitUsd": "62.4317",
"liquidationLimitUsd": "62.4317",
"borrowLimitUsedBps": 6000,
"netWorthUsd": "62.4317",
"executableCollateralUsd": "62.4317",
"pricesFresh": true
}
}
}#Build a borrow transaction
/v1/tx/borrowReturns the unsigned transaction(s) for the user's wallet to send, in order (an ERC-20 approval first when needed). The action is simulated first: if it would revert, the API answers 422 ACTION_NOT_ALLOWED with the reasons instead of handing out a transaction that would fail.
Request body
accountrequired | string the wallet that will sign |
assetrequired | string token address or symbol |
amountrequired | string Token amount in base units |
to | string EVM address |
Response
stepsrequired | object[] Unsigned transactions for the user's wallet, to be sent in order |
steps[].kindrequired | string |
steps[].chainIdrequired | number |
steps[].torequired | string EVM address |
steps[].datarequired | string |
steps[].valuerequired | string |
steps[].descriptionrequired | string |
previewrequired | object |
preview.actionrequired | string |
preview.assetrequired | string EVM address |
preview.symbolrequired | string |
preview.amountrequired | string Token amount in base units |
preview.allowedrequired | boolean |
preview.problemsrequired | string[] why the action would fail, as stable codes |
preview.beforerequired | object |
preview.afterrequired | object |
Errors
curl -X POST "https://aethr-api.vercel.app/v1/tx/borrow" \
-H "content-type: application/json" \
-d '{"account":"0x7a3F00000000000000000000000000000000c91E","asset":"WHYPE","amount":"1000000","to":"string"}'{
"steps": [
{
"kind": "string",
"chainId": 0,
"to": "string",
"data": "0x…",
"value": "string",
"description": "string"
}
],
"preview": {
"action": "string",
"asset": "WHYPE",
"symbol": "WHYPE",
"amount": "1000000",
"allowed": true,
"problems": [
"string"
],
"before": {
"healthFactor": "0.0425",
"status": "no_debt",
"collateralUsd": "62.4317",
"debtUsd": "62.4317",
"borrowLimitUsd": "62.4317",
"liquidationLimitUsd": "62.4317",
"borrowLimitUsedBps": 6000,
"netWorthUsd": "62.4317",
"executableCollateralUsd": "62.4317",
"pricesFresh": true
},
"after": {
"healthFactor": "0.0425",
"status": "no_debt",
"collateralUsd": "62.4317",
"debtUsd": "62.4317",
"borrowLimitUsd": "62.4317",
"liquidationLimitUsd": "62.4317",
"borrowLimitUsedBps": 6000,
"netWorthUsd": "62.4317",
"executableCollateralUsd": "62.4317",
"pricesFresh": true
}
}
}#Build a repay transaction
/v1/tx/repayReturns the unsigned transaction(s) for the user's wallet to send, in order (an ERC-20 approval first when needed). The action is simulated first: if it would revert, the API answers 422 ACTION_NOT_ALLOWED with the reasons instead of handing out a transaction that would fail. Use "amount": "max" to clear the whole debt, including interest that accrues before it is mined.
Request body
accountrequired | string the wallet that will sign |
assetrequired | string token address or symbol |
amountrequired | string | "max" Token amount in base units, or "max" for the whole balance |
onBehalfOf | string EVM address |
Response
stepsrequired | object[] Unsigned transactions for the user's wallet, to be sent in order |
steps[].kindrequired | string |
steps[].chainIdrequired | number |
steps[].torequired | string EVM address |
steps[].datarequired | string |
steps[].valuerequired | string |
steps[].descriptionrequired | string |
previewrequired | object |
preview.actionrequired | string |
preview.assetrequired | string EVM address |
preview.symbolrequired | string |
preview.amountrequired | string Token amount in base units |
preview.allowedrequired | boolean |
preview.problemsrequired | string[] why the action would fail, as stable codes |
preview.beforerequired | object |
preview.afterrequired | object |
Errors
curl -X POST "https://aethr-api.vercel.app/v1/tx/repay" \
-H "content-type: application/json" \
-d '{"account":"0x7a3F00000000000000000000000000000000c91E","asset":"WHYPE","amount":"1000000","onBehalfOf":"0x7a3F00000000000000000000000000000000c91E"}'{
"steps": [
{
"kind": "string",
"chainId": 0,
"to": "string",
"data": "0x…",
"value": "string",
"description": "string"
}
],
"preview": {
"action": "string",
"asset": "WHYPE",
"symbol": "WHYPE",
"amount": "1000000",
"allowed": true,
"problems": [
"string"
],
"before": {
"healthFactor": "0.0425",
"status": "no_debt",
"collateralUsd": "62.4317",
"debtUsd": "62.4317",
"borrowLimitUsd": "62.4317",
"liquidationLimitUsd": "62.4317",
"borrowLimitUsedBps": 6000,
"netWorthUsd": "62.4317",
"executableCollateralUsd": "62.4317",
"pricesFresh": true
},
"after": {
"healthFactor": "0.0425",
"status": "no_debt",
"collateralUsd": "62.4317",
"debtUsd": "62.4317",
"borrowLimitUsd": "62.4317",
"liquidationLimitUsd": "62.4317",
"borrowLimitUsedBps": 6000,
"netWorthUsd": "62.4317",
"executableCollateralUsd": "62.4317",
"pricesFresh": true
}
}
}#Enable or disable an asset as collateral
/v1/tx/collateralReturns the unsigned transaction(s) for the user's wallet to send, in order (an ERC-20 approval first when needed). The action is simulated first: if it would revert, the API answers 422 ACTION_NOT_ALLOWED with the reasons instead of handing out a transaction that would fail.
Request body
accountrequired | string the wallet that will sign |
assetrequired | string token address or symbol |
enabledrequired | boolean |
Response
stepsrequired | object[] Unsigned transactions for the user's wallet, to be sent in order |
steps[].kindrequired | string |
steps[].chainIdrequired | number |
steps[].torequired | string EVM address |
steps[].datarequired | string |
steps[].valuerequired | string |
steps[].descriptionrequired | string |
previewrequired | object |
preview.actionrequired | string |
preview.assetrequired | string EVM address |
preview.symbolrequired | string |
preview.amountrequired | string Token amount in base units |
preview.allowedrequired | boolean |
preview.problemsrequired | string[] why the action would fail, as stable codes |
preview.beforerequired | object |
preview.afterrequired | object |
Errors
curl -X POST "https://aethr-api.vercel.app/v1/tx/collateral" \
-H "content-type: application/json" \
-d '{"account":"0x7a3F00000000000000000000000000000000c91E","asset":"WHYPE","enabled":true}'{
"steps": [
{
"kind": "string",
"chainId": 0,
"to": "string",
"data": "0x…",
"value": "string",
"description": "string"
}
],
"preview": {
"action": "string",
"asset": "WHYPE",
"symbol": "WHYPE",
"amount": "1000000",
"allowed": true,
"problems": [
"string"
],
"before": {
"healthFactor": "0.0425",
"status": "no_debt",
"collateralUsd": "62.4317",
"debtUsd": "62.4317",
"borrowLimitUsd": "62.4317",
"liquidationLimitUsd": "62.4317",
"borrowLimitUsedBps": 6000,
"netWorthUsd": "62.4317",
"executableCollateralUsd": "62.4317",
"pricesFresh": true
},
"after": {
"healthFactor": "0.0425",
"status": "no_debt",
"collateralUsd": "62.4317",
"debtUsd": "62.4317",
"borrowLimitUsd": "62.4317",
"liquidationLimitUsd": "62.4317",
"borrowLimitUsedBps": 6000,
"netWorthUsd": "62.4317",
"executableCollateralUsd": "62.4317",
"pricesFresh": true
}
}
}#Build a rewards claim transaction
/v1/tx/claim-rewardsClaims everything currently claimable for one reward kind and token. Anyone may submit it; the tokens always go to account.
Request body
accountrequired | string EVM address |
kindrequired | "yield_booster" | "borrow_rebates" |
tokenrequired | string |
Response
stepsrequired | object[] Unsigned transactions for the user's wallet, to be sent in order |
steps[].kindrequired | string |
steps[].chainIdrequired | number |
steps[].torequired | string EVM address |
steps[].datarequired | string |
steps[].valuerequired | string |
steps[].descriptionrequired | string |
previewrequired | object |
preview.actionrequired | string |
preview.assetrequired | string EVM address |
preview.symbolrequired | string |
preview.amountrequired | string Token amount in base units |
preview.allowedrequired | boolean |
preview.problemsrequired | string[] why the action would fail, as stable codes |
preview.beforerequired | object |
preview.afterrequired | object |
Errors
curl -X POST "https://aethr-api.vercel.app/v1/tx/claim-rewards" \
-H "content-type: application/json" \
-d '{"account":"0x7a3F00000000000000000000000000000000c91E","kind":"yield_booster","token":"0x7a3F00000000000000000000000000000000c91E"}'{
"steps": [
{
"kind": "string",
"chainId": 0,
"to": "string",
"data": "0x…",
"value": "string",
"description": "string"
}
],
"preview": {
"action": "string",
"asset": "WHYPE",
"symbol": "WHYPE",
"amount": "1000000",
"allowed": true,
"problems": [
"string"
],
"before": {
"healthFactor": "0.0425",
"status": "no_debt",
"collateralUsd": "62.4317",
"debtUsd": "62.4317",
"borrowLimitUsd": "62.4317",
"liquidationLimitUsd": "62.4317",
"borrowLimitUsedBps": 6000,
"netWorthUsd": "62.4317",
"executableCollateralUsd": "62.4317",
"pricesFresh": true
},
"after": {
"healthFactor": "0.0425",
"status": "no_debt",
"collateralUsd": "62.4317",
"debtUsd": "62.4317",
"borrowLimitUsd": "62.4317",
"liquidationLimitUsd": "62.4317",
"borrowLimitUsedBps": 6000,
"netWorthUsd": "62.4317",
"executableCollateralUsd": "62.4317",
"pricesFresh": true
}
}
}