@polkadot-cloud/connect
v1.0.9
Published
Providers and hooks for connecting to web3 wallets and interacting with accounts
Maintainers
Readme
Connect
Providers and hooks for connecting to web3 wallets and interacting with accounts
Installation
npm install @polkadot-cloud/connector
yarn add @polkadot-cloud/connector
pnpm add @polkadot-cloud/connectUsage
import { ConnectProvider } from '@polkadot-cloud/connect'
function App() {
return (
<ConnectProvider ss58={0} dappName="My Dapp">
{/* Your app content */}
</ConnectProvider>
)
}Adaptor Model
ConnectProvider supports an adaptors prop that accepts an array of provider components. Adaptors are dynamically nested inside ConnectProvider, allowing your dapp to opt in to whichever connection methods it needs without hard dependencies.
First-party adaptors:
@polkadot-cloud/connect-ledger— Ledger hardware wallet support@polkadot-cloud/connect-vault— Polkadot Vault (QR-based) wallet support
import { ConnectProvider } from '@polkadot-cloud/connect'
import { LedgerAdaptor } from '@polkadot-cloud/connect-ledger'
function App() {
return (
<ConnectProvider
ss58={0}
dappName="My Dapp"
adaptors={[LedgerAdaptor]}
>
{/* Your app content */}
</ConnectProvider>
)
}Each adaptor provides its own hooks for interacting with its connection method (e.g., useLedger from @polkadot-cloud/connect-ledger). Browser extension connectivity is built in via useExtensions and useExtensionAccounts.
Documentation
For comprehensive documentation and examples, visit the documentation.
Keywords
polkadot-cloud, polkadot, web3, react, hooks, wallet, connect, typescript
Repository
- Source: GitHub
- Package: npm
- Issues: GitHub Issues
License
This package is licensed under the GPL-3.0-only.
Part of the polkadot-cloud/connect - Packages for connecting to Polkadot wallets.
