2.1.1 • Published 1 year ago

sdk-blockchain v2.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Project description

Simple SDK that enables communication with the Covalent RESTful API bundled by microbundle.

Installation

With npm:

npm i sdk-blockchain

...or with yarn:

yarn add sdk-blockchain

API Endpoints

BalancesApi

MethodArgumentsHTTP request
getTokenBalances()chainId: number, address: stringGET/${chainId}/address/${address}/balances_v2
getHistoricalPortfolio()chainId: number, address: stringGET/${chainId}/address/${address}/portfolio_v2

Authorization

API key

Every endpoints required to be authenticated using the API key mechanism. To receive it, please go here

All you have to do is provide an API key when instantiating the SDK client:

const balance: Balances = new Balances({
  apiKey: "YOUR_API_KEY",
});

Usage

balance.getTokenBalances(chainId, address).then((tokenBalances) => {
  console.log({ tokenBalances });
});
balance.getHistoricalPortfolio(chainId, address).then((portfolio) => {
  console.log({ portfolio });
});

for demonstration purposes these values can be used: chainId = 1 address = "demo.eth"

2.1.1

1 year ago

2.1.0

1 year ago

2.0.0

1 year ago

1.2.0

1 year ago

1.1.0

1 year ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago