How to use the @truffle/contract-schema.normalize function in @truffle/contract-schema

To help you get started, we’ve selected a few @truffle/contract-schema examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github trufflesuite / truffle / packages / contract / index.js View on Github external
const contract = (json = {}, networkType = "ethereum") => {
  const normalizedArtifactObject = Object.assign({}, Schema.normalize(json), {
    networkType
  });

  // Note we don't use `new` here at all. This will cause the class to
  // "mutate" instead of instantiate an instance.
  return Contract.clone(normalizedArtifactObject);
};

@truffle/contract-schema

JSON schema for contract artifacts

MIT
Latest version published 1 year ago

Package Health Score

61 / 100
Full package analysis