paraUSD Allowance (fetchParabolUSDAllowance)
This method fetches the paraUSD allowance to a spender from a wallet address.
import {
SupportedChainIds,
getContractAddress,
ContractTarget,
} from "@parabolfi/core";
import { ParabolServer } from "@parabolfi/server";
const parabolServer = new ParabolServer({
apiKey: process.env.PARABOL_API_KEY,
});
const rspAddress = getContractAddress(
chain,
ContractTarget.ReserveStabilityPool
);
const chain = SupportedChainIds.ZKSYNC;
const walletAddress = "0x...";
const allowance = await parabolServer.fetchParabolUSDAllowance(
walletAddress,
rspAddress,
[chain]
);
ℹ️
You can get the Reserve Stability Pool address from the Smart Contracts page.
Response
{
"324": {
"owner": "0x4ea830109b8df82d4e05f1fa7780b27f8f6dc7d7",
"spender": "0x454db664fdd3d873271512a4b972bdf18c5a0bc3",
"value": "0"
}
}
owner
is the wallet address of the allowance.spender
is the spender of the allowance.value
is the allowance value based on paraUSD decimals (18) in wei.