DOCUMENTATION

BTC/PQD
Crypto 🤝 Cash

Payments infrastructure for the internet.

Hero image
Hero image
Hero image
Go down

Features

🔌 Connection management

  • Read-only mode out-of the box
  • Network switching
  • Handling multiple networks

🔄 Reading blockchain state

  • Auto refresh on new block
  • Auto refresh on wallet change
  • Combine multiple calls into a single multicall

✅ Transactions

  • Track transaction state
  • History
  • Notifications

⚙️ Browser plugin

  • Available in Beta for Firefox and Chrome
  • Track under-the-hood events
  • Manage ABIs and tags

Good design is opinionated

build on modern DApp stack

substrate logo Ethers logo Web3 logo Waffle logo

Example

Example app
is availiable here ❤️

const config: Config = {
    readOnlyChain: ChainId.Mainnet,
    readOnlyUrls: {
      [ChainId.Mainnet]: 'https://mainnet.infura.io/v3/62687d1a985d4508b2b7a24827551934',
    },
  }
    
  ReactDOM.render (
    <React.StrictMode>
      <DAppProvider config={config}>
        <App />
      </DAppProvider>
    </React.StrictMode>,
    document.getElementById('root')
  )
  1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import { formatUnits } from '@ethersproject/units'

const DAI = '0x6b175474e89094c44da98b954eedeac495271d0f'

export function TokenBalance( ) {
    const { account } = useEthers( )
    const tokenBalance = useTokenBalance(DAI, account)
                  
return (
      <div>
         {tokenBalance && <p>Balance: {formatUnits(tokenBalance, 18)}</p>}
      </div>
    )
}

  1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
function useTokenBalance (
  tokenAddress: string | Falsy,
  address: string | Falsy
) {
  const [tokenBalance] =
    useContractCall (
      address && tokenAddress && {
          abi: ERC20Interface, // ABI interface of the called contract
          address: tokenAddress, // On-chain address of the deployed contract 
          method: "balanceOf", // Method to be called 
          args: [address], // Method arguments - address to be checked for balance 
        }
    ) ?? [ ];
 return tokenBalance;
}
  1
2
3
4
5
6
7
8
9
10
11
12
13
14
15