* 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 })
| 1152 | * If the matching function cannot be found, return null. |
| 1153 | */ |
| 1154 | parseTransaction(tx: { data: string, value?: BigNumberish }): null | TransactionDescription { |
| 1155 | const data = getBytes(tx.data, "tx.data"); |
| 1156 | const value = getBigInt((tx.value != null) ? tx.value: 0, "tx.value"); |
| 1157 | |
| 1158 | const fragment = this.getFunction(hexlify(data.slice(0, 4))); |
| 1159 | |
| 1160 | if (!fragment) { return null; } |
| 1161 | |
| 1162 | const args = this.#abiCoder.decode(fragment.inputs, data.slice(4)); |
| 1163 | return new TransactionDescription(fragment, fragment.selector, args, value); |
| 1164 | } |
| 1165 | |
| 1166 | parseCallResult(data: BytesLike): Result { |
| 1167 | throw new Error("@TODO"); |