* 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)
| 906 | * If the matching function cannot be found, return null. |
| 907 | */ |
| 908 | parseTransaction(tx) { |
| 909 | const data = getBytes(tx.data, "tx.data"); |
| 910 | const value = getBigInt((tx.value != null) ? tx.value : 0, "tx.value"); |
| 911 | const fragment = this.getFunction(hexlify(data.slice(0, 4))); |
| 912 | if (!fragment) { |
| 913 | return null; |
| 914 | } |
| 915 | const args = this.#abiCoder.decode(fragment.inputs, data.slice(4)); |
| 916 | return new TransactionDescription(fragment, fragment.selector, args, value); |
| 917 | } |
| 918 | parseCallResult(data) { |
| 919 | throw new Error("@TODO"); |
| 920 | } |