Package Exports
- synths-sdk
- synths-sdk/dist/src/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (synths-sdk) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
synths-sdk
Documentation
Using the Yam Uma Synths SDK
Official assets: File and Raw file
Install
yarn add synths-sdkUse
import Synths from "synths-sdk";
import { ethers } from "ethers";
// Create an ethers provider instance
const provider = new ethers.providers.Web3Provider(web3Provider);
// Initialize the sdk with the official yam synths
const synthsSDK = await Synths.create({
ethersProvider: provider,
});
// Connect the sdk to a synth
const upunksAsset = await synthsSDK.connectAsset("upunks-0921");
// Example method calls
const gcr: any = await upunksAsset.getGCR();// Alternatively you can pass your own synth object or modify the existing synths for a local test network deployment
const chainId = 1;
const userAssetsConfig: SynthsAssetsConfig = {
[chainId]: {
upunks: [
{
name: "September",
cycle: "09",
year: "21",
collateral: "WETH",
token: {
address: "0x86140A763077155964754968B6F6e243fE809cBe",
token: 18,
},
emp: {
address: "0xF8eF02C10C473CA5E48b10c62ba4d46115dd2288",
new: true,
type: "finlib",
},
pool: {
address: "0x6e01db46b183593374a49c0025e42c4bb7ee3ffa",
location: "sushiswap",
},
expired: false,
},
],
},
};
const synthsSDK = await Synths.create({
ethersProvider: provider,
userAssetsConfig: userAssetsConfig,
});Development
After cloning the synths repo, copy over the .env.template file and fill in variables.
# Copy over the .env.template file to .env and fill in variables.
yarn install
yarn testLocal testnet deployment
yarn hardhat node
yarn hardhat deploy --network localhost