DEPRECATED - erdbox is now deprecated and no longer maintained. Please use the official starter dapp instead.
Drop-in widget for connecting your Elrond dapp to user's wallets.
- 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.
Include the following script tag anywhere within your HTML:
<scripttype="text/javascript">constg=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 walletconstaddress=awaitwindow.erdbox.getWalletAddress({mustLoadWallet: true});alert(`User wallet address: ${address}`);},{once: true});Note: These instructions are for developers who wish to work on erdbox itself.
Start the dev server
yarn devThe 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'AGPLv3