* Encode the %%values%% as the %%types%% into ABI data. * * @returns DataHexstring
(types, values)
| 96 | * @returns DataHexstring |
| 97 | */ |
| 98 | encode(types, values) { |
| 99 | assertArgumentCount(values.length, types.length, "types/values length mismatch"); |
| 100 | const coders = types.map((type) => this.#getCoder(ParamType.from(type))); |
| 101 | const coder = (new TupleCoder(coders, "_")); |
| 102 | const writer = new Writer(); |
| 103 | coder.encode(writer, values); |
| 104 | return writer.data; |
| 105 | } |
| 106 | /** |
| 107 | * Decode the ABI %%data%% as the %%types%% into values. |
| 108 | * |