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

Method decode

ts/src/static_dependencies/ethers/abi-coder.ts:138–142  ·  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: ReadonlyArray<string | ParamType>, data: BytesLike, loose?: boolean)

Source from the content-addressed store, hash-verified

136 * padded event data emitted from ``external`` functions.
137 */
138 decode(types: ReadonlyArray<string | ParamType>, data: BytesLike, loose?: boolean): Result {
139 const coders: Array<Coder> = types.map((type) => this.#getCoder(ParamType.from(type)));
140 const coder = new TupleCoder(coders, "_");
141 return coder.decode(new Reader(data, loose, defaultMaxInflation));
142 }
143
144 static _setDefaultMaxInflation(value: number): void {
145 assertArgument(typeof(value) === "number" && Number.isInteger(value), "invalid defaultMaxInflation factor", "value", value);

Callers 15

decodeFunction · 0.45
decodeFunction · 0.45
decodeFunction · 0.45
decodeFunction · 0.45
decodeFunction · 0.45
decodeFunction · 0.45
decodeFunction · 0.45
decodeFunction · 0.45
decodeFunction · 0.45
decodeFunction · 0.45
decodeFunction · 0.45
decodeFunction · 0.45

Calls 4

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

Tested by

no test coverage detected