A command-line interface for minting, sending, receiving, and checking balances of BSV tokens using the BSV SDK.
- Node.js installed
- BSV wallet configured
tsxpackage for running TypeScript files
Install dependencies:
npm installThe tools should be used in the following sequence:
First, mint new tokens:
npx tsx src/mint.tsThis will create new tokens and output the transaction details including the asset ID that will be used for subsequent operations.
Send tokens to another wallet by providing the recipient's public key and the amount:
npx tsx src/send.ts <recipient_public_key> <amount>Example:
npx tsx src/send.ts 028656505ffad07975a839a4cdf13c71318e5e7dd0e98db485137f249d9afddeff 123This will transfer the specified amount of tokens from your wallet to the recipient's public key.
Important: Before receiving tokens or checking balance, you need to switch to a different wallet profile to simulate receiving tokens from another wallet.
Switch your wallet configuration or profile to the recipient wallet before proceeding to the next steps.
Receive tokens that were sent:
npx tsx src/receive.tsThis will process incoming token transfers to your current wallet.
Finally, check your token balance:
npx tsx src/balance.tsThis will display the current token balance in your wallet.
The complete workflow is:
npx tsx src/mint.ts- Create new tokensnpx tsx src/send.ts <recipient_public_key> <amount>- Send tokens to another wallet- Switch wallet profile - Change to recipient wallet
npx tsx src/receive.ts- Receive the sent tokensnpx tsx src/balance.ts- Check the updated balance
Make sure your wallet configuration is properly set up in the config/ directory before running these commands.
@bsv/sdk- BSV Software Development Kit@bsv/message-box-client- Message box client for BSV
- Each script should be run in sequence as they depend on the state created by previous operations
- The wallet profile switch between send and receive operations is crucial for proper token transfer simulation
- Make sure your BSV wallet has sufficient funds for transaction fees