Exchanges
This section describes how to integrate the 1Money Network into an exchange.
Connect to the 1Money Network
Make sure you are connected to the 1Money Network's Rest API Endpoints and Websockets.
Deposits
Note that the 1Money Network has checkpoints instead of blocks. You can think of a checkpoint as similar to the concept of a block in traditional blockchains. A checkpoint in the 1Money Network represents a specific point in time that captures the current state of each account, including newly distributed transaction fees credited to validators’ accounts.
Learn more about checkpoints in the system components section.
Exchanges should follow these steps for deposits:
Track the latest checkpoint and transaction data
Use the get checkpoint by latest number API to get the latest checkpoint number
Compare the network's checkpoint number to your local checkpoint number and make sure they match
If they match, then use the get checkpoint by number API to pull all the transaction data from that checkpoint
Input the checkpoint number and set full=true. For example: https://api.testnet.1money.network/v1/checkpoints/by_number?number=1000&full=true
Confirm customer deposit
Match your customer's address with the data structure in the transaction data queried in part 1 (above)
Once the customer deposit is confirmed, credit the balance to your local database
As a check, exchanges can use the get account balance API to ensure the customer deposits are correct compared to their local database
Withdrawals
To initiate a withdrawal, an exchange should:
Prepare the transaction with a private key signature
Use the submit payment API to prepare the transaction
Send signed transaction to the network
In special instances where a transaction is not approved by 2/3 of the validators, an exchange can cancel a transaction using the submit cancellation API.
How to check on the status of your transaction
Follow these steps to check on the status of your transaction:
Once you submitted a transaction, you will automatically get a hash as a return
Use Get Transaction Receipt by Hash to check the transaction status
Note that transactions on the network are finalized instantly, so there is no need wait for a checkpoint to be generated.
Additional Resources
Transaction types — all possible transaction types, including relevant documentation
Last updated