Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: about 1 month ago
JSON representation
Typescript interface for @bisonai/sbt-contracts
- Host: GitHub
- URL: https://github.com/bisonai/sbt-js
- Owner: Bisonai
- License: apache-2.0
- Created: 2022-09-27T12:16:24.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2023-01-18T00:48:29.000Z (almost 2 years ago)
- Last Synced: 2024-11-06T03:06:48.743Z (about 2 months ago)
- Topics: ethereum, klaytn, nft, soulbound-tokens
- Language: TypeScript
- Homepage:
- Size: 247 KB
- Stars: 7
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-klaytn - Typescript interface repository
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)