1.0.0 • Published 1 year ago

@kcf/kda-wallet-eckowallet-connect-button v1.0.0

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
1 year ago

@kcf/kda-wallet-eckowallet-connect-button

A ready-to-use eckoWALLET connect wallet button.

Usage Notes

  • As with all other @kcf/kda-wallet-* web components, the element is completely unstyled and not encapsulated in a shadow DOM to allow for easy customizability. The raw html is available in template.js

Attributes

namedescriptionrequireddefault
autoresumewhen set, the component will save the current wallet connected session to localStorage and attempt to resume from it the next time the user enters the sitenofalse
autoresumekeythe localStorage key to use to save autoresume datano@kcf/kda-wallets-web-components-base.DEFAULT_AUTORESUME_LOCALSTORAGE_KEY
network-idthe chainweb network IDno"mainnet01"

Custom Events

See @kcf/kda-wallet-web-components-base for custom events' detail schema

namedispatched after
kdawallet:beginconnectuser clicks the button
kdawallet:connectedwallet connected
kdawallet:disconnectedwallet disconnected
kdawallet:errorerror

Example

<kda-wallet-eckowallet-connect-button
  autoresume
></kda-wallet-eckowallet-connect-button>
const btn = document.querySelector("kda-wallet-eckowallet-connect-button");
const wallet = btn.connectedWallet;
if (wallet) {
  console.log(wallet.accounts);
}