npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

etherbrite-connect

v1.0.5

Published

Connect ethereum network.

Downloads

48

Readme

etherbrite-connect

An Async JavaScript library for interacting with the Etherbrite protocol.

Installation

npm i --save etherbrite-connect
or 
yarn add etherbrite-connect

Don't forget setup init a providor with web3 before any API;

// configuration
import Web3 from 'web3';
const provider = new Web3.providers.HttpProvider("http://localhost:8545");

import { eventContract } from 'etherbrite-connect'; // import eventContract class from 'etherbrite-connect
const eventContractInst = new eventContract(provider); // init an eventContract instance

APIs

  • Create an event
eventContractInst.createEvent(name, location, date, ticketNum, ticketPrice)
  .then(inst=>{
    if(inst.options.address) return console.log(`Deplyed Contract Address ${inst.options.address}`, inst);
  })
  .catch(console.error);
  • Buy a ticket
    • usage
    let dataObj = { first: 'Andy', last: 'Chen', email: '[email protected]' };
    eventContractInst.register(ContractAddress, dataObj)
      .then(result=>console.log(result))
      .catch(console.error);
  • sampe response
{ transactionHash: '0x5494bc4a76d3a85546cfd89b1d17b63a1aa55f5df372d434182839aa874905c7',
    transactionIndex: 0,
    blockHash: '0x7a9638f641431884e133bc8c29f22df7199be4665b5927090d6e044167af3fd3',
    blockNumber: 11,
    gasUsed: 105643,
    cumulativeGasUsed: 105643,
    contractAddress: null,
    status: 1,
    events:
     { NewRegistration:
        { logIndex: 0,
          transactionIndex: 0,
          transactionHash: '0x5494bc4a76d3a85546cfd89b1d17b63a1aa55f5df372d434182839aa874905c7',
          blockHash: '0x7a9638f641431884e133bc8c29f22df7199be4665b5927090d6e044167af3fd3',
          blockNumber: 11,
          address: '0xE39e06858989b5eB9C7C056240aC04578D836D57',
          type: 'mined',
          id: 'log_adbe8fef',
          returnValues: [Object],
          event: 'NewRegistration',
          signature: '0x127d2d02c713b5cea468d887c24a55945cc57fe875c38067b84648cf4f936661',
          raw: [Object] } } }
  • Search for one existing user
  • usage
let dataObj = { address: "0x5911a943ba6bdsamp1e150269a087047bdsamp1e" }
eventContractInst.search(ContractAddress, dataObj)
  .then(result=>console.log(result))
  .catch(console.error);
  • sample repsonse

    {
        '0': 'Andy', // first name
        '1': 'Chen', // last name
        '2': '[email protected]', // email
        '3': false  // checkedin status
    }
  • Checkin one existing user

  • usage

let dataObj = { address: "0x5911a943ba6bdsamp1e150269a087047bdsamp1e" }
eventContractInst.checkin(ContractAddress, dataObj)
  .then(result=>console.log(result)) // 
  .catch(console.error);
  • sample repsonse
    { transactionHash: '0x6242018138e86ad184d73661ac403cc18e8557bf271926b325741ef028b28cc0',
        transactionIndex: 0,
        blockHash: '0x3f2aad58157335ac4356391f1a8b64fee0736784735a6ab6adeda847dcb63ddf',
        blockNumber: 24,
        gasUsed: 50378,
        cumulativeGasUsed: 50378,
        contractAddress: null,
        status: 1,
        events:
         { CheckedIn:
            { logIndex: 0,
              transactionIndex: 0,
              transactionHash: '0x6242018138e86ad184d73661ac403cc18e8557bf271926b325741ef028b28cc0',
              blockHash: '0x3f2aad58157335ac4356391f1a8b64fee0736784735a6ab6adeda847dcb63ddf',
              blockNumber: 24,
              address: '0xd75b896e948631049117CDC8A2765b0323Be166D',
              type: 'mined',
              id: 'log_2ff0196c',
              returnValues: [Object],
              event: 'CheckedIn',
              signature: '0x27e2f86749fa88ec6d05509790439db523bba85f9371575f0e6610b483a0fdf0',
              raw: [Object] } } }

Sample Code

are available in the test.js

author

Andy Chen(amazingandyyy)

LICENSE

MIT