@kaddex/kaddex-sdk v0.0.1
:hammer_and_wrench: Kaddex SDK
The Kaddex SDK is a stand-alone library designed to assist developers when interacting with the protocol in any environment that can execute JavaScript, such as websites or node scripts.
INSTRUCTIONS
For general usage, refer to our documentation on gitbook:
https://docs.kaddex.com/kaddex-sdk/
SDK Developers (Contributors)
Getting started
First step, clone the repository, and change into the project directory
$ git clone https://github.com/roboswap-ai/kaddex-sdk.git$ cd kaddex-sdkInstall NPM packages for local development
$ npm installDuplicate the .env.example file for local development
$ cp .env.example .envNow, you'll need to generate a local key pair for integration testing on the Kadena Chainweb testnet.
$ npm run keygenCopy this key pair into your .env file.
Next, use the testnet faucet to send some Testnet KDA to your new public key (ensure you use the public key as the account name): https://faucet.testnet.chainweb.com/
Finally, you will need to transfer some coins to chain ID 0 in order to run the integration tests.
Open Chainweaver here: https://chainweaver.kadena.network/
Create a new Chainweaver account if necessary.
Ensure you are on the testnet in Chainweaver.
Click "Add Account" and paste your public key.
If your testnet faucet transaction is complete, you should already see your Testnet KDA deposited.
Click "Transfer" in order to send some coins to chain ID 0.
Wait for your transfer to complete and ensure Chainweaver shows your new balance on chain ID 0.
Now, you are ready to run the integration tests using your new keypair.
$ npm run testAll tests should pass. Otherwise, notify the repository owners! ;)
You should now be all set for local development. Congrats! :party-popper:
In order to test the end-to-end functionality on the testnet, run the test command with nock disabled.
$ NOCK_OFF=true npm run testCode Quality
We use eslint.
You can run lint in two modes:
lint
$ npm run lintlint with auto fixing
$ npm run lint:fixRun the tests
We use mocha and chai with a mostly (but not strict) behavioral style for testing.
You can run the tests in three different contexts:
Single run
$ npm run testWatch mode
$ npm run test:watchCoverage
$ npm run test:coverageDocumentation
Documentation is using jsDoc and is available as html or markdown version.
To build the documentation in development, you need to run
$ npm run docsLicense
MIT, see license file