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

Method encode

ts/src/static_dependencies/ethers/abi-coder.ts:120–129  ·  view source on GitHub ↗

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

(types: ReadonlyArray<string | ParamType>, values: ReadonlyArray<any>)

Source from the content-addressed store, hash-verified

118 * @returns DataHexstring
119 */
120 encode(types: ReadonlyArray<string | ParamType>, values: ReadonlyArray<any>): string {
121 assertArgumentCount(values.length, types.length, "types/values length mismatch");
122
123 const coders = types.map((type) => this.#getCoder(ParamType.from(type)));
124 const coder = (new TupleCoder(coders, "_"));
125
126 const writer = new Writer();
127 coder.encode(writer, values);
128 return writer.data;
129 }
130
131 /**
132 * Decode the ABI %%data%% as the %%types%% into values.

Callers 15

signMethod · 0.45
signMethod · 0.45
signMethod · 0.45
signMethod · 0.45
signMethod · 0.45
signMethod · 0.45
signMethod · 0.45
signMethod · 0.45
signMethod · 0.45
signMethod · 0.45
signMethod · 0.45
signMethod · 0.45

Calls 4

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

Tested by

no test coverage detected