@goodwidget/ai-credits-widget 0.1.1
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.
- package/README.md +25 -0
- package/dist/chunk-5ABKU4SW.js +4518 -0
- package/dist/chunk-5ABKU4SW.js.map +1 -0
- package/dist/chunk-YIXMIOVW.js +24 -0
- package/dist/chunk-YIXMIOVW.js.map +1 -0
- package/dist/element.cjs +4487 -0
- package/dist/element.cjs.map +1 -0
- package/dist/element.js +24 -0
- package/dist/element.js.map +1 -0
- package/dist/index.cjs +4527 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.js +39 -0
- package/dist/index.js.map +1 -0
- package/dist/mocked/index.cjs +4786 -0
- package/dist/mocked/index.cjs.map +1 -0
- package/dist/mocked/index.js +330 -0
- package/dist/mocked/index.js.map +1 -0
- package/dist/register.cjs +4759 -0
- package/dist/register.cjs.map +1 -0
- package/dist/register.js +20 -0
- package/dist/register.js.map +1 -0
- package/package.json +65 -0
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
import "../chunk-YIXMIOVW.js";
|
|
2
|
+
import {
|
|
3
|
+
ANTSEED_DEPOSITS_BASE_ADDRESS,
|
|
4
|
+
AiCreditsWidget,
|
|
5
|
+
BASE_CHAIN_ID,
|
|
6
|
+
DEFAULT_DISCOUNT_CONFIG,
|
|
7
|
+
buildQuoteAmounts,
|
|
8
|
+
buildSetOperatorPayload,
|
|
9
|
+
totalCreditUsdFromProfile
|
|
10
|
+
} from "../chunk-5ABKU4SW.js";
|
|
11
|
+
|
|
12
|
+
// src/mocked/AiCreditsMockWidget.tsx
|
|
13
|
+
import { useMemo } from "react";
|
|
14
|
+
|
|
15
|
+
// src/mocked/chainClient.ts
|
|
16
|
+
var mockOperatorAcceptedBuyers = /* @__PURE__ */ new Set();
|
|
17
|
+
function normalizeAddress(address) {
|
|
18
|
+
return address.toLowerCase();
|
|
19
|
+
}
|
|
20
|
+
function markMockOperatorConsent(buyer) {
|
|
21
|
+
mockOperatorAcceptedBuyers.add(normalizeAddress(buyer));
|
|
22
|
+
}
|
|
23
|
+
var MockAiCreditsChainClient = class {
|
|
24
|
+
operatorAccepted;
|
|
25
|
+
gdUsdPerToken;
|
|
26
|
+
goodIdVerified;
|
|
27
|
+
constructor(options = {}) {
|
|
28
|
+
this.operatorAccepted = options.operatorAccepted ?? false;
|
|
29
|
+
this.gdUsdPerToken = options.gdUsdPerToken ?? 15e-4;
|
|
30
|
+
this.goodIdVerified = options.goodIdVerified ?? false;
|
|
31
|
+
}
|
|
32
|
+
async isGoodIdVerified() {
|
|
33
|
+
return this.goodIdVerified;
|
|
34
|
+
}
|
|
35
|
+
async fetchGdUsdPerToken() {
|
|
36
|
+
return this.gdUsdPerToken;
|
|
37
|
+
}
|
|
38
|
+
async buildQuote(depositG, streamG) {
|
|
39
|
+
return buildQuoteAmounts(depositG, streamG);
|
|
40
|
+
}
|
|
41
|
+
async getBuyerOperatorStatus(ref) {
|
|
42
|
+
const payer = normalizeAddress(ref.payer);
|
|
43
|
+
const buyer = normalizeAddress(ref.buyer);
|
|
44
|
+
const operatorAddress = "0x0000000000000000000000000000000000000004";
|
|
45
|
+
const operatorAccepted = this.operatorAccepted || mockOperatorAcceptedBuyers.has(buyer);
|
|
46
|
+
return {
|
|
47
|
+
enabled: true,
|
|
48
|
+
account: payer,
|
|
49
|
+
buyerAddress: buyer,
|
|
50
|
+
operatorAddress,
|
|
51
|
+
currentOperator: operatorAccepted ? operatorAddress : "0x0000000000000000000000000000000000000000",
|
|
52
|
+
operatorAccepted,
|
|
53
|
+
consentNonce: "0"
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
async buildOperatorConsentPayload(ref, operatorStatus) {
|
|
57
|
+
const status = operatorStatus ?? await this.getBuyerOperatorStatus(ref);
|
|
58
|
+
if (!status.enabled || !status.operatorAddress) {
|
|
59
|
+
return {
|
|
60
|
+
enabled: false,
|
|
61
|
+
account: normalizeAddress(ref.payer),
|
|
62
|
+
buyerAddress: normalizeAddress(ref.buyer)
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
return {
|
|
66
|
+
enabled: true,
|
|
67
|
+
account: normalizeAddress(ref.payer),
|
|
68
|
+
buyerAddress: normalizeAddress(ref.buyer),
|
|
69
|
+
typedData: buildSetOperatorPayload(
|
|
70
|
+
BASE_CHAIN_ID,
|
|
71
|
+
ANTSEED_DEPOSITS_BASE_ADDRESS,
|
|
72
|
+
status.operatorAddress,
|
|
73
|
+
BigInt(status.consentNonce),
|
|
74
|
+
{ name: "AntseedDeposits", version: "1" }
|
|
75
|
+
)
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
async getWithdrawableUsd() {
|
|
79
|
+
return "0";
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
// src/mocked/backendClient.ts
|
|
84
|
+
var MOCK_DELAY_MS = 600;
|
|
85
|
+
var DEFAULT_HISTORY_LIMIT = 20;
|
|
86
|
+
var MAX_HISTORY_LIMIT = 100;
|
|
87
|
+
function sleep(ms) {
|
|
88
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
89
|
+
}
|
|
90
|
+
function normalizeAddress2(address) {
|
|
91
|
+
return address.toLowerCase();
|
|
92
|
+
}
|
|
93
|
+
function paginateGdCredits(entries, options = {}) {
|
|
94
|
+
let result = [...entries].sort((a, b) => {
|
|
95
|
+
const byCreated = b.createdAt.localeCompare(a.createdAt);
|
|
96
|
+
return byCreated !== 0 ? byCreated : b.id.localeCompare(a.id);
|
|
97
|
+
});
|
|
98
|
+
if (options.source) result = result.filter((entry) => entry.source === options.source);
|
|
99
|
+
if (options.fundingStatus) result = result.filter((entry) => entry.fundingStatus === options.fundingStatus);
|
|
100
|
+
if (options.from) {
|
|
101
|
+
const fromMs = Date.parse(options.from);
|
|
102
|
+
result = result.filter((entry) => Date.parse(entry.createdAt) >= fromMs);
|
|
103
|
+
}
|
|
104
|
+
if (options.to) {
|
|
105
|
+
const toMs = Date.parse(options.to);
|
|
106
|
+
result = result.filter((entry) => Date.parse(entry.createdAt) <= toMs);
|
|
107
|
+
}
|
|
108
|
+
const limit = options.limit === void 0 ? DEFAULT_HISTORY_LIMIT : Math.min(Math.max(1, Math.floor(options.limit)), MAX_HISTORY_LIMIT);
|
|
109
|
+
const offset = Math.max(0, Math.floor(options.offset ?? 0));
|
|
110
|
+
return {
|
|
111
|
+
account: "",
|
|
112
|
+
items: result.slice(offset, offset + limit),
|
|
113
|
+
total: result.length,
|
|
114
|
+
limit,
|
|
115
|
+
offset,
|
|
116
|
+
hasMore: offset + limit < result.length
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
function createDemoHistory(account) {
|
|
120
|
+
const normalized = normalizeAddress2(account);
|
|
121
|
+
return [
|
|
122
|
+
{
|
|
123
|
+
id: "demo-deposit-1",
|
|
124
|
+
account: normalized,
|
|
125
|
+
rootAccount: normalized,
|
|
126
|
+
source: "deposit",
|
|
127
|
+
gdAmountWei: "440000000000000000000",
|
|
128
|
+
totalCreditUsd: "6600",
|
|
129
|
+
principalUsd: "6000",
|
|
130
|
+
bonusUsd: "600",
|
|
131
|
+
fundingStatus: "funded",
|
|
132
|
+
txHash: "0xdemo01",
|
|
133
|
+
logIndex: 0,
|
|
134
|
+
createdAt: "2026-06-25T14:30:00.000Z",
|
|
135
|
+
streamUpdateMonth: "2026-06",
|
|
136
|
+
buyerAddress: normalized
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
id: "demo-stream-update-1",
|
|
140
|
+
account: normalized,
|
|
141
|
+
rootAccount: normalized,
|
|
142
|
+
source: "streamUpdate",
|
|
143
|
+
gdAmountWei: "10000000000000000000",
|
|
144
|
+
totalCreditUsd: "0",
|
|
145
|
+
principalUsd: "0",
|
|
146
|
+
bonusUsd: "0",
|
|
147
|
+
fundingStatus: "funded",
|
|
148
|
+
txHash: "0xdemo02",
|
|
149
|
+
logIndex: 0,
|
|
150
|
+
createdAt: "2026-06-24T12:00:00.000Z",
|
|
151
|
+
streamUpdateMonth: "2026-06",
|
|
152
|
+
buyerAddress: normalized
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
id: "demo-stream-request-1",
|
|
156
|
+
account: normalized,
|
|
157
|
+
rootAccount: normalized,
|
|
158
|
+
source: "streamRequest",
|
|
159
|
+
gdAmountWei: "8000000000000000000",
|
|
160
|
+
totalCreditUsd: "1200",
|
|
161
|
+
principalUsd: "1000",
|
|
162
|
+
bonusUsd: "200",
|
|
163
|
+
fundingStatus: "pending",
|
|
164
|
+
txHash: "0xdemo03",
|
|
165
|
+
logIndex: 0,
|
|
166
|
+
createdAt: "2026-06-23T09:15:00.000Z",
|
|
167
|
+
streamUpdateMonth: "2026-06",
|
|
168
|
+
buyerAddress: normalized
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
id: "demo-stream-cron-1",
|
|
172
|
+
account: normalized,
|
|
173
|
+
rootAccount: normalized,
|
|
174
|
+
source: "streamCron",
|
|
175
|
+
gdAmountWei: "5000000000000000000",
|
|
176
|
+
totalCreditUsd: "900",
|
|
177
|
+
principalUsd: "750",
|
|
178
|
+
bonusUsd: "150",
|
|
179
|
+
fundingStatus: "funded",
|
|
180
|
+
createdAt: "2026-06-22T08:00:00.000Z",
|
|
181
|
+
streamUpdateMonth: "2026-06",
|
|
182
|
+
buyerAddress: normalized
|
|
183
|
+
}
|
|
184
|
+
];
|
|
185
|
+
}
|
|
186
|
+
var MockAiCreditsBackendClient = class {
|
|
187
|
+
activeRef = null;
|
|
188
|
+
lastCreditUsd = 0n;
|
|
189
|
+
accountStates = /* @__PURE__ */ new Map();
|
|
190
|
+
getState(payer) {
|
|
191
|
+
const key = normalizeAddress2(payer);
|
|
192
|
+
if (!this.accountStates.has(key)) {
|
|
193
|
+
this.accountStates.set(key, {
|
|
194
|
+
principalUsd: 0n,
|
|
195
|
+
bonusUsd: 0n,
|
|
196
|
+
transactions: createDemoHistory(key),
|
|
197
|
+
rootAccount: key
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
return this.accountStates.get(key);
|
|
201
|
+
}
|
|
202
|
+
async getDiscountConfig() {
|
|
203
|
+
await sleep(MOCK_DELAY_MS);
|
|
204
|
+
return { ...DEFAULT_DISCOUNT_CONFIG };
|
|
205
|
+
}
|
|
206
|
+
buildProfile(payer) {
|
|
207
|
+
const state = this.getState(payer);
|
|
208
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
209
|
+
const outstanding = state.transactions.filter((entry) => entry.fundingStatus === "pending" || entry.fundingStatus === "failed").reduce((sum, entry) => sum + BigInt(entry.totalCreditUsd), 0n);
|
|
210
|
+
return {
|
|
211
|
+
account: normalizeAddress2(payer),
|
|
212
|
+
rootAccount: state.rootAccount,
|
|
213
|
+
createdAt: now,
|
|
214
|
+
updatedAt: now,
|
|
215
|
+
totalGdDepositedWei: "0",
|
|
216
|
+
totalPrincipalUsd: state.principalUsd.toString(),
|
|
217
|
+
totalBonusUsd: state.bonusUsd.toString(),
|
|
218
|
+
totalGDStreamedWei: "0",
|
|
219
|
+
totalOutstandingFundingUsd: outstanding.toString(),
|
|
220
|
+
streamFlowRateWeiPerSecond: "0"
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
async getAccountCredit(payer) {
|
|
224
|
+
await sleep(MOCK_DELAY_MS);
|
|
225
|
+
const profile = this.buildProfile(payer);
|
|
226
|
+
return { account: profile.account, profile };
|
|
227
|
+
}
|
|
228
|
+
async getCreditHistory(payer, options = {}) {
|
|
229
|
+
await sleep(MOCK_DELAY_MS);
|
|
230
|
+
return { ...paginateGdCredits(this.getState(payer).transactions, options), account: normalizeAddress2(payer) };
|
|
231
|
+
}
|
|
232
|
+
async getOutstanding(payer) {
|
|
233
|
+
await sleep(MOCK_DELAY_MS);
|
|
234
|
+
const pending = this.getState(payer).transactions.filter(
|
|
235
|
+
(entry) => entry.fundingStatus === "pending" || entry.fundingStatus === "failed"
|
|
236
|
+
);
|
|
237
|
+
return {
|
|
238
|
+
outstandingFundingUsd: pending.reduce((sum, entry) => sum + BigInt(entry.totalCreditUsd || "0"), 0n).toString(),
|
|
239
|
+
count: pending.length
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
async getTransactions(payer, options = {}) {
|
|
243
|
+
const history = await this.getCreditHistory(payer, {
|
|
244
|
+
fundingStatus: options.status,
|
|
245
|
+
limit: options.limit,
|
|
246
|
+
offset: options.cursor ? Number(options.cursor) || 0 : 0
|
|
247
|
+
});
|
|
248
|
+
return { account: history.account, transactions: history.items };
|
|
249
|
+
}
|
|
250
|
+
prepareSettlement(ref, creditUsd) {
|
|
251
|
+
this.activeRef = { payer: normalizeAddress2(ref.payer), buyer: normalizeAddress2(ref.buyer) };
|
|
252
|
+
this.lastCreditUsd = creditUsd;
|
|
253
|
+
}
|
|
254
|
+
async notifyPayment(txHash) {
|
|
255
|
+
await sleep(MOCK_DELAY_MS);
|
|
256
|
+
const ref = this.activeRef;
|
|
257
|
+
if (!ref) return { txHash, events: [] };
|
|
258
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
259
|
+
const entry = {
|
|
260
|
+
id: `${txHash}:0`,
|
|
261
|
+
account: ref.payer,
|
|
262
|
+
rootAccount: ref.payer,
|
|
263
|
+
source: "deposit",
|
|
264
|
+
gdAmountWei: "0",
|
|
265
|
+
totalCreditUsd: this.lastCreditUsd.toString(),
|
|
266
|
+
principalUsd: this.lastCreditUsd.toString(),
|
|
267
|
+
bonusUsd: "0",
|
|
268
|
+
fundingStatus: "pending",
|
|
269
|
+
txHash,
|
|
270
|
+
logIndex: 0,
|
|
271
|
+
createdAt: now,
|
|
272
|
+
streamUpdateMonth: now.slice(0, 7),
|
|
273
|
+
buyerAddress: ref.buyer
|
|
274
|
+
};
|
|
275
|
+
const state = this.getState(ref.payer);
|
|
276
|
+
if (!state.transactions.find((item) => item.id === entry.id)) state.transactions.unshift(entry);
|
|
277
|
+
return { txHash, events: [entry] };
|
|
278
|
+
}
|
|
279
|
+
async waitForSettlement(ref) {
|
|
280
|
+
await sleep(MOCK_DELAY_MS);
|
|
281
|
+
const state = this.getState(ref.payer);
|
|
282
|
+
for (const entry of state.transactions) {
|
|
283
|
+
if (entry.fundingStatus !== "pending") continue;
|
|
284
|
+
entry.fundingStatus = "funded";
|
|
285
|
+
state.principalUsd += BigInt(entry.principalUsd);
|
|
286
|
+
state.bonusUsd += BigInt(entry.bonusUsd);
|
|
287
|
+
}
|
|
288
|
+
return { totalCreditUsd: totalCreditUsdFromProfile(this.buildProfile(ref.payer)) };
|
|
289
|
+
}
|
|
290
|
+
async closeChannel(channelId) {
|
|
291
|
+
await sleep(MOCK_DELAY_MS);
|
|
292
|
+
return { channelId, action: "close", bridge: { enabled: true, txHash: "0xmock" } };
|
|
293
|
+
}
|
|
294
|
+
async withdrawCredits(buyer, body) {
|
|
295
|
+
await sleep(MOCK_DELAY_MS);
|
|
296
|
+
return { account: buyer, amountUsd: body.amount, bridge: { enabled: true, txHash: "0xmock" } };
|
|
297
|
+
}
|
|
298
|
+
async submitOperatorConsent(buyer) {
|
|
299
|
+
await sleep(MOCK_DELAY_MS);
|
|
300
|
+
const normalizedBuyer = normalizeAddress2(buyer);
|
|
301
|
+
markMockOperatorConsent(normalizedBuyer);
|
|
302
|
+
return { buyer: normalizedBuyer, bridge: { enabled: true, txHash: "0xmock" } };
|
|
303
|
+
}
|
|
304
|
+
};
|
|
305
|
+
|
|
306
|
+
// src/mocked/AiCreditsMockWidget.tsx
|
|
307
|
+
import { jsx } from "react/jsx-runtime";
|
|
308
|
+
function MockAiCreditsWidget(props) {
|
|
309
|
+
const backendClient = useMemo(() => new MockAiCreditsBackendClient(), []);
|
|
310
|
+
const chainClient = useMemo(() => new MockAiCreditsChainClient(), []);
|
|
311
|
+
return /* @__PURE__ */ jsx(
|
|
312
|
+
AiCreditsWidget,
|
|
313
|
+
{
|
|
314
|
+
...props,
|
|
315
|
+
environment: "development",
|
|
316
|
+
adapterOptions: {
|
|
317
|
+
backendClient,
|
|
318
|
+
chainClient,
|
|
319
|
+
skipVaultPaymentValidation: true,
|
|
320
|
+
prepareSettlement: (ref, creditUsd) => backendClient.prepareSettlement(ref, creditUsd)
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
);
|
|
324
|
+
}
|
|
325
|
+
export {
|
|
326
|
+
MockAiCreditsBackendClient,
|
|
327
|
+
MockAiCreditsChainClient,
|
|
328
|
+
MockAiCreditsWidget
|
|
329
|
+
};
|
|
330
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/mocked/AiCreditsMockWidget.tsx","../../src/mocked/chainClient.ts","../../src/mocked/backendClient.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport { AiCreditsWidget, type AiCreditsWidgetProps } from '..'\nimport { MockAiCreditsBackendClient } from './backendClient'\nimport { MockAiCreditsChainClient } from './chainClient'\n\nexport function MockAiCreditsWidget(props: Omit<AiCreditsWidgetProps, 'adapterOptions' | 'environment'>) {\n const backendClient = useMemo(() => new MockAiCreditsBackendClient(), [])\n const chainClient = useMemo(() => new MockAiCreditsChainClient(), [])\n\n return (\n <AiCreditsWidget\n {...props}\n environment=\"development\"\n adapterOptions={{\n backendClient,\n chainClient,\n skipVaultPaymentValidation: true,\n prepareSettlement: (ref, creditUsd) => backendClient.prepareSettlement(ref, creditUsd),\n }}\n />\n )\n}\n","import type { AccountRef } from '../backendTypes'\nimport { BASE_CHAIN_ID, type AiCreditsChainClient } from '../chainClient'\nimport { ANTSEED_DEPOSITS_BASE_ADDRESS, buildSetOperatorPayload } from '../operatorConsent'\nimport { buildQuoteAmounts } from '../quoteMath'\nimport type { BuyerOperatorStatus, OperatorConsentPayloadResponse } from '../operatorConsent'\nimport type { AiCreditsQuote } from '../widgetRuntimeContract'\n\nconst mockOperatorAcceptedBuyers = new Set<string>()\n\nfunction normalizeAddress(address: string): string {\n return address.toLowerCase()\n}\n\nexport function markMockOperatorConsent(buyer: string): void {\n mockOperatorAcceptedBuyers.add(normalizeAddress(buyer))\n}\n\nexport class MockAiCreditsChainClient implements AiCreditsChainClient {\n private operatorAccepted: boolean\n private readonly gdUsdPerToken: number\n private readonly goodIdVerified: boolean\n\n constructor(\n options: { operatorAccepted?: boolean; gdUsdPerToken?: number; goodIdVerified?: boolean } = {},\n ) {\n this.operatorAccepted = options.operatorAccepted ?? false\n this.gdUsdPerToken = options.gdUsdPerToken ?? 0.0015\n this.goodIdVerified = options.goodIdVerified ?? false\n }\n\n async isGoodIdVerified(): Promise<boolean> {\n return this.goodIdVerified\n }\n\n async fetchGdUsdPerToken(): Promise<number> {\n return this.gdUsdPerToken\n }\n\n async buildQuote(depositG: string, streamG: string): Promise<AiCreditsQuote> {\n return buildQuoteAmounts(depositG, streamG)\n }\n\n async getBuyerOperatorStatus(ref: AccountRef): Promise<BuyerOperatorStatus> {\n const payer = normalizeAddress(ref.payer)\n const buyer = normalizeAddress(ref.buyer)\n const operatorAddress = '0x0000000000000000000000000000000000000004'\n const operatorAccepted = this.operatorAccepted || mockOperatorAcceptedBuyers.has(buyer)\n return {\n enabled: true,\n account: payer,\n buyerAddress: buyer,\n operatorAddress,\n currentOperator: operatorAccepted ? operatorAddress : '0x0000000000000000000000000000000000000000',\n operatorAccepted,\n consentNonce: '0',\n }\n }\n\n async buildOperatorConsentPayload(\n ref: AccountRef,\n operatorStatus?: BuyerOperatorStatus,\n ): Promise<OperatorConsentPayloadResponse> {\n const status = operatorStatus ?? (await this.getBuyerOperatorStatus(ref))\n if (!status.enabled || !status.operatorAddress) {\n return {\n enabled: false,\n account: normalizeAddress(ref.payer),\n buyerAddress: normalizeAddress(ref.buyer),\n }\n }\n return {\n enabled: true,\n account: normalizeAddress(ref.payer),\n buyerAddress: normalizeAddress(ref.buyer),\n typedData: buildSetOperatorPayload(\n BASE_CHAIN_ID,\n ANTSEED_DEPOSITS_BASE_ADDRESS,\n status.operatorAddress,\n BigInt(status.consentNonce),\n { name: 'AntseedDeposits', version: '1' },\n ),\n }\n }\n\n async getWithdrawableUsd(): Promise<string> {\n return '0'\n }\n}\n","import type {\n AccountCreditResponse,\n AccountRef,\n CeloEventsRecordResponse,\n ChannelOperationResponse,\n CreditHistoryQuery,\n CreditHistoryResponse,\n DiscountConfig,\n GdCreditEntry,\n OperatorConsentResponse,\n SettlementResult,\n TransactionsResponse,\n UserCreditProfile,\n WithdrawPrincipalRequest,\n WithdrawPrincipalResponse,\n} from '../backendClient'\nimport { DEFAULT_DISCOUNT_CONFIG, totalCreditUsdFromProfile } from '../backendClient'\nimport type { AiCreditsBackendClient } from '../backendClient'\nimport { markMockOperatorConsent } from './chainClient'\n\nconst MOCK_DELAY_MS = 600\nconst DEFAULT_HISTORY_LIMIT = 20\nconst MAX_HISTORY_LIMIT = 100\n\nfunction sleep(ms: number): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, ms))\n}\n\nfunction normalizeAddress(address: string): string {\n return address.toLowerCase()\n}\n\nfunction paginateGdCredits(\n entries: GdCreditEntry[],\n options: CreditHistoryQuery = {},\n): CreditHistoryResponse {\n let result = [...entries].sort((a, b) => {\n const byCreated = b.createdAt.localeCompare(a.createdAt)\n return byCreated !== 0 ? byCreated : b.id.localeCompare(a.id)\n })\n if (options.source) result = result.filter((entry) => entry.source === options.source)\n if (options.fundingStatus) result = result.filter((entry) => entry.fundingStatus === options.fundingStatus)\n if (options.from) {\n const fromMs = Date.parse(options.from)\n result = result.filter((entry) => Date.parse(entry.createdAt) >= fromMs)\n }\n if (options.to) {\n const toMs = Date.parse(options.to)\n result = result.filter((entry) => Date.parse(entry.createdAt) <= toMs)\n }\n const limit = options.limit === undefined\n ? DEFAULT_HISTORY_LIMIT\n : Math.min(Math.max(1, Math.floor(options.limit)), MAX_HISTORY_LIMIT)\n const offset = Math.max(0, Math.floor(options.offset ?? 0))\n return {\n account: '',\n items: result.slice(offset, offset + limit),\n total: result.length,\n limit,\n offset,\n hasMore: offset + limit < result.length,\n }\n}\n\nfunction createDemoHistory(account: string): GdCreditEntry[] {\n const normalized = normalizeAddress(account)\n return [\n {\n id: 'demo-deposit-1', account: normalized, rootAccount: normalized, source: 'deposit',\n gdAmountWei: '440000000000000000000', totalCreditUsd: '6600', principalUsd: '6000',\n bonusUsd: '600', fundingStatus: 'funded', txHash: '0xdemo01', logIndex: 0,\n createdAt: '2026-06-25T14:30:00.000Z', streamUpdateMonth: '2026-06', buyerAddress: normalized,\n },\n {\n id: 'demo-stream-update-1', account: normalized, rootAccount: normalized, source: 'streamUpdate',\n gdAmountWei: '10000000000000000000', totalCreditUsd: '0', principalUsd: '0',\n bonusUsd: '0', fundingStatus: 'funded', txHash: '0xdemo02', logIndex: 0,\n createdAt: '2026-06-24T12:00:00.000Z', streamUpdateMonth: '2026-06', buyerAddress: normalized,\n },\n {\n id: 'demo-stream-request-1', account: normalized, rootAccount: normalized, source: 'streamRequest',\n gdAmountWei: '8000000000000000000', totalCreditUsd: '1200', principalUsd: '1000',\n bonusUsd: '200', fundingStatus: 'pending', txHash: '0xdemo03', logIndex: 0,\n createdAt: '2026-06-23T09:15:00.000Z', streamUpdateMonth: '2026-06', buyerAddress: normalized,\n },\n {\n id: 'demo-stream-cron-1', account: normalized, rootAccount: normalized, source: 'streamCron',\n gdAmountWei: '5000000000000000000', totalCreditUsd: '900', principalUsd: '750',\n bonusUsd: '150', fundingStatus: 'funded', createdAt: '2026-06-22T08:00:00.000Z',\n streamUpdateMonth: '2026-06', buyerAddress: normalized,\n },\n ]\n}\n\nexport class MockAiCreditsBackendClient implements AiCreditsBackendClient {\n private activeRef: AccountRef | null = null\n private lastCreditUsd = 0n\n private readonly accountStates = new Map<string, {\n principalUsd: bigint\n bonusUsd: bigint\n transactions: GdCreditEntry[]\n rootAccount: string\n }>()\n\n private getState(payer: string) {\n const key = normalizeAddress(payer)\n if (!this.accountStates.has(key)) {\n this.accountStates.set(key, {\n principalUsd: 0n, bonusUsd: 0n, transactions: createDemoHistory(key), rootAccount: key,\n })\n }\n return this.accountStates.get(key)!\n }\n\n async getDiscountConfig(): Promise<DiscountConfig> {\n await sleep(MOCK_DELAY_MS)\n return { ...DEFAULT_DISCOUNT_CONFIG }\n }\n\n private buildProfile(payer: string): UserCreditProfile {\n const state = this.getState(payer)\n const now = new Date().toISOString()\n const outstanding = state.transactions\n .filter((entry) => entry.fundingStatus === 'pending' || entry.fundingStatus === 'failed')\n .reduce((sum, entry) => sum + BigInt(entry.totalCreditUsd), 0n)\n return {\n account: normalizeAddress(payer), rootAccount: state.rootAccount, createdAt: now, updatedAt: now,\n totalGdDepositedWei: '0', totalPrincipalUsd: state.principalUsd.toString(),\n totalBonusUsd: state.bonusUsd.toString(), totalGDStreamedWei: '0',\n totalOutstandingFundingUsd: outstanding.toString(), streamFlowRateWeiPerSecond: '0',\n }\n }\n\n async getAccountCredit(payer: string): Promise<AccountCreditResponse> {\n await sleep(MOCK_DELAY_MS)\n const profile = this.buildProfile(payer)\n return { account: profile.account, profile }\n }\n\n async getCreditHistory(payer: string, options: CreditHistoryQuery = {}): Promise<CreditHistoryResponse> {\n await sleep(MOCK_DELAY_MS)\n return { ...paginateGdCredits(this.getState(payer).transactions, options), account: normalizeAddress(payer) }\n }\n\n async getOutstanding(payer: string): Promise<{ outstandingFundingUsd: string; count: number }> {\n await sleep(MOCK_DELAY_MS)\n const pending = this.getState(payer).transactions.filter(\n (entry) => entry.fundingStatus === 'pending' || entry.fundingStatus === 'failed',\n )\n return {\n outstandingFundingUsd: pending.reduce((sum, entry) => sum + BigInt(entry.totalCreditUsd || '0'), 0n).toString(),\n count: pending.length,\n }\n }\n\n async getTransactions(payer: string, options: { status?: 'pending' | 'funded' | 'failed'; limit?: number; cursor?: string } = {}): Promise<TransactionsResponse> {\n const history = await this.getCreditHistory(payer, {\n fundingStatus: options.status, limit: options.limit, offset: options.cursor ? Number(options.cursor) || 0 : 0,\n })\n return { account: history.account, transactions: history.items }\n }\n\n prepareSettlement(ref: AccountRef, creditUsd: bigint): void {\n this.activeRef = { payer: normalizeAddress(ref.payer), buyer: normalizeAddress(ref.buyer) }\n this.lastCreditUsd = creditUsd\n }\n\n async notifyPayment(txHash: string): Promise<CeloEventsRecordResponse> {\n await sleep(MOCK_DELAY_MS)\n const ref = this.activeRef\n if (!ref) return { txHash, events: [] }\n const now = new Date().toISOString()\n const entry: GdCreditEntry = {\n id: `${txHash}:0`, account: ref.payer, rootAccount: ref.payer, source: 'deposit',\n gdAmountWei: '0', totalCreditUsd: this.lastCreditUsd.toString(), principalUsd: this.lastCreditUsd.toString(),\n bonusUsd: '0', fundingStatus: 'pending', txHash, logIndex: 0, createdAt: now,\n streamUpdateMonth: now.slice(0, 7), buyerAddress: ref.buyer,\n }\n const state = this.getState(ref.payer)\n if (!state.transactions.find((item) => item.id === entry.id)) state.transactions.unshift(entry)\n return { txHash, events: [entry] }\n }\n\n async waitForSettlement(ref: AccountRef): Promise<SettlementResult> {\n await sleep(MOCK_DELAY_MS)\n const state = this.getState(ref.payer)\n for (const entry of state.transactions) {\n if (entry.fundingStatus !== 'pending') continue\n entry.fundingStatus = 'funded'\n state.principalUsd += BigInt(entry.principalUsd)\n state.bonusUsd += BigInt(entry.bonusUsd)\n }\n return { totalCreditUsd: totalCreditUsdFromProfile(this.buildProfile(ref.payer)) }\n }\n\n async closeChannel(channelId: string): Promise<ChannelOperationResponse> {\n await sleep(MOCK_DELAY_MS)\n return { channelId, action: 'close', bridge: { enabled: true, txHash: '0xmock' } }\n }\n\n async withdrawCredits(buyer: string, body: WithdrawPrincipalRequest): Promise<WithdrawPrincipalResponse> {\n await sleep(MOCK_DELAY_MS)\n return { account: buyer, amountUsd: body.amount, bridge: { enabled: true, txHash: '0xmock' } }\n }\n\n async submitOperatorConsent(buyer: string): Promise<OperatorConsentResponse> {\n await sleep(MOCK_DELAY_MS)\n const normalizedBuyer = normalizeAddress(buyer)\n markMockOperatorConsent(normalizedBuyer)\n return { buyer: normalizedBuyer, bridge: { enabled: true, txHash: '0xmock' } }\n }\n}\n"],"mappings":";;;;;;;;;;;;AAAA,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