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

Method encodeFunctionData

js/src/static_dependencies/ethers/interface.js:646–656  ·  view source on GitHub ↗

* Encodes the ``tx.data`` for a transaction that calls the function * specified (see [[getFunction]] for valid values for %%fragment%%) with * the %%values%%.

(fragment, values)

Source from the content-addressed store, hash-verified

644 * the %%values%%.
645 */
646 encodeFunctionData(fragment, values) {
647 if (typeof (fragment) === "string") {
648 const f = this.getFunction(fragment);
649 assertArgument(f, "unknown function", "fragment", fragment);
650 fragment = f;
651 }
652 return concat([
653 fragment.selector,
654 this._encodeParams(fragment.inputs, values || [])
655 ]);
656 }
657 /**
658 * Decodes the result %%data%% (e.g. from an ``eth_call``) for the
659 * specified function (see [[getFunction]] for valid values for

Callers

nothing calls this directly

Calls 4

getFunctionMethod · 0.95
_encodeParamsMethod · 0.95
assertArgumentFunction · 0.90
concatFunction · 0.90

Tested by

no test coverage detected