TokenAccountResponse.fromJson constructor

TokenAccountResponse.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory TokenAccountResponse.fromJson(Map<String, dynamic> json) {
  final account = SolanaAccountInfo.fromJson(json["account"]);
  final tokenAccount = SolanaTokenAccount.fromBuffer(
      data: account.toBytesData(), address: account.owner);
  return TokenAccountResponse(
      pubkey: SolAddress.uncheckCurve(json["pubkey"]),
      account: account,
      tokenAccount: tokenAccount);
}