Skip to content

Commit

Permalink
Add lightMode option to makeCurrencyEngine
Browse files Browse the repository at this point in the history
The memory wallet is temporary that just needs to get balances and spend. An engine recognizing lightMode can reduce unnecessary operations like transaction history
  • Loading branch information
peachbits committed Jul 22, 2024
1 parent 23e99f4 commit 2768186
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/core/account/memory-wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ export const makeMemoryWalletInner = async (
},
customTokens: { ...config.customTokens },
enabledTokenIds: [...Object.keys(config.allTokens)],
lightMode: true,
log,
userSettings: { ...(config.userSettings ?? {}) },
walletLocalDisklet: makeMemoryDisklet(),
Expand Down
3 changes: 3 additions & 0 deletions src/types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -894,6 +894,9 @@ export interface EdgeCurrencyEngineCallbacks {
export interface EdgeCurrencyEngineOptions {
callbacks: EdgeCurrencyEngineCallbacks

/** True if we only need a balance and the ability to spend it. */
lightMode?: boolean

// Wallet-scoped IO objects:
log: EdgeLog
walletLocalDisklet: Disklet
Expand Down

0 comments on commit 2768186

Please sign in to comment.