This project demonstrates how to use the ao-process-clients
library to interact with various AO processes, including Bazar NFTs, tokens, and oracles.
-
Install dependencies:
npm install
-
Make sure you have a valid Arweave wallet file. The default path is set to
../arweave-keyfile-jAmz_Wcc_3ZeO_b5iruLNnI1e-ObZ9A8wHMKacigJ_g.json
in the.env
file. Update this path if your wallet is located elsewhere.
The project includes several scripts to demonstrate different aspects of AO process integration:
To create a new NFT collection:
node create-nft-collection.js
This will:
- Create a new NFT collection with the name "Test NFT Collection" and ticker "TESTNFT"
- Save the process ID to
nft-process-id.txt
for use in other scripts
To mint NFTs from your collection:
node mint-nft.js
This will:
- Read the process ID from
nft-process-id.txt
- Mint 1 NFT to your wallet
- Display your current balance
To transfer NFTs to another wallet:
node transfer-nft.js
This will:
- Read the process ID from
nft-process-id.txt
- Transfer 1 NFT to the specified recipient address
- Display your new balance after the transfer
- The scripts use the wallet specified in the
.env
file for all operations - Make sure your wallet has sufficient balance for the operations
- The recipient address in
transfer-nft.js
is set to an example address. Update it with the actual recipient address before running the script.
To fetch the price of Arweave tokens:
node arweave-price.js
This will:
- Connect to the oracle process
- Fetch the current price of WRAPPED_ARWEAVE tokens
- Display the price information
- Save the price to
arweave-price.json
To explore liquidity pools:
node test-liquidity-pool.js
This will:
- Connect to the AO/qAR liquidity pool
- Retrieve information about the pool
- Attempt to fetch token prices
To see a demonstration of various AO process clients:
node ao-clients-demo.js
This will:
- Demonstrate TokenClient, NftClient, CollectionClient, and BotegaLiquidityPoolClient
- Show available methods and functionality
- Connect to various AO processes
- If you encounter errors related to the wallet, make sure the path in
.env
is correct and the wallet file is valid - If you encounter errors related to the process ID, make sure you're using valid process IDs
- If operations fail, check that you have the necessary permissions
- For price fetching issues, try using the oracle process directly with the
arweave-price.js
script