inabit x Crypto Clearing Services
An example use case of how inabit's API Infrastructure is utilized
Last updated
An example use case of how inabit's API Infrastructure is utilized
Last updated
Welcome to the comprehensive guide on leveraging inabit's digital wallet infrastructure. As a digital wallet infrastructure provider, inabit is dedicated to streamlining operations for clearing services like yours. This guide will walk you through the seamless integration and management of your digital wallet operations, ensuring security, efficiency, and scalability.
Before diving into the setup, ensure you have:
Have an API Admin user created for your organization in inabit.
Access to the inabit platform (as the Clearer):
Have an account ready to be used.
Create an inabit "Main" wallet via the platform's UI.
This wallet will serve as the funding route for the Clearer.
Create an additional inabit wallet and deposit funds for fee:
If you're clearing Ethereum / tokens in Ethereum chain - deposit ETH.
If you're clearing in TRON / tokens in TRON chain - deposit TRX. (and so on, refer to Supported Blockchains)
Necessary access permissions setup.
Eligible roles - Owner / Admin / API Admin.
🚧 One-time Must-Have Setup:Please ensure that you complete the Approvals Docker Configuration and execute the API signer Setup as a one-time prerequisite. Once this step is accomplished, you will be able to create your API wallets and addresses as needed.
We highly advise taking a look at the following guides as you develop your crypto clearing application with inabit:
API Login Access / Authentication
Create Transfer Requests in API
Create API wallet addresses
Remote & Automatic Approvals (Docker Configuration)
Automate Signing Transactions
Receive Webhooks on Transaction Events
The architectural diagram depicts the wallet infrastructure utilizing Inabit for clearers (Clearing service providers). The process primarily involves customer actions and the reception of API information. Below is a breakdown of the workflow outlined in the diagram:
Clearer initiates a request to inabit's API to generate a dedicated deposit address (API wallet) for the customer (step 1 in the flow).
Refer to the first section below to learn how to generate API wallet addresses.
inabit also sends a new transaction event webhook to the clearer during this time.
The clearer issues a withdrawal from the inabit wallet that contains native assets (for fee payment purposes) and transfers the "gas" to the desired customer API wallet (API wallet F in this case) (step 3)
Now that the flow is clear, let's review the implementation process step by step! ✨
The clearing service (clearer) develops a logic that on every crypto deposit request their customer makes, a new inabit API wallet and address are created.
The clearer then saves this API walletId
to associate it with their customer in the clearer's database.
In order to generate the API wallet address for the customer's deposit, call the following mutation:
Remember to authenticate to call our graphQL API using an access token (bearer) with your API Admin credentials. (If you're not sure how, refer to Authentication)
Don't have an API Admin/API Signer yet? contact us at support@inabit.com to create one!
CreateApiWalletAddress Mutation:
Name | Type | Description |
---|---|---|
blockchainId* | string | ID of the blockchain in inabit |
financialAssetId* | string | ID of the financial asset in inabit (can be token/native) |
organizationId* | string | ID of the organization in inabit |
Example body:
In the mutation's response, you should receive the deposit address for the blockchain and asset you've requested, as well as the inabit API wallet ID for the customer (which you can later save and relate to the specific customer, in order to identify a customer's inabit API wallet).
Reminder - You can always query data and fetch all API wallets & their blockchain address in your organization when needed. Refer to Wallets Info.
In order to receive a notification that the customer sent funds successfully to their inabit API wallet address, you will need to register to our webhook subscription service and create a subscription for your organization.
Please refer to Webhooks and Notifications 📣 for further information.
Once the clearer (you) receives a successful webhook for a received transaction in the customer's wallet (status update that txn was successful and funds are in the customer's wallet)
The clearer should issue an additional transfer from the wallet intended for fees, to the customer's wallet in order be able to withdraw the customer's deposited funds.
This step is applicable only in cases where the user transfers tokens, native blockchain assets can be transferred if they complete a sufficient amount to pay for the transaction fee.
Take this into consideration when transferring funds from your "fees" wallet.
Let's put this into an actual example:
Customer transfers USDT in Ethereum blockchain.
Clearer (you) receives transaction webhook that it was completed.
Clearer (you) initiates a withdrawal for Ethereum from the fees API wallet to the designated customer wallet, in order to withdraw the funds afterwards. (step 4)
How to Withdraw/Transfer Gas Funds to the Customers Wallet?
Name | Type | Description |
---|---|---|
walletId* | String | Wallet ID |
financialAssetId* | String | Asset ID |
address* | String | From Address (Source) |
amount* | Integer | Transfer amount |
blockchainId* | String | Blockchain ID |
note | String | Transaction Note |
priority | String | Transaction Priority (Slow, medium, fast, etc.) |
Example body:
In the mutation's response, you should receive the withdrawal ID.
🚧 Approval RequiredNote that withdrawals will require an approval. In this case, approvals are given automatically according to the logic decided by the clearer (you), through the automatic approvals application (docker).
If you feel like you've missed this step, please check prerequisite once more and refer to our additional reference section at the beginning of the page.
Now that the customer's API wallet has enough funds for fee, the final step of the flow would be to send the crypto amount deposited by the customer - to the clearer's (you) "main" wallet. (that we created as a prerequisite.
This step would require an additional withdrawal mutation to be called upon, but this time using the customer's walletId
with the financialAssetId
of the deposited crypto, and to the destination address in the main wallet.
🚧 Approval RequiredOnce again, approvals in this step are happening automatically according to the logic decided by the clearer, within the automatic approvals application (docker).
If you feel like you've missed this step, please check prerequisite once more and refer to our additional reference section at the beginning of the page.
Your clearing service, powered by our infrastructure, is fully operational, functional, and secure!
If you encounter any challenges in the process or need further clarification on any aspect, please don't hesitate to reach out to us at support@inabit.com.
Customer (Clearer's customer)
Customer is requesting to deposit funds in crypto and be credited with balance in the clearer's application.
The Clearer fetches the address and displays it in the Clearing Service UI for customer
Customer copies the address from the Clearer's UI and deposits crypto funds to the address. (step 2)
Funds are retrieved to the inabit generated wallet & address for customer (Customer's inabit API wallet ).
Notice that there are more than one customer API wallet within the Clearer's inabit account. This is to emphasize that the clearer needs only one inabit account. ()
Once gas funds arrive to customer API wallet, the clearer issues a second withdrawal to release the deposited funds that customer deposited earlier. (step 4)