JSPM

  • Created
  • Published
  • Downloads 500
  • Score
    100M100P100Q100879F
  • License MIT

ETHERspot contracts

Package Exports

  • @etherspot/contracts

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@etherspot/contracts) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

ETHERspot contracts

NPM version

Installation

$ npm i @etherspot/contracts -S

Usage

Javascript

import {
  TYPED_DATA_DOMAIN_SALT,
  ContractNames, 
  getContractAbi, 
  getContractAddress, 
  getContractByteCodeHash, 
  getContractTypedDataDomainName, 
  getContractTypedDataDomainVersion, 
} from '@etherspot/contracts'; 

console.log(
  'PersonalAccountRegistry mainnet address:', 
  getContractAddress(ContractNames.PersonalAccountRegistry),
);

console.log(
  'PersonalAccountRegistry görli address:', 
  getContractAddress(ContractNames.PersonalAccountRegistry, '5'),
);

console.log(
  'ERC20Token abi:', 
  getContractAbi(ContractNames.ERC20Token),
);

console.log(
  'Account byte code hash:',
  getContractByteCodeHash(ContractNames.Account),
);

// see: https://eips.ethereum.org/EIPS/eip-712

console.log(
  'Typed data domain salt (used in all contracts):',
  TYPED_DATA_DOMAIN_SALT,
);

console.log(
  'PaymentRegistry typed data domain name:',
  getContractTypedDataDomainName(ContractNames.PaymentRegistry),
);

console.log(
  'PaymentRegistry typed data domain version:',
  getContractTypedDataDomainVersion(ContractNames.PaymentRegistry),
);

Solidity

// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;

import "@etherspot/contracts/src/gateway/GatewayRecipient.sol";

// ...

License

MIT