0.1.6 • Published 1 year ago

delegatecash-button-react v0.1.6

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

delegatecash-button-react · NPM npm (tag) npm bundle size Twitter URL

This library is a component that, when given a connected wallet and an rpc network, will generate a pre-made UI component that allows you to select your delegated vaults from the delegate.cash Relegation Registry.

Usage Examples

Javascript | React | Svelte

import DelegateCashButton from 'delegatecash-button-react';

function Example() {
  return (
    <DelegateCashButton
      label="Mint"
      connectedWallet="0x0000000000000000000000000000000000000001"
      rpcUrl="https://goerli.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161"
      rounded={true}
      onButtonClick={event => console.log(event.detail)}
      onWalletSelect={event => console.log(event.detail)}
    />
  );
}

Properties

PropertyDescriptionTypeDefault
rpcUrl (required)The rpc url of the network you want to usestringundefined
connectedWalletThe current connected walletstringundefined
labelThe main label (eg. "Mint", "Purchase")stringundefined
disabledWhether the main button is disabled or notbooleanundefined
contractFilter delegations by contract approvalstringundefined
tokenIdFilter delegations by tokenId approvalstringundefined
defaultWalletSelectionAuto-select a vault instead of connected walletstringundefined
defaultNoWalletLabelDefault label when a connected wallet is not selectedstring'Connect Wallet'
forceDropdownForce dropdown to be openbooleanfalse
roundedIf you want rounded cornersbooleanfalse
themeLight or Dark themestring'light'

Events

EventDescriptionType
buttonClickWhen the main button is clickedCustomEvent<string>
walletSelectWhen a wallet is selected from the dropdownCustomEvent<string>
0.1.0

1 year ago

0.1.4

1 year ago

0.1.6

1 year ago

0.1.5

1 year ago

0.0.1

1 year ago