pharos-agent-kit
Version:
Connect AI Agents to Pharos protocols
28 lines • 1.24 kB
TypeScript
import { PharosWalletProvider } from "../wallet-providers";
/**
* Approves a spender to spend tokens on behalf of the owner
*
* @param wallet - The wallet provider
* @param tokenAddress - The address of the token contract
* @param spenderAddress - The address of the spender
* @param amount - The amount to approve in atomic units (wei)
* @returns A success message or error message
*/
export declare function approve(wallet: PharosWalletProvider, tokenAddress: string, spenderAddress: string, amount: bigint): Promise<string>;
/**
* Scales a gas estimate by a given multiplier.
*
* This function converts the gas estimate to a number, applies the multiplier,
* rounds the result to the nearest integer, and returns it as a bigint.
*
* @param gas - The original gas estimate (bigint).
* @param multiplier - The factor by which to scale the estimate.
* @returns The adjusted gas estimate as a bigint.
*/
export declare function applyGasMultiplier(gas: bigint, multiplier: number): bigint;
export * from "../utils/formatPharos";
export * from "../utils/getTokenDecimals";
export * from "../utils/isContract";
export * from "../utils/getBalance";
export * from "../utils/approveTokens";
//# sourceMappingURL=index.d.ts.map