0.1.5 • Published 1 year ago
delegatecash-button v0.1.5
delegatecash-button ·
This library is a web 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
<html>
<head>
<script
src="https://cdn.jsdelivr.net/npm/delegatecash-button@latest/delegate-cash-button.js"
type="module"
></script>
</head>
<body>
<delegate-cash-button
label="Mint"
connected-wallet="0x0000000000000000000000000000000000000001"
rpc-url="https://goerli.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161"
rounded="true"
/>
</body>
</html>
Properties
Property | Description | Type | Default |
---|---|---|---|
rpc-url (required) | The rpc url of the network you want to use | string | undefined |
connected-wallet | The current connected wallet | string | undefined |
label | The main label (eg. "Mint", "Purchase") | string | undefined |
disabled | Whether the main button is disabled or not | boolean | false |
contract | Filter delegations by contract approval | string | undefined |
token-id | Filter delegations by tokenId approval | string | undefined |
default-wallet-selection | Auto-select a vault instead of connected wallet | string | undefined |
default-no-wallet-label | Default label when a connected wallet is not selected | string | 'Connect Wallet' |
force-dropdown | Force dropdown to be open | boolean | false |
rounded | If you want rounded corners | boolean | false |
theme | Light or Dark theme | string | 'light' |
Events
Event | Description | Type |
---|---|---|
buttonClick | When the main button is clicked | CustomEvent<string> |
walletSelect | When a wallet is selected from the dropdown | CustomEvent<string> |