Socket
Socket
Sign inDemoInstall

nft-scam-detector

Package Overview
Dependencies
Maintainers
0
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nft-scam-detector

A lightweight detector scam classifier for NFTs with 95% accuracy. Can run anywhere that webassembly runs: on a server, in a lambda function, and even running entirely in your browser.


Version published
Weekly downloads
101
increased by77.19%
Maintainers
0
Weekly downloads
 
Created
Source

SUI NFT Scam Detector

A lightweight detector scam classifier for NFTs with 95% accuracy. Can run anywhere that webassembly runs: on a server, in a lambda function, and even running entirely in your browser.

Also included is the model training code and data, so you can train and bring your own model if the default model is not performing well.

Feature extraction is done with a combination of on-chain data and OCR using the tesseract.js library. Classification is done with naive bayes and hand-picked labels.

We labeled NFT into 2 categories:

  • Scam: NFT that our classifier detected as scammed
  • Ham: NFT that our classifier detected as trusted

Installation

  • Using npm
npm install nft-scam-detector --save
  • Using yarn
yarn add nft-scam-detector

Getting started

import { extractAndClassify } from "nft-scam-detector";

const imageUrl = "YOUR_NFT_IMAGE_URL";
const result = extractAndClassify(imageUrl);

result.then(console.log);
// result here 
// 
// {
//     "classification": "scam",
//     "scam_likelihood": 0.0001565123,
//     "ham_likelihood": 0.0000004214,
// }
// 

Testing

Live testing at: https://sui-nft-spam-fe.getnimbus.io/

You can test the accuracy of a model using the code in the /test folder. Make sure that your training set and test set do not overlap. It should spit out a confusion matrix as well as all of the mistakes made with accuracy more than 95%

scam (predicted)ham (predicted)
scam (actual)200
ham (actual)218
  • avg time: 1930ms
  • median time: 1820ms

License

MIT License

Keywords

FAQs

Package last updated on 29 Jun 2024

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