DbObjectBox class
Inheritance
Object
WalletsRepo
DbObjectBox
Constructors
DbObjectBox ({bool attach = false , String ? directory })
crates objectbox db instace
attach to attach to already open instance (e.g. for isolates)
directory optional custom directory for the database (useful for testing)
Properties
dbRdy
→ Future
no setter
hashCode
→ int
The hash code for this object.
no setter inherited
runtimeType
→ Type
A representation of the runtime type of the object.
no setter inherited
Methods
clearAll ()
→ Future <void >
Clears all cached data.
override
close ()
→ Future <void >
closes the cache manger
used to close the db
override
getCashuSecretCounter ({required String mintUrl , required String keysetId })
→ Future <int >
override
getDefaultWalletIdForReceiving ()
→ String ?
Get default wallet for sending funds (e.g. for paying invoices)
override
getDefaultWalletIdForSending ()
→ String ?
Get default wallet for receiving funds (e.g. for generating invoices)
override
getKeysets ({String ? mintUrl })
→ Future <List <CahsuKeyset > >
get all keysets if no mintUrl is provided \
override
getMintInfos ({List <String > ? mintUrls })
→ Future <List <CashuMintInfo > ? >
return all if no mintUrls are provided
override
getProofs ({String ? mintUrl , String ? keysetId , CashuProofState state = CashuProofState.unspend })
→ Future <List <CashuProof > >
override
getTransactions ({int ? limit , int ? offset , String ? walletId , String ? unit , WalletType? walletType })
→ Future <List <WalletTransaction > >
Get transactions with optional filtering
override
getWallet (String id )
→ Future <Wallet >
Get a specific wallet by ID
inherited
getWallets ({List <String > ? ids })
→ Future <List <Wallet > >
Get wallets by id
return all if ids is null
override
loadContactList (String pubKey )
→ Future <ContactList? >
override
loadEvent (String id )
→ Future <Nip01Event? >
override
loadEvents ({List <String > ? ids , List <String > ? pubKeys , List <int > ? kinds , Map <String , List <String > > ? tags , int ? since , int ? until , String ? search , int ? limit })
→ Future <List <Nip01Event > >
Load events from cache with flexible filtering
ids - list of event ids
pubKeys - list of authors pubKeys
kinds - list of kinds
tags - map of tags (e.g. {'p': 'pubkey1', 'e': 'eventid1'})
since - timestamp
until - timestamp
search - search string to match against content
limit - limit of results
returns list of events
override
loadFilterFetchedRangeRecords (String filterHash )
→ Future <List <FilterFetchedRangeRecord > >
Load all fetched range records for a filter hash
override
loadFilterFetchedRangeRecordsByRelay (String filterHash , String relayUrl )
→ Future <List <FilterFetchedRangeRecord > >
Load all fetched range records for a filter hash and relay
override
loadFilterFetchedRangeRecordsByRelayUrl (String relayUrl )
→ Future <List <FilterFetchedRangeRecord > >
Load all fetched range records for a relay (all filters)
override
loadMetadata (String pubKey )
→ Future <Metadata? >
override
loadMetadatas (List <String > pubKeys )
→ Future <List <Metadata? > >
override
loadNip05 ({String ? pubKey , String ? identifier })
→ Future <Nip05? >
override
loadNip05s (List <String > pubKeys )
→ Future <List <Nip05? > >
override
loadRelaySet (String name , String pubKey )
→ Future <RelaySet? >
override
loadUserRelayList (String pubKey )
→ Future <UserRelayList? >
override
noSuchMethod (Invocation invocation )
→ dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeAllContactLists ()
→ Future <void >
override
removeAllEvents ()
→ Future <void >
override
removeAllEventsByPubKey (String pubKey )
→ Future <void >
override
removeAllFilterFetchedRangeRecords ()
→ Future <void >
Remove all filter fetched range records
override
removeAllMetadatas ()
→ Future <void >
override
removeAllNip05s ()
→ Future <void >
override
removeAllRelaySets ()
→ Future <void >
override
removeAllUserRelayLists ()
→ Future <void >
override
removeContactList (String pubKey )
→ Future <void >
override
removeEvent (String id )
→ Future <void >
override
removeEvents ({List <String > ? ids , List <String > ? pubKeys , List <int > ? kinds , Map <String , List <String > > ? tags , int ? since , int ? until })
→ Future <void >
Remove events from cache with flexible filtering
ids - list of event ids
pubKeys - list of authors pubKeys
kinds - list of kinds
tags - map of tags (e.g. {'p': 'pubkey1', 'e': 'eventid1'})
since - timestamp
until - timestamp
If all parameters are empty, returns early (doesn't delete everything)
override
removeFilterFetchedRangeRecords (String filterHash )
→ Future <void >
Remove all fetched range records for a filter hash
override
removeFilterFetchedRangeRecordsByFilterAndRelay (String filterHash , String relayUrl )
→ Future <void >
Remove fetched range records for a specific filter hash and relay
override
removeFilterFetchedRangeRecordsByRelay (String relayUrl )
→ Future <void >
Remove all fetched range records for a relay
override
removeMetadata (String pubKey )
→ Future <void >
override
removeMintInfo ({required String mintUrl })
→ Future <void >
override
removeNip05 (String pubKey )
→ Future <void >
override
removeProofs ({required List <CashuProof > proofs , required String mintUrl })
→ Future <void >
override
removeRelaySet (String name , String pubKey )
→ Future <void >
override
removeUserRelayList (String pubKey )
→ Future <void >
override
removeWallet (String walletId )
→ Future <void >
Remove a wallet by ID
override
saveContactList (ContactList contactList )
→ Future <void >
override
saveContactLists (List <ContactList > contactLists )
→ Future <void >
override
saveEvent (Nip01Event event )
→ Future <void >
override
saveEvents (List <Nip01Event > events )
→ Future <void >
override
saveFilterFetchedRangeRecord (FilterFetchedRangeRecord record )
→ Future <void >
Save a filter fetched range record
override
saveFilterFetchedRangeRecords (List <FilterFetchedRangeRecord > records )
→ Future <void >
Save multiple filter fetched range records
override
saveKeyset (CahsuKeyset keyset )
→ Future <void >
cashu methods
override
saveMetadata (Metadata metadata )
→ Future <void >
override
saveMetadatas (List <Metadata > metadatas )
→ Future <void >
override
saveMintInfo ({required CashuMintInfo mintInfo })
→ Future <void >
override
saveNip05 (Nip05 nip05 )
→ Future <void >
override
saveNip05s (List <Nip05 > nip05s )
→ Future <void >
override
saveProofs ({required List <CashuProof > proofs , required String mintUrl })
→ Future <void >
override
saveRelaySet (RelaySet relaySet )
→ Future <void >
override
saveTransactions (List <WalletTransaction > transactions )
→ Future <void >
Save transactions to storage
override
saveUserRelayList (UserRelayList userRelayList )
→ Future <void >
override
saveUserRelayLists (List <UserRelayList > userRelayLists )
→ Future <void >
override
searchEvents ({List <String > ? ids , List <String > ? authors , List <int > ? kinds , Map <String , List <String > > ? tags , int ? since , int ? until , String ? search , int limit = 100 })
→ Future <Iterable <Nip01Event > >
search events
ids - list of event ids
authors - list of authors pubKeys
kinds - list of kinds
tags - map of tags
since - timestamp
until - timestamp
search - search string to match against content
limit - limit of results
returns list of events
override
searchMetadatas (String search , int limit )
→ Future <Iterable <Metadata > >
Search by name, nip05
override
setCashuSecretCounter ({required String mintUrl , required String keysetId , required int counter })
→ Future <void >
override
setDefaultWalletForReceiving (String ? walletId )
→ void
Set default wallet for receiving funds (e.g. for generating invoices)
override
setDefaultWalletForSending (String ? walletId )
→ void
Set default wallet for sending funds (e.g. for paying invoices)
override
storeWallet (Wallet wallet )
→ Future <void >
Store a wallet
override
toString ()
→ String
A string representation of this object.
inherited