UNPKG

@0xsplits/splits-sdk

Version:

SDK for the 0xSplits protocol

249 lines (248 loc) 11 kB
import { Address, GetLogsReturnType } from 'viem'; import { SplitV2Type } from '../types'; export declare const PERCENTAGE_SCALE: bigint; export declare const MULTICALL_3_ADDRESS = "0xca11bde05977b3631167028862be2a173976ca11"; export declare const REVERSE_RECORDS_ADDRESS = "0x3671aE578E63FdF66ad4F3E12CC0c0d71Ac7510C"; export declare const PULL_SPLIT_FACTORY_ADDRESS = "0x80f1B766817D04870f115fEBbcCADF8DBF75E017"; export declare const PUSH_SPLIT_FACTORY_ADDRESS = "0xaDC87646f736d6A82e9a6539cddC488b2aA07f38"; export declare const PULL_SPLIT_V2o1_FACTORY_ADDRESS = "0x5cbA88D55Cec83caD5A105Ad40C8c9aF20bE21d1"; export declare const PUSH_SPLIT_V2o1_FACTORY_ADDRESS = "0xDc6259E13ec0621e6F19026b2e49D846525548Ed"; export declare const PULL_SPLIT_V2o1_ADDRESS = "0xF9C25250523Df26343222fC46de932355B850c97"; export declare const PUSH_SPLIT_V2o1_ADDRESS = "0x3f81D81e0884abD8Cc4583a704a9397972623214"; export declare const getSplitMainAddress: (chainId: number) => Address; export declare const getVestingFactoryAddress: (chainId: number) => Address; export declare const getWaterfallFactoryAddress: (chainId: number) => Address; export declare const getLiquidSplitFactoryAddress: (chainId: number) => Address; export declare const getRecoupAddress: (chainId: number) => Address; export declare const getPassThroughWalletFactoryAddress: (chainId: number) => Address; export declare const getSwapperFactoryAddress: () => Address; /** * @param chainId - The chain ID to get the UniV3Swap address for. * @returns The UniV3Swap address for the given chain ID. * @dev It is recommended to pass in the chainId. */ export declare const getUniV3SwapAddress: (chainId?: number) => Address; export declare const getDiversifierFactoryAddress: (chainId: number) => Address; export declare const getWarehouseAddress: () => Address; export declare const getSplitV2FactoryAddress: (_chainId: number, type: SplitV2Type) => Address; export declare const getSplitV2o1FactoryAddress: (_chainId: number, type: SplitV2Type) => Address; export declare const getSplitV1StartBlock: (chainId: number) => bigint; export declare const getSplitV2FactoriesStartBlock: (chainId: number) => bigint; export declare enum ChainId { MAINNET = 1, SEPOLIA = 11155111, HOLESKY = 17000, HOODI = 560048, POLYGON = 137, OPTIMISM = 10, OPTIMISM_SEPOLIA = 11155420, ARBITRUM = 42161, GNOSIS = 100, BSC = 56, ZORA = 7777777, ZORA_SEPOLIA = 999999999, BASE = 8453, BASE_SEPOLIA = 84532, FOUNDRY = 31337, BLAST = 81457, SHAPE = 360, WORLDCHAIN = 480, PLUME = 98866, PLUME_TESTNET = 98867 } export declare const ETHEREUM_CHAIN_IDS: ChainId[]; export declare const ETHEREUM_TEST_CHAIN_IDS: ChainId[]; export declare const POLYGON_CHAIN_IDS: ChainId[]; export declare const OPTIMISM_CHAIN_IDS: ChainId[]; export declare const ARBITRUM_CHAIN_IDS: ChainId[]; export declare const GNOSIS_CHAIN_IDS: ChainId[]; export declare const BSC_CHAIN_IDS: ChainId[]; export declare const ZORA_CHAIN_IDS: ChainId[]; export declare const BASE_CHAIN_IDS: ChainId[]; export declare const BLAST_CHAIN_IDS: ChainId[]; export declare const SHAPE_CHAIN_IDS: ChainId[]; export declare const WORLD_CHAIN_IDS: ChainId[]; export declare const PLUME_CHAIN_IDS: ChainId[]; export declare const ALL_CHAIN_IDS: ChainId[]; export declare const SPLITS_SUPPORTED_CHAIN_IDS: number[]; export declare const SPLITS_V2_SUPPORTED_CHAIN_IDS: ChainId[]; export declare const INVALID_BLOCK_NUMBER_CHAIN_IDS: ChainId[]; export declare const SPLITS_SUBGRAPH_CHAIN_IDS: ChainId[]; export declare const WATERFALL_CHAIN_IDS: (ChainId.MAINNET | ChainId.SEPOLIA | ChainId.HOLESKY | ChainId.HOODI | ChainId.POLYGON | ChainId.OPTIMISM | ChainId.OPTIMISM_SEPOLIA | ChainId.ARBITRUM | ChainId.GNOSIS | ChainId.BSC | ChainId.ZORA | ChainId.BASE | ChainId.FOUNDRY | ChainId.SHAPE | ChainId.WORLDCHAIN | ChainId.PLUME | ChainId.PLUME_TESTNET)[]; export declare const LIQUID_SPLIT_CHAIN_IDS: (ChainId.MAINNET | ChainId.SEPOLIA | ChainId.HOLESKY | ChainId.HOODI | ChainId.POLYGON | ChainId.OPTIMISM | ChainId.OPTIMISM_SEPOLIA | ChainId.ARBITRUM | ChainId.GNOSIS | ChainId.BSC | ChainId.ZORA | ChainId.BASE | ChainId.FOUNDRY | ChainId.SHAPE | ChainId.WORLDCHAIN | ChainId.PLUME | ChainId.PLUME_TESTNET)[]; export declare const VESTING_CHAIN_IDS: (ChainId.MAINNET | ChainId.SEPOLIA | ChainId.HOLESKY | ChainId.HOODI | ChainId.POLYGON | ChainId.OPTIMISM | ChainId.OPTIMISM_SEPOLIA | ChainId.ARBITRUM | ChainId.GNOSIS | ChainId.BSC | ChainId.ZORA | ChainId.BASE | ChainId.FOUNDRY | ChainId.SHAPE | ChainId.WORLDCHAIN | ChainId.PLUME | ChainId.PLUME_TESTNET)[]; export declare const TEMPLATES_CHAIN_IDS: (ChainId.MAINNET | ChainId.SEPOLIA | ChainId.HOLESKY | ChainId.HOODI | ChainId.POLYGON | ChainId.OPTIMISM | ChainId.OPTIMISM_SEPOLIA | ChainId.ARBITRUM | ChainId.GNOSIS | ChainId.BSC | ChainId.ZORA | ChainId.BASE | ChainId.FOUNDRY | ChainId.SHAPE | ChainId.WORLDCHAIN | ChainId.PLUME | ChainId.PLUME_TESTNET)[]; export declare const SWAPPER_CHAIN_IDS: ChainId[]; export declare const PERMISSIONLESS_SWAPPER_CHAIN_IDS: ChainId[]; export declare const PASS_THROUGH_WALLET_CHAIN_IDS: ChainId[]; export declare const ORACLE_CHAIN_IDS: ChainId[]; export declare const DIVERSIFIER_CHAIN_IDS: ChainId[]; export declare const SPLITS_MAX_PRECISION_DECIMALS = 4; export declare const LIQUID_SPLITS_MAX_PRECISION_DECIMALS = 1; export declare const LIQUID_SPLIT_NFT_COUNT = 1000; export declare const LIQUID_SPLIT_URI_BASE_64_HEADER = "data:application/json;base64,"; export declare const CHAIN_INFO: { [chainId: number]: { startBlock: number; wrappedNativeTokenAddress?: Address; nativeCurrency: { symbol: string; }; startBlockV2?: number; }; }; export declare enum TransactionType { Transaction = "Transaction", CallData = "CallData", GasEstimate = "GasEstimate", Signature = "Signature" } export declare const ZERO: bigint; export declare const ONE: bigint; export declare const TWO: bigint; export declare const NATIVE_TOKEN_ADDRESS: Address; export declare const splitV1UpdatedEvent: { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: true; readonly internalType: "address"; readonly name: "split"; readonly type: "address"; }, { readonly indexed: false; readonly internalType: "address[]"; readonly name: "accounts"; readonly type: "address[]"; }, { readonly indexed: false; readonly internalType: "uint32[]"; readonly name: "percentAllocations"; readonly type: "uint32[]"; }, { readonly indexed: false; readonly internalType: "uint32"; readonly name: "distributorFee"; readonly type: "uint32"; }]; readonly name: "UpdateSplit"; readonly type: "event"; }; export declare const splitV1CreatedEvent: { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: true; readonly internalType: "address"; readonly name: "split"; readonly type: "address"; }, { readonly indexed: false; readonly internalType: "address[]"; readonly name: "accounts"; readonly type: "address[]"; }, { readonly indexed: false; readonly internalType: "uint32[]"; readonly name: "percentAllocations"; readonly type: "uint32[]"; }, { readonly indexed: false; readonly internalType: "uint32"; readonly name: "distributorFee"; readonly type: "uint32"; }, { readonly indexed: false; readonly internalType: "address"; readonly name: "controller"; readonly type: "address"; }]; readonly name: "CreateSplit"; readonly type: "event"; }; type SplitV1UpdatedEventType = typeof splitV1UpdatedEvent; export type SplitV1UpdatedLogType = GetLogsReturnType<SplitV1UpdatedEventType, [ SplitV1UpdatedEventType ], true, bigint, bigint>[0]; type SplitV1CreatedEventType = typeof splitV1CreatedEvent; export type SplitV1CreatedLogType = GetLogsReturnType<SplitV1CreatedEventType, [ SplitV1CreatedEventType ], true, bigint, bigint>[0]; export declare const splitV2UpdatedEvent: { readonly type: "event"; readonly name: "SplitUpdated"; readonly inputs: readonly [{ readonly name: "_split"; readonly type: "tuple"; readonly indexed: false; readonly internalType: "struct SplitV2Lib.Split"; readonly components: readonly [{ readonly name: "recipients"; readonly type: "address[]"; readonly internalType: "address[]"; }, { readonly name: "allocations"; readonly type: "uint256[]"; readonly internalType: "uint256[]"; }, { readonly name: "totalAllocation"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "distributionIncentive"; readonly type: "uint16"; readonly internalType: "uint16"; }]; }]; readonly anonymous: false; }; export declare const splitV2CreatedEvent: { readonly type: "event"; readonly name: "SplitCreated"; readonly inputs: readonly [{ readonly name: "split"; readonly type: "address"; readonly indexed: true; readonly internalType: "address"; }, { readonly name: "splitParams"; readonly type: "tuple"; readonly indexed: false; readonly internalType: "struct SplitV2Lib.Split"; readonly components: readonly [{ readonly name: "recipients"; readonly type: "address[]"; readonly internalType: "address[]"; }, { readonly name: "allocations"; readonly type: "uint256[]"; readonly internalType: "uint256[]"; }, { readonly name: "totalAllocation"; readonly type: "uint256"; readonly internalType: "uint256"; }, { readonly name: "distributionIncentive"; readonly type: "uint16"; readonly internalType: "uint16"; }]; }, { readonly name: "owner"; readonly type: "address"; readonly indexed: false; readonly internalType: "address"; }, { readonly name: "creator"; readonly type: "address"; readonly indexed: false; readonly internalType: "address"; }]; readonly anonymous: false; }; type SplitV2UpdatedEventType = typeof splitV2UpdatedEvent; export type SplitV2UpdatedLogType = GetLogsReturnType<SplitV2UpdatedEventType, [ SplitV2UpdatedEventType ], true, bigint, bigint>[0]; type SplitV2CreatedEventType = typeof splitV2CreatedEvent; export type SplitV2CreatedLogType = GetLogsReturnType<SplitV2CreatedEventType, [ SplitV2CreatedEventType ], true, bigint, bigint>[0]; export {};