Create Exchange Swap

Create a swap request from a specific wallet.

Create a Swap Through an Exchange Wallet

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

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Body (WithdrawalCreateInput) object

Name
Type
Description

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:

Name
Type
Description

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