@mapprotocol/routekits
v1.0.0
Published
Maplabs network comprehensive toolkit for cross chains.
Readme
@maplabs/routekits
Maplabs network comprehensive toolkit for cross chains
It includes all the operations that can be used in the cross-chain process.
Getting Started
Installing
- npm
npm i @maplabs/routekits Usage
import { Client } from '@maplabs/routekits';
const initClient = () => {
const endpoint = {
routes:"https://...",
common:"https://...",
}
//for test
const apikey = '3d30ba954f8f2c9e6e3fc8d4b0020e27';
const secret = 'ce34985d95c985bcc44fede8ce642704d542c4baf0fc4fe012d0a865be3349da'
const client = new Client({routes,common},{apikey,secret})
return client;
}
const getChains = async () => {
const client = initClient();
const response = await client.getChains();
if (response.errno == 0){
//success
console.log(response.data)
}else {
//failed
console.log(response.message)
}
}
getChains();
Request method aliases
client.getTokens(params)
client.getRoutes(params)
client.getOrders(params)
client.getTransaction(params)
client.getTransactions(params)
