@remitmd/sdk 0.1.0

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.
Files changed (132) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +250 -0
  3. package/dist/a2a.d.ts +137 -0
  4. package/dist/a2a.d.ts.map +1 -0
  5. package/dist/a2a.js +121 -0
  6. package/dist/a2a.js.map +1 -0
  7. package/dist/client.d.ts +41 -0
  8. package/dist/client.d.ts.map +1 -0
  9. package/dist/client.js +81 -0
  10. package/dist/client.js.map +1 -0
  11. package/dist/errors.d.ts +108 -0
  12. package/dist/errors.d.ts.map +1 -0
  13. package/dist/errors.js +218 -0
  14. package/dist/errors.js.map +1 -0
  15. package/dist/http.d.ts +23 -0
  16. package/dist/http.d.ts.map +1 -0
  17. package/dist/http.js +150 -0
  18. package/dist/http.js.map +1 -0
  19. package/dist/index.d.ts +18 -0
  20. package/dist/index.d.ts.map +1 -0
  21. package/dist/index.js +21 -0
  22. package/dist/index.js.map +1 -0
  23. package/dist/integrations/vercel-ai.d.ts +44 -0
  24. package/dist/integrations/vercel-ai.d.ts.map +1 -0
  25. package/dist/integrations/vercel-ai.js +175 -0
  26. package/dist/integrations/vercel-ai.js.map +1 -0
  27. package/dist/models/bounty.d.ts +22 -0
  28. package/dist/models/bounty.d.ts.map +1 -0
  29. package/dist/models/bounty.js +2 -0
  30. package/dist/models/bounty.js.map +1 -0
  31. package/dist/models/common.d.ts +78 -0
  32. package/dist/models/common.d.ts.map +1 -0
  33. package/dist/models/common.js +3 -0
  34. package/dist/models/common.js.map +1 -0
  35. package/dist/models/deposit.d.ts +13 -0
  36. package/dist/models/deposit.d.ts.map +1 -0
  37. package/dist/models/deposit.js +2 -0
  38. package/dist/models/deposit.js.map +1 -0
  39. package/dist/models/escrow.d.ts +16 -0
  40. package/dist/models/escrow.d.ts.map +1 -0
  41. package/dist/models/escrow.js +2 -0
  42. package/dist/models/escrow.js.map +1 -0
  43. package/dist/models/index.d.ts +9 -0
  44. package/dist/models/index.d.ts.map +1 -0
  45. package/dist/models/index.js +9 -0
  46. package/dist/models/index.js.map +1 -0
  47. package/dist/models/invoice.d.ts +30 -0
  48. package/dist/models/invoice.d.ts.map +1 -0
  49. package/dist/models/invoice.js +2 -0
  50. package/dist/models/invoice.js.map +1 -0
  51. package/dist/models/reputation.d.ts +7 -0
  52. package/dist/models/reputation.d.ts.map +1 -0
  53. package/dist/models/reputation.js +2 -0
  54. package/dist/models/reputation.js.map +1 -0
  55. package/dist/models/stream.d.ts +15 -0
  56. package/dist/models/stream.d.ts.map +1 -0
  57. package/dist/models/stream.js +2 -0
  58. package/dist/models/stream.js.map +1 -0
  59. package/dist/models/tab.d.ts +21 -0
  60. package/dist/models/tab.d.ts.map +1 -0
  61. package/dist/models/tab.js +2 -0
  62. package/dist/models/tab.js.map +1 -0
  63. package/dist/provider.d.ts +135 -0
  64. package/dist/provider.d.ts.map +1 -0
  65. package/dist/provider.js +218 -0
  66. package/dist/provider.js.map +1 -0
  67. package/dist/signer.d.ts +31 -0
  68. package/dist/signer.d.ts.map +1 -0
  69. package/dist/signer.js +35 -0
  70. package/dist/signer.js.map +1 -0
  71. package/dist/testing/local.d.ts +31 -0
  72. package/dist/testing/local.d.ts.map +1 -0
  73. package/dist/testing/local.js +100 -0
  74. package/dist/testing/local.js.map +1 -0
  75. package/dist/testing/mock.d.ts +95 -0
  76. package/dist/testing/mock.d.ts.map +1 -0
  77. package/dist/testing/mock.js +407 -0
  78. package/dist/testing/mock.js.map +1 -0
  79. package/dist/wallet.d.ts +162 -0
  80. package/dist/wallet.d.ts.map +1 -0
  81. package/dist/wallet.js +365 -0
  82. package/dist/wallet.js.map +1 -0
  83. package/dist/x402.d.ts +78 -0
  84. package/dist/x402.d.ts.map +1 -0
  85. package/dist/x402.js +151 -0
  86. package/dist/x402.js.map +1 -0
  87. package/eslint.config.js +27 -0
  88. package/package.json +39 -0
  89. package/src/a2a.ts +241 -0
  90. package/src/client.ts +104 -0
  91. package/src/errors.ts +261 -0
  92. package/src/http.ts +190 -0
  93. package/src/index.ts +94 -0
  94. package/src/integrations/vercel-ai.ts +213 -0
  95. package/src/models/bounty.ts +23 -0
  96. package/src/models/common.ts +106 -0
  97. package/src/models/deposit.ts +13 -0
  98. package/src/models/escrow.ts +16 -0
  99. package/src/models/index.ts +8 -0
  100. package/src/models/invoice.ts +32 -0
  101. package/src/models/reputation.ts +7 -0
  102. package/src/models/stream.ts +15 -0
  103. package/src/models/tab.ts +22 -0
  104. package/src/provider.ts +281 -0
  105. package/src/signer.ts +70 -0
  106. package/src/testing/local.ts +118 -0
  107. package/src/testing/mock.ts +507 -0
  108. package/src/wallet.ts +546 -0
  109. package/src/x402.ts +202 -0
  110. package/tests/acceptance/bounty.test.ts +82 -0
  111. package/tests/acceptance/deposit.test.ts +70 -0
  112. package/tests/acceptance/direct.test.ts +53 -0
  113. package/tests/acceptance/escrow.test.ts +67 -0
  114. package/tests/acceptance/setup.ts +113 -0
  115. package/tests/acceptance/stream.test.ts +98 -0
  116. package/tests/acceptance/tab.test.ts +108 -0
  117. package/tests/acceptance/x402.test.ts +140 -0
  118. package/tests/compliance/auth.ts +69 -0
  119. package/tests/compliance/escrows.ts +96 -0
  120. package/tests/compliance/helpers.ts +90 -0
  121. package/tests/compliance/payments.ts +69 -0
  122. package/tests/compliance/tabs.ts +52 -0
  123. package/tests/test_a2a.ts +151 -0
  124. package/tests/test_errors.ts +80 -0
  125. package/tests/test_golden_vectors.ts +162 -0
  126. package/tests/test_integrations.ts +115 -0
  127. package/tests/test_mock.ts +217 -0
  128. package/tests/test_permit.ts +216 -0
  129. package/tests/test_provider.ts +304 -0
  130. package/tests/test_wallet.ts +108 -0
  131. package/tests/test_x402.ts +302 -0
  132. package/tsconfig.json +19 -0
@@ -0,0 +1,507 @@
1
+ /**
2
+ * MockRemit — in-memory test double. No network, no chain. <1ms per operation.
3
+ *
4
+ * Usage:
5
+ * const mock = new MockRemit();
6
+ * const wallet = mock.createWallet(1000);
7
+ * const other = mock.createWallet(0);
8
+ * const tab = await wallet.openTab({ to: other.address, limit: 100, perUnit: 1 });
9
+ */
10
+
11
+ import { generatePrivateKey, privateKeyToAddress } from "viem/accounts";
12
+ import { Wallet } from "../wallet.js";
13
+ import {
14
+ InsufficientBalanceError,
15
+ EscrowNotFoundError,
16
+ TabNotFoundError,
17
+ StreamNotFoundError,
18
+ BountyNotFoundError,
19
+ } from "../errors.js";
20
+ import type {
21
+ Transaction,
22
+ WalletStatus,
23
+ Reputation,
24
+ Webhook,
25
+ } from "../models/index.js";
26
+ import type { Invoice } from "../models/invoice.js";
27
+ import type { Escrow } from "../models/escrow.js";
28
+ import type { Tab } from "../models/tab.js";
29
+ import type { Stream } from "../models/stream.js";
30
+ import type { Bounty } from "../models/bounty.js";
31
+ import type { Deposit } from "../models/deposit.js";
32
+ let _idCounter = 1;
33
+ function nextId(): string {
34
+ return `mock-${_idCounter++}`;
35
+ }
36
+
37
+ function mkTx(invoiceId?: string): Transaction {
38
+ return {
39
+ invoiceId,
40
+ txHash: `0x${nextId()}`,
41
+ chain: "base",
42
+ status: "confirmed",
43
+ createdAt: MockRemit._now(),
44
+ };
45
+ }
46
+
47
+ /** State machine for a mock wallet. */
48
+ class MockWalletState {
49
+ balance: number;
50
+ forcedError: string | null = null;
51
+
52
+ constructor(balance: number) {
53
+ this.balance = balance;
54
+ }
55
+ }
56
+
57
+ export class MockRemit {
58
+ readonly #wallets: Map<string, MockWalletState> = new Map();
59
+ readonly #escrows: Map<string, Escrow> = new Map();
60
+ readonly #tabs: Map<string, Tab> = new Map();
61
+ readonly #streams: Map<string, Stream> = new Map();
62
+ readonly #bounties: Map<string, Bounty> = new Map();
63
+ readonly #deposits: Map<string, Deposit> = new Map();
64
+ #timeOffset = 0;
65
+
66
+ static _now(): number {
67
+ return Math.floor(Date.now() / 1000);
68
+ }
69
+
70
+ _now(): number {
71
+ return MockRemit._now() + this.#timeOffset;
72
+ }
73
+
74
+ /** Advance simulated time. Useful for testing timeouts and expirations. */
75
+ advanceTime(seconds: number): void {
76
+ this.#timeOffset += seconds;
77
+ }
78
+
79
+ /** Create a mock wallet with a given USDC balance. */
80
+ createWallet(balance = 1000): MockWallet {
81
+ const key = generatePrivateKey();
82
+ const address = privateKeyToAddress(key) as string;
83
+ this.#wallets.set(address, new MockWalletState(balance));
84
+ return new MockWallet(key, this);
85
+ }
86
+
87
+ /** Force the next operation for a given wallet address to fail with an error code. */
88
+ setBehavior(address: string, errorCode: string | null): void {
89
+ const state = this.#wallets.get(address);
90
+ if (state) state.forcedError = errorCode;
91
+ }
92
+
93
+ _getState(address: string): MockWalletState {
94
+ let state = this.#wallets.get(address);
95
+ if (!state) {
96
+ state = new MockWalletState(0);
97
+ this.#wallets.set(address, state);
98
+ }
99
+ return state;
100
+ }
101
+
102
+ _checkForced(address: string): void {
103
+ const state = this._getState(address);
104
+ if (state.forcedError) {
105
+ const code = state.forcedError;
106
+ state.forcedError = null;
107
+ throw new Error(code);
108
+ }
109
+ }
110
+
111
+ _debit(address: string, amount: number): void {
112
+ const state = this._getState(address);
113
+ if (state.balance < amount) throw new InsufficientBalanceError();
114
+ state.balance -= amount;
115
+ }
116
+
117
+ _credit(address: string, amount: number): void {
118
+ this._getState(address).balance += amount;
119
+ }
120
+
121
+ // ─── Read operations ─────────────────────────────────────────────────────────
122
+
123
+ getEscrow(id: string): Escrow {
124
+ const e = this.#escrows.get(id);
125
+ if (!e) throw new EscrowNotFoundError();
126
+ return { ...e };
127
+ }
128
+
129
+ getTab(id: string): Tab {
130
+ const t = this.#tabs.get(id);
131
+ if (!t) throw new TabNotFoundError();
132
+ return { ...t };
133
+ }
134
+
135
+ getStream(id: string): Stream {
136
+ const s = this.#streams.get(id);
137
+ if (!s) throw new StreamNotFoundError();
138
+ return { ...s };
139
+ }
140
+
141
+ getBounty(id: string): Bounty {
142
+ const b = this.#bounties.get(id);
143
+ if (!b) throw new BountyNotFoundError();
144
+ return { ...b };
145
+ }
146
+
147
+ getDeposit(id: string): Deposit {
148
+ const d = this.#deposits.get(id);
149
+ if (!d) throw new Error("DEPOSIT_NOT_FOUND");
150
+ return { ...d };
151
+ }
152
+
153
+ getStatus(address: string): WalletStatus {
154
+ const state = this._getState(address);
155
+ return {
156
+ wallet: address,
157
+ balance: String(state.balance),
158
+ monthly_volume: "0",
159
+ tier: "trusted",
160
+ fee_rate_bps: 50,
161
+ active_escrows: 0,
162
+ active_tabs: 0,
163
+ active_streams: 0,
164
+ };
165
+ }
166
+
167
+ getReputation(address: string): Reputation {
168
+ return {
169
+ address,
170
+ score: 100,
171
+ totalPaid: 0,
172
+ totalReceived: 0,
173
+ escrowsCompleted: 0,
174
+ memberSince: this._now() - 86400 * 30,
175
+ };
176
+ }
177
+
178
+ listBounties(status = "open"): Bounty[] {
179
+ return [...this.#bounties.values()].filter((b) => b.status === status);
180
+ }
181
+
182
+ // ─── Write operations ────────────────────────────────────────────────────────
183
+
184
+ payDirect(from: string, to: string, amount: number): Transaction {
185
+ this._checkForced(from);
186
+ this._debit(from, amount);
187
+ this._credit(to, amount);
188
+ return mkTx();
189
+ }
190
+
191
+ fundEscrow(from: string, invoice: Invoice): { tx: Transaction; escrow: Escrow } {
192
+ this._checkForced(from);
193
+ this._debit(from, invoice.amount);
194
+ const id = invoice.id ?? nextId();
195
+ const escrow: Escrow = {
196
+ invoiceId: id,
197
+ txHash: `0x${nextId()}`,
198
+ payer: from,
199
+ payee: invoice.to,
200
+ amount: invoice.amount,
201
+ chain: "base",
202
+ status: "funded",
203
+ createdAt: this._now(),
204
+ };
205
+ this.#escrows.set(id, escrow);
206
+ return { tx: mkTx(id), escrow };
207
+ }
208
+
209
+ releaseEscrow(from: string, invoiceId: string): Transaction {
210
+ this._checkForced(from);
211
+ const escrow = this.getEscrow(invoiceId);
212
+ if (escrow.status === "completed") throw new Error("ESCROW_ALREADY_COMPLETED");
213
+ const mut = this.#escrows.get(invoiceId)!;
214
+ mut.status = "completed";
215
+ this._credit(escrow.payee, escrow.amount);
216
+ return mkTx(invoiceId);
217
+ }
218
+
219
+ cancelEscrow(from: string, invoiceId: string): Transaction {
220
+ this._checkForced(from);
221
+ const escrow = this.getEscrow(invoiceId);
222
+ const mut = this.#escrows.get(invoiceId)!;
223
+ mut.status = "cancelled";
224
+ this._credit(from, escrow.amount);
225
+ return mkTx(invoiceId);
226
+ }
227
+
228
+ openTab(from: string, to: string, limit: number, perUnit: number, expires = 86400): Tab {
229
+ this._checkForced(from);
230
+ this._debit(from, limit);
231
+ const id = nextId();
232
+ const tab: Tab = {
233
+ id,
234
+ payer: from,
235
+ payee: to,
236
+ limit,
237
+ perUnit,
238
+ spent: 0,
239
+ chain: "base",
240
+ status: "open",
241
+ createdAt: this._now(),
242
+ expiresAt: this._now() + expires,
243
+ };
244
+ this.#tabs.set(id, tab);
245
+ return { ...tab };
246
+ }
247
+
248
+ closeTab(from: string, tabId: string): Transaction {
249
+ this._checkForced(from);
250
+ const tab = this.getTab(tabId);
251
+ const remaining = tab.limit - tab.spent;
252
+ const mut = this.#tabs.get(tabId)!;
253
+ mut.status = "closed";
254
+ // Refund unspent to payer
255
+ this._credit(from, remaining);
256
+ this._credit(tab.payee, tab.spent);
257
+ return mkTx();
258
+ }
259
+
260
+ openStream(from: string, to: string, rate: number, maxDuration = 3600, maxTotal?: number): Stream {
261
+ this._checkForced(from);
262
+ const reserve = maxTotal ?? rate * maxDuration;
263
+ this._debit(from, reserve);
264
+ const id = nextId();
265
+ const stream: Stream = {
266
+ id,
267
+ payer: from,
268
+ payee: to,
269
+ ratePerSecond: rate,
270
+ maxDuration,
271
+ maxTotal,
272
+ totalStreamed: 0,
273
+ chain: "base",
274
+ status: "active",
275
+ startedAt: this._now(),
276
+ };
277
+ this.#streams.set(id, stream);
278
+ return { ...stream };
279
+ }
280
+
281
+ closeStream(from: string, streamId: string): Transaction {
282
+ this._checkForced(from);
283
+ const stream = this.getStream(streamId);
284
+ const elapsed = Math.min(this._now() - stream.startedAt, stream.maxDuration);
285
+ const earned = Math.min(elapsed * stream.ratePerSecond, stream.maxTotal ?? Infinity);
286
+ const reserve = stream.maxTotal ?? stream.ratePerSecond * stream.maxDuration;
287
+ const refund = reserve - earned;
288
+ const mut = this.#streams.get(streamId)!;
289
+ mut.status = "closed";
290
+ mut.closedAt = this._now();
291
+ mut.totalStreamed = earned;
292
+ this._credit(stream.payee, earned);
293
+ this._credit(from, refund);
294
+ return mkTx();
295
+ }
296
+
297
+ postBounty(
298
+ from: string,
299
+ amount: number,
300
+ task: string,
301
+ deadline: number,
302
+ validation: Bounty["validation"] = "poster",
303
+ maxAttempts = 10,
304
+ ): Bounty {
305
+ this._checkForced(from);
306
+ this._debit(from, amount);
307
+ const id = nextId();
308
+ const bounty: Bounty = {
309
+ id,
310
+ poster: from,
311
+ amount,
312
+ task,
313
+ chain: "base",
314
+ status: "open",
315
+ validation,
316
+ maxAttempts,
317
+ submissions: [],
318
+ createdAt: this._now(),
319
+ deadline,
320
+ };
321
+ this.#bounties.set(id, bounty);
322
+ return { ...bounty };
323
+ }
324
+
325
+ submitBounty(from: string, bountyId: string, evidenceHash: string): { id: number } {
326
+ this._checkForced(from);
327
+ const mut = this.#bounties.get(bountyId);
328
+ if (!mut) throw new Error(`bounty ${bountyId} not found`);
329
+ mut.submissions.push({
330
+ submitter: from,
331
+ evidenceUri: evidenceHash,
332
+ submittedAt: this._now(),
333
+ });
334
+ return { id: mut.submissions.length };
335
+ }
336
+
337
+ awardBounty(from: string, bountyId: string, submissionId: number): Transaction {
338
+ this._checkForced(from);
339
+ const bounty = this.getBounty(bountyId);
340
+ const mut = this.#bounties.get(bountyId)!;
341
+ const submission = mut.submissions[submissionId - 1];
342
+ if (!submission) throw new Error(`submission ${submissionId} not found`);
343
+ mut.status = "awarded";
344
+ mut.winner = submission.submitter;
345
+ this._credit(submission.submitter, bounty.amount);
346
+ return mkTx();
347
+ }
348
+
349
+ placeDeposit(from: string, to: string, amount: number, expires: number): Deposit {
350
+ this._checkForced(from);
351
+ this._debit(from, amount);
352
+ const id = nextId();
353
+ const deposit: Deposit = {
354
+ id,
355
+ payer: from,
356
+ payee: to,
357
+ amount,
358
+ chain: "base",
359
+ status: "locked",
360
+ createdAt: this._now(),
361
+ expiresAt: this._now() + expires,
362
+ };
363
+ this.#deposits.set(id, deposit);
364
+ return { ...deposit };
365
+ }
366
+
367
+ }
368
+
369
+ /**
370
+ * MockWallet — a Wallet backed by MockRemit instead of the real API.
371
+ * Overrides all write methods to use the in-memory state machine.
372
+ */
373
+ export class MockWallet extends Wallet {
374
+ readonly #mock: MockRemit;
375
+
376
+ constructor(privateKey: string, mock: MockRemit) {
377
+ // Pass a dummy apiUrl so no real HTTP is needed
378
+ super({ privateKey, apiUrl: "http://localhost:0" });
379
+ this.#mock = mock;
380
+ }
381
+
382
+ override async payDirect(to: string, amount: number, _memo = ""): Promise<Transaction> {
383
+ return this.#mock.payDirect(this.address, to, amount);
384
+ }
385
+
386
+ override async pay(invoice: Invoice): Promise<Escrow> {
387
+ const { escrow } = this.#mock.fundEscrow(this.address, invoice);
388
+ return escrow;
389
+ }
390
+
391
+ override async releaseEscrow(invoiceId: string): Promise<Transaction> {
392
+ return this.#mock.releaseEscrow(this.address, invoiceId);
393
+ }
394
+
395
+ override async cancelEscrow(invoiceId: string): Promise<Transaction> {
396
+ return this.#mock.cancelEscrow(this.address, invoiceId);
397
+ }
398
+
399
+ override async openTab(options: Parameters<Wallet["openTab"]>[0]): Promise<Tab> {
400
+ return this.#mock.openTab(
401
+ this.address,
402
+ options.to,
403
+ options.limit,
404
+ options.perUnit,
405
+ options.expires,
406
+ );
407
+ }
408
+
409
+ override async closeTab(tabId: string): Promise<Transaction> {
410
+ return this.#mock.closeTab(this.address, tabId);
411
+ }
412
+
413
+ override async openStream(options: Parameters<Wallet["openStream"]>[0]): Promise<Stream> {
414
+ return this.#mock.openStream(
415
+ this.address,
416
+ options.to,
417
+ options.rate,
418
+ options.maxDuration,
419
+ options.maxTotal,
420
+ );
421
+ }
422
+
423
+ override async closeStream(streamId: string): Promise<Transaction> {
424
+ return this.#mock.closeStream(this.address, streamId);
425
+ }
426
+
427
+ override async postBounty(options: Parameters<Wallet["postBounty"]>[0]): Promise<Bounty> {
428
+ return this.#mock.postBounty(
429
+ this.address,
430
+ options.amount,
431
+ options.task,
432
+ options.deadline,
433
+ options.validation,
434
+ options.maxAttempts,
435
+ );
436
+ }
437
+
438
+ override async submitBounty(bountyId: string, evidenceHash: string): Promise<Transaction> {
439
+ this.#mock.submitBounty(this.address, bountyId, evidenceHash);
440
+ return mkTx();
441
+ }
442
+
443
+ override async awardBounty(bountyId: string, submissionId: number): Promise<Transaction> {
444
+ return this.#mock.awardBounty(this.address, bountyId, submissionId);
445
+ }
446
+
447
+ override async placeDeposit(options: Parameters<Wallet["placeDeposit"]>[0]): Promise<Deposit> {
448
+ return this.#mock.placeDeposit(
449
+ this.address,
450
+ options.to,
451
+ options.amount,
452
+ options.expires,
453
+ );
454
+ }
455
+
456
+ override async status(): Promise<WalletStatus> {
457
+ return this.#mock.getStatus(this.address);
458
+ }
459
+
460
+ override async balance(): Promise<number> {
461
+ return parseFloat((await this.status()).balance);
462
+ }
463
+
464
+ override registerWebhook(url: string, events: string[]): Promise<Webhook> {
465
+ const wh: Webhook = {
466
+ id: `wh-${Date.now()}`,
467
+ wallet: this.address,
468
+ url,
469
+ events,
470
+ chains: ["base"],
471
+ active: true,
472
+ createdAt: MockRemit._now(),
473
+ };
474
+ return Promise.resolve(wh);
475
+ }
476
+
477
+ override requestTestnetFunds(): Promise<Transaction> {
478
+ this.#mock._credit(this.address, 100);
479
+ return Promise.resolve(mkTx());
480
+ }
481
+
482
+ // Override the #auth-based get calls to use mock state
483
+ override getEscrow(invoiceId: string): Promise<import("../models/escrow.js").Escrow> {
484
+ return Promise.resolve(this.#mock.getEscrow(invoiceId));
485
+ }
486
+
487
+ override getTab(tabId: string): Promise<Tab> {
488
+ return Promise.resolve(this.#mock.getTab(tabId));
489
+ }
490
+
491
+ override getStream(streamId: string): Promise<Stream> {
492
+ return Promise.resolve(this.#mock.getStream(streamId));
493
+ }
494
+
495
+ override getBounty(bountyId: string): Promise<Bounty> {
496
+ return Promise.resolve(this.#mock.getBounty(bountyId));
497
+ }
498
+
499
+ override getStatus(_wallet: string): Promise<WalletStatus> {
500
+ return this.status();
501
+ }
502
+
503
+ override getReputation(wallet: string): Promise<import("../models/index.js").Reputation> {
504
+ return Promise.resolve(this.#mock.getReputation(wallet));
505
+ }
506
+ }
507
+