Coder Social home page Coder Social logo

Comments (6)

nsjames avatar nsjames commented on June 6, 2024

Need more code here to see what's going on ( like what getScatterEosInstance is doing ). Also, I see you're using extension, have to tried to check if this works from desktop? Lots of functionality is missing from the extension.

from scatterwebextension.

jurosh avatar jurosh commented on June 6, 2024

Wanted to build and try desktop version but ran into GetScatter/ScatterDesktop#156

Here are some details about getScatterEosInstance

// Tried also with latest scatter-js and same result...
import ScatterJS from 'scatter-js/dist/scatter.esm';
import Eos from 'eosjs';

...

export const getScatterEosInstance = (
  actors: Array<{ actor: string, permission: string }>,
  moreOptions: any = {}
) => {
  const options = {
    broadcast: true,
    chainId,
    authorization: actors,
    ...moreOptions
  };
  const scatterEos = ScatterJS.scatter.eos(eosNetwork, Eos, options, 'http');
  if (scatterEos === undefined || scatterEos === null) {
    // 'failed to obtain the Scatter eosjs instance.'
    // throw error....
  }
  return scatterEos;
};

from scatterwebextension.

nsjames avatar nsjames commented on June 6, 2024

Looks like you aren't pulling in the ScatterEOS plugin: https://get-scatter.com/docs/examples-interaction-flow

from scatterwebextension.

jurosh avatar jurosh commented on June 6, 2024

Forgot to paste it here, but I am doing eos initialization ScatterJS.plugins(new ScatterEOS()); in another file..

Cannot make this code to be functional:

scatterInstance.getArbitrarySignature(
    userPublicKey,
    'testToSign',
    'Order signing',
    false
);

@nsjames can you confirm it's working for you ? Already tried Scatter Desktop too and looks like it's same issue - so maybe error in scatter eos plugin or am I calling it wrong way ?

from scatterwebextension.

nsjames avatar nsjames commented on June 6, 2024

Those imports, and the ScatterJS.plugins(new ScatterEOS()); instantiation should be done as early as possible in your app, and only in a single location and then fetched from a global store/state-handler.

By doing:

import ScatterJS from 'scatter-js/dist/scatter.esm';
import Eos from 'eosjs';

That instance of ScatterJS has no knowledge of any plugins in any other files as the scopes are different.

from scatterwebextension.

jurosh avatar jurosh commented on June 6, 2024

So I am getting into the core of issue. Looks like I have to use ScatterJS.scatter for getting signatures but I was using ScatterJS.scatter.eos instead.

from scatterwebextension.

Related Issues (20)

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.