Type alias FreezeTokenPaymentGuardRouteSettings

FreezeTokenPaymentGuardRouteSettings: {
    path: "initialize";
    period: number;
    candyGuardAuthority: Signer;
} | {
    path: "thaw";
    nftMint: PublicKey;
    nftOwner: PublicKey;
} | {
    path: "unlockFunds";
    candyGuardAuthority: Signer;
}

The settings for the freezeTokenPayment guard that should be provided when accessing the guard's special "route" instruction.

Initialize

The initialize path creates the freeze escrow account that will hold the funds until all NFTs are thawed. It must be called before any NFTs can be minted.

await metaplex.candyMachines().callGuardRoute({
candyMachine,
guard: 'freezeTokenPayment',
settings: {
path: 'initialize',
period: 15 * 24 * 60 * 60, // 15 days.
candyGuardAuthority,
},
});

Thaw

The thaw path unfreezes one NFT if one of the following conditions are met:

  • All NFTs have been minted.
  • The configured period has elapsed (max 30 days).
  • The Candy Machine account was deleted.

Anyone can call this instruction. Since the funds are not transferrable until all NFTs are thawed, it creates an incentive for the treasury to thaw all NFTs as soon as possible.

await metaplex.candyMachines().callGuardRoute({
candyMachine,
guard: 'freezeTokenPayment',
settings: {
path: 'thaw',
nftMint: nftToThaw.address,
nftOwner: nftToThaw.token.ownerAddress,
},
});

Unlock Funds

The unlockFunds path transfers all of the escrow funds to the configured destination token address once all NFTs have been thawed.

await metaplex.candyMachines().callGuardRoute({
candyMachine,
guard: 'freezeTokenPayment',
settings: {
path: 'unlockFunds',
candyGuardAuthority,
},
});

See

FreezeTokenPaymentGuardSettings for more information on the freezeTokenPayment guard itself.

Generated using TypeDoc