1.0.1 • Published 2 years ago

@bitahon/api v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@bitahon/api

This library serves as a client for the Bitahon API.

Installation

General

To obtain the latest version, simply require the project using npm:

npm install @bitahon/api

Usage

ERC20:

import {ethereumToken} from '@bitahon/api';
import {ethereum} from '@bitahon/protocol';

const token = await ethereumToken({
  network: ethereum.NETWORK_ID.ETHEREUM_MAINNET,
  contract: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
});

console.log(token.name, token.symbol, token.decimals);

TRC20:

import {tronToken} from '@bitahon/api';
import {tron} from '@bitahon/protocol';

const token = await tronToken({
  network: tron.NETWORK_ID.TRON_MAINNET,
  contract: 'TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t',
});

console.log(token.name, token.symbol, token.decimals);

TRC10:

import {tronToken} from '@bitahon/api';
import {tron} from '@bitahon/protocol';

const token = await tronToken({
  network: tron.NETWORK_ID.TRON_MAINNET,
  contract: '1002000',
});

console.log(token.name, token.symbol, token.decimals);

API

Functions

License

MIT

1.0.1

2 years ago

1.0.0

2 years ago