Create Swap Request

Create a swap request from a specific wallet.

Create a Swap

Initiate a mutation to create an assets swap request for approval, from one of your organization's exchange wallets

Please note that all is applicable only for exchange wallet swaps.

mutation CreateSwap($data: SwapCreateInput!) {
  createSwap(data: $data) {
    id
    amount
    fee
    orderType
  }
}

Headers

NameValue

Content-Type

application/json

Authorization

Bearer <token>

Body (WithdrawalCreateInput) object

NameTypeDescription

amount*

Integer

Swap Amount

financialAsset*

String

Coin to swap

swapAssetTo*

String

Coin to swap to

walletId*

String

Wallet ID

Example body:

{
  "data": {
    "amount": 0.0051,
    "financialAsset": {
      "id": "clefn78h5012plc6rxbmofnop"
    },
    "swapAssetTo": {
      "id": "clefn78gv011olc6rcwtt0wel"
    },
    "wallet": {
      "id": "clp5bm4f1002icg01d526dgw9"
    }
  }
}

Response

Return values:

NameTypeDescription

id

String

Swap ID

amount

Integer

Swap Amount

fee

Integer

Fee Amount

orderType

String

Type of the order (Market/Limit) (will always be market)

{
	"data": {
		"createSwap": {
			"id": "clph3mik5000t8f01qqr0ol74",
			"amount": 0.0051,
			"fee": null,
			"orderType": "Market"
		}
	}
}

Try it out!

Last updated