UNPKG

@0xsplits/splits-sdk

Version:

SDK for the 0xSplits protocol

86 lines (85 loc) 4.15 kB
import { Address, GetContractReturnType, Hash, Hex, Log } from 'viem'; import { BaseClientMixin, BaseGasEstimatesMixin, BaseTransactions } from './base'; import { vestingFactoryAbi } from '../constants/abi/vestingFactory'; import { vestingAbi } from '../constants/abi/vesting'; import type { CallData, CreateVestingConfig, ReadContractArgs, ReleaseVestedFundsConfig, SplitsClientConfig, StartVestConfig, TransactionConfig, TransactionFormat, SplitsPublicClient } from '../types'; type VestingAbi = typeof vestingAbi; type VestingFactoryAbi = typeof vestingFactoryAbi; declare class VestingTransactions extends BaseTransactions { constructor(transactionClientArgs: SplitsClientConfig & TransactionConfig); protected _createVestingModuleTransaction({ beneficiary, vestingPeriodSeconds, chainId, transactionOverrides, }: CreateVestingConfig): Promise<TransactionFormat>; protected _startVestTransaction({ vestingModuleAddress, tokens, transactionOverrides, }: StartVestConfig): Promise<TransactionFormat>; protected _releaseVestedFundsTransaction({ vestingModuleAddress, streamIds, transactionOverrides, }: ReleaseVestedFundsConfig): Promise<TransactionFormat>; protected _getVestingContract(vestingModule: string, chainId: number): GetContractReturnType<VestingAbi, SplitsPublicClient>; protected _getVestingFactoryContract(chainId: number): GetContractReturnType<VestingFactoryAbi, SplitsPublicClient>; } export declare class VestingClient extends VestingTransactions { readonly eventTopics: { [key: string]: Hex[]; }; readonly callData: VestingCallData; readonly estimateGas: VestingGasEstimates; constructor(clientArgs: SplitsClientConfig); _submitCreateVestingModuleTransaction(createVestingArgs: CreateVestingConfig): Promise<{ txHash: Hash; }>; createVestingModule(createVestingArgs: CreateVestingConfig): Promise<{ vestingModuleAddress: string; event: Log; }>; _submitStartVestTransaction(startVestArgs: StartVestConfig): Promise<{ txHash: Hash; }>; startVest(startVestArgs: StartVestConfig): Promise<{ events: Log[]; }>; _submitReleaseVestedFundsTransaction(releaseFundsArgs: ReleaseVestedFundsConfig): Promise<{ txHash: Hash; }>; releaseVestedFunds(releaseFundsArgs: ReleaseVestedFundsConfig): Promise<{ events: Log[]; }>; predictVestingModuleAddress({ beneficiary, vestingPeriodSeconds, chainId, }: CreateVestingConfig): Promise<{ address: Address; exists: boolean; }>; getBeneficiary({ vestingModuleAddress, chainId, }: ReadContractArgs & { vestingModuleAddress: string; }): Promise<{ beneficiary: Address; }>; getVestingPeriod({ vestingModuleAddress, chainId, }: ReadContractArgs & { vestingModuleAddress: string; }): Promise<{ vestingPeriod: bigint; }>; getVestedAmount({ vestingModuleAddress, streamId, chainId, }: ReadContractArgs & { vestingModuleAddress: string; streamId: string; }): Promise<{ amount: bigint; }>; getVestedAndUnreleasedAmount({ vestingModuleAddress, streamId, chainId, }: ReadContractArgs & { vestingModuleAddress: string; streamId: string; }): Promise<{ amount: bigint; }>; } export interface VestingClient extends BaseClientMixin { } declare class VestingGasEstimates extends VestingTransactions { constructor(clientArgs: SplitsClientConfig); createVestingModule(createVestingArgs: CreateVestingConfig): Promise<bigint>; startVest(startVestArgs: StartVestConfig): Promise<bigint>; releaseVestedFunds(releaseFundsArgs: ReleaseVestedFundsConfig): Promise<bigint>; } interface VestingGasEstimates extends BaseGasEstimatesMixin { } declare class VestingCallData extends VestingTransactions { constructor(clientArgs: SplitsClientConfig); createVestingModule(createVestingArgs: CreateVestingConfig): Promise<CallData>; startVest(startVestArgs: StartVestConfig): Promise<CallData>; releaseVestedFunds(releaseFundsArgs: ReleaseVestedFundsConfig): Promise<CallData>; } export {};