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

Method from

ts/src/static_dependencies/ethers/interface.ts:1212–1226  ·  view source on GitHub ↗

* Creates a new [[Interface]] from the ABI %%value%%. * * The %%value%% may be provided as an existing [[Interface]] object, * a JSON-encoded ABI or any Human-Readable ABI format.

(value: InterfaceAbi | Interface)

Source from the content-addressed store, hash-verified

1210 * a JSON-encoded ABI or any Human-Readable ABI format.
1211 */
1212 static from(value: InterfaceAbi | Interface): Interface {
1213 // Already an Interface, which is immutable
1214 if (value instanceof Interface) { return value; }
1215
1216 // JSON
1217 if (typeof(value) === "string") { return new Interface(JSON.parse(value)); }
1218
1219 // Maybe an interface from an older version, or from a symlinked copy
1220 if (typeof((<any>value).format) === "function") {
1221 return new Interface((<any>value).format("json"));
1222 }
1223
1224 // Array of fragments
1225 return new Interface(value);
1226 }
1227}

Callers 8

constructorMethod · 0.45
#getFunctionMethod · 0.45
forEachFunctionMethod · 0.45
#getEventMethod · 0.45
forEachEventMethod · 0.45
getErrorMethod · 0.45
forEachErrorMethod · 0.45
decodeEventLogMethod · 0.45

Calls 2

parseMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected