Skip to content

AzothZephyr/swig-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Swig CLI

This is a command-line interface for interacting with a Swig wallet. It's intention is to be rudimentary and demonstrate how to do things over to be a usable client for anything.

Setup

First, navigate to this directory and install the dependencies:

bun install

Usage

Create

To create a new Swig account:

bun create

This will create a new Swig account and log its address.

List

To list all Swig accounts for the current user:

bun list

Transfer

To transfer SOL from your Swig wallet to another address, use the transfer command:

bun transfer <RECIPIENT_ADDRESS> <AMOUNT> <SWIG_ACCOUNT_ADDRESS>
  • <RECIPIENT_ADDRESS>: The Solana address of the recipient.
  • <AMOUNT>: The amount of SOL to transfer.
  • <SWIG_ACCOUNT_ADDRESS>: The specific Swig account to use.

Transfer SPL Tokens

To transfer SPL tokens from your Swig wallet to another address, use the transfer-spl command:

bun transfer-spl <RECIPIENT_ADDRESS> <MINT_ADDRESS> <AMOUNT> <SWIG_ACCOUNT_ADDRESS>
  • <RECIPIENT_ADDRESS>: The Solana address of the recipient.
  • <MINT_ADDRESS>: The mint address of the SPL token.
  • <AMOUNT>: The amount of tokens to transfer (in the smallest unit of the token).
  • <SWIG_ACCOUNT_ADDRESS>: The specific Swig account to use.

Swap

To swap tokens using Jupiter, use the swap command:

bun swap <AMOUNT> <SWIG_ACCOUNT_ADDRESS> [FROM_TOKEN] [TO_TOKEN]
  • <AMOUNT>: The amount of tokens to swap.
  • <SWIG_ACCOUNT_ADDRESS>: The specific Swig account to use.
  • [FROM_TOKEN]: The token to swap from (defaults to sol).
  • [TO_TOKEN]: The token to swap to (defaults to usdc).

Close

To close a Swig account and reclaim the rent, use the close command:

bun close <SWIG_ACCOUNT_ADDRESS>
  • <SWIG_ACCOUNT_ADDRESS>: The Swig account to close.

Close All

To close all Swig accounts for the current user:

bun close-all

Give Permission

To grant swap permissions to a Swig account:

bun give-permission swap <SWIG_ACCOUNT_ADDRESS>
  • <SWIG_ACCOUNT_ADDRESS>: The Swig account to grant permission to.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors