MCPcopy Create free account
hub / github.com/PageLeay/celestial-runtime / encodeFunctionData

Method encodeFunctionData

lib.commonjs/abi/interface.js:743–753  ·  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

741 * the %%values%%.
742 */
743 encodeFunctionData(fragment, values) {
744 if (typeof (fragment) === "string") {
745 const f = this.getFunction(fragment);
746 (0, index_js_3.assertArgument)(f, "unknown function", "fragment", fragment);
747 fragment = f;
748 }
749 return (0, index_js_3.concat)([
750 fragment.selector,
751 this._encodeParams(fragment.inputs, values || [])
752 ]);
753 }
754 /**
755 * Decodes the result %%data%% (e.g. from an ``eth_call``) for the
756 * specified function (see [[getFunction]] for valid values for

Callers 3

#fetchMethod · 0.45
populateTransactionFunction · 0.45
test-abi.jsFile · 0.45

Calls 2

getFunctionMethod · 0.95
_encodeParamsMethod · 0.95

Tested by

no test coverage detected