How to use the @polkadot/api-contract.PromiseContract function in @polkadot/api-contract

To help you get started, we’ve selected a few @polkadot/api-contract 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 polkadot-js / apps / packages / app-contracts / src / Contracts / util.tsx View on Github external
export function getContractForAddress (api: ApiPromise, address: StringOrNull): Contract | null {
  if (!address) {
    return null;
  } else {
    const abi = getContractAbi(address);
    return abi
      ? new Contract(api, abi, address)
      : null;
  }
}

@polkadot/api-contract

Interfaces for interacting with contracts and contract ABIs

Apache-2.0
Latest version published 2 days ago

Package Health Score

87 / 100
Full package analysis

Similar packages