erdboxdeprecated

Drop-in widget for connecting Elrond dapps to user wallets

Usage no npm install needed!

<script type="module">
  import erdbox from 'https://cdn.skypack.dev/erdbox';
</script>

README

erdbox

NPM module Join the community Follow on Twitter

Drop-in widget for connecting your Elrond dapp to user's wallets.

Live demo: Sting wallet

  • Supports all wallet types: Mnemonic/seedphrase, JSON keyfile, PEM file, Ledger hardware.
  • Full transaction signing (including smart contract interactions).
  • Easy and simple API.
  • Works with any frontend framework and/or vanilla JS.
  • Self-hosting and/or IPFS supported.
  • Typescript definitions.
  • Full documentation.

Usage

Include the following script tag anywhere within your HTML:

<script type="text/javascript">
  const g = window.document.createElement('script');
  g.id = 'erdboxScript';
  g.type = 'text/javascript';
  g.async = true;
  g.defer = true;
  g.src = 'https://cdn.jsdelivr.net/npm/erdbox@1.12.0/dist/erdbox.js';
  window.document.body.appendChild(g);
</script>

Note: replace 1.12.0 in the above code with the latest version of erdbox. This can always be found by visiting the erdbox package page at https://www.npmjs.com/package/erdbox

Then in your Javascript code:

window.addEventListener('erdbox:ready', async () => {
  /*
    `window.erdbox` is now available for use!
  */

  // Example: ask user to connect a wallet
  const address = await window.erdbox.getWalletAddress({ mustLoadWallet: true });
  alert(`User wallet address: ${address}`);
}, { once: true });

Full documentation is available at https://erdbox.erd.dev.

Contributors guide

Note: These instructions are for developers who wish to work on erdbox itself.

Start the dev server

yarn dev

The script will now be available at http://localhost:9000/erdbox.js, so replace the embed code URL with this one:

g.src = 'http://localhost:9000/erdbox.js'

License

AGPLv3