Skip to content

Customizing JSON RPC requests #704

Closed Answered by jxom
daoleno asked this question in Idea / Feature Request
Jun 13, 2023 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Can do this already! You can use the RpcSchemaOverride generic to fully type the request:

type TraceTransactionSchema = {
  Parameters: [
    hash: Hash,
    options:
      | {
          disableStorage?: boolean
          disableStack?: boolean
          enableMemory?: boolean
          enableReturnData?: boolean
          tracer?: string
        }
      | {
          timeout?: string
          tracerConfig?: {
            onlyTopCall?: boolean
            withLog?: boolean
          }
        }
      | undefined,
  ]
  ReturnType: {
    ...
  }
}

await publicClient.request<TraceTransactionSchema>({
  method: 'debug_traceTransaction',
  params: ['0x...', { tracer: 'callTracer' }],
})

If you

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@daoleno
Comment options

Answer selected by daoleno
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants