The Aggregator package has been developed to facilitate interaction with multiple decentralised protocols. It provides a unified interface for developers, with the objective of offering end users the best of each protocol in the most straightforward manner.
The current supported protocols are:
yarn add @xchainjs/xchain-aggregator
or
npm install @xchainjs/xchain-aggregator
Aggregator can be easily initialise providing the Wallet with the XChainJs Clients you are working with. If no protocol is provided, the Aggregator will work with all the supported protocols.
import { Aggregator } from '@xchainjs/xchain-aggregator';
const aggregator = new Aggregator({
wallet: new Wallet({
// Your XChainJS clients
}),
protocols: [
// The protocols you want to work with
],
affiliate: {
// Affiliate config
}
})
- Estimate the most efficient swap among protocols
- Do swaps
- Get swap history through different protocols
You can find examples using the Aggregator package in the aggregator examples folder.
More information about how to use the Aggregator package can be found on documentation