@0xsplits/splits-sdk
Version:
SDK for the 0xSplits protocol
99 lines (98 loc) • 4.97 kB
TypeScript
import { Address, GetContractReturnType, Hash, Hex, Log } from 'viem';
import { BaseClientMixin, BaseGasEstimatesMixin, BaseTransactions } from './base';
import { waterfallAbi } from '../constants/abi/waterfall';
import type { CallData, CreateWaterfallConfig, ReadContractArgs, RecoverNonWaterfallFundsConfig, SplitsClientConfig, SplitsPublicClient, TransactionConfig, TransactionFormat, WaterfallFundsConfig, WithdrawWaterfallPullFundsConfig } from '../types';
type WaterfallAbi = typeof waterfallAbi;
declare class WaterfallTransactions extends BaseTransactions {
constructor(transactionClientArgs: SplitsClientConfig & TransactionConfig);
protected _createWaterfallModuleTransaction({ token, tranches, nonWaterfallRecipient, chainId, transactionOverrides, }: CreateWaterfallConfig): Promise<TransactionFormat>;
protected _waterfallFundsTransaction({ waterfallModuleAddress, usePull, transactionOverrides, }: WaterfallFundsConfig): Promise<TransactionFormat>;
protected _recoverNonWaterfallFundsTransaction({ waterfallModuleAddress, token, recipient, chainId, transactionOverrides, }: RecoverNonWaterfallFundsConfig): Promise<TransactionFormat>;
protected _withdrawPullFundsTransaction({ waterfallModuleAddress, address, transactionOverrides, }: WithdrawWaterfallPullFundsConfig): Promise<TransactionFormat>;
private _validateRecoverTokensWaterfallData;
protected _getWaterfallContract(waterfallModule: string, chainId: number): GetContractReturnType<WaterfallAbi, SplitsPublicClient>;
}
export declare class WaterfallClient extends WaterfallTransactions {
readonly eventTopics: {
[key: string]: Hex[];
};
readonly callData: WaterfallCallData;
readonly estimateGas: WaterfallGasEstimates;
constructor(clientArgs: SplitsClientConfig);
_submitCreateWaterfallModuleTransaction(createWaterfallArgs: CreateWaterfallConfig): Promise<{
txHash: Hash;
}>;
createWaterfallModule(createWaterfallArgs: CreateWaterfallConfig): Promise<{
waterfallModuleAddress: string;
event: Log;
}>;
_submitWaterfallFundsTransaction(waterfallFundsArgs: WaterfallFundsConfig): Promise<{
txHash: Hash;
}>;
waterfallFunds(waterfallFundsArgs: WaterfallFundsConfig): Promise<{
event: Log;
}>;
_submitRecoverNonWaterfallFundsTransaction(recoverFundsArgs: RecoverNonWaterfallFundsConfig): Promise<{
txHash: Hash;
}>;
recoverNonWaterfallFunds(recoverFundsArgs: RecoverNonWaterfallFundsConfig): Promise<{
event: Log;
}>;
_submitWithdrawPullFundsTransaction(withdrawFundsArgs: WithdrawWaterfallPullFundsConfig): Promise<{
txHash: Hash;
}>;
withdrawPullFunds(withdrawFundsArgs: WithdrawWaterfallPullFundsConfig): Promise<{
event: Log;
}>;
getDistributedFunds({ waterfallModuleAddress, chainId, }: ReadContractArgs & {
waterfallModuleAddress: string;
}): Promise<{
distributedFunds: bigint;
}>;
getFundsPendingWithdrawal({ waterfallModuleAddress, chainId, }: ReadContractArgs & {
waterfallModuleAddress: string;
}): Promise<{
fundsPendingWithdrawal: bigint;
}>;
getTranches({ waterfallModuleAddress, chainId, }: ReadContractArgs & {
waterfallModuleAddress: string;
}): Promise<{
recipients: Address[];
thresholds: bigint[];
}>;
getNonWaterfallRecipient({ waterfallModuleAddress, chainId, }: ReadContractArgs & {
waterfallModuleAddress: string;
}): Promise<{
nonWaterfallRecipient: Address;
}>;
getToken({ waterfallModuleAddress, chainId, }: ReadContractArgs & {
waterfallModuleAddress: string;
}): Promise<{
token: Address;
}>;
getPullBalance({ waterfallModuleAddress, address, chainId, }: ReadContractArgs & {
waterfallModuleAddress: string;
address: string;
}): Promise<{
pullBalance: bigint;
}>;
}
export interface WaterfallClient extends BaseClientMixin {
}
declare class WaterfallGasEstimates extends WaterfallTransactions {
constructor(clientArgs: SplitsClientConfig);
createWaterfallModule(createWaterfallArgs: CreateWaterfallConfig): Promise<bigint>;
waterfallFunds(waterfallFundsArgs: WaterfallFundsConfig): Promise<bigint>;
recoverNonWaterfallFunds(recoverFundsArgs: RecoverNonWaterfallFundsConfig): Promise<bigint>;
withdrawPullFunds(withdrawArgs: WithdrawWaterfallPullFundsConfig): Promise<bigint>;
}
interface WaterfallGasEstimates extends BaseGasEstimatesMixin {
}
declare class WaterfallCallData extends WaterfallTransactions {
constructor(clientArgs: SplitsClientConfig);
createWaterfallModule(args: CreateWaterfallConfig): Promise<CallData>;
waterfallFunds(args: WaterfallFundsConfig): Promise<CallData>;
recoverNonWaterfallFunds(args: RecoverNonWaterfallFundsConfig): Promise<CallData>;
withdrawPullFunds(args: WithdrawWaterfallPullFundsConfig): Promise<CallData>;
}
export {};