nearfundocs
The NearFun handbook
SPECIFICATION · 03

Runtime NEAR Verification

NearFun master specification

Before NearFun enables any state-changing protocol operation, verify the NEAR quote mint directly through the configured Solana Mainnet RPC.

Create:

src/lib/nearfun/verifyNearQuoteAsset.ts

Read:

3ZLekZYq2qkZiSpnSvabjit34tUkjSwD1JFuW9as9wBG

Determine:

  • account exists
  • account owner
  • token program
  • decimals
  • supply
  • mint authority
  • freeze authority

Do not scrape explorers.

Decode the actual Solana account.

Do not assume:

decimals = 9

even if external sources report 9.

Do not assume:

SPL Token Program

even if external sources report it.

Detect them.

Return a typed result.

Example conceptually:

type NearQuoteAssetVerification = {
mint: string;
exists: boolean;
tokenProgram: string;
decimals: number;
supply: bigint;
mintAuthority: string | null;
freezeAuthority: string | null;
verifiedAt: Date;
};

Use appropriate actual types.

NearFun documentation