equation-sdk
Version:
🛠An SDK for building applications on top of Equation.
32 lines (31 loc) • 1.21 kB
TypeScript
import { Contract, Wallet } from 'ethers';
export default class Approval {
provider: Wallet;
tokenAddress: string;
ApprovalTokenContract: Contract;
RouterContract: Contract;
constructor(provider: Wallet);
/**
* Fetches the allowance amount for the specified spender.
* @param spender - The contract address of the spender.
* @returns The formatted allowance amount.
*/
fetchAllowance(spender: string): Promise<string>;
/**
* Approves the spender to spend tokens on behalf of the contract.
* @param spender - The contract address of the spender.
* @returns A Promise that resolves to the result of the approval transaction.
*/
approvalToken(spender: string): Promise<void>;
/**
* Checks if the plugin is approved by the spender.
* @param spender - The contract address of the spender.
* @returns A Promise that resolves to the approval status.
*/
isPluginApproved(spender: string): Promise<any>;
/**
* Approves a plugin for spending tokens.
* @param spender - The address of the plugin to be approved.
*/
approvalPlugin(spender: string): Promise<void>;
}