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

Method from

lib.commonjs/abi/interface.js:1088–1107  ·  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

1086 * a JSON-encoded ABI or any Human-Readable ABI format.
1087 */
1088 static from(value) {
1089 // Already an Interface, which is immutable
1090 if (value instanceof Interface) {
1091 return value;
1092 }
1093 // JSON
1094 if (typeof (value) === "string") {
1095 return new Interface(JSON.parse(value));
1096 }
1097 // An Interface; possibly from another v6 instance
1098 if (typeof (value.formatJson) === "function") {
1099 return new Interface(value.formatJson());
1100 }
1101 // A legacy Interface; from an older version
1102 if (typeof (value.format) === "function") {
1103 return new Interface(value.format("json"));
1104 }
1105 // Array of fragments
1106 return new Interface(value);
1107 }
1108}
1109exports.Interface = Interface;
1110//# 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