@fluent.xyz/connect 0.6.2 → 0.6.4
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 +2 -0
- package/dist/batchOperation-BXn9nmvk.d.ts +524 -0
- package/dist/index.d.ts +15 -507
- package/dist/index.js +445 -207
- package/dist/index.js.map +1 -1
- package/dist/internal.d.ts +293 -0
- package/dist/internal.js +4781 -0
- package/dist/internal.js.map +1 -0
- package/docs/api.md +16 -8
- package/docs/errors.md +10 -4
- package/docs/getting-started.md +4 -2
- package/docs/guides/transactions.md +9 -0
- package/docs/internal.md +109 -0
- package/docs/upgrading-0.5.md +40 -8
- package/package.json +5 -1
package/docs/api.md
CHANGED
|
@@ -631,7 +631,7 @@ export type FluentBatchOperation = {
|
|
|
631
631
|
| `calls` | `readonly FluentBatchCallInput[]` | no | no | The calls as the host passed them. |
|
|
632
632
|
| `encodedCalls` | `FluentEncodedBatchCall[]` | no | no | The same calls encoded, in order: what `execute()` sends. |
|
|
633
633
|
| `canExecute` | `boolean` | no | no | Whether the widget could send the operation when it was built: the Widget account ready, or able to prepare itself when `execute()` is called. Not updated afterwards; read `widget.account.executionReady` for the live value. |
|
|
634
|
-
| `execute` | `(options?: FluentBatchOperationExecuteOptions) => Promise<FluentExecuteResult>` | no | no | Executes the operation for the Widget account and resolves once it is included. **Throws** `FluentReviewRejectedError` with `code` `transaction_review_rejected` when the person dismisses the Review, which a Fluent ID shows in Prompt mode; an External wallet's refusal in its own prompt rejects with the wallet's error. **Throws** `FluentSponsorshipFallbackError` when a Fluent ID asked for Sponsorship, a sponsored submission failed, and the submission in which the account pays its own gas failed too; its `code` says why Sponsorship failed: `denied`, `unauthorized`, `unreachable` or `no_token`. A failure while waiting for an operation's inclusion is not wrapped: it rejects with its own error, and an operation whose wait failed was submitted. What else is not wrapped: [guides/sponsorship.md](guides/sponsorship.md#both-failed-fluentsponsorshipfallbackerror). **Throws** `FluentUserOperationGasError` (experimental) with `code` `invalid_policy` for a `skipEstimation` policy that cannot be used (other invalid `userOperationGas` values throw a plain `Error`), and `paymaster_gas_mismatch` when, with estimation skipped, the paymaster's authorization of a Gas token payment does not match the fixed gas limits. Under Sponsorship, a failed check of the paymaster's gas fails the sponsored submission instead, and the account pays its own gas. **Throws** `FluentGasPaymentError`
|
|
634
|
+
| `execute` | `(options?: FluentBatchOperationExecuteOptions) => Promise<FluentExecuteResult>` | no | no | Executes the operation for the Widget account and resolves once it is included. **Throws** `FluentReviewRejectedError` with `code` `transaction_review_rejected` when the person dismisses the Review, which a Fluent ID shows in Prompt mode; an External wallet's refusal in its own prompt rejects with the wallet's error. **Throws** `FluentSponsorshipFallbackError` when a Fluent ID asked for Sponsorship, a sponsored submission failed, and the submission in which the account pays its own gas failed too; its `code` says why Sponsorship failed: `denied`, `unauthorized`, `unreachable` or `no_token`. A failure while waiting for an operation's inclusion is not wrapped: it rejects with its own error, and an operation whose wait failed was submitted. What else is not wrapped: [guides/sponsorship.md](guides/sponsorship.md#both-failed-fluentsponsorshipfallbackerror). **Throws** `FluentUserOperationGasError` (experimental) with `code` `invalid_policy` for a `skipEstimation` policy that cannot be used (other invalid `userOperationGas` values throw a plain `Error`), and `paymaster_gas_mismatch` when, with estimation skipped, the paymaster's authorization of a Gas token payment does not match the fixed gas limits. Under Sponsorship, a failed check of the paymaster's gas fails the sponsored submission instead, and the account pays its own gas. **Throws** `FluentGasPaymentError` when a Fluent ID's operation is paid in a Gas token and cannot be prepared; nothing has been signed or sent. Its `code` is `paymaster_unavailable` when the address of the paymaster to approve the Gas token to cannot be read, `insufficient_gas_token` when the account's balance of the Gas token is below the fee the paymaster quotes for the operation or the paymaster's simulation cannot charge the fee in it, and `paymaster_rejected` when the paymaster refuses to charge the fee in the Gas token for another reason. |
|
|
635
635
|
|
|
636
636
|
### `FluentBatchOperationExecuteOptions`
|
|
637
637
|
|
|
@@ -1120,9 +1120,11 @@ Literals: `denied`, `no_token`, `not_requested`, `unauthorized`, `unreachable`.
|
|
|
1120
1120
|
*value*
|
|
1121
1121
|
|
|
1122
1122
|
A Gas token payment the widget could not prepare. Thrown by `execute()` of a Fluent ID's Batch
|
|
1123
|
-
operation paid in a Gas token, before any signature is requested and before anything is sent
|
|
1124
|
-
|
|
1125
|
-
|
|
1123
|
+
operation paid in a Gas token, before any signature is requested and before anything is sent.
|
|
1124
|
+
`code`, a `FluentGasPaymentErrorCode`, identifies the failure, and `message` names the Gas
|
|
1125
|
+
token for `insufficient_gas_token` and `paymaster_rejected`; `cause` holds the error of the
|
|
1126
|
+
failed request when there was one. Paying in ETH (`gasPayment: { symbol: "ETH" }`) avoids every
|
|
1127
|
+
code.
|
|
1126
1128
|
|
|
1127
1129
|
```ts declaration
|
|
1128
1130
|
export class FluentGasPaymentError extends Error {
|
|
@@ -1144,14 +1146,20 @@ export class FluentGasPaymentError extends Error {
|
|
|
1144
1146
|
|
|
1145
1147
|
Why a `FluentGasPaymentError` was thrown. `paymaster_unavailable`: the request for the address
|
|
1146
1148
|
of the paymaster that charges Gas tokens on the operation's Network failed, or its answer held
|
|
1147
|
-
no address, so the widget has no spender to approve the Gas token to.
|
|
1148
|
-
|
|
1149
|
+
no address, so the widget has no spender to approve the Gas token to.
|
|
1150
|
+
`insufficient_gas_token`: the account's balance of the Gas token is below the fee the paymaster
|
|
1151
|
+
quotes for the operation, or the paymaster's simulation could not charge the fee in it.
|
|
1152
|
+
`paymaster_rejected`: the paymaster refused to charge the fee in the Gas token for another
|
|
1153
|
+
reason. Keep a `default` branch in a `switch` over it: a later release may add a code.
|
|
1149
1154
|
|
|
1150
1155
|
```ts declaration
|
|
1151
|
-
export type FluentGasPaymentErrorCode =
|
|
1156
|
+
export type FluentGasPaymentErrorCode =
|
|
1157
|
+
| "paymaster_unavailable"
|
|
1158
|
+
| "insufficient_gas_token"
|
|
1159
|
+
| "paymaster_rejected";
|
|
1152
1160
|
```
|
|
1153
1161
|
|
|
1154
|
-
Literals: `paymaster_unavailable`.
|
|
1162
|
+
Literals: `insufficient_gas_token`, `paymaster_rejected`, `paymaster_unavailable`.
|
|
1155
1163
|
|
|
1156
1164
|
## Link X
|
|
1157
1165
|
|
package/docs/errors.md
CHANGED
|
@@ -206,14 +206,20 @@ measured.
|
|
|
206
206
|
|
|
207
207
|
A Fluent ID's Batch operation paid in a Gas token could not be prepared. Before the operation is
|
|
208
208
|
signed, the widget reads the address of the paymaster that charges Gas tokens, because the
|
|
209
|
-
approval it may add to the operation names that paymaster as the spender
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
209
|
+
approval it may add to the operation names that paymaster as the spender; it compares the
|
|
210
|
+
account's balance of the Gas token with the fee the paymaster quotes for the operation; and it
|
|
211
|
+
asks the paymaster to charge the fee in the token. It throws before any signature is requested and
|
|
212
|
+
before anything is sent. A balance or quote the widget cannot read does not throw: the operation
|
|
213
|
+
goes to the paymaster as it is. `cause` holds the error of the failed request when there was one,
|
|
214
|
+
and `message` names the Gas token for `insufficient_gas_token` and `paymaster_rejected`. An
|
|
215
|
+
External wallet pays its own gas and an operation paid in ETH has no Gas token, so neither throws
|
|
216
|
+
it.
|
|
213
217
|
|
|
214
218
|
| `code` | Thrown by | What it means | What to do |
|
|
215
219
|
|---|---|---|---|
|
|
216
220
|
| `paymaster_unavailable` | `execute()` | The request for the paymaster's address on the operation's Network failed, or its answer held no address, so the widget has no spender to approve the Gas token to. | Try again later, or pay in ETH (`gasPayment: { symbol: "ETH" }`). |
|
|
221
|
+
| `insufficient_gas_token` | `execute()` | The account's balance of the Gas token is below the fee the paymaster quotes for the operation, or the paymaster's simulation of the operation could not charge the fee in the token. | Ask the person to pay the fee in ETH (`gasPayment: { symbol: "ETH" }`) or to add more of the Gas token, then send the operation again. The widget's own flows say "Not enough {symbol} to pay the network fee. Pay the fee in ETH or add {symbol}." |
|
|
222
|
+
| `paymaster_rejected` | `execute()` | The paymaster refused to charge the fee in the Gas token for another reason; `cause` holds its answer. | Pay in ETH (`gasPayment: { symbol: "ETH" }`) or try again later; report `cause` if it persists. |
|
|
217
223
|
|
|
218
224
|
## `FluentUserOperationGasError`
|
|
219
225
|
|
package/docs/getting-started.md
CHANGED
|
@@ -86,8 +86,10 @@ Keep `config` stable: a module constant, as here, or a memo. The widget resolves
|
|
|
86
86
|
on every render that passes a new object, and such a render can throw too.
|
|
87
87
|
|
|
88
88
|
After Direct login authenticates a Fluent ID, the widget prepares its Signer even when the
|
|
89
|
-
return from X or Google did not restore the connect dialog.
|
|
90
|
-
|
|
89
|
+
return from X or Google did not restore the connect dialog. Creation does not wait for the
|
|
90
|
+
connected-wallet list to become ready: the authenticated user's linked Signer records identify
|
|
91
|
+
an existing Signer. The Widget account becomes ready after that Signer loads and its smart
|
|
92
|
+
account initializes. A Signer creation failure opens the
|
|
91
93
|
dialog with the provider's error and a **Try again** action; retrying preparation does not start
|
|
92
94
|
another X or Google redirect. A restored External wallet's authentication is not prepared as a
|
|
93
95
|
Fluent ID.
|
|
@@ -180,6 +180,15 @@ allowance the widget cannot read counts as none, and when ZeroDev cannot name th
|
|
|
180
180
|
amount instead, whatever the allowance. The Review lists the operation's own calls, not the
|
|
181
181
|
approval, and an operation paid in ETH or sent by an External wallet gets none.
|
|
182
182
|
|
|
183
|
+
Before an operation paid in a Gas token is signed, the widget also compares the account's balance
|
|
184
|
+
of that token with the fee the paymaster quotes for the operation. A balance below it rejects
|
|
185
|
+
`execute()` with a `FluentGasPaymentError` whose `code` is `insufficient_gas_token` and whose
|
|
186
|
+
`message` names the token; so does a paymaster whose simulation cannot charge the fee in the token,
|
|
187
|
+
and any other refusal by the paymaster rejects with `code` `paymaster_rejected`. Nothing has been
|
|
188
|
+
signed or sent in either case: offer the person the fee in ETH (`gasPayment: { symbol: "ETH" }`)
|
|
189
|
+
or ask them to add more of the token. A balance or quote the widget cannot read does not stop the
|
|
190
|
+
operation. The full list is in [errors.md](../errors.md#fluentgaspaymenterror).
|
|
191
|
+
|
|
183
192
|
Gas limits can be fixed by hand with the experimental `userOperationGas` option
|
|
184
193
|
([experimental.md](../experimental.md#useroperationgas)); leaving it out lets the widget
|
|
185
194
|
estimate.
|
package/docs/internal.md
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# Internal entry
|
|
2
|
+
|
|
3
|
+
> **Nothing on this page is promised.** `@fluent.xyz/connect/internal` is the Internal entry:
|
|
4
|
+
> the helpers the widget is built from, importable by name. Any of them may change or go in any
|
|
5
|
+
> release, a patch included, and none is in [api.md](api.md). The root entry,
|
|
6
|
+
> `@fluent.xyz/connect`, is what is kept after 0.6.0; [experimental.md](experimental.md) says
|
|
7
|
+
> which of its names may still change. Import from here only where you can read this page at
|
|
8
|
+
> every upgrade.
|
|
9
|
+
|
|
10
|
+
The entry exists so that an App which needs the widget's own helpers, such as a wallet
|
|
11
|
+
dashboard that reads balances or builds a transfer without the widget's Send form, imports them
|
|
12
|
+
instead of copying their source, which drifts from the SDK silently. A name an App comes to rely
|
|
13
|
+
on is moved to the root entry, where it becomes a promise; ask for it.
|
|
14
|
+
|
|
15
|
+
| Name | What it is |
|
|
16
|
+
|---|---|
|
|
17
|
+
| `fluentTestnetTokenDefaults`, `fluentMainnetTokenDefaults`, `getFluentTokenDefaultsForNetwork` | The Default tokens of a Network, by symbol. |
|
|
18
|
+
| `getFluentDefaultWidgetDisplayTokens` | The Default tokens in the order the widget shows them. |
|
|
19
|
+
| `isFluentNativeToken`, `fluentTokenIdentity` | Whether a token is the chain's own currency; a token's Token identity. |
|
|
20
|
+
| `readFluentTokenBalances`, `FluentTokenBalance` | One account's balance of each token, read through a viem public client. |
|
|
21
|
+
| `FluentTokenDefinition` | The widget's own token shape, with `native` and `gasPriority`; see below. |
|
|
22
|
+
| `parseFluentTransferRecipient`, `parseFluentTransferAmount`, `FluentTransferRecipient`, `FluentTransferAmount` | The validation of the widget's Send form: a recipient, an amount. |
|
|
23
|
+
| `buildFluentTransferCall`, `fluentTransferAbi` | The one call of a Batch operation that moves a token, and the ERC-20 ABI it encodes with. |
|
|
24
|
+
| `isFaucetNetwork`, `getFluentExplorerBaseUrl` | Whether a Network has a faucet; its block explorer URL. |
|
|
25
|
+
| `normalizeFluentWidgetNetwork` | The Network an App's own setting names (`"prod"`, `"Development"`, …), or `undefined`; the widget reads no environment variable, so the App passes the result as `network`. |
|
|
26
|
+
| `createFluentFamiliesClient`, `FluentFamilies`, `FluentFamily`, `FluentFamilyTier`, `FluentFamilyType`, `FluentFamiliesClient`, `FluentFamiliesClientConfig` | A client of the service's families endpoint, read by the person's Privy DID. |
|
|
27
|
+
| `buildFluentBridgeUrl` | The portal bridge URL with a recipient, for an App that links out to the bridge. |
|
|
28
|
+
|
|
29
|
+
## Two `FluentTokenDefinition`s
|
|
30
|
+
|
|
31
|
+
The root entry's `FluentTokenDefinition` is an Integrator token: what an App passes in `tokens`,
|
|
32
|
+
with no `native` and no `gasPriority`, because the widget grants neither to a token it did not
|
|
33
|
+
declare itself. The Internal entry's `FluentTokenDefinition` is a Default token as the widget
|
|
34
|
+
declares it, and carries both; the helpers above take and return that one. An App that imports
|
|
35
|
+
both renames one:
|
|
36
|
+
|
|
37
|
+
```ts
|
|
38
|
+
import type { FluentTokenDefinition } from "@fluent.xyz/connect";
|
|
39
|
+
import type { FluentTokenDefinition as FluentDefaultToken } from "@fluent.xyz/connect/internal";
|
|
40
|
+
|
|
41
|
+
export function isNative(token: FluentDefaultToken): boolean {
|
|
42
|
+
return token.native === true;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function integratorToken(token: FluentDefaultToken): FluentTokenDefinition {
|
|
46
|
+
const { native: _native, gasPriority: _gasPriority, ...rest } = token;
|
|
47
|
+
return rest;
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Reading balances
|
|
52
|
+
|
|
53
|
+
```ts
|
|
54
|
+
import { createPublicClient, http, type Address } from "viem";
|
|
55
|
+
import { fluentTestnet } from "@fluent.xyz/connect";
|
|
56
|
+
import {
|
|
57
|
+
getFluentDefaultWidgetDisplayTokens,
|
|
58
|
+
readFluentTokenBalances,
|
|
59
|
+
} from "@fluent.xyz/connect/internal";
|
|
60
|
+
|
|
61
|
+
const client = createPublicClient({ chain: fluentTestnet, transport: http() });
|
|
62
|
+
|
|
63
|
+
export async function balancesOf(account: Address) {
|
|
64
|
+
const balances = await readFluentTokenBalances({
|
|
65
|
+
client,
|
|
66
|
+
account,
|
|
67
|
+
tokens: getFluentDefaultWidgetDisplayTokens("testnet"),
|
|
68
|
+
});
|
|
69
|
+
return balances.filter((balance) => balance.status === "ready");
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Building a transfer
|
|
74
|
+
|
|
75
|
+
The call goes to the Widget API's `execute()` like any other; the widget's Send form does the
|
|
76
|
+
same.
|
|
77
|
+
|
|
78
|
+
```ts
|
|
79
|
+
import type { FluentBatchCallInput } from "@fluent.xyz/connect";
|
|
80
|
+
import {
|
|
81
|
+
buildFluentTransferCall,
|
|
82
|
+
fluentMainnetTokenDefaults,
|
|
83
|
+
parseFluentTransferAmount,
|
|
84
|
+
parseFluentTransferRecipient,
|
|
85
|
+
} from "@fluent.xyz/connect/internal";
|
|
86
|
+
|
|
87
|
+
export function transferCall(params: {
|
|
88
|
+
from: `0x${string}`;
|
|
89
|
+
to: string;
|
|
90
|
+
amount: string;
|
|
91
|
+
balance: bigint;
|
|
92
|
+
}): FluentBatchCallInput | string {
|
|
93
|
+
const token = fluentMainnetTokenDefaults.BLEND;
|
|
94
|
+
const recipient = parseFluentTransferRecipient({
|
|
95
|
+
input: params.to,
|
|
96
|
+
self: params.from,
|
|
97
|
+
contracts: new Set([token.address.toLowerCase()]),
|
|
98
|
+
});
|
|
99
|
+
if (recipient.status !== "ok") return recipient.status === "empty" ? "" : recipient.message;
|
|
100
|
+
const amount = parseFluentTransferAmount({
|
|
101
|
+
input: params.amount,
|
|
102
|
+
symbol: token.symbol,
|
|
103
|
+
decimals: token.decimals,
|
|
104
|
+
balance: params.balance,
|
|
105
|
+
});
|
|
106
|
+
if (amount.status !== "ok") return amount.status === "empty" ? "" : amount.message;
|
|
107
|
+
return buildFluentTransferCall({ token, to: recipient.address, amount: amount.raw });
|
|
108
|
+
}
|
|
109
|
+
```
|
package/docs/upgrading-0.5.md
CHANGED
|
@@ -165,7 +165,8 @@ export function chainDefinitionOf(network: FluentWidgetNetwork) {
|
|
|
165
165
|
#### Recipe: `getFluentExplorerBaseUrl`
|
|
166
166
|
|
|
167
167
|
0.5's `getFluentExplorerBaseUrl(network)` was this expression. Like it, it returns testnet's
|
|
168
|
-
explorer for any value other than `"mainnet"`.
|
|
168
|
+
explorer for any value other than `"mainnet"`. The Internal entry exports the function itself
|
|
169
|
+
([Recipe: the Internal entry](#recipe-the-internal-entry)).
|
|
169
170
|
|
|
170
171
|
```ts
|
|
171
172
|
import { getFluentChainForNetwork, type FluentWidgetNetwork } from "@fluent.xyz/connect";
|
|
@@ -179,9 +180,10 @@ export function explorerBaseUrlOf(network: FluentWidgetNetwork): string | undefi
|
|
|
179
180
|
|
|
180
181
|
| Removed | Kind | Use instead |
|
|
181
182
|
|---|---|---|
|
|
182
|
-
| `normalizeFluentWidgetNetwork` |
|
|
183
|
+
| `normalizeFluentWidgetNetwork` | recipe | [Recipe: the Internal entry](#recipe-the-internal-entry) |
|
|
183
184
|
| `resolveFluentWidgetNetworkFromEnv` | none | The widget reads no environment variable; the App passes `network`. |
|
|
184
|
-
| `FluentWidgetNetworkProvider`, `useFluentWidgetNetwork
|
|
185
|
+
| `FluentWidgetNetworkProvider`, `useFluentWidgetNetwork` | none | Internal: the App passes `network` itself, so it already knows it. |
|
|
186
|
+
| `isFaucetNetwork` | recipe | [Recipe: the Internal entry](#recipe-the-internal-entry) |
|
|
185
187
|
| `ResolvedFluentWidgetConfig`, `ResolvedFluentWidgetExecution` | none | There is no public resolved config. |
|
|
186
188
|
| `FLUENT_CONNECT_DEFAULT_ASSETS` | none | The widget's default images are internal. |
|
|
187
189
|
|
|
@@ -198,16 +200,45 @@ export function explorerBaseUrlOf(network: FluentWidgetNetwork): string | undefi
|
|
|
198
200
|
|
|
199
201
|
| Removed | Kind | Use instead |
|
|
200
202
|
|---|---|---|
|
|
201
|
-
| `fluent`, `createFluentClient`, `FluentClient`, `FluentClientConfig
|
|
203
|
+
| `fluent`, `createFluentClient`, `FluentClient`, `FluentClientConfig` | none | The feature is removed: the standalone client. |
|
|
204
|
+
| `createFluentFamiliesClient`, `FluentFamilies`, `FluentFamiliesClient`, `FluentFamiliesClientConfig`, `FluentFamily`, `FluentFamilyTier`, `FluentFamilyType` | recipe | [Recipe: the Internal entry](#recipe-the-internal-entry) |
|
|
202
205
|
|
|
203
206
|
### Tokens and balances
|
|
204
207
|
|
|
205
208
|
| Removed | Kind | Use instead |
|
|
206
209
|
|---|---|---|
|
|
207
|
-
| `
|
|
208
|
-
| `
|
|
210
|
+
| `getFluentTokenDefaults`, `getFluentDefaultWidgetGasTokens`, `isFluentDefaultToken`, `mergeFluentDisplayTokens`, `findFluentSymbolCollisions` | none | The widget does this itself: it lists its Default tokens beside the App's `tokens`. |
|
|
211
|
+
| `fluentMainnetTokenDefaults`, `fluentTestnetTokenDefaults`, `getFluentTokenDefaultsForNetwork`, `getFluentDefaultWidgetDisplayTokens`, `isFluentNativeToken`, `fluentTokenIdentity` | recipe | [Recipe: the Internal entry](#recipe-the-internal-entry) |
|
|
212
|
+
| `readFluentTokenMetadata` | none | The widget reads balances itself; `refreshBalances` refetches them. |
|
|
213
|
+
| `readFluentTokenBalances`, `FluentTokenBalance` | recipe | [Recipe: the Internal entry](#recipe-the-internal-entry) |
|
|
209
214
|
| `FLUENT_USER_TOKEN_LIMIT`, `createFluentUserTokenStore`, `createFluentBackendUserTokenStore`, `useFluentUserTokens`, `UserTokenStore`, `BackendUserTokenStore`, `FluentUserTokenAddResult` | none | The widget keeps the person's User tokens itself. |
|
|
210
215
|
|
|
216
|
+
#### Recipe: the Internal entry
|
|
217
|
+
|
|
218
|
+
Every row that points here names a helper 0.6.0 removed from the root entry and the package
|
|
219
|
+
publishes again, promised nothing, as the Internal entry, `@fluent.xyz/connect/internal`
|
|
220
|
+
([internal.md](internal.md)): the name is the same, so the import path is all that changes. A
|
|
221
|
+
name there may change or go in any release; read that page at every upgrade.
|
|
222
|
+
|
|
223
|
+
```ts
|
|
224
|
+
import { createPublicClient, http, type Address } from "viem";
|
|
225
|
+
import { fluentTestnet } from "@fluent.xyz/connect";
|
|
226
|
+
import {
|
|
227
|
+
getFluentDefaultWidgetDisplayTokens,
|
|
228
|
+
readFluentTokenBalances,
|
|
229
|
+
} from "@fluent.xyz/connect/internal";
|
|
230
|
+
|
|
231
|
+
const client = createPublicClient({ chain: fluentTestnet, transport: http() });
|
|
232
|
+
|
|
233
|
+
export function balancesOf(account: Address) {
|
|
234
|
+
return readFluentTokenBalances({
|
|
235
|
+
client,
|
|
236
|
+
account,
|
|
237
|
+
tokens: getFluentDefaultWidgetDisplayTokens("testnet"),
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
```
|
|
241
|
+
|
|
211
242
|
### Gas payment
|
|
212
243
|
|
|
213
244
|
| Removed | Kind | Use instead |
|
|
@@ -219,7 +250,8 @@ export function explorerBaseUrlOf(network: FluentWidgetNetwork): string | undefi
|
|
|
219
250
|
|
|
220
251
|
| Removed | Kind | Use instead |
|
|
221
252
|
|---|---|---|
|
|
222
|
-
| `
|
|
253
|
+
| `checkFluentTransferFee`, `FluentTokenTransferOutcome`, `FluentTokenTransferRequest`, `FluentTokenTransferSender`, `FluentTransferFee` | none | Internal to the widget's Send form. |
|
|
254
|
+
| `buildFluentTransferCall`, `fluentTransferAbi`, `parseFluentTransferAmount`, `parseFluentTransferRecipient`, `FluentTransferAmount`, `FluentTransferRecipient` | recipe | [Recipe: the Internal entry](#recipe-the-internal-entry) |
|
|
223
255
|
|
|
224
256
|
### User settings
|
|
225
257
|
|
|
@@ -301,7 +333,7 @@ export function signingModeOf(confirmation: "always" | "session"): FluentSigning
|
|
|
301
333
|
|
|
302
334
|
| Member | Kind | Use instead |
|
|
303
335
|
|---|---|---|
|
|
304
|
-
| `FluentTokenDefinition.gasPriority`, `FluentTokenDefinition.native` | none | The widget already ignored both on a token the App passed: only a Default token can be a Gas token or the chain's own currency. |
|
|
336
|
+
| `FluentTokenDefinition.gasPriority`, `FluentTokenDefinition.native` | none | The widget already ignored both on a token the App passed: only a Default token can be a Gas token or the chain's own currency. The Internal entry's `FluentTokenDefinition`, the Default token's shape, keeps both ([internal.md](internal.md#two-fluenttokendefinitions)). |
|
|
305
337
|
|
|
306
338
|
### `FluentWidgetAccount`
|
|
307
339
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluent.xyz/connect",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.4",
|
|
4
4
|
"description": "Fluent Connect React widget \u2014 Privy login, ZeroDev smart account, batch operations, and wallet UI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -41,6 +41,10 @@
|
|
|
41
41
|
"types": "./dist/index.d.ts",
|
|
42
42
|
"import": "./dist/index.js"
|
|
43
43
|
},
|
|
44
|
+
"./internal": {
|
|
45
|
+
"types": "./dist/internal.d.ts",
|
|
46
|
+
"import": "./dist/internal.js"
|
|
47
|
+
},
|
|
44
48
|
"./styles.css": "./dist/fluent-connect.css",
|
|
45
49
|
"./package.json": "./package.json"
|
|
46
50
|
},
|