0.7.2 • Published 9 months ago
@gluwa/creditcoin-dex-router-sdk v0.7.2
creditcoin-dex-router-sdk
Introduction
This repository adapts the smart-order-router to be used in Gluwa's Creditcoin ecosystem.
Getting Started
1. Installation process
The package can be found at @gluwa/creditcoin-dex-router-sdk. Run the following command to install it in your project:
npm install @gluwa/creditcoin-dex-router-sdk
2. Software dependencies
It is recommended that you install ethers v5.7 in your project.
Example
Here is are the basic steps to initialize the DexRouter:
import { DexRouter, DexRouterConfiguration, DexRouterParams } from "@gluwa/creditcoin-dex-router-sdk";
import { ethers } from "ethers";
const CC3_DEX_FACTORY_ADDRESS = '0x62C10aaE28a6e9447413Dc5586484a397DBa10d8';
// Initialize the DexRouterConfiguration with URLs of backend services, chain ID, and factory address of CC3 DEX
// There are several optional properties that will fallback to defaults. See technical reference doc for more info on these.
const config: DexRouterConfiguration = {
chainId: 102031,
factoryAddress: CC3_DEX_FACTORY_ADDRESS,
indexerGraphqlUrl: "http://localhost:8080/graphql",
blockedTokenServiceUrl: "http://localhost:5243/"
};
// Initialize the provider to communicate with the block chain.
const baseProvider = new ethers.providers.JsonRpcProvider('https://rpc.cc3-testnet.creditcoin.network');
// Initialize DexRouterParams with config and base provider
const dexRouterParams: DexRouterParams = {
config,
baseProvider
};
// Construct a new instance of DexRouter using the above params.
const dexRouter = new DexRouter(dexRouterParams);
0.7.2
9 months ago
0.7.1
9 months ago
0.6.5
10 months ago
0.6.4
10 months ago
0.7.0
10 months ago
0.6.3
10 months ago
0.6.2
10 months ago
0.6.1
10 months ago
0.6.0
10 months ago
0.5.1
10 months ago
0.5.0
10 months ago
0.4.0
10 months ago
0.3.0
11 months ago
0.2.3
11 months ago
0.2.2
11 months ago
0.2.1
1 year ago
0.2.0
1 year ago
0.1.2
1 year ago
0.1.1
1 year ago
0.1.0
1 year ago