SPLTokenProgram.setAuthority constructor

SPLTokenProgram.setAuthority({
  1. required SPLTokenSetAuthorityLayout layout,
  2. required SolAddress account,
  3. required SolAddress currentAuthority,
  4. SolAddress programId = SPLTokenProgramConst.tokenProgramId,
  5. List<SolAddress> multiSigners = const [],
})

Sets a new authority of a mint or account.

Implementation

factory SPLTokenProgram.setAuthority({
  required SPLTokenSetAuthorityLayout layout,

  /// The mint or account to change the authority of.
  required SolAddress account,

  /// The current authority of the mint or account.
  required SolAddress currentAuthority,
  SolAddress programId = SPLTokenProgramConst.tokenProgramId,

  /// Multisignature authority.
  List<SolAddress> multiSigners = const [],
}) {
  return SPLTokenProgram(
      layout: layout,
      keys: SPLTokenUtils.buildKeys(keys: [
        account.toWritable(),
      ], owner: currentAuthority, multiSigners: multiSigners),
      programId: programId);
}