1.1.5 • Published 2 years ago

synths-sdk v1.1.5

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

synths-sdk

CI

Documentation

Using the Yam Uma Synths SDK

Official assets: File and Raw file

Install

yarn add synths-sdk

Use

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 test

Local testnet deployment

yarn hardhat node
yarn hardhat deploy --network localhost
1.1.5

2 years ago

1.1.4

2 years ago

1.1.1

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.0

3 years ago

1.0.9

3 years ago

1.0.91

3 years ago

1.0.95

3 years ago

1.0.94

3 years ago

1.0.93

3 years ago

1.0.92

3 years ago

1.0.97

3 years ago

1.0.8

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago