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.
This software requires node.js v20 or higher. Instructions for installation:
git clone https://github.com/Permissionless-Software-Foundation/psf-slp-walletcd psf-slp-walletnpm install
node psf-slp-wallet.js help
Create a new wallet.
node psf-slp-wallet.js wallet-create -n wallet1 -d "My first wallet"
- Use the
-nflag to specify the name of the wallet (required). - Use the
-dflag to specify a description for the wallet (optional).
List all existing wallets.
node psf-slp-wallet.js wallet-list
- No arguments required.
List the different addresses (Cash, SLP, Legacy) for a wallet.
node psf-slp-wallet.js wallet-addrs -n wallet1
- Use the
-nflag to specify the name of the wallet (required).
Get the balance of a wallet in BCH and SLP tokens.
node psf-slp-wallet.js wallet-balance -n wallet1
- Use the
-nflag to specify the name of the wallet (required).
Sweep BCH and SLP tokens from a WIF private key into the wallet.
node psf-slp-wallet.js wallet-sweep -n wallet1 -w L1qFRBqMdS9kBMmLPSCpT2BHRcBF9iGaQsR5G85FLRe5bUUoAYee
- Use the
-nflag to specify the name of the wallet receiving the funds (required). - Use the
-wflag to specify the WIF private key to sweep (required).
Send BCH to an address.
node psf-slp-wallet.js send-bch -n wallet1 -a bitcoincash:qr2u4f2dmva6yvf3npkd5lquryp09qk7gs5vxl423h -q 0.001
- Use the
-nflag to specify the name of the wallet sending BCH (required). - Use the
-aflag to specify the address to send BCH to (required). - Use the
-qflag to specify the quantity of BCH to send (required).
Send SLP tokens to an address.
node psf-slp-wallet.js send-tokens -n wallet1 -a simpleledger:qr2u4f2dmva6yvf3npkd5lquryp09qk7gsvfq5kzsu -q 1 -t 1d542ac6b26a2c85a892b79b7ec39dfba5c731b95c644cf5aef75e580f5c7660
- Use the
-nflag to specify the name of the wallet sending tokens (required). - Use the
-aflag to specify the address to send tokens to (required). - Use the
-qflag to specify the quantity of tokens to send (required). - Use the
-tflag to specify the token ID of the token to send (required).
Cryptographically sign a message using the wallet's private key.
node psf-slp-wallet.js msg-sign -n wallet1 -m "Hello World"
- Use the
-nflag to specify the name of the wallet to sign with (required). - Use the
-mflag to specify the message to sign (required).
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=
- Use the
-aflag to specify the BCH address that generated the signature (required). - Use the
-mflag to specify the cleartext message that was signed (required). - Use the
-sflag to specify the signature to verify (required).
Get information about an SLP token. Outputs a JSON object with token metadata.
node psf-slp-wallet.js token-info -t 1d542ac6b26a2c85a892b79b7ec39dfba5c731b95c644cf5aef75e580f5c7660
- Use the
-tflag to specify the token ID of the token to get information about (required).
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
- Use the
-tflag to specify the token ID of the token to get the transaction history for (required).
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
- Use the
-nflag to specify the name of the wallet (required). - Use the
-mflag to specify the name of the token (required). - Use the
-tflag to specify the ticker of the token (required). - Use the
-dflag to specify the number of decimals of the token (required). - Use the
-qflag to specify the quantity of tokens to create (required). - Use the
-uflag to specify a URL to attach to the token, used for immutable data (optional). - Use the
-hflag to specify a TX hash to attach to the token, used for mutable data (optional).
Create a new SLP Group token.
node psf-slp-wallet.js token-create-group -n wallet1 -m "My Group Token" -t MYGT
- Use the
-nflag to specify the name of the wallet (required). - Use the
-mflag to specify the name of the token (required). - Use the
-tflag to specify the ticker of the token (required). - Use the
-qflag to specify the quantity of tokens to create (optional). - Use the
-uflag to specify the url of tokens to create (optional). - Use the
-hflag to specify the hash of tokens to create (optional).
Create a new NFT.
node psf-slp-wallet.js token-create-nft -n wallet1 -m "My NFT" -t MNFT -i 9921cd7d19ca536e595f69a89fbc73e10cc446a7fe80acb3d78bd2b036997fe2
- Use the
-nflag to specify the name of the wallet (required). - Use the
-mflag to specify the name of the token (required). - Use the
-tflag to specify the ticker of the token (required). - Use the
-iflag to specify the Group token to burn, to generate the NFT (required). - Use the
-uflag to specify the url of tokens to create (optional). - Use the
-hflag to specify the hash of tokens to create (optional).
Mint new Fungible (Type 1) or Group tokens.
node psf-slp-wallet.js token-mint -n wallet1 -q 1 -t 1d542ac6b26a2c85a892b79b7ec39dfba5c731b95c644cf5aef75e580f5c7660
- Use the
-nflag to specify the name of the wallet (required). - Use the
-qflag to specify the quantity of tokens to create (required). - Use the
-tflag to specify the token ID of the token to mint (required). - Use the
-rflag to specify the receiver of the new baton (optional).
Burn a specific quantity of SLP Type1 fungible tokens.
node psf-slp-wallet.js token-burn -n wallet1 -q 100 -t 1d542ac6b26a2c85a892b79b7ec39dfba5c731b95c644cf5aef75e580f5c7660
- Use the
-nflag to specify the name of the wallet (required). - Use the
-qflag to specify the quantity of tokens to burn (required). - Use the
-tflag to specify the token ID of the token to burn (required).
Create a new Mutable Data Address (MDA) for a token.
node psf-slp-wallet.js token-mda-tx -n wallet1 -a bitcoincash:qr2u4f2dmva6yvf3npkd5lquryp09qk7gs5vxl423h
- Use the
-nflag to specify the name of the wallet to pay for transaction (required). - Use the
-aflag to specify the Mutable Data Address (MDA) (required).
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
- Use the
-nflag to specify the name of the wallet controlling the MDA. - Use the
-cflag to specify the IPFS hash of the new mutable data file.