npm install
or yarn- Write code in
index.js
npm run start
- initializeKeypair:
- takes a connection obj
- takes optional filePath, if you provide the keypair file path like
~/.config/solana/id.json
which is the default keypair for Solana CLI it will take the keypair from there and consider them as payer - if not it will generate a new keypair and store them in the .env to use them in the future with any other transaction
- it will airdrop SOL for the payer account if need
- uploadOffChainMetadata:
- take metadata inputs like name, symbol, description, and image
- uploads them to an off-chain storage provide
- return a URI that points to that metadata JSON