MarkVink / stargate-crosschain-swap

Typescript cross chain swaps with Stargate

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Stargate Crosschain Swap

This repo contains Typescript code that allow you to make cross chain swaps using Stargate Finance.

You can learn more about how to use it by reading the thread on my Twitter

Setup

  1. Install dependencies, generate typechain types
npm i
npm run generate-typechain
  1. Create .env file and set private key there

How to Swap

Script takes fromNetwork, toNetwork, amount and token CLI args.

Here is example of calling script for initiating cross chain swap of 5 USDC from Fantom to Polygon

npx ts-node ./scripts/crossChainSwap.ts --fromNetwork=Fantom --toNetwork=Polygon --token=USDC --amount=5

Please, note: Currently, supports only USDC on Fantom, Polygon, BSC networks.

About

Typescript cross chain swaps with Stargate


Languages

Language:TypeScript 100.0%