Giter Club home page Giter Club logo

Comments (5)

jeapostrophe avatar jeapostrophe commented on May 28, 2024

Thanks @KBryan . I've assigned @DanBurton to work on "Implement formatAddress to turn a NetworkAccount into the way accounts are formatted for the given network".

In Reach's JavaScript support --- Address is represented by an internal NetworkAccount (see: https://docs.reach.sh/ref-frontends-js-types.html ) which on Algorand is just the public key, which you see displayed there. However, it is typical for people to not think of their public key as their address, but instead to write out the base32 encoding of the public key AND a checksum. You can see this in this function of the Algorand JS SDK --- https://github.com/algorand/js-algorand-sdk/blob/fd187cedab70cb123333ba62ca3e6fe98c1e7d3d/src/encoding/address.ts#L94-L110

Basically, we will make it so that Reach has a way to "format for user consumption" an address, just like we have formatCurrency.

Thanks again!

from reach-lang.

KBryan avatar KBryan commented on May 28, 2024

Sounds good, will keep this issue open until the solution mentioned has been implemented and tested.

from reach-lang.

DanBurton avatar DanBurton commented on May 28, 2024

There is a new stdlib function, formatAddress, that is available for this. It accepts an Account, NetworkAccount, or an Address, and formats it in the network-specific way users expect to see it.

https://docs.reach.sh/ref-frontends-js-utils.html#%28javascript._%28%28format.Address%29%29%29

Available as of @reach-sh/[email protected]

from reach-lang.

KBryan avatar KBryan commented on May 28, 2024

Ok, are there any test cases for this?

from reach-lang.

DanBurton avatar DanBurton commented on May 28, 2024

If you're curious:
279dcbd#diff-238f2c0082bb61188656d618a2e0069050a4512be69c42a0fd3b798ce7a42042

from reach-lang.

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.