This function is similar to [[compatibleNativize]], but takes
a LogDecoding, and puts the results in an object. Note
that this does not return the entire event info, but just the
args
for the event.
This function is similar to nativize, but takes a ReturndataDecoding. If there's only one returned value, it will be run through compatibleNativize but otherwise unaltered; otherwise the results will be put in an object.
Note that if the ReturndataDecoding is not a ReturnDecoding,
this will just return undefined
.
Generated using TypeDoc
This function is similar to unsafeNativize, but is intended to be safe, and also allows for different output formats. The only currently supported format is "ethers", which is intended to match the way that Truffle Contract currently returns values (based on the Ethers decoder). As such, it only handles ABI types, and in addition does not handle the types fixed, ufixed, or function. Note that in these cases it returns
undefined
rather than throwing, as we want this function to be used in contexts where it had better not throw. It also does not handle circularities, for similar reasons.To handle numeric types, this function takes an optional numberFormatter option that tells it how to handle numbers; this function should take a BigInt as input. By default, this function will be the identity, and so numbers will be represented as BigInts.
Note that this function begins by calling abify, so out-of-range enums (that aren't so out-of-range as to be padding errors) will not return
undefined
. Out-of-range booleans similarly will return true rather thanundefined
. However, other range errors may returnundefined
; this may technically be a slight incompatibility with existing behavior, but should not be relevant except in quite unusual cases.In order to match the behavior for tuples, tuples will be transformed into arrays, but named entries will additionally be keyed by name. Moreover, indexed variables of reference type will be nativized to an undecoded hex string.