VaultLayer supports connecting various wallets, including Bitcoin and EVM-compatible wallets. Hereβs how you can open the connect modal and handle wallet connections:
import { useEffect } from'react';constbtcProvider=useBitcoinProvider();// Will show a confirmation Modal:constres=awaitbtcProvider?.sendBitcoin( fromAddress: string; toAddress: string; satoshis: number; options: { fee:"slow"|"avg"|"fast"; bitcoinRpc: ''; forceHideConfirmModal?: boolean; });// Or directly sign a PSBT bitcoin transaction:consttxHex=await btcProvider??.signPsbt(psbt, { forceHideConfirmModal:false });consttxID=awaitbtcProvider?.pushTx(txHex);
Ethereum Transactions
import { useEffect } from'react';constethProvider=useEthereumProvider();// Will show a confirmation Modal:constres=awaitethProvider?.vaultEthClient?.signMessage({ account:smartVault.ethAddress asany, message:'Hello VaultLayer!\n\nChain-Abstraction for 1 click Bitcoin DeFi' });// Or directly sign an Ethereum transaction:constres=awaitvaultEthWallet?.signMessage('Hello VaultLayer!\n\nChain-Abstraction for 1 click Bitcoin DeFi');