Extension Wallet
To enable dApps to automatically detect extension wallets that support Alephium, these wallets must adhere to the following standard, which is inspired by EIP-6963:
function announceProvider() {
const event = new CustomEvent('announceAlephiumProvider', {
detail: Object.freeze({ provider: alephiumWindowObject })
})
const handler = () => window.dispatchEvent(event)
handler()
window.addEventListener('requestAlephiumProvider', handler)
}
The extension wallets must call the announceProvider
function in inpage.js
.
The alephiumWindowObject
must inherit from the InteractiveSignerProvider
and include the following four fields:
name
: The wallet name, please note thatalephium
cannot be used as the wallet nameid
: The wallet ID, please note thatalephium
cannot be used as the wallet IDicon
: The wallet iconversion
: The wallet version
For more details, you can refer to the code in the Alephium extension wallet here.