MCPcopy Create free account
hub / github.com/ccxt/ccxt / parseTransaction

Method parseTransaction

js/src/static_dependencies/ethers/interface.js:908–917  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

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 }

Callers

nothing calls this directly

Calls 6

getFunctionMethod · 0.95
getBytesFunction · 0.90
getBigIntFunction · 0.90
hexlifyFunction · 0.90
sliceMethod · 0.45
decodeMethod · 0.45

Tested by

no test coverage detected