@uniswap/redux-multicall
TypeScript icon, indicating that this package has built-in type declarations

1.1.8 • Public • Published

MultiCall

A React + Redux library for fetching, batching, and caching chain state via the MultiCall contract.

Setup

yarn add @uniswap/redux-multicall or npm install @uniswap/redux-multicall

Usage

The usage of this library is similar to RTK Query.

// Somewhere in your app
export const multicall = createMulticall({ reducerPath: 'multicall' })

// In your store's root reducer
export const rootReducer = combineReducers({
  // Other reducers
  [multicall.reducerPath]: multicall.reducer
})

To use the updater, you'll need an instance of the Uniswap Multicall2 contract:

import { abi as MulticallABI } from '@uniswap/v3-periphery/artifacts/contracts/lens/UniswapInterfaceMulticall.sol/UniswapInterfaceMulticall.json'
import { Contract } from '@ethersproject/contracts'
import { UniswapInterfaceMulticall } from './abi/types'

const multicall2Contract = new Contract(address, MulticallABI, provider) as UniswapInterfaceMulticall

For a more detailed example, see basic example app in ./integration-tests

Alpha software

The latest version of the SDK is used in production in the Uniswap Interface, but it is considered Alpha software and may contain bugs or change significantly between patch versions. If you have questions about how to use the SDK, please reach out in the #dev-chat channel of the Discord. Pull requests welcome!

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.1.8
    6,690
    • latest

Version History

Package Sidebar

Install

npm i @uniswap/redux-multicall

Weekly Downloads

11,105

Version

1.1.8

License

MIT

Unpacked Size

548 kB

Total Files

34

Last publish

Collaborators

  • uniswap-labs-service-account
  • mr-uniswap
  • zzmp