@xircus-web3/react
v1.1.89
Published
Xircus SDK React
Downloads
108
Readme
@xircus-web3/react
Hooks
Here are the list of available hooks
| Hook Name | Description | |--- |--- | |useWallet | Account Wallet Connection | |useWalletAuth | Wallet Authentication | |useSDK | Using the SDK Instance | |useSDKCore | Using the SDK Core Only | |useXircusRegistry | Use Xircus Registry API functions | |useProviderGraph | Use Provider API functions | |useNetwork | Get Blockchain Info | |useCoreContract | Use Prebuilt Contracts | |useStorage | Upload with IPFS | |useContractFactory | Fetches deployed contract from registry with Contract ID | |useContract | Requires Contract ID, Deployment Address, Chain | |useDeployedContract| Requires Deployment Contract ID | |useGlobalState | Global State Manager | |useDebounce | Simple Debounce Hook |
Release Info
- We just added first class support for solana and near
Documentation
For full documentation and example, visit Xircus Developers
Installation
npm install @xircus-web3/react @tanstack/react-query
or
yarn add @xircus-web3/react @tanstack/react-query
Get Started with Next
Add XircusProvider inside the _app.js file
import { XircusProvider, setupSDK } from '@xircus-web3/react'
const sdk = setupSDK('bsc')
function YourApp({ Component, pageProps }) {
return (
<XircusProvider sdk={sdk}>
<Component {...pageProps} />
</XircusProvider>
)
}
export default YourApp
Using hooks inside the index.js
import { useWallet } from '@xircus-web3/react'
export default function Index() {
const wallet = useWallet()
return (
<div>
<p>Account: {wallet.status == 'connected' && wallet.account}</p>
<button onClick={wallet.connectMetamask}>Connect To Metamask (EVMs)</button>
<button onClick={wallet.connectPhantom}>Connect To Phantom (Solana)</button>
<button onClick={wallet.connectSender}>Connect To Sender (Near)</button>
</div>
)
}
Community
Check out the following places for more xircus-related content:
- Join the discussions on GitHub
- Follow @xircusweb3 on Twitter for project updates
- Share your project/organization using Xircus
- Browse the awesome-xircus list of awesome projects and resources
Support
If you find @xircus-web3/sdk useful, please consider supporting our development. Thank you 🙏