getAllowance() returns { status, code, data }. data is keyed by token address - there is no approvalNeeded/signatureNeeded field; derive those from allowance/type:
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Response shape for getAllowance.
getAllowance() returns { status, code, data }. data is keyed by token address - there is no approvalNeeded/signatureNeeded field; derive those from allowance/type:
// data shape (per token address)
type AllowanceDataEntry = {
allowance: bigint;
type: "dzap" | "permit2" | "eip2612";
};
// Example: check if any token needs an on-chain approval
const data = allowanceCheck.data ?? {};
const needsApproval = tokens.some((t) => {
const entry = data[t.address];
return entry && entry.type !== "eip2612" && entry.allowance < BigInt(t.amount);
});
// "permit2" and "eip2612" types both additionally require a sign() call before executing
const needsSignature = tokens.some((t) => data[t.address]?.type !== "dzap");