Given an event with nested tuples, like so:
struct CreateEventCommon {
address funder;
address sender;
address recipient;
Lockup.CreateAmounts amounts;
IERC20 token;
bool cancelable;
bool transferable;
Lockup.Timestamps timestamps;
string shape;
address broker;
}
event CreateLockupTranchedStream(
uint256 indexed streamId, Lockup.CreateEventCommon commonParams, LockupTranched.Tranche[] tranches
);
Envio will generate the following types:
export type SablierLockup_v2_0_CreateLockupTranchedStream_eventArgs = {
readonly streamId: bigint;
readonly commonParams: [
Address_t,
Address_t,
Address_t,
[bigint, bigint],
Address_t,
boolean,
boolean,
[bigint, bigint],
string,
Address_t,
];
readonly tranches: Array<[bigint, bigint]>;
};
As you can see, commonParams is an array.
Whereas I was expecting it to be an object with named fields (funder, sender).
The lack of named fields impairs the user experience because the developer has to constantly double check the Solidity interface. And this makes the implementation error-prone when the fields have the same type.
Given an event with nested tuples, like so:
Envio will generate the following types:
As you can see,
commonParamsis an array.Whereas I was expecting it to be an object with named fields (
funder,sender).The lack of named fields impairs the user experience because the developer has to constantly double check the Solidity interface. And this makes the implementation error-prone when the fields have the same type.