* Parses a transaction, finding the matching function and extracts * the parameter values along with other useful function details. * * If the matching function cannot be found, return null.
(tx: { data: string, value?: BigNumberish })
| 1191 | * If the matching function cannot be found, return null. |
| 1192 | */ |
| 1193 | parseTransaction(tx: { data: string, value?: BigNumberish }): null | TransactionDescription { |
| 1194 | const data = getBytes(tx.data, "tx.data"); |
| 1195 | const value = getBigInt((tx.value != null) ? tx.value: 0, "tx.value"); |
| 1196 | |
| 1197 | const fragment = this.getFunction(hexlify(data.slice(0, 4))); |
| 1198 | |
| 1199 | if (!fragment) { return null; } |
| 1200 | |
| 1201 | const args = this.#abiCoder.decode(fragment.inputs, data.slice(4)); |
| 1202 | return new TransactionDescription(fragment, fragment.selector, args, value); |
| 1203 | } |
| 1204 | |
| 1205 | parseCallResult(data: BytesLike): Result { |
| 1206 | throw new Error("@TODO"); |