1.0.4 • Published 2 years ago

@steban1/bchswap-sdk v1.0.4

Weekly downloads
-
License
GPL-3.0-or-later
Repository
github
Last release
2 years ago

BchSwap SDK

Type Script library to connect with the BCH Swap protocol

Publishing it to NPM

  • Run cd ~
  • Run git clone https://gitlab.com/pranesh.as26/bchswap-sdk
  • Make sure the FACTORY_ADDRESS, CHAIN_ID and INIT_CODE_HASH are updated in the /src/constants.ts file.
  • Don't forget to update the wBCH address in the /src/entities/token.ts file.
  • Update the project name and description in the package.json
  • Run rm -rf package-lock.json
  • Run npm install tsdx
  • Run npm login run only if your account is not logged in
  • Run npm publish (may need --access public or update package.json to include access: public)
  • Publish this SDK to NPM as a npm library under your organization (to be used in the interface)_

Running tests

To run the tests, follow these steps. You must have at least node v10 and yarn installed.

First clone the repository:

git clone https://gitlab.com/pranesh.as26/bchswap-sdk

Move into the bchswap-sdk working directory

cd bchswap-sdk/

Install dependencies

yarn install

Run tests

yarn test

You should see output like the following:

yarn run v1.22.4
$ tsdx test
 PASS  test/constants.test.ts
 PASS  test/pair.test.ts
 PASS  test/fraction.test.ts
 PASS  test/miscellaneous.test.ts
 PASS  test/entities.test.ts
 PASS  test/trade.test.ts

Test Suites: 1 skipped, 6 passed, 6 of 7 total
Tests:       3 skipped, 82 passed, 85 total
Snapshots:   0 total
Time:        5.091s
Ran all test suites.
✨  Done in 6.61s.