Interact solana wallet using web3.js
v2
The recommended way to connect a solana wallet in frontend code is using @solana/wallet-adapter-base
and concrete adapter like @solana/wallet-adapter-phantom
But these package has some limitations:
- Outdated, hasn't been updated for years
- Depends on
web3.js
V1, This library depends on legacy version of bs58 which depends on node:buffer which would cause my cloudflare pages app crash
This is just a demo project for me to learn the new web3.js
V2 api, Most code is copied from https://github.com/solana-labs/solana-web3.js/tree/master/examples/react-app
The official supported framework is react, but I don't like it, so I rewrite in sveltekit
How to run locally:
bun i
bun run dev # http://localhost:5173