Skip to content

Permissionless-Software-Foundation/psf-slp-wallet

Repository files navigation

psf-slp-wallet

This is a command-line interface (CLI) application for creating and managing Simple Ledger Protocol (SLP) tokens.

This is a fork of psf-bch-wallet. This CLI has all the same commands as that one, plus additional commands for managing SLP tokens.

Tutorial Videos

Installation

This software requires node.js v20 or higher. Instructions for installation:

  • git clone https://github.com/Permissionless-Software-Foundation/psf-slp-wallet
  • cd psf-slp-wallet
  • npm install

Usage

Display Help

  • node psf-slp-wallet.js help

Wallet Commands

Create a Wallet

Create a new wallet.

  • node psf-slp-wallet.js wallet-create -n wallet1 -d "My first wallet"
Arguments
  • Use the -n flag to specify the name of the wallet (required).
  • Use the -d flag to specify a description for the wallet (optional).

List Wallets

List all existing wallets.

  • node psf-slp-wallet.js wallet-list
Arguments
  • No arguments required.

Wallet Addresses

List the different addresses (Cash, SLP, Legacy) for a wallet.

  • node psf-slp-wallet.js wallet-addrs -n wallet1
Arguments
  • Use the -n flag to specify the name of the wallet (required).

Wallet Balance

Get the balance of a wallet in BCH and SLP tokens.

  • node psf-slp-wallet.js wallet-balance -n wallet1
Arguments
  • Use the -n flag to specify the name of the wallet (required).

Wallet Sweep

Sweep BCH and SLP tokens from a WIF private key into the wallet.

  • node psf-slp-wallet.js wallet-sweep -n wallet1 -w L1qFRBqMdS9kBMmLPSCpT2BHRcBF9iGaQsR5G85FLRe5bUUoAYee
Arguments
  • Use the -n flag to specify the name of the wallet receiving the funds (required).
  • Use the -w flag to specify the WIF private key to sweep (required).

BCH and Token Send Commands

Send BCH

Send BCH to an address.

  • node psf-slp-wallet.js send-bch -n wallet1 -a bitcoincash:qr2u4f2dmva6yvf3npkd5lquryp09qk7gs5vxl423h -q 0.001
Arguments
  • Use the -n flag to specify the name of the wallet sending BCH (required).
  • Use the -a flag to specify the address to send BCH to (required).
  • Use the -q flag to specify the quantity of BCH to send (required).

Send Tokens

Send SLP tokens to an address.

  • node psf-slp-wallet.js send-tokens -n wallet1 -a simpleledger:qr2u4f2dmva6yvf3npkd5lquryp09qk7gsvfq5kzsu -q 1 -t 1d542ac6b26a2c85a892b79b7ec39dfba5c731b95c644cf5aef75e580f5c7660
Arguments
  • Use the -n flag to specify the name of the wallet sending tokens (required).
  • Use the -a flag to specify the address to send tokens to (required).
  • Use the -q flag to specify the quantity of tokens to send (required).
  • Use the -t flag to specify the token ID of the token to send (required).

Message Commands

Sign a Message

Cryptographically sign a message using the wallet's private key.

  • node psf-slp-wallet.js msg-sign -n wallet1 -m "Hello World"
Arguments
  • Use the -n flag to specify the name of the wallet to sign with (required).
  • Use the -m flag to specify the message to sign (required).

Verify a Message

Verify that a message signature was generated by a given BCH address.

  • node psf-slp-wallet.js msg-verify -a bitcoincash:qr2u4f2dmva6yvf3npkd5lquryp09qk7gs5vxl423h -m "Hello World" -s IHm5fXfMTjXGOGxRnDSVCGHoBBht8MqMFhChrkmPWgr3dL922DwYbEgbSwmrNMdRaxSfYBiZEiRZyQPWE6OQVbc=
Arguments
  • Use the -a flag to specify the BCH address that generated the signature (required).
  • Use the -m flag to specify the cleartext message that was signed (required).
  • Use the -s flag to specify the signature to verify (required).

SLP Token Commands

Token Info

Get information about an SLP token. Outputs a JSON object with token metadata.

  • node psf-slp-wallet.js token-info -t 1d542ac6b26a2c85a892b79b7ec39dfba5c731b95c644cf5aef75e580f5c7660
Arguments
  • Use the -t flag to specify the token ID of the token to get information about (required).

Token Transaction History

Get the transaction history for an SLP token. Outputs a JSON object with the transaction history.

  • node psf-slp-wallet.js token-tx-history -t 1d542ac6b26a2c85a892b79b7ec39dfba5c731b95c644cf5aef75e580f5c7660
Arguments
  • Use the -t flag to specify the token ID of the token to get the transaction history for (required).

Create a Fungible Token

Create a new SLP Type1 fungible token.

  • node psf-slp-wallet.js token-create-fungible -n wallet1 -m "My Token" -t MYTOK -d 8 -q 100000000
Arguments
  • Use the -n flag to specify the name of the wallet (required).
  • Use the -m flag to specify the name of the token (required).
  • Use the -t flag to specify the ticker of the token (required).
  • Use the -d flag to specify the number of decimals of the token (required).
  • Use the -q flag to specify the quantity of tokens to create (required).
  • Use the -u flag to specify a URL to attach to the token, used for immutable data (optional).
  • Use the -h flag to specify a TX hash to attach to the token, used for mutable data (optional).

Create a Group Token

Create a new SLP Group token.

  • node psf-slp-wallet.js token-create-group -n wallet1 -m "My Group Token" -t MYGT
Arguments
  • Use the -n flag to specify the name of the wallet (required).
  • Use the -m flag to specify the name of the token (required).
  • Use the -t flag to specify the ticker of the token (required).
  • Use the -q flag to specify the quantity of tokens to create (optional).
  • Use the -u flag to specify the url of tokens to create (optional).
  • Use the -h flag to specify the hash of tokens to create (optional).

Create NFT

Create a new NFT.

  • node psf-slp-wallet.js token-create-nft -n wallet1 -m "My NFT" -t MNFT -i 9921cd7d19ca536e595f69a89fbc73e10cc446a7fe80acb3d78bd2b036997fe2
Arguments
  • Use the -n flag to specify the name of the wallet (required).
  • Use the -m flag to specify the name of the token (required).
  • Use the -t flag to specify the ticker of the token (required).
  • Use the -i flag to specify the Group token to burn, to generate the NFT (required).
  • Use the -u flag to specify the url of tokens to create (optional).
  • Use the -h flag to specify the hash of tokens to create (optional).

Mint Tokens

Mint new Fungible (Type 1) or Group tokens.

  • node psf-slp-wallet.js token-mint -n wallet1 -q 1 -t 1d542ac6b26a2c85a892b79b7ec39dfba5c731b95c644cf5aef75e580f5c7660
Arguments
  • Use the -n flag to specify the name of the wallet (required).
  • Use the -q flag to specify the quantity of tokens to create (required).
  • Use the -t flag to specify the token ID of the token to mint (required).
  • Use the -r flag to specify the receiver of the new baton (optional).

Burn Tokens

Burn a specific quantity of SLP Type1 fungible tokens.

  • node psf-slp-wallet.js token-burn -n wallet1 -q 100 -t 1d542ac6b26a2c85a892b79b7ec39dfba5c731b95c644cf5aef75e580f5c7660
Arguments
  • Use the -n flag to specify the name of the wallet (required).
  • Use the -q flag to specify the quantity of tokens to burn (required).
  • Use the -t flag to specify the token ID of the token to burn (required).

Create Mutable Data Address (MDA)

Create a new Mutable Data Address (MDA) for a token.

  • node psf-slp-wallet.js token-mda-tx -n wallet1 -a bitcoincash:qr2u4f2dmva6yvf3npkd5lquryp09qk7gs5vxl423h
Arguments
  • Use the -n flag to specify the name of the wallet to pay for transaction (required).
  • Use the -a flag to specify the Mutable Data Address (MDA) (required).

Update Token Mutable Data

Update the token to point to a new version of the mutable data.

  • node psf-slp-wallet.js token-update -n wallet1 -c ipfs://bafkreifhtcnmf577q2s5lfr46ax5qf2jnk7oy3azu5x7ceab6xajcccl3u
Arguments
  • Use the -n flag to specify the name of the wallet controlling the MDA.
  • Use the -c flag to specify the IPFS hash of the new mutable data file.

About

A CLI app for creating and managing SLP tokens.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors