🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis
Socket
Book a DemoInstallSign in
Socket

@radixdlt/connect-button

Package Overview
Dependencies
Maintainers
8
Versions
105
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@radixdlt/connect-button

Radix Connect button repository

Source
npmnpm
Version
0.11.0-alpha.9
Version published
Weekly downloads
11
-70.27%
Maintainers
8
Weekly downloads
 
Created
Source

License

The √ Connect Button is a framework agnostic web component to help developers connect users and their Radix Wallet to their dApps.

It appears as a consistent, Radix-branded UI element that helps users identify your dApp website as a Radix dApp. When used with Radix dApp Toolkit it is compatible with the Radix Wallet – and it automatically provides a consistent user experience for users to connect with their wallet and see the current status of the connection between dApp and Radix Wallet.

Installation

Using NPM

npm install @radixdlt/connect-button

Using Yarn

yarn add @radixdlt/connect-button

Usage

Getting started

Add the <radix-connect-button /> element in your HTML code and call the configuration function.

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <script type="module" src="/bundle.js"></script>
  </head>
  <body>
    <radix-connect-button />
  </body>
</html>

Properties

const radixConnectButton = document.querySelector('radix-connect-button')!

const handleConnect = () => {
  radixConnectButton.loading = true
  radixConnectButton.connecting = true
}

radixConnectButton.addEventListener('onConnect', handleConnect)
type ConnectButtonProperties = {
  personaLabel: string
  dAppName: string
  loading: boolean
  connected: boolean
  connecting: boolean
  showPopover: boolean
  showNotification: boolean
  requestItems: RequestItem[]
  accounts: Account[]
}
  • personaLabel - label of the connected persona
  • dAppName - name of the dApp
  • loading - set loading state
  • connected - set connected state
  • connecting - set connecting state
  • showPopover - display connect button popover
  • showNotification - display an icon that indicates that a request item has been updated
  • requestItems - displays a list of maximum 3 request items in the popover
  • accounts - displays a list of connected accounts

Events

type ConnectButtonEvents = {
  onConnect: () => void
  onDisconnect: () => void
  onCancelRequestItem: (event: CustomEvent<{ id: string }>) => void
  onDestroy: () => void
  onShowPopover: () => void
}
  • onConnect - triggers when user clicks connect now button
  • onDisconnect - triggers when user clicks disconnect wallet button
  • onCancel - triggers when user cancels connect request
  • onDestroy - triggers when button is removed from the DOM. Useful for cleaning up registered event listeners and subscriptions.

Keywords

radix

FAQs

Package last updated on 14 Feb 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts