# @ankr.com/stkr-jssdk-v2

> stkr js sdk to interact with stkr.io directly

Latest version **2.0.3** (published 2021-02-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install @ankr.com/stkr-jssdk-v2
pnpm add @ankr.com/stkr-jssdk-v2
yarn add @ankr.com/stkr-jssdk-v2
bun add @ankr.com/stkr-jssdk-v2
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.3 |
| Published | 2021-02-15 |
| First published | 2021-02-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=6.0.0 |
| Dependencies | 15 |
| Unpacked size | 529.1 KB |
| Known vulnerabilities | 0 (+24 in 2 direct dependencies) |
| Install scripts | no |
| Maintainers | nwts0as, ankr_network |
| Keywords | ankr, ankr.com, stkr, stkr.io, eth 2.0, staking |

## Links

- npm: https://www.npmjs.com/package/@ankr.com/stkr-jssdk-v2
- npm.io page: https://npm.io/package/@ankr.com/stkr-jssdk-v2

## Dependencies (15)

- [web3](https://npm.io/package/web3.md) 1.2.11
- [axios](https://npm.io/package/axios.md) ^0.21.1
- [bn.js](https://npm.io/package/bn.js.md) ^5.1.3
- [react](https://npm.io/package/react.md) ^16.9.0
- [rimraf](https://npm.io/package/rimraf.md) ^3.0.2
- [web-utils](https://npm.io/package/web-utils.md) ^1.0.0
- [web3-core](https://npm.io/package/web3-core.md) 1.2.11
- [web3modal](https://npm.io/package/web3modal.md) ^1.9.3
- [node-fetch](https://npm.io/package/node-fetch.md) ^2.6.1
- [@types/react](https://npm.io/package/@types/react.md) ^16.9.0
- [ethereumjs-wallet](https://npm.io/package/ethereumjs-wallet.md) ^1.0.1
- [web3-eth-contract](https://npm.io/package/web3-eth-contract.md) 1.2.11
- [web3-typescript-typings](https://npm.io/package/web3-typescript-typings.md) ^0.10.2
- [@binance-chain/bsc-connector](https://npm.io/package/@binance-chain/bsc-connector.md) ^1.0.0
- [@walletconnect/web3-provider](https://npm.io/package/@walletconnect/web3-provider.md) ^1.3.6

## Recent versions

- 2.0.3 (latest) — 2021-02-15
- 2.0.2 — 2021-02-15
- 2.0.1 — 2021-02-15

## README

Ankr Staking JavaScript SDK
===========================

This sdk used to implement stkr.io to javascript applications. 

## Installation

Via npm;

```
npm install @ankr.com/stkr-jssdk-v2
```

Via yarn;

```
yarn add @ankr.com/stkr-jssdk-v2
```

## Usage

Stkr sdk constructor gets web3 instance and network name (e.g. mainnet or goerli) and act like a bridge to 
contract with web3. And return types almost same with web3 contract calls but
they may be changed / edited to provide simplicity for applications.

You can configure Stkr SDK instance by setting env `REACT_APP_STKR_ENV` to one of next possible values:
- mainnet (default) - use mainnet configuration
- goerli - use goerli configuration
- develop - use develop configuration
- local - use localhost configuration

```js
import { StkrSdk } from "@ankr.com/stkr-jssdk-v2"
const stkr = StkrSdk.getForEnv()
await stkr.connect()
const {transactionHash} = await stkr.stake('1')
await stkr.disconnect()
```

Or if you want you can also configure Stkr SDK instance manually.

```js
import { StkrSdk } from "@ankr.com/stkr-jssdk-v2"
const stkr = StkrSdk.getForConfig({
  // ...
})
await stkr.connect()
const {transactionHash} = await stkr.stake('1')
await stkr.disconnect()
```

---
_Source: https://npm.io/package/@ankr.com/stkr-jssdk-v2 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
