Skip to content

Commit bf20213

Browse files
npm run doc
1 parent 8d76831 commit bf20213

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

docs/reference/kvstore.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ export interface KVStoreConfig {
5050
wallet?: WalletInterface;
5151
networkPreset?: "mainnet" | "testnet" | "local";
5252
acceptDelayedBroadcast?: boolean;
53+
overlayBroadcast?: boolean;
5354
tokenSetDescription?: string;
5455
tokenUpdateDescription?: string;
5556
tokenRemovalDescription?: string;
@@ -82,6 +83,14 @@ Originator
8283
originator?: string
8384
```
8485

86+
#### Property overlayBroadcast
87+
88+
Whether to let overlay handle broadcasting (prevents UTXO spending on rejection)
89+
90+
```ts
91+
overlayBroadcast?: boolean
92+
```
93+
8594
#### Property overlayHost
8695

8796
The overlay service host URL

docs/reference/overlay-tools.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,38 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
564564
---
565565
## Functions
566566

567+
### Function: withDoubleSpendRetry
568+
569+
Executes an operation with automatic retry logic for double-spend errors.
570+
When a double-spend is detected, broadcasts the competing transaction to
571+
update the overlay with missing state, then retries the operation.
572+
573+
```ts
574+
export async function withDoubleSpendRetry<T>(operation: () => Promise<T>, broadcaster: TopicBroadcaster, maxRetries: number = MAX_DOUBLE_SPEND_RETRIES): Promise<T>
575+
```
576+
577+
See also: [TopicBroadcaster](./overlay-tools.md#class-topicbroadcaster)
578+
579+
Returns
580+
581+
The result of the successful operation
582+
583+
Argument Details
584+
585+
+ **operation**
586+
+ The async operation to execute (e.g., createAction + signAction)
587+
+ **broadcaster**
588+
+ The TopicBroadcaster to use for syncing missing state
589+
+ **maxRetries**
590+
+ Maximum number of retry attempts (default: MAX_DOUBLE_SPEND_RETRIES)
591+
592+
Throws
593+
594+
If max retries exceeded or non-double-spend error occurs
595+
596+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
597+
598+
---
567599
## Types
568600

569601
| |

0 commit comments

Comments
 (0)