npm install
Run solana vadidator local:
solana-test-validator --reset
Run Unit test
anchor test --skip-local-validator
Result example:
- The program deployed on devnet.
const programId = swapEsYJ7iLDbYeg9154yR1dsUjumanS7LF9KEiJQae
const mintAddress = HVTEudbUMJaMRzCnQ2fo1cq6vL9gqHD9mYbvYhfkmQuh
Run swap:
npx ts-node client/swap.ts
- Currently, I have set default SOL value for swap: 0.5 SOL -> receive 5 Token. use specified value at here
- I made public
authority
,master authority
, anduser
private key for convenient testing. All wallet have already been airdrop SOL for network fees.