@cryptoalgebra/alm-sdk
Version:
Algebra ALM SDK
27 lines (26 loc) • 1.2 kB
TypeScript
import { Provider } from '@ethersproject/providers';
import { Contract } from '@ethersproject/contracts';
import { BigNumber, Signer } from 'ethers';
import { SupportedChainId } from '../types';
interface Call {
target: string;
gasLimit: number;
callData: string;
}
export interface Result {
success: boolean;
gasUsed: BigNumber;
returnData: string;
}
export declare function getMulticallContract(chainId: SupportedChainId, provider: Provider | Signer): Contract;
export declare function multicall(calls: Call[], chainId: SupportedChainId, provider: Provider | Signer): Promise<Result[]>;
export declare function encodeTotalAmountsCall(vaultAddress: string): Call;
export declare function encodeTotalSupplyCall(vaultAddress: string): Call;
export declare function encodeDecimalsCall(tokenAddress: string): Call;
export declare function decodeTotalAmountsResult(result: Result, vaultAddress: string): {
total0: BigNumber;
total1: BigNumber;
};
export declare function decodeTotalSupplyResult(result: Result, vaultAddress: string): BigNumber;
export declare function decodeDecimalsResult(result: Result, tokenAddress: string): number;
export {};