* 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)
| 1028 | * If the matching function cannot be found, return null. |
| 1029 | */ |
| 1030 | parseTransaction(tx) { |
| 1031 | const data = getBytes(tx.data, "tx.data"); |
| 1032 | const value = getBigInt((tx.value != null) ? tx.value : 0, "tx.value"); |
| 1033 | const fragment = this.getFunction(hexlify(data.slice(0, 4))); |
| 1034 | if (!fragment) { |
| 1035 | return null; |
| 1036 | } |
| 1037 | const args = this.#abiCoder.decode(fragment.inputs, data.slice(4)); |
| 1038 | return new TransactionDescription(fragment, fragment.selector, args, value); |
| 1039 | } |
| 1040 | parseCallResult(data) { |
| 1041 | throw new Error("@TODO"); |
| 1042 | } |