Skip to content

wallet_getCallsHistory

Returns a paginated list of call bundles for an account.

Request

type Request = {
  method: 'wallet_getCallsHistory'
  params: [{
    /** Address to fetch call bundles for. */
    address: `0x${string}`
    /** Optional index cursor. */
    index?: number
    /** Maximum number of bundles to return. */
    limit: number
    /** Sort direction. */
    sort: 'asc' | 'desc'
  }]
}

Response

type Response = {
  capabilities: {
    assetDiffs?: AssetDiffs
    feeTotals?: FeeTotals
    quotes?: Quote[]
  }
  id: `0x${string}`
  index: number
  keyHash: `0x${string}`
  status: number
  timestamp: number
  transactions: {
    chainId: number
    transactionHash: `0x${string}`
  }[]
}[]

Refer to wallet_prepareCalls for the AssetDiffs, FeeTotals, and Quote structures.

Example

import { Porto } from 'porto'
 
const { provider } = Porto.create()
 
const [address] = await provider.request({ method: 'eth_requestAccounts' })
 
const history = await provider.request({ 
  method: 'wallet_getCallsHistory', 
  params: [{ 
    address, 
    limit: 10, 
    sort: 'desc', 
  }], 
})