Skip to content

Commit 9bdece6

Browse files
committed
feat: Disable search history by amount
1 parent e1064d4 commit 9bdece6

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

packages/neuron-wallet/src/services/tx/transaction-service.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export class TransactionsService {
6969
return base
7070
}
7171
if (type === SearchType.Address) {
72-
const lockHashes: string[] = await new LockUtils(await LockUtils.systemScript()).addressToAllLockHashes(value)
72+
const lockHashes = new LockUtils(await LockUtils.systemScript()).addressToAllLockHashes(value)
7373
return ['input.lockHash IN (:...lockHashes) OR output.lockHash IN (:...lockHashes)', { lockHashes }]
7474
}
7575
if (type === SearchType.TxHash) {
@@ -92,7 +92,15 @@ export class TransactionsService {
9292
return base
9393
}
9494

95-
public static searchByAmount = async (params: TransactionsByLockHashesParam, amount: string) => {
95+
/// TODO: Decide if this should be supported.
96+
/// For now just return empty results.
97+
/// The second query (one after `if (result.totalCount > 100) {` will mostly cuase `SQLITE_ERROR: too many SQL variables` error.
98+
public static searchByAmount = async (_params: TransactionsByLockHashesParam, _amount: string) => {
99+
return {
100+
totalCount: 0,
101+
items: []
102+
}
103+
/*
96104
// 1. get all transactions
97105
const result = await TransactionsService.getAll({
98106
pageNo: 1,
@@ -114,7 +122,7 @@ export class TransactionsService {
114122
return {
115123
totalCount: txs.length || 0,
116124
items: txs.slice(skip, skip + params.pageSize),
117-
}
125+
}*/
118126
}
119127

120128
public static getAll = async (

0 commit comments

Comments
 (0)