StakePoolProgram.createTokenMetadata constructor

StakePoolProgram.createTokenMetadata({
  1. required SolAddress stakePool,
  2. required SolAddress manager,
  3. required SolAddress tokenMetadata,
  4. required SolAddress withdrawAuthority,
  5. required SolAddress poolMint,
  6. required SolAddress payer,
  7. required StakePoolCreateTokenMetaDataLayout layout,
})

Create token metadata for the stake-pool token in the metaplex-token program

Implementation

factory StakePoolProgram.createTokenMetadata({
  /// Stake pool
  required SolAddress stakePool,

  /// Manager
  required SolAddress manager,

  /// Token metadata account
  required SolAddress tokenMetadata,

  /// Stake pool withdraw authority
  required SolAddress withdrawAuthority,

  /// Pool token mint account
  required SolAddress poolMint,

  /// Payer for creation of token metadata account
  required SolAddress payer,
  required StakePoolCreateTokenMetaDataLayout layout,
}) {
  return StakePoolProgram(
      layout: layout,
      keys: [
        stakePool.toReadOnly(),
        manager.toSigner(),
        withdrawAuthority.toReadOnly(),
        poolMint.toReadOnly(),
        payer.toSignerAndWritable(),
        tokenMetadata.toWritable(),
        SPLTokenProgramConst.metaDataProgramId.toReadOnly(),
        SystemProgramConst.programId.toReadOnly(),
        SystemProgramConst.sysvarRentPubkey.toReadOnly(),
      ],
      programId: StakePoolProgramConst.programId);
}