forked from CredenceOrg/Credence-Frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbondMutations.ts
More file actions
23 lines (21 loc) · 842 Bytes
/
Copy pathbondMutations.ts
File metadata and controls
23 lines (21 loc) · 842 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/**
* Bond mutation boundary.
*
* The real product implementation will submit signed Stellar transactions and
* return the authoritative hash. For now, the demo pages use deterministic
* local hashes so we can:
* - persist and recover mutation state across reloads
* - test retry/duplicate protection deterministically with fake timers
*/
export async function submitCreateBond(_params: { amountUsdc: number }): Promise<{ hash: string }> {
// Simulated async wallet/network path.
await new Promise((resolve) => setTimeout(resolve, 50))
return { hash: `local-bond-create-${Date.now()}` }
}
export async function submitWithdrawBond(_params: {
bondId: number
amountUsdc: number
}): Promise<{ hash: string }> {
await new Promise((resolve) => setTimeout(resolve, 50))
return { hash: `local-bond-withdraw-${Date.now()}` }
}