Skip to content

SVOIcom/inscriptionsplace-plugin-helper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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;
        }
    }
    
}

About

Everscale inscriptions plugin interface

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published