@fluent.xyz/connect 0.5.0 → 0.5.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/INTEGRATION.md +38 -15
- package/README.md +12 -8
- package/dist/index.d.ts +16 -11
- package/dist/index.js +97 -65
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/INTEGRATION.md
CHANGED
|
@@ -605,8 +605,6 @@ await widget.createBatchOp({ calls }).execute({
|
|
|
605
605
|
callGasLimit: 600_000n,
|
|
606
606
|
verificationGasLimit: 500_000n,
|
|
607
607
|
preVerificationGas: 100_000n,
|
|
608
|
-
paymasterVerificationGasLimit: 100_000n,
|
|
609
|
-
paymasterPostOpGasLimit: 50_000n,
|
|
610
608
|
},
|
|
611
609
|
});
|
|
612
610
|
```
|
|
@@ -617,24 +615,37 @@ and `eth_estimateUserOperationGas` for sponsored, native-gas and ERC-20-gas
|
|
|
617
615
|
UserOperations, including native-gas fallback after sponsorship fails. External
|
|
618
616
|
wallet transactions keep their wallet's estimation.
|
|
619
617
|
|
|
620
|
-
Supply all three account limits.
|
|
621
|
-
|
|
618
|
+
Supply all three account limits. With a paymaster, omit both paymaster limits to
|
|
619
|
+
use the provider's validation and post-operation limits. Its returned
|
|
620
|
+
`preVerificationGas` is accepted up to your configured value; a larger value
|
|
621
|
+
fails before signing. Execution and account-validation limits stay fixed. The
|
|
622
|
+
provider must return complete paymaster limits in its first response; later
|
|
623
|
+
authorization may keep or replace them. The SDK preserves the authorized values
|
|
624
|
+
through signing without invoking the account gas hook or bundler gas estimator.
|
|
625
|
+
|
|
626
|
+
Alternatively, supply both `paymasterVerificationGasLimit` and
|
|
627
|
+
`paymasterPostOpGasLimit` to fix every gas field, as in 0.5.0. When a paymaster is
|
|
628
|
+
used, supplying only one fails before authorization. Limits are bigints:
|
|
629
|
+
`preVerificationGas` must fit a positive
|
|
622
630
|
uint256, `paymasterPostOpGasLimit` a nonnegative uint128, and the others a positive
|
|
623
631
|
uint128. `callGasBuffer` cannot be combined with `skipEstimation: true`.
|
|
624
632
|
Gas-policy validation reports `FluentUserOperationGasError` with code
|
|
625
633
|
`invalid_policy` and names the option to correct.
|
|
626
634
|
|
|
627
635
|
The example values are illustrative. Choose limits that cover the complete batch,
|
|
628
|
-
including a prepended Gas token approval
|
|
629
|
-
paymaster execution. The SDK does not verify
|
|
630
|
-
an underestimated operation can be rejected
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
authorization.
|
|
636
|
+
including a prepended Gas token approval and account validation or deployment.
|
|
637
|
+
Fixed paymaster limits must cover paymaster execution. The SDK does not verify
|
|
638
|
+
that these budgets are sufficient; an underestimated operation can be rejected
|
|
639
|
+
or fail during execution.
|
|
640
|
+
|
|
641
|
+
The SDK supplies account gas before paymaster authorization. A data-only adapter's
|
|
642
|
+
authorization or a stub marked final is reused; a nonfinal stub still requires
|
|
643
|
+
final authorization. A changed execution or account-validation limit fails that
|
|
636
644
|
attempt before signing with `FluentUserOperationGasError` code
|
|
637
|
-
`paymaster_gas_mismatch`.
|
|
645
|
+
`paymaster_gas_mismatch`. With both paymaster limits fixed, any changed gas field
|
|
646
|
+
fails the same way. Malformed provider gas and calldata overhead above the
|
|
647
|
+
configured ceiling also fail before signing. Normal sponsorship fallback still
|
|
648
|
+
applies, with the configured account limits and no gas estimation.
|
|
638
649
|
|
|
639
650
|
This flag does not disable fee quotes, nonce or factory reads, paymaster
|
|
640
651
|
authorization, signing, bundler submission checks or receipt waiting. A paymaster
|
|
@@ -716,8 +727,8 @@ ZeroDev on its own and inside the send that needed it:
|
|
|
716
727
|
A bundler may refuse an operation whose `maxFeePerGas` or `maxPriorityFeePerGas` is below what
|
|
717
728
|
it will accept. That one rejection is retried once, inside the same send, whichever source
|
|
718
729
|
quoted the attempt it refused: the operation is prepared again with a fresh
|
|
719
|
-
`zd_getUserOperationGasPrice` quote, signed again
|
|
720
|
-
|
|
730
|
+
`zd_getUserOperationGasPrice` quote, signed again without a second review, and submitted a
|
|
731
|
+
second time. A second refusal is the bundler's answer to the bundler's own quote and reaches your
|
|
721
732
|
`catch` unchanged, after exactly two submissions. Nothing is remembered: the next send asks the
|
|
722
733
|
chain first again.
|
|
723
734
|
|
|
@@ -1061,6 +1072,18 @@ auth service. Your backend needs no Fluent SDK to check it:
|
|
|
1061
1072
|
4. Use `sub` as the user id. Read `addresses.account` only if your App has the `addresses`
|
|
1062
1073
|
scope, and only for on-chain joins.
|
|
1063
1074
|
|
|
1075
|
+
The issuer is **per network**, and no single rule derives it from the API host the widget calls.
|
|
1076
|
+
Pin the one your widget's `network` says, and read its key set from that issuer:
|
|
1077
|
+
|
|
1078
|
+
| `network` | `iss` | Key set |
|
|
1079
|
+
|-------------|-------|---------|
|
|
1080
|
+
| `"mainnet"` | `https://api.fluent.xyz/connect` | `https://api.fluent.xyz/connect/.well-known/jwks.json` |
|
|
1081
|
+
| `"testnet"` | `https://api.fluent-connect.dev.gblend.xyz` | `https://api.fluent-connect.dev.gblend.xyz/.well-known/jwks.json` |
|
|
1082
|
+
|
|
1083
|
+
Each issuer publishes its own key set, so a backend serving both networks pins both issuers and
|
|
1084
|
+
picks the one it expects for that App — not the `iss` the token carries, which is the value
|
|
1085
|
+
being checked.
|
|
1086
|
+
|
|
1064
1087
|
Go, with the same two libraries the Fluent auth service uses:
|
|
1065
1088
|
|
|
1066
1089
|
```go
|
package/README.md
CHANGED
|
@@ -92,9 +92,13 @@ leaving it. External wallets connect through Reown AppKit beside it.
|
|
|
92
92
|
|
|
93
93
|
`getAuthToken()` (render context / `useFluentWidget()`) returns a 5-minute ES256 JWT signed by
|
|
94
94
|
Fluent Connect. Send it to your backend once and issue your own session; verify it with the keys
|
|
95
|
-
at `<iss>/.well-known/jwks.json`
|
|
96
|
-
|
|
97
|
-
|
|
95
|
+
at `<iss>/.well-known/jwks.json` and check `iss`, `aud` (your `appId`) and `exp`. The issuer is
|
|
96
|
+
per network, and no single rule derives it from the API host: on `testnet` it is
|
|
97
|
+
`https://api.fluent-connect.dev.gblend.xyz`, on `mainnet` `https://api.fluent.xyz/connect`, whose
|
|
98
|
+
key set is `https://api.fluent.xyz/connect/.well-known/jwks.json`. Pin the issuer of the network
|
|
99
|
+
your widget runs on — [`INTEGRATION.md` §8b](INTEGRATION.md#8b-verify-the-token-on-your-backend).
|
|
100
|
+
`sub` is stable per user per app. `addresses` is present only when your app has the `addresses`
|
|
101
|
+
scope. A Fluent ID and an external wallet both get a token —
|
|
98
102
|
for a wallet, an EOA or a deployed contract wallet signs in; a counterfactual smart account
|
|
99
103
|
cannot (no ERC-6492).
|
|
100
104
|
The token renews itself silently for both account types — against a service that issues the
|
|
@@ -240,16 +244,16 @@ await widget.createBatchOp({ calls }).execute({
|
|
|
240
244
|
callGasLimit: 600_000n,
|
|
241
245
|
verificationGasLimit: 500_000n,
|
|
242
246
|
preVerificationGas: 100_000n,
|
|
243
|
-
paymasterVerificationGasLimit: 100_000n,
|
|
244
|
-
paymasterPostOpGasLimit: 50_000n,
|
|
245
247
|
},
|
|
246
248
|
});
|
|
247
249
|
```
|
|
248
250
|
|
|
249
251
|
This skips the account gas hook and `eth_estimateUserOperationGas`. Supply budgets
|
|
250
|
-
for the complete batch
|
|
251
|
-
illustrative.
|
|
252
|
-
|
|
252
|
+
for the complete batch and account deployment; the example values are
|
|
253
|
+
illustrative. Omit both paymaster limits to use the provider's authorized limits
|
|
254
|
+
and calldata overhead up to `preVerificationGas`, without SDK gas estimation.
|
|
255
|
+
Supply both limits to require an exact match for every gas field, as in 0.5.0.
|
|
256
|
+
The default is `skipEstimation: false`; a fixed `callGasLimit` alone
|
|
253
257
|
still allows other gas fields to be estimated. See
|
|
254
258
|
[`INTEGRATION.md` §7](INTEGRATION.md#skipping-useroperation-gas-estimation) for validation,
|
|
255
259
|
authorization and remaining network requests.
|
package/dist/index.d.ts
CHANGED
|
@@ -1744,12 +1744,6 @@ declare function createFluentZeroDevPermissionSession(params: {
|
|
|
1744
1744
|
calls: readonly FluentZeroDevPermissionCall[];
|
|
1745
1745
|
expiresAt?: number;
|
|
1746
1746
|
}): Promise<FluentZeroDevPermissionSession>;
|
|
1747
|
-
/**
|
|
1748
|
-
* Runs `sign` with the Privy prompt worded for a plain signature rather than a
|
|
1749
|
-
* UserOperation. The prompt kernel's signer reads a module-level context because
|
|
1750
|
-
* the signer is built once per mode, while the wording is per call.
|
|
1751
|
-
*/
|
|
1752
|
-
declare function withFluentSignaturePrompt<T>(sign: () => Promise<T>): Promise<T>;
|
|
1753
1747
|
|
|
1754
1748
|
type FluentPermissionArgConstraint = {
|
|
1755
1749
|
equals: unknown;
|
|
@@ -1848,18 +1842,19 @@ type FixedAccountGas = {
|
|
|
1848
1842
|
callGasLimit: bigint;
|
|
1849
1843
|
/** Account validation and deployment budget. Positive uint128. */
|
|
1850
1844
|
verificationGasLimit: bigint;
|
|
1851
|
-
/** Calldata
|
|
1845
|
+
/** Calldata overhead, or its ceiling with provider-owned paymaster gas. Positive uint256. */
|
|
1852
1846
|
preVerificationGas: bigint;
|
|
1853
1847
|
};
|
|
1854
1848
|
type FixedPaymasterGas = {
|
|
1855
|
-
/**
|
|
1849
|
+
/** Fixed validation budget, a positive uint128. Omit both paymaster limits to use its answer. */
|
|
1856
1850
|
paymasterVerificationGasLimit?: bigint;
|
|
1857
|
-
/**
|
|
1851
|
+
/** Fixed post-operation budget, a nonnegative uint128. Supplied together with validation. */
|
|
1858
1852
|
paymasterPostOpGasLimit?: bigint;
|
|
1859
1853
|
};
|
|
1860
1854
|
/**
|
|
1861
1855
|
* Gas policy for a Fluent ID batch. Estimation is enabled unless `skipEstimation` is true.
|
|
1862
|
-
* Skipping requires
|
|
1856
|
+
* Skipping requires account limits. Omit both paymaster limits to use provider-authorized
|
|
1857
|
+
* paymaster gas and calldata overhead within `preVerificationGas`; supply both to fix all gas.
|
|
1863
1858
|
*/
|
|
1864
1859
|
type FluentUserOperationGas = (FixedAccountGas & FixedPaymasterGas & {
|
|
1865
1860
|
/** Skip the account gas hook and bundler gas estimation. Defaults to false. */
|
|
@@ -2835,6 +2830,16 @@ type FluentZeroDevPaymasterDemoResult = {
|
|
|
2835
2830
|
transactionHash: Hash;
|
|
2836
2831
|
userOpHash: Hash;
|
|
2837
2832
|
};
|
|
2833
|
+
/**
|
|
2834
|
+
* The ZeroDev bundler URL for one chain. `chainId` defaults to Fluent Testnet, and `projectId`
|
|
2835
|
+
* to the Fluent ZeroDev project of the network that chain id belongs to — the testnet project
|
|
2836
|
+
* for 20994, the production one for 25363 — so a host that passes a chain id gets that
|
|
2837
|
+
* network's project without naming it. Pass `projectId` to use your own ZeroDev project, and
|
|
2838
|
+
* `selfFunded` for the ERC-20 paymaster form.
|
|
2839
|
+
*
|
|
2840
|
+
* @example
|
|
2841
|
+
* const rpcUrl = createFluentZeroDevRpcUrl({ chainId: 25363 });
|
|
2842
|
+
*/
|
|
2838
2843
|
declare function createFluentZeroDevRpcUrl(params?: {
|
|
2839
2844
|
chainId?: number;
|
|
2840
2845
|
projectId?: string;
|
|
@@ -3244,4 +3249,4 @@ type AccountAvatarProps = {
|
|
|
3244
3249
|
*/
|
|
3245
3250
|
declare function AccountAvatar({ userLogoUrl, defaultLogoUrl, className }: AccountAvatarProps): React.JSX.Element;
|
|
3246
3251
|
|
|
3247
|
-
export { AccountAvatar, type AccountAvatarProps, type AppDefinition, type BackendUserTokenStore, type BridgeAddresses, Button, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, FLUENT_CONNECT_DEFAULT_ASSETS, FLUENT_GAS_PAYMENT_DEFAULT_ETH_RATES, FLUENT_USER_TOKEN_LIMIT, FLUENT_WIDGET_DEFAULT_GAS_TOKEN, FLUENT_WIDGET_SESSION_STORAGE_KEY, FLUENT_WIDGET_USER_TOKENS_IMPORT_MARKER_KEY, FLUENT_WIDGET_USER_TOKENS_STORAGE_KEY, FLUENT_ZERODEV_ERC20_PAYMASTER_QUERY, FLUENT_ZERODEV_PAYMASTER_DEMO_RECIPIENT, type FluentAccountCapabilities, FluentAccountDrawer, type FluentAccountType, FluentAuthError, type FluentAuthErrorCode, type FluentBatchApi, type FluentBatchCallInput, type FluentBatchConfirmationMode, type FluentBatchOperation, type FluentBatchOperationExecuteOptions, type FluentBatchOperationExecutor, type FluentBatchOperationInput, type FluentBatchOperationReview, type FluentCallPermission, type FluentChainDefinition, type FluentClient, type FluentClientConfig, type FluentEncodedBatchCall, type FluentExecuteResult, type FluentExecuteTiming, type FluentExecuteTimingInstants, type FluentExternalWalletState, type FluentFamilies, type FluentFamiliesClient, type FluentFamiliesClientConfig, type FluentFamily, type FluentFamilyTier, type FluentFamilyType, type FluentGasPayment, type FluentGasPaymentEthRates, type FluentGasPaymentSelection, type FluentGasPaymentValueTier, type FluentGasTokenSymbol, type FluentIframeBridge, type FluentIframeBridgeOptions, type FluentIframeElement, FluentIframeRpcError, type FluentIframeRpcExecutor, type FluentIframeRpcHandler, type FluentIframeRpcRequest, type FluentLinkXResult, type FluentPermissionApi, type FluentPermissionArgConstraint, type FluentPermissionArgs, type FluentPermissionBatchPolicy, type FluentPermissionBatchPolicyInput, type FluentPermissionCallInput, type FluentPermissionCallPolicy, type FluentPermissionClient, type FluentPermissionClientConfig, type FluentPermissionGrant, type FluentPermissionGrantRequest, type FluentPermissionPolicy, type FluentPermissionPolicyBuilders, type FluentPermissionPreview, type FluentPermissionSession, type FluentPermissionSessionExecutor, type FluentPermissionSessionInput, type FluentPermissionStatus, FluentPortalContainerProvider, type FluentPrivyAdapter, type FluentProfile, FluentReviewRejectedError, type FluentSession, type FluentSettingsClient, FluentSettingsError, type FluentSettingsErrorCode, type FluentSignApi, type FluentSignatureReview, type FluentSpendPeriod, type FluentSpendPermission, FluentSponsorshipFallbackError, type FluentSponsorshipReason, type FluentTokenBalance, type FluentTokenDefinition, type FluentTokenTransferOutcome, type FluentTokenTransferRequest, type FluentTokenTransferSender, type FluentTransferAmount, type FluentTransferFee, type FluentTransferRecipient, type FluentTypedDataRequest, type FluentUserOperationGas, FluentUserOperationGasError, type FluentUserOperationGasErrorCode, type FluentUserSettings, type FluentUserSettingsPatch, type FluentUserTokenAddResult, type FluentWalletChoice, FluentWidget, type FluentWidgetAccount, type FluentWidgetAuthMethod, type FluentWidgetConfig, FluentWidgetConfigError, type FluentWidgetConfigErrorCode, FluentWidgetConnectButton, type FluentWidgetConnectButtonProps, type FluentWidgetConnectButtonRenderContext, type FluentWidgetExecution, type FluentWidgetExecutionSource, type FluentWidgetExecutionStatus, type FluentWidgetGasPayment, type FluentWidgetNetwork, FluentWidgetNetworkProvider, type FluentWidgetProps, type FluentWidgetRenderContext, type FluentWidgetSession, type FluentWidgetStatus, type FluentXAccount, type FluentZeroDevErc20PaymasterToken, type FluentZeroDevErc20PaymasterTokenInfo, type FluentZeroDevKernel, type FluentZeroDevPaymasterDemoResult, type FluentZeroDevPaymasterKernel, type FluentZeroDevPermissionCall, type FluentZeroDevPermissionSession, type FluentZeroDevSignerMode, type FluentZeroDevSponsorshipTokenSource, Icon, type IconName, type L1ChainDefinition, Label, type ResolvedFluentWidgetConfig, type ResolvedFluentWidgetExecution, Separator, Switch, type UseFluentIframeBridgeOptions, type UserTokenStore, WIDGET_STYLE_SCOPE, WalletMenuActionCard, type ZerodevIntegration, buildFluentTransferCall, buttonVariants, checkFluentTransferFee, clearPrivyRecentLoginMethod, createFluentBackendUserTokenStore, createFluentBatchOp, createFluentClient, createFluentFamiliesClient, createFluentIframeBridge, createFluentIframeRpcHandler, createFluentPermissionApi, createFluentPermissionClient, createFluentPermissionPolicyBuilders, createFluentPermissionSession, createFluentSettingsClient, createFluentSponsorshipRpcUrl, createFluentUserTokenStore, createFluentZeroDevErc20Paymaster, createFluentZeroDevErc20PaymasterApprovalCall, createFluentZeroDevErc20PaymasterClient, createFluentZeroDevErc20PaymasterRpcUrl, createFluentZeroDevPermissionSession, createFluentZeroDevRpcUrl, createFluentZeroDevSponsoredPaymaster, deriveFluentGasEthRates, findFluentSymbolCollisions, fluent, apps as fluentApps, fluentBridgeAbi, fluent$1 as fluentChain, fluentChains, fluentDefinitionToViemChain, integrations as fluentIntegrations, l1Chains as fluentL1Chains, fluentMainnet, fluentMainnetTokenDefaults, fluentTestnet, fluentTestnetTokenDefaults, fluentTokenIdentity, fluentTransferAbi, fluentZeroDevChainIds, getApp, getContractAddressFromChain, getFluentChain, getFluentChainByChainId, getFluentChainForNetwork, getFluentDefaultWidgetDisplayTokens, getFluentDefaultWidgetGasTokens, getFluentExplorerBaseUrl, getFluentGasPaymentEthValue, getFluentGasPaymentTokens, getFluentGasPaymentValueTier, getFluentGasTokenAddress, getFluentTokenDefaults, getFluentTokenDefaultsForNetwork, getFluentZeroDevErc20PaymasterTokens, getL1Chain, getL1ForFluentChain, getZeroDevRpcUrl, getZerodevIntegration, isFaucetNetwork, isFluentDefaultToken, isFluentNativeToken, isFluentZeroDevChain, l1DefinitionToViemChain, mergeFluentDisplayTokens, normalizeFluentWidgetNetwork, parseFluentTransferAmount, parseFluentTransferRecipient, readFluentTokenBalances, readFluentTokenMetadata, registryVersion, resolveBridgeAddresses, resolveDefaultGasToken, resolveFluentWidgetNetworkFromEnv, resolveFluentZeroDevErc20PaymasterToken, resolveL1Definition, selectFluentGasPaymentToken, sendFluentZeroDevErc20PaymasterDemo, sortFluentGasTokens, useFluentIframeBridge, useFluentUserTokens, useFluentWidget, useFluentWidgetNetwork, useFluentZeroDevAccount, useLinkX, useWidget
|
|
3252
|
+
export { AccountAvatar, type AccountAvatarProps, type AppDefinition, type BackendUserTokenStore, type BridgeAddresses, Button, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, FLUENT_CONNECT_DEFAULT_ASSETS, FLUENT_GAS_PAYMENT_DEFAULT_ETH_RATES, FLUENT_USER_TOKEN_LIMIT, FLUENT_WIDGET_DEFAULT_GAS_TOKEN, FLUENT_WIDGET_SESSION_STORAGE_KEY, FLUENT_WIDGET_USER_TOKENS_IMPORT_MARKER_KEY, FLUENT_WIDGET_USER_TOKENS_STORAGE_KEY, FLUENT_ZERODEV_ERC20_PAYMASTER_QUERY, FLUENT_ZERODEV_PAYMASTER_DEMO_RECIPIENT, type FluentAccountCapabilities, FluentAccountDrawer, type FluentAccountType, FluentAuthError, type FluentAuthErrorCode, type FluentBatchApi, type FluentBatchCallInput, type FluentBatchConfirmationMode, type FluentBatchOperation, type FluentBatchOperationExecuteOptions, type FluentBatchOperationExecutor, type FluentBatchOperationInput, type FluentBatchOperationReview, type FluentCallPermission, type FluentChainDefinition, type FluentClient, type FluentClientConfig, type FluentEncodedBatchCall, type FluentExecuteResult, type FluentExecuteTiming, type FluentExecuteTimingInstants, type FluentExternalWalletState, type FluentFamilies, type FluentFamiliesClient, type FluentFamiliesClientConfig, type FluentFamily, type FluentFamilyTier, type FluentFamilyType, type FluentGasPayment, type FluentGasPaymentEthRates, type FluentGasPaymentSelection, type FluentGasPaymentValueTier, type FluentGasTokenSymbol, type FluentIframeBridge, type FluentIframeBridgeOptions, type FluentIframeElement, FluentIframeRpcError, type FluentIframeRpcExecutor, type FluentIframeRpcHandler, type FluentIframeRpcRequest, type FluentLinkXResult, type FluentPermissionApi, type FluentPermissionArgConstraint, type FluentPermissionArgs, type FluentPermissionBatchPolicy, type FluentPermissionBatchPolicyInput, type FluentPermissionCallInput, type FluentPermissionCallPolicy, type FluentPermissionClient, type FluentPermissionClientConfig, type FluentPermissionGrant, type FluentPermissionGrantRequest, type FluentPermissionPolicy, type FluentPermissionPolicyBuilders, type FluentPermissionPreview, type FluentPermissionSession, type FluentPermissionSessionExecutor, type FluentPermissionSessionInput, type FluentPermissionStatus, FluentPortalContainerProvider, type FluentPrivyAdapter, type FluentProfile, FluentReviewRejectedError, type FluentSession, type FluentSettingsClient, FluentSettingsError, type FluentSettingsErrorCode, type FluentSignApi, type FluentSignatureReview, type FluentSpendPeriod, type FluentSpendPermission, FluentSponsorshipFallbackError, type FluentSponsorshipReason, type FluentTokenBalance, type FluentTokenDefinition, type FluentTokenTransferOutcome, type FluentTokenTransferRequest, type FluentTokenTransferSender, type FluentTransferAmount, type FluentTransferFee, type FluentTransferRecipient, type FluentTypedDataRequest, type FluentUserOperationGas, FluentUserOperationGasError, type FluentUserOperationGasErrorCode, type FluentUserSettings, type FluentUserSettingsPatch, type FluentUserTokenAddResult, type FluentWalletChoice, FluentWidget, type FluentWidgetAccount, type FluentWidgetAuthMethod, type FluentWidgetConfig, FluentWidgetConfigError, type FluentWidgetConfigErrorCode, FluentWidgetConnectButton, type FluentWidgetConnectButtonProps, type FluentWidgetConnectButtonRenderContext, type FluentWidgetExecution, type FluentWidgetExecutionSource, type FluentWidgetExecutionStatus, type FluentWidgetGasPayment, type FluentWidgetNetwork, FluentWidgetNetworkProvider, type FluentWidgetProps, type FluentWidgetRenderContext, type FluentWidgetSession, type FluentWidgetStatus, type FluentXAccount, type FluentZeroDevErc20PaymasterToken, type FluentZeroDevErc20PaymasterTokenInfo, type FluentZeroDevKernel, type FluentZeroDevPaymasterDemoResult, type FluentZeroDevPaymasterKernel, type FluentZeroDevPermissionCall, type FluentZeroDevPermissionSession, type FluentZeroDevSignerMode, type FluentZeroDevSponsorshipTokenSource, Icon, type IconName, type L1ChainDefinition, Label, type ResolvedFluentWidgetConfig, type ResolvedFluentWidgetExecution, Separator, Switch, type UseFluentIframeBridgeOptions, type UserTokenStore, WIDGET_STYLE_SCOPE, WalletMenuActionCard, type ZerodevIntegration, buildFluentTransferCall, buttonVariants, checkFluentTransferFee, clearPrivyRecentLoginMethod, createFluentBackendUserTokenStore, createFluentBatchOp, createFluentClient, createFluentFamiliesClient, createFluentIframeBridge, createFluentIframeRpcHandler, createFluentPermissionApi, createFluentPermissionClient, createFluentPermissionPolicyBuilders, createFluentPermissionSession, createFluentSettingsClient, createFluentSponsorshipRpcUrl, createFluentUserTokenStore, createFluentZeroDevErc20Paymaster, createFluentZeroDevErc20PaymasterApprovalCall, createFluentZeroDevErc20PaymasterClient, createFluentZeroDevErc20PaymasterRpcUrl, createFluentZeroDevPermissionSession, createFluentZeroDevRpcUrl, createFluentZeroDevSponsoredPaymaster, deriveFluentGasEthRates, findFluentSymbolCollisions, fluent, apps as fluentApps, fluentBridgeAbi, fluent$1 as fluentChain, fluentChains, fluentDefinitionToViemChain, integrations as fluentIntegrations, l1Chains as fluentL1Chains, fluentMainnet, fluentMainnetTokenDefaults, fluentTestnet, fluentTestnetTokenDefaults, fluentTokenIdentity, fluentTransferAbi, fluentZeroDevChainIds, getApp, getContractAddressFromChain, getFluentChain, getFluentChainByChainId, getFluentChainForNetwork, getFluentDefaultWidgetDisplayTokens, getFluentDefaultWidgetGasTokens, getFluentExplorerBaseUrl, getFluentGasPaymentEthValue, getFluentGasPaymentTokens, getFluentGasPaymentValueTier, getFluentGasTokenAddress, getFluentTokenDefaults, getFluentTokenDefaultsForNetwork, getFluentZeroDevErc20PaymasterTokens, getL1Chain, getL1ForFluentChain, getZeroDevRpcUrl, getZerodevIntegration, isFaucetNetwork, isFluentDefaultToken, isFluentNativeToken, isFluentZeroDevChain, l1DefinitionToViemChain, mergeFluentDisplayTokens, normalizeFluentWidgetNetwork, parseFluentTransferAmount, parseFluentTransferRecipient, readFluentTokenBalances, readFluentTokenMetadata, registryVersion, resolveBridgeAddresses, resolveDefaultGasToken, resolveFluentWidgetNetworkFromEnv, resolveFluentZeroDevErc20PaymasterToken, resolveL1Definition, selectFluentGasPaymentToken, sendFluentZeroDevErc20PaymasterDemo, sortFluentGasTokens, useFluentIframeBridge, useFluentUserTokens, useFluentWidget, useFluentWidgetNetwork, useFluentZeroDevAccount, useLinkX, useWidget };
|
package/dist/index.js
CHANGED
|
@@ -5278,6 +5278,9 @@ function getFluentChainForNetwork(network) {
|
|
|
5278
5278
|
return fluentTestnet;
|
|
5279
5279
|
}
|
|
5280
5280
|
}
|
|
5281
|
+
function getFluentWidgetNetworkForChainId(chainId) {
|
|
5282
|
+
return chainId === fluentMainnet.id ? "mainnet" : "testnet";
|
|
5283
|
+
}
|
|
5281
5284
|
function getFluentTokenDefaults(network) {
|
|
5282
5285
|
return getFluentTokenDefaultsForNetwork(network);
|
|
5283
5286
|
}
|
|
@@ -5294,14 +5297,15 @@ var FLUENT_WIDGET_REFRESH_CREDENTIAL_STORAGE_PREFIX = "fluent:widget:refresh:v1"
|
|
|
5294
5297
|
// src/core/config.ts
|
|
5295
5298
|
var FLUENT_CONNECT_PRIVY_APP_ID = "cmi7li7v901yojv0dmtfuf0v4";
|
|
5296
5299
|
var FLUENT_CONNECT_REOWN_PROJECT_ID = "fbf7578f67b4a34e5101051131829ac0";
|
|
5297
|
-
var
|
|
5300
|
+
var FLUENT_CONNECT_TESTNET_ZERODEV_PROJECT_ID = "893acc63-da39-4b57-8789-5784ed7f1969";
|
|
5301
|
+
var FLUENT_CONNECT_MAINNET_ZERODEV_PROJECT_ID = "216ca7d9-2b97-4894-ac23-7aa6a287dd97";
|
|
5298
5302
|
var FLUENT_CONNECT_POSTHOG_TOKEN = "phc_xr3QqFLEnKbDvmD5qsKvXuyaAdSkSKvcFGUH5VeDTLGD";
|
|
5299
5303
|
var FLUENT_CONNECT_TESTNET_PUBLIC_API_URL = "https://api.fluent-connect.dev.gblend.xyz/api/v1";
|
|
5300
|
-
var FLUENT_CONNECT_MAINNET_PUBLIC_API_URL = "https://
|
|
5304
|
+
var FLUENT_CONNECT_MAINNET_PUBLIC_API_URL = "https://api.fluent.xyz/connect/v1";
|
|
5301
5305
|
var FLUENT_CONNECT_TESTNET_ANALYTICS_HOST = "https://api.fluent-connect.dev.gblend.xyz/ingest";
|
|
5302
|
-
var FLUENT_CONNECT_MAINNET_ANALYTICS_HOST = "";
|
|
5306
|
+
var FLUENT_CONNECT_MAINNET_ANALYTICS_HOST = "https://api.fluent.xyz/connect/v1/ingest";
|
|
5303
5307
|
var FLUENT_CONNECT_TESTNET_SPONSORSHIP_URL = "https://sponsorship.fluent-connect.dev.gblend.xyz";
|
|
5304
|
-
var FLUENT_CONNECT_MAINNET_SPONSORSHIP_URL = "";
|
|
5308
|
+
var FLUENT_CONNECT_MAINNET_SPONSORSHIP_URL = "https://api.fluent.xyz/connect/v1";
|
|
5305
5309
|
var FLUENT_CONNECT_TESTNET_REPUTATION_SIGNUP_URL = "https://connect-preview.vercel.app/signin";
|
|
5306
5310
|
var FLUENT_CONNECT_MAINNET_REPUTATION_SIGNUP_URL = "https://connect.fluent.xyz/signin";
|
|
5307
5311
|
var FLUENT_CONNECT_TESTNET_FAUCET_ENDPOINT = "https://eco-faucet-api.fluent.xyz/fluent-connect/pre-fund";
|
|
@@ -5340,6 +5344,13 @@ var FLUENT_CONNECT_NETWORK_ENDPOINTS = {
|
|
|
5340
5344
|
function getFluentWidgetNetworkEndpoints(network) {
|
|
5341
5345
|
return FLUENT_CONNECT_NETWORK_ENDPOINTS[network];
|
|
5342
5346
|
}
|
|
5347
|
+
var FLUENT_CONNECT_ZERODEV_PROJECT_IDS = {
|
|
5348
|
+
testnet: FLUENT_CONNECT_TESTNET_ZERODEV_PROJECT_ID,
|
|
5349
|
+
mainnet: FLUENT_CONNECT_MAINNET_ZERODEV_PROJECT_ID
|
|
5350
|
+
};
|
|
5351
|
+
function getFluentZeroDevProjectId(network) {
|
|
5352
|
+
return FLUENT_CONNECT_ZERODEV_PROJECT_IDS[network];
|
|
5353
|
+
}
|
|
5343
5354
|
var FLUENT_CONNECT_DEFAULT_ASSETS = {
|
|
5344
5355
|
fluentLogo: FLUENT_CONNECT_BUNDLED_ASSETS.fluentLogo,
|
|
5345
5356
|
walletConnectIcon: FLUENT_CONNECT_BUNDLED_ASSETS.walletConnectIcon,
|
|
@@ -5378,10 +5389,10 @@ var FLUENT_CONNECT_PRIVY_CONFIG = {
|
|
|
5378
5389
|
*
|
|
5379
5390
|
* Privy resolves this once when `PrivyProvider` mounts and does not pick up a
|
|
5380
5391
|
* later change to the `config` prop — which is why Quick sign used to key that
|
|
5381
|
-
* provider and rebuild everything below it.
|
|
5382
|
-
* confirmation screen
|
|
5383
|
-
*
|
|
5384
|
-
*
|
|
5392
|
+
* provider and rebuild everything below it. Neither signer mode shows Privy's
|
|
5393
|
+
* confirmation screen: Prompt mode is confirmed in the widget's own review,
|
|
5394
|
+
* and its signer still names `uiOptions.showWalletUIs: false` per call, which
|
|
5395
|
+
* wins over this.
|
|
5385
5396
|
*/
|
|
5386
5397
|
embeddedWallets: {
|
|
5387
5398
|
createOnLogin: "users-without-wallets",
|
|
@@ -6801,17 +6812,19 @@ function validateFixedLimit(field, value, maximum = maxCallGasLimit, minimum = 1
|
|
|
6801
6812
|
}
|
|
6802
6813
|
function withoutGasEstimation(client2, args, gas) {
|
|
6803
6814
|
const paymaster = args.paymaster ?? client2.paymaster;
|
|
6804
|
-
|
|
6815
|
+
const fixedPaymasterGas = gas.paymasterVerificationGasLimit !== void 0;
|
|
6816
|
+
if (paymaster && fixedPaymasterGas !== (gas.paymasterPostOpGasLimit !== void 0)) {
|
|
6805
6817
|
throw new FluentUserOperationGasError(
|
|
6806
6818
|
"invalid_policy",
|
|
6807
|
-
"skipEstimation requires paymasterVerificationGasLimit and paymasterPostOpGasLimit when a paymaster is used"
|
|
6819
|
+
"skipEstimation requires both paymasterVerificationGasLimit and paymasterPostOpGasLimit or neither when a paymaster is used"
|
|
6808
6820
|
);
|
|
6809
6821
|
}
|
|
6810
|
-
const
|
|
6822
|
+
const providerGas = Boolean(paymaster && !fixedPaymasterGas);
|
|
6823
|
+
let limits = {
|
|
6811
6824
|
callGasLimit: gas.callGasLimit,
|
|
6812
6825
|
verificationGasLimit: gas.verificationGasLimit,
|
|
6813
6826
|
preVerificationGas: gas.preVerificationGas,
|
|
6814
|
-
...paymaster ? {
|
|
6827
|
+
...paymaster && fixedPaymasterGas ? {
|
|
6815
6828
|
paymasterVerificationGasLimit: gas.paymasterVerificationGasLimit,
|
|
6816
6829
|
paymasterPostOpGasLimit: gas.paymasterPostOpGasLimit
|
|
6817
6830
|
} : {}
|
|
@@ -6820,6 +6833,21 @@ function withoutGasEstimation(client2, args, gas) {
|
|
|
6820
6833
|
getPaymasterStubData: (operation) => getPaymasterStubData(client2, operation),
|
|
6821
6834
|
getPaymasterData: (operation) => getPaymasterData(client2, operation)
|
|
6822
6835
|
} : typeof paymaster === "object" ? paymaster : void 0;
|
|
6836
|
+
if (providerGas && !adapter) {
|
|
6837
|
+
throw new FluentUserOperationGasError(
|
|
6838
|
+
"invalid_policy",
|
|
6839
|
+
"skipEstimation needs a paymaster adapter to obtain provider gas limits"
|
|
6840
|
+
);
|
|
6841
|
+
}
|
|
6842
|
+
const acceptGas = (data, isFinal) => {
|
|
6843
|
+
if (providerGas) {
|
|
6844
|
+
if (isFinal) assertAuthorizedGas(data, {
|
|
6845
|
+
callGasLimit: gas.callGasLimit,
|
|
6846
|
+
verificationGasLimit: gas.verificationGasLimit
|
|
6847
|
+
});
|
|
6848
|
+
limits = readProviderGas(data, limits, gas.preVerificationGas);
|
|
6849
|
+
} else if (isFinal) assertAuthorizedGas(data, limits);
|
|
6850
|
+
};
|
|
6823
6851
|
return {
|
|
6824
6852
|
...args,
|
|
6825
6853
|
...limits,
|
|
@@ -6830,14 +6858,14 @@ function withoutGasEstimation(client2, args, gas) {
|
|
|
6830
6858
|
const fixedOperation = { ...operation, ...limits };
|
|
6831
6859
|
const data = await getStub.call(adapter, fixedOperation);
|
|
6832
6860
|
const isFinal = !adapter.getPaymasterStubData || "isFinal" in data && data.isFinal === true;
|
|
6833
|
-
|
|
6861
|
+
acceptGas(data, isFinal);
|
|
6834
6862
|
return { ...data, ...limits, isFinal };
|
|
6835
6863
|
},
|
|
6836
6864
|
async getPaymasterData(operation) {
|
|
6837
6865
|
const fixedOperation = { ...operation, ...limits };
|
|
6838
6866
|
const data = await adapter.getPaymasterData(fixedOperation);
|
|
6839
|
-
|
|
6840
|
-
return data;
|
|
6867
|
+
acceptGas(data, true);
|
|
6868
|
+
return { ...data, ...limits };
|
|
6841
6869
|
}
|
|
6842
6870
|
}
|
|
6843
6871
|
} : {},
|
|
@@ -6852,6 +6880,30 @@ function withoutGasEstimation(client2, args, gas) {
|
|
|
6852
6880
|
}
|
|
6853
6881
|
};
|
|
6854
6882
|
}
|
|
6883
|
+
function readProviderGas(data, current, preVerificationGasCeiling) {
|
|
6884
|
+
if (!data || typeof data !== "object") {
|
|
6885
|
+
throw new FluentUserOperationGasError(
|
|
6886
|
+
"paymaster_gas_mismatch",
|
|
6887
|
+
"skipEstimation requires a paymaster authorization object"
|
|
6888
|
+
);
|
|
6889
|
+
}
|
|
6890
|
+
const next = { ...current };
|
|
6891
|
+
for (const [field, minimum, maximum] of [
|
|
6892
|
+
["preVerificationGas", 1n, preVerificationGasCeiling],
|
|
6893
|
+
["paymasterVerificationGasLimit", 1n, maxCallGasLimit],
|
|
6894
|
+
["paymasterPostOpGasLimit", 0n, maxCallGasLimit]
|
|
6895
|
+
]) {
|
|
6896
|
+
const value = Object.hasOwn(data, field) ? Reflect.get(data, field) : current[field];
|
|
6897
|
+
if (typeof value !== "bigint" || value < minimum || value > maximum) {
|
|
6898
|
+
throw new FluentUserOperationGasError(
|
|
6899
|
+
"paymaster_gas_mismatch",
|
|
6900
|
+
`Paymaster ${field} must be a bigint between ${minimum} and ${maximum}`
|
|
6901
|
+
);
|
|
6902
|
+
}
|
|
6903
|
+
next[field] = value;
|
|
6904
|
+
}
|
|
6905
|
+
return next;
|
|
6906
|
+
}
|
|
6855
6907
|
function assertAuthorizedGas(data, limits) {
|
|
6856
6908
|
if (!data || typeof data !== "object") {
|
|
6857
6909
|
throw new FluentUserOperationGasError(
|
|
@@ -7187,7 +7239,9 @@ function getFluentZeroDevErc20PaymasterTokens(network = "testnet") {
|
|
|
7187
7239
|
}
|
|
7188
7240
|
function createFluentZeroDevRpcUrl(params = {}) {
|
|
7189
7241
|
const chainId = params.chainId ?? fluentTestnet.id;
|
|
7190
|
-
const projectId = params.projectId ??
|
|
7242
|
+
const projectId = params.projectId ?? getFluentZeroDevProjectId(
|
|
7243
|
+
getFluentWidgetNetworkForChainId(chainId)
|
|
7244
|
+
);
|
|
7191
7245
|
const baseUrl = `https://rpc.zerodev.app/api/v3/${projectId}/chain/${chainId}`;
|
|
7192
7246
|
return params.selfFunded ? `${baseUrl}?${FLUENT_ZERODEV_ERC20_PAYMASTER_QUERY}` : baseUrl;
|
|
7193
7247
|
}
|
|
@@ -8495,6 +8549,7 @@ function toFluentSigningAccount(params) {
|
|
|
8495
8549
|
}
|
|
8496
8550
|
function useFluentZeroDevAccount(hookOptions = {}) {
|
|
8497
8551
|
const { chain, network } = useFluentWidgetNetwork();
|
|
8552
|
+
const zeroDevProjectId = getFluentZeroDevProjectId(network);
|
|
8498
8553
|
const { authenticated, login: privyLogin, ready } = usePrivy2();
|
|
8499
8554
|
const login = hookOptions.login ?? privyLogin;
|
|
8500
8555
|
const { signMessage: promptSignMessage } = useSignMessage2();
|
|
@@ -8533,7 +8588,7 @@ function useFluentZeroDevAccount(hookOptions = {}) {
|
|
|
8533
8588
|
cachedSignerModes: Object.keys(kernels),
|
|
8534
8589
|
initInFlight: Boolean(initPromise.current[signerMode]),
|
|
8535
8590
|
throwOnError: Boolean(options.throwOnError),
|
|
8536
|
-
hasProjectId: Boolean(
|
|
8591
|
+
hasProjectId: Boolean(zeroDevProjectId)
|
|
8537
8592
|
});
|
|
8538
8593
|
if (cachedKernel) {
|
|
8539
8594
|
debugLog("[fluent zerodev] using cached kernel", {
|
|
@@ -8566,6 +8621,13 @@ function useFluentZeroDevAccount(hookOptions = {}) {
|
|
|
8566
8621
|
debugLog("[fluent zerodev] joining in-flight initialization");
|
|
8567
8622
|
return initPromise.current[signerMode];
|
|
8568
8623
|
}
|
|
8624
|
+
if (!zeroDevProjectId) {
|
|
8625
|
+
setKernels({});
|
|
8626
|
+
setSmartAccountReady(false);
|
|
8627
|
+
setError(null);
|
|
8628
|
+
debugWarn("[fluent zerodev] initialize blocked: project id missing");
|
|
8629
|
+
return null;
|
|
8630
|
+
}
|
|
8569
8631
|
setSmartAccountReady(Boolean(activeKernel));
|
|
8570
8632
|
setError(null);
|
|
8571
8633
|
initPromise.current[signerMode] = (async () => {
|
|
@@ -8626,7 +8688,8 @@ function useFluentZeroDevAccount(hookOptions = {}) {
|
|
|
8626
8688
|
promptSignMessage,
|
|
8627
8689
|
promptSignTypedData,
|
|
8628
8690
|
readExecution,
|
|
8629
|
-
ready
|
|
8691
|
+
ready,
|
|
8692
|
+
zeroDevProjectId
|
|
8630
8693
|
]);
|
|
8631
8694
|
useEffect(() => {
|
|
8632
8695
|
if (!ready) return;
|
|
@@ -8717,10 +8780,6 @@ function useFluentZeroDevAccount(hookOptions = {}) {
|
|
|
8717
8780
|
value: (call.value ?? 0n).toString()
|
|
8718
8781
|
}))
|
|
8719
8782
|
});
|
|
8720
|
-
setPromptSigningContext({
|
|
8721
|
-
intent: "transaction",
|
|
8722
|
-
gasTokenSymbol: options?.gasPayment?.symbol
|
|
8723
|
-
});
|
|
8724
8783
|
const signerChainCheck = execution.chainCheckBeforeSign ? readFluentSignerChainCheck(executionKernel.account) : void 0;
|
|
8725
8784
|
const signingAccount = signerChainCheck ? withFluentSignerChainCheck(
|
|
8726
8785
|
executionKernel.account,
|
|
@@ -8891,8 +8950,6 @@ function useFluentZeroDevAccount(hookOptions = {}) {
|
|
|
8891
8950
|
} catch (err) {
|
|
8892
8951
|
debugError("[fluent zerodev] sendCalls failed", err);
|
|
8893
8952
|
throw err;
|
|
8894
|
-
} finally {
|
|
8895
|
-
clearPromptSigningContext();
|
|
8896
8953
|
}
|
|
8897
8954
|
},
|
|
8898
8955
|
[
|
|
@@ -8924,7 +8981,7 @@ function useFluentZeroDevAccount(hookOptions = {}) {
|
|
|
8924
8981
|
return executionKernel;
|
|
8925
8982
|
}, [authenticated, error, initialize2, kernels, login, ready]);
|
|
8926
8983
|
return {
|
|
8927
|
-
smartAccountEnabled: Boolean(
|
|
8984
|
+
smartAccountEnabled: Boolean(zeroDevProjectId),
|
|
8928
8985
|
smartAccountReady,
|
|
8929
8986
|
smartAccountAddress: activeKernel?.smartAccountAddress,
|
|
8930
8987
|
signerAddress: embeddedWallet?.address ?? hookOptions.sessionSignerAddress,
|
|
@@ -9035,7 +9092,11 @@ function createFluentZeroDevKernelClient(params) {
|
|
|
9035
9092
|
});
|
|
9036
9093
|
}
|
|
9037
9094
|
async function createFluentZeroDevAuthorizedSessionKernel(authorizationSession, chain, readExecution) {
|
|
9038
|
-
const
|
|
9095
|
+
const projectId = getFluentZeroDevProjectId(getFluentWidgetNetworkForChainId(chain.id));
|
|
9096
|
+
if (!projectId) {
|
|
9097
|
+
throw new Error("Fluent ZeroDev project is not configured");
|
|
9098
|
+
}
|
|
9099
|
+
const zeroDevRpcUrl = `https://rpc.zerodev.app/api/v3/${projectId}/chain/${chain.id}`;
|
|
9039
9100
|
const publicClient = createPublicClient({
|
|
9040
9101
|
chain,
|
|
9041
9102
|
transport: createFluentRpcTransport(chain)
|
|
@@ -9067,11 +9128,13 @@ async function createFluentZeroDevAuthorizedSessionKernel(authorizationSession,
|
|
|
9067
9128
|
};
|
|
9068
9129
|
}
|
|
9069
9130
|
async function createFluentZeroDevKernel(params) {
|
|
9131
|
+
const projectId = getFluentZeroDevProjectId(getFluentWidgetNetworkForChainId(params.chain.id));
|
|
9132
|
+
if (!projectId) throw new Error("Fluent ZeroDev project is not configured");
|
|
9070
9133
|
if (!params.wallet) throw new Error("Fluent signer is unavailable");
|
|
9071
9134
|
debugLog("[fluent zerodev] ensuring Fluent chain", params.chain.id);
|
|
9072
9135
|
await ensureWalletOnFluentChain(params.wallet, params.chain);
|
|
9073
9136
|
debugLog("[fluent zerodev] Fluent chain ready", params.chain.id);
|
|
9074
|
-
const zeroDevRpcUrl = `https://rpc.zerodev.app/api/v3/${
|
|
9137
|
+
const zeroDevRpcUrl = `https://rpc.zerodev.app/api/v3/${projectId}/chain/${params.chain.id}`;
|
|
9075
9138
|
const publicClient = createPublicClient({
|
|
9076
9139
|
chain: params.chain,
|
|
9077
9140
|
transport: createFluentRpcTransport(params.chain)
|
|
@@ -9119,38 +9182,7 @@ function createFluentZeroDevErc20ExecutionClient(kernel, gasToken, readExecution
|
|
|
9119
9182
|
})
|
|
9120
9183
|
});
|
|
9121
9184
|
}
|
|
9122
|
-
var
|
|
9123
|
-
function setPromptSigningContext(context) {
|
|
9124
|
-
promptSigningContext = context;
|
|
9125
|
-
}
|
|
9126
|
-
function clearPromptSigningContext() {
|
|
9127
|
-
promptSigningContext = {};
|
|
9128
|
-
}
|
|
9129
|
-
async function withFluentSignaturePrompt(sign) {
|
|
9130
|
-
setPromptSigningContext({ intent: "signature" });
|
|
9131
|
-
try {
|
|
9132
|
-
return await sign();
|
|
9133
|
-
} finally {
|
|
9134
|
-
clearPromptSigningContext();
|
|
9135
|
-
}
|
|
9136
|
-
}
|
|
9137
|
-
function buildPromptSigningUiOptions() {
|
|
9138
|
-
if (promptSigningContext.intent === "signature") {
|
|
9139
|
-
return {
|
|
9140
|
-
showWalletUIs: true,
|
|
9141
|
-
title: "Sign with Fluent",
|
|
9142
|
-
description: "Sign this request with your Fluent account. Nothing is sent on chain.",
|
|
9143
|
-
buttonText: "Sign"
|
|
9144
|
-
};
|
|
9145
|
-
}
|
|
9146
|
-
const gasTokenSymbol = promptSigningContext.gasTokenSymbol;
|
|
9147
|
-
return {
|
|
9148
|
-
showWalletUIs: true,
|
|
9149
|
-
title: "Confirm Fluent transaction",
|
|
9150
|
-
description: gasTokenSymbol ? `Gas will be paid in ${gasTokenSymbol}. Confirm this Fluent transaction.` : "Confirm this Fluent transaction.",
|
|
9151
|
-
buttonText: "Sign"
|
|
9152
|
-
};
|
|
9153
|
-
}
|
|
9185
|
+
var PROMPT_MODE_PRIVY_UI_OPTIONS = { showWalletUIs: false };
|
|
9154
9186
|
function toPromptedPrivyLocalAccount(wallet, promptedSigners) {
|
|
9155
9187
|
const source = {
|
|
9156
9188
|
address: wallet.address,
|
|
@@ -9159,7 +9191,7 @@ function toPromptedPrivyLocalAccount(wallet, promptedSigners) {
|
|
|
9159
9191
|
{ message: formatSignableMessageForPrivy(message2) },
|
|
9160
9192
|
{
|
|
9161
9193
|
address: wallet.address,
|
|
9162
|
-
uiOptions:
|
|
9194
|
+
uiOptions: PROMPT_MODE_PRIVY_UI_OPTIONS
|
|
9163
9195
|
}
|
|
9164
9196
|
);
|
|
9165
9197
|
return signature;
|
|
@@ -9177,7 +9209,7 @@ function toPromptedPrivyLocalAccount(wallet, promptedSigners) {
|
|
|
9177
9209
|
},
|
|
9178
9210
|
{
|
|
9179
9211
|
address: wallet.address,
|
|
9180
|
-
uiOptions:
|
|
9212
|
+
uiOptions: PROMPT_MODE_PRIVY_UI_OPTIONS
|
|
9181
9213
|
}
|
|
9182
9214
|
);
|
|
9183
9215
|
return signature;
|
|
@@ -9646,7 +9678,7 @@ function useFluentIframeBridge(iframeRef, { allowedOrigin }) {
|
|
|
9646
9678
|
}
|
|
9647
9679
|
|
|
9648
9680
|
// package.json
|
|
9649
|
-
var version = "0.5.
|
|
9681
|
+
var version = "0.5.1";
|
|
9650
9682
|
|
|
9651
9683
|
// src/core/analytics.ts
|
|
9652
9684
|
var INSTANCE_NAME = "fluent";
|
|
@@ -16786,8 +16818,8 @@ function useWidgetExecution(params) {
|
|
|
16786
16818
|
return {
|
|
16787
16819
|
signerSource: kernel.signerSource,
|
|
16788
16820
|
account: {
|
|
16789
|
-
signMessage: (params2) =>
|
|
16790
|
-
signTypedData: (typedData) =>
|
|
16821
|
+
signMessage: (params2) => kernel.account.signMessage(params2),
|
|
16822
|
+
signTypedData: (typedData) => kernel.account.signTypedData(typedData)
|
|
16791
16823
|
}
|
|
16792
16824
|
};
|
|
16793
16825
|
},
|
|
@@ -19627,6 +19659,6 @@ function FluentWidget(props) {
|
|
|
19627
19659
|
) });
|
|
19628
19660
|
}
|
|
19629
19661
|
|
|
19630
|
-
export { AccountAvatar, Button, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, FLUENT_CONNECT_DEFAULT_ASSETS, FLUENT_GAS_PAYMENT_DEFAULT_ETH_RATES, FLUENT_USER_TOKEN_LIMIT, FLUENT_WIDGET_DEFAULT_GAS_TOKEN, FLUENT_WIDGET_SESSION_STORAGE_KEY, FLUENT_WIDGET_USER_TOKENS_IMPORT_MARKER_KEY, FLUENT_WIDGET_USER_TOKENS_STORAGE_KEY, FLUENT_ZERODEV_ERC20_PAYMASTER_QUERY, FLUENT_ZERODEV_PAYMASTER_DEMO_RECIPIENT, FluentAccountDrawer, FluentAuthError, FluentIframeRpcError, FluentPortalContainerProvider, FluentReviewRejectedError, FluentSettingsError, FluentSponsorshipFallbackError, FluentUserOperationGasError, FluentWidget, FluentWidgetConfigError, FluentWidgetConnectButton, FluentWidgetNetworkProvider, Icon, Label, Separator, Switch, WIDGET_STYLE_SCOPE, WalletMenuActionCard, buildFluentTransferCall, buttonVariants, checkFluentTransferFee, clearPrivyRecentLoginMethod, createFluentBackendUserTokenStore, createFluentBatchOp, createFluentClient, createFluentFamiliesClient, createFluentIframeBridge, createFluentIframeRpcHandler, createFluentPermissionApi, createFluentPermissionClient, createFluentPermissionPolicyBuilders, createFluentPermissionSession, createFluentSettingsClient, createFluentSponsorshipRpcUrl, createFluentUserTokenStore, createFluentZeroDevErc20Paymaster, createFluentZeroDevErc20PaymasterApprovalCall, createFluentZeroDevErc20PaymasterClient, createFluentZeroDevErc20PaymasterRpcUrl, createFluentZeroDevPermissionSession, createFluentZeroDevRpcUrl, createFluentZeroDevSponsoredPaymaster, deriveFluentGasEthRates, findFluentSymbolCollisions, fluent2 as fluent, apps as fluentApps, fluentBridgeAbi, fluent as fluentChain, fluentChains, fluentDefinitionToViemChain, integrations as fluentIntegrations, l1Chains as fluentL1Chains, fluentMainnet, fluentMainnetTokenDefaults, fluentTestnet, fluentTestnetTokenDefaults, fluentTokenIdentity, fluentTransferAbi, fluentZeroDevChainIds, getApp, getContractAddressFromChain, getFluentChain, getFluentChainByChainId, getFluentChainForNetwork, getFluentDefaultWidgetDisplayTokens, getFluentDefaultWidgetGasTokens, getFluentExplorerBaseUrl, getFluentGasPaymentEthValue, getFluentGasPaymentTokens, getFluentGasPaymentValueTier, getFluentGasTokenAddress, getFluentTokenDefaults, getFluentTokenDefaultsForNetwork, getFluentZeroDevErc20PaymasterTokens, getL1Chain, getL1ForFluentChain, getZeroDevRpcUrl, getZerodevIntegration, isFaucetNetwork, isFluentDefaultToken, isFluentNativeToken, isFluentZeroDevChain, l1DefinitionToViemChain, mergeFluentDisplayTokens, normalizeFluentWidgetNetwork, parseFluentTransferAmount, parseFluentTransferRecipient, readFluentTokenBalances, readFluentTokenMetadata, registryVersion, resolveBridgeAddresses, resolveDefaultGasToken, resolveFluentWidgetNetworkFromEnv, resolveFluentZeroDevErc20PaymasterToken, resolveL1Definition, selectFluentGasPaymentToken, sendFluentZeroDevErc20PaymasterDemo, sortFluentGasTokens, useFluentIframeBridge, useFluentUserTokens, useFluentWidget, useFluentWidgetNetwork, useFluentZeroDevAccount, useLinkX, useWidget
|
|
19662
|
+
export { AccountAvatar, Button, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, FLUENT_CONNECT_DEFAULT_ASSETS, FLUENT_GAS_PAYMENT_DEFAULT_ETH_RATES, FLUENT_USER_TOKEN_LIMIT, FLUENT_WIDGET_DEFAULT_GAS_TOKEN, FLUENT_WIDGET_SESSION_STORAGE_KEY, FLUENT_WIDGET_USER_TOKENS_IMPORT_MARKER_KEY, FLUENT_WIDGET_USER_TOKENS_STORAGE_KEY, FLUENT_ZERODEV_ERC20_PAYMASTER_QUERY, FLUENT_ZERODEV_PAYMASTER_DEMO_RECIPIENT, FluentAccountDrawer, FluentAuthError, FluentIframeRpcError, FluentPortalContainerProvider, FluentReviewRejectedError, FluentSettingsError, FluentSponsorshipFallbackError, FluentUserOperationGasError, FluentWidget, FluentWidgetConfigError, FluentWidgetConnectButton, FluentWidgetNetworkProvider, Icon, Label, Separator, Switch, WIDGET_STYLE_SCOPE, WalletMenuActionCard, buildFluentTransferCall, buttonVariants, checkFluentTransferFee, clearPrivyRecentLoginMethod, createFluentBackendUserTokenStore, createFluentBatchOp, createFluentClient, createFluentFamiliesClient, createFluentIframeBridge, createFluentIframeRpcHandler, createFluentPermissionApi, createFluentPermissionClient, createFluentPermissionPolicyBuilders, createFluentPermissionSession, createFluentSettingsClient, createFluentSponsorshipRpcUrl, createFluentUserTokenStore, createFluentZeroDevErc20Paymaster, createFluentZeroDevErc20PaymasterApprovalCall, createFluentZeroDevErc20PaymasterClient, createFluentZeroDevErc20PaymasterRpcUrl, createFluentZeroDevPermissionSession, createFluentZeroDevRpcUrl, createFluentZeroDevSponsoredPaymaster, deriveFluentGasEthRates, findFluentSymbolCollisions, fluent2 as fluent, apps as fluentApps, fluentBridgeAbi, fluent as fluentChain, fluentChains, fluentDefinitionToViemChain, integrations as fluentIntegrations, l1Chains as fluentL1Chains, fluentMainnet, fluentMainnetTokenDefaults, fluentTestnet, fluentTestnetTokenDefaults, fluentTokenIdentity, fluentTransferAbi, fluentZeroDevChainIds, getApp, getContractAddressFromChain, getFluentChain, getFluentChainByChainId, getFluentChainForNetwork, getFluentDefaultWidgetDisplayTokens, getFluentDefaultWidgetGasTokens, getFluentExplorerBaseUrl, getFluentGasPaymentEthValue, getFluentGasPaymentTokens, getFluentGasPaymentValueTier, getFluentGasTokenAddress, getFluentTokenDefaults, getFluentTokenDefaultsForNetwork, getFluentZeroDevErc20PaymasterTokens, getL1Chain, getL1ForFluentChain, getZeroDevRpcUrl, getZerodevIntegration, isFaucetNetwork, isFluentDefaultToken, isFluentNativeToken, isFluentZeroDevChain, l1DefinitionToViemChain, mergeFluentDisplayTokens, normalizeFluentWidgetNetwork, parseFluentTransferAmount, parseFluentTransferRecipient, readFluentTokenBalances, readFluentTokenMetadata, registryVersion, resolveBridgeAddresses, resolveDefaultGasToken, resolveFluentWidgetNetworkFromEnv, resolveFluentZeroDevErc20PaymasterToken, resolveL1Definition, selectFluentGasPaymentToken, sendFluentZeroDevErc20PaymasterDemo, sortFluentGasTokens, useFluentIframeBridge, useFluentUserTokens, useFluentWidget, useFluentWidgetNetwork, useFluentZeroDevAccount, useLinkX, useWidget };
|
|
19631
19663
|
//# sourceMappingURL=index.js.map
|
|
19632
19664
|
//# sourceMappingURL=index.js.map
|