10000 GitHub - rajsha10/GardenFinance
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

rajsha10/GardenFinance

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BTC to WBTC Swapper

Getting Started

  1. Clone the repository.
  2. Install the required dependencies.
bun install
bun link
bun link swapper
  1. Get the API_KEY. The API_KEY is used for initializing the ETHEREUM_PROVIDER.
// File: src/index.ts

// Part of the code that does the initialization
const API_KEY = readFileSync(join(homedir(), ".swapper_api_key"),"utf-8");
const RPC_PROVIDER_URL = `https://sepolia.gateway.tenderly.co/${API_KEY}`;
const ETHEREUM_PROVIDER = new JsonRpcProvider(RPC_PROVIDER_URL);

Note

Here we are using Tenderly as an RPC Provider.

  1. To obtain the API_KEY from Tenderly,go to the Tenderly Dashboard. Navigate to Node RPCs and click Create Node & Sepolia as your network.

  2. Set up the API_KEY.

chmod +x setup_key.sh
./setup_key.sh <API_KEY>

Running the CLI

Creating Wallets

Create an EVM wallet.

swapper createevmwallet --privatekey=<PRIVATE_KEY>

createevmwallet

Create a Bitcoin wallet.

swapper createbitcoinwallet --privatekey=<PRIVATE_KEY>

createbitcoinwallet

Swapping

Swap between WBTC to BTC.

swapper swapwbtctobtc --amount=0.0001

swapwbtctobtc

Swap between BTC to WBTC.

swapper swapbtctowbtc --amount=0.0001

swapbtctowbtc

Get Details

A utility command useful for looking up the $HOME/.swapper_config.json file.

swapper getdetails

getdetails

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 99.1%
  • Shell 0.9%
0