-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
4,687 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
declare const _default: readonly [{ | ||
readonly inputs: readonly []; | ||
readonly name: "getCurrentBlockTimestamp"; | ||
readonly outputs: readonly [{ | ||
readonly internalType: "uint256"; | ||
readonly name: "timestamp"; | ||
readonly type: "uint256"; | ||
}]; | ||
readonly stateMutability: "view"; | ||
readonly type: "function"; | ||
}, { | ||
readonly inputs: readonly [{ | ||
readonly internalType: "address"; | ||
readonly name: "addr"; | ||
readonly type: "address"; | ||
}]; | ||
readonly name: "getEthBalance"; | ||
readonly outputs: readonly [{ | ||
readonly internalType: "uint256"; | ||
readonly name: "balance"; | ||
readonly type: "uint256"; | ||
}]; | ||
readonly stateMutability: "view"; | ||
readonly type: "function"; | ||
}, { | ||
readonly inputs: readonly [{ | ||
readonly components: readonly [{ | ||
readonly internalType: "address"; | ||
readonly name: "target"; | ||
readonly type: "address"; | ||
}, { | ||
readonly internalType: "uint256"; | ||
readonly name: "gasLimit"; | ||
readonly type: "uint256"; | ||
}, { | ||
readonly internalType: "bytes"; | ||
readonly name: "callData"; | ||
readonly type: "bytes"; | ||
}]; | ||
readonly internalType: "struct PancakeInterfaceMulticall.Call[]"; | ||
readonly name: "calls"; | ||
readonly type: "tuple[]"; | ||
}]; | ||
readonly name: "multicall"; | ||
readonly outputs: readonly [{ | ||
readonly internalType: "uint256"; | ||
readonly name: "blockNumber"; | ||
readonly type: "uint256"; | ||
}, { | ||
readonly components: readonly [{ | ||
readonly internalType: "bool"; | ||
readonly name: "success"; | ||
readonly type: "bool"; | ||
}, { | ||
readonly internalType: "uint256"; | ||
readonly name: "gasUsed"; | ||
readonly type: "uint256"; | ||
}, { | ||
readonly internalType: "bytes"; | ||
readonly name: "returnData"; | ||
readonly type: "bytes"; | ||
}]; | ||
readonly internalType: "struct PancakeInterfaceMulticall.Result[]"; | ||
readonly name: "returnData"; | ||
readonly type: "tuple[]"; | ||
}]; | ||
readonly stateMutability: "nonpayable"; | ||
readonly type: "function"; | ||
}]; | ||
export default _default; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import type { CallResult, CallState, ListenerOptions } from './types'; | ||
export declare const DEFAULT_BLOCKS_PER_FETCH = 1; | ||
export declare const DEFAULT_CALL_GAS_REQUIRED = 1000000; | ||
export declare const DEFAULT_CHUNK_GAS_REQUIRED = 200000; | ||
export declare const CHUNK_GAS_LIMIT = 100000000; | ||
export declare const CONSERVATIVE_BLOCK_GAS_LIMIT = 10000000; | ||
export declare const INVALID_RESULT: CallResult; | ||
export declare const NEVER_RELOAD: ListenerOptions; | ||
export declare const INVALID_CALL_STATE: CallState; | ||
export declare const LOADING_CALL_STATE: CallState; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import type { MulticallActions } from './slice'; | ||
export interface MulticallContext { | ||
reducerPath: string; | ||
actions: MulticallActions; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/// <reference types="react" /> | ||
export interface MulticallOptions { | ||
reducerPath?: string; | ||
} | ||
export declare function createMulticall(options?: MulticallOptions): { | ||
reducerPath: string; | ||
reducer: import("redux").Reducer<import("./types").MulticallState, import("redux").AnyAction>; | ||
actions: import("@reduxjs/toolkit").CaseReducerActions<{ | ||
addMulticallListeners: (state: import("immer/dist/internal").WritableDraft<import("./types").MulticallState>, action: { | ||
payload: import("./types").MulticallListenerPayload; | ||
type: string; | ||
}) => void; | ||
removeMulticallListeners: (state: import("immer/dist/internal").WritableDraft<import("./types").MulticallState>, action: { | ||
payload: import("./types").MulticallListenerPayload; | ||
type: string; | ||
}) => void; | ||
fetchingMulticallResults: (state: import("immer/dist/internal").WritableDraft<import("./types").MulticallState>, action: { | ||
payload: import("./types").MulticallFetchingPayload; | ||
type: string; | ||
}) => void; | ||
errorFetchingMulticallResults: (state: import("immer/dist/internal").WritableDraft<import("./types").MulticallState>, action: { | ||
payload: import("./types").MulticallFetchingPayload; | ||
type: string; | ||
}) => void; | ||
updateMulticallResults: (state: import("immer/dist/internal").WritableDraft<import("./types").MulticallState>, action: { | ||
payload: import("./types").MulticallResultsPayload; | ||
type: string; | ||
}) => void; | ||
updateListenerOptions: (state: import("immer/dist/internal").WritableDraft<import("./types").MulticallState>, action: { | ||
payload: import("./types").MulticallListenerOptionsPayload; | ||
type: string; | ||
}) => void; | ||
}, string>; | ||
hooks: { | ||
useMultipleContractSingleData: (chainId: number | undefined, latestBlockNumber: number | undefined, addresses: (string | undefined)[], contractInterface: import("abitype").AbiFunction[], methodName: string, callInputs?: (string | number | BigInt | import("./validation").MethodArg[] | undefined)[] | undefined, options?: Partial<import("./types").ListenerOptionsWithGas> | undefined) => import("./types").CallState[]; | ||
useSingleContractMultipleData: (chainId: number | undefined, latestBlockNumber: number | undefined, contract: import("./types").ContractInfo | null | undefined, methodName: string, callInputs: ((string | number | BigInt | import("./validation").MethodArg[] | undefined)[] | undefined)[], options?: Partial<import("./types").ListenerOptionsWithGas> | undefined) => import("./types").CallState[]; | ||
useSingleContractWithCallData: (chainId: number | undefined, latestBlockNumber: number | undefined, contract: import("./types").ContractInfo | null | undefined, callDatas: string[], options?: Partial<import("./types").ListenerOptionsWithGas> | undefined) => import("./types").CallState[]; | ||
useSingleCallResult: (chainId: number | undefined, latestBlockNumber: number | undefined, contract: import("./types").ContractInfo | null | undefined, methodName: string, inputs?: (string | number | BigInt | import("./validation").MethodArg[] | undefined)[] | undefined, options?: Partial<import("./types").ListenerOptionsWithGas> | undefined) => import("./types").CallState; | ||
useMultiChainMultiContractSingleData: (chainToBlockNumber: Record<number, number | undefined>, chainToAddresses: Record<number, (string | undefined)[]>, contractInterface: import("abitype").AbiFunction[], methodName: string, callInputs?: (string | number | BigInt | import("./validation").MethodArg[] | undefined)[] | undefined, options?: Partial<import("./types").ListenerOptionsWithGas> | undefined) => Record<number, import("./types").CallState[]>; | ||
useMultiChainSingleContractSingleData: (chainToBlockNumber: Record<number, number | undefined>, chainToAddress: Record<number, string | undefined>, contractInterface: import("abitype").AbiFunction[], methodName: string, callInputs?: (string | number | BigInt | import("./validation").MethodArg[] | undefined)[] | undefined, options?: Partial<import("./types").ListenerOptionsWithGas> | undefined) => Record<number, import("./types").CallState>; | ||
}; | ||
Updater: (props: Pick<import("./updater").UpdaterProps, "listenerOptions" | "chainId" | "latestBlockNumber" | "multicallInfo" | "isDebug">) => import("react").JSX.Element; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import type { MulticallContext } from './context'; | ||
import type { Call, CallResult, CallState, ContractInfo, ListenerOptions, ListenerOptionsWithGas } from './types'; | ||
import { MethodArg } from './validation'; | ||
import { AbiFunction } from 'viem'; | ||
declare type OptionalMethodInputs = Array<MethodArg | MethodArg[] | undefined> | undefined; | ||
export declare function useCallsDataSubscription(context: MulticallContext, chainId: number | undefined, calls: Array<Call | undefined>, listenerOptions?: ListenerOptions): CallResult[]; | ||
export declare function useSingleContractMultipleData(context: MulticallContext, chainId: number | undefined, latestBlockNumber: number | undefined, contract: ContractInfo | null | undefined, methodName: string, callInputs: OptionalMethodInputs[], options?: Partial<ListenerOptionsWithGas>): CallState[]; | ||
export declare function useMultipleContractSingleData(context: MulticallContext, chainId: number | undefined, latestBlockNumber: number | undefined, addresses: (string | undefined)[], contractInterface: AbiFunction[], methodName: string, callInputs?: OptionalMethodInputs, options?: Partial<ListenerOptionsWithGas>): CallState[]; | ||
export declare function useSingleCallResult(context: MulticallContext, chainId: number | undefined, latestBlockNumber: number | undefined, contract: ContractInfo | null | undefined, methodName: string, inputs?: OptionalMethodInputs, options?: Partial<ListenerOptionsWithGas>): CallState; | ||
export declare function useSingleContractWithCallData(context: MulticallContext, chainId: number | undefined, latestBlockNumber: number | undefined, contract: ContractInfo | null | undefined, callDatas: string[], options?: Partial<ListenerOptionsWithGas>): CallState[]; | ||
export declare function useMultiChainMultiContractSingleData(context: MulticallContext, chainToBlockNumber: Record<number, number | undefined>, chainToAddresses: Record<number, Array<string | undefined>>, contractInterface: AbiFunction[], methodName: string, callInputs?: OptionalMethodInputs, options?: Partial<ListenerOptionsWithGas>): Record<number, CallState[]>; | ||
export declare function useMultiChainSingleContractSingleData(context: MulticallContext, chainToBlockNumber: Record<number, number | undefined>, chainToAddress: Record<number, string | undefined>, contractInterface: AbiFunction[], methodName: string, callInputs?: OptionalMethodInputs, options?: Partial<ListenerOptionsWithGas>): Record<number, CallState>; | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export * from './constants'; | ||
export * from './create'; | ||
export * from './types'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import React from 'react'; | ||
export declare function App(): React.JSX.Element; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import React from 'react'; | ||
export declare function MultichainApp(): React.JSX.Element; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import React from 'react'; | ||
import { ChainId } from './consts'; | ||
interface Props { | ||
chainId: ChainId; | ||
blockNumber: number | undefined; | ||
blocksPerFetch?: number; | ||
} | ||
export declare function Updater({ chainId, blockNumber, blocksPerFetch }: Props): React.JSX.Element; | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export declare const NULL_ADDRESS = "0x0000000000000000000000000000000000000000"; | ||
export declare const MULTICALL_ADDRESS = "0x1F98415757620B543A52E61c46B32eB19261F984"; | ||
export declare const DAI_ADDRESS = "0x6B175474E89094C44Da98b954EedeAC495271d0F"; | ||
export declare const USDC_ADDRESS = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"; | ||
export declare const USDT_ADDRESS = "0xdAC17F958D2ee523a2206206994597C13D831ec7"; | ||
export declare enum ChainId { | ||
MAINNET = 1, | ||
SEPOLIA = 11155111 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,168 @@ | ||
export declare const ERC20_ABI: readonly [{ | ||
readonly constant: true; | ||
readonly inputs: readonly []; | ||
readonly name: "name"; | ||
readonly outputs: readonly [{ | ||
readonly name: ""; | ||
readonly type: "string"; | ||
}]; | ||
readonly payable: false; | ||
readonly stateMutability: "view"; | ||
readonly type: "function"; | ||
}, { | ||
readonly constant: false; | ||
readonly inputs: readonly [{ | ||
readonly name: "_spender"; | ||
readonly type: "address"; | ||
}, { | ||
readonly name: "_value"; | ||
readonly type: "uint256"; | ||
}]; | ||
readonly name: "approve"; | ||
readonly outputs: readonly [{ | ||
readonly name: ""; | ||
readonly type: "bool"; | ||
}]; | ||
readonly payable: false; | ||
readonly stateMutability: "nonpayable"; | ||
readonly type: "function"; | ||
}, { | ||
readonly constant: true; | ||
readonly inputs: readonly []; | ||
readonly name: "totalSupply"; | ||
readonly outputs: readonly [{ | ||
readonly name: ""; | ||
readonly type: "uint256"; | ||
}]; | ||
readonly payable: false; | ||
readonly stateMutability: "view"; | ||
readonly type: "function"; | ||
}, { | ||
readonly constant: false; | ||
readonly inputs: readonly [{ | ||
readonly name: "_from"; | ||
readonly type: "address"; | ||
}, { | ||
readonly name: "_to"; | ||
readonly type: "address"; | ||
}, { | ||
readonly name: "_value"; | ||
readonly type: "uint256"; | ||
}]; | ||
readonly name: "transferFrom"; | ||
readonly outputs: readonly [{ | ||
readonly name: ""; | ||
readonly type: "bool"; | ||
}]; | ||
readonly payable: false; | ||
readonly stateMutability: "nonpayable"; | ||
readonly type: "function"; | ||
}, { | ||
readonly constant: true; | ||
readonly inputs: readonly []; | ||
readonly name: "decimals"; | ||
readonly outputs: readonly [{ | ||
readonly name: ""; | ||
readonly type: "uint8"; | ||
}]; | ||
readonly payable: false; | ||
readonly stateMutability: "view"; | ||
readonly type: "function"; | ||
}, { | ||
readonly constant: true; | ||
readonly inputs: readonly [{ | ||
readonly name: "_owner"; | ||
readonly type: "address"; | ||
}]; | ||
readonly name: "balanceOf"; | ||
readonly outputs: readonly [{ | ||
readonly name: "balance"; | ||
readonly type: "uint256"; | ||
}]; | ||
readonly payable: false; | ||
readonly stateMutability: "view"; | ||
readonly type: "function"; | ||
}, { | ||
readonly constant: true; | ||
readonly inputs: readonly []; | ||
readonly name: "symbol"; | ||
readonly outputs: readonly [{ | ||
readonly name: ""; | ||
readonly type: "string"; | ||
}]; | ||
readonly payable: false; | ||
readonly stateMutability: "view"; | ||
readonly type: "function"; | ||
}, { | ||
readonly constant: false; | ||
readonly inputs: readonly [{ | ||
readonly name: "_to"; | ||
readonly type: "address"; | ||
}, { | ||
readonly name: "_value"; | ||
readonly type: "uint256"; | ||
}]; | ||
readonly name: "transfer"; | ||
readonly outputs: readonly [{ | ||
readonly name: ""; | ||
readonly type: "bool"; | ||
}]; | ||
readonly payable: false; | ||
readonly stateMutability: "nonpayable"; | ||
readonly type: "function"; | ||
}, { | ||
readonly constant: true; | ||
readonly inputs: readonly [{ | ||
readonly name: "_owner"; | ||
readonly type: "address"; | ||
}, { | ||
readonly name: "_spender"; | ||
readonly type: "address"; | ||
}]; | ||
readonly name: "allowance"; | ||
readonly outputs: readonly [{ | ||
readonly name: ""; | ||
readonly type: "uint256"; | ||
}]; | ||
readonly payable: false; | ||
readonly stateMutability: "view"; | ||
readonly type: "function"; | ||
}, { | ||
readonly payable: true; | ||
readonly stateMutability: "payable"; | ||
readonly type: "fallback"; | ||
}, { | ||
readonly anonymous: false; | ||
readonly inputs: readonly [{ | ||
readonly indexed: true; | ||
readonly name: "owner"; | ||
readonly type: "address"; | ||
}, { | ||
readonly indexed: true; | ||
readonly name: "spender"; | ||
readonly type: "address"; | ||
}, { | ||
readonly indexed: false; | ||
readonly name: "value"; | ||
readonly type: "uint256"; | ||
}]; | ||
readonly name: "Approval"; | ||
readonly type: "event"; | ||
}, { | ||
readonly anonymous: false; | ||
readonly inputs: readonly [{ | ||
readonly indexed: true; | ||
readonly name: "from"; | ||
readonly type: "address"; | ||
}, { | ||
readonly indexed: true; | ||
readonly name: "to"; | ||
readonly type: "address"; | ||
}, { | ||
readonly indexed: false; | ||
readonly name: "value"; | ||
readonly type: "uint256"; | ||
}]; | ||
readonly name: "Transfer"; | ||
readonly type: "event"; | ||
}]; |
Oops, something went wrong.