Skip to content

Conversation

grod220
Copy link
Member

@grod220 grod220 commented Mar 18, 2025

Creating a js client library for calling the CreateMint instruction (1 of 3 total). Attempts to use solana kit as the base library.

Walkthrough for testing locally:

  1. Build program
cargo build-sbf # generates .so file
cargo build # builds binary
  1. Start solana test validator
solana-test-validator \
  --bpf-program TwRapQCDhWkZRrDaHfZGuHxkZ91gHDRkyuzNqeU5MgR target/deploy/spl_token_wrap.so \
  --reset
  1. Create a new mint & token account
spl-token create-token
# Example will have G85DDQCoHchhDFWtUFT2MDkfUPYQt8BvViFyjGv167xb for this
spl-token create-account G85DDQCoHchhDFWtUFT2MDkfUPYQt8BvViFyjGv167xb
spl-token mint G85DDQCoHchhDFWtUFT2MDkfUPYQt8BvViFyjGv167xb 100000
  1. Update token-wrap/clients/js/example.ts with your keypair + unwrapped mint address generated above

  2. Install deps

cd ./token-wrap/clients/js
pnpm install
  1. Run example
pnpm example:create-mint
  1. See expected output
Wrapped Mint: 4yvMNhbXqbZC7oYrgNY3dYhsRsGUK4Cdsz5RVwDBJTnH
Backpointer: A4hV7H5NY6xNSfeWa1goAJeEkRYrctUFoLjiThDfTJN7
Funded wrapped mint lamports: 1461600n
Funded backpointer lamports: 1113600n
Signature: 47DidWXkH62Bzj8bq3fpN737ofUXUvZGq2U2U9oTQuQKgmDS2mnyHGmatEWN2Rjwj8ADwqNShsS8nbQQeAphVyU4

@grod220 grod220 force-pushed the js-client-create-mint branch from 9fa582b to 8bda420 Compare March 18, 2025 19:27
@grod220 grod220 marked this pull request as ready for review March 18, 2025 19:30
@grod220 grod220 force-pushed the js-client-create-mint branch 3 times, most recently from 1788e87 to 0537f3f Compare March 20, 2025 11:38
@grod220 grod220 requested a review from lorisleiva March 20, 2025 11:40
Copy link
Member

@lorisleiva lorisleiva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm impressed! I've made some comments/suggestions on the JS client. Let me know what you think.

@grod220 grod220 requested a review from lorisleiva March 21, 2025 09:59
Copy link
Member

@lorisleiva lorisleiva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice! Just a few last comments/suggestions but it's good to merge after that. 👌

@grod220 grod220 force-pushed the js-client-create-mint branch 2 times, most recently from 6aac777 to c08745e Compare March 24, 2025 11:01
@grod220 grod220 force-pushed the js-client-create-mint branch from c08745e to ce23112 Compare March 24, 2025 11:02
@grod220 grod220 merged commit b809a7d into main Mar 24, 2025
10 checks passed
@grod220 grod220 deleted the js-client-create-mint branch March 24, 2025 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants