How to use @chainlink/contracts - 3 common examples

To help you get started, we’ve selected a few @chainlink/contracts 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 smartcontractkit / chainlink / integration-scripts / src / initiateServiceAgreement.ts View on Github external
async function initiateServiceAgreement({
  coordinatorAddress,
  normalizedRequest,
  oracleSignature,
  saJson,
  expectedAddress,
}: Args) {
  const provider = createProvider()
  const signer = provider.getSigner(DEVNET_ADDRESS)
  const coordinatorFactory = new Coordinator__factory(signer)
  const coordinator = coordinatorFactory.attach(coordinatorAddress)

  console.log('Creating service agreement to initiate with...')
  const sa: ServiceAgreement = {
    aggFulfillSelector: saJson.aggFulfillSelector,
    aggInitiateJobSelector: saJson.aggInitiateJobSelector,
    aggregator: saJson.aggregator,
    expiration: saJson.expiration,
    oracles: saJson.oracles,
    payment: saJson.payment,
    endAt: Math.round(new Date(saJson.endAt).getTime() / 1000), // end date in seconds
    requestDigest: ethers.utils.keccak256(
      ethers.utils.toUtf8Bytes(normalizedRequest),
    ),
  }
github smartcontractkit / chainlink / belt / src / services / truffle-box.ts View on Github external
export function getSolidityVersions(): [string, string][] {
  // eslint-disable-next-line @typescript-eslint/no-var-requires
  const config: App = require('@chainlink/contracts/app.config.json')

  return Object.entries(config.compilerSettings.versions).filter(([, v]) =>
    config.publicVersions.find((pv) => pv === v),
  )
}
github smartcontractkit / chainlink / belt / src / services / truffle-box.ts View on Github external
return Object.entries(config.compilerSettings.versions).filter(([, v]) =>
    config.publicVersions.find((pv) => pv === v),
  )

@chainlink/contracts

Chainlink smart contracts

MIT
Latest version published 2 months ago

Package Health Score

68 / 100
Full package analysis

Similar packages