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

Method encode

lib.esm/abi/abi-coder.js:162–169  ·  view source on GitHub ↗

* Encode the %%values%% as the %%types%% into ABI data. * * @returns DataHexstring

(types, values)

Source from the content-addressed store, hash-verified

160 * @returns DataHexstring
161 */
162 encode(types, values) {
163 assertArgumentCount(values.length, types.length, "types/values length mismatch");
164 const coders = types.map((type) => this.#getCoder(ParamType.from(type)));
165 const coder = (new TupleCoder(coders, "_"));
166 const writer = new Writer();
167 coder.encode(writer, values);
168 return writer.data;
169 }
170 /**
171 * Decode the ABI %%data%% as the %%types%% into values.
172 *

Callers 6

test-abi.jsFile · 0.45
_encodeParamsMethod · 0.45
encodeFunctionResultMethod · 0.45
encodeTopicMethod · 0.45
encodeEventLogMethod · 0.45

Calls 4

#getCoderMethod · 0.95
assertArgumentCountFunction · 0.90
mapMethod · 0.45
fromMethod · 0.45

Tested by

no test coverage detected