SPLTokenProgram.syncNative constructor

SPLTokenProgram.syncNative({
  1. required SolAddress account,
  2. SolAddress programId = SPLTokenProgramConst.tokenProgramId,
})

Given a wrapped / native token account (a token account containing SOL) updates its amount field based on the account's underlying lamports.

Implementation

factory SPLTokenProgram.syncNative(
    {
    /// The native token account to sync with its underlying
    /// lamports.
    required SolAddress account,
    SolAddress programId = SPLTokenProgramConst.tokenProgramId}) {
  return SPLTokenProgram(
      layout: SPLTokenSyncNativeLayout(),
      keys: [account.toWritable()],
      programId: programId);
}