Customizing JSON RPC requests #704
-
I would like to customize a JSON RPC request, for example, using
I hope that viem can extend the request interface to a generic JSON RPC client. |
Beta Was this translation helpful? Give feedback.
Answered by
jxom
Jun 13, 2023
Replies: 1 comment 1 reply
-
Can do this already! You can use the 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 |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
daoleno
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Can do this already! You can use the
RpcSchemaOverride
generic to fully type the request:If you