Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/bisonai/sbt-js

Typescript interface for @bisonai/sbt-contracts
https://github.com/bisonai/sbt-js

ethereum klaytn nft soulbound-tokens

Last synced: 4 days ago
JSON representation

Typescript interface for @bisonai/sbt-contracts

Awesome Lists containing this project

README

        

# @bisonai/sbt-js

This repository is a Typescript interface for [@bisonai/sbt-contracts](https://github.com/bisonai/sbt-contracts).

## Installation

```
yarn install
```

## How to use

```
import { ethers } from 'ethers'
import { SBT, Network } from '@bisonai/sbt-js'

const wallet = ethers.Wallet.createRandom()
const sbt = new SBT(Network.localhost, wallet.privateKey)
```

## Testing

Tests defined in `test/sbt.ts` can be used for testing on the local or live network.
All settings related to tests are loaded from the `.env` file.
Copy the `.env.example` to the `.env` file, follow included instructions and fill in the required settings.

### Local network

When testing on a local network, we recommend using [Ganache](https://trufflesuite.com/ganache/).
Our test scripts include accounts that come with Ganache when launched with the command `ganache -d`.
After launching Ganache, you can run tests with `yarn test`.

### Live network

Before testing on a live network you will need to create two accounts and fund the first one with tokens.
The name of the network has to be assigned to the `TEST_NETWOK` environment variable located in the `.env` file.
The accounts can be generated with the `npx menmonics` command.
After you generate mnemonics for both accounts, copy them to the `.env` file and assign them to the `MNEMONIC0` and `MNEMONIC1` environment variables.
If you are testing on Klaytn test net called `Baobab`, you will need to fund your account first (only account related to `MNEMONIC0`).
We recommend using [Klaytn Baobab Faucet](https://baobab.wallet.klaytn.foundation/faucet).
Eventually, you can launch test scenarios using the `yarn test` command.

## Publish to registry

```
yarn clean
yarn build
yarn pub
```

## License

[Apache License 2.0](LICENSE)