Nth Phonetic Mnemonic

    ng-angular
    TypeScript icon, indicating that this package has built-in type declarations

    0.0.1 • Public • Published

    ng-ansible

    An Angular service for using Ansibles, generalised state channels enforced on the Ethereum blockchain. This service is provided as a wrapper for an Ansible Relay to make some of the operations more convenient - it does not handle any custom Speaker interaction.

    Events

    To get all past events for a given Ansible, use the getAnsibleEvents(ansibleID) method, and use watchAnsibleEvents(ansibleID) to watch for future events.

    Examples

    constructor(
        private ansibleService : AnsibleService
    ){}
    
    watchSpeakerOpens() {
        let speaker = "0x0";
        this.ansibleService.watchSpeakerOpens(speaker).subscribe(e => {
            // will be fired every time an event is found
        });
    }
    
    getAnsibleCheckpoints() {
        let id = 1000;
        this.ansibleService.getAnsibleCheckpoints(id).subscribe(events => {
            // an array of all prior checkpoints
        });
    }
    
    watchSpeakerEvents() {
        let speaker = "0x0";
        this.ansibleService.watchSpeakerEvents(speaker).subscribe(e => {
            // will be fired every time an event is found
        });
    }
    
    watchAnsibleEvents() {
        let ansibleID = 1000;
        this.ansibleService.watchAnsibleEvents(ansibleID).subscribe(e => {
            // will be fired every time an event is found
        });
    }
    
    watchSpeakerEvents() {
        let speaker = "0x0";
        this.ansibleService.watchSpeakerEvents(speaker).subscribe(e => {
            // will be fired every time an event is found
        });
    }
    

    Install

    npm i ng-angular

    DownloadsWeekly Downloads

    4

    Version

    0.0.1

    License

    MIT

    Unpacked Size

    283 kB

    Total Files

    14

    Last publish

    Collaborators

    • alexender