Skip to main content

close

Closes an uninitialized (buffer) asset account, returning the rent funds. This instruction is used to close an account created by allocate, either because the asset was not created or the account was only used as a buffer for update.

Accounts

Below is the list of accounts expected by the close instruction.

NameWritableSignerOptionalDescription
assetUninitialized (buffer) asset account
recipientAccount receiving refunded rent

Arguments

None.

Examples

import { close } from '@nifty-oss/asset';

// Accounts:
// - buffer: KeypairSigner
// - recipient: PublicKey
await close(umi, {
buffer,
recipient,
}).sendAndConfirm(umi);