Giter Site home page Giter Site logo

client-js's People

Contributors

abourget avatar alexcppns avatar billettc avatar deniscarriere avatar dependabot[bot] avatar fproulx-dfuse avatar fschoell avatar joshkauffman avatar jubeless avatar kesar avatar maoueh avatar marcuswin avatar matei-radu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

client-js's Issues

Unexpected values returned from streamActionTraces() when with_dbops === true

Summary
The data returned from the streamActionTraces() method doesn't match the format expected by the declared Typescript interfaces.

Steps to Reproduce
Call the streamActionTraces() method with the with_dbops option set to true.

Expected Results
When an inbound message is received of type InboundMessageType.ACTION_TRACE, the message should conform to the ActionTraceInboundMessage interface declaration.

Actual Results
The dbOps key is undefined. The message contains a dbops key instead which is an array of objects similar to the following:

{
  "op": "UPD",
  "action_idx": 3,
  "opayer": "sampleuser24",
  "npayer": "sampleuser24",
  "path": "mycontract11//mytable12345/",
  "old": "000000000000000050c8102afb43affa97f89a5c881300000000000004454f53000000006d3301000000000001",
  "new": "000000000000000050c8102afb43affa97f89a5c881300000000000004454f53000000004de500000000000001"
}

…which is different than the DbOp type declaration in the @dfuse/client library:

export declare type DbOp<T> = {
    op?: string;
    action_idx: number;
    account?: string;
    table?: string;
    scope?: string;
    key?: string;
    old?: DbRow<T>;
    new?: DbRow<T>;
};

invalid token provided: illegal base64 data at input byte 1

Brief:

Trying to test my dfuse install, using examples/check-balance.ts with the following config (recommended here):

export NETWORK=0.0.0.0:8080 // using real IP
  const client = createDfuseClient({
    apiKey: "web_abcdef123456789",
    network: DFUSE_API_NETWORK,
    authUrl: "null://",
    secure: false
  })

Error:

An error occurred DfuseApiError: Unable to correctly decode provided token.
    at DefaultHttpClient.<anonymous> (/newvolume/client-js/examples/node_modules/@dfuse/client/dist/lib/client/http-client.js:164:24)
    at Generator.next (<anonymous>)
    at fulfilled (/newvolume/client-js/examples/node_modules/@dfuse/client/dist/lib/client/http-client.js:5:58)
    at processTicksAndRejections (internal/process/task_queues.js:97:5) {
  description: 'Unable to correctly decode provided token.',
  cause: undefined,
  code: 'auth_invalid_token_error',
  trace_id: 'ee76f63a26b30c06a541b0aa9a6ca0f9',
  details: {
    reason: 'rpc error: code = Unauthenticated desc = invalid token provided: illegal base64 data at input byte 1',
    token: ''
  }
}
Example completed.

Do graphql auto reconnects, if websocket connection gets closed?

Hi!
I am writing an app which needs to be up to date with eos blockchain and I am wondering, if I need to handle websockets closing on my end.

In other words:
If websockets close for graphql query do they automatically reconnects if I use your library or I need to manually establish connection again?

Example query:

        const stream = await dfuseClient.graphql(`subscription {
                searchTransactionsForward(query: "receiver:eosio.token action:transfer", irreversibleOnly: false) {
                  cursor
                  trace {
                    matchingActions {
                      json
                    }
                  }
                }
              }`, (message) => {
            if (message.type === "data") {
                console.log(message.data);
            } else {
                console.log(message);
            }
        });

script does not terminate - how to properly shut down?

Hi, I'm using this client in a node.js script and my script never terminates because the refresh-scheduler has an open handle. (the setTimeout in @dfuse/client/dist/lib/client/refresh-scheduler.js:27)

Is there a proper way to tell the client to cleanup / disconnect / release resources?

signing method (alg) is unavailable.

Today I tried to run queries which were working for couple of months on EOS network in my code and they all throw error:

signing method (alg) is unavailable.

Example query which generates this error:

    const dfuseClient = createDfuseClient({
      network: "eos.dfuse.eosnation.io",
      apiKey: "<web api key here>",
      streamClientOptions: {
        socketOptions: {
          onClose: (data) => {
            console.log(data);
          },
          onError: (data) => {
            console.log(data);
          }
        }
      }
    });

    const graphQLSubscriptionForAllIncomingTransactionsToEosioToken = `
              subscription($cursor: String!) {
                searchTransactionsForward(query: "receiver:eosio.token action:transfer -data.quantity:'0.0001 EOS'", irreversibleOnly: false) {
                  cursor
                  undo
                  trace {
                    matchingActions { json }
                  }
                }
              }
            `;

     // error is thrown exactly by below instruction
    const stream = await dfuseClient.graphql(graphQLSubscriptionForAllIncomingTransactionsToEosioToken, (message) => {
      if (message.type === "data") {
        console.log(message.data);
        console.log(message.data.searchTransactionsForward.undo);
      } else {
        console.log(message);
      }
    });

GraphQL conection hang up with message: { type: 'complete' }

Hi!

I am building application which synchronizes live with EOS blockchain. I established graphQL connection like this using dfuse-js:

this.dFuseClient.graphql(graphQLQuery, async (message) => { // do something });

My connection hang up after a few days and I am wondering how can I prevent it in the future?
I think terminal message I got was:

console.log(message); // { type: 'complete' }

and just in case one error message before I got:

console.log(message); // { type: 'error', errors: [ { message: 'graphql: hammer search result: rpc error: code = Unavailable desc = transport is closing (trace_id: 4bba6b2d211cb515713be5698c2014e1)' } ], terminal: true }

What should I do in such situation?
How can I make sure connection was closed so I can re establish it?
Or how to make sure connection won't hang up?

Unable to install for browser using NPM

I get this message

ERROR in ./node_modules/@dfuse/client/dist/dfuse-client.umd.js
Module not found: Error: Can't resolve 'fs' in '/Users/mwawrusch/Dev/roji/roji-shop/node_modules/@dfuse/client/dist'

in version "@dfuse/client": "0.2.0-rc.28",
It worked in version 0.2.0-rc.01 - don't know yet where it broke in between

I receive the same data from network twice after connection hang up error!

Hi!

I have got small dapp which tracks transactions on EOS network and it is very important for me to not receive over your library duplicated data and I am pretty sure I do.

After library hangs connection for a moment with error:

{
  type: 'error',
  errors: [
    {
      message: 'graphql: hammer search result: rpc error: code = Unknown desc = Internal server error (trace_id: 
      56c9fe4be60757f244e32b37e56ce125)'
    }
  ],
  terminal: true
}

I receive the same data I already received before error being thrown.
This is very dangerous for my app. I plan to receive and send from my contract money in form of EOS and other tokens to users.
Please advice what to do.

Remove spread operator from umd bundle

We're getting prod errors in the Everipedia.org site for browsers which do not support the spread operator (...).

After running this repo locally, it appears that dfuse-client.umd.js contains this syntax, which should not land in user's browsers untranspiled.

None of the other dist outputs contain this, so I'm going to borrow their build syntax and PR this 🙌

ApiRequest obfuscates nodeos like erros in DfuseAPiError

ApiRequest obfuscates nodeos like erros if used to fetch or push a transaction using dfuse endpoint

The reason is the handling of DfuseApiError class
https://github.com/dfuse-io/client-js/blob/master/src/client/http-client.ts#L235

Example nodeos error and the "error" field with "code" and "what" is obfuscated.
{"code":500,"message":"Internal Service Error","error":{"code":3090005,"name":"irrelevant_auth_exception","what":"Irrelevant authority included","details":[{"message":"action declares irrelevant authority '{"actor":"pixeos1issue","permission":"issue"}'; minimum authority is {"actor":"pixeos1issue","permission":"active"}","file":"authorization_manager.cpp","line_number":534,"method":"check_authorization"}]}}

Add WAX as a valid network

As Dfuse partnered with WAX, it would be nice to just be able to write wax like you can currently do with mainnet, jungle, and kylin.

The host is mainnet.wax.dfuse.io

// i want to do
createDfuseClient({
    apiKey: DFUSE_API_KEY,
    network: `wax`,
    httpClientOptions: {
      fetch: nodeFetch
    }
  });

// I have to do
createDfuseClient({
    apiKey: DFUSE_API_KEY,
    network: `mainnet.wax.dfuse.io`,
    httpClientOptions: {
      fetch: nodeFetch
    }
  });

Cannot write to $HOME

I'm deploying an app to the serverless Now platform where access to the $HOME directory is not allowed (/tmp is). I am therefore running into an issue because api-token-store.js on line 146 tries to write to the home directory:

super(`${homeDirectory}/.dfuse/${sha256sum.update(apiKey).digest("hex")}/token.json`);

would it be possible to pass an option to the createDfuseClient function indicating where an acceptable location for such storage may be?

if I submitted a PR would it have a reasonable chance of being accepted?

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.