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

Method from

lib.esm/abi/interface.js:1080–1099  ·  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

1078 * a JSON-encoded ABI or any Human-Readable ABI format.
1079 */
1080 static from(value) {
1081 // Already an Interface, which is immutable
1082 if (value instanceof Interface) {
1083 return value;
1084 }
1085 // JSON
1086 if (typeof (value) === "string") {
1087 return new Interface(JSON.parse(value));
1088 }
1089 // An Interface; possibly from another v6 instance
1090 if (typeof (value.formatJson) === "function") {
1091 return new Interface(value.formatJson());
1092 }
1093 // A legacy Interface; from an older version
1094 if (typeof (value.format) === "function") {
1095 return new Interface(value.format("json"));
1096 }
1097 // Array of fragments
1098 return new Interface(value);
1099 }
1100}
1101//# sourceMappingURL=interface.js.map

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

formatJsonMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected