@fluent.xyz/connect 0.1.0 → 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 +5 -1
- package/dist/index.d.ts +580 -7
- package/dist/index.js +198 -14
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,7 +17,11 @@ pnpm add @privy-io/react-auth viem wagmi @tanstack/react-query
|
|
|
17
17
|
## Usage
|
|
18
18
|
|
|
19
19
|
```tsx
|
|
20
|
-
import {
|
|
20
|
+
import {
|
|
21
|
+
FluentWidget,
|
|
22
|
+
fluentTestnet,
|
|
23
|
+
readFluentTokenBalances,
|
|
24
|
+
} from "@fluent.xyz/connect";
|
|
21
25
|
import "@fluent.xyz/connect/styles.css";
|
|
22
26
|
|
|
23
27
|
export function App() {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as viem from 'viem';
|
|
2
|
-
import { Address, WalletClient, createPublicClient, Hex, Abi, Hash } from 'viem';
|
|
2
|
+
import { Transport, Chain, PublicClient, Address, WalletClient, createPublicClient, Hex, Abi, Hash } from 'viem';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ReactNode, AnchorHTMLAttributes, SVGProps } from 'react';
|
|
5
5
|
import * as _privy_io_react_auth from '@privy-io/react-auth';
|
|
@@ -10,12 +10,467 @@ import { createKernelAccount, createKernelAccountClient, ZeroDevPaymasterClient
|
|
|
10
10
|
import * as _zerodev_sdk_actions from '@zerodev/sdk/actions';
|
|
11
11
|
import * as viem_account_abstraction from 'viem/account-abstraction';
|
|
12
12
|
import { SmartAccount, GetPaymasterDataParameters } from 'viem/account-abstraction';
|
|
13
|
-
import * as node_modules_viem__types_utils_ccip from 'node_modules/viem/_types/utils/ccip';
|
|
14
13
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
15
14
|
import { Button as Button$1 } from '@base-ui/react/button';
|
|
16
15
|
import { VariantProps } from 'class-variance-authority';
|
|
17
16
|
import { Dialog as Dialog$1 } from '@base-ui/react/dialog';
|
|
18
17
|
import { Separator as Separator$1 } from '@base-ui/react/separator';
|
|
18
|
+
import { z } from 'zod';
|
|
19
|
+
|
|
20
|
+
declare const fluentChainSchema: z.ZodObject<{
|
|
21
|
+
id: z.ZodString;
|
|
22
|
+
name: z.ZodString;
|
|
23
|
+
chainId: z.ZodNumber;
|
|
24
|
+
testnet: z.ZodBoolean;
|
|
25
|
+
nativeCurrency: z.ZodObject<{
|
|
26
|
+
name: z.ZodString;
|
|
27
|
+
symbol: z.ZodString;
|
|
28
|
+
decimals: z.ZodNumber;
|
|
29
|
+
}, "strip", z.ZodTypeAny, {
|
|
30
|
+
symbol: string;
|
|
31
|
+
name: string;
|
|
32
|
+
decimals: number;
|
|
33
|
+
}, {
|
|
34
|
+
symbol: string;
|
|
35
|
+
name: string;
|
|
36
|
+
decimals: number;
|
|
37
|
+
}>;
|
|
38
|
+
rpcUrls: z.ZodObject<{
|
|
39
|
+
default: z.ZodObject<{
|
|
40
|
+
http: z.ZodArray<z.ZodString, "many">;
|
|
41
|
+
webSocket: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
42
|
+
}, "strip", z.ZodTypeAny, {
|
|
43
|
+
http: string[];
|
|
44
|
+
webSocket?: string[] | undefined;
|
|
45
|
+
}, {
|
|
46
|
+
http: string[];
|
|
47
|
+
webSocket?: string[] | undefined;
|
|
48
|
+
}>;
|
|
49
|
+
}, "strip", z.ZodTypeAny, {
|
|
50
|
+
default: {
|
|
51
|
+
http: string[];
|
|
52
|
+
webSocket?: string[] | undefined;
|
|
53
|
+
};
|
|
54
|
+
}, {
|
|
55
|
+
default: {
|
|
56
|
+
http: string[];
|
|
57
|
+
webSocket?: string[] | undefined;
|
|
58
|
+
};
|
|
59
|
+
}>;
|
|
60
|
+
blockExplorers: z.ZodObject<{
|
|
61
|
+
default: z.ZodObject<{
|
|
62
|
+
name: z.ZodString;
|
|
63
|
+
url: z.ZodString;
|
|
64
|
+
}, "strip", z.ZodTypeAny, {
|
|
65
|
+
name: string;
|
|
66
|
+
url: string;
|
|
67
|
+
}, {
|
|
68
|
+
name: string;
|
|
69
|
+
url: string;
|
|
70
|
+
}>;
|
|
71
|
+
}, "strip", z.ZodTypeAny, {
|
|
72
|
+
default: {
|
|
73
|
+
name: string;
|
|
74
|
+
url: string;
|
|
75
|
+
};
|
|
76
|
+
}, {
|
|
77
|
+
default: {
|
|
78
|
+
name: string;
|
|
79
|
+
url: string;
|
|
80
|
+
};
|
|
81
|
+
}>;
|
|
82
|
+
infoURL: z.ZodString;
|
|
83
|
+
faucets: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
84
|
+
parent: z.ZodOptional<z.ZodObject<{
|
|
85
|
+
type: z.ZodLiteral<"L2">;
|
|
86
|
+
chainId: z.ZodNumber;
|
|
87
|
+
bridgeUrl: z.ZodString;
|
|
88
|
+
}, "strip", z.ZodTypeAny, {
|
|
89
|
+
type: "L2";
|
|
90
|
+
chainId: number;
|
|
91
|
+
bridgeUrl: string;
|
|
92
|
+
}, {
|
|
93
|
+
type: "L2";
|
|
94
|
+
chainId: number;
|
|
95
|
+
bridgeUrl: string;
|
|
96
|
+
}>>;
|
|
97
|
+
contracts: z.ZodOptional<z.ZodObject<{
|
|
98
|
+
fluentBridge: z.ZodOptional<z.ZodObject<{
|
|
99
|
+
address: z.ZodString;
|
|
100
|
+
implementation: z.ZodOptional<z.ZodString>;
|
|
101
|
+
}, "strip", z.ZodTypeAny, {
|
|
102
|
+
address: string;
|
|
103
|
+
implementation?: string | undefined;
|
|
104
|
+
}, {
|
|
105
|
+
address: string;
|
|
106
|
+
implementation?: string | undefined;
|
|
107
|
+
}>>;
|
|
108
|
+
universalTokenFactory: z.ZodOptional<z.ZodObject<{
|
|
109
|
+
address: z.ZodString;
|
|
110
|
+
implementation: z.ZodOptional<z.ZodString>;
|
|
111
|
+
}, "strip", z.ZodTypeAny, {
|
|
112
|
+
address: string;
|
|
113
|
+
implementation?: string | undefined;
|
|
114
|
+
}, {
|
|
115
|
+
address: string;
|
|
116
|
+
implementation?: string | undefined;
|
|
117
|
+
}>>;
|
|
118
|
+
paymentGateway: z.ZodOptional<z.ZodObject<{
|
|
119
|
+
address: z.ZodString;
|
|
120
|
+
implementation: z.ZodOptional<z.ZodString>;
|
|
121
|
+
}, "strip", z.ZodTypeAny, {
|
|
122
|
+
address: string;
|
|
123
|
+
implementation?: string | undefined;
|
|
124
|
+
}, {
|
|
125
|
+
address: string;
|
|
126
|
+
implementation?: string | undefined;
|
|
127
|
+
}>>;
|
|
128
|
+
peggedTokenPrecompile: z.ZodOptional<z.ZodObject<{
|
|
129
|
+
address: z.ZodString;
|
|
130
|
+
}, "strip", z.ZodTypeAny, {
|
|
131
|
+
address: string;
|
|
132
|
+
}, {
|
|
133
|
+
address: string;
|
|
134
|
+
}>>;
|
|
135
|
+
}, "strip", z.ZodTypeAny, {
|
|
136
|
+
fluentBridge?: {
|
|
137
|
+
address: string;
|
|
138
|
+
implementation?: string | undefined;
|
|
139
|
+
} | undefined;
|
|
140
|
+
universalTokenFactory?: {
|
|
141
|
+
address: string;
|
|
142
|
+
implementation?: string | undefined;
|
|
143
|
+
} | undefined;
|
|
144
|
+
paymentGateway?: {
|
|
145
|
+
address: string;
|
|
146
|
+
implementation?: string | undefined;
|
|
147
|
+
} | undefined;
|
|
148
|
+
peggedTokenPrecompile?: {
|
|
149
|
+
address: string;
|
|
150
|
+
} | undefined;
|
|
151
|
+
}, {
|
|
152
|
+
fluentBridge?: {
|
|
153
|
+
address: string;
|
|
154
|
+
implementation?: string | undefined;
|
|
155
|
+
} | undefined;
|
|
156
|
+
universalTokenFactory?: {
|
|
157
|
+
address: string;
|
|
158
|
+
implementation?: string | undefined;
|
|
159
|
+
} | undefined;
|
|
160
|
+
paymentGateway?: {
|
|
161
|
+
address: string;
|
|
162
|
+
implementation?: string | undefined;
|
|
163
|
+
} | undefined;
|
|
164
|
+
peggedTokenPrecompile?: {
|
|
165
|
+
address: string;
|
|
166
|
+
} | undefined;
|
|
167
|
+
}>>;
|
|
168
|
+
}, "strip", z.ZodTypeAny, {
|
|
169
|
+
id: string;
|
|
170
|
+
name: string;
|
|
171
|
+
chainId: number;
|
|
172
|
+
testnet: boolean;
|
|
173
|
+
nativeCurrency: {
|
|
174
|
+
symbol: string;
|
|
175
|
+
name: string;
|
|
176
|
+
decimals: number;
|
|
177
|
+
};
|
|
178
|
+
rpcUrls: {
|
|
179
|
+
default: {
|
|
180
|
+
http: string[];
|
|
181
|
+
webSocket?: string[] | undefined;
|
|
182
|
+
};
|
|
183
|
+
};
|
|
184
|
+
blockExplorers: {
|
|
185
|
+
default: {
|
|
186
|
+
name: string;
|
|
187
|
+
url: string;
|
|
188
|
+
};
|
|
189
|
+
};
|
|
190
|
+
infoURL: string;
|
|
191
|
+
faucets?: string[] | undefined;
|
|
192
|
+
parent?: {
|
|
193
|
+
type: "L2";
|
|
194
|
+
chainId: number;
|
|
195
|
+
bridgeUrl: string;
|
|
196
|
+
} | undefined;
|
|
197
|
+
contracts?: {
|
|
198
|
+
fluentBridge?: {
|
|
199
|
+
address: string;
|
|
200
|
+
implementation?: string | undefined;
|
|
201
|
+
} | undefined;
|
|
202
|
+
universalTokenFactory?: {
|
|
203
|
+
address: string;
|
|
204
|
+
implementation?: string | undefined;
|
|
205
|
+
} | undefined;
|
|
206
|
+
paymentGateway?: {
|
|
207
|
+
address: string;
|
|
208
|
+
implementation?: string | undefined;
|
|
209
|
+
} | undefined;
|
|
210
|
+
peggedTokenPrecompile?: {
|
|
211
|
+
address: string;
|
|
212
|
+
} | undefined;
|
|
213
|
+
} | undefined;
|
|
214
|
+
}, {
|
|
215
|
+
id: string;
|
|
216
|
+
name: string;
|
|
217
|
+
chainId: number;
|
|
218
|
+
testnet: boolean;
|
|
219
|
+
nativeCurrency: {
|
|
220
|
+
symbol: string;
|
|
221
|
+
name: string;
|
|
222
|
+
decimals: number;
|
|
223
|
+
};
|
|
224
|
+
rpcUrls: {
|
|
225
|
+
default: {
|
|
226
|
+
http: string[];
|
|
227
|
+
webSocket?: string[] | undefined;
|
|
228
|
+
};
|
|
229
|
+
};
|
|
230
|
+
blockExplorers: {
|
|
231
|
+
default: {
|
|
232
|
+
name: string;
|
|
233
|
+
url: string;
|
|
234
|
+
};
|
|
235
|
+
};
|
|
236
|
+
infoURL: string;
|
|
237
|
+
faucets?: string[] | undefined;
|
|
238
|
+
parent?: {
|
|
239
|
+
type: "L2";
|
|
240
|
+
chainId: number;
|
|
241
|
+
bridgeUrl: string;
|
|
242
|
+
} | undefined;
|
|
243
|
+
contracts?: {
|
|
244
|
+
fluentBridge?: {
|
|
245
|
+
address: string;
|
|
246
|
+
implementation?: string | undefined;
|
|
247
|
+
} | undefined;
|
|
248
|
+
universalTokenFactory?: {
|
|
249
|
+
address: string;
|
|
250
|
+
implementation?: string | undefined;
|
|
251
|
+
} | undefined;
|
|
252
|
+
paymentGateway?: {
|
|
253
|
+
address: string;
|
|
254
|
+
implementation?: string | undefined;
|
|
255
|
+
} | undefined;
|
|
256
|
+
peggedTokenPrecompile?: {
|
|
257
|
+
address: string;
|
|
258
|
+
} | undefined;
|
|
259
|
+
} | undefined;
|
|
260
|
+
}>;
|
|
261
|
+
declare const l1ChainSchema: z.ZodObject<{
|
|
262
|
+
id: z.ZodString;
|
|
263
|
+
name: z.ZodString;
|
|
264
|
+
chainId: z.ZodNumber;
|
|
265
|
+
testnet: z.ZodBoolean;
|
|
266
|
+
nativeCurrency: z.ZodObject<{
|
|
267
|
+
name: z.ZodString;
|
|
268
|
+
symbol: z.ZodString;
|
|
269
|
+
decimals: z.ZodNumber;
|
|
270
|
+
}, "strip", z.ZodTypeAny, {
|
|
271
|
+
symbol: string;
|
|
272
|
+
name: string;
|
|
273
|
+
decimals: number;
|
|
274
|
+
}, {
|
|
275
|
+
symbol: string;
|
|
276
|
+
name: string;
|
|
277
|
+
decimals: number;
|
|
278
|
+
}>;
|
|
279
|
+
rpcUrls: z.ZodObject<{
|
|
280
|
+
default: z.ZodObject<{
|
|
281
|
+
http: z.ZodArray<z.ZodString, "many">;
|
|
282
|
+
}, "strip", z.ZodTypeAny, {
|
|
283
|
+
http: string[];
|
|
284
|
+
}, {
|
|
285
|
+
http: string[];
|
|
286
|
+
}>;
|
|
287
|
+
}, "strip", z.ZodTypeAny, {
|
|
288
|
+
default: {
|
|
289
|
+
http: string[];
|
|
290
|
+
};
|
|
291
|
+
}, {
|
|
292
|
+
default: {
|
|
293
|
+
http: string[];
|
|
294
|
+
};
|
|
295
|
+
}>;
|
|
296
|
+
blockExplorers: z.ZodObject<{
|
|
297
|
+
default: z.ZodObject<{
|
|
298
|
+
name: z.ZodString;
|
|
299
|
+
url: z.ZodString;
|
|
300
|
+
}, "strip", z.ZodTypeAny, {
|
|
301
|
+
name: string;
|
|
302
|
+
url: string;
|
|
303
|
+
}, {
|
|
304
|
+
name: string;
|
|
305
|
+
url: string;
|
|
306
|
+
}>;
|
|
307
|
+
}, "strip", z.ZodTypeAny, {
|
|
308
|
+
default: {
|
|
309
|
+
name: string;
|
|
310
|
+
url: string;
|
|
311
|
+
};
|
|
312
|
+
}, {
|
|
313
|
+
default: {
|
|
314
|
+
name: string;
|
|
315
|
+
url: string;
|
|
316
|
+
};
|
|
317
|
+
}>;
|
|
318
|
+
pairedL2: z.ZodOptional<z.ZodString>;
|
|
319
|
+
contracts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
320
|
+
address: z.ZodString;
|
|
321
|
+
implementation: z.ZodOptional<z.ZodString>;
|
|
322
|
+
}, "strip", z.ZodTypeAny, {
|
|
323
|
+
address: string;
|
|
324
|
+
implementation?: string | undefined;
|
|
325
|
+
}, {
|
|
326
|
+
address: string;
|
|
327
|
+
implementation?: string | undefined;
|
|
328
|
+
}>>>;
|
|
329
|
+
}, "strip", z.ZodTypeAny, {
|
|
330
|
+
id: string;
|
|
331
|
+
name: string;
|
|
332
|
+
chainId: number;
|
|
333
|
+
testnet: boolean;
|
|
334
|
+
nativeCurrency: {
|
|
335
|
+
symbol: string;
|
|
336
|
+
name: string;
|
|
337
|
+
decimals: number;
|
|
338
|
+
};
|
|
339
|
+
rpcUrls: {
|
|
340
|
+
default: {
|
|
341
|
+
http: string[];
|
|
342
|
+
};
|
|
343
|
+
};
|
|
344
|
+
blockExplorers: {
|
|
345
|
+
default: {
|
|
346
|
+
name: string;
|
|
347
|
+
url: string;
|
|
348
|
+
};
|
|
349
|
+
};
|
|
350
|
+
contracts?: Record<string, {
|
|
351
|
+
address: string;
|
|
352
|
+
implementation?: string | undefined;
|
|
353
|
+
}> | undefined;
|
|
354
|
+
pairedL2?: string | undefined;
|
|
355
|
+
}, {
|
|
356
|
+
id: string;
|
|
357
|
+
name: string;
|
|
358
|
+
chainId: number;
|
|
359
|
+
testnet: boolean;
|
|
360
|
+
nativeCurrency: {
|
|
361
|
+
symbol: string;
|
|
362
|
+
name: string;
|
|
363
|
+
decimals: number;
|
|
364
|
+
};
|
|
365
|
+
rpcUrls: {
|
|
366
|
+
default: {
|
|
367
|
+
http: string[];
|
|
368
|
+
};
|
|
369
|
+
};
|
|
370
|
+
blockExplorers: {
|
|
371
|
+
default: {
|
|
372
|
+
name: string;
|
|
373
|
+
url: string;
|
|
374
|
+
};
|
|
375
|
+
};
|
|
376
|
+
contracts?: Record<string, {
|
|
377
|
+
address: string;
|
|
378
|
+
implementation?: string | undefined;
|
|
379
|
+
}> | undefined;
|
|
380
|
+
pairedL2?: string | undefined;
|
|
381
|
+
}>;
|
|
382
|
+
type FluentChainDefinition = z.infer<typeof fluentChainSchema>;
|
|
383
|
+
type L1ChainDefinition = z.infer<typeof l1ChainSchema>;
|
|
384
|
+
|
|
385
|
+
type BridgeAddresses = {
|
|
386
|
+
l2?: {
|
|
387
|
+
proxy: `0x${string}`;
|
|
388
|
+
implementation?: `0x${string}`;
|
|
389
|
+
};
|
|
390
|
+
l1?: {
|
|
391
|
+
proxy: `0x${string}`;
|
|
392
|
+
implementation?: `0x${string}`;
|
|
393
|
+
};
|
|
394
|
+
};
|
|
395
|
+
|
|
396
|
+
type FluentClientConfig<TTransport extends Transport = Transport> = {
|
|
397
|
+
/** Viem chain (use exports from `@fluent.xyz/connect-sdk`) */
|
|
398
|
+
chain: Chain;
|
|
399
|
+
transport: TTransport;
|
|
400
|
+
};
|
|
401
|
+
type FluentClient<TTransport extends Transport = Transport> = {
|
|
402
|
+
chain: Chain;
|
|
403
|
+
definition: FluentChainDefinition;
|
|
404
|
+
public: PublicClient<TTransport, Chain>;
|
|
405
|
+
addresses: {
|
|
406
|
+
bridge: BridgeAddresses;
|
|
407
|
+
peggedTokenPrecompile?: `0x${string}`;
|
|
408
|
+
paymentGateway?: `0x${string}`;
|
|
409
|
+
universalTokenFactory?: `0x${string}`;
|
|
410
|
+
};
|
|
411
|
+
l1: L1ChainDefinition | undefined;
|
|
412
|
+
/** Read L2 bridge `otherSideChainId` when deployed */
|
|
413
|
+
readOtherSideChainId: () => Promise<bigint | undefined>;
|
|
414
|
+
};
|
|
415
|
+
declare function createFluentClient<TTransport extends Transport>(config: FluentClientConfig<TTransport>): FluentClient<TTransport>;
|
|
416
|
+
|
|
417
|
+
type FluentPermissionStatus = "pending" | "active" | "expired" | "revoked";
|
|
418
|
+
type FluentCallPermission = {
|
|
419
|
+
chainId: number;
|
|
420
|
+
to: `0x${string}`;
|
|
421
|
+
function?: string;
|
|
422
|
+
selector?: `0x${string}`;
|
|
423
|
+
};
|
|
424
|
+
type FluentSpendPeriod = "transaction" | "hour" | "day" | "session";
|
|
425
|
+
type FluentSpendPermission = {
|
|
426
|
+
chainId: number;
|
|
427
|
+
token: `0x${string}` | "native";
|
|
428
|
+
symbol?: string;
|
|
429
|
+
limit: string;
|
|
430
|
+
period: FluentSpendPeriod;
|
|
431
|
+
recipients?: `0x${string}`[];
|
|
432
|
+
};
|
|
433
|
+
type FluentPermissionPolicy$1 = {
|
|
434
|
+
calls: FluentCallPermission[];
|
|
435
|
+
spend: FluentSpendPermission[];
|
|
436
|
+
};
|
|
437
|
+
type FluentPermissionGrantRequest = {
|
|
438
|
+
appId: string;
|
|
439
|
+
expiry: number;
|
|
440
|
+
permissions: FluentPermissionPolicy$1;
|
|
441
|
+
};
|
|
442
|
+
type FluentPermissionGrant = {
|
|
443
|
+
id: string;
|
|
444
|
+
appId: string;
|
|
445
|
+
clientId: string;
|
|
446
|
+
userId: string;
|
|
447
|
+
walletAddress?: `0x${string}`;
|
|
448
|
+
origin: string;
|
|
449
|
+
status: FluentPermissionStatus;
|
|
450
|
+
expiry: number;
|
|
451
|
+
permissions: FluentPermissionPolicy$1;
|
|
452
|
+
createdAt: number;
|
|
453
|
+
lastUsedAt?: number;
|
|
454
|
+
revokedAt?: number;
|
|
455
|
+
};
|
|
456
|
+
type FluentPermissionPreview = {
|
|
457
|
+
request: FluentPermissionGrantRequest;
|
|
458
|
+
effectivePolicy: FluentPermissionPolicy$1;
|
|
459
|
+
warnings: string[];
|
|
460
|
+
};
|
|
461
|
+
type FluentPermissionClientConfig = {
|
|
462
|
+
baseUrl: string;
|
|
463
|
+
clientId: string;
|
|
464
|
+
getSessionToken: () => string | Promise<string>;
|
|
465
|
+
fetch?: typeof globalThis.fetch;
|
|
466
|
+
};
|
|
467
|
+
type FluentPermissionClient = {
|
|
468
|
+
preview: (request: FluentPermissionGrantRequest) => Promise<FluentPermissionPreview>;
|
|
469
|
+
grant: (request: FluentPermissionGrantRequest) => Promise<FluentPermissionGrant>;
|
|
470
|
+
list: () => Promise<FluentPermissionGrant[]>;
|
|
471
|
+
revoke: (grantId: string) => Promise<FluentPermissionGrant>;
|
|
472
|
+
};
|
|
473
|
+
declare function createFluentPermissionClient(config: FluentPermissionClientConfig): FluentPermissionClient;
|
|
19
474
|
|
|
20
475
|
type FluentTokenDefinition = {
|
|
21
476
|
chainId: number;
|
|
@@ -31,7 +486,97 @@ type FluentTokenBalance = FluentTokenDefinition & {
|
|
|
31
486
|
status: "ready" | "not-configured" | "error";
|
|
32
487
|
error?: string;
|
|
33
488
|
};
|
|
489
|
+
declare const fluentTestnetTokenDefaults: {
|
|
490
|
+
readonly ETH: {
|
|
491
|
+
readonly chainId: 20994;
|
|
492
|
+
readonly symbol: "ETH";
|
|
493
|
+
readonly name: "Ether";
|
|
494
|
+
readonly decimals: 18;
|
|
495
|
+
};
|
|
496
|
+
readonly USDnr: {
|
|
497
|
+
readonly chainId: 20994;
|
|
498
|
+
readonly symbol: "USDnr";
|
|
499
|
+
readonly name: "USDnr";
|
|
500
|
+
readonly decimals: 18;
|
|
501
|
+
readonly address: "0x092AE7564C6611a114C20C6df766B5B35A52334A";
|
|
502
|
+
};
|
|
503
|
+
readonly BLEND: {
|
|
504
|
+
readonly chainId: 20994;
|
|
505
|
+
readonly symbol: "BLEND";
|
|
506
|
+
readonly name: "Mock Blend";
|
|
507
|
+
readonly decimals: 18;
|
|
508
|
+
readonly address: "0x83Fed707A8dDDC2535aE591CF19fB6C91D542D8E";
|
|
509
|
+
};
|
|
510
|
+
readonly USDC: {
|
|
511
|
+
readonly chainId: 20994;
|
|
512
|
+
readonly symbol: "USDC";
|
|
513
|
+
readonly name: "USD Coin";
|
|
514
|
+
readonly decimals: 6;
|
|
515
|
+
readonly address: "0xC8Ebbf08Cb2A87aB90cC8EeC34C721764b7755e9";
|
|
516
|
+
};
|
|
517
|
+
readonly USDT: {
|
|
518
|
+
readonly chainId: 20994;
|
|
519
|
+
readonly symbol: "USDT";
|
|
520
|
+
readonly name: "USDT";
|
|
521
|
+
readonly decimals: 6;
|
|
522
|
+
readonly address: "0xD80Ca465c268e76F0d897D44a35fC97Db75AB797";
|
|
523
|
+
};
|
|
524
|
+
};
|
|
525
|
+
declare const fluentTestnetWidgetTokens: readonly FluentTokenDefinition[];
|
|
526
|
+
declare function readFluentTokenBalances<TTransport extends Transport = Transport, TChain extends Chain = Chain>(params: {
|
|
527
|
+
client: PublicClient<TTransport, TChain>;
|
|
528
|
+
account: Address;
|
|
529
|
+
tokens: readonly FluentTokenDefinition[];
|
|
530
|
+
}): Promise<FluentTokenBalance[]>;
|
|
34
531
|
|
|
532
|
+
type FluentFamilyTier = "A" | "B" | "C" | "D";
|
|
533
|
+
type FluentFamilyType = "identity" | "tester" | "builder" | "influential" | "predictor";
|
|
534
|
+
type FluentFamily = {
|
|
535
|
+
tier: FluentFamilyTier;
|
|
536
|
+
metadata?: Record<string, string>;
|
|
537
|
+
lastUpdate?: string;
|
|
538
|
+
};
|
|
539
|
+
type FluentFamilies = {
|
|
540
|
+
xHandle?: string;
|
|
541
|
+
families: Record<FluentFamilyType, FluentFamily>;
|
|
542
|
+
};
|
|
543
|
+
type FluentFamiliesClientConfig = {
|
|
544
|
+
baseUrl: string;
|
|
545
|
+
fetch?: typeof globalThis.fetch;
|
|
546
|
+
};
|
|
547
|
+
type FluentFamiliesClient = {
|
|
548
|
+
getFamilies: (privyId: string) => Promise<FluentFamilies>;
|
|
549
|
+
};
|
|
550
|
+
declare function createFluentFamiliesClient(config: FluentFamiliesClientConfig): FluentFamiliesClient;
|
|
551
|
+
|
|
552
|
+
/** Fluent Developer Preview (chain id 20993) */
|
|
553
|
+
declare const fluentDevnet: viem.Chain;
|
|
554
|
+
/** Fluent public testnet (chain id 20994) */
|
|
555
|
+
declare const fluentTestnet: viem.Chain;
|
|
556
|
+
/** Fluent mainnet (chain id 25363) */
|
|
557
|
+
declare const fluentMainnet: viem.Chain;
|
|
558
|
+
|
|
559
|
+
type FluentNetwork = "devnet" | "testnet" | "mainnet";
|
|
560
|
+
type FluentInitializeConfig = {
|
|
561
|
+
network: FluentNetwork;
|
|
562
|
+
/**
|
|
563
|
+
* Advanced override for registered production apps.
|
|
564
|
+
* Default integrations should omit this and let Fluent derive app identity from origin.
|
|
565
|
+
*/
|
|
566
|
+
clientId?: string;
|
|
567
|
+
/**
|
|
568
|
+
* Optional display hint for anonymous/basic mode.
|
|
569
|
+
* Fluent-controlled hosted auth remains the source of truth for registered app metadata.
|
|
570
|
+
*/
|
|
571
|
+
appName?: string;
|
|
572
|
+
authorizeUrl?: string;
|
|
573
|
+
scopes?: string[];
|
|
574
|
+
source?: string;
|
|
575
|
+
campaign?: string;
|
|
576
|
+
storage?: StorageLike;
|
|
577
|
+
origin?: string;
|
|
578
|
+
redirectUri?: string;
|
|
579
|
+
};
|
|
35
580
|
type FluentAppIdentity = {
|
|
36
581
|
mode: "origin" | "registered";
|
|
37
582
|
origin: string;
|
|
@@ -52,6 +597,36 @@ type FluentSession = {
|
|
|
52
597
|
issuedAt: number;
|
|
53
598
|
idToken?: string;
|
|
54
599
|
};
|
|
600
|
+
type FluentConnectionStatus = {
|
|
601
|
+
status: "connected" | "disconnected";
|
|
602
|
+
network: FluentNetwork;
|
|
603
|
+
app: FluentAppIdentity;
|
|
604
|
+
session?: FluentSession;
|
|
605
|
+
};
|
|
606
|
+
type FluentConnectOptions = {
|
|
607
|
+
popup?: WindowOpenLike;
|
|
608
|
+
state?: string;
|
|
609
|
+
};
|
|
610
|
+
type StorageLike = Pick<Storage, "getItem" | "setItem" | "removeItem">;
|
|
611
|
+
type WindowOpenLike = (url?: string | URL, target?: string, features?: string) => unknown;
|
|
612
|
+
declare class FluentConnectSDK {
|
|
613
|
+
private config;
|
|
614
|
+
private app;
|
|
615
|
+
private session;
|
|
616
|
+
constructor(config: FluentInitializeConfig);
|
|
617
|
+
status(): FluentConnectionStatus;
|
|
618
|
+
buildAuthorizeUrl(state?: string): URL;
|
|
619
|
+
connect(options?: FluentConnectOptions): URL;
|
|
620
|
+
setSession(session: Omit<FluentSession, "app"> & {
|
|
621
|
+
app?: FluentAppIdentity;
|
|
622
|
+
}): FluentSession;
|
|
623
|
+
disconnect(): FluentConnectionStatus;
|
|
624
|
+
private readStoredSession;
|
|
625
|
+
}
|
|
626
|
+
declare function initialize(config: FluentInitializeConfig): FluentConnectSDK;
|
|
627
|
+
declare const fluent: {
|
|
628
|
+
initialize: typeof initialize;
|
|
629
|
+
};
|
|
55
630
|
|
|
56
631
|
declare const FLUENT_GAS_PAYMENT_PRIORITY: readonly ["USDnr", "BLEND", "ETH"];
|
|
57
632
|
type FluentGasPaymentSymbol = typeof FLUENT_GAS_PAYMENT_PRIORITY[number];
|
|
@@ -470,7 +1045,7 @@ declare function createFluentZeroDevErc20PaymasterClient(params?: {
|
|
|
470
1045
|
} | undefined;
|
|
471
1046
|
cacheTime: number;
|
|
472
1047
|
ccipRead?: false | {
|
|
473
|
-
request?: (parameters: viem.CcipRequestParameters) => Promise
|
|
1048
|
+
request?: (parameters: viem.CcipRequestParameters) => Promise<`0x${string}`>;
|
|
474
1049
|
} | undefined;
|
|
475
1050
|
chain: viem.Chain | undefined;
|
|
476
1051
|
dataSuffix?: viem.DataSuffix | undefined;
|
|
@@ -479,7 +1054,6 @@ declare function createFluentZeroDevErc20PaymasterClient(params?: {
|
|
|
479
1054
|
name: string;
|
|
480
1055
|
pollingInterval: number;
|
|
481
1056
|
request: viem.EIP1193RequestFn<_zerodev_sdk.ZeroDevPaymasterRpcSchema<"0.7">>;
|
|
482
|
-
tokens: viem.Tokens | undefined;
|
|
483
1057
|
transport: viem.TransportConfig<string, viem.EIP1193RequestFn> & Record<string, any>;
|
|
484
1058
|
type: string;
|
|
485
1059
|
uid: string;
|
|
@@ -500,11 +1074,10 @@ declare function createFluentZeroDevErc20PaymasterClient(params?: {
|
|
|
500
1074
|
name?: undefined;
|
|
501
1075
|
pollingInterval?: undefined;
|
|
502
1076
|
request?: undefined;
|
|
503
|
-
tokens?: undefined;
|
|
504
1077
|
transport?: undefined;
|
|
505
1078
|
type?: undefined;
|
|
506
1079
|
uid?: undefined;
|
|
507
|
-
} & viem.ExactPartial<Pick<viem.PublicActions<viem.Transport, viem.Chain | undefined, SmartAccount | undefined
|
|
1080
|
+
} & viem.ExactPartial<Pick<viem.PublicActions<viem.Transport, viem.Chain | undefined, SmartAccount | undefined>, "call" | "createContractEventFilter" | "createEventFilter" | "estimateContractGas" | "estimateGas" | "getBlock" | "getBlockNumber" | "getChainId" | "getContractEvents" | "getEnsText" | "getFilterChanges" | "getGasPrice" | "getLogs" | "getTransaction" | "getTransactionCount" | "getTransactionReceipt" | "prepareTransactionRequest" | "readContract" | "sendRawTransaction" | "simulateContract" | "uninstallFilter" | "watchBlockNumber" | "watchContractEvent"> & Pick<viem.WalletActions<viem.Chain | undefined, SmartAccount | undefined>, "sendTransaction" | "writeContract">>>(fn: (client: viem.Client<viem.Transport, viem.Chain | undefined, SmartAccount | undefined, _zerodev_sdk.ZeroDevPaymasterRpcSchema<"0.7">, viem_account_abstraction.PaymasterActions & _zerodev_sdk.ZeroDevPaymasterClientActions>) => client) => viem.Client<viem.Transport, viem.Chain | undefined, SmartAccount | undefined, _zerodev_sdk.ZeroDevPaymasterRpcSchema<"0.7">, { [K in keyof client]: client[K]; } & viem_account_abstraction.PaymasterActions & _zerodev_sdk.ZeroDevPaymasterClientActions>;
|
|
508
1081
|
};
|
|
509
1082
|
declare function createFluentZeroDevErc20Paymaster(params: {
|
|
510
1083
|
gasToken?: FluentZeroDevErc20PaymasterToken;
|
|
@@ -573,4 +1146,4 @@ declare function Icon({ name, className, ...props }: {
|
|
|
573
1146
|
name: IconName;
|
|
574
1147
|
} & SVGProps<SVGSVGElement>): React.JSX.Element;
|
|
575
1148
|
|
|
576
|
-
export { Button, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, FLUENT_GAS_PAYMENT_DEFAULT_ETH_RATES, FLUENT_GAS_PAYMENT_PRIORITY, FLUENT_WIDGET_SESSION_STORAGE_KEY, FLUENT_ZERODEV_ERC20_PAYMASTER_QUERY, FLUENT_ZERODEV_ERC20_PAYMASTER_TOKENS, FLUENT_ZERODEV_PAYMASTER_DEMO_RECIPIENT, type FluentBatchApi, type FluentBatchButtonConfig, type FluentBatchCallInput, type FluentBatchConfirmationMode, type FluentBatchOperation, type FluentBatchOperationExecuteOptions, type FluentBatchOperationExecutor, type FluentBatchOperationInput, type FluentBatchOperationReview, type FluentEncodedBatchCall, type FluentExternalWalletState, type FluentGasPayment, type FluentGasPaymentEthRates, type FluentGasPaymentSelection, type FluentGasPaymentSymbol, type FluentGasPaymentValueTier, type FluentPermissionApi, type FluentPermissionArgConstraint, type FluentPermissionArgs, type FluentPermissionBatchPolicy, type FluentPermissionBatchPolicyInput, type FluentPermissionCallInput, type FluentPermissionCallPolicy, type FluentPermissionPolicy, type FluentPermissionPolicyBuilders, type FluentPermissionSession, type FluentPermissionSessionExecutor, type FluentPermissionSessionInput, FluentWidget, type FluentWidgetAccount, type FluentWidgetAuthMode, type FluentWidgetConfig, type FluentWidgetExecutionStatus, type FluentWidgetGasPayment, type FluentWidgetProps, type FluentWidgetRenderContext, type FluentWidgetSession, type FluentZeroDevErc20PaymasterToken, type FluentZeroDevErc20PaymasterTokenKey, type FluentZeroDevKernel, type FluentZeroDevPaymasterDemoResult, type FluentZeroDevPaymasterKernel, type FluentZeroDevPermissionCall, type FluentZeroDevPermissionSession, type FluentZeroDevSignerMode, Icon, type IconName, Separator, buttonVariants, createFluentBatchOp, createFluentPermissionApi, createFluentPermissionPolicyBuilders, createFluentPermissionSession, createFluentZeroDevErc20Paymaster, createFluentZeroDevErc20PaymasterApprovalCall, createFluentZeroDevErc20PaymasterClient, createFluentZeroDevErc20PaymasterRpcUrl, createFluentZeroDevPermissionSession, createFluentZeroDevRpcUrl, formatFluentGasTokenBalance, getFluentGasPaymentEthValue, getFluentGasPaymentTokens, getFluentGasPaymentValueTier, resolveFluentZeroDevErc20PaymasterToken, selectFluentGasPaymentToken, sendFluentZeroDevErc20PaymasterDemo, useFluentZeroDevAccount };
|
|
1149
|
+
export { Button, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, FLUENT_GAS_PAYMENT_DEFAULT_ETH_RATES, FLUENT_GAS_PAYMENT_PRIORITY, FLUENT_WIDGET_SESSION_STORAGE_KEY, FLUENT_ZERODEV_ERC20_PAYMASTER_QUERY, FLUENT_ZERODEV_ERC20_PAYMASTER_TOKENS, FLUENT_ZERODEV_PAYMASTER_DEMO_RECIPIENT, type FluentBatchApi, type FluentBatchButtonConfig, type FluentBatchCallInput, type FluentBatchConfirmationMode, type FluentBatchOperation, type FluentBatchOperationExecuteOptions, type FluentBatchOperationExecutor, type FluentBatchOperationInput, type FluentBatchOperationReview, type FluentEncodedBatchCall, type FluentExternalWalletState, type FluentFamilies, type FluentGasPayment, type FluentGasPaymentEthRates, type FluentGasPaymentSelection, type FluentGasPaymentSymbol, type FluentGasPaymentValueTier, type FluentPermissionApi, type FluentPermissionArgConstraint, type FluentPermissionArgs, type FluentPermissionBatchPolicy, type FluentPermissionBatchPolicyInput, type FluentPermissionCallInput, type FluentPermissionCallPolicy, type FluentPermissionPolicy, type FluentPermissionPolicyBuilders, type FluentPermissionSession, type FluentPermissionSessionExecutor, type FluentPermissionSessionInput, type FluentSession, type FluentTokenBalance, type FluentTokenDefinition, FluentWidget, type FluentWidgetAccount, type FluentWidgetAuthMode, type FluentWidgetConfig, type FluentWidgetExecutionStatus, type FluentWidgetGasPayment, type FluentWidgetProps, type FluentWidgetRenderContext, type FluentWidgetSession, type FluentZeroDevErc20PaymasterToken, type FluentZeroDevErc20PaymasterTokenKey, type FluentZeroDevKernel, type FluentZeroDevPaymasterDemoResult, type FluentZeroDevPaymasterKernel, type FluentZeroDevPermissionCall, type FluentZeroDevPermissionSession, type FluentZeroDevSignerMode, Icon, type IconName, Separator, buttonVariants, createFluentBatchOp, createFluentClient, createFluentFamiliesClient, createFluentPermissionApi, createFluentPermissionClient, createFluentPermissionPolicyBuilders, createFluentPermissionSession, createFluentZeroDevErc20Paymaster, createFluentZeroDevErc20PaymasterApprovalCall, createFluentZeroDevErc20PaymasterClient, createFluentZeroDevErc20PaymasterRpcUrl, createFluentZeroDevPermissionSession, createFluentZeroDevRpcUrl, fluent, fluentDevnet, fluentMainnet, fluentTestnet, fluentTestnetTokenDefaults, fluentTestnetWidgetTokens, formatFluentGasTokenBalance, getFluentGasPaymentEthValue, getFluentGasPaymentTokens, getFluentGasPaymentValueTier, readFluentTokenBalances, resolveFluentZeroDevErc20PaymasterToken, selectFluentGasPaymentToken, sendFluentZeroDevErc20PaymasterDemo, useFluentZeroDevAccount };
|