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

Method parseTransaction

ts/src/static_dependencies/ethers/interface.ts:1154–1164  ·  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: { data: string, value?: BigNumberish })

Source from the content-addressed store, hash-verified

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");

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