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

Method decode

lib.commonjs/abi/abi-coder.js:180–184  ·  view source on GitHub ↗

* Decode the ABI %%data%% as the %%types%% into values. * * If %%loose%% decoding is enabled, then strict padding is * not enforced. Some older versions of Solidity incorrectly * padded event data emitted from ``external`` functions.

(types, data, loose)

Source from the content-addressed store, hash-verified

178 * padded event data emitted from ``external`` functions.
179 */
180 decode(types, data, loose) {
181 const coders = types.map((type) => this.#getCoder(fragments_js_1.ParamType.from(type)));
182 const coder = new tuple_js_1.TupleCoder(coders, "_");
183 return coder.decode(new abstract_coder_js_1.Reader(data, loose, defaultMaxInflation));
184 }
185 static _setDefaultMaxInflation(value) {
186 (0, index_js_1.assertArgument)(typeof (value) === "number" && Number.isInteger(value), "invalid defaultMaxInflation factor", "value", value);
187 defaultMaxInflation = value;

Callers 10

test-abi.jsFile · 0.45
fromHexFunction · 0.45
fromHexFunction · 0.45
getBuiltinCallExceptionFunction · 0.45
_decodeParamsMethod · 0.45
decodeFunctionResultMethod · 0.45
makeErrorMethod · 0.45
decodeEventLogMethod · 0.45
parseTransactionMethod · 0.45
parseErrorMethod · 0.45

Calls 4

#getCoderMethod · 0.95
decodeMethod · 0.95
mapMethod · 0.45
fromMethod · 0.45

Tested by

no test coverage detected