Trust Wallet is a light client wallet, which means it needs to get data / information from remote nodes (either light nodes or full nodes). In order to integrate your blockchain into Trust Wallet smoothly, you must also fulfill RPC / API requirements. We list all needed APIs or RPCs plus an example below for your reference.
We need API or RPC to:
- query account / address balance
- query transaction details
- query fee / nonce for sending transaction
- query blockchain status (block height etc)
- send raw transaction
Used to create transaction list index and notify users about incoming/outgoing transactions.
- query transactions in a block
We will take XRP as an example here, it supports WebSocket, JSON-RPC (including over HTTP)
- JSON RPC method:
account_info(https://xrpl.org/docs/references/http-websocket-apis/public-api-methods/account-methods/account_info)
- JSON RPC method:
tx(https://xrpl.org/docs/references/http-websocket-apis/public-api-methods/transaction-methods/tx)
- fee: JSON RPC method:
fee(https://xrpl.org/docs/references/http-websocket-apis/public-api-methods/server-info-methods/fee) - nonce: same as
account_info, you can findSequencein response.
- JSON RPC method:
server_state(https://xrpl.org/docs/references/http-websocket-apis/public-api-methods/server-info-methods/server_state)
- JSON RPC method:
submit(https://xrpl.org/docs/references/http-websocket-apis/public-api-methods/transaction-methods/submit)
- JSON RPC method:
account_tx(https://xrpl.org/docs/references/http-websocket-apis/public-api-methods/account-methods/account_tx)
- JSON RPC method:
ledger(https://xrpl.org/docs/references/http-websocket-apis/public-api-methods/ledger-methods/ledger)