Skip to content

prepareCreatingWSOLAccountAndCloseWhenDone(from_amount_payer_minRentExemption_)

bigearsenal edited this page May 17, 2022 · 1 revision

prepareCreatingWSOLAccountAndCloseWhenDone(from:amount:payer:minRentExemption:)

Prepare instructions for creating WSOL account and close it after finishing transaction to return funds back to native SOL account

public func prepareCreatingWSOLAccountAndCloseWhenDone(
        from owner: PublicKey,
        amount: Lamports,
        payer: PublicKey,
        minRentExemption mre: Lamports?
    )

Parameters

  • owner: The owner of new WSOL account
  • amount: The initial amount in Lamports to transfer to the new WSOL account
  • payer: The payer of the transaction (usually the owner)
  • mre: The min rent exemption (leave it nil if there is no pre-defined)

Returns

AccountInstructions that contains needed instructions, signers, .etc

Types
Protocols
Global Typealiases
Global Variables
Global Functions
Operators
Extensions
Clone this wiki locally