File: lib/tokens.ts:176-184 (approveAllowance)
export async function approveAllowance(
source: string,
tokenAddress: string,
spender: string,
amount: bigint,
expirationLedger: number = DEFAULT_EXPIRATION_LEDGER, // optional, has a default
signTx: (xdr: string, signal?) => Promise<string>, // REQUIRED, comes after
options?: { signal?: AbortSignal },
): Promise<ApproveResult>
A required parameter (signTx) sits after a parameter with a default value
(expirationLedger). TypeScript still requires the caller to pass
expirationLedger positionally to reach signTx, so the default is unreachable
in practice — every call site must write
approveAllowance(src, tok, sp, amt, DEFAULT_EXPIRATION_LEDGER, signTx).
Suggested fix
Move signTx before expirationLedger, or take a single options object.
File:
lib/tokens.ts:176-184(approveAllowance)A required parameter (
signTx) sits after a parameter with a default value(
expirationLedger). TypeScript still requires the caller to passexpirationLedgerpositionally to reachsignTx, so the default is unreachablein practice — every call site must write
approveAllowance(src, tok, sp, amt, DEFAULT_EXPIRATION_LEDGER, signTx).Suggested fix
Move
signTxbeforeexpirationLedger, or take a single options object.