Explore use cases¶
In short, to integrate with Insolar MainNet, do the following:
Create an Insolar wallet to keep the users’ XNS coins. See the use cases: Create a Wallet and Get the Wallet’s Balance.
Let the users deposit XNS coins to your wallet—provide them with the wallet address. See the use cases: Deposit Funds to Exchange and Deposit Coins to Exchange.
Let the users withdraw XNS coins. They must create their own wallets on the MainNet and provide you with addresses of these wallets. See the use cases: Create a Wallet and Withdraw Coins from Exchange.
Transfer XNS coins between wallets on the MainNet. See the use case: Transfer Coins.
Get information on transactions on the MainNet. See the corresponding API request.
To invoke APIs correctly, familiarize yourself with:
General API invocation sequence.
List of API integration use cases. Each use case describes a sequence of steps and a list of corresponding API requests used in those steps.
The requests themselves are described in detail in the Insolar’s API specifications — MainNet API and Observer API.
To simplify testing, Insolar can provide a testing environment on demand.
General API invocation sequence¶
The general API invocation sequence is as follows:
Integration use cases¶
Below is the list of integration use cases.
Use case: Create a wallet¶
To create a wallet:
Generate a private/public key pair.
Invoke Insolar’s API:
Provide the public key.
Receive a reference to the new member—address on the Insolar network.
The wallet creation sequence is as follows:
API requests used:
node.getSeed
member.create
Use case: Get the wallet balance¶
To view the balance, a user (exchange service or any other user) can either:
Use their Insolar Wallet web interface.
Or invoke the API using their Insolar’s credentials (
memberReference
orpublicKey
).
The viewing sequence is as follows:
API requests used:
node.getSeed
member.get
API endpoints used:
GET
<observer_URL>/member/{memberReference}
GET
<observer_URL>/member/{memberReference}/balance
Use case: Transfer coins¶
To transfer XNS coins to another user, a user (exchange or any other) can either:
Use their Insolar Wallet.
Or invoke the API.
To transfer coins via API, provide:
Sender’s
memberReference
, so Insolar can identify the sender.toMemberReference
—recipient’s reference.An
amount
of XNS coins to transfer.
Note
To retrieve the memberReference
, invoke the relevant API and provide a public key.
The transfer sequence is as follows:
API requests used:
node.getSeed
(optional)
member.get
member.transfer
Use case: Deposit funds to an exchange¶
When a user deposits funds to the exchange and immediately converts them to XNS, an accompanying transfer between wallets should be performed.
This case is similar to coin transfer, where:
memberReference
is the reference to the owner of the wallet the coins are withdrawn from.toMemberReference
is the reference to the exchange’s wallet.
Use case: Deposit coins to an exchange¶
When a user deposits XNS coins to the exchange, an accompanying transfer between wallets should be performed.
This case is similar to coin transfer, where:
memberReference
is the reference to the owner of the wallet the coins are withdrawn from.toMemberReference
is the reference to the exchange’s wallet.
Use case: Withdraw coins from an exchange¶
Prerequisite: the recipient must have an Insolar’s wallet created as described in wallet creation.
This case is similar to coin transfer, where:
memberReference
is the reference to the owner of the wallet the coins are withdrawn from.Note
This can be either a wallet opened by the exchange for the user, or the exchange’s wallet.
toMemberReference
is the reference to the recipient.