@0xsplits/splits-sdk
Version:
SDK for the 0xSplits protocol
31 lines (30 loc) • 2 kB
TypeScript
import { Address } from 'viem';
import { ContractRecoupTranche, RecoupTrancheInput, SplitRecipient, SplitsPublicClient, SplitV2Type, WaterfallTrancheInput } from '../types';
import { IRecipient } from '../subgraph/types';
export * from './ens';
export * from './numbers';
export * from './swapper';
export * from './validation';
export * from './balances';
export * from './requests';
export * from './tokens';
export declare const getRecipientSortedAddressesAndAllocations: (recipients: SplitRecipient[]) => [Address[], bigint[]];
export declare const getNftCountsFromPercents: (percentAllocations: bigint[]) => number[];
export declare const getTrancheRecipientsAndSizes: (chainId: number, token: Address, tranches: WaterfallTrancheInput[], publicClient: SplitsPublicClient) => Promise<[Address[], bigint[]]>;
export declare const getRecoupTranchesAndSizes: (chainId: number, token: Address, tranches: RecoupTrancheInput[], publicClient: SplitsPublicClient) => Promise<[ContractRecoupTranche[], bigint[]]>;
export declare const getAddressAndAllocationFromRecipients: (recipients: SplitRecipient[]) => {
recipientAddresses: Address[];
recipientAllocations: bigint[];
};
export declare const MAX_V2_DISTRIBUTION_INCENTIVE = 6.5535;
export declare const getValidatedSplitV2Config: (recipients: SplitRecipient[], distributorFeePercent: number, totalAllocationPercent?: number) => {
recipientAddresses: Address[];
recipientAllocations: bigint[];
distributionIncentive: number;
totalAllocation: bigint;
};
export declare const getSplitType: (chainId: number, factoryAddress: Address) => SplitV2Type;
export declare const getAccountsAndPercentAllocations: (arg0: IRecipient[], arg1?: boolean) => [Address[], bigint[]];
export declare const hashSplitV2: (arg0: Address[], arg1: bigint[], arg2: bigint, arg3: number) => string;
export declare const hashSplitV1: (arg0: Address[], arg1: number[], arg2: number) => string;
export declare const sleep: (timeMs: number) => Promise<unknown>;