This repository contains a TypeScript script for interacting with the BARK token on the Solana blockchain using the Solana Web3.js library and the SPL Token program.
This TypeScript script demonstrates the creation, initialization, and interaction with a custom token (BARK) on the Solana blockchain. It covers various functions, including minting, transferring tokens with fees, fee withdrawal, and more.
- Minting BARK tokens on the Solana blockchain.
- Transferring BARK tokens with fees.
- Withdrawing fees from BARK accounts.
- Creating a new fee account.
- Harvesting and transferring withheld fees.
- Checking BARK token and Solana account balances.
- Node.js (v14 or higher)
- npm (Node Package Manager)
- Solana devnet cluster access
- Solana wallet with sufficient funds for transaction fees
Solana Explorer:
- Devnet:
- Testnet:
- Mainnet:
-
Clone the repository:
git clone https://github.com/bark-community/bark-token-program.git cd bark -
Install dependencies:
npm install
-
Configure your Solana wallet details in the script.
-
Execute the script:
npm start
Ensure that you have met the requirements and have configured the script with your Solana wallet details. Run the script to perform various BARK token interactions on the Solana blockchain.
- initializeMintAccount(): Initializes the Mint BARK account.
- initializeSolanaAccounts(): Initializes source and destination Solana token accounts.
- transferBarkWithFee(): Transfers BARK tokens with fees.
- withdrawFees(): Withdraws fees from BARK accounts.
- createFeeAccount(): Creates a new fee account.
- harvestWithheldTokensToMint(): Harvests withheld fees and transfers to the Mint BARK account.
- checkBarkBalance(): Checks the BARK token balance of the wallet.
- checkBalance(): Checks the Solana account balance of the wallet.
Contributions are welcome! If you find a bug or have an enhancement in mind, please open an issue or submit a pull request following the contribution guidelines.