Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@cryptoscamdb/api

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cryptoscamdb/api

A Javascript wrapper for the CryptoScamDB API

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

API

A Javascript wrapper for the CryptoScamDB API for Node.js and browser applications.

Usage

npm i -P @cryptoscamdb/api

API

Options

  • cache.enable (default: false) - Enable or disable the cache
  • cache.cacheProvider (default: MemoryCacheProvider, in-memory caching) - Set the cache provider
  • cache.cacheDuration (default: 600000) - Set the duration in milliseconds to cache a result for

Methods

All methods return a promise.

  • check(query: string) - Check a domain, Ethereum address or IP address
  • getAllScams() - Get a list of all scams
  • getAllScamsByAddress() - Get a list of all scams mapped by the Ethereum address
  • getAllScamsByIP() - Get a list of all scams mapped by the IP address

Cache provider

You can use the CacheProvider interface to implement your own caching method (e.g. filesystem or Redis).

interface CacheProvider {
    get<T = any>(key: string): Promise<T | undefined>;
    getTimestamp(key: string): Promise<number>;
    set<T = any>(key: string, result: T): Promise<boolean>;
    has(key: string): Promise<boolean>;
    remove(key: string): Promise<boolean>;
}

See cache.ts for an example (in-memory) implementation.

Example

import CryptoScamDBAPI from '@cryptoscamdb/api';

const options = {
    cache: {
        enable: true
    }
};
const api = new CryptoScamDBAPI(options);

// Equal to https://cryptoscamdb.org/api/check/example.com
api.check('example.com')
    .then(result => {
        // Do something with the result
        console.log(result.entries);
    })
    // Handle error
    .catch(console.error);

Keywords

FAQs

Package last updated on 01 Oct 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc