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

Method encodeFunctionData

lib.esm/abi/interface.js:735–745  ·  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

733 * the %%values%%.
734 */
735 encodeFunctionData(fragment, values) {
736 if (typeof (fragment) === "string") {
737 const f = this.getFunction(fragment);
738 assertArgument(f, "unknown function", "fragment", fragment);
739 fragment = f;
740 }
741 return concat([
742 fragment.selector,
743 this._encodeParams(fragment.inputs, values || [])
744 ]);
745 }
746 /**
747 * Decodes the result %%data%% (e.g. from an ``eth_call``) for the
748 * specified function (see [[getFunction]] for valid values for

Callers 3

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

Calls 4

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

Tested by

no test coverage detected