@devasher/kuru-sdk
Version:
Ethers v6 SDK to interact with Kuru (forked from @kuru-labs/kuru-sdk)
34 lines • 2.17 kB
TypeScript
import { ethers, BigNumberish } from 'ethers';
import { TransactionOptions } from '../types';
/**
* @dev Constructs a transaction to approve token spending.
* @param signer - The signer instance.
* @param tokenContractAddress - The token contract address.
* @param approveTo - EOA/Contract address of spender.
* @param size - The amount of tokens to approve.
* @param txOptions - Optional transaction parameters.
* @returns A promise that resolves to the transaction request object.
*/
export declare function constructApproveTransaction(signer: ethers.AbstractSigner, tokenContractAddress: string, approveTo: string, size: BigNumberish, txOptions?: TransactionOptions): Promise<ethers.TransactionRequest>;
/**
* @dev Approves a token for spending by the market contract.
* @param tokenContract - The token contract instance.
* @param approveTo - EOA/Contract address of spender.
* @param size - The amount of tokens to approve.
* @param providerOrSigner - The provider or signer to use for the transaction.
* @param txOptions - Optional transaction parameters.
* @param waitForReceipt - Whether to wait for the transaction receipt.
* @returns A promise that resolves when the transaction is confirmed.
*/
export declare function approveToken(tokenContract: ethers.Contract, approveTo: string, size: bigint, providerOrSigner: ethers.JsonRpcProvider | ethers.AbstractSigner, txOptions?: TransactionOptions, waitForReceipt?: boolean): Promise<string | null>;
export declare function estimateApproveGas(tokenContract: ethers.Contract, approveTo: string, size: bigint): Promise<bigint>;
/**
* @dev Gets the token allowance for a specific owner and spender.
* @param tokenAddress - The token contract address.
* @param ownerAddress - The address of the token owner.
* @param spenderAddress - The address of the spender.
* @param provider - The provider instance to use for the query.
* @returns A promise that resolves to the current allowance as a bigint.
*/
export declare function getAllowance(tokenAddress: string, ownerAddress: string, spenderAddress: string, provider: ethers.Provider): Promise<bigint>;
//# sourceMappingURL=approve.d.ts.map