Create inabit Wallet Swap
Create a swap request from a specific wallet.
Create a Swap in an inabit Wallet
Initiate a mutation to create an assets swap request for approval, from one of your organization's inabit wallets:
Please note that this mutation is applicable only for inabit wallets.
mutation CreateInabitWalletSwap($data: InabitWalletSwapCreateInput!) {
createInabitWalletSwap(data: $data) {
id
amount
fee
orderType
}
}
Headers
Name
Value
Content-Type
application/json
Authorization
Bearer <token>
Body (WithdrawalCreateInput) object
Name
Type
Description
amount*
Integer
Swap Amount
financialAsset*
String
ID of Swapped From Asset
swapAssetTo*
String
ID of Swapped To Asset
walletId*
String
inabit Wallet ID
note
String
Internal Note on the Swap
isAccelerated
boolean
Always keep as null
Example body:
{
"data": {
"amount": 0.0051,
"blockchain": {
"id": "" // FILL WITH CORRECT ID
},
"financialAsset": {
"id": "clefn78h5012plc6rxbmofnop"
},
"note": null,
"swapToBlockchain": {
"id": "" // FILL WITH CORRECT ID
},
"swapAssetTo": {
"id": "clefn78gv011olc6rcwtt0wel"
},
"wallet": {
"id": "clp5bm4f1002icg01d526dgw9"
},
"isAccelerated": null,
}
}
Response
Return values:
Name
Type
Description
id
String
Swap ID
amount
Integer
Swap Amount
fee
Integer
Fee Amount (in Native Asset of the "From Asset")
{
"data": {
"createSwap": {
"id": "clph3mik5000t8f01qqr0ol74",
"amount": 0.0051,
"fee": 0.0014,
}
}
}
Try it out!
Last updated
Was this helpful?