New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@gyrostable/sdk

Package Overview
Dependencies
Maintainers
2
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gyrostable/sdk

TypeScript/JavaScript SDK to interact with Gyro.

  • 0.1.28
  • latest
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

Gyro SDK

TypeScript/JavaScript SDK to interact with Gyro.

Development

Follow the installation instructions of https://github.com/stablecoin-labs/core including starting the node and linking the package. Then run the following

yarn install
yarn link @gyrostable/core
yarn link
yarn build

To make sure everything is working, try running the tests using yarn test.

To compile automatically when changing something, run yarn build --watch instead of yarn build.

Usage

The SDK is based around the Gyro class, which can be instantiated as follows:

import { Gyro } from "@gyrostable/sdk";
import { ethers } from "ethers";

const provider = new ethers.providers.Web3Provider(window.ethereum);
const gyro = await Gyro.create(provider);

const tokens = await gyro.getSupportedTokens();

const usdt = tokens.find((t) => t.symbol === "USDT");
const weth = tokens.find((t) => t.symbol === "WETH");

const inputs = [
  { token: usdt.address, amount: MonetaryAmount.fromNormalized(2500, usdc.decimals) }
  { token: weth.address, amount: MonetaryAmount.fromNormalized(2, weth.decimals) }
];
const mintResult = await gyro.mint(inputs);
console.log(`Minted ${mintResult} tokens`);
const currentBalance = await gyro.balance();
console.log(`Gyro balance: ${currentBalance.toNormalizedString()}`);

FAQs

Package last updated on 08 Dec 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc