-
Notifications
You must be signed in to change notification settings - Fork 7
JS helper: Unwrap #57
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
a740634
to
63fb236
Compare
a95f5e8
to
c6fcb5f
Compare
c6fcb5f
to
f586c2b
Compare
} | ||
return getTokenDecoder().decode(account.data).mint; | ||
} | ||
|
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.
Everything below this comment was moved from src/wrap.ts
given combinedMultisigTx
is a shared function between both wrap and unwrap helpers.
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!
export interface SingleSignerUnwrapArgs { | ||
rpc: Rpc<GetAccountInfoApi>; | ||
blockhash: { | ||
blockhash: Blockhash; | ||
lastValidBlockHeight: bigint; | ||
}; | ||
payer: TransactionSigner; // Fee payer and default transfer authority | ||
wrappedTokenAccount: Address; | ||
unwrappedEscrow: Address; | ||
amount: bigint | number; | ||
recipientUnwrappedToken: Address; | ||
// Optional arguments below (will be derived/defaulted if not provided) | ||
transferAuthority?: Address | TransactionSigner; // Defaults to payer | ||
unwrappedMint?: Address; // Will derive from unwrappedEscrow if not provided | ||
wrappedTokenProgram?: Address; // Will derive from wrappedTokenAccount if not provided | ||
unwrappedTokenProgram?: Address; // Will derive from unwrappedEscrow if not provided | ||
} |
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.
Optional for a follow up PR - it might be worth using TSDoc here: https://tsdoc.org
The benefit would be that this param documentation will show inline in the editor for someone creating this, while these comments typically won't
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.
Ah, good to know!
The final javascript helper for the Token Wrap program. Mirrors the Rust work done in #47.
Logic largely follows Wrapping work: #53