@getpara/react-sdk 2.0.0-dev.3 → 2.0.0-dev.5
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/cosmos/actions/getCosmjsAminoSigner.d.ts +8 -0
- package/dist/cosmos/actions/getCosmjsAminoSigner.js +16 -0
- package/dist/cosmos/actions/getCosmjsProtoSigner.d.ts +8 -0
- package/dist/cosmos/actions/getCosmjsProtoSigner.js +16 -0
- package/dist/cosmos/actions/index.d.ts +2 -0
- package/dist/cosmos/actions/index.js +3 -0
- package/dist/cosmos/hooks/index.d.ts +2 -0
- package/dist/cosmos/hooks/index.js +3 -0
- package/dist/cosmos/hooks/useCosmjsAminoSigner.d.ts +11 -0
- package/dist/cosmos/hooks/useCosmjsAminoSigner.js +37 -0
- package/dist/cosmos/hooks/useCosmjsProtoSigner.d.ts +11 -0
- package/dist/cosmos/hooks/useCosmjsProtoSigner.js +37 -0
- package/dist/cosmos/index.d.ts +2 -0
- package/dist/cosmos/index.js +3 -0
- package/dist/css/modal.css +14 -1
- package/dist/evm/actions/getViemAccount.d.ts +22 -0
- package/dist/evm/actions/getViemAccount.js +20 -0
- package/dist/evm/actions/getViemClient.d.ts +7659 -0
- package/dist/evm/actions/getViemClient.js +25 -0
- package/dist/evm/actions/index.d.ts +2 -0
- package/dist/evm/actions/index.js +3 -0
- package/dist/evm/hooks/index.d.ts +2 -0
- package/dist/evm/hooks/index.js +3 -0
- package/dist/evm/hooks/useViemAccount.d.ts +26 -0
- package/dist/evm/hooks/useViemAccount.js +32 -0
- package/dist/evm/hooks/useViemClient.d.ts +7663 -0
- package/dist/evm/hooks/useViemClient.js +30 -0
- package/dist/evm/index.d.ts +2 -0
- package/dist/evm/index.js +3 -0
- package/dist/index.d.ts +3 -5
- package/dist/index.js +4 -4
- package/dist/provider/ParaProvider.d.ts +1 -2
- package/dist/provider/ParaProvider.js +13 -106
- package/dist/public/PPMori-Regular.woff2 +0 -0
- package/dist/public/PPMori-SemiBold.woff2 +0 -0
- package/dist/solana/actions/getSolanaSigner.d.ts +8 -0
- package/dist/solana/actions/getSolanaSigner.js +15 -0
- package/dist/solana/actions/index.d.ts +1 -0
- package/dist/solana/actions/index.js +2 -0
- package/dist/solana/hooks/index.d.ts +1 -0
- package/dist/solana/hooks/index.js +2 -0
- package/dist/solana/hooks/useSolanaSigner.d.ts +12 -0
- package/dist/solana/hooks/useSolanaSigner.js +32 -0
- package/dist/solana/index.d.ts +2 -0
- package/dist/solana/index.js +3 -0
- package/package.json +19 -29
- package/styles.css/package.json +1 -1
- package/dist/cli/cli.mjs +0 -50
- package/dist/modal/ParaModal.d.ts +0 -2
- package/dist/modal/ParaModal.js +0 -301
- package/dist/modal/components/Account/Account.d.ts +0 -5
- package/dist/modal/components/Account/Account.js +0 -148
- package/dist/modal/components/Account/AccountProfile.d.ts +0 -1
- package/dist/modal/components/Account/AccountProfile.js +0 -168
- package/dist/modal/components/Account/AccountProfileLink.d.ts +0 -1
- package/dist/modal/components/Account/AccountProfileLink.js +0 -206
- package/dist/modal/components/Account/AccountProfileLinkOptions.d.ts +0 -1
- package/dist/modal/components/Account/AccountProfileLinkOptions.js +0 -111
- package/dist/modal/components/Account/AccountProfileUnlink.d.ts +0 -1
- package/dist/modal/components/Account/AccountProfileUnlink.js +0 -47
- package/dist/modal/components/AddFunds/AddFunds.d.ts +0 -1
- package/dist/modal/components/AddFunds/AddFunds.js +0 -69
- package/dist/modal/components/AddFunds/AddFundsAsset.d.ts +0 -1
- package/dist/modal/components/AddFunds/AddFundsAsset.js +0 -125
- package/dist/modal/components/AddFunds/AddFundsAwaiting.d.ts +0 -1
- package/dist/modal/components/AddFunds/AddFundsAwaiting.js +0 -78
- package/dist/modal/components/AddFunds/AddFundsContext.d.ts +0 -31
- package/dist/modal/components/AddFunds/AddFundsContext.js +0 -160
- package/dist/modal/components/AddFunds/AddFundsDone.d.ts +0 -6
- package/dist/modal/components/AddFunds/AddFundsDone.js +0 -49
- package/dist/modal/components/AddFunds/AddFundsProvider.d.ts +0 -1
- package/dist/modal/components/AddFunds/AddFundsProvider.js +0 -109
- package/dist/modal/components/AddFunds/AddFundsReceive.d.ts +0 -1
- package/dist/modal/components/AddFunds/AddFundsReceive.js +0 -83
- package/dist/modal/components/AddFunds/AddFundsSettings.d.ts +0 -1
- package/dist/modal/components/AddFunds/AddFundsSettings.js +0 -237
- package/dist/modal/components/AddFunds/MoonPayEmbed.d.ts +0 -2
- package/dist/modal/components/AddFunds/MoonPayEmbed.js +0 -7
- package/dist/modal/components/AddFunds/common.d.ts +0 -19
- package/dist/modal/components/AddFunds/common.js +0 -24
- package/dist/modal/components/AddFunds/index.d.ts +0 -3
- package/dist/modal/components/AddFunds/index.js +0 -4
- package/dist/modal/components/AuthInput/AuthInput.d.ts +0 -20
- package/dist/modal/components/AuthInput/AuthInput.js +0 -277
- package/dist/modal/components/AuthInput/hooks/useDropdownPosition.d.ts +0 -7
- package/dist/modal/components/AuthInput/hooks/useDropdownPosition.js +0 -33
- package/dist/modal/components/AuthInput/phoneMasks.d.ts +0 -247
- package/dist/modal/components/AuthInput/phoneMasks.js +0 -253
- package/dist/modal/components/AuthMainStep/AuthMainStep.d.ts +0 -9
- package/dist/modal/components/AuthMainStep/AuthMainStep.js +0 -50
- package/dist/modal/components/AuthMainStep/AuthMainStepContent.d.ts +0 -9
- package/dist/modal/components/AuthMainStep/AuthMainStepContent.js +0 -164
- package/dist/modal/components/AuthOptions/AuthOptions.d.ts +0 -9
- package/dist/modal/components/AuthOptions/AuthOptions.js +0 -85
- package/dist/modal/components/AwaitingBiometricsStep/AwaitingBiometricsStep.d.ts +0 -1
- package/dist/modal/components/AwaitingBiometricsStep/AwaitingBiometricsStep.js +0 -18
- package/dist/modal/components/AwaitingOAuthStep/AwaitingOAuthStep.d.ts +0 -1
- package/dist/modal/components/AwaitingOAuthStep/AwaitingOAuthStep.js +0 -10
- package/dist/modal/components/AwaitingPasswordStep/AwaitingPasswordStep.d.ts +0 -1
- package/dist/modal/components/AwaitingPasswordStep/AwaitingPasswordStep.js +0 -18
- package/dist/modal/components/AwaitingWalletCreationStep/AwaitingWalletCreationStep.d.ts +0 -5
- package/dist/modal/components/AwaitingWalletCreationStep/AwaitingWalletCreationStep.js +0 -49
- package/dist/modal/components/BiometricCreationStep/BiometricCreationStep.d.ts +0 -1
- package/dist/modal/components/BiometricCreationStep/BiometricCreationStep.js +0 -62
- package/dist/modal/components/BiometricLoginStep/BiometricLoginStep.d.ts +0 -1
- package/dist/modal/components/BiometricLoginStep/BiometricLoginStep.js +0 -48
- package/dist/modal/components/Body/AnimatedHeightWrapper.d.ts +0 -6
- package/dist/modal/components/Body/AnimatedHeightWrapper.js +0 -29
- package/dist/modal/components/Body/Body.d.ts +0 -11
- package/dist/modal/components/Body/Body.js +0 -350
- package/dist/modal/components/ChainSwitch/ChainSwitch.d.ts +0 -1
- package/dist/modal/components/ChainSwitch/ChainSwitch.js +0 -95
- package/dist/modal/components/ChainSwitch/config.d.ts +0 -7
- package/dist/modal/components/ChainSwitch/config.js +0 -17
- package/dist/modal/components/Controls/Controls.d.ts +0 -5
- package/dist/modal/components/Controls/Controls.js +0 -78
- package/dist/modal/components/Controls/Selects.d.ts +0 -2
- package/dist/modal/components/Controls/Selects.js +0 -173
- package/dist/modal/components/ExternalWalletNetworkSelectStep/ExternalWalletNetworkSelectStep.d.ts +0 -1
- package/dist/modal/components/ExternalWalletNetworkSelectStep/ExternalWalletNetworkSelectStep.js +0 -75
- package/dist/modal/components/ExternalWalletStep/ExternalWalletStep.d.ts +0 -8
- package/dist/modal/components/ExternalWalletStep/ExternalWalletStep.js +0 -175
- package/dist/modal/components/ExternalWalletStep/config.d.ts +0 -7
- package/dist/modal/components/ExternalWalletStep/config.js +0 -17
- package/dist/modal/components/ExternalWalletVerificationStep/ExternalWalletVerificationStep.d.ts +0 -1
- package/dist/modal/components/ExternalWalletVerificationStep/ExternalWalletVerificationStep.js +0 -39
- package/dist/modal/components/ExternalWallets/ExternalWallets.d.ts +0 -1
- package/dist/modal/components/ExternalWallets/ExternalWallets.js +0 -184
- package/dist/modal/components/Footer/Footer.d.ts +0 -1
- package/dist/modal/components/Footer/Footer.js +0 -95
- package/dist/modal/components/Header/Header.d.ts +0 -1
- package/dist/modal/components/Header/Header.js +0 -43
- package/dist/modal/components/Header/hooks/useStepTitle.d.ts +0 -3
- package/dist/modal/components/Header/hooks/useStepTitle.js +0 -61
- package/dist/modal/components/Hero/Hero.d.ts +0 -1
- package/dist/modal/components/Hero/Hero.js +0 -116
- package/dist/modal/components/IFrameStep/IFrameStep.d.ts +0 -1
- package/dist/modal/components/IFrameStep/IFrameStep.js +0 -59
- package/dist/modal/components/LoginDoneStep/LoginDoneStep.d.ts +0 -5
- package/dist/modal/components/LoginDoneStep/LoginDoneStep.js +0 -44
- package/dist/modal/components/ModalContent/ModalContent.d.ts +0 -10
- package/dist/modal/components/ModalContent/ModalContent.js +0 -88
- package/dist/modal/components/OAuth/FarcasterOAuthStep.d.ts +0 -3
- package/dist/modal/components/OAuth/FarcasterOAuthStep.js +0 -31
- package/dist/modal/components/OAuth/OAuth.d.ts +0 -6
- package/dist/modal/components/OAuth/OAuth.js +0 -79
- package/dist/modal/components/OAuth/TelegramOAuthStep.d.ts +0 -8
- package/dist/modal/components/OAuth/TelegramOAuthStep.js +0 -74
- package/dist/modal/components/OnRampComponents/AddingFunds.d.ts +0 -1
- package/dist/modal/components/OnRampComponents/AddingFunds.js +0 -23
- package/dist/modal/components/OnRampComponents/OnRampProviderButton.d.ts +0 -9
- package/dist/modal/components/OnRampComponents/OnRampProviderButton.js +0 -77
- package/dist/modal/components/RecoverySecretStep/RecoverySecretStep.d.ts +0 -6
- package/dist/modal/components/RecoverySecretStep/RecoverySecretStep.js +0 -107
- package/dist/modal/components/Setup2FAStep/Setup2FAStep.d.ts +0 -5
- package/dist/modal/components/Setup2FAStep/Setup2FAStep.js +0 -132
- package/dist/modal/components/TwoFactorDoneStep/TwoFactorDoneStep.d.ts +0 -5
- package/dist/modal/components/TwoFactorDoneStep/TwoFactorDoneStep.js +0 -27
- package/dist/modal/components/VerificationCodeStep/VerificationCodeStep.d.ts +0 -12
- package/dist/modal/components/VerificationCodeStep/VerificationCodeStep.js +0 -160
- package/dist/modal/components/Waiting/Waiting.d.ts +0 -6
- package/dist/modal/components/Waiting/Waiting.js +0 -17
- package/dist/modal/components/WalletCard/PartnerIcon.d.ts +0 -6
- package/dist/modal/components/WalletCard/PartnerIcon.js +0 -34
- package/dist/modal/components/WalletCard/WalletCard.d.ts +0 -18
- package/dist/modal/components/WalletCard/WalletCard.js +0 -128
- package/dist/modal/components/WalletCreationDoneStep/WalletCreationDoneStep.d.ts +0 -6
- package/dist/modal/components/WalletCreationDoneStep/WalletCreationDoneStep.js +0 -83
- package/dist/modal/components/common.d.ts +0 -59
- package/dist/modal/components/common.js +0 -261
- package/dist/modal/components/index.d.ts +0 -1
- package/dist/modal/components/index.js +0 -2
- package/dist/modal/constants/constants.d.ts +0 -40
- package/dist/modal/constants/constants.js +0 -142
- package/dist/modal/constants/defaults.d.ts +0 -5
- package/dist/modal/constants/defaults.js +0 -10
- package/dist/modal/constants/oAuthLogos.d.ts +0 -17
- package/dist/modal/constants/oAuthLogos.js +0 -158
- package/dist/modal/constants/walletTypeConfig.d.ts +0 -6
- package/dist/modal/constants/walletTypeConfig.js +0 -13
- package/dist/modal/hooks/useGoBack.d.ts +0 -1
- package/dist/modal/hooks/useGoBack.js +0 -43
- package/dist/modal/hooks/useTelegramLogin.d.ts +0 -12
- package/dist/modal/hooks/useTelegramLogin.js +0 -65
- package/dist/modal/index.d.ts +0 -8
- package/dist/modal/index.js +0 -29
- package/dist/modal/stores/index.d.ts +0 -1
- package/dist/modal/stores/index.js +0 -2
- package/dist/modal/stores/modal/actions.d.ts +0 -3
- package/dist/modal/stores/modal/actions.js +0 -135
- package/dist/modal/stores/modal/useModalStore.d.ts +0 -103
- package/dist/modal/stores/modal/useModalStore.js +0 -73
- package/dist/modal/types/commonTypes.d.ts +0 -6
- package/dist/modal/types/commonTypes.js +0 -1
- package/dist/modal/types/modalProps.d.ts +0 -129
- package/dist/modal/types/modalProps.js +0 -12
- package/dist/modal/utils/authInputHelpers.d.ts +0 -5
- package/dist/modal/utils/authInputHelpers.js +0 -41
- package/dist/modal/utils/authLayoutHelpers.d.ts +0 -3
- package/dist/modal/utils/authLayoutHelpers.js +0 -8
- package/dist/modal/utils/countryCodes.d.ts +0 -8
- package/dist/modal/utils/countryCodes.js +0 -45
- package/dist/modal/utils/getMailtoLink.d.ts +0 -1
- package/dist/modal/utils/getMailtoLink.js +0 -10
- package/dist/modal/utils/getTileButtonFlex.d.ts +0 -1
- package/dist/modal/utils/getTileButtonFlex.js +0 -20
- package/dist/modal/utils/getWalletDisplayName.d.ts +0 -5
- package/dist/modal/utils/getWalletDisplayName.js +0 -22
- package/dist/modal/utils/isPasskeySupported.d.ts +0 -1
- package/dist/modal/utils/isPasskeySupported.js +0 -15
- package/dist/modal/utils/openPopup.d.ts +0 -6
- package/dist/modal/utils/openPopup.js +0 -60
- package/dist/modal/utils/routeMobileExternalWallet.d.ts +0 -1
- package/dist/modal/utils/routeMobileExternalWallet.js +0 -31
- package/dist/modal/utils/steps.d.ts +0 -133
- package/dist/modal/utils/steps.js +0 -273
- package/dist/modal/utils/stringFormatters.d.ts +0 -5
- package/dist/modal/utils/stringFormatters.js +0 -19
- package/dist/modal/utils/validateOnRampConfig.d.ts +0 -5
- package/dist/modal/utils/validateOnRampConfig.js +0 -32
- package/dist/provider/actions/getEmbeddedAccount.d.ts +0 -26
- package/dist/provider/actions/getEmbeddedAccount.js +0 -52
- package/dist/provider/actions/getWallet.d.ts +0 -5
- package/dist/provider/actions/getWallet.js +0 -18
- package/dist/provider/actions/index.d.ts +0 -47
- package/dist/provider/actions/index.js +0 -79
- package/dist/provider/actions/utils.d.ts +0 -4
- package/dist/provider/actions/utils.js +0 -34
- package/dist/provider/components/CosmosWalletWrapper.d.ts +0 -11
- package/dist/provider/components/CosmosWalletWrapper.js +0 -43
- package/dist/provider/components/EvmWalletWrapper.d.ts +0 -12
- package/dist/provider/components/EvmWalletWrapper.js +0 -43
- package/dist/provider/components/ExternalWalletWrapper.d.ts +0 -8
- package/dist/provider/components/ExternalWalletWrapper.js +0 -140
- package/dist/provider/components/SolanaWalletWrapper.d.ts +0 -9
- package/dist/provider/components/SolanaWalletWrapper.js +0 -44
- package/dist/provider/external/getParaCosmosConnector.d.ts +0 -7
- package/dist/provider/external/getParaCosmosConnector.js +0 -19
- package/dist/provider/external/getParaCosmosLib.d.ts +0 -4
- package/dist/provider/external/getParaCosmosLib.js +0 -16
- package/dist/provider/external/getParaEvmConnector.d.ts +0 -7
- package/dist/provider/external/getParaEvmConnector.js +0 -19
- package/dist/provider/external/getParaEvmLib.d.ts +0 -4
- package/dist/provider/external/getParaEvmLib.js +0 -16
- package/dist/provider/external/getParaSolanaConnector.d.ts +0 -7
- package/dist/provider/external/getParaSolanaConnector.js +0 -19
- package/dist/provider/external/getParaSolanaLib.d.ts +0 -4
- package/dist/provider/external/getParaSolanaLib.js +0 -16
- package/dist/provider/external/stubs/CosmosExternalWalletContextStub.d.ts +0 -2
- package/dist/provider/external/stubs/CosmosExternalWalletContextStub.js +0 -8
- package/dist/provider/external/stubs/EvmExternalWalletContextStub.d.ts +0 -2
- package/dist/provider/external/stubs/EvmExternalWalletContextStub.js +0 -8
- package/dist/provider/external/stubs/SolanaExternalWalletContextStub.d.ts +0 -2
- package/dist/provider/external/stubs/SolanaExternalWalletContextStub.js +0 -8
- package/dist/provider/hooks/index.d.ts +0 -3
- package/dist/provider/hooks/index.js +0 -4
- package/dist/provider/hooks/mutations/core.d.ts +0 -27
- package/dist/provider/hooks/mutations/core.js +0 -66
- package/dist/provider/hooks/mutations/index.d.ts +0 -3
- package/dist/provider/hooks/mutations/index.js +0 -9
- package/dist/provider/hooks/mutations/useLinkAccount.d.ts +0 -9
- package/dist/provider/hooks/mutations/useLinkAccount.js +0 -18
- package/dist/provider/hooks/mutations/utils.d.ts +0 -12
- package/dist/provider/hooks/mutations/utils.js +0 -90
- package/dist/provider/hooks/queries/core.d.ts +0 -4
- package/dist/provider/hooks/queries/core.js +0 -16
- package/dist/provider/hooks/queries/index.d.ts +0 -4
- package/dist/provider/hooks/queries/index.js +0 -11
- package/dist/provider/hooks/queries/useAccount.d.ts +0 -90
- package/dist/provider/hooks/queries/useAccount.js +0 -135
- package/dist/provider/hooks/queries/useIsFullyLoggedIn.d.ts +0 -5
- package/dist/provider/hooks/queries/useIsFullyLoggedIn.js +0 -24
- package/dist/provider/hooks/queries/useWallet.d.ts +0 -5
- package/dist/provider/hooks/queries/useWallet.js +0 -26
- package/dist/provider/hooks/queries/useWalletBalance.d.ts +0 -6
- package/dist/provider/hooks/queries/useWalletBalance.js +0 -55
- package/dist/provider/hooks/queries/utils.d.ts +0 -7
- package/dist/provider/hooks/queries/utils.js +0 -25
- package/dist/provider/hooks/utils/index.d.ts +0 -3
- package/dist/provider/hooks/utils/index.js +0 -10
- package/dist/provider/hooks/utils/useAutoSessionKeepAlive.d.ts +0 -3
- package/dist/provider/hooks/utils/useAutoSessionKeepAlive.js +0 -74
- package/dist/provider/hooks/utils/useClient.d.ts +0 -5
- package/dist/provider/hooks/utils/useClient.js +0 -10
- package/dist/provider/hooks/utils/useEventListeners.d.ts +0 -2
- package/dist/provider/hooks/utils/useEventListeners.js +0 -157
- package/dist/provider/hooks/utils/useFormattedBiometricHints.d.ts +0 -4
- package/dist/provider/hooks/utils/useFormattedBiometricHints.js +0 -27
- package/dist/provider/hooks/utils/useInternalClient.d.ts +0 -5
- package/dist/provider/hooks/utils/useInternalClient.js +0 -10
- package/dist/provider/hooks/utils/useModal.d.ts +0 -11
- package/dist/provider/hooks/utils/useModal.js +0 -27
- package/dist/provider/hooks/utils/useWalletState.d.ts +0 -15
- package/dist/provider/hooks/utils/useWalletState.js +0 -48
- package/dist/provider/index.d.ts +0 -6
- package/dist/provider/index.js +0 -11
- package/dist/provider/providers/AccountLinkProvider.d.ts +0 -47
- package/dist/provider/providers/AccountLinkProvider.js +0 -452
- package/dist/provider/providers/AuthProvider.d.ts +0 -37
- package/dist/provider/providers/AuthProvider.js +0 -523
- package/dist/provider/providers/CosmosExternalWalletProvider.d.ts +0 -7
- package/dist/provider/providers/CosmosExternalWalletProvider.js +0 -66
- package/dist/provider/providers/EvmExternalWalletProvider.d.ts +0 -7
- package/dist/provider/providers/EvmExternalWalletProvider.js +0 -74
- package/dist/provider/providers/ExternalWalletProvider.d.ts +0 -59
- package/dist/provider/providers/ExternalWalletProvider.js +0 -596
- package/dist/provider/providers/SolanaExternalWalletProvider.d.ts +0 -7
- package/dist/provider/providers/SolanaExternalWalletProvider.js +0 -66
- package/dist/provider/stores/getters.d.ts +0 -4
- package/dist/provider/stores/getters.js +0 -13
- package/dist/provider/stores/setters.d.ts +0 -1
- package/dist/provider/stores/setters.js +0 -7
- package/dist/provider/stores/slices/analytics.d.ts +0 -3
- package/dist/provider/stores/slices/analytics.js +0 -9
- package/dist/provider/stores/slices/client.d.ts +0 -3
- package/dist/provider/stores/slices/client.js +0 -9
- package/dist/provider/stores/slices/config.d.ts +0 -3
- package/dist/provider/stores/slices/config.js +0 -9
- package/dist/provider/stores/slices/externalWallets.d.ts +0 -3
- package/dist/provider/stores/slices/externalWallets.js +0 -46
- package/dist/provider/stores/slices/index.d.ts +0 -5
- package/dist/provider/stores/slices/index.js +0 -6
- package/dist/provider/stores/slices/modal.d.ts +0 -3
- package/dist/provider/stores/slices/modal.js +0 -18
- package/dist/provider/stores/slices/wallet.d.ts +0 -3
- package/dist/provider/stores/slices/wallet.js +0 -13
- package/dist/provider/stores/types.d.ts +0 -76
- package/dist/provider/stores/types.js +0 -1
- package/dist/provider/stores/useStore.d.ts +0 -17
- package/dist/provider/stores/useStore.js +0 -34
- package/dist/provider/types/externalWalletProviders.d.ts +0 -12
- package/dist/provider/types/externalWalletProviders.js +0 -1
- package/dist/provider/types/provider.d.ts +0 -161
- package/dist/provider/types/provider.js +0 -1
- package/dist/provider/types/query.d.ts +0 -3
- package/dist/provider/types/query.js +0 -1
- package/dist/provider/types/utils.d.ts +0 -45
- package/dist/provider/types/utils.js +0 -1
- package/dist/provider/utils/constants.d.ts +0 -5
- package/dist/provider/utils/constants.js +0 -10
- package/dist/provider/utils/paraConfigTypeGuards.d.ts +0 -7
- package/dist/provider/utils/paraConfigTypeGuards.js +0 -13
- package/dist/provider/utils/renameMutations.d.ts +0 -5
- package/dist/provider/utils/renameMutations.js +0 -18
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
__async,
|
|
4
|
+
__spreadProps,
|
|
5
|
+
__spreadValues
|
|
6
|
+
} from "../../chunk-MMUBH76A.js";
|
|
7
|
+
import { useClient } from "@getpara/react-sdk-lite";
|
|
8
|
+
import { useViemAccount } from "./useViemAccount.js";
|
|
9
|
+
import { createParaViemClient } from "@getpara/viem-v2-integration";
|
|
10
|
+
import { useQuery } from "@tanstack/react-query";
|
|
11
|
+
const VIEM_CLIENT_BASE_KEY = "PARA_VIEM_CLIENT";
|
|
12
|
+
const useViemClient = ({ address, walletClientConfig }) => {
|
|
13
|
+
const para = useClient();
|
|
14
|
+
const { viemAccount } = useViemAccount({ address });
|
|
15
|
+
const { data, isLoading } = useQuery({
|
|
16
|
+
queryKey: [VIEM_CLIENT_BASE_KEY, viemAccount, address, walletClientConfig],
|
|
17
|
+
enabled: !!viemAccount && !!para,
|
|
18
|
+
queryFn: () => __async(void 0, null, function* () {
|
|
19
|
+
if (!para || !viemAccount) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
return yield createParaViemClient(para, __spreadProps(__spreadValues({}, walletClientConfig), { account: viemAccount }));
|
|
23
|
+
})
|
|
24
|
+
});
|
|
25
|
+
return { viemClient: data, isLoading };
|
|
26
|
+
};
|
|
27
|
+
export {
|
|
28
|
+
VIEM_CLIENT_BASE_KEY,
|
|
29
|
+
useViemClient
|
|
30
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
export * from '
|
|
2
|
-
|
|
3
|
-
export * from '@getpara/web-sdk';
|
|
4
|
-
export type { Theme } from '@getpara/react-components';
|
|
5
|
-
import ParaWeb from '@getpara/web-sdk';
|
|
1
|
+
export * from '@getpara/react-sdk-lite';
|
|
2
|
+
import ParaWeb from '@getpara/react-sdk-lite';
|
|
6
3
|
export default ParaWeb;
|
|
4
|
+
export { ParaProvider } from './provider/ParaProvider.js';
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "./chunk-MMUBH76A.js";
|
|
3
|
-
export * from "
|
|
4
|
-
|
|
5
|
-
export * from "@getpara/web-sdk";
|
|
6
|
-
import ParaWeb from "@getpara/web-sdk";
|
|
3
|
+
export * from "@getpara/react-sdk-lite";
|
|
4
|
+
import ParaWeb from "@getpara/react-sdk-lite";
|
|
7
5
|
var src_default = ParaWeb;
|
|
6
|
+
import { ParaProvider } from "./provider/ParaProvider.js";
|
|
8
7
|
export {
|
|
8
|
+
ParaProvider,
|
|
9
9
|
src_default as default
|
|
10
10
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ParaProviderProps } from '
|
|
1
|
+
import { ParaModalHandle, ParaProviderProps } from '@getpara/react-sdk-lite';
|
|
2
2
|
import { Chain, Transport } from 'viem';
|
|
3
|
-
import { ParaModalHandle } from '../modal/index.js';
|
|
4
3
|
export declare const ParaProvider: import("react").ForwardRefExoticComponent<ParaProviderProps<readonly [Chain, ...Chain[]], Record<number, Transport>> & import("react").RefAttributes<ParaModalHandle>>;
|
|
@@ -1,115 +1,22 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
|
+
__objRest,
|
|
3
4
|
__spreadProps,
|
|
4
5
|
__spreadValues
|
|
5
6
|
} from "../chunk-MMUBH76A.js";
|
|
6
|
-
import { jsx
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
import { ParaModal } from "../modal/ParaModal.js";
|
|
13
|
-
import { isConfigType, isParaWeb } from "./utils/paraConfigTypeGuards.js";
|
|
14
|
-
import ParaWeb from "@getpara/web-sdk";
|
|
15
|
-
import { EXTERNAL_WALLET_TYPES } from "@getpara/web-sdk";
|
|
16
|
-
import { AuthProvider } from "./providers/AuthProvider.js";
|
|
17
|
-
import { AccountLinkProvider } from "./providers/AccountLinkProvider.js";
|
|
18
|
-
const ParaProvider = forwardRef(({ children, paraClientConfig, callbacks, config, externalWalletConfig, paraModalConfig }, ref) => {
|
|
19
|
-
useEventListeners(callbacks);
|
|
20
|
-
useAutoSessionKeepAlive({ disabled: config.disableAutoSessionKeepAlive });
|
|
21
|
-
const setClient = useStore((state) => state.setClient);
|
|
22
|
-
const client = useStore((state) => state.client);
|
|
23
|
-
const setExternalWallets = useStore((state) => state.setExternalWallets);
|
|
24
|
-
const externalWallets = useStore((state) => state.externalWallets);
|
|
25
|
-
const setExternalWalletsWithFullAuth = useStore((state) => state.setExternalWalletsWithFullAuth);
|
|
26
|
-
const externalWalletsWithFullAuth = useStore((state) => state.externalWalletsWithFullAuth);
|
|
27
|
-
const setIncludeWalletVerification = useStore((state) => state.setIncludeWalletVerification);
|
|
28
|
-
const includeWalletVerification = useStore((state) => state.includeWalletVerification);
|
|
29
|
-
const setConnectionOnly = useStore((state) => state.setConnectionOnly);
|
|
30
|
-
const connectionOnly = useStore((state) => state.connectionOnly);
|
|
31
|
-
const setModalConfig = useStore((state) => state.setModalConfig);
|
|
32
|
-
const modalConfig = useStore((state) => state.modalConfig);
|
|
33
|
-
const setAppName = useStore((state) => state.setAppName);
|
|
34
|
-
const appName = useStore((state) => state.appName);
|
|
35
|
-
const rpcUrl = useStore((state) => state.rpcUrl);
|
|
36
|
-
const setRpcUrl = useStore((state) => state.setRpcUrl);
|
|
37
|
-
const setProviderProps = useStore((state) => state.setProviderProps);
|
|
38
|
-
useEffect(() => {
|
|
39
|
-
setProviderProps(__spreadProps(__spreadValues(__spreadValues(__spreadValues({}, config), externalWalletConfig), paraModalConfig), {
|
|
40
|
-
// Redacting walletConnect to avoid exposing project id
|
|
41
|
-
walletConnect: void 0
|
|
42
|
-
}));
|
|
43
|
-
}, [config, externalWalletConfig, paraModalConfig]);
|
|
44
|
-
useEffect(() => {
|
|
45
|
-
if (rpcUrl !== config.rpcUrl) setRpcUrl(config.rpcUrl);
|
|
46
|
-
}, [config.rpcUrl]);
|
|
47
|
-
useEffect(() => {
|
|
48
|
-
if (appName !== config.appName) setAppName(config.appName);
|
|
49
|
-
}, [config.appName]);
|
|
50
|
-
useEffect(() => {
|
|
51
|
-
if (modalConfig !== paraModalConfig) setModalConfig(paraModalConfig);
|
|
52
|
-
}, [paraModalConfig]);
|
|
53
|
-
useEffect(() => {
|
|
54
|
-
var _a;
|
|
55
|
-
if (connectionOnly !== (externalWalletConfig == null ? void 0 : externalWalletConfig.connectionOnly)) {
|
|
56
|
-
setConnectionOnly((_a = externalWalletConfig == null ? void 0 : externalWalletConfig.connectionOnly) != null ? _a : false);
|
|
57
|
-
}
|
|
58
|
-
}, [externalWalletConfig == null ? void 0 : externalWalletConfig.connectionOnly]);
|
|
59
|
-
useEffect(() => {
|
|
60
|
-
var _a, _b;
|
|
61
|
-
if (includeWalletVerification !== (externalWalletConfig == null ? void 0 : externalWalletConfig.includeWalletVerification)) {
|
|
62
|
-
if ((externalWalletConfig == null ? void 0 : externalWalletConfig.connectionOnly) || (isConfigType(paraClientConfig) ? (_a = paraClientConfig.opts) == null ? void 0 : _a.externalWalletConnectionOnly : paraClientConfig.externalWalletConnectionOnly)) {
|
|
63
|
-
console.warn("includeWalletVerification has no effect when using connection only external wallets");
|
|
64
|
-
setIncludeWalletVerification(false);
|
|
65
|
-
} else {
|
|
66
|
-
setIncludeWalletVerification((_b = externalWalletConfig == null ? void 0 : externalWalletConfig.includeWalletVerification) != null ? _b : false);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}, [externalWalletConfig == null ? void 0 : externalWalletConfig.includeWalletVerification]);
|
|
70
|
-
useEffect(() => {
|
|
71
|
-
var _a;
|
|
72
|
-
if (externalWallets !== (externalWalletConfig == null ? void 0 : externalWalletConfig.wallets)) {
|
|
73
|
-
setExternalWallets((_a = externalWalletConfig == null ? void 0 : externalWalletConfig.wallets) != null ? _a : [...EXTERNAL_WALLET_TYPES]);
|
|
74
|
-
}
|
|
75
|
-
}, [externalWalletConfig == null ? void 0 : externalWalletConfig.wallets]);
|
|
76
|
-
useEffect(() => {
|
|
77
|
-
var _a, _b;
|
|
78
|
-
if (externalWalletsWithFullAuth !== (externalWalletConfig == null ? void 0 : externalWalletConfig.createLinkedEmbeddedForExternalWallets)) {
|
|
79
|
-
if ((externalWalletConfig == null ? void 0 : externalWalletConfig.connectionOnly) || (isConfigType(paraClientConfig) ? (_a = paraClientConfig.opts) == null ? void 0 : _a.externalWalletConnectionOnly : paraClientConfig.externalWalletConnectionOnly)) {
|
|
80
|
-
console.warn("createLinkedEmbeddedForExternalWallets has no effect when using connection only external wallets");
|
|
81
|
-
setExternalWalletsWithFullAuth([]);
|
|
82
|
-
} else {
|
|
83
|
-
setExternalWalletsWithFullAuth(
|
|
84
|
-
(externalWalletConfig == null ? void 0 : externalWalletConfig.createLinkedEmbeddedForExternalWallets) === "ALL" ? [...EXTERNAL_WALLET_TYPES] : (_b = externalWalletConfig == null ? void 0 : externalWalletConfig.createLinkedEmbeddedForExternalWallets) != null ? _b : []
|
|
85
|
-
);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}, [externalWalletConfig == null ? void 0 : externalWalletConfig.createLinkedEmbeddedForExternalWallets]);
|
|
89
|
-
useEffect(() => {
|
|
90
|
-
if (!isConfigType(paraClientConfig) && !isParaWeb(paraClientConfig)) {
|
|
91
|
-
throw new Error("Invalid Para config");
|
|
92
|
-
}
|
|
93
|
-
const newClient = isConfigType(paraClientConfig) ? new ParaWeb(paraClientConfig.env, paraClientConfig.apiKey, paraClientConfig.opts) : paraClientConfig;
|
|
94
|
-
setClient(newClient);
|
|
95
|
-
}, [paraClientConfig]);
|
|
96
|
-
if (!client) {
|
|
97
|
-
return null;
|
|
98
|
-
}
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
import { ParaProviderMin } from "@getpara/react-sdk-lite";
|
|
9
|
+
import { forwardRef } from "react";
|
|
10
|
+
const ParaProvider = forwardRef((_a, ref) => {
|
|
11
|
+
var _b = _a, { children, externalWalletConfig } = _b, providerProps = __objRest(_b, ["children", "externalWalletConfig"]);
|
|
12
|
+
var _a2;
|
|
99
13
|
return /* @__PURE__ */ jsx(
|
|
100
|
-
|
|
101
|
-
{
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
createWallets: paraModalConfig == null ? void 0 : paraModalConfig.createWalletOverride
|
|
107
|
-
},
|
|
108
|
-
children: /* @__PURE__ */ jsx(ExternalWalletWrapper, { config: externalWalletConfig, children: /* @__PURE__ */ jsxs(AccountLinkProvider, { children: [
|
|
109
|
-
children,
|
|
110
|
-
!config.disableEmbeddedModal && client.isReady && /* @__PURE__ */ jsx(ParaModal, { ref })
|
|
111
|
-
] }) })
|
|
112
|
-
}
|
|
14
|
+
ParaProviderMin,
|
|
15
|
+
__spreadProps(__spreadValues({}, providerProps), {
|
|
16
|
+
externalWalletConfig: __spreadProps(__spreadValues({}, externalWalletConfig), { wallets: (_a2 = externalWalletConfig == null ? void 0 : externalWalletConfig.wallets) != null ? _a2 : [] }),
|
|
17
|
+
ref,
|
|
18
|
+
children
|
|
19
|
+
})
|
|
113
20
|
);
|
|
114
21
|
});
|
|
115
22
|
export {
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import ParaWeb from '@getpara/react-sdk-lite';
|
|
2
|
+
import { SolanaRpcApi } from '@solana/rpc-api';
|
|
3
|
+
import { Rpc } from '@solana/rpc-spec';
|
|
4
|
+
export declare const getSolanaSigner: ({ para, rpc, walletId, }: {
|
|
5
|
+
para: ParaWeb;
|
|
6
|
+
walletId?: string;
|
|
7
|
+
rpc: Rpc<SolanaRpcApi>;
|
|
8
|
+
}) => Promise<import("@getpara/solana-signers-v2-integration").ParaSolanaSigner>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
__async
|
|
4
|
+
} from "../../chunk-MMUBH76A.js";
|
|
5
|
+
import { createParaSolanaSigner } from "@getpara/solana-signers-v2-integration";
|
|
6
|
+
const getSolanaSigner = (_0) => __async(void 0, [_0], function* ({
|
|
7
|
+
para,
|
|
8
|
+
rpc,
|
|
9
|
+
walletId
|
|
10
|
+
}) {
|
|
11
|
+
return createParaSolanaSigner({ para, rpc, walletId });
|
|
12
|
+
});
|
|
13
|
+
export {
|
|
14
|
+
getSolanaSigner
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './getSolanaSigner.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useSolanaSigner.js';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SolanaRpcApi } from '@solana/rpc-api';
|
|
2
|
+
import { Rpc } from '@solana/rpc-spec';
|
|
3
|
+
export declare const SOLANA_SIGNER_BASE_KEY = "PARA_SOLANA_SIGNER";
|
|
4
|
+
type UseSolanaSignerParameters = {
|
|
5
|
+
walletId?: string;
|
|
6
|
+
rpc: Rpc<SolanaRpcApi>;
|
|
7
|
+
};
|
|
8
|
+
export declare const useSolanaSigner: ({ walletId, rpc }: UseSolanaSignerParameters) => {
|
|
9
|
+
solanaSigner: import("@getpara/solana-signers-v2-integration").ParaSolanaSigner | null | undefined;
|
|
10
|
+
isLoading: boolean;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
__async
|
|
4
|
+
} from "../../chunk-MMUBH76A.js";
|
|
5
|
+
import { useAccount, useClient, useWallet } from "@getpara/react-sdk-lite";
|
|
6
|
+
import { useQuery } from "@tanstack/react-query";
|
|
7
|
+
import { getSolanaSigner } from "../actions/index.js";
|
|
8
|
+
const SOLANA_SIGNER_BASE_KEY = "PARA_SOLANA_SIGNER";
|
|
9
|
+
const useSolanaSigner = ({ walletId, rpc }) => {
|
|
10
|
+
const para = useClient();
|
|
11
|
+
const {
|
|
12
|
+
isConnected,
|
|
13
|
+
embedded: { userId }
|
|
14
|
+
} = useAccount();
|
|
15
|
+
const { data: wallet } = useWallet();
|
|
16
|
+
const { data, isLoading } = useQuery({
|
|
17
|
+
queryKey: [SOLANA_SIGNER_BASE_KEY, isConnected, userId, walletId != null ? walletId : (wallet == null ? void 0 : wallet.type) === "SOLANA" ? wallet == null ? void 0 : wallet.id : null],
|
|
18
|
+
enabled: isConnected && !!para,
|
|
19
|
+
queryFn: () => __async(void 0, null, function* () {
|
|
20
|
+
if (!isConnected || !para) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
const _id = walletId != null ? walletId : (wallet == null ? void 0 : wallet.type) === "SOLANA" ? wallet == null ? void 0 : wallet.id : void 0;
|
|
24
|
+
return yield getSolanaSigner({ para, rpc, walletId: _id });
|
|
25
|
+
})
|
|
26
|
+
});
|
|
27
|
+
return { solanaSigner: data, isLoading };
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
SOLANA_SIGNER_BASE_KEY,
|
|
31
|
+
useSolanaSigner
|
|
32
|
+
};
|
package/package.json
CHANGED
|
@@ -1,61 +1,51 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpara/react-sdk",
|
|
3
|
-
"version": "2.0.0-dev.
|
|
3
|
+
"version": "2.0.0-dev.5",
|
|
4
4
|
"bin": {
|
|
5
5
|
"setup-para": "dist/cli/cli.mjs"
|
|
6
6
|
},
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@getpara/
|
|
9
|
-
"@getpara/
|
|
10
|
-
"@getpara/
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"zustand": "^4.5.2",
|
|
16
|
-
"zustand-sync-tabs": "^0.2.2"
|
|
8
|
+
"@getpara/cosmjs-v0-integration": "2.0.0-alpha.43",
|
|
9
|
+
"@getpara/cosmos-wallet-connectors": "2.0.0-alpha.43",
|
|
10
|
+
"@getpara/evm-wallet-connectors": "2.0.0-alpha.43",
|
|
11
|
+
"@getpara/react-sdk-lite": "2.0.0-dev.5",
|
|
12
|
+
"@getpara/solana-signers-v2-integration": "2.0.0-alpha.43",
|
|
13
|
+
"@getpara/solana-wallet-connectors": "2.0.0-alpha.43",
|
|
14
|
+
"@getpara/viem-v2-integration": "2.0.0-alpha.43"
|
|
17
15
|
},
|
|
18
16
|
"devDependencies": {
|
|
19
|
-
"@getpara/cosmos-wallet-connectors": "2.0.0-dev.3",
|
|
20
|
-
"@getpara/evm-wallet-connectors": "2.0.0-dev.3",
|
|
21
|
-
"@getpara/solana-wallet-connectors": "2.0.0-dev.3",
|
|
22
|
-
"@tanstack/react-query": "^5.74.0",
|
|
23
|
-
"@testing-library/dom": "^10.4.0",
|
|
24
|
-
"@testing-library/react": "^16.3.0",
|
|
25
|
-
"@testing-library/react-hooks": "^8.0.1",
|
|
26
|
-
"@testing-library/user-event": "^14.6.1",
|
|
27
|
-
"@types/chrome": "^0.0.237",
|
|
28
17
|
"@types/react": "^18.0.31",
|
|
29
18
|
"@types/react-dom": "^18.2.7",
|
|
30
19
|
"typescript": "^5.8.3"
|
|
31
20
|
},
|
|
32
21
|
"exports": {
|
|
33
22
|
".": "./dist/index.js",
|
|
34
|
-
"./styles.css": "./dist/css/modal.css"
|
|
23
|
+
"./styles.css": "./dist/css/modal.css",
|
|
24
|
+
"./evm": "./dist/evm/index.js",
|
|
25
|
+
"./evm/hooks": "./dist/evm/hooks/index.js",
|
|
26
|
+
"./evm/actions": "./dist/evm/actions/index.js",
|
|
27
|
+
"./cosmos": "./dist/cosmos/index.js",
|
|
28
|
+
"./cosmos/hooks": "./dist/cosmos/hooks/index.js",
|
|
29
|
+
"./cosmos/actions": "./dist/cosmos/actions/index.js",
|
|
30
|
+
"./solana": "./dist/solana/index.js",
|
|
31
|
+
"./solana/hooks": "./dist/solana/hooks/index.js",
|
|
32
|
+
"./solana/actions": "./dist/solana/actions/index.js"
|
|
35
33
|
},
|
|
36
34
|
"files": [
|
|
37
35
|
"dist",
|
|
38
36
|
"package.json",
|
|
39
37
|
"styles.css"
|
|
40
38
|
],
|
|
41
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "e6e791d4e4f9afd94f2093d6045d686b85e5a682",
|
|
42
40
|
"main": "dist/index.js",
|
|
43
41
|
"peerDependencies": {
|
|
44
|
-
"@getpara/cosmos-wallet-connectors": "^2.0.0-alpha.26",
|
|
45
|
-
"@getpara/evm-wallet-connectors": "^2.0.0-alpha.26",
|
|
46
|
-
"@getpara/solana-wallet-connectors": "^2.0.0-alpha.26",
|
|
47
42
|
"@tanstack/react-query": ">=5.0.0",
|
|
48
43
|
"react": "*",
|
|
49
44
|
"react-dom": "*"
|
|
50
45
|
},
|
|
51
|
-
"resolutions": {
|
|
52
|
-
"styled-components": "^6"
|
|
53
|
-
},
|
|
54
46
|
"scripts": {
|
|
55
47
|
"build": "rm -rf dist && yarn typegen && node ./scripts/build.mjs && yarn post-build",
|
|
56
|
-
"cli": "node ./dist/cli/cli.mjs",
|
|
57
48
|
"post-build": "./scripts/post-build.sh",
|
|
58
|
-
"test": "vitest run --coverage",
|
|
59
49
|
"typegen": "tsc --emitDeclarationOnly"
|
|
60
50
|
},
|
|
61
51
|
"sideEffects": [
|
package/styles.css/package.json
CHANGED
package/dist/cli/cli.mjs
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import * as fs from 'node:fs/promises';
|
|
3
|
-
import * as path from 'node:path';
|
|
4
|
-
import { createRequire } from 'module';
|
|
5
|
-
const require = createRequire(import.meta.url);
|
|
6
|
-
|
|
7
|
-
const PACKAGES_TO_STUB = [
|
|
8
|
-
'@getpara/evm-wallet-connectors',
|
|
9
|
-
'@getpara/cosmos-wallet-connectors',
|
|
10
|
-
'@getpara/solana-wallet-connectors',
|
|
11
|
-
'@farcaster/miniapp-sdk',
|
|
12
|
-
'@farcaster/miniapp-wagmi-connector',
|
|
13
|
-
];
|
|
14
|
-
|
|
15
|
-
const checkForPackages = async () => {
|
|
16
|
-
const pathToNodeModules = path.resolve('node_modules');
|
|
17
|
-
|
|
18
|
-
for (let i = 0; i < PACKAGES_TO_STUB.length; i++) {
|
|
19
|
-
const packageName = PACKAGES_TO_STUB[i];
|
|
20
|
-
try {
|
|
21
|
-
await import(packageName);
|
|
22
|
-
} catch (err) {
|
|
23
|
-
if (err.code === 'ERR_MODULE_NOT_FOUND') {
|
|
24
|
-
const packageJsonContent = { name: packageName, main: './index.js' };
|
|
25
|
-
|
|
26
|
-
await fs.mkdir(path.join(pathToNodeModules, packageName), { recursive: true });
|
|
27
|
-
const indexPath = path.join(pathToNodeModules, packageName, 'index.js');
|
|
28
|
-
const packageJsonPath = path.join(pathToNodeModules, packageName, 'package.json');
|
|
29
|
-
|
|
30
|
-
try {
|
|
31
|
-
await fs.access(indexPath);
|
|
32
|
-
} catch {
|
|
33
|
-
await fs.writeFile(indexPath, '//STUB');
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
try {
|
|
37
|
-
await fs.access(packageJsonPath);
|
|
38
|
-
} catch {
|
|
39
|
-
await fs.writeFile(packageJsonPath, JSON.stringify(packageJsonContent), {
|
|
40
|
-
encoding: 'utf-8',
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
process.exit();
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
await checkForPackages();
|