Giter Club home page Giter Club logo

alephium-web3's Issues

Improve the error message when contract deployment fails

@nop33 reported that when contract deployment fails, the error message is something like this:

Loading alephium config file: /Users/ilias/dev/alephium/fetatoken/alephium.config.ts
Failed to deploy contracts, error: SyntaxError: Property assignment expected. (24:9)
  22 |     function toDeployments(json: any): Deployments {
  23 |       const contracts = {
> 24 |         ,
     |         ^
  25 |       }
  26 |       return {
  27 |         ...json,

We need to improve the error message.

Support debugging mode

When debug mode is configure in alephium.config.ts, all of the HTTP requests would be logged, like Wallet connect

Improve Dev Experience

Feel free to share any specific suggestions to enhance the overall experience, especially with examples. The dev team is currently busy, but we'll soon have more time to fine-tune things. Your input is valuable!

Detect non hex string for fields

When providing name and symbol to deploy a new token, it's very easy to use string instead of hex string in the initialFields:

    initialFields: {
      symbol: 'TF', // Buffer.from('TF', 'utf8').toString('hex'),
      name: 'TokenFaucet' // Buffer.from('TokenFaucet', 'utf8').toString('hex'),
      decimals: 0n,
      supply: issueTokenAmount,
      balance: issueTokenAmount
    }

More tests

  • Test deployments generation, especially with taskId
  • Test deployment scripts, especially with fromIndex, toIndex

Improve cli deploy

  • Check whether source code changed before deployment
  • ask devs whether they want to deploy even if the contracts have changed

Fix circular dependencies

I noticed some circular deps in the web3-react package when running the build script:

(!) Circular dependencies
src/components/AlephiumConnect.tsx -> src/components/ConnectModal/index.tsx -> src/components/AlephiumConnect.tsx
src/components/AlephiumConnect.tsx -> src/components/ConnectModal/index.tsx -> src/components/Common/Modal/index.tsx -> src/components/AlephiumConnect.tsx
src/components/AlephiumConnect.tsx -> src/components/ConnectModal/index.tsx -> src/components/Pages/Connectors/index.tsx -> src/components/AlephiumConnect.tsx
...and 7 more

[web3-react] Simplify connect context

All changes to the ConnectContext would trigger rerender, so we should keep the global context as simple as possible. The following should be removed and devs should use other hooks useAccount and useBalance etc.

  account?: Account
  setAccount: React.Dispatch<React.SetStateAction<Account | undefined>>
  displayAccount?: (account: Account) => string
  signerProvider?: SignerProvider
  setSignerProvider: React.Dispatch<React.SetStateAction<SignerProvider | undefined>>
  addressGroup?: number
  keyType?: KeyType
  network?: NetworkId

Explorer endpoints always return `null` due to post processing

The following explorer endpoints always return null. I believe this is due to the convertHttpResponse post-processing. These specific endpoints accept text/plain media type, in contrary to the usual application/json. So they require a different kind of post-processing, sth like .then((res) => res.text()):

  • getInfosSupplyTotalAlph
  • getInfosSupplyCirculatingAlph
  • getInfosTotalTransactions

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.