JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 27
  • Score
    100M100P100Q81254F
  • License MIT

Yam Uma Synths SDK

Package Exports

  • synths-sdk

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

Install

yarn add synths-sdk

Synths contract and sdk tests

yarn install
yarn test

Code

import Synths from "synths-sdk";
import { ethers } from "ethers";

/// @dev Create an ethers provider instance
const provider = new ethers.providers.Web3Provider(web3Provider);

/// @dev User params for a local / not supported chain or asset
// const chainId = 1;
// const userAssetsConfig: SynthsAssetsConfig = {
//   [chainId]: {
//     "upunks": [
//       {
//         "name": "September",
//         "cycle": "09",
//         "year": "21",
//         "collateral": "WETH",
//         "token": {
//           "address": "0x86140A763077155964754968B6F6e243fE809cBe"
//         },
//         "emp": {
//           "address": "0xF8eF02C10C473CA5E48b10c62ba4d46115dd2288",
//           "new": true,
//           "type": "finlib"
//         },
//         "pool": {
//           "address": "0x6e01db46b183593374a49c0025e42c4bb7ee3ffa",
//           "location": "sushiswap"
//         },
//         "expired": false
//       }
//     ],
//   },
// };

const synthsSDK = await Synths.create({
  ethersProvider: provider,
  // userAssetsConfig: userAssetsConfig
});

const upunksAsset = await synthsSDK.connectAsset("upunks-0921");

/// @notice Example method calls
const gcr: any = await upunksAsset.getGCR();