LogoLogo
WebsiteLoginStatus
API Reference
API Reference
  • Introduction
  • Introduction to GraphQL
    • What is GraphQL?
      • GraphQL Schema
      • Example Using GraphQL
    • Authentication
    • Queries
      • Example Query
    • Mutations
      • Example Mutation
    • Variables
    • Fields
  • Develop With inabit API
    • Getting Started
      • Authentication
      • inabit Postman Collection
    • Organizations
      • Organization Info
      • Organization ID
      • Organization Users
      • Organization Contacts
      • Organization Transactions
    • Wallets
      • Wallets Info
      • Create inabit Wallet
      • Edit Wallet Name
      • Generate Deposit Address
      • Fetch Deposit Address
      • Save Address to Whitelist
      • Archive / Unarchive Wallet
      • Disconnect Exchange Wallet
    • Contacts
      • Contact Info
      • Create New Contact
      • Update Contact
    • Transactions
      • Transaction Info
      • Create Transfer Request
      • Create Off Ramp Request
      • Create On Ramp Request
      • Create Exchange Swap
      • Create inabit Wallet Swap
      • Edit Transaction Note
    • Utilities
      • Fetch Financial Asset
      • Fetch Blockchains
  • Remote Approver App
    • Setup and Configuration
    • API Wallets Generation
    • Automate Signing Transactions
    • Webhooks
      • Notification Types
  • WHAT WE SUPPORT
    • Assets & Tokens
    • Blockchains
    • Exchanges
      • Binance
      • Kucoin
      • Kraken
  • Changelog
Powered by GitBook
On this page
  • Create a Swap in an inabit Wallet
  • Headers
  • Body (WithdrawalCreateInput) object
  • Response
  • Try it out!

Was this helpful?

Export as PDF
  1. Develop With inabit API
  2. Transactions

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,
		}
	}
}
{
  "errors": [
    {
      "code": "OPERATION_FAILED",
      "message": "No InabitWalletSupportedPair found",
      "path": [
        "createInabitWalletSwap"
      ],
      "extensions": {
        "code": "OPERATION_FAILED",
        "message": "No InabitWalletSupportedPair found"
      }
    }
  ],
  "data": null
}

Try it out!

PreviousCreate Exchange SwapNextEdit Transaction Note

Last updated 7 months ago

Was this helpful?

Apollo Studio