SPLTokenProgram.syncNative constructor
SPLTokenProgram.syncNative({
- required SolAddress account,
- 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);
}