Catalog npm
Back to packageRELEASE DETAILS

0.1.3

npm

@0xcert/erc721-validator

ERC-721 token validator.

0xcertblockblockscontractcontractsethereumparseparserprotocolscanscannersoliditytransactiontransactions
Published20 Jul 2018
Direct dependencies11
Transitive dependenciesNot calculated

README

Current package documentation

npm version

Ethereum ERC-721 Contract Validator.

This is an open source package for NodeJS written with TypeScript. It allows for validating a contract against a series of tests to check its compliancy with the ERC-721 standard.

This package is actively maintained, well tested and already used in production environments. The source code is available on GitHub where you can also find our issue tracker.

How it works

For more information on how the validator works please check the article explaining the technique.

Installation

Run the command below to install the package.

npm install --save web3 erc721-validator

This package uses promises thus you need to use Promise polyfill when promises are not supported.

Getting started

Initialize the Web3 provider.

import * as Web3 from 'web3';

const web3 = new Web3(new Web3.providers.HttpProvider('http://localhost:8545'));

Load and parse data of a particular block.

import { Validator } from 'erc721-validator';

const validator = new ERC721Validator(web3);
const contract  = '0x...';
const token     = '123';
const giver     = '0x...';

await validator.basic(test, contract);                  // => [{...},{...},{...},{...}]
await validator.token(test, contract, token);           // => [{...},{...},{...},{...}]
await validator.transfer(test, contract, token, giver); // => [{...},{...},{...},{...}]

API

ERC721Validator Class

ERC721Validator(web3)

Main class which allows for testing your contract validity.

OptionTypeRequiredDefaultDescription
web3Web3Yes-Instance of a Web3 provider.

NOTICE: The ERC721Validator class extends is a RawModel class and thus exposes all related helper methods.

ERC721Validator.prototype.basic(contract): Promise(JSON)

Performes a series of basic contract tests.

OptionTypeRequiredDefaultDescription
contractStringYes-Contract Address

ERC721Validator.prototype.token(contract, tokenId): Promise(JSON)

Performes a series of tests to validate contract token compliancy.

OptionTypeRequiredDefaultDescription
contractStringYes-Contract Address
tokenIdStringYes-Token ID

ERC721Validator.prototype.transfer(contract, tokenId, giver): Promise(JSON)

Performes a series of tests to validate contract token transfer compliancy.

OptionTypeRequiredDefaultDescription
contractStringYes-Contract Address
tokenIdStringYes-Token ID
giverStringYes-Address of giver

License (MIT)

Copyright (c) 2018 0xcert admin@0xcert.org.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 12

Native requirements
11 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
@types/node
Environment
{
  "local_name": "@types/node",
  "alias": false,
  "peer_metadata": null
}
^10.5.2runtime
rawmodel
Environment
{
  "local_name": "rawmodel",
  "alias": false,
  "peer_metadata": null
}
^1.31.2runtime
@types/mocha
Environment
{
  "local_name": "@types/mocha",
  "alias": false,
  "peer_metadata": null
}
5.0.0development
mocha
Environment
{
  "local_name": "mocha",
  "alias": false,
  "peer_metadata": null
}
5.0.5development
solc
Environment
{
  "local_name": "solc",
  "alias": false,
  "peer_metadata": null
}
^0.4.21development
ts-node
Environment
{
  "local_name": "ts-node",
  "alias": false,
  "peer_metadata": null
}
^3.3.0development
tslint
Environment
{
  "local_name": "tslint",
  "alias": false,
  "peer_metadata": null
}
^5.7.0development
tslint-config-standard
Environment
{
  "local_name": "tslint-config-standard",
  "alias": false,
  "peer_metadata": null
}
^6.0.1development
typescript
Environment
{
  "local_name": "typescript",
  "alias": false,
  "peer_metadata": null
}
^2.8.0development
web3
Environment
{
  "local_name": "web3",
  "alias": false,
  "peer_metadata": null
}
^1.0.0-beta.33development
web3-typescript-typings
Environment
{
  "local_name": "web3-typescript-typings",
  "alias": false,
  "peer_metadata": null
}
^0.10.2development
web3
Environment
{
  "local_name": "web3",
  "alias": false,
  "peer_metadata": null
}
^1.0.0-beta.34peer

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "integrity": "sha512-tS7n1fmBx7917g4FSYGGZ6nI/BM8vBGZny7wEqMyp85X6qsRZz9P5F74cEztA1X4xFRUl2L0IpI818o/WrVQDA==",
  "shasum": "df3e94ca97a901d0109d0c6eb6064d7b1dae6acf",
  "tarball": "https://registry.npmjs.org/@0xcert/erc721-validator/-/erc721-validator-0.1.3.tgz",
  "fileCount": 23,
  "unpackedSize": 113648,
  "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbUdO4CRA9TVsSAnZWagAAqacP/3ufSbFrBx/4aiMo/J3C\n+LmQW2v28rqFqYIbU3/k8KOrbsJt222DxOAydrXeTG8s6ExMkG/fqnPYKOu8\nNyrzCvM6vvDN8foJ5T7XgJJOk0skyd72/S+Bmj/8ifpMkYIPqSPYbR770YOS\nanTcD23ztpCK+xnA/hzLxcla09KSIFtZ62facQ37oF//Eq3ThFZuH104v4Nb\n9Hn9Ddn3GtobhrXpTSBwq9hVtrRaQMQ71TEwQ7fnV420jnwKo4Cl6WuXhj4c\n+hTArfh6uq3vT/w2aKL4stRQQOKjY8EVOfobi8TCMDpQtLPQGTLN9CXRqpk7\ngYwKSkLP6YSWO/hksE1FnxincyIcdscLoZqiCtXPJxpqbfhblndD57kb13YI\nWL2svNXu/F5qKDbJGHhadXmZBltsuUFWe5c8WY3uyxMw8KBznsa9x9PMmPbZ\nM6Ec7KGxuXs9CppZILO4gDk/Cu2RQ5GKDSbUKnhcXGp5/rC92JnpG1lJrI/K\nYCNBqAD4+fouqfq17j6KNExKR2XCA1QXI7RN32II/zqAEU4OLKw8yWhz0cy5\nWqa5XvBU0j4X7fN9ul1ylCk6/53a0mlUpvu9cnQVEm4oIMciBRJw6fkJVuDo\nwzjPrUlhYlnIhN0o0mB7c8ofU8s6Qwhcqy87lfyjia26xxVUXb01m0ZMBM4O\nQshU\r\n=PbK9\r\n-----END PGP SIGNATURE-----\r\n",
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEUCIFtPOlbarLYHkmxVi4SFBfZgqtgp4Mbnbe5CXSQmH/9BAiEA11ki5ebCNxEaH9P8N+BLhGFTTa3JVeew6Z63KNrGlwM="
    }
  ]
}

Repository

PENDING
0xcert/erc721-validator

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 22:45 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:785a1dca166c708c930ccd201d7e7815022aeea7f8f3cc408f2dcd2dcf1ba133

Other collected versions

0.3.022 Sept0.2.221 Sept0.2.120 Sept0.2.020 Sept0.1.614 Nov0.1.420 JulView all collected versions →