Git Product home page Git Product logo

Comments (4)

dakom avatar dakom commented on July 17, 2024

Is this not possible, because the extension itself uses sync instead of block? : https://github.com/terra-money/station/blob/9064625093f352b1e8d65a44cfb81ef98e2775ce/src/extension/Confirm.tsx#L116

from wallet-provider.

dakom avatar dakom commented on July 17, 2024

ok, I think I'm supposed to lookup the hash info after - but when I do lcd.tx.txInfo(res.result.txhash) I get a 404

however, if I delay it by several seconds, then it works.

is this a bug? or is there some way to tell wallet.post() to wait until the block is resolved?

from wallet-provider.

iamssen avatar iamssen commented on July 17, 2024

@dakom After you broadcast Tx, it takes time for it to be processed as a block.

It will be a txhash value after post(). We tend to wait for the block to be processed by polling txInfo() at regular intervals of 500ms to 1000ms based on the corresponding txhash.

The above codes are part of the Anchor WebApp and may seem too complicated, but there is no simple example code.

It would be nice to add an example of waiting for txhash after post(). Currently, I am developing related to col-5 update, so I think I need time to add that example.

from wallet-provider.

dakom avatar dakom commented on July 17, 2024

Thanks @iamssen !

I'm happy to share my "hello world" sorta project once I have it working... I'm moving the wallet integration stuff into its own iframe so that could help it be a nice reference since the core functions will be totally abstracted.

Closing the issue :)

from wallet-provider.

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.