Options
All
  • Public
  • Public/Protected
  • All
Menu

Allows to setup a safety deposit box and all related accounts easily. It exposes the {@link PublicKey}s for all created accounts as well as the tokenMintPair {@link Keypair} if it was created.

Use SafetyDepositSetup.create in order to instantiate it.

The instructions need to be provided to a transaction which is executed before the instruction to add tokens to the vault. Make sure to provide the signers with that transaction.

The SafetyDepositSetup is then provided to addTokenToInactiveVault in order to create the instruction to add the tokens to the vault.

cateogry

Instructions

Hierarchy

  • SafetyDepositSetup

Index

Properties

instructions: TransactionInstruction[]
mintAmount: number
safetyDeposit: PublicKey
signers: Signer[]
store: PublicKey
tokenAccount: PublicKey
tokenMint: PublicKey
tokenMintPair?: Keypair
transferAuthority: PublicKey
transferAuthorityPair: Keypair
vault: PublicKey

Methods

  • create(connection: Connection, args: { associateTokenAccount?: boolean; mintAmount: number; payer: PublicKey; tokenAccount?: PublicKey; tokenMint?: PublicKey; vault: PublicKey }): Promise<SafetyDepositSetup>
  • Prepares a SafetyDepositBox to be setup which includes initializing needed accounts properly.

    Returns an instance of SafetyDepositSetup which exposes instructions and signers to be included with the setup transaction.

    Parameters

    • connection: Connection

      to solana cluster

    • args: { associateTokenAccount?: boolean; mintAmount: number; payer: PublicKey; tokenAccount?: PublicKey; tokenMint?: PublicKey; vault: PublicKey }
      • Optional associateTokenAccount?: boolean

        flag indicating if created tokenAccount should be associated with the payer. At this point only associated accounts are supported.

      • mintAmount: number

        the amount ot mint to the token account to include with the store

      • payer: PublicKey

        payer who will own the store that will be added to the vault

      • Optional tokenAccount?: PublicKey

        the account to hold the minted toknes, if not provided one will be created

      • Optional tokenMint?: PublicKey

        to mint tokens from, if not provided one will be created

      • vault: PublicKey

        the parent vault which will manage the store

    Returns Promise<SafetyDepositSetup>

Generated using TypeDoc