This library provides necessary types and JSON-RPC information for user to access Parallel Finance backend by using polkadot.js.
- Add this repo as dependencies
yarn add @parallel-finance/api
- Import the
ApiPromise
from this package
import { ApiPromise, options, WsProvider, Keyring } from "@parallel-finance/api"
const main = async () => {
const api = await ApiPromise.create(options({
provider: new WsProvider()
}))
const keyring = new Keyring({ type: "sr25519" });
const signer = keyring.addFromUri("//Alice")
await api.tx.system.remark("hello").signAndSend(signer);
const [route, amount] = await api.rpc.router.getBestRoute("10000000", 100, 1, true);
}
- api
- Contains necessary options to create a polkadot.js API instance
- types
- Polkadot.js types for Parallel Fanance
- types-definitions
- Polkadot.js type definitions for Parallel Fanance
Start a local node service on ws://localhost:9948
yarn
ENDPOINT=ws://localhost:9948 yarn update-metadata
yarn
yarn generate:defs
yarn generate:meta
yarn build
# For patch update(eg: 0.0.1 -> 0.0.2)
yarn bump patch
# For minor update(eg: 0.1.0 -> 0.2.0)
yarn bump minor
# For major update(eg: 1.0.0 -> 2.0.0)
yarn bump major
We would like to thank the following projects.