Giter VIP home page Giter VIP logo

alephium-web3's Introduction

Alephium Web3

Github CI NPM code style: prettier

A Typescript library for building decentralized applications on Alephium.

Getting started

You could run the following command to scaffold a skeleton project for smart contract development:

npx @alephium/cli init <project-dir> [-t (base | react | nextjs)]

Please read the documentation for more.

Packages

There are a few packages in this repository:

  1. @alephium/cli is the CLI tool for dApp development.
  2. @alephium/web3 is the core and base package for all dApp development.
  3. @alephium/web3-wallet contains wallet related functions.
  4. @alephium/web3-test contains test related functions.
  5. @alephium/web3-react contains react components to help authenticate and interact with the Alephium blockchain
  6. @alephium/get-extension-wallet contains functions to get the extension wallet object
  7. @alephium/walletconnect contains Alephium's WalletConnect implementation

Development

Please refer to package.json.

alephium-web3's People

Contributors

aloiscochard avatar gilles-hemmerle avatar h0ngcha0 avatar jimmyhoffa avatar lbqds avatar lf94 avatar mvaivre avatar nop33 avatar polarker avatar ross-weir avatar suyanlong avatar tdroxler avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

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.

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

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
    }

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

[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

Improve cli deploy

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

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!

Support debugging mode

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

More tests

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

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.