feat(finance): BTC basket flows, client scoping, and jewelry-box store

- Finance API: baskets, holdings, rebalances, deposits, bridge withdrawals, vault checks.
- Schemas: btc-basket; api-client finance types; workspace lockfile update.
- Vitest config for finance service; expanded tests.

Made-with: Cursor
This commit is contained in:
defiQUG
2026-04-07 22:59:32 -07:00
parent 923b703d97
commit 3f7cc0f854
18 changed files with 1825 additions and 494 deletions

View File

@@ -4,7 +4,6 @@
*/
import { query } from './client';
import { listDocuments, getDocumentById } from './schema';
export interface DocumentSearchResult {
documents: Array<{
@@ -102,8 +101,8 @@ export async function searchDocuments(
/**
* Get search suggestions
*/
export async function getSearchSuggestions(query: string, limit = 10): Promise<string[]> {
if (!query || query.length < 2) {
export async function getSearchSuggestions(searchTerm: string, limit = 10): Promise<string[]> {
if (!searchTerm || searchTerm.length < 2) {
return [];
}
@@ -113,9 +112,8 @@ export async function getSearchSuggestions(query: string, limit = 10): Promise<s
WHERE title ILIKE $1
ORDER BY title
LIMIT $2`,
[`%${query}%`, limit]
[`%${searchTerm}%`, limit]
);
return result.rows.map((row) => row.title);
}

View File

@@ -320,9 +320,11 @@ export function extractTemplateVariables(template_content: string): string[] {
const matches = template_content.matchAll(/\{\{(\w+(?:\.\w+)*)\}\}/g);
for (const match of matches) {
variables.add(match[1]);
const variableName = match[1];
if (variableName) {
variables.add(variableName);
}
}
return Array.from(variables).sort();
}