Git Product home page Git Product logo

rif-wallet-services's Introduction

logo

@rsksmart/rif-wallet-services

RIF Wallet Services

ci

RIF Wallet Services is a server application that provides basic account querying API to bootstrap your app.

Usage

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)

Tokens

Get the list of all the tokens in the RSK network

GET /tokens -> IToken[]
Query param: chainId

Addresses

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

Prices

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

Run for development

API Keys

Get a API key from CoinMarketCap and put it in the .env file.

Install

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

Branching model

  • main has latest release. PRs need to pass ci. Do merge commits.
  • develop has latest approved feature. PRs need to pass ci. Do squash&merge.
  • Use branches pointing to develop to add new PRs.
  • Do external PRs against latest commit in develop.

Documentation

  • 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

Indexers

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

rif-wallet-services's People

Contributors

sleyter93 avatar rafaiovlabs avatar freshenext avatar jessgusclark avatar david-iov avatar chescalante avatar ilanolkies avatar dependabot[bot] avatar agustin-v avatar bcodesido avatar lucasvuotto avatar lucachaco avatar diegograsso avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.