@routstr/sdk 0.2.5 → 0.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,172 @@
1
+ import { StoreApi } from 'zustand/vanilla';
2
+ import { D as DiscoveryAdapter } from './interfaces-BWJJTCXO.mjs';
3
+ import { P as ProviderRegistry, S as StorageAdapter } from './interfaces-C5fLD3jB.mjs';
4
+ import { M as Model, P as ProviderInfo } from './types-BYj_8c5c.mjs';
5
+
6
+ interface UsageTrackingEntry {
7
+ id: string;
8
+ timestamp: number;
9
+ modelId: string;
10
+ baseUrl: string;
11
+ requestId: string;
12
+ cost: number;
13
+ satsCost: number;
14
+ promptTokens: number;
15
+ completionTokens: number;
16
+ totalTokens: number;
17
+ client?: string;
18
+ sessionId?: string;
19
+ tags?: string[];
20
+ }
21
+
22
+ interface ListUsageTrackingOptions {
23
+ limit?: number;
24
+ before?: number;
25
+ after?: number;
26
+ modelId?: string;
27
+ baseUrl?: string;
28
+ sessionId?: string;
29
+ client?: string;
30
+ }
31
+ interface UsageTrackingDriver {
32
+ migrate(): Promise<void>;
33
+ append(entry: UsageTrackingEntry): Promise<void>;
34
+ appendMany(entries: UsageTrackingEntry[]): Promise<void>;
35
+ list(options?: ListUsageTrackingOptions): Promise<UsageTrackingEntry[]>;
36
+ count(options?: Omit<ListUsageTrackingOptions, "limit">): Promise<number>;
37
+ deleteOlderThan(timestamp: number): Promise<number>;
38
+ clear(): Promise<void>;
39
+ }
40
+
41
+ interface StorageDriver {
42
+ getItem<T>(key: string, defaultValue: T): Promise<T>;
43
+ setItem<T>(key: string, value: T): Promise<void>;
44
+ removeItem(key: string): Promise<void>;
45
+ }
46
+ interface SdkStorageState {
47
+ modelsFromAllProviders: Record<string, Model[]>;
48
+ lastUsedModel: string | null;
49
+ baseUrlsList: string[];
50
+ disabledProviders: string[];
51
+ mintsFromAllProviders: Record<string, string[]>;
52
+ infoFromAllProviders: Record<string, ProviderInfo>;
53
+ lastModelsUpdate: Record<string, number>;
54
+ lastBaseUrlsUpdate: number | null;
55
+ apiKeys: Array<{
56
+ baseUrl: string;
57
+ key: string;
58
+ balance: number;
59
+ lastUsed: number | null;
60
+ }>;
61
+ childKeys: Array<{
62
+ parentBaseUrl: string;
63
+ childKey: string;
64
+ balance: number;
65
+ balanceLimit?: number;
66
+ validityDate?: number;
67
+ createdAt: number;
68
+ }>;
69
+ xcashuTokens: Record<string, Array<{
70
+ baseUrl: string;
71
+ token: string;
72
+ createdAt: number;
73
+ tryCount: number;
74
+ }>>;
75
+ routstr21Models: string[];
76
+ lastRoutstr21ModelsUpdate: number | null;
77
+ cachedReceiveTokens: Array<{
78
+ token: string;
79
+ amount: number;
80
+ unit: "sat" | "msat";
81
+ createdAt: number;
82
+ }>;
83
+ clientIds: Array<{
84
+ clientId: string;
85
+ name: string;
86
+ apiKey: string;
87
+ createdAt: number;
88
+ lastUsed?: number | null;
89
+ }>;
90
+ /** Set of failed provider URLs */
91
+ failedProviders: string[];
92
+ /** Map of provider URL -> timestamp of last failure */
93
+ lastFailed: Record<string, number>;
94
+ /** Providers currently on cooldown: [baseUrl, timestamp][] */
95
+ providersOnCooldown: Array<{
96
+ baseUrl: string;
97
+ timestamp: number;
98
+ }>;
99
+ }
100
+
101
+ interface SdkStoreOptions {
102
+ driver: StorageDriver;
103
+ }
104
+ interface SdkStorageStore extends SdkStorageState {
105
+ setModelsFromAllProviders: (value: Record<string, Model[]>) => void;
106
+ setLastUsedModel: (value: string | null) => void;
107
+ setBaseUrlsList: (value: string[]) => void;
108
+ setBaseUrlsLastUpdate: (value: number | null) => void;
109
+ setDisabledProviders: (value: string[]) => void;
110
+ setMintsFromAllProviders: (value: Record<string, string[]>) => void;
111
+ setInfoFromAllProviders: (value: Record<string, ProviderInfo>) => void;
112
+ setLastModelsUpdate: (value: Record<string, number>) => void;
113
+ setApiKeys: (value: Array<{
114
+ baseUrl: string;
115
+ key: string;
116
+ balance?: number;
117
+ lastUsed?: number | null;
118
+ }> | ((current: SdkStorageStore["apiKeys"]) => SdkStorageStore["apiKeys"])) => void;
119
+ setChildKeys: (value: Array<{
120
+ parentBaseUrl: string;
121
+ childKey: string;
122
+ balance?: number;
123
+ balanceLimit?: number;
124
+ validityDate?: number;
125
+ createdAt?: number;
126
+ }>) => void;
127
+ setXcashuTokens: (value: Record<string, Array<{
128
+ baseUrl: string;
129
+ token: string;
130
+ createdAt?: number;
131
+ tryCount?: number;
132
+ }>>) => void;
133
+ updateXcashuTokenTryCount: (token: string, tryCount: number) => void;
134
+ setRoutstr21Models: (value: string[]) => void;
135
+ setRoutstr21ModelsLastUpdate: (value: number | null) => void;
136
+ setCachedReceiveTokens: (value: Array<{
137
+ token: string;
138
+ amount: number;
139
+ unit: "sat" | "msat";
140
+ createdAt?: number;
141
+ }>) => void;
142
+ setClientIds: (value: Array<{
143
+ clientId: string;
144
+ name: string;
145
+ apiKey: string;
146
+ createdAt?: number;
147
+ lastUsed?: number | null;
148
+ }> | ((current: SdkStorageStore["clientIds"]) => SdkStorageStore["clientIds"])) => void;
149
+ setFailedProviders: (value: string[]) => void;
150
+ addFailedProvider: (baseUrl: string) => void;
151
+ removeFailedProvider: (baseUrl: string) => void;
152
+ setLastFailed: (value: Record<string, number>) => void;
153
+ setLastFailedTimestamp: (baseUrl: string, timestamp: number) => void;
154
+ setProvidersOnCooldown: (value: Array<{
155
+ baseUrl: string;
156
+ timestamp: number;
157
+ }>) => void;
158
+ addProviderOnCooldown: (baseUrl: string, timestamp: number) => void;
159
+ removeProviderFromCooldown: (baseUrl: string) => void;
160
+ clearProvidersOnCooldown: () => void;
161
+ }
162
+ /** Store type returned after async initialization */
163
+ type SdkStore = StoreApi<SdkStorageStore>;
164
+ declare const createSdkStore: ({ driver, }: SdkStoreOptions) => {
165
+ store: SdkStore;
166
+ hydrate: Promise<void>;
167
+ };
168
+ declare const createDiscoveryAdapterFromStore: (store: SdkStore) => DiscoveryAdapter;
169
+ declare const createStorageAdapterFromStore: (store: SdkStore) => StorageAdapter;
170
+ declare const createProviderRegistryFromStore: (store: SdkStore) => ProviderRegistry;
171
+
172
+ export { type ListUsageTrackingOptions as L, type SdkStore as S, type UsageTrackingDriver as U, type StorageDriver as a, type UsageTrackingEntry as b, createDiscoveryAdapterFromStore as c, createProviderRegistryFromStore as d, createSdkStore as e, createStorageAdapterFromStore as f };
@@ -0,0 +1,172 @@
1
+ import { StoreApi } from 'zustand/vanilla';
2
+ import { D as DiscoveryAdapter } from './interfaces-BxDEka72.js';
3
+ import { P as ProviderRegistry, S as StorageAdapter } from './interfaces-B62Rw-dd.js';
4
+ import { M as Model, P as ProviderInfo } from './types-BYj_8c5c.js';
5
+
6
+ interface UsageTrackingEntry {
7
+ id: string;
8
+ timestamp: number;
9
+ modelId: string;
10
+ baseUrl: string;
11
+ requestId: string;
12
+ cost: number;
13
+ satsCost: number;
14
+ promptTokens: number;
15
+ completionTokens: number;
16
+ totalTokens: number;
17
+ client?: string;
18
+ sessionId?: string;
19
+ tags?: string[];
20
+ }
21
+
22
+ interface ListUsageTrackingOptions {
23
+ limit?: number;
24
+ before?: number;
25
+ after?: number;
26
+ modelId?: string;
27
+ baseUrl?: string;
28
+ sessionId?: string;
29
+ client?: string;
30
+ }
31
+ interface UsageTrackingDriver {
32
+ migrate(): Promise<void>;
33
+ append(entry: UsageTrackingEntry): Promise<void>;
34
+ appendMany(entries: UsageTrackingEntry[]): Promise<void>;
35
+ list(options?: ListUsageTrackingOptions): Promise<UsageTrackingEntry[]>;
36
+ count(options?: Omit<ListUsageTrackingOptions, "limit">): Promise<number>;
37
+ deleteOlderThan(timestamp: number): Promise<number>;
38
+ clear(): Promise<void>;
39
+ }
40
+
41
+ interface StorageDriver {
42
+ getItem<T>(key: string, defaultValue: T): Promise<T>;
43
+ setItem<T>(key: string, value: T): Promise<void>;
44
+ removeItem(key: string): Promise<void>;
45
+ }
46
+ interface SdkStorageState {
47
+ modelsFromAllProviders: Record<string, Model[]>;
48
+ lastUsedModel: string | null;
49
+ baseUrlsList: string[];
50
+ disabledProviders: string[];
51
+ mintsFromAllProviders: Record<string, string[]>;
52
+ infoFromAllProviders: Record<string, ProviderInfo>;
53
+ lastModelsUpdate: Record<string, number>;
54
+ lastBaseUrlsUpdate: number | null;
55
+ apiKeys: Array<{
56
+ baseUrl: string;
57
+ key: string;
58
+ balance: number;
59
+ lastUsed: number | null;
60
+ }>;
61
+ childKeys: Array<{
62
+ parentBaseUrl: string;
63
+ childKey: string;
64
+ balance: number;
65
+ balanceLimit?: number;
66
+ validityDate?: number;
67
+ createdAt: number;
68
+ }>;
69
+ xcashuTokens: Record<string, Array<{
70
+ baseUrl: string;
71
+ token: string;
72
+ createdAt: number;
73
+ tryCount: number;
74
+ }>>;
75
+ routstr21Models: string[];
76
+ lastRoutstr21ModelsUpdate: number | null;
77
+ cachedReceiveTokens: Array<{
78
+ token: string;
79
+ amount: number;
80
+ unit: "sat" | "msat";
81
+ createdAt: number;
82
+ }>;
83
+ clientIds: Array<{
84
+ clientId: string;
85
+ name: string;
86
+ apiKey: string;
87
+ createdAt: number;
88
+ lastUsed?: number | null;
89
+ }>;
90
+ /** Set of failed provider URLs */
91
+ failedProviders: string[];
92
+ /** Map of provider URL -> timestamp of last failure */
93
+ lastFailed: Record<string, number>;
94
+ /** Providers currently on cooldown: [baseUrl, timestamp][] */
95
+ providersOnCooldown: Array<{
96
+ baseUrl: string;
97
+ timestamp: number;
98
+ }>;
99
+ }
100
+
101
+ interface SdkStoreOptions {
102
+ driver: StorageDriver;
103
+ }
104
+ interface SdkStorageStore extends SdkStorageState {
105
+ setModelsFromAllProviders: (value: Record<string, Model[]>) => void;
106
+ setLastUsedModel: (value: string | null) => void;
107
+ setBaseUrlsList: (value: string[]) => void;
108
+ setBaseUrlsLastUpdate: (value: number | null) => void;
109
+ setDisabledProviders: (value: string[]) => void;
110
+ setMintsFromAllProviders: (value: Record<string, string[]>) => void;
111
+ setInfoFromAllProviders: (value: Record<string, ProviderInfo>) => void;
112
+ setLastModelsUpdate: (value: Record<string, number>) => void;
113
+ setApiKeys: (value: Array<{
114
+ baseUrl: string;
115
+ key: string;
116
+ balance?: number;
117
+ lastUsed?: number | null;
118
+ }> | ((current: SdkStorageStore["apiKeys"]) => SdkStorageStore["apiKeys"])) => void;
119
+ setChildKeys: (value: Array<{
120
+ parentBaseUrl: string;
121
+ childKey: string;
122
+ balance?: number;
123
+ balanceLimit?: number;
124
+ validityDate?: number;
125
+ createdAt?: number;
126
+ }>) => void;
127
+ setXcashuTokens: (value: Record<string, Array<{
128
+ baseUrl: string;
129
+ token: string;
130
+ createdAt?: number;
131
+ tryCount?: number;
132
+ }>>) => void;
133
+ updateXcashuTokenTryCount: (token: string, tryCount: number) => void;
134
+ setRoutstr21Models: (value: string[]) => void;
135
+ setRoutstr21ModelsLastUpdate: (value: number | null) => void;
136
+ setCachedReceiveTokens: (value: Array<{
137
+ token: string;
138
+ amount: number;
139
+ unit: "sat" | "msat";
140
+ createdAt?: number;
141
+ }>) => void;
142
+ setClientIds: (value: Array<{
143
+ clientId: string;
144
+ name: string;
145
+ apiKey: string;
146
+ createdAt?: number;
147
+ lastUsed?: number | null;
148
+ }> | ((current: SdkStorageStore["clientIds"]) => SdkStorageStore["clientIds"])) => void;
149
+ setFailedProviders: (value: string[]) => void;
150
+ addFailedProvider: (baseUrl: string) => void;
151
+ removeFailedProvider: (baseUrl: string) => void;
152
+ setLastFailed: (value: Record<string, number>) => void;
153
+ setLastFailedTimestamp: (baseUrl: string, timestamp: number) => void;
154
+ setProvidersOnCooldown: (value: Array<{
155
+ baseUrl: string;
156
+ timestamp: number;
157
+ }>) => void;
158
+ addProviderOnCooldown: (baseUrl: string, timestamp: number) => void;
159
+ removeProviderFromCooldown: (baseUrl: string) => void;
160
+ clearProvidersOnCooldown: () => void;
161
+ }
162
+ /** Store type returned after async initialization */
163
+ type SdkStore = StoreApi<SdkStorageStore>;
164
+ declare const createSdkStore: ({ driver, }: SdkStoreOptions) => {
165
+ store: SdkStore;
166
+ hydrate: Promise<void>;
167
+ };
168
+ declare const createDiscoveryAdapterFromStore: (store: SdkStore) => DiscoveryAdapter;
169
+ declare const createStorageAdapterFromStore: (store: SdkStore) => StorageAdapter;
170
+ declare const createProviderRegistryFromStore: (store: SdkStore) => ProviderRegistry;
171
+
172
+ export { type ListUsageTrackingOptions as L, type SdkStore as S, type UsageTrackingDriver as U, type StorageDriver as a, type UsageTrackingEntry as b, createDiscoveryAdapterFromStore as c, createProviderRegistryFromStore as d, createSdkStore as e, createStorageAdapterFromStore as f };
@@ -1,5 +1,5 @@
1
- import { W as WalletAdapter, S as StorageAdapter, P as ProviderRegistry } from '../interfaces-C6Dr6hKy.mjs';
2
- export { A as ApiKeyEntry, C as ChildKeyEntry, R as RoutstrClientOptions, a as StreamingCallbacks } from '../interfaces-C6Dr6hKy.mjs';
1
+ import { W as WalletAdapter, S as StorageAdapter, P as ProviderRegistry } from '../interfaces-C5fLD3jB.mjs';
2
+ export { A as ApiKeyEntry, C as ChildKeyEntry, R as RoutstrClientOptions, a as StreamingCallbacks, X as XCashuTokenEntry } from '../interfaces-C5fLD3jB.mjs';
3
3
  import { R as RefundResult, m as TopUpResult, S as SpendResult } from '../types-BYj_8c5c.mjs';
4
4
  export { P as ProviderInfo } from '../types-BYj_8c5c.mjs';
5
5
 
@@ -15,17 +15,6 @@ export { P as ProviderInfo } from '../types-BYj_8c5c.mjs';
15
15
  * Extracted from utils/cashuUtils.ts
16
16
  */
17
17
 
18
- /**
19
- * Options for refunding tokens
20
- */
21
- interface RefundOptions {
22
- /** The mint URL (for NIP-60 wallet operations) */
23
- mintUrl: string;
24
- /** The provider base URL */
25
- baseUrl: string;
26
- /** Optional specific token to refund (if not provided, uses stored token) */
27
- token?: string;
28
- }
29
18
  /**
30
19
  * Options for refunding API key balance
31
20
  */
@@ -82,10 +71,6 @@ declare class BalanceManager {
82
71
  private cashuSpender;
83
72
  constructor(walletAdapter: WalletAdapter, storageAdapter: StorageAdapter, providerRegistry?: ProviderRegistry | undefined, cashuSpender?: CashuSpender);
84
73
  getBalanceState(): Promise<BalanceState>;
85
- /**
86
- * Unified refund - handles both NIP-60 and legacy wallet refunds
87
- */
88
- refund(options: RefundOptions): Promise<RefundResult>;
89
74
  /**
90
75
  * Refund API key balance - convert remaining API key balance to cashu token
91
76
  * @param options - Refund options including forceRefund flag
@@ -93,9 +78,14 @@ declare class BalanceManager {
93
78
  */
94
79
  refundApiKey(options: RefundApiKeyOptions): Promise<RefundResult>;
95
80
  /**
96
- * Fetch refund token from provider API using API key authentication
81
+ * Fetch refund token from provider API using API key (or xcashu token) authentication
97
82
  */
98
- private _fetchRefundTokenWithApiKey;
83
+ fetchRefundToken(baseUrl: string, apiKeyOrToken: string, xCashu?: boolean): Promise<{
84
+ success: boolean;
85
+ token?: string;
86
+ requestId?: string;
87
+ error?: string;
88
+ }>;
99
89
  /**
100
90
  * Top up API key balance with a cashu token
101
91
  */
@@ -103,10 +93,6 @@ declare class BalanceManager {
103
93
  createProviderToken(options: CreateProviderTokenOptions): Promise<ProviderTokenResult>;
104
94
  private _selectCandidateMints;
105
95
  private _refundOtherProvidersForTopUp;
106
- /**
107
- * Fetch refund token from provider API
108
- */
109
- private _fetchRefundToken;
110
96
  /**
111
97
  * Post topup request to provider API
112
98
  */
@@ -209,13 +195,27 @@ declare class CashuSpender {
209
195
  */
210
196
  private _spendInternal;
211
197
  /**
212
- * Try to reuse an existing token
198
+ * Try to reuse an existing API key
213
199
  */
214
200
  private _tryReuseToken;
201
+ /**
202
+ * Refund all xcashu tokens from storage by calling the provider's refund endpoint.
203
+ * The xcashu token acts as an API key to claim the refund, and the response contains
204
+ * the actual refunded Cashu token which is then received into the wallet.
205
+ * @param mintUrl - The mint URL for receiving tokens
206
+ * @param excludeBaseUrls - Base URLs to exclude from refund (optional)
207
+ * @returns Results for each xcashu token refund attempt
208
+ */
209
+ refundXcashuTokens(mintUrl: string, excludeBaseUrls?: string[]): Promise<{
210
+ baseUrl: string;
211
+ token: string;
212
+ success: boolean;
213
+ error?: string;
214
+ }[]>;
215
215
  /**
216
216
  * Refund specific providers without retrying spend
217
217
  */
218
- refundProviders(baseUrls: string[], mintUrl: string, refundApiKeys?: boolean, forceRefund?: boolean): Promise<{
218
+ refundProviders(mintUrl: string, forceRefund?: boolean): Promise<{
219
219
  baseUrl: string;
220
220
  success: boolean;
221
221
  }[]>;
@@ -226,4 +226,4 @@ declare class CashuSpender {
226
226
  private _getProviderTokenBalance;
227
227
  }
228
228
 
229
- export { BalanceManager, type BalanceState, CashuSpender, type CreateProviderTokenOptions, ProviderRegistry, type ProviderTokenResult, type RefundApiKeyOptions, type RefundOptions, type SpendOptions, StorageAdapter, type TopUpOptions, WalletAdapter };
229
+ export { BalanceManager, type BalanceState, CashuSpender, type CreateProviderTokenOptions, ProviderRegistry, type ProviderTokenResult, type RefundApiKeyOptions, type SpendOptions, StorageAdapter, type TopUpOptions, WalletAdapter };
@@ -1,5 +1,5 @@
1
- import { W as WalletAdapter, S as StorageAdapter, P as ProviderRegistry } from '../interfaces-CluftN4z.js';
2
- export { A as ApiKeyEntry, C as ChildKeyEntry, R as RoutstrClientOptions, a as StreamingCallbacks } from '../interfaces-CluftN4z.js';
1
+ import { W as WalletAdapter, S as StorageAdapter, P as ProviderRegistry } from '../interfaces-B62Rw-dd.js';
2
+ export { A as ApiKeyEntry, C as ChildKeyEntry, R as RoutstrClientOptions, a as StreamingCallbacks, X as XCashuTokenEntry } from '../interfaces-B62Rw-dd.js';
3
3
  import { R as RefundResult, m as TopUpResult, S as SpendResult } from '../types-BYj_8c5c.js';
4
4
  export { P as ProviderInfo } from '../types-BYj_8c5c.js';
5
5
 
@@ -15,17 +15,6 @@ export { P as ProviderInfo } from '../types-BYj_8c5c.js';
15
15
  * Extracted from utils/cashuUtils.ts
16
16
  */
17
17
 
18
- /**
19
- * Options for refunding tokens
20
- */
21
- interface RefundOptions {
22
- /** The mint URL (for NIP-60 wallet operations) */
23
- mintUrl: string;
24
- /** The provider base URL */
25
- baseUrl: string;
26
- /** Optional specific token to refund (if not provided, uses stored token) */
27
- token?: string;
28
- }
29
18
  /**
30
19
  * Options for refunding API key balance
31
20
  */
@@ -82,10 +71,6 @@ declare class BalanceManager {
82
71
  private cashuSpender;
83
72
  constructor(walletAdapter: WalletAdapter, storageAdapter: StorageAdapter, providerRegistry?: ProviderRegistry | undefined, cashuSpender?: CashuSpender);
84
73
  getBalanceState(): Promise<BalanceState>;
85
- /**
86
- * Unified refund - handles both NIP-60 and legacy wallet refunds
87
- */
88
- refund(options: RefundOptions): Promise<RefundResult>;
89
74
  /**
90
75
  * Refund API key balance - convert remaining API key balance to cashu token
91
76
  * @param options - Refund options including forceRefund flag
@@ -93,9 +78,14 @@ declare class BalanceManager {
93
78
  */
94
79
  refundApiKey(options: RefundApiKeyOptions): Promise<RefundResult>;
95
80
  /**
96
- * Fetch refund token from provider API using API key authentication
81
+ * Fetch refund token from provider API using API key (or xcashu token) authentication
97
82
  */
98
- private _fetchRefundTokenWithApiKey;
83
+ fetchRefundToken(baseUrl: string, apiKeyOrToken: string, xCashu?: boolean): Promise<{
84
+ success: boolean;
85
+ token?: string;
86
+ requestId?: string;
87
+ error?: string;
88
+ }>;
99
89
  /**
100
90
  * Top up API key balance with a cashu token
101
91
  */
@@ -103,10 +93,6 @@ declare class BalanceManager {
103
93
  createProviderToken(options: CreateProviderTokenOptions): Promise<ProviderTokenResult>;
104
94
  private _selectCandidateMints;
105
95
  private _refundOtherProvidersForTopUp;
106
- /**
107
- * Fetch refund token from provider API
108
- */
109
- private _fetchRefundToken;
110
96
  /**
111
97
  * Post topup request to provider API
112
98
  */
@@ -209,13 +195,27 @@ declare class CashuSpender {
209
195
  */
210
196
  private _spendInternal;
211
197
  /**
212
- * Try to reuse an existing token
198
+ * Try to reuse an existing API key
213
199
  */
214
200
  private _tryReuseToken;
201
+ /**
202
+ * Refund all xcashu tokens from storage by calling the provider's refund endpoint.
203
+ * The xcashu token acts as an API key to claim the refund, and the response contains
204
+ * the actual refunded Cashu token which is then received into the wallet.
205
+ * @param mintUrl - The mint URL for receiving tokens
206
+ * @param excludeBaseUrls - Base URLs to exclude from refund (optional)
207
+ * @returns Results for each xcashu token refund attempt
208
+ */
209
+ refundXcashuTokens(mintUrl: string, excludeBaseUrls?: string[]): Promise<{
210
+ baseUrl: string;
211
+ token: string;
212
+ success: boolean;
213
+ error?: string;
214
+ }[]>;
215
215
  /**
216
216
  * Refund specific providers without retrying spend
217
217
  */
218
- refundProviders(baseUrls: string[], mintUrl: string, refundApiKeys?: boolean, forceRefund?: boolean): Promise<{
218
+ refundProviders(mintUrl: string, forceRefund?: boolean): Promise<{
219
219
  baseUrl: string;
220
220
  success: boolean;
221
221
  }[]>;
@@ -226,4 +226,4 @@ declare class CashuSpender {
226
226
  private _getProviderTokenBalance;
227
227
  }
228
228
 
229
- export { BalanceManager, type BalanceState, CashuSpender, type CreateProviderTokenOptions, ProviderRegistry, type ProviderTokenResult, type RefundApiKeyOptions, type RefundOptions, type SpendOptions, StorageAdapter, type TopUpOptions, WalletAdapter };
229
+ export { BalanceManager, type BalanceState, CashuSpender, type CreateProviderTokenOptions, ProviderRegistry, type ProviderTokenResult, type RefundApiKeyOptions, type SpendOptions, StorageAdapter, type TopUpOptions, WalletAdapter };