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

evtscan

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

evtscan

The js(ts) SDK to help developer using evtscan api.

  • 1.1.0
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

evtscan-sdk

NHibiki NHibiki Docs NHibiki

How to use

For Browser

Refer to CDN
<script src="https://cdn.jsdelivr.net/npm/evtscan/dist/evtscan.js"></script>
<!-- OR -->
<script src="https://unpkg.com/evtscan/dist/evtscan.js"></script>
Write your Code
<script>

    const evtScan = EvtScan.new();
    // Or
    // const evtScan = new EvtScan();
    // Or [with homemade apiCaller]
    // const evtScan = new EvtScan({ endpoint: 'https://some-evtscans.io/api/' });

    // Getting information of Block / Transaction / Fungible
    const blocks = evtScan.block(); // or evtScan.transaction(), evtScan.fungible(), etc.
                                    // :EvtScan.Pager

    console.log(await blocks.next()); // it will print the first 10 blocks
    console.log(await blocks.next()); // then next 10-19[included] blocks

    const b = blocks.data[0];    // will return the 10th block since the method is called twice
    console.log(b);              // view the block
    const prev = await b.prev(); // get the previous block
    console.log(prev);           // view the block

    assert(prev instanceof EvtScan.Classes.Block); // they both belones to Block class
    const { Block } = EvtScan.Classes;
    const otherBlock = await (new Block().update(BLOCK_ID)); 
    // Or
    // const otherBlock = new Block();
    // await otherBlock.update(BLOCK_ID));

    // Get Detail by ID
    // Take nonfungible: artworks.cert as example
    const artworks = await evtScan.nonfungible('artworks.cert');
    console.log(artworks);
    
    // Searching / Getting information of Address
    const addresses = evtScan.searchAddress('EVT73Y'); // :EvtScan.Pager, get results of addresses that match this pattern
    const result = await addresses.next();
    const addr = result[0];
    console.log(addr.address); // results might differ
    // EVT73yyCz1VWKu6WsCtv31C2ifsC4Ef7Zn7WhfdYD3qtHeB8CRUPa
    await addr.update(); // get all information about this address
    console.log(addr.address);
    const { history } = addr; // :EvtScan.Pager, get transaction history
    history.pageSize = 100;
    console.log(await history.next()); // get the first 100 transactions

    // enjoy ...

</script>

For Node(js/ts)

Install with yarn/npm
yarn add evtscan
# or
# npm install --save evtscan
Write your Code
import EvtScan from 'evtscan';

const evtScan = new EvtScan();

Or, if you want to use your own upstream:

import EvtScan, { ApiCaller } from 'evtscan';

const apiCaller = ApiCaller('https://some-evtscans.io/api/');
const evtScan = new EvtScan({ apiCaller });
// or
// const evtScan = new EvtScan({ endpoint: 'https://some-evtscans.io/api/' });

Keywords

FAQs

Package last updated on 30 Jun 2019

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