-
Notifications
You must be signed in to change notification settings - Fork 7
CLI helper: Unwrap #47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
59b308c
to
4db885c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!! I think this looks great.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks really good! Mostly small things
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few last things, looking really close!
/// The address of the token account to receive the unwrapped tokens | ||
#[clap(value_parser = parse_pubkey)] | ||
pub unwrapped_token_recipient: Pubkey, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be done in a separate command, but it would be good to have a way to find out: "Given a mint address, is this a wrapped token mint? If so, what's it wrapping?"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
Final CLI helper: Unwrap instruction. Converts wrapped tokens back into the original unwrapped version.
Walkthrough for testing locally:
cargo build-sbf && cargo build
token-wrap
commandspl-token create-account 8XFsJ3v6zycqQaxhmgLQtYrYNCxL52q8ERWeZHNh3EDv --owner 4WGS8PTY9fetLDY9nn3wBUWSGm92ysX5TaR3svKCPneQ --fee-payer /Users/gabe/.config/solana/id.json # Escrow: 5GcUo7Dk2kdoZc1MD5gwXrbpufm3VoXZj7qLda62g6Qe
spl-token create-account 3KdPWyHmyVDThDjf4jE6m4sxmgYev9sSG74GW9BcFyK9 --program-id TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb # recipient account: EJPFBmkU7gnV2KmaQwQsm3sgY3BqMqknRQYGeJ4Ac7Bx