Giter Club home page Giter Club logo

web3.js's Introduction

web3.js

web3.js - Ethereum JavaScript API

This is a modified version of the web3.js library, which only includes the web3-eth-abi package.

Usage

This was adapted so that it can be used in BigQuery SQL. To use it yourself, upload ./dist/web3.min.js file to Google Cloud bucket storage and use it like so:

CREATE TEMP FUNCTION myFunc()
RETURNS STRING
LANGUAGE js
OPTIONS (
library=['gs://lib-source/web3.min.js'])
AS r"""
const web3 = new window.Web3();

const decoded = web3.decodeLog([
{
    type: 'bytes32',
    name: 'node',
    indexed: true
    },
    {
        type: 'string',
        name: 'indexedKey',
        indexed: true
        },
        {
            type: 'string',
            name: 'key',
            },
            // Value emit was added just recently
            // https://github.com/ensdomains/ens-contracts/commit/d5174e4572d4143342d237ec8017d6e0da90bc7d
            // {
                //   type: 'string',
                //   name: 'value',
                // }
                ],
                '0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000066176617461720000000000000000000000000000000000000000000000000000',
                [
                "0xd8c9334b1a9c2f9da342a0a2b32629c1a229b6445dad78947f674b44444a7550",
                "0xf6ed4a4a8c7d4df88c25a6ec2f3868a66e3bc9c6f2a7481dfd0c3ea7d32d2129",
                "0xd1f86c93d831119ad98fe983e643a7431e4ac992e3ead6e3007f4dd1adf66343"
                ]
                );

console.log(decoded)

return decoded.key;
""";

SELECT myFunc();

web3.js's People

Contributors

frozeman avatar debris avatar nivida avatar cgewecke avatar ryanio avatar spacesailor24 avatar cubedro avatar jdevcs avatar gregthegreek avatar obscuren avatar gabmontes avatar holgerd77 avatar frankiebee avatar gavofyork avatar cruzmolina avatar nachomazzara avatar ethers avatar kumavis avatar chevdor avatar nazarhussain avatar dependabot[bot] avatar lefterisjp avatar nimishbongale avatar bethnull avatar princesinha19 avatar ewingrj avatar joshstevens19 avatar nujabes403 avatar helderjnpinto avatar victortaelin avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.