Skip to main content

transfer

Transfers ownership of the aseet to a new public key. When the asset or the group asset has royalty constraints associated, these are validated during the transfer.

Accounts

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

NameWritableSignerOptionalDescription
assetAsset account
signerCurrent owner of the asset or transfer delegate
recipientRecipient of the asset
groupGroup asset account of the asset

The group is required when the asset is part of a group. The rationale is that royalties can be set at the group level and they need to be validated.

info

For assets with associated royalties, the transfer will fail if the royalties constraint is not satisfied.

Arguments

None.

Examples

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

// Accounts:
// - asset: PublicKey
// - signer: KeypairSigner
// - recipient: PublicKey
await transfer(umi, {
asset,
signer,
recipient,
}).sendAndConfirm(umi);