Initial commit
This commit is contained in:
46
packages/wallets/README.md
Normal file
46
packages/wallets/README.md
Normal file
@@ -0,0 +1,46 @@
|
||||
# @dbis-thirdweb/wallets
|
||||
|
||||
Wallet connectors and configuration for Chain 138.
|
||||
|
||||
## Usage
|
||||
|
||||
### Wallet Configuration
|
||||
|
||||
```typescript
|
||||
import { getWalletConfig } from '@dbis-thirdweb/wallets';
|
||||
|
||||
const config = getWalletConfig({
|
||||
confirmationBlocks: 2,
|
||||
gasStrategy: {
|
||||
multiplier: 1.5,
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
### Chain Switching
|
||||
|
||||
```typescript
|
||||
import { switchToChain138, ensureChain138 } from '@dbis-thirdweb/wallets';
|
||||
import { useWallet } from '@thirdweb-dev/react';
|
||||
|
||||
function MyComponent() {
|
||||
const wallet = useWallet();
|
||||
|
||||
const handleSwitch = async () => {
|
||||
await switchToChain138(wallet);
|
||||
};
|
||||
|
||||
// Or use ensure (switches only if not already on Chain 138)
|
||||
const handleEnsure = async () => {
|
||||
await ensureChain138(wallet);
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
## Features
|
||||
|
||||
- Chain 138 wallet configuration defaults
|
||||
- Gas strategy configuration
|
||||
- RPC failover support
|
||||
- Chain switching utilities
|
||||
- Automatic chain addition if missing
|
||||
Reference in New Issue
Block a user