Giter VIP home page Giter VIP logo

Comments (8)

evgenykuzyakov avatar evgenykuzyakov commented on September 24, 2024

It seems to be triggered when the access key points to its own account. We've tried to repro with the studio app, but it doesn't reproduce correctly.

from near-api-js.

evgenykuzyakov avatar evgenykuzyakov commented on September 24, 2024

Can we prioritize the fix?
Currently the accessKey is always pulled from the node through RPC. It doesn't cache the key locally:
https://github.com/nearprotocol/nearlib/blob/8aadbdd93c255ff2fa3f01397f5fc11be3f9aea5/src.ts/account.ts#L91-L100

from near-api-js.

evgenykuzyakov avatar evgenykuzyakov commented on September 24, 2024

Background: Right now 2 of the apps I'm working on (ethrelay and metanear) can't send more than 1 transaction per second. So I have to implement queue for metanear and to reimplement sendTransaction on ethrelay

from near-api-js.

evgenykuzyakov avatar evgenykuzyakov commented on September 24, 2024

Getting cors error:
Access to fetch at 'https://rpc.nearprotocol.com/' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

const nearRpc = new providers.JsonRpcProvider("https://rpc.nearprotocol.com");
return await nearRpc.sendJsonRpc('tx', [txHash, accountId]);

txHash is encoded and accountId is also expected val

Screen Shot 2020-03-30 at 9 56 16 AM

from near-api-js.

vgrichina avatar vgrichina commented on September 24, 2024

@evgenykuzyakov is nearcore executing OPTIONS requests as actual JSON-RPC? Not sure why would CORS error occur because of nonce error otherwise. Or is the problem that Access-Control-Allow-Origin isn't set on errors by nearcore?

from near-api-js.

mikedotexe avatar mikedotexe commented on September 24, 2024

Moved it to In Progress as I understand Vlad is working on this currently.

from near-api-js.

vgrichina avatar vgrichina commented on September 24, 2024

For now this is somewhat blocked by the fact that nearcore sometimes doesn't return error specific to duplicate nonce (Timeout is returned instead).

from near-api-js.

bowenwang1996 avatar bowenwang1996 commented on September 24, 2024

nearcore issue: near/nearcore#2039.

from near-api-js.

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.