onyx-contracts
v0.1.0
Published
Smart contracts utilities for Onyx
Keywords
Readme
Onyx contracts
Smart contracts utilities for the Onyx app and server.
Installation
yarn add onyx-contractsUsage
import createContracts from 'onyx-contracts'
const contracts = createContracts('TESTNET') // 'MAINNET' by default when not providedThe contracts Object contains the following properties:
ensgetResolverAddress: (nameHash: string) => Promise<string>getHashAddress: (contractAddress: string, nameHash: string) => Promise<string>resolveHash: (nameHash: string) => Promise<string>resolveName: (ensName: string) => Promise<string>
stakinghasStake: (contractAddress: string, walletAddress: string) => Promise<boolean>requiredStake: (contractAddress: string) => Promise<number>
getStakingContractAddress: () => Promise<string>getRequiredStake: () => Promise<number>walletHasStake: (walletAddress: string) => Promise<boolean>
License
MIT.
See LICENSE file.
