0.0.44 • Published 5 months ago

@unielon/wallet-connect-react v0.0.44

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

Dogeuni Wallet browser extension & React Provider

Powering the future for Dogeuni DRC20 Wallet. Connecting the Unielon Wallet to the base library through React Provider.

Installation

yarn add @unielon/wallet-connect-react
npm i @unielon/wallet-connect-react --save

Initialize

/* App.jsx */
import { WalletConnect } from '@unielon/wallet-connect-react'

export default App(){
  return (
    <WalletProvider blockRefresh={5000}>
    ...
    </WalletProvider>
  )
}

WalletProvider coinfig state

statetypedefaultdescription
blockRefreshnumber1000 * 60Interval in milliseconds to refresh the block data

connect to dogeuni wallet

/* ConnectButton.jsx */
import { useWallet } from './provider'

export default function ConnectButton() {
  const { connect, connectLoading, address } = useWallet()
  return <button onClick={() => connect()}>{connectLoading ? 'connecting...' : address || 'Connect Wallet'}</button>
}

wallet state

statetypedefaultdescription
addressstringnullThe currently connected wallet address
installedbooleanfalseWhether the extension is installed
connectedbooleanfalseWhether it is connected to the wallet extension
sendLoadingbooleanfalseLoading state for sending transactions
connectLoadingbooleanfalseLoading state for connecting to the wallet
sendErrorstringError message for sending transactions
dogecoinBalancenumbernullBalance of Dogecoin
publicKeystringnullPublic key of the wallet
networkstringnullCurrent network
currencystringusdCurrent currency
currentCurrencystring{ name: 'USD', symbol: '$' }Current selected currency
currencyListarrayCurrencyItemType[]List of available currencies, CurrencyItemType[]
uniBlockfunctionnullget the current Unielon block
dogeBlockfunctionnullget the current Dogecoin block
pricefunctionnullget the current price
feefunctionnullget the current fee

wallet actions

actiontypedefaultdescription
sendTransferfunctionnullbase wallet action
connectfunctionnullconnect to the wallet
sendInscribefunctionnullmint & inscribe DRC20 tick
sendTransferfunctionnullDRC20 tick transfer
sendSwapfunctionnullDRC20 swap exchange
sendExchangefunctionnullDRC20 market exchange
sendBoxfunctionnullsend box exchange
sendNftfunctionnullNFT exchange
sendStakefunctionnullstake
sendPumpfunctionnullpump swap & transfer
sendDogefunctionnullsend doge
getBalancefunctionnullget Dogecoin balance
networkChangefunctionnullcurrent Dogecoin network
accountChangefunctionnulladdress account change
currencyChangefunctionnullcurrent currency change
getBlockNumberfunctionnullget the current block number
getFeefunctionnullretrieve the fee
getPricefunctionnullretrieve the price
initPriceFeefunctionnullinitialize the price and fee
0.0.44

5 months ago

0.0.42

5 months ago

0.0.43

5 months ago

0.0.40

5 months ago

0.0.41

5 months ago

0.0.37

6 months ago

0.0.38

6 months ago

0.0.39

6 months ago

0.0.35

6 months ago

0.0.36

6 months ago

0.0.34

6 months ago

0.0.30

6 months ago

0.0.31

6 months ago

0.0.32

6 months ago

0.0.33

6 months ago

0.0.28

6 months ago

0.0.29

6 months ago

0.0.22

6 months ago

0.0.24

6 months ago

0.0.25

6 months ago

0.0.26

6 months ago

0.0.27

6 months ago

0.0.20

7 months ago

0.0.21

7 months ago

0.0.19

7 months ago

0.0.15

7 months ago

0.0.16

7 months ago

0.0.17

7 months ago

0.0.18

7 months ago

0.0.14

1 year ago

0.0.13

1 year ago

0.0.12

1 year ago

0.0.11

1 year ago

0.0.10

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago