dAPI Integration
Integrating a mobile wallet using the dAPI
Integrating the
dAPI
is practically equivalent to integrating the Provider SDK
. The Provider SDK
encapsulates methods for iOS/Android webview
, and supports communication between web based dApps
and iOS/Android webview
.
Mobile version of
dAPI
can allow the wallet to perform the following features based on dApp
scenarios-dApps
are launched in the wallet- Wallet scans QR codes
- Applications wake the wallet
The execution process is as follows:
- 1.The
dApp
is opened in the wallet - 2.Account or identity information is fetched
- 3.
dApp
logs in - 4.
dApp
invokes smart contract

The execution process is as follows:
- 1.Wallet scans the QR code provided by the
dApp
- 2.Provider receives the
callback URL
and verification message, user authenticates and signs the message, the message is sent to thecallback URL
provided. - 3.
dApp
back end carries out the verification process for the message.

The execution process is as follows:
- 1.Wallet scans the QR code provided by the
dApp
- 2.Wallet initiates the transaction, the user authenticates and signs, the contract is pre-executed, user confirms, transaction is transmitted to the blockchain, transaction
hash
is returned to the callback address - 3.
dApp
back end queries transaction event

- 1.
dApp
sends the wake call to the wallet - 2.Wallet fetches the
callback URL
and the verification message, user enter authenticates and signs the message, wallet returns the signature to the callback address - 3.
dApp
back end verifies the message

- 1.
dApp
sends the wake call to the wallet - 2.Wallet initiates the transaction, the user authenticates and signs, wallet pre-executes the transaction, the transaction is transmitted to the blockchain, the transaction
hash
is returned to thecallback
address - 3.
dApp
back end queries the transaction event on the blockchain using the transactionhash
Here is a basic demonstration of some of the basic functions that the wallet can perform. A demo wallet which can be downloaded using the link below has been used to mimic a second party.
After completing the installation of
Cyano
wallet and the demo app, features of both the wallets can be tested along with the source code as reference.Transactions can be performed to test smart contract logic and confirming whether or not the platform has been integrated successfully.
Launch Cyano wallet and access the "DApp" section. Open the "PRIVATE APPS" tab and input this address to access the demo
dApp
: http://101.132.193.149:5000/#/

Clicking on the Get Identity button will directly fetch the
ONT ID
of the account. Enter the password when prompted and the ID will appear in the blank field below. You can carry out the authorization/KYC by uploading your document information, for e.g, passport number, picture of the first page, etc.

In case there is a need to verify the user's identity,
dApp
sends a message to the wallet to carry out the signature process, and then verifies the signature.As illustrated above, the wallet prompts the user to enter the password. Once confirmed, the contract related details can be accessed.

The contract deployment process involves the following steps:
- 1.After the signature verification is completed successfully, the contract is pre-processed.
- 2.The user confirms and transmits the transaction via the wallet.
- 3.The
hash
value of the transaction is returned to thedApp
.
Last modified 3yr ago