Typescript library for interacting with the UXD contracts on EVM.
npm i "UXDProtocol/uxd-evm-client"
You need to import the UXDController from the library as well as the ethers library
import { ethers } from 'ethers';
import { UXDController }from 'uxd-evm-client';
The controller must be ininitialized with following parameters:
- JSON RPC provider pointing to the kovan optimism RPC endpoint.
- UXD Controller contract address on kovan optimism.
- UXD token on kovan optimism.
The provider can be injected when using Metamask or other browser wallet
const provider = new ethers.providers.JsonRpcProvider("https://kovan.optimism.io")
const controller = new UXDController(
provider,
"0x73864663E5E8B3974D896AcE3Ce125e33d5d7c51",
"0x02Bbb29C5ECAd50219215a400B10a161b77bc2DA");
You can then start calling functions on the controller
const totalSupply = await controller.uxdTotalSupply()
console.log('totalsupply = ', totalSupply);
Check this here to see the list of public functions availale on the controller.
Version 1.0.0 has been unpublished. Current version are tagged as alph 0.0.1-alpha.X