New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@inscriptionsplace/plugin-helper

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@inscriptionsplace/plugin-helper

Everscale inscriptions plugin interface

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

Inscriptions.place

Write your inscriptions indexer plugin with this interface

Usage


import Plugin from '@inscriptionsplace/plugin-helper';

class MyPlugin extends Plugin {

    //Initialize your plugin
    async init() {
        console.log('MyPlugin loaded')
    }

    //Start your plugin
    async start() {
        console.log('MyPlugin started')
    }

    //Process events
    async processProtocolEvent(protocol, event, data) {
        switch (protocol) {
            case 'eep20':
                switch (event) {
                    case 'transfer':
                        console.log('new eep20 transfer!:', data)
                        break;
                }
        }
    }

}

Custom protocol


import Plugin from '@inscriptionsplace/plugin-helper';



class BlockchainLogProtocolPlugin extends Plugin {

    //Initialize your plugin
    async init() {
        const bcLogProtocol = new BlockchainLogProtocol(this.storage, this.api, this.sqlIndex, this.processor);
        await this.registerProtocol('log', BlockchainLogProtocol);
    }

 

}

class BlockchainLogProtocol{
    
    async processTx(etx){
        let {op, log} = etx.protocolData;
        
        switch (op) {
            case 'log':
                console.log('new log event!:', log)
                break;
        }
    }
    
}

Keywords

inscriptions

FAQs

Package last updated on 31 Jan 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