@coti-io/coti-wallet-plugin 0.2.0 → 0.2.2
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/dist/index.d.mts +14 -7
- package/dist/index.d.ts +14 -7
- package/dist/index.js +75 -29
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +74 -28
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -1
package/dist/index.d.mts
CHANGED
|
@@ -234,11 +234,12 @@ interface CotiPluginConfig {
|
|
|
234
234
|
*/
|
|
235
235
|
snapVersion?: string;
|
|
236
236
|
/**
|
|
237
|
-
* When false,
|
|
238
|
-
*
|
|
239
|
-
*
|
|
237
|
+
* When false, Snap is fully disabled for this app: no install/connect,
|
|
238
|
+
* no AES key probe/retrieval, and strategy routing ignores an already-installed
|
|
239
|
+
* Snap. Unlock continues via encrypted backup restore and/or contract
|
|
240
|
+
* onboarding. Default: true.
|
|
240
241
|
*/
|
|
241
|
-
|
|
242
|
+
snapEnabled?: boolean;
|
|
242
243
|
/** If set, enforces a specific network chain ID (decimal string or hex). */
|
|
243
244
|
defaultNetworkId?: string;
|
|
244
245
|
/** Sepolia RPC URL for PoD portal operations. */
|
|
@@ -302,8 +303,8 @@ declare function getSnapRequestParams(snapId?: string, snapVersion?: string): Re
|
|
|
302
303
|
* Returns the current plugin configuration.
|
|
303
304
|
*/
|
|
304
305
|
declare function getPluginConfig(): Readonly<CotiPluginConfig>;
|
|
305
|
-
/** Whether
|
|
306
|
-
declare function
|
|
306
|
+
/** Whether Snap usage (install, probe, AES key retrieve/save) is allowed for this app. */
|
|
307
|
+
declare function isSnapEnabled(): boolean;
|
|
307
308
|
|
|
308
309
|
/**
|
|
309
310
|
* Internal logger for the COTI Wallet Plugin.
|
|
@@ -3707,6 +3708,12 @@ interface AesKeyProviderOptions {
|
|
|
3707
3708
|
forceContractOnboarding?: boolean;
|
|
3708
3709
|
/** Whether contract-onboarding should save a client-encrypted AES backup. */
|
|
3709
3710
|
saveBackup?: boolean;
|
|
3711
|
+
/**
|
|
3712
|
+
* Persist the onboarded AES key to Snap after contract onboarding.
|
|
3713
|
+
* Used when the unlock UI just connected Snap (`wallet_requestSnaps`) but
|
|
3714
|
+
* `isMetaMaskWithSnap` may still be stale.
|
|
3715
|
+
*/
|
|
3716
|
+
persistToSnap?: boolean;
|
|
3710
3717
|
/** Only restore via Snap-side decrypt / backup; never export raw key or run contract onboarding. */
|
|
3711
3718
|
restoreOnly?: boolean;
|
|
3712
3719
|
/** Unlock via Snap typed decrypt RPC (no raw AES export). Used when AES is already stored in Snap. */
|
|
@@ -4752,4 +4759,4 @@ declare function muteChainUpdates(): void;
|
|
|
4752
4759
|
declare function unmuteChainUpdates(): void;
|
|
4753
4760
|
declare function isChainUpdatesMuted(): boolean;
|
|
4754
4761
|
|
|
4755
|
-
export { type AesKeyChainId, type AesKeyProviderOptions, BRIDGE_ABI, BRIDGE_ERC20_ABI, type BridgeData, type BridgeFees, type BridgeStatus, CHAIN_CONFIGS, CONTRACT_ADDRESSES, COTI_MAINNET_CHAIN_ID, COTI_MAINNET_RPC, COTI_PRICE_CONSUMER_ABI, COTI_TESTNET_CHAIN_ID$1 as COTI_TESTNET_CHAIN_ID, COTI_TESTNET_POD_INBOX, COTI_TESTNET_RPC, type ChainIndexPageUi, type ConnectorProviderSource, type CotiBridgeFeeQuote, CotiErrorCode, type CotiPluginConfig, CotiPluginError, DEFAULT_CHAIN_ID, DEFAULT_POD_BALANCE_STATE, DEFAULT_POD_EXPLORER_BASE_URL, type EIP1193Provider, ERC20_ABI, ETHEREUM_MAINNET_CHAIN_ID, ETHEREUM_MAINNET_RPC, type EncryptedAesBackup, type FeeEstimate, type GrantResult, LIMITS, type Logger, MINIMUM_PORTAL_IN_AMOUNTS, MULTIPLE_WALLETS_ERROR_SUBSTRING, type NetworkEnforcerResult, NetworkGuard, type NetworkGuardProps, ONBOARDING_STEPS, ONBOARD_MODAL_STYLE_KEYS, OnboardModal, type OnboardModalPage, type OnboardModalProps, type OnboardModalTheme, type OnboardModalWarnings, type OnboardingProgressCallback, type OnboardingServiceRequest, type OnboardingServices, type OnboardingStep, type OnboardingStepInfo, COTI_TESTNET_CHAIN_ID as POD_COTI_TESTNET_CHAIN_ID, POD_INBOX_ADDRESS, POD_PORTAL_ADMIN_ABI, POD_PRICE_ORACLE_ABI, POD_PTOKEN_ABI, SEPOLIA_CHAIN_ID as POD_SEPOLIA_CHAIN_ID, PRIVACY_PORTAL_ABI, PRIVATE_ERC20_TRANSFER_256_SIG, type PodBalanceState, type PodBalanceTrustState, type PodPortalFeeQuote, type PodPortalRequest, type PodPortalRequestStatus, type PodWithdrawPermit, type ChainConfig as PortalChainConfig, type PortalStrategy, type PrivacyBridgeContextType, type PrivacyBridgeModalsContextValue, type PrivacyBridgeNetworkContextValue, type PrivacyBridgePodContextValue, PrivacyBridgeProvider, type PrivacyBridgeProviderProps, type PrivacyBridgeSwapContextValue, type PrivacyBridgeTokensContextValue, type PrivacyBridgeUnlockContextValue, type PrivacyBridgeWalletContextValue, type PrivateUnlockControllerValue, PrivateUnlockProvider, type PrivateUnlockProviderOptions, type PrivateUnlockProviderProps, type RefreshPrivateBalancesOptions, type ResolvedIndexPageUi, SEPOLIA_CHAIN_ID$1 as SEPOLIA_CHAIN_ID, SEPOLIA_RPC, SEPOLIA_RPC_FALLBACK, SUPPORTED_TOKENS, type SaveEncryptedAesBackupRequest, type SimulationResult, TOKEN_ABI, type TokenConfig, type UnlockStrategy, WALLET_CONNECT_FAILURE_EVENT, type WagmiConfigOptions, WagmiRainbowKitProvider, type WalletConnectFailureDetail, type WalletNetworkConfig, type WalletType, type WalletTypeInfo, addThousandsSeparators, buildPodExplorerRequestUrl, computeCotiFee, computeErc20Fee, configureCotiPlugin, cotiMainnet, cotiTestnet, estimateBridgeFee, estimateCotiBridgeGasFeeDisplay, estimatePodPortalFees, ethereumMainnet, executePodPortalTransaction, fetchBridgeFees, fetchPodBridgeData, fetchPodOracleTokenUsdPrice, fetchTokenUsdPrice, formatBalanceWithNotation, formatPodFeeDisplay, formatPortalFeeDisplay, formatTokenBalanceDisplay, getChainConfig, getChainIdConstants, getContractAddresses, getEip6963MetaMaskProvider, getEip6963RabbyProvider, getEthereumProvider, getExplorerBaseUrlForChain, getNetworkNameForChain, getPluginConfig, getPodGasPrice, getPodInboxAddress, getPodSdkConfig, getPrivateTokensForChain, getPublicTokensForChain, getRpcUrlForChain, getRpcUrlForChainId, getRpcUrlsForChain, getSepoliaGasPrice, getSnapRequestParams, getTokenSimulationMeta, getTokensForChain, getUnlockStrategyForChain, getWagmiConfig, getWalletNetworkConfigs, getWalletNetworkOptions, hasCotiErrorCode, isChainUpdatesMuted, isCotiPluginError, isMultipleWalletsError,
|
|
4762
|
+
export { type AesKeyChainId, type AesKeyProviderOptions, BRIDGE_ABI, BRIDGE_ERC20_ABI, type BridgeData, type BridgeFees, type BridgeStatus, CHAIN_CONFIGS, CONTRACT_ADDRESSES, COTI_MAINNET_CHAIN_ID, COTI_MAINNET_RPC, COTI_PRICE_CONSUMER_ABI, COTI_TESTNET_CHAIN_ID$1 as COTI_TESTNET_CHAIN_ID, COTI_TESTNET_POD_INBOX, COTI_TESTNET_RPC, type ChainIndexPageUi, type ConnectorProviderSource, type CotiBridgeFeeQuote, CotiErrorCode, type CotiPluginConfig, CotiPluginError, DEFAULT_CHAIN_ID, DEFAULT_POD_BALANCE_STATE, DEFAULT_POD_EXPLORER_BASE_URL, type EIP1193Provider, ERC20_ABI, ETHEREUM_MAINNET_CHAIN_ID, ETHEREUM_MAINNET_RPC, type EncryptedAesBackup, type FeeEstimate, type GrantResult, LIMITS, type Logger, MINIMUM_PORTAL_IN_AMOUNTS, MULTIPLE_WALLETS_ERROR_SUBSTRING, type NetworkEnforcerResult, NetworkGuard, type NetworkGuardProps, ONBOARDING_STEPS, ONBOARD_MODAL_STYLE_KEYS, OnboardModal, type OnboardModalPage, type OnboardModalProps, type OnboardModalTheme, type OnboardModalWarnings, type OnboardingProgressCallback, type OnboardingServiceRequest, type OnboardingServices, type OnboardingStep, type OnboardingStepInfo, COTI_TESTNET_CHAIN_ID as POD_COTI_TESTNET_CHAIN_ID, POD_INBOX_ADDRESS, POD_PORTAL_ADMIN_ABI, POD_PRICE_ORACLE_ABI, POD_PTOKEN_ABI, SEPOLIA_CHAIN_ID as POD_SEPOLIA_CHAIN_ID, PRIVACY_PORTAL_ABI, PRIVATE_ERC20_TRANSFER_256_SIG, type PodBalanceState, type PodBalanceTrustState, type PodPortalFeeQuote, type PodPortalRequest, type PodPortalRequestStatus, type PodWithdrawPermit, type ChainConfig as PortalChainConfig, type PortalStrategy, type PrivacyBridgeContextType, type PrivacyBridgeModalsContextValue, type PrivacyBridgeNetworkContextValue, type PrivacyBridgePodContextValue, PrivacyBridgeProvider, type PrivacyBridgeProviderProps, type PrivacyBridgeSwapContextValue, type PrivacyBridgeTokensContextValue, type PrivacyBridgeUnlockContextValue, type PrivacyBridgeWalletContextValue, type PrivateUnlockControllerValue, PrivateUnlockProvider, type PrivateUnlockProviderOptions, type PrivateUnlockProviderProps, type RefreshPrivateBalancesOptions, type ResolvedIndexPageUi, SEPOLIA_CHAIN_ID$1 as SEPOLIA_CHAIN_ID, SEPOLIA_RPC, SEPOLIA_RPC_FALLBACK, SUPPORTED_TOKENS, type SaveEncryptedAesBackupRequest, type SimulationResult, TOKEN_ABI, type TokenConfig, type UnlockStrategy, WALLET_CONNECT_FAILURE_EVENT, type WagmiConfigOptions, WagmiRainbowKitProvider, type WalletConnectFailureDetail, type WalletNetworkConfig, type WalletType, type WalletTypeInfo, addThousandsSeparators, buildPodExplorerRequestUrl, computeCotiFee, computeErc20Fee, configureCotiPlugin, cotiMainnet, cotiTestnet, estimateBridgeFee, estimateCotiBridgeGasFeeDisplay, estimatePodPortalFees, ethereumMainnet, executePodPortalTransaction, fetchBridgeFees, fetchPodBridgeData, fetchPodOracleTokenUsdPrice, fetchTokenUsdPrice, formatBalanceWithNotation, formatPodFeeDisplay, formatPortalFeeDisplay, formatTokenBalanceDisplay, getChainConfig, getChainIdConstants, getContractAddresses, getEip6963MetaMaskProvider, getEip6963RabbyProvider, getEthereumProvider, getExplorerBaseUrlForChain, getNetworkNameForChain, getPluginConfig, getPodGasPrice, getPodInboxAddress, getPodSdkConfig, getPrivateTokensForChain, getPublicTokensForChain, getRpcUrlForChain, getRpcUrlForChainId, getRpcUrlsForChain, getSepoliaGasPrice, getSnapRequestParams, getTokenSimulationMeta, getTokensForChain, getUnlockStrategyForChain, getWagmiConfig, getWalletNetworkConfigs, getWalletNetworkOptions, hasCotiErrorCode, isChainUpdatesMuted, isCotiPluginError, isMultipleWalletsError, isSnapEnabled, loadPodRequests, logger, mobileZerionWallet, muteChainUpdates, defaultStyles as onboardModalDefaultStyles, podRequestsStorageKey, quoteCotiBridgeFees, quotePodPortalTransactionFees, quotePortalFeeOnly, requireChainConfig, resolveConnectedProvider, resolveIndexPageUi, resolveMetaMaskInjectedTarget, resolvePodRequestStatus, resolvePodTxGasPrice, resolvePrivateTokenContractAddress, resolvePrivateTokenTransferTarget, resolveRabbyInjectedTarget, savePodRequests, sepolia, setDebugLogging, signPodWithdrawPermit, simulateFeeOnChain, simulatePodPortalFee, truncateDecimalValue, unmuteChainUpdates, useBalanceUpdater, useBridgeData, useBridgeStatus, useMetamask, useNetworkEnforcer, usePrivacyBridgeContext, usePrivacyBridgeModals, usePrivacyBridgeNetwork, usePrivacyBridgePod, usePrivacyBridgeSwap, usePrivacyBridgeTokens, usePrivacyBridgeUnlock, usePrivacyBridgeWallet, usePrivateTokenBalance, usePrivateUnlock, useWalletType, wagmiConfig };
|
package/dist/index.d.ts
CHANGED
|
@@ -234,11 +234,12 @@ interface CotiPluginConfig {
|
|
|
234
234
|
*/
|
|
235
235
|
snapVersion?: string;
|
|
236
236
|
/**
|
|
237
|
-
* When false,
|
|
238
|
-
*
|
|
239
|
-
*
|
|
237
|
+
* When false, Snap is fully disabled for this app: no install/connect,
|
|
238
|
+
* no AES key probe/retrieval, and strategy routing ignores an already-installed
|
|
239
|
+
* Snap. Unlock continues via encrypted backup restore and/or contract
|
|
240
|
+
* onboarding. Default: true.
|
|
240
241
|
*/
|
|
241
|
-
|
|
242
|
+
snapEnabled?: boolean;
|
|
242
243
|
/** If set, enforces a specific network chain ID (decimal string or hex). */
|
|
243
244
|
defaultNetworkId?: string;
|
|
244
245
|
/** Sepolia RPC URL for PoD portal operations. */
|
|
@@ -302,8 +303,8 @@ declare function getSnapRequestParams(snapId?: string, snapVersion?: string): Re
|
|
|
302
303
|
* Returns the current plugin configuration.
|
|
303
304
|
*/
|
|
304
305
|
declare function getPluginConfig(): Readonly<CotiPluginConfig>;
|
|
305
|
-
/** Whether
|
|
306
|
-
declare function
|
|
306
|
+
/** Whether Snap usage (install, probe, AES key retrieve/save) is allowed for this app. */
|
|
307
|
+
declare function isSnapEnabled(): boolean;
|
|
307
308
|
|
|
308
309
|
/**
|
|
309
310
|
* Internal logger for the COTI Wallet Plugin.
|
|
@@ -3707,6 +3708,12 @@ interface AesKeyProviderOptions {
|
|
|
3707
3708
|
forceContractOnboarding?: boolean;
|
|
3708
3709
|
/** Whether contract-onboarding should save a client-encrypted AES backup. */
|
|
3709
3710
|
saveBackup?: boolean;
|
|
3711
|
+
/**
|
|
3712
|
+
* Persist the onboarded AES key to Snap after contract onboarding.
|
|
3713
|
+
* Used when the unlock UI just connected Snap (`wallet_requestSnaps`) but
|
|
3714
|
+
* `isMetaMaskWithSnap` may still be stale.
|
|
3715
|
+
*/
|
|
3716
|
+
persistToSnap?: boolean;
|
|
3710
3717
|
/** Only restore via Snap-side decrypt / backup; never export raw key or run contract onboarding. */
|
|
3711
3718
|
restoreOnly?: boolean;
|
|
3712
3719
|
/** Unlock via Snap typed decrypt RPC (no raw AES export). Used when AES is already stored in Snap. */
|
|
@@ -4752,4 +4759,4 @@ declare function muteChainUpdates(): void;
|
|
|
4752
4759
|
declare function unmuteChainUpdates(): void;
|
|
4753
4760
|
declare function isChainUpdatesMuted(): boolean;
|
|
4754
4761
|
|
|
4755
|
-
export { type AesKeyChainId, type AesKeyProviderOptions, BRIDGE_ABI, BRIDGE_ERC20_ABI, type BridgeData, type BridgeFees, type BridgeStatus, CHAIN_CONFIGS, CONTRACT_ADDRESSES, COTI_MAINNET_CHAIN_ID, COTI_MAINNET_RPC, COTI_PRICE_CONSUMER_ABI, COTI_TESTNET_CHAIN_ID$1 as COTI_TESTNET_CHAIN_ID, COTI_TESTNET_POD_INBOX, COTI_TESTNET_RPC, type ChainIndexPageUi, type ConnectorProviderSource, type CotiBridgeFeeQuote, CotiErrorCode, type CotiPluginConfig, CotiPluginError, DEFAULT_CHAIN_ID, DEFAULT_POD_BALANCE_STATE, DEFAULT_POD_EXPLORER_BASE_URL, type EIP1193Provider, ERC20_ABI, ETHEREUM_MAINNET_CHAIN_ID, ETHEREUM_MAINNET_RPC, type EncryptedAesBackup, type FeeEstimate, type GrantResult, LIMITS, type Logger, MINIMUM_PORTAL_IN_AMOUNTS, MULTIPLE_WALLETS_ERROR_SUBSTRING, type NetworkEnforcerResult, NetworkGuard, type NetworkGuardProps, ONBOARDING_STEPS, ONBOARD_MODAL_STYLE_KEYS, OnboardModal, type OnboardModalPage, type OnboardModalProps, type OnboardModalTheme, type OnboardModalWarnings, type OnboardingProgressCallback, type OnboardingServiceRequest, type OnboardingServices, type OnboardingStep, type OnboardingStepInfo, COTI_TESTNET_CHAIN_ID as POD_COTI_TESTNET_CHAIN_ID, POD_INBOX_ADDRESS, POD_PORTAL_ADMIN_ABI, POD_PRICE_ORACLE_ABI, POD_PTOKEN_ABI, SEPOLIA_CHAIN_ID as POD_SEPOLIA_CHAIN_ID, PRIVACY_PORTAL_ABI, PRIVATE_ERC20_TRANSFER_256_SIG, type PodBalanceState, type PodBalanceTrustState, type PodPortalFeeQuote, type PodPortalRequest, type PodPortalRequestStatus, type PodWithdrawPermit, type ChainConfig as PortalChainConfig, type PortalStrategy, type PrivacyBridgeContextType, type PrivacyBridgeModalsContextValue, type PrivacyBridgeNetworkContextValue, type PrivacyBridgePodContextValue, PrivacyBridgeProvider, type PrivacyBridgeProviderProps, type PrivacyBridgeSwapContextValue, type PrivacyBridgeTokensContextValue, type PrivacyBridgeUnlockContextValue, type PrivacyBridgeWalletContextValue, type PrivateUnlockControllerValue, PrivateUnlockProvider, type PrivateUnlockProviderOptions, type PrivateUnlockProviderProps, type RefreshPrivateBalancesOptions, type ResolvedIndexPageUi, SEPOLIA_CHAIN_ID$1 as SEPOLIA_CHAIN_ID, SEPOLIA_RPC, SEPOLIA_RPC_FALLBACK, SUPPORTED_TOKENS, type SaveEncryptedAesBackupRequest, type SimulationResult, TOKEN_ABI, type TokenConfig, type UnlockStrategy, WALLET_CONNECT_FAILURE_EVENT, type WagmiConfigOptions, WagmiRainbowKitProvider, type WalletConnectFailureDetail, type WalletNetworkConfig, type WalletType, type WalletTypeInfo, addThousandsSeparators, buildPodExplorerRequestUrl, computeCotiFee, computeErc20Fee, configureCotiPlugin, cotiMainnet, cotiTestnet, estimateBridgeFee, estimateCotiBridgeGasFeeDisplay, estimatePodPortalFees, ethereumMainnet, executePodPortalTransaction, fetchBridgeFees, fetchPodBridgeData, fetchPodOracleTokenUsdPrice, fetchTokenUsdPrice, formatBalanceWithNotation, formatPodFeeDisplay, formatPortalFeeDisplay, formatTokenBalanceDisplay, getChainConfig, getChainIdConstants, getContractAddresses, getEip6963MetaMaskProvider, getEip6963RabbyProvider, getEthereumProvider, getExplorerBaseUrlForChain, getNetworkNameForChain, getPluginConfig, getPodGasPrice, getPodInboxAddress, getPodSdkConfig, getPrivateTokensForChain, getPublicTokensForChain, getRpcUrlForChain, getRpcUrlForChainId, getRpcUrlsForChain, getSepoliaGasPrice, getSnapRequestParams, getTokenSimulationMeta, getTokensForChain, getUnlockStrategyForChain, getWagmiConfig, getWalletNetworkConfigs, getWalletNetworkOptions, hasCotiErrorCode, isChainUpdatesMuted, isCotiPluginError, isMultipleWalletsError,
|
|
4762
|
+
export { type AesKeyChainId, type AesKeyProviderOptions, BRIDGE_ABI, BRIDGE_ERC20_ABI, type BridgeData, type BridgeFees, type BridgeStatus, CHAIN_CONFIGS, CONTRACT_ADDRESSES, COTI_MAINNET_CHAIN_ID, COTI_MAINNET_RPC, COTI_PRICE_CONSUMER_ABI, COTI_TESTNET_CHAIN_ID$1 as COTI_TESTNET_CHAIN_ID, COTI_TESTNET_POD_INBOX, COTI_TESTNET_RPC, type ChainIndexPageUi, type ConnectorProviderSource, type CotiBridgeFeeQuote, CotiErrorCode, type CotiPluginConfig, CotiPluginError, DEFAULT_CHAIN_ID, DEFAULT_POD_BALANCE_STATE, DEFAULT_POD_EXPLORER_BASE_URL, type EIP1193Provider, ERC20_ABI, ETHEREUM_MAINNET_CHAIN_ID, ETHEREUM_MAINNET_RPC, type EncryptedAesBackup, type FeeEstimate, type GrantResult, LIMITS, type Logger, MINIMUM_PORTAL_IN_AMOUNTS, MULTIPLE_WALLETS_ERROR_SUBSTRING, type NetworkEnforcerResult, NetworkGuard, type NetworkGuardProps, ONBOARDING_STEPS, ONBOARD_MODAL_STYLE_KEYS, OnboardModal, type OnboardModalPage, type OnboardModalProps, type OnboardModalTheme, type OnboardModalWarnings, type OnboardingProgressCallback, type OnboardingServiceRequest, type OnboardingServices, type OnboardingStep, type OnboardingStepInfo, COTI_TESTNET_CHAIN_ID as POD_COTI_TESTNET_CHAIN_ID, POD_INBOX_ADDRESS, POD_PORTAL_ADMIN_ABI, POD_PRICE_ORACLE_ABI, POD_PTOKEN_ABI, SEPOLIA_CHAIN_ID as POD_SEPOLIA_CHAIN_ID, PRIVACY_PORTAL_ABI, PRIVATE_ERC20_TRANSFER_256_SIG, type PodBalanceState, type PodBalanceTrustState, type PodPortalFeeQuote, type PodPortalRequest, type PodPortalRequestStatus, type PodWithdrawPermit, type ChainConfig as PortalChainConfig, type PortalStrategy, type PrivacyBridgeContextType, type PrivacyBridgeModalsContextValue, type PrivacyBridgeNetworkContextValue, type PrivacyBridgePodContextValue, PrivacyBridgeProvider, type PrivacyBridgeProviderProps, type PrivacyBridgeSwapContextValue, type PrivacyBridgeTokensContextValue, type PrivacyBridgeUnlockContextValue, type PrivacyBridgeWalletContextValue, type PrivateUnlockControllerValue, PrivateUnlockProvider, type PrivateUnlockProviderOptions, type PrivateUnlockProviderProps, type RefreshPrivateBalancesOptions, type ResolvedIndexPageUi, SEPOLIA_CHAIN_ID$1 as SEPOLIA_CHAIN_ID, SEPOLIA_RPC, SEPOLIA_RPC_FALLBACK, SUPPORTED_TOKENS, type SaveEncryptedAesBackupRequest, type SimulationResult, TOKEN_ABI, type TokenConfig, type UnlockStrategy, WALLET_CONNECT_FAILURE_EVENT, type WagmiConfigOptions, WagmiRainbowKitProvider, type WalletConnectFailureDetail, type WalletNetworkConfig, type WalletType, type WalletTypeInfo, addThousandsSeparators, buildPodExplorerRequestUrl, computeCotiFee, computeErc20Fee, configureCotiPlugin, cotiMainnet, cotiTestnet, estimateBridgeFee, estimateCotiBridgeGasFeeDisplay, estimatePodPortalFees, ethereumMainnet, executePodPortalTransaction, fetchBridgeFees, fetchPodBridgeData, fetchPodOracleTokenUsdPrice, fetchTokenUsdPrice, formatBalanceWithNotation, formatPodFeeDisplay, formatPortalFeeDisplay, formatTokenBalanceDisplay, getChainConfig, getChainIdConstants, getContractAddresses, getEip6963MetaMaskProvider, getEip6963RabbyProvider, getEthereumProvider, getExplorerBaseUrlForChain, getNetworkNameForChain, getPluginConfig, getPodGasPrice, getPodInboxAddress, getPodSdkConfig, getPrivateTokensForChain, getPublicTokensForChain, getRpcUrlForChain, getRpcUrlForChainId, getRpcUrlsForChain, getSepoliaGasPrice, getSnapRequestParams, getTokenSimulationMeta, getTokensForChain, getUnlockStrategyForChain, getWagmiConfig, getWalletNetworkConfigs, getWalletNetworkOptions, hasCotiErrorCode, isChainUpdatesMuted, isCotiPluginError, isMultipleWalletsError, isSnapEnabled, loadPodRequests, logger, mobileZerionWallet, muteChainUpdates, defaultStyles as onboardModalDefaultStyles, podRequestsStorageKey, quoteCotiBridgeFees, quotePodPortalTransactionFees, quotePortalFeeOnly, requireChainConfig, resolveConnectedProvider, resolveIndexPageUi, resolveMetaMaskInjectedTarget, resolvePodRequestStatus, resolvePodTxGasPrice, resolvePrivateTokenContractAddress, resolvePrivateTokenTransferTarget, resolveRabbyInjectedTarget, savePodRequests, sepolia, setDebugLogging, signPodWithdrawPermit, simulateFeeOnChain, simulatePodPortalFee, truncateDecimalValue, unmuteChainUpdates, useBalanceUpdater, useBridgeData, useBridgeStatus, useMetamask, useNetworkEnforcer, usePrivacyBridgeContext, usePrivacyBridgeModals, usePrivacyBridgeNetwork, usePrivacyBridgePod, usePrivacyBridgeSwap, usePrivacyBridgeTokens, usePrivacyBridgeUnlock, usePrivacyBridgeWallet, usePrivateTokenBalance, usePrivateUnlock, useWalletType, wagmiConfig };
|
package/dist/index.js
CHANGED
|
@@ -568,10 +568,10 @@ function configureCotiPlugin(config) {
|
|
|
568
568
|
...config.onboardingServices
|
|
569
569
|
}
|
|
570
570
|
};
|
|
571
|
-
if ("
|
|
572
|
-
console.log("[CotiPlugin]
|
|
573
|
-
|
|
574
|
-
effective:
|
|
571
|
+
if ("snapEnabled" in config && _config.debug) {
|
|
572
|
+
console.log("[CotiPlugin] snapEnabled:", {
|
|
573
|
+
snapEnabled: config.snapEnabled,
|
|
574
|
+
effective: isSnapEnabled()
|
|
575
575
|
});
|
|
576
576
|
}
|
|
577
577
|
}
|
|
@@ -582,8 +582,8 @@ function getSnapRequestParams(snapId = _config.snapId, snapVersion) {
|
|
|
582
582
|
function getPluginConfig() {
|
|
583
583
|
return _config;
|
|
584
584
|
}
|
|
585
|
-
function
|
|
586
|
-
return getPluginConfig().
|
|
585
|
+
function isSnapEnabled() {
|
|
586
|
+
return getPluginConfig().snapEnabled !== false;
|
|
587
587
|
}
|
|
588
588
|
var _config;
|
|
589
589
|
var init_plugin = __esm({
|
|
@@ -592,7 +592,7 @@ var init_plugin = __esm({
|
|
|
592
592
|
init_chains();
|
|
593
593
|
_config = {
|
|
594
594
|
snapId: "npm:@coti-io/coti-snap",
|
|
595
|
-
|
|
595
|
+
snapEnabled: true,
|
|
596
596
|
defaultNetworkId: void 0,
|
|
597
597
|
debug: false,
|
|
598
598
|
clearSessionKeyOnWagmiDisconnect: false,
|
|
@@ -1205,7 +1205,7 @@ __export(index_exports, {
|
|
|
1205
1205
|
isChainUpdatesMuted: () => isChainUpdatesMuted,
|
|
1206
1206
|
isCotiPluginError: () => isCotiPluginError,
|
|
1207
1207
|
isMultipleWalletsError: () => isMultipleWalletsError,
|
|
1208
|
-
|
|
1208
|
+
isSnapEnabled: () => isSnapEnabled,
|
|
1209
1209
|
loadPodRequests: () => loadPodRequests,
|
|
1210
1210
|
logger: () => logger,
|
|
1211
1211
|
mobileZerionWallet: () => mobileZerionWallet,
|
|
@@ -1558,6 +1558,7 @@ var resolveBridgeAddress = (chainId, symbol, pubTok) => {
|
|
|
1558
1558
|
if (symbol === "USDC.e") return addresses.PrivacyBridgeUSDCe;
|
|
1559
1559
|
if (symbol === "WADA") return addresses.PrivacyBridgeWADA;
|
|
1560
1560
|
if (symbol === "gCOTI") return addresses.PrivacyBridgegCOTI;
|
|
1561
|
+
if (symbol === "NIGHT") return addresses.PrivacyBridgeNight;
|
|
1561
1562
|
return addresses.PrivacyBridgeCotiNative;
|
|
1562
1563
|
};
|
|
1563
1564
|
var quoteCotiBridgeFees = async (params) => {
|
|
@@ -1589,7 +1590,7 @@ var quoteCotiBridgeFees = async (params) => {
|
|
|
1589
1590
|
if (isWbtc) {
|
|
1590
1591
|
publicDecimals = 8;
|
|
1591
1592
|
privateDecimals = 8;
|
|
1592
|
-
} else if (isUsdt || isUsdcE || isWada) {
|
|
1593
|
+
} else if (isUsdt || isUsdcE || isWada || isNight) {
|
|
1593
1594
|
publicDecimals = 6;
|
|
1594
1595
|
privateDecimals = 6;
|
|
1595
1596
|
}
|
|
@@ -3828,6 +3829,17 @@ var usePrivateTokenBalance = () => {
|
|
|
3828
3829
|
if (error instanceof CotiPluginError) {
|
|
3829
3830
|
throw error;
|
|
3830
3831
|
}
|
|
3832
|
+
const message = error instanceof Error ? error.message : String(error?.message ?? error ?? "");
|
|
3833
|
+
const code = error?.code;
|
|
3834
|
+
const isDecryptPayloadFailure = message.includes("Invalid encrypted payload") || code === -32603 && /encrypt|decrypt|ciphertext/i.test(message);
|
|
3835
|
+
if (isDecryptPayloadFailure || canUseSnapDecrypt) {
|
|
3836
|
+
logger.error(`\u274C Failed to decrypt private balance for ${contractAddress}`, error);
|
|
3837
|
+
throw new CotiPluginError(
|
|
3838
|
+
"AES_KEY_MISMATCH" /* AES_KEY_MISMATCH */,
|
|
3839
|
+
isDecryptPayloadFailure ? "Could not decrypt private balances. The Snap AES key may be missing or invalid \u2014 re-onboarding is required." : "Could not decrypt private balances via Snap. Re-onboarding may be required.",
|
|
3840
|
+
message
|
|
3841
|
+
);
|
|
3842
|
+
}
|
|
3831
3843
|
logger.error(`\u274C Failed to fetch/decrypt for ${contractAddress}`, error);
|
|
3832
3844
|
return "0.00";
|
|
3833
3845
|
}
|
|
@@ -4228,7 +4240,7 @@ var useBalanceUpdater = ({
|
|
|
4228
4240
|
return { symbol: token.symbol, value, isMismatch: false };
|
|
4229
4241
|
} catch (e) {
|
|
4230
4242
|
const msg = e?.message || "";
|
|
4231
|
-
const isMismatch = msg.includes("AES key mismatch") || msg.includes("onboarding") || msg.includes("ACCOUNT_NOT_ONBOARDED") || msg.includes("implausible decrypted balance");
|
|
4243
|
+
const isMismatch = e instanceof CotiPluginError && (e.code === "AES_KEY_MISMATCH" /* AES_KEY_MISMATCH */ || e.code === "ACCOUNT_NOT_ONBOARDED" /* ACCOUNT_NOT_ONBOARDED */) || msg.includes("AES key mismatch") || msg.includes("Invalid encrypted payload") || msg.includes("onboarding") || msg.includes("ACCOUNT_NOT_ONBOARDED") || msg.includes("implausible decrypted balance");
|
|
4232
4244
|
if (isMismatch) {
|
|
4233
4245
|
logger.warn(`\u26A0\uFE0F Private token decrypt mismatch for ${tokenAddress}. Falling back to 0.`);
|
|
4234
4246
|
return { symbol: token.symbol, value: "0", isMismatch: true };
|
|
@@ -4312,8 +4324,10 @@ var SYMBOL_TO_ORACLE_BASE = {
|
|
|
4312
4324
|
USDT: "USDT",
|
|
4313
4325
|
USDC: "USDC",
|
|
4314
4326
|
"USDC.e": "USDC",
|
|
4315
|
-
WADA: "ADA"
|
|
4316
|
-
//
|
|
4327
|
+
WADA: "ADA",
|
|
4328
|
+
// Consumer base is uppercase GCOTI (lowercase gCOTI reverts).
|
|
4329
|
+
gCOTI: "GCOTI",
|
|
4330
|
+
NIGHT: "NIGHT"
|
|
4317
4331
|
};
|
|
4318
4332
|
function getPriceConsumerAddress(chainId = 7082400) {
|
|
4319
4333
|
const addresses = CONTRACT_ADDRESSES[chainId];
|
|
@@ -4421,7 +4435,8 @@ var TOKEN_TO_ORACLE_SYMBOL = {
|
|
|
4421
4435
|
USDT: "USDT",
|
|
4422
4436
|
"USDC.e": "USDC",
|
|
4423
4437
|
WADA: "ADA",
|
|
4424
|
-
gCOTI: "GCOTI"
|
|
4438
|
+
gCOTI: "GCOTI",
|
|
4439
|
+
NIGHT: "NIGHT"
|
|
4425
4440
|
};
|
|
4426
4441
|
var TOKEN_DECIMALS = {
|
|
4427
4442
|
COTI: 18,
|
|
@@ -4430,7 +4445,8 @@ var TOKEN_DECIMALS = {
|
|
|
4430
4445
|
USDT: 6,
|
|
4431
4446
|
"USDC.e": 6,
|
|
4432
4447
|
WADA: 6,
|
|
4433
|
-
gCOTI: 18
|
|
4448
|
+
gCOTI: 18,
|
|
4449
|
+
NIGHT: 6
|
|
4434
4450
|
};
|
|
4435
4451
|
async function simulateFeeOnChain(bridgeAddress, amount, fixedFee, percentageBps, maxFee, oracleSymbol, tokenDecimals, provider) {
|
|
4436
4452
|
try {
|
|
@@ -4943,6 +4959,10 @@ var useSnap = (setSnapError) => {
|
|
|
4943
4959
|
}
|
|
4944
4960
|
}, [resolveProvider]);
|
|
4945
4961
|
const isSnapInstalled = (0, import_react6.useCallback)(async () => {
|
|
4962
|
+
if (!isSnapEnabled()) {
|
|
4963
|
+
logger.log("\u2139\uFE0F Snap disabled via plugin config \u2014 treating as not installed");
|
|
4964
|
+
return false;
|
|
4965
|
+
}
|
|
4946
4966
|
const provider = await resolveProvider();
|
|
4947
4967
|
if (!provider) {
|
|
4948
4968
|
logger.log("\u274C isSnapInstalled: No MetaMask provider");
|
|
@@ -4972,8 +4992,8 @@ var useSnap = (setSnapError) => {
|
|
|
4972
4992
|
}
|
|
4973
4993
|
}, [detectFlask, resolveProvider]);
|
|
4974
4994
|
const connectToSnap = (0, import_react6.useCallback)(async () => {
|
|
4975
|
-
if (!
|
|
4976
|
-
logger.log("\u2139\uFE0F Snap
|
|
4995
|
+
if (!isSnapEnabled()) {
|
|
4996
|
+
logger.log("\u2139\uFE0F Snap disabled via plugin config");
|
|
4977
4997
|
return false;
|
|
4978
4998
|
}
|
|
4979
4999
|
const provider = await resolveProvider();
|
|
@@ -5120,6 +5140,13 @@ var useSnap = (setSnapError) => {
|
|
|
5120
5140
|
return parseSnapItUint256(result?.value);
|
|
5121
5141
|
}, [connectedAddress, invokeSnapOperation]);
|
|
5122
5142
|
const getAESKeyFromSnap = (0, import_react6.useCallback)(async (accountAddress, options) => {
|
|
5143
|
+
if (!isSnapEnabled()) {
|
|
5144
|
+
logger.log("\u2139\uFE0F Snap disabled via plugin config \u2014 treating as unavailable");
|
|
5145
|
+
throw new CotiPluginError(
|
|
5146
|
+
"SNAP_CONNECT_FAILED" /* SNAP_CONNECT_FAILED */,
|
|
5147
|
+
"COTI Snap is disabled for this app"
|
|
5148
|
+
);
|
|
5149
|
+
}
|
|
5123
5150
|
if (setSnapError) setSnapError(null);
|
|
5124
5151
|
const skipCache = options?.skipCache === true;
|
|
5125
5152
|
if (isSnapRequestPending.current) {
|
|
@@ -5256,6 +5283,7 @@ var useSnap = (setSnapError) => {
|
|
|
5256
5283
|
}
|
|
5257
5284
|
}, [isSnapInstalled, setSnapError, resolveProvider, syncEnvironment]);
|
|
5258
5285
|
const hasAesKeyInSnap = (0, import_react6.useCallback)(async (accountAddress) => {
|
|
5286
|
+
if (!isSnapEnabled()) return null;
|
|
5259
5287
|
const provider = await resolveProvider();
|
|
5260
5288
|
if (!provider) return null;
|
|
5261
5289
|
const installed = await isSnapInstalled();
|
|
@@ -5288,6 +5316,10 @@ var useSnap = (setSnapError) => {
|
|
|
5288
5316
|
}
|
|
5289
5317
|
}, [isSnapInstalled, resolveProvider, syncEnvironment]);
|
|
5290
5318
|
const saveAESKeyToSnap = (0, import_react6.useCallback)(async (key, accountAddress = "") => {
|
|
5319
|
+
if (!isSnapEnabled()) {
|
|
5320
|
+
logger.log("\u2139\uFE0F Snap disabled via plugin config \u2014 skipping AES key save");
|
|
5321
|
+
return false;
|
|
5322
|
+
}
|
|
5291
5323
|
const provider = await resolveProvider();
|
|
5292
5324
|
if (!provider) return false;
|
|
5293
5325
|
try {
|
|
@@ -6726,7 +6758,7 @@ function useWalletType() {
|
|
|
6726
6758
|
const walletType = mapConnectorIdToWalletType(connectorId);
|
|
6727
6759
|
(0, import_react12.useEffect)(() => {
|
|
6728
6760
|
let cancelled = false;
|
|
6729
|
-
if (walletType !== "metamask" || !connector) {
|
|
6761
|
+
if (walletType !== "metamask" || !connector || !isSnapEnabled()) {
|
|
6730
6762
|
setIsMetaMaskWithSnap(false);
|
|
6731
6763
|
return;
|
|
6732
6764
|
}
|
|
@@ -7815,7 +7847,8 @@ function useAesKeyProvider(walletTypeInfo) {
|
|
|
7815
7847
|
}
|
|
7816
7848
|
}
|
|
7817
7849
|
let savedToSnap = false;
|
|
7818
|
-
const
|
|
7850
|
+
const shouldPersistToSnap = walletTypeInfo.isMetaMaskWithSnap || options.persistToSnap === true;
|
|
7851
|
+
const canSaveToConnectedSnap = !!aesKey && walletTypeInfo.walletType === "metamask" && shouldPersistToSnap && canPersistAesKeyToSnap();
|
|
7819
7852
|
const canSaveEncryptedBackup = aesKey && isValidAesKey(aesKey) && options.saveBackup && servicesEnabled && (services?.saveEncryptedAesBackup || services?.replaceEncryptedAesBackup);
|
|
7820
7853
|
if (canSaveToConnectedSnap) {
|
|
7821
7854
|
emitStep("persisting-key");
|
|
@@ -7827,7 +7860,7 @@ function useAesKeyProvider(walletTypeInfo) {
|
|
|
7827
7860
|
success: "Onboarding succeeded, but the AES key could not be saved to MetaMask Snap. You can retry by unlocking again."
|
|
7828
7861
|
});
|
|
7829
7862
|
}
|
|
7830
|
-
} else if (aesKey && walletTypeInfo.walletType === "metamask" && canPersistAesKeyToSnap() && !
|
|
7863
|
+
} else if (aesKey && walletTypeInfo.walletType === "metamask" && canPersistAesKeyToSnap() && !shouldPersistToSnap) {
|
|
7831
7864
|
logger.log(
|
|
7832
7865
|
"\u2139\uFE0F Skipping Snap AES persist \u2014 Snap is not connected to this origin"
|
|
7833
7866
|
);
|
|
@@ -7912,7 +7945,17 @@ function useAesKeyProvider(walletTypeInfo) {
|
|
|
7912
7945
|
}
|
|
7913
7946
|
}
|
|
7914
7947
|
},
|
|
7915
|
-
[
|
|
7948
|
+
[
|
|
7949
|
+
walletTypeInfo.walletType,
|
|
7950
|
+
walletTypeInfo.isMetaMaskWithSnap,
|
|
7951
|
+
getAESKeyFromSnap,
|
|
7952
|
+
saveAESKeyToSnap,
|
|
7953
|
+
clearSnapCache,
|
|
7954
|
+
connector,
|
|
7955
|
+
connectedChainId,
|
|
7956
|
+
emitStep,
|
|
7957
|
+
reportOnboardingFailure
|
|
7958
|
+
]
|
|
7916
7959
|
);
|
|
7917
7960
|
return {
|
|
7918
7961
|
getAesKey,
|
|
@@ -8297,6 +8340,7 @@ var usePrivacyBridgeNetworkSession = ({
|
|
|
8297
8340
|
// src/context/privacyBridge/usePrivacyBridgeAccountSync.ts
|
|
8298
8341
|
var import_react20 = require("react");
|
|
8299
8342
|
var import_wagmi9 = require("wagmi");
|
|
8343
|
+
init_plugin();
|
|
8300
8344
|
init_logger();
|
|
8301
8345
|
var usePrivacyBridgeAccountSync = ({
|
|
8302
8346
|
core,
|
|
@@ -8343,13 +8387,13 @@ var usePrivacyBridgeAccountSync = ({
|
|
|
8343
8387
|
);
|
|
8344
8388
|
const getAESKeyForCurrentNetwork = (0, import_react20.useCallback)(
|
|
8345
8389
|
async (accountAddress, options) => {
|
|
8346
|
-
if (options?.skipCache && walletTypeInfo.walletType === "metamask" && !options.forceContractOnboarding && !options.restoreOnly) {
|
|
8390
|
+
if (options?.skipCache && walletTypeInfo.walletType === "metamask" && isSnapEnabled() && !options.forceContractOnboarding && !options.restoreOnly) {
|
|
8347
8391
|
return getAESKeyFromSnap(accountAddress, { skipCache: true });
|
|
8348
8392
|
}
|
|
8349
8393
|
if (sessionAesKey && !options?.forceContractOnboarding) return sessionAesKey;
|
|
8350
8394
|
return options === void 0 ? getAesKeyFromProvider(accountAddress) : getAesKeyFromProvider(accountAddress, options.onProgress, options);
|
|
8351
8395
|
},
|
|
8352
|
-
[sessionAesKey, getAesKeyFromProvider, getAESKeyFromSnap]
|
|
8396
|
+
[sessionAesKey, getAesKeyFromProvider, getAESKeyFromSnap, walletTypeInfo.walletType]
|
|
8353
8397
|
);
|
|
8354
8398
|
const { updateAccountState } = useBalanceUpdater({
|
|
8355
8399
|
setWalletAddress,
|
|
@@ -11162,8 +11206,8 @@ function usePrivateUnlockController(options = {}) {
|
|
|
11162
11206
|
isPrivateUnlockedRef.current = unlock.isPrivateUnlocked;
|
|
11163
11207
|
const connectedAddress = wallet.walletAddress || "";
|
|
11164
11208
|
const isMetaMaskWallet = walletTypeInfo.walletType === "metamask";
|
|
11165
|
-
const
|
|
11166
|
-
const usesSnapStorage =
|
|
11209
|
+
const canUseSnap = isMetaMaskWallet && !isMetaMaskMobileBrowser() && isSnapEnabled();
|
|
11210
|
+
const usesSnapStorage = canUseSnap && (walletTypeInfo.isMetaMaskWithSnap || snapConnectedInModal);
|
|
11167
11211
|
const isActiveUnlockRequest = (0, import_react28.useCallback)(
|
|
11168
11212
|
(requestId) => requestId === unlockRequestIdRef.current,
|
|
11169
11213
|
[]
|
|
@@ -11261,7 +11305,7 @@ function usePrivateUnlockController(options = {}) {
|
|
|
11261
11305
|
dismissOnboardModal();
|
|
11262
11306
|
}, [dismissOnboardModal, wallet.walletAddress]);
|
|
11263
11307
|
const connectSnap = (0, import_react28.useCallback)(async () => {
|
|
11264
|
-
if (!
|
|
11308
|
+
if (!canUseSnap) return false;
|
|
11265
11309
|
setModalError(null);
|
|
11266
11310
|
try {
|
|
11267
11311
|
const connected = await unlock.requestSnapConnection();
|
|
@@ -11280,7 +11324,7 @@ function usePrivateUnlockController(options = {}) {
|
|
|
11280
11324
|
});
|
|
11281
11325
|
return false;
|
|
11282
11326
|
}
|
|
11283
|
-
}, [
|
|
11327
|
+
}, [canUseSnap, unlock]);
|
|
11284
11328
|
const handleRestoreUnlockProgress = (0, import_react28.useCallback)((step) => {
|
|
11285
11329
|
if (step === "signing-backup") {
|
|
11286
11330
|
setCurrentStep(step);
|
|
@@ -11465,7 +11509,7 @@ function usePrivateUnlockController(options = {}) {
|
|
|
11465
11509
|
contractOnboardingFailureRef.current = null;
|
|
11466
11510
|
try {
|
|
11467
11511
|
let useSnapStorageForOnboarding = usesSnapStorage || snapConnectedInModalRef.current;
|
|
11468
|
-
if (!useSnapStorageForOnboarding &&
|
|
11512
|
+
if (!useSnapStorageForOnboarding && canUseSnap) {
|
|
11469
11513
|
useSnapStorageForOnboarding = await connectSnap();
|
|
11470
11514
|
}
|
|
11471
11515
|
if (!isActiveUnlockRequest(requestId)) {
|
|
@@ -11474,6 +11518,8 @@ function usePrivateUnlockController(options = {}) {
|
|
|
11474
11518
|
const ok = await unlock.refreshPrivateBalances({
|
|
11475
11519
|
forceContractOnboarding: true,
|
|
11476
11520
|
saveBackup: useSnapStorageForOnboarding ? false : saveBackup,
|
|
11521
|
+
// Explicit: don't rely on isMetaMaskWithSnap which can lag after connectSnap.
|
|
11522
|
+
persistToSnap: useSnapStorageForOnboarding,
|
|
11477
11523
|
onProgress: (step, details) => {
|
|
11478
11524
|
if (isActiveUnlockRequest(requestId)) {
|
|
11479
11525
|
handleContractOnboardingProgress(step, details);
|
|
@@ -11529,7 +11575,7 @@ function usePrivateUnlockController(options = {}) {
|
|
|
11529
11575
|
setIsUnlocking(false);
|
|
11530
11576
|
}
|
|
11531
11577
|
}
|
|
11532
|
-
}, [
|
|
11578
|
+
}, [canUseSnap, connectSnap, connectedAddress, currentStep, dismissOnboardModal, handleContractOnboardingProgress, handleOnboardingIncomplete, isActiveUnlockRequest, onOnboardingCancelled, saveBackup, showOnboardingComplete, unlock, usesSnapStorage]);
|
|
11533
11579
|
const handleOnboardModalClose = (0, import_react28.useCallback)(() => {
|
|
11534
11580
|
if (currentStep === "complete" || currentStep === "validating-key" && pendingCompleteRequestIdRef.current !== null) {
|
|
11535
11581
|
void finishSuccessfulOnboarding();
|
|
@@ -12720,7 +12766,7 @@ var import_rainbowkit3 = require("@rainbow-me/rainbowkit");
|
|
|
12720
12766
|
isChainUpdatesMuted,
|
|
12721
12767
|
isCotiPluginError,
|
|
12722
12768
|
isMultipleWalletsError,
|
|
12723
|
-
|
|
12769
|
+
isSnapEnabled,
|
|
12724
12770
|
loadPodRequests,
|
|
12725
12771
|
logger,
|
|
12726
12772
|
mobileZerionWallet,
|