RIF Wallet Services
RIF Wallet Services is a server application that provides basic account querying API to bootstrap your app.
The API is as follows. Fin the response types in src/types.ts
Use addresses in lower case chainId query param is optional default value for chainId query param is 31(TestNet)
Get the list of all the tokens in the RSK network
GET /tokens -> IToken[]
Query param: chainId
Get the tokens of an address:
GET /address/:address/tokens -> ITokenWithBalance[]
Query param: chainId
Get the events related to a given address
GET /address/:address/events -> IEvent[]
Query param: chainId
Get the incoming and outgoing transactions of a given address
GET /address/:address/transactions -> IApiTransactions[]
Query params: limit, prev, next, chainId
Get prices for tokens
GET /price
Query params: addresses, convert
Example:
- addresses: '0x2acc95758f8b5f583470ba265eb685a8f45fc9d5,0xef213441a85df4d7acbdae0cf78004e1e486bb96'
- convert: 'USD'
For BTC price indicate BTC in addresses
For ERC 20 Token indicate the smart contract address
Get a API key from CoinMarketCap and put it in the .env
file.
Install dependencies:
npm i
Run tests:
npm test
npm test:watch
Lint the code:
npm run lint
npm run lint:fix
Start the service:
npm run start
npm run start:prod
main
has latest release. PRs need to passci
. Do merge commits.develop
has latest approved feature. PRs need to passci
. Do squash&merge.- Use branches pointing to
develop
to add new PRs. - Do external PRs against latest commit in
develop
.
- Documentation is located in docs directory.
- We use PlantUML to write our class diagram.
- You can visit https://plantuml.com/ to check more about it.
- API documentation is in /api-docs endpoint - GET
- WebSocket documentation is in docs/websocket.md
- Markdown file is generated frowm websocket.yaml using @asyncapi/markdown-template
We provide two different indexer integrations to get balances, transactions, events:
- RSKExplorerAPI(Default)
- BlockscoutAPI To use RSKExplorerAPI, you should set PROFILE environment variable into PROFILE=wallet To use BlockscoutAPI, you should set PROFILE environment variable into PROFILE=dao