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

Method from

js/src/static_dependencies/ethers/interface.js:958–973  ·  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)

Source from the content-addressed store, hash-verified

956 * a JSON-encoded ABI or any Human-Readable ABI format.
957 */
958 static from(value) {
959 // Already an Interface, which is immutable
960 if (value instanceof Interface) {
961 return value;
962 }
963 // JSON
964 if (typeof (value) === "string") {
965 return new Interface(JSON.parse(value));
966 }
967 // Maybe an interface from an older version, or from a symlinked copy
968 if (typeof (value.format) === "function") {
969 return new Interface(value.format("json"));
970 }
971 // Array of fragments
972 return new Interface(value);
973 }
974}

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