You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import{start,subscribeState,WalletState}from'react-native-nitro-lndltc'// Write lnd.conf to your app's documents directory first, then:constsubscription=subscribeState((response)=>{console.log('State:',WalletState[response.state])},(error)=>console.error(error))awaitstart(`--lnddir=${lndDir}`)
Create or unlock a wallet
import{genSeed,initWallet,unlockWallet}from'react-native-nitro-lndltc'// First run: generate seed and create walletconstseed=awaitgenSeed({})const{ adminMacaroon }=awaitinitWallet({walletPassword: newTextEncoder().encode('mypassword'),cipherSeedMnemonic: seed.cipherSeedMnemonic,})// Subsequent runs: unlockawaitunlockWallet({walletPassword: newTextEncoder().encode('mypassword'),})
Subscribe to wallet state changes. Returns Subscription
Wallet management
Function
Description
genSeed(request?)
Generate a new wallet seed
initWallet(request)
Create a new wallet with password and seed
unlockWallet(request)
Unlock an existing wallet
walletBalance(request?)
Get wallet balance (total, confirmed, unconfirmed)
newAddress(request)
Generate a new address (P2WPKH, P2SH-P2WPKH, MWEB)
Transactions
Function
Description
getTransactions(request?)
Get transaction history
sendCoins(request)
Send coins to an address
estimateFee(request)
Estimate transaction fee
subscribeTransactions(request, onTx, onError)
Live transaction updates. Returns Subscription
Node info
Function
Description
getInfo()
Get node info (version, pubkey, sync status, etc.)
getRecoveryInfo()
Get wallet recovery progress
neutrinoKitStatus()
Get neutrino light client sync status
WalletKit
Function
Description
walletKitImportAccount(request)
Import a watch-only account
walletKitListAccounts(request?)
List wallet accounts
walletKitListAddresses(request?)
List addresses for all accounts
walletKitListLeases(request?)
List currently locked UTXOs
walletKitListUnspent(request?)
List unspent outputs
walletKitLabelTransaction(request)
Label a transaction
walletKitReleaseOutput(request)
Release a previously locked UTXO
walletKitPublishTransaction(request)
Publish a raw transaction to the network
walletKitSignMessageWithAddr(request)
Sign a message with an address's private key
walletKitVerifyMessageWithAddr(request)
Verify a signed message against an address
walletKitSignPsbt(request)
Sign a PSBT with wallet keys
walletKitFundPsbt(request)
Create and fund a PSBT
walletKitFinalizePsbt(request)
Finalize a PSBT into a broadcast-ready transaction
walletKitImportMwebScanKey(request)
Import an MWEB scan key for HW wallet integration
walletKitPrepareMwebPresign(request)
Attach MWEB presign fields (sender key + stealth scalar) to a funded PSBT for an external signer
Types
// Enumsimport{AddressType,WalletState,OutputScriptType,ChangeAddressType}from'react-native-nitro-lndltc'// Subscription handle (returned by subscribe methods)importtype{Subscription}from'react-native-nitro-lndltc'
Example app
See the example/ directory for a working app with daemon management, wallet creation, balance display, address generation, and live transaction streaming.