UNPKG

@bancor/carbon-sdk

Version:

The SDK is a READ-ONLY tool, intended to facilitate working with Carbon contracts. It's a convenient wrapper around our matching algorithm, allowing programs and users get a ready to use transaction data that will allow them to manage strategies and fulfi

2 lines (1 loc) 1.61 kB
import{CarbonBatcher__factory as r}from"../../abis/types/factories/CarbonBatcher__factory/index.js";import{CarbonController__factory as o}from"../../abis/types/factories/CarbonController__factory/index.js";import{Multicall__factory as t}from"../../abis/types/factories/Multicall__factory/index.js";import{Token__factory as e}from"../../abis/types/factories/Token__factory/index.js";import{Voucher__factory as s}from"../../abis/types/factories/Voucher__factory/index.js";import{config as i}from"../config/index.js";class c{_provider;_carbonController;_multiCall;_voucher;_carbonBatcher;_config=i;constructor(r,o){this._provider=r,this._config.carbonControllerAddress=o?.carbonControllerAddress||i.carbonControllerAddress,this._config.multiCallAddress=o?.multiCallAddress||i.multiCallAddress,this._config.voucherAddress=o?.voucherAddress||i.voucherAddress,this._config.carbonBatcherAddress=o?.carbonBatcherAddress||i.carbonBatcherAddress}get carbonController(){return this._carbonController||(this._carbonController=o.connect(this._config.carbonControllerAddress,this._provider)),this._carbonController}get carbonBatcher(){return this._carbonBatcher||(this._carbonBatcher=r.connect(this._config.carbonBatcherAddress,this._provider)),this._carbonBatcher}get multicall(){return this._multiCall||(this._multiCall=t.connect(this._config.multiCallAddress,this._provider)),this._multiCall}get voucher(){return this._voucher||(this._voucher=s.connect(this._config.voucherAddress,this._provider)),this._voucher}token(r){return e.connect(r,this._provider)}get provider(){return this._provider}}export{c as Contracts};