@multiversx/sdk-dapp-liquidity 2.1.0-alpha.0 → 2.1.0-alpha.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/all-networks--dfVLHLJ.js +2 -0
- package/all-networks-Czd8zS1n.mjs +4 -0
- package/api/checkAccount.js +1 -21
- package/api/checkAccount.mjs +13 -13
- package/api/confirmRate.js +1 -29
- package/api/confirmRate.mjs +17 -22
- package/api/getChains.js +1 -17
- package/api/getChains.mjs +10 -10
- package/api/getRate.js +1 -27
- package/api/getRate.mjs +17 -20
- package/api/getTokens.js +1 -22
- package/api/getTokens.mjs +14 -15
- package/api/getTokensBalances.js +1 -21
- package/api/getTokensBalances.mjs +13 -13
- package/api/getTransactions.js +1 -38
- package/api/getTransactions.mjs +25 -31
- package/api/index.js +1 -18
- package/api/index.mjs +16 -16
- package/api/sendTransactions.js +1 -32
- package/api/sendTransactions.mjs +19 -19
- package/api/tests/confirmRate.spec.js +1 -130
- package/api/tests/confirmRate.spec.mjs +44 -58
- package/api/tests/getChains.spec.js +1 -43
- package/api/tests/getChains.spec.mjs +15 -18
- package/api/tests/getRate.spec.js +1 -87
- package/api/tests/getRate.spec.mjs +35 -49
- package/api/tests/getTokens.spec.js +1 -68
- package/api/tests/getTokens.spec.mjs +23 -29
- package/api/tests/getTransactions.spec.js +1 -94
- package/api/tests/getTransactions.spec.mjs +35 -51
- package/api/tests/sendTransactions.spec.js +1 -96
- package/api/tests/sendTransactions.spec.mjs +44 -52
- package/constants/index.js +1 -4
- package/constants/index.mjs +2 -2
- package/default-D0Jk5ROI.mjs +4 -0
- package/default-DbU6vPaB.js +2 -0
- package/helpers/assertRateConfirmationMatchesIntent.js +1 -23
- package/helpers/assertRateConfirmationMatchesIntent.mjs +13 -16
- package/helpers/base64Utils.js +1 -31
- package/helpers/base64Utils.mjs +14 -24
- package/helpers/decodeLoginToken.js +1 -27
- package/helpers/decodeLoginToken.mjs +13 -18
- package/helpers/decodeToken.js +1 -39
- package/helpers/decodeToken.mjs +20 -31
- package/helpers/getApiURL.js +1 -7
- package/helpers/getApiURL.mjs +3 -5
- package/helpers/getBridgeURL.js +1 -7
- package/helpers/getBridgeURL.mjs +3 -5
- package/helpers/getDisplayName.js +1 -11
- package/helpers/getDisplayName.mjs +3 -8
- package/helpers/getMvxApiURL.js +1 -7
- package/helpers/getMvxApiURL.mjs +3 -5
- package/helpers/getMvxChainId.js +1 -7
- package/helpers/getMvxChainId.mjs +3 -5
- package/helpers/getMvxExplorerAddress.js +1 -7
- package/helpers/getMvxExplorerAddress.mjs +3 -5
- package/helpers/index.js +1 -26
- package/helpers/index.mjs +24 -24
- package/helpers/safeImageUrl.js +1 -23
- package/helpers/safeImageUrl.mjs +10 -20
- package/helpers/serializeTransaction.js +1 -8
- package/helpers/serializeTransaction.mjs +3 -5
- package/helpers/tests/assertRateConfirmationMatchesIntent.spec.js +1 -63
- package/helpers/tests/assertRateConfirmationMatchesIntent.spec.mjs +31 -41
- package/helpers/tests/base64Utils.spec.js +1 -29
- package/helpers/tests/base64Utils.spec.mjs +11 -24
- package/helpers/tests/decodeLoginToken.spec.js +1 -34
- package/helpers/tests/decodeLoginToken.spec.mjs +13 -24
- package/helpers/tests/decodeToken.spec.js +1 -27
- package/helpers/tests/decodeToken.spec.mjs +7 -12
- package/helpers/tests/safeImageUrl.spec.js +1 -48
- package/helpers/tests/safeImageUrl.spec.mjs +28 -43
- package/helpers/tests/serializeTransaction.spec.js +1 -36
- package/helpers/tests/serializeTransaction.spec.mjs +13 -24
- package/index.js +1 -232
- package/index.mjs +196 -196
- package/package.json +5 -4
- package/react.esm-B0AMOHxa.js +73 -0
- package/react.esm-BxvJJ86Q.mjs +9949 -0
- package/reactjs/adapters/SuiAdapter.js +1 -378
- package/reactjs/adapters/SuiAdapter.mjs +160 -217
- package/reactjs/components/AccountAddress/AccountAddress.js +1 -31
- package/reactjs/components/AccountAddress/AccountAddress.mjs +16 -16
- package/reactjs/components/AccountAddress/index.js +1 -4
- package/reactjs/components/AccountAddress/index.mjs +2 -2
- package/reactjs/components/AmountCard/AmountCard.js +1 -33
- package/reactjs/components/AmountCard/AmountCard.mjs +19 -21
- package/reactjs/components/AmountCard/index.js +1 -4
- package/reactjs/components/AmountCard/index.mjs +2 -2
- package/reactjs/components/AmountInput/AmountInput.js +1 -71
- package/reactjs/components/AmountInput/AmountInput.mjs +42 -46
- package/reactjs/components/AmountInput/index.js +1 -4
- package/reactjs/components/AmountInput/index.mjs +2 -2
- package/reactjs/components/BridgeForm/BridgeForm.d.ts +9 -0
- package/reactjs/components/BridgeForm/BridgeForm.js +1 -89
- package/reactjs/components/BridgeForm/BridgeForm.mjs +72 -79
- package/reactjs/components/BridgeForm/Deposit.js +1 -675
- package/reactjs/components/BridgeForm/Deposit.mjs +380 -504
- package/reactjs/components/BridgeForm/Transfer.js +1 -561
- package/reactjs/components/BridgeForm/Transfer.mjs +315 -428
- package/reactjs/components/BridgeForm/hooks/useBridgeAmounts.js +1 -78
- package/reactjs/components/BridgeForm/hooks/useBridgeAmounts.mjs +47 -70
- package/reactjs/components/BridgeForm/hooks/useBridgeRateFetching.js +1 -58
- package/reactjs/components/BridgeForm/hooks/useBridgeRateFetching.mjs +36 -47
- package/reactjs/components/BridgeForm/hooks/useBridgeTokenSelection.js +1 -266
- package/reactjs/components/BridgeForm/hooks/useBridgeTokenSelection.mjs +163 -231
- package/reactjs/components/BridgeForm/index.js +1 -4
- package/reactjs/components/BridgeForm/index.mjs +2 -2
- package/reactjs/components/BridgeForm/utils/bridgeFormHelpers.js +1 -76
- package/reactjs/components/BridgeForm/utils/bridgeFormHelpers.mjs +33 -65
- package/reactjs/components/BridgeHistory/BridgeHistory.js +1 -381
- package/reactjs/components/BridgeHistory/BridgeHistory.mjs +170 -200
- package/reactjs/components/BridgeHistory/index.js +1 -4
- package/reactjs/components/BridgeHistory/index.mjs +2 -2
- package/reactjs/components/Connect/BridgeAccountDisplay.js +1 -150
- package/reactjs/components/Connect/BridgeAccountDisplay.mjs +99 -115
- package/reactjs/components/Connect/BridgeConnectButton.js +1 -35
- package/reactjs/components/Connect/BridgeConnectButton.mjs +20 -20
- package/reactjs/components/Connect/ChainSelectConnect.js +1 -144
- package/reactjs/components/Connect/ChainSelectConnect.mjs +70 -83
- package/reactjs/components/Connect/CustomConnectButton.js +1 -40
- package/reactjs/components/Connect/CustomConnectButton.mjs +24 -30
- package/reactjs/components/Connect/MvxAccountDisplay.js +1 -97
- package/reactjs/components/Connect/MvxAccountDisplay.mjs +47 -50
- package/reactjs/components/Connect/MvxConnectButton.js +1 -43
- package/reactjs/components/Connect/MvxConnectButton.mjs +35 -40
- package/reactjs/components/Connect/SwitchChainButton.js +1 -29
- package/reactjs/components/Connect/SwitchChainButton.mjs +15 -18
- package/reactjs/components/Connect/index.js +1 -16
- package/reactjs/components/Connect/index.mjs +14 -14
- package/reactjs/components/CopyButton/CopyButton.js +1 -46
- package/reactjs/components/CopyButton/CopyButton.mjs +33 -36
- package/reactjs/components/CopyButton/index.js +1 -4
- package/reactjs/components/CopyButton/index.mjs +2 -2
- package/reactjs/components/CopyButton/utils/copyToClipboard.js +1 -38
- package/reactjs/components/CopyButton/utils/copyToClipboard.mjs +20 -32
- package/reactjs/components/CopyButton/utils/index.js +1 -4
- package/reactjs/components/CopyButton/utils/index.mjs +2 -2
- package/reactjs/components/DisplayAmount/DisplayAmount.js +1 -90
- package/reactjs/components/DisplayAmount/DisplayAmount.mjs +68 -75
- package/reactjs/components/DisplayAmount/components/AnimateNumber/AnimateNumber.js +1 -39
- package/reactjs/components/DisplayAmount/components/AnimateNumber/AnimateNumber.mjs +26 -33
- package/reactjs/components/DisplayAmount/components/PrecisedAmount/PrecisedAmount.js +1 -61
- package/reactjs/components/DisplayAmount/components/PrecisedAmount/PrecisedAmount.mjs +38 -46
- package/reactjs/components/DisplayAmount/index.js +1 -4
- package/reactjs/components/DisplayAmount/index.mjs +2 -2
- package/reactjs/components/DisplayAmount/utils/index.js +1 -4
- package/reactjs/components/DisplayAmount/utils/index.mjs +2 -2
- package/reactjs/components/DisplayAmount/utils/truncateAmount.js +1 -21
- package/reactjs/components/DisplayAmount/utils/truncateAmount.mjs +9 -13
- package/reactjs/components/Error/Error.js +1 -66
- package/reactjs/components/Error/Error.mjs +29 -29
- package/reactjs/components/Error/index.js +1 -4
- package/reactjs/components/Error/index.mjs +2 -2
- package/reactjs/components/SmallLoader/SmallLoader.js +1 -21
- package/reactjs/components/SmallLoader/SmallLoader.mjs +13 -18
- package/reactjs/components/SmallLoader/index.js +1 -4
- package/reactjs/components/SmallLoader/index.mjs +2 -2
- package/reactjs/components/ToggleDirection/ToggleDirection.js +1 -30
- package/reactjs/components/ToggleDirection/ToggleDirection.mjs +22 -28
- package/reactjs/components/TokenSelector/TokenSelector.js +1 -172
- package/reactjs/components/TokenSelector/TokenSelector.mjs +98 -118
- package/reactjs/components/TokenSelector/components/ChainSelect/ChainSelect.js +1 -94
- package/reactjs/components/TokenSelector/components/ChainSelect/ChainSelect.mjs +48 -57
- package/reactjs/components/TokenSelector/components/ChainSelect/components/ChainOptionLabel.js +1 -55
- package/reactjs/components/TokenSelector/components/ChainSelect/components/ChainOptionLabel.mjs +45 -48
- package/reactjs/components/TokenSelector/components/ChainSelect/components/FormatChainOptionLabel.js +1 -18
- package/reactjs/components/TokenSelector/components/ChainSelect/components/FormatChainOptionLabel.mjs +9 -14
- package/reactjs/components/TokenSelector/components/ChainSelect/components/IndicatorSeparator.js +1 -6
- package/reactjs/components/TokenSelector/components/ChainSelect/components/IndicatorSeparator.mjs +2 -4
- package/reactjs/components/TokenSelector/components/ChainSelect/components/SelectedChainOption.js +1 -43
- package/reactjs/components/TokenSelector/components/ChainSelect/components/SelectedChainOption.mjs +21 -21
- package/reactjs/components/TokenSelector/components/SelectContainer.js +1 -40
- package/reactjs/components/TokenSelector/components/SelectContainer.mjs +36 -38
- package/reactjs/components/TokenSelector/components/SelectContent.js +1 -136
- package/reactjs/components/TokenSelector/components/SelectContent.mjs +79 -103
- package/reactjs/components/TokenSelector/components/SelectedOption.js +1 -28
- package/reactjs/components/TokenSelector/components/SelectedOption.mjs +22 -24
- package/reactjs/components/TokenSelector/components/TokenIcon.js +1 -82
- package/reactjs/components/TokenSelector/components/TokenIcon.mjs +52 -58
- package/reactjs/components/TokenSelector/components/TokenItem.js +1 -80
- package/reactjs/components/TokenSelector/components/TokenItem.mjs +41 -54
- package/reactjs/components/TokenSelector/components/TokenList.js +1 -23
- package/reactjs/components/TokenSelector/components/TokenList.mjs +19 -21
- package/reactjs/components/TokenSelector/components/TokenSymbol.js +1 -25
- package/reactjs/components/TokenSelector/components/TokenSymbol.mjs +14 -15
- package/reactjs/components/TokenSelector/index.js +1 -4
- package/reactjs/components/TokenSelector/index.mjs +2 -2
- package/reactjs/components/TransactionToast/TransactionToast.js +1 -53
- package/reactjs/components/TransactionToast/TransactionToast.mjs +27 -28
- package/reactjs/components/TransactionToast/TransactionToastContainer.js +1 -20
- package/reactjs/components/TransactionToast/TransactionToastContainer.mjs +16 -18
- package/reactjs/components/TransactionToast/index.js +1 -6
- package/reactjs/components/TransactionToast/index.mjs +4 -4
- package/reactjs/components/TrimAddress/TrimAddress.js +1 -27
- package/reactjs/components/TrimAddress/TrimAddress.mjs +19 -24
- package/reactjs/components/TrimAddress/index.js +1 -4
- package/reactjs/components/TrimAddress/index.mjs +2 -2
- package/reactjs/components/base/MxButton/MxButton.js +1 -71
- package/reactjs/components/base/MxButton/MxButton.mjs +46 -46
- package/reactjs/components/base/MxButton/index.js +1 -4
- package/reactjs/components/base/MxButton/index.mjs +2 -2
- package/reactjs/components/base/MxCard/MxCard.js +1 -54
- package/reactjs/components/base/MxCard/MxCard.mjs +34 -34
- package/reactjs/components/base/MxCard/index.js +1 -4
- package/reactjs/components/base/MxCard/index.mjs +2 -2
- package/reactjs/components/base/MxCircleLoader/MxCircleLoader.js +1 -28
- package/reactjs/components/base/MxCircleLoader/MxCircleLoader.mjs +24 -26
- package/reactjs/components/base/MxCircleLoader/index.js +1 -4
- package/reactjs/components/base/MxCircleLoader/index.mjs +2 -2
- package/reactjs/components/base/MxLink/MxLink.js +1 -70
- package/reactjs/components/base/MxLink/MxLink.mjs +44 -46
- package/reactjs/components/base/MxLink/index.js +1 -4
- package/reactjs/components/base/MxLink/index.mjs +2 -2
- package/reactjs/components/base/MxSearch/MxSearch.js +1 -69
- package/reactjs/components/base/MxSearch/MxSearch.mjs +37 -41
- package/reactjs/components/base/MxSearch/index.js +1 -4
- package/reactjs/components/base/MxSearch/index.mjs +2 -2
- package/reactjs/components/base/MxSlideover/MxSlideover.js +1 -78
- package/reactjs/components/base/MxSlideover/MxSlideover.mjs +72 -74
- package/reactjs/components/base/MxSlideover/index.js +1 -4
- package/reactjs/components/base/MxSlideover/index.mjs +2 -2
- package/reactjs/components/base/MxTooltip/MxTooltip.js +1 -163
- package/reactjs/components/base/MxTooltip/MxTooltip.mjs +92 -135
- package/reactjs/components/base/MxTooltip/components/TooltipContainer/TooltipContainer.js +1 -33
- package/reactjs/components/base/MxTooltip/components/TooltipContainer/TooltipContainer.mjs +29 -31
- package/reactjs/components/base/MxTooltip/components/TooltipContainer/index.js +1 -4
- package/reactjs/components/base/MxTooltip/components/TooltipContainer/index.mjs +2 -2
- package/reactjs/components/base/MxTooltip/components/TooltipContent/TooltipContent.js +1 -27
- package/reactjs/components/base/MxTooltip/components/TooltipContent/TooltipContent.mjs +23 -25
- package/reactjs/components/base/MxTooltip/components/TooltipContent/index.js +1 -4
- package/reactjs/components/base/MxTooltip/components/TooltipContent/index.mjs +2 -2
- package/reactjs/components/base/MxTooltip/components/index.js +1 -6
- package/reactjs/components/base/MxTooltip/components/index.mjs +4 -4
- package/reactjs/components/base/MxTooltip/index.js +1 -4
- package/reactjs/components/base/MxTooltip/index.mjs +2 -2
- package/reactjs/components/base/index.js +1 -14
- package/reactjs/components/base/index.mjs +12 -12
- package/reactjs/components/index.js +1 -54
- package/reactjs/components/index.mjs +52 -52
- package/reactjs/constants/chains.js +1 -54
- package/reactjs/constants/chains.mjs +33 -52
- package/reactjs/constants/index.js +1 -13
- package/reactjs/constants/index.mjs +9 -10
- package/reactjs/context/Web3AppProvider.js +1 -42
- package/reactjs/context/Web3AppProvider.mjs +34 -36
- package/reactjs/context/queryClient.js +1 -11
- package/reactjs/context/queryClient.mjs +5 -8
- package/reactjs/context/useWeb3App.js +1 -12
- package/reactjs/context/useWeb3App.mjs +7 -8
- package/reactjs/helpers/index.js +1 -6
- package/reactjs/helpers/index.mjs +4 -4
- package/reactjs/helpers/resolveBridgeApiChainId.js +1 -40
- package/reactjs/helpers/resolveBridgeApiChainId.mjs +21 -34
- package/reactjs/hooks/index.js +1 -35
- package/reactjs/hooks/index.mjs +33 -33
- package/reactjs/hooks/tests/useGenericSignMessage.spec.js +1 -68
- package/reactjs/hooks/tests/useGenericSignMessage.spec.mjs +23 -38
- package/reactjs/hooks/tests/useSignTransaction.spec.js +1 -195
- package/reactjs/hooks/tests/useSignTransaction.spec.mjs +72 -110
- package/reactjs/hooks/useAccount.js +1 -13
- package/reactjs/hooks/useAccount.mjs +7 -8
- package/reactjs/hooks/useBalances.js +1 -53
- package/reactjs/hooks/useBalances.mjs +28 -40
- package/reactjs/hooks/useBridgeApiChainId.js +1 -13
- package/reactjs/hooks/useBridgeApiChainId.mjs +9 -9
- package/reactjs/hooks/useBridgeFormik.js +1 -167
- package/reactjs/hooks/useBridgeFormik.mjs +110 -155
- package/reactjs/hooks/useDebounce.js +1 -13
- package/reactjs/hooks/useDebounce.mjs +8 -10
- package/reactjs/hooks/useFetchBridgeData.js +1 -45
- package/reactjs/hooks/useFetchBridgeData.mjs +37 -38
- package/reactjs/hooks/useFetchTokens.js +1 -115
- package/reactjs/hooks/useFetchTokens.mjs +80 -108
- package/reactjs/hooks/useGenericSignMessage.js +1 -75
- package/reactjs/hooks/useGenericSignMessage.mjs +44 -64
- package/reactjs/hooks/useGetChainId.js +1 -11
- package/reactjs/hooks/useGetChainId.mjs +7 -8
- package/reactjs/hooks/useResolveTokenChain.js +1 -20
- package/reactjs/hooks/useResolveTokenChain.mjs +11 -14
- package/reactjs/hooks/useSendTransactions.js +1 -25
- package/reactjs/hooks/useSendTransactions.mjs +19 -23
- package/reactjs/hooks/useSignTransaction.js +1 -112
- package/reactjs/hooks/useSignTransaction.mjs +50 -76
- package/reactjs/hooks/useSuiConnect.js +1 -86
- package/reactjs/hooks/useSuiConnect.mjs +52 -70
- package/reactjs/hooks/validation/index.js +1 -10
- package/reactjs/hooks/validation/index.mjs +8 -8
- package/reactjs/hooks/validation/useAmountSchema.js +1 -32
- package/reactjs/hooks/validation/useAmountSchema.mjs +8 -11
- package/reactjs/hooks/validation/useSecondAmountSchema.js +1 -26
- package/reactjs/hooks/validation/useSecondAmountSchema.mjs +5 -6
- package/reactjs/hooks/validation/useTestHasEnoughFunds.js +1 -37
- package/reactjs/hooks/validation/useTestHasEnoughFunds.mjs +20 -29
- package/reactjs/hooks/validation/useTestIsConnected.js +1 -27
- package/reactjs/hooks/validation/useTestIsConnected.mjs +13 -19
- package/reactjs/index.js +1 -190
- package/reactjs/index.mjs +154 -154
- package/reactjs/init/index.js +1 -5
- package/reactjs/init/index.mjs +3 -3
- package/reactjs/init/init.js +1 -147
- package/reactjs/init/init.mjs +57 -78
- package/reactjs/queries/index.js +1 -17
- package/reactjs/queries/index.mjs +15 -15
- package/reactjs/queries/useCheckAccount.query.js +1 -39
- package/reactjs/queries/useCheckAccount.query.mjs +29 -33
- package/reactjs/queries/useGetAllTokens.query.js +1 -35
- package/reactjs/queries/useGetAllTokens.query.mjs +26 -30
- package/reactjs/queries/useGetChains.query.js +1 -34
- package/reactjs/queries/useGetChains.query.mjs +26 -28
- package/reactjs/queries/useGetHistory.query.js +1 -69
- package/reactjs/queries/useGetHistory.query.mjs +53 -57
- package/reactjs/queries/useGetMvxTokensBalances.query.js +1 -66
- package/reactjs/queries/useGetMvxTokensBalances.query.mjs +38 -46
- package/reactjs/queries/useGetNonMvxTokensBalances.query.js +1 -81
- package/reactjs/queries/useGetNonMvxTokensBalances.query.mjs +49 -57
- package/reactjs/queries/useGetRate.mutation.js +1 -18
- package/reactjs/queries/useGetRate.mutation.mjs +12 -15
- package/reactjs/reexports.js +1 -48
- package/reactjs/reexports.mjs +13 -13
- package/reactjs/utils/delay.js +1 -6
- package/reactjs/utils/delay.mjs +3 -3
- package/reactjs/utils/formatAmount.js +1 -23
- package/reactjs/utils/formatAmount.mjs +16 -17
- package/reactjs/utils/getCleanStringAmount.js +1 -11
- package/reactjs/utils/getCleanStringAmount.mjs +6 -8
- package/reactjs/utils/getCompletePathname.js +1 -5
- package/reactjs/utils/getCompletePathname.mjs +3 -3
- package/reactjs/utils/getInitialTokens.js +1 -12
- package/reactjs/utils/getInitialTokens.mjs +6 -7
- package/reactjs/utils/hasEnoughFunds.js +1 -19
- package/reactjs/utils/hasEnoughFunds.mjs +11 -14
- package/reactjs/utils/index.js +1 -26
- package/reactjs/utils/index.mjs +24 -24
- package/reactjs/utils/isStringFloat.js +1 -21
- package/reactjs/utils/isStringFloat.mjs +11 -18
- package/reactjs/utils/mxClsx.js +1 -8
- package/reactjs/utils/mxClsx.mjs +4 -6
- package/reactjs/utils/pipe.js +1 -25
- package/reactjs/utils/pipe.mjs +13 -17
- package/reactjs/utils/removeCommas.js +1 -6
- package/reactjs/utils/removeCommas.mjs +2 -4
- package/reactjs/utils/roundAmount.js +1 -40
- package/reactjs/utils/roundAmount.mjs +16 -36
- package/reactjs/utils/testNumber.js +1 -4
- package/reactjs/utils/testNumber.mjs +2 -2
- package/store/inMemoryStore.js +1 -39
- package/store/inMemoryStore.mjs +17 -21
- package/style.css +1 -2274
- package/types/chainType.js +1 -11
- package/types/chainType.mjs +2 -9
- package/types/errors.js +1 -9
- package/types/errors.mjs +4 -5
- package/types/providerType.js +1 -9
- package/types/providerType.mjs +2 -7
- package/types/transaction.d.ts +2 -0
- package/all-networks-EJIVYZ_i.mjs +0 -4
- package/all-networks-NYACMyeN.js +0 -4
- package/default-BYtXv70Z.mjs +0 -4
- package/default-H3AbmzFV.js +0 -4
- package/react.esm-7GsOwMPq.js +0 -11815
- package/react.esm-CU-Iqz8D.mjs +0 -11796
|
@@ -1,64 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
const types_errors = require("../../types/errors.js");
|
|
4
|
-
const helpers_assertRateConfirmationMatchesIntent = require("../assertRateConfirmationMatchesIntent.js");
|
|
5
|
-
const makeTransaction = (overrides = {}) => ({
|
|
6
|
-
to: "0xdeadbeef",
|
|
7
|
-
data: "0x",
|
|
8
|
-
gasLimit: BigInt(21e3),
|
|
9
|
-
value: BigInt(0),
|
|
10
|
-
account: "0xSender",
|
|
11
|
-
txHash: "",
|
|
12
|
-
...overrides
|
|
13
|
-
});
|
|
14
|
-
describe("assertRateConfirmationMatchesIntent", () => {
|
|
15
|
-
const intent = { fromChainId: "1", sender: "0xSender" };
|
|
16
|
-
it("does not throw for an empty transactions array", () => {
|
|
17
|
-
expect(() => helpers_assertRateConfirmationMatchesIntent.assertRateConfirmationMatchesIntent(intent, [])).not.toThrow();
|
|
18
|
-
});
|
|
19
|
-
it("does not throw when chainID and account match", () => {
|
|
20
|
-
const tx = makeTransaction({ chainID: "1", account: "0xSender" });
|
|
21
|
-
expect(
|
|
22
|
-
() => helpers_assertRateConfirmationMatchesIntent.assertRateConfirmationMatchesIntent(intent, [tx])
|
|
23
|
-
).not.toThrow();
|
|
24
|
-
});
|
|
25
|
-
it("does not throw when chainID is undefined (field absent)", () => {
|
|
26
|
-
const tx = makeTransaction({ account: "0xSender" });
|
|
27
|
-
expect(
|
|
28
|
-
() => helpers_assertRateConfirmationMatchesIntent.assertRateConfirmationMatchesIntent(intent, [tx])
|
|
29
|
-
).not.toThrow();
|
|
30
|
-
});
|
|
31
|
-
it("throws RateConfirmationMismatchError when chainID does not match fromChainId", () => {
|
|
32
|
-
const tx = makeTransaction({ chainID: "999", account: "0xSender" });
|
|
33
|
-
expect(() => helpers_assertRateConfirmationMatchesIntent.assertRateConfirmationMatchesIntent(intent, [tx])).toThrow(
|
|
34
|
-
types_errors.RateConfirmationMismatchError
|
|
35
|
-
);
|
|
36
|
-
});
|
|
37
|
-
it("throws RateConfirmationMismatchError when account does not match sender (case-insensitive)", () => {
|
|
38
|
-
const tx = makeTransaction({ account: "0xAttacker" });
|
|
39
|
-
expect(() => helpers_assertRateConfirmationMatchesIntent.assertRateConfirmationMatchesIntent(intent, [tx])).toThrow(
|
|
40
|
-
types_errors.RateConfirmationMismatchError
|
|
41
|
-
);
|
|
42
|
-
});
|
|
43
|
-
it("does not throw when account matches sender case-insensitively", () => {
|
|
44
|
-
const tx = makeTransaction({ account: "0xsender" });
|
|
45
|
-
const intentLower = { fromChainId: "1", sender: "0xSENDER" };
|
|
46
|
-
expect(
|
|
47
|
-
() => helpers_assertRateConfirmationMatchesIntent.assertRateConfirmationMatchesIntent(intentLower, [tx])
|
|
48
|
-
).not.toThrow();
|
|
49
|
-
});
|
|
50
|
-
it("throws RateConfirmationMismatchError when MvX sender field does not match", () => {
|
|
51
|
-
const tx = makeTransaction({ account: "0xSender", sender: "erd1attacker" });
|
|
52
|
-
const mvxIntent = { fromChainId: "1", sender: "erd1legit" };
|
|
53
|
-
expect(() => helpers_assertRateConfirmationMatchesIntent.assertRateConfirmationMatchesIntent(mvxIntent, [tx])).toThrow(
|
|
54
|
-
types_errors.RateConfirmationMismatchError
|
|
55
|
-
);
|
|
56
|
-
});
|
|
57
|
-
it("throws on the bad transaction when mixed valid and invalid transactions are present", () => {
|
|
58
|
-
const goodTx = makeTransaction({ chainID: "1", account: "0xSender" });
|
|
59
|
-
const badTx = makeTransaction({ chainID: "999", account: "0xSender" });
|
|
60
|
-
expect(
|
|
61
|
-
() => helpers_assertRateConfirmationMatchesIntent.assertRateConfirmationMatchesIntent(intent, [goodTx, badTx])
|
|
62
|
-
).toThrow(types_errors.RateConfirmationMismatchError);
|
|
63
|
-
});
|
|
64
|
-
});
|
|
2
|
+
"use strict";const r=require("../../types/errors.js"),e=require("../assertRateConfirmationMatchesIntent.js"),o=(n={})=>({to:"0xdeadbeef",data:"0x",gasLimit:BigInt(21e3),value:BigInt(0),account:"0xSender",txHash:"",...n});describe("assertRateConfirmationMatchesIntent",()=>{const n={fromChainId:"1",sender:"0xSender"};it("does not throw for an empty transactions array",()=>{expect(()=>e.assertRateConfirmationMatchesIntent(n,[])).not.toThrow()}),it("does not throw when chainID and account match",()=>{const t=o({chainID:"1",account:"0xSender"});expect(()=>e.assertRateConfirmationMatchesIntent(n,[t])).not.toThrow()}),it("does not throw when chainID is undefined (field absent)",()=>{const t=o({account:"0xSender"});expect(()=>e.assertRateConfirmationMatchesIntent(n,[t])).not.toThrow()}),it("throws RateConfirmationMismatchError when chainID does not match fromChainId",()=>{const t=o({chainID:"999",account:"0xSender"});expect(()=>e.assertRateConfirmationMatchesIntent(n,[t])).toThrow(r.RateConfirmationMismatchError)}),it("throws RateConfirmationMismatchError when account does not match sender (case-insensitive)",()=>{const t=o({account:"0xAttacker"});expect(()=>e.assertRateConfirmationMatchesIntent(n,[t])).toThrow(r.RateConfirmationMismatchError)}),it("does not throw when account matches sender case-insensitively",()=>{const t=o({account:"0xsender"}),a={fromChainId:"1",sender:"0xSENDER"};expect(()=>e.assertRateConfirmationMatchesIntent(a,[t])).not.toThrow()}),it("throws RateConfirmationMismatchError when MvX sender field does not match",()=>{const t=o({account:"0xSender",sender:"erd1attacker"}),a={fromChainId:"1",sender:"erd1legit"};expect(()=>e.assertRateConfirmationMatchesIntent(a,[t])).toThrow(r.RateConfirmationMismatchError)}),it("throws on the bad transaction when mixed valid and invalid transactions are present",()=>{const t=o({chainID:"1",account:"0xSender"}),a=o({chainID:"999",account:"0xSender"});expect(()=>e.assertRateConfirmationMatchesIntent(n,[t,a])).toThrow(r.RateConfirmationMismatchError)})});
|
|
@@ -1,62 +1,52 @@
|
|
|
1
|
-
import { RateConfirmationMismatchError } from "../../types/errors.mjs";
|
|
2
|
-
import { assertRateConfirmationMatchesIntent } from "../assertRateConfirmationMatchesIntent.mjs";
|
|
3
|
-
const
|
|
1
|
+
import { RateConfirmationMismatchError as r } from "../../types/errors.mjs";
|
|
2
|
+
import { assertRateConfirmationMatchesIntent as e } from "../assertRateConfirmationMatchesIntent.mjs";
|
|
3
|
+
const o = (n = {}) => ({
|
|
4
4
|
to: "0xdeadbeef",
|
|
5
5
|
data: "0x",
|
|
6
6
|
gasLimit: BigInt(21e3),
|
|
7
7
|
value: BigInt(0),
|
|
8
8
|
account: "0xSender",
|
|
9
9
|
txHash: "",
|
|
10
|
-
...
|
|
10
|
+
...n
|
|
11
11
|
});
|
|
12
12
|
describe("assertRateConfirmationMatchesIntent", () => {
|
|
13
|
-
const
|
|
13
|
+
const n = { fromChainId: "1", sender: "0xSender" };
|
|
14
14
|
it("does not throw for an empty transactions array", () => {
|
|
15
|
-
expect(() =>
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
const tx = makeTransaction({ chainID: "1", account: "0xSender" });
|
|
15
|
+
expect(() => e(n, [])).not.toThrow();
|
|
16
|
+
}), it("does not throw when chainID and account match", () => {
|
|
17
|
+
const t = o({ chainID: "1", account: "0xSender" });
|
|
19
18
|
expect(
|
|
20
|
-
() =>
|
|
19
|
+
() => e(n, [t])
|
|
21
20
|
).not.toThrow();
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
const tx = makeTransaction({ account: "0xSender" });
|
|
21
|
+
}), it("does not throw when chainID is undefined (field absent)", () => {
|
|
22
|
+
const t = o({ account: "0xSender" });
|
|
25
23
|
expect(
|
|
26
|
-
() =>
|
|
24
|
+
() => e(n, [t])
|
|
27
25
|
).not.toThrow();
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
RateConfirmationMismatchError
|
|
26
|
+
}), it("throws RateConfirmationMismatchError when chainID does not match fromChainId", () => {
|
|
27
|
+
const t = o({ chainID: "999", account: "0xSender" });
|
|
28
|
+
expect(() => e(n, [t])).toThrow(
|
|
29
|
+
r
|
|
33
30
|
);
|
|
34
|
-
})
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
RateConfirmationMismatchError
|
|
31
|
+
}), it("throws RateConfirmationMismatchError when account does not match sender (case-insensitive)", () => {
|
|
32
|
+
const t = o({ account: "0xAttacker" });
|
|
33
|
+
expect(() => e(n, [t])).toThrow(
|
|
34
|
+
r
|
|
39
35
|
);
|
|
40
|
-
})
|
|
41
|
-
|
|
42
|
-
const tx = makeTransaction({ account: "0xsender" });
|
|
43
|
-
const intentLower = { fromChainId: "1", sender: "0xSENDER" };
|
|
36
|
+
}), it("does not throw when account matches sender case-insensitively", () => {
|
|
37
|
+
const t = o({ account: "0xsender" }), a = { fromChainId: "1", sender: "0xSENDER" };
|
|
44
38
|
expect(
|
|
45
|
-
() =>
|
|
39
|
+
() => e(a, [t])
|
|
46
40
|
).not.toThrow();
|
|
47
|
-
})
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
expect(() => assertRateConfirmationMatchesIntent(mvxIntent, [tx])).toThrow(
|
|
52
|
-
RateConfirmationMismatchError
|
|
41
|
+
}), it("throws RateConfirmationMismatchError when MvX sender field does not match", () => {
|
|
42
|
+
const t = o({ account: "0xSender", sender: "erd1attacker" }), a = { fromChainId: "1", sender: "erd1legit" };
|
|
43
|
+
expect(() => e(a, [t])).toThrow(
|
|
44
|
+
r
|
|
53
45
|
);
|
|
54
|
-
})
|
|
55
|
-
|
|
56
|
-
const goodTx = makeTransaction({ chainID: "1", account: "0xSender" });
|
|
57
|
-
const badTx = makeTransaction({ chainID: "999", account: "0xSender" });
|
|
46
|
+
}), it("throws on the bad transaction when mixed valid and invalid transactions are present", () => {
|
|
47
|
+
const t = o({ chainID: "1", account: "0xSender" }), a = o({ chainID: "999", account: "0xSender" });
|
|
58
48
|
expect(
|
|
59
|
-
() =>
|
|
60
|
-
).toThrow(
|
|
49
|
+
() => e(n, [t, a])
|
|
50
|
+
).toThrow(r);
|
|
61
51
|
});
|
|
62
52
|
});
|
|
@@ -1,30 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
const helpers_base64Utils = require("../base64Utils.js");
|
|
4
|
-
describe("base64Utils", () => {
|
|
5
|
-
it("encodes a string to base64", () => {
|
|
6
|
-
const input = "Hello, World!";
|
|
7
|
-
const expectedOutput = "SGVsbG8sIFdvcmxkIQ==";
|
|
8
|
-
expect(helpers_base64Utils.encodeToBase64(input)).toBe(expectedOutput);
|
|
9
|
-
});
|
|
10
|
-
it("decodes a base64 string", () => {
|
|
11
|
-
const input = "SGVsbG8sIFdvcmxkIQ==";
|
|
12
|
-
const expectedOutput = "Hello, World!";
|
|
13
|
-
expect(helpers_base64Utils.decodeBase64(input)).toBe(expectedOutput);
|
|
14
|
-
});
|
|
15
|
-
it("encodes an empty string to base64", () => {
|
|
16
|
-
const input = "";
|
|
17
|
-
const expectedOutput = "";
|
|
18
|
-
expect(helpers_base64Utils.encodeToBase64(input)).toBe(expectedOutput);
|
|
19
|
-
});
|
|
20
|
-
it("decodes an empty base64 string", () => {
|
|
21
|
-
const input = "";
|
|
22
|
-
const expectedOutput = "";
|
|
23
|
-
expect(helpers_base64Utils.decodeBase64(input)).toBe(expectedOutput);
|
|
24
|
-
});
|
|
25
|
-
it("retrieve the given input if is an invalid base64 string", () => {
|
|
26
|
-
const input = "Invalid base64 string";
|
|
27
|
-
const decoded = helpers_base64Utils.decodeBase64(input);
|
|
28
|
-
expect(decoded).toEqual(input);
|
|
29
|
-
});
|
|
30
|
-
});
|
|
2
|
+
"use strict";const s=require("../base64Utils.js");describe("base64Utils",()=>{it("encodes a string to base64",()=>{expect(s.encodeToBase64("Hello, World!")).toBe("SGVsbG8sIFdvcmxkIQ==")}),it("decodes a base64 string",()=>{expect(s.decodeBase64("SGVsbG8sIFdvcmxkIQ==")).toBe("Hello, World!")}),it("encodes an empty string to base64",()=>{expect(s.encodeToBase64("")).toBe("")}),it("decodes an empty base64 string",()=>{expect(s.decodeBase64("")).toBe("")}),it("retrieve the given input if is an invalid base64 string",()=>{const e="Invalid base64 string",t=s.decodeBase64(e);expect(t).toEqual(e)})});
|
|
@@ -1,28 +1,15 @@
|
|
|
1
|
-
import { encodeToBase64, decodeBase64 } from "../base64Utils.mjs";
|
|
1
|
+
import { encodeToBase64 as n, decodeBase64 as s } from "../base64Utils.mjs";
|
|
2
2
|
describe("base64Utils", () => {
|
|
3
3
|
it("encodes a string to base64", () => {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
expect(
|
|
7
|
-
})
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const input = "";
|
|
15
|
-
const expectedOutput = "";
|
|
16
|
-
expect(encodeToBase64(input)).toBe(expectedOutput);
|
|
17
|
-
});
|
|
18
|
-
it("decodes an empty base64 string", () => {
|
|
19
|
-
const input = "";
|
|
20
|
-
const expectedOutput = "";
|
|
21
|
-
expect(decodeBase64(input)).toBe(expectedOutput);
|
|
22
|
-
});
|
|
23
|
-
it("retrieve the given input if is an invalid base64 string", () => {
|
|
24
|
-
const input = "Invalid base64 string";
|
|
25
|
-
const decoded = decodeBase64(input);
|
|
26
|
-
expect(decoded).toEqual(input);
|
|
4
|
+
expect(n("Hello, World!")).toBe("SGVsbG8sIFdvcmxkIQ==");
|
|
5
|
+
}), it("decodes a base64 string", () => {
|
|
6
|
+
expect(s("SGVsbG8sIFdvcmxkIQ==")).toBe("Hello, World!");
|
|
7
|
+
}), it("encodes an empty string to base64", () => {
|
|
8
|
+
expect(n("")).toBe("");
|
|
9
|
+
}), it("decodes an empty base64 string", () => {
|
|
10
|
+
expect(s("")).toBe("");
|
|
11
|
+
}), it("retrieve the given input if is an invalid base64 string", () => {
|
|
12
|
+
const t = "Invalid base64 string", e = s(t);
|
|
13
|
+
expect(e).toEqual(t);
|
|
27
14
|
});
|
|
28
15
|
});
|
|
@@ -1,35 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
const helpers_decodeLoginToken = require("../decodeLoginToken.js");
|
|
4
|
-
describe("decodeLoginToken", () => {
|
|
5
|
-
it("decodes a valid login token", () => {
|
|
6
|
-
const token = "aHR0cHM6Ly9kZXZuZXQudGVtcGxhdGUtZGFwcC5tdWx0aXZlcnN4LmNvbQ.ef76b4c76ef6e13a6390767fc78a88ca4bbb5918a2b9ddc44942927693650651.86400.eyJ0aW1lc3RhbXAiOjE3MzM0ODk0MDB9";
|
|
7
|
-
const expectedPayload = {
|
|
8
|
-
origin: "https://devnet.template-dapp.multiversx.com",
|
|
9
|
-
blockHash: "ef76b4c76ef6e13a6390767fc78a88ca4bbb5918a2b9ddc44942927693650651",
|
|
10
|
-
ttl: 86400,
|
|
11
|
-
extraInfo: { timestamp: 1733489400 }
|
|
12
|
-
};
|
|
13
|
-
expect(helpers_decodeLoginToken.decodeLoginToken(token)).toEqual(expectedPayload);
|
|
14
|
-
});
|
|
15
|
-
it("returns null for an invalid login token", () => {
|
|
16
|
-
const token = "invalid.token.here";
|
|
17
|
-
expect(helpers_decodeLoginToken.decodeLoginToken(token)).toBeNull();
|
|
18
|
-
});
|
|
19
|
-
it("returns null for an empty token", () => {
|
|
20
|
-
const token = "";
|
|
21
|
-
expect(helpers_decodeLoginToken.decodeLoginToken(token)).toBeNull();
|
|
22
|
-
});
|
|
23
|
-
it("returns null for a token with less than 4 parts", () => {
|
|
24
|
-
const token = "part1.part2.part3";
|
|
25
|
-
expect(helpers_decodeLoginToken.decodeLoginToken(token)).toBeNull();
|
|
26
|
-
});
|
|
27
|
-
it("returns null for a token with more than 4 parts", () => {
|
|
28
|
-
const token = "part1.part2.part3.part4.part5";
|
|
29
|
-
expect(helpers_decodeLoginToken.decodeLoginToken(token)).toBeNull();
|
|
30
|
-
});
|
|
31
|
-
it("returns null for a token with invalid JSON in extraInfo", () => {
|
|
32
|
-
const token = "b3JpZ2lu.blockHash.3600.invalidBase64";
|
|
33
|
-
expect(helpers_decodeLoginToken.decodeLoginToken(token)).toBeNull();
|
|
34
|
-
});
|
|
35
|
-
});
|
|
2
|
+
"use strict";const t=require("../decodeLoginToken.js");describe("decodeLoginToken",()=>{it("decodes a valid login token",()=>{const e="aHR0cHM6Ly9kZXZuZXQudGVtcGxhdGUtZGFwcC5tdWx0aXZlcnN4LmNvbQ.ef76b4c76ef6e13a6390767fc78a88ca4bbb5918a2b9ddc44942927693650651.86400.eyJ0aW1lc3RhbXAiOjE3MzM0ODk0MDB9",o={origin:"https://devnet.template-dapp.multiversx.com",blockHash:"ef76b4c76ef6e13a6390767fc78a88ca4bbb5918a2b9ddc44942927693650651",ttl:86400,extraInfo:{timestamp:1733489400}};expect(t.decodeLoginToken(e)).toEqual(o)}),it("returns null for an invalid login token",()=>{expect(t.decodeLoginToken("invalid.token.here")).toBeNull()}),it("returns null for an empty token",()=>{expect(t.decodeLoginToken("")).toBeNull()}),it("returns null for a token with less than 4 parts",()=>{expect(t.decodeLoginToken("part1.part2.part3")).toBeNull()}),it("returns null for a token with more than 4 parts",()=>{expect(t.decodeLoginToken("part1.part2.part3.part4.part5")).toBeNull()}),it("returns null for a token with invalid JSON in extraInfo",()=>{expect(t.decodeLoginToken("b3JpZ2lu.blockHash.3600.invalidBase64")).toBeNull()})});
|
|
@@ -1,33 +1,22 @@
|
|
|
1
|
-
import { decodeLoginToken } from "../decodeLoginToken.mjs";
|
|
1
|
+
import { decodeLoginToken as e } from "../decodeLoginToken.mjs";
|
|
2
2
|
describe("decodeLoginToken", () => {
|
|
3
3
|
it("decodes a valid login token", () => {
|
|
4
|
-
const
|
|
5
|
-
const expectedPayload = {
|
|
4
|
+
const t = "aHR0cHM6Ly9kZXZuZXQudGVtcGxhdGUtZGFwcC5tdWx0aXZlcnN4LmNvbQ.ef76b4c76ef6e13a6390767fc78a88ca4bbb5918a2b9ddc44942927693650651.86400.eyJ0aW1lc3RhbXAiOjE3MzM0ODk0MDB9", n = {
|
|
6
5
|
origin: "https://devnet.template-dapp.multiversx.com",
|
|
7
6
|
blockHash: "ef76b4c76ef6e13a6390767fc78a88ca4bbb5918a2b9ddc44942927693650651",
|
|
8
7
|
ttl: 86400,
|
|
9
8
|
extraInfo: { timestamp: 1733489400 }
|
|
10
9
|
};
|
|
11
|
-
expect(
|
|
12
|
-
})
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
expect(
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
expect(
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
const token = "part1.part2.part3";
|
|
23
|
-
expect(decodeLoginToken(token)).toBeNull();
|
|
24
|
-
});
|
|
25
|
-
it("returns null for a token with more than 4 parts", () => {
|
|
26
|
-
const token = "part1.part2.part3.part4.part5";
|
|
27
|
-
expect(decodeLoginToken(token)).toBeNull();
|
|
28
|
-
});
|
|
29
|
-
it("returns null for a token with invalid JSON in extraInfo", () => {
|
|
30
|
-
const token = "b3JpZ2lu.blockHash.3600.invalidBase64";
|
|
31
|
-
expect(decodeLoginToken(token)).toBeNull();
|
|
10
|
+
expect(e(t)).toEqual(n);
|
|
11
|
+
}), it("returns null for an invalid login token", () => {
|
|
12
|
+
expect(e("invalid.token.here")).toBeNull();
|
|
13
|
+
}), it("returns null for an empty token", () => {
|
|
14
|
+
expect(e("")).toBeNull();
|
|
15
|
+
}), it("returns null for a token with less than 4 parts", () => {
|
|
16
|
+
expect(e("part1.part2.part3")).toBeNull();
|
|
17
|
+
}), it("returns null for a token with more than 4 parts", () => {
|
|
18
|
+
expect(e("part1.part2.part3.part4.part5")).toBeNull();
|
|
19
|
+
}), it("returns null for a token with invalid JSON in extraInfo", () => {
|
|
20
|
+
expect(e("b3JpZ2lu.blockHash.3600.invalidBase64")).toBeNull();
|
|
32
21
|
});
|
|
33
22
|
});
|
|
@@ -1,28 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
const helpers_decodeToken = require("../decodeToken.js");
|
|
4
|
-
describe("decodeToken", () => {
|
|
5
|
-
it("decodes a valid native auth token", async () => {
|
|
6
|
-
const token = "ZXJkMXdoOWMwc2pyMnhuOGh6ZjAybHd3Y3I0amsyczg0dGF0OXVkMmthcTZ6cjd4enB2bDlsNXE4YXdtZXg.YUhSMGNITTZMeTlrWlhadVpYUXVkR1Z0Y0d4aGRHVXRaR0Z3Y0M1dGRXeDBhWFpsY25ONExtTnZiUS5lZjc2YjRjNzZlZjZlMTNhNjM5MDc2N2ZjNzhhODhjYTRiYmI1OTE4YTJiOWRkYzQ0OTQyOTI3NjkzNjUwNjUxLjg2NDAwLmV5SjBhVzFsYzNSaGJYQWlPakUzTXpNME9EazBNREI5.04a986df7f0142837f9b1ca1ae4829f7b471e4c3470602ca6a16f2a4d7c6616c4e7628a93b4ce87d9534e95ab9215f893faeb9e0904e1d834007c16e43b12d01";
|
|
7
|
-
const expectedPayload = {
|
|
8
|
-
address: "erd1wh9c0sjr2xn8hzf02lwwcr4jk2s84tat9ud2kaq6zr7xzpvl9l5q8awmex",
|
|
9
|
-
blockHash: "ef76b4c76ef6e13a6390767fc78a88ca4bbb5918a2b9ddc44942927693650651",
|
|
10
|
-
body: "aHR0cHM6Ly9kZXZuZXQudGVtcGxhdGUtZGFwcC5tdWx0aXZlcnN4LmNvbQ.ef76b4c76ef6e13a6390767fc78a88ca4bbb5918a2b9ddc44942927693650651.86400.eyJ0aW1lc3RhbXAiOjE3MzM0ODk0MDB9",
|
|
11
|
-
extraInfo: {
|
|
12
|
-
timestamp: 1733489400
|
|
13
|
-
},
|
|
14
|
-
origin: "https://devnet.template-dapp.multiversx.com",
|
|
15
|
-
signature: "04a986df7f0142837f9b1ca1ae4829f7b471e4c3470602ca6a16f2a4d7c6616c4e7628a93b4ce87d9534e95ab9215f893faeb9e0904e1d834007c16e43b12d01",
|
|
16
|
-
ttl: 86400
|
|
17
|
-
};
|
|
18
|
-
expect(helpers_decodeToken.decodeToken(token)).toEqual(expectedPayload);
|
|
19
|
-
});
|
|
20
|
-
it("returns null for an invalid native auth token", async () => {
|
|
21
|
-
const token = "invalid.token.here";
|
|
22
|
-
expect(helpers_decodeToken.decodeToken(token)).toBeNull();
|
|
23
|
-
});
|
|
24
|
-
it("returns null for an empty token", async () => {
|
|
25
|
-
const token = "";
|
|
26
|
-
expect(helpers_decodeToken.decodeToken(token)).toBeNull();
|
|
27
|
-
});
|
|
28
|
-
});
|
|
2
|
+
"use strict";const a=require("../decodeToken.js");describe("decodeToken",()=>{it("decodes a valid native auth token",async()=>{const e="ZXJkMXdoOWMwc2pyMnhuOGh6ZjAybHd3Y3I0amsyczg0dGF0OXVkMmthcTZ6cjd4enB2bDlsNXE4YXdtZXg.YUhSMGNITTZMeTlrWlhadVpYUXVkR1Z0Y0d4aGRHVXRaR0Z3Y0M1dGRXeDBhWFpsY25ONExtTnZiUS5lZjc2YjRjNzZlZjZlMTNhNjM5MDc2N2ZjNzhhODhjYTRiYmI1OTE4YTJiOWRkYzQ0OTQyOTI3NjkzNjUwNjUxLjg2NDAwLmV5SjBhVzFsYzNSaGJYQWlPakUzTXpNME9EazBNREI5.04a986df7f0142837f9b1ca1ae4829f7b471e4c3470602ca6a16f2a4d7c6616c4e7628a93b4ce87d9534e95ab9215f893faeb9e0904e1d834007c16e43b12d01",c={address:"erd1wh9c0sjr2xn8hzf02lwwcr4jk2s84tat9ud2kaq6zr7xzpvl9l5q8awmex",blockHash:"ef76b4c76ef6e13a6390767fc78a88ca4bbb5918a2b9ddc44942927693650651",body:"aHR0cHM6Ly9kZXZuZXQudGVtcGxhdGUtZGFwcC5tdWx0aXZlcnN4LmNvbQ.ef76b4c76ef6e13a6390767fc78a88ca4bbb5918a2b9ddc44942927693650651.86400.eyJ0aW1lc3RhbXAiOjE3MzM0ODk0MDB9",extraInfo:{timestamp:1733489400},origin:"https://devnet.template-dapp.multiversx.com",signature:"04a986df7f0142837f9b1ca1ae4829f7b471e4c3470602ca6a16f2a4d7c6616c4e7628a93b4ce87d9534e95ab9215f893faeb9e0904e1d834007c16e43b12d01",ttl:86400};expect(a.decodeToken(e)).toEqual(c)}),it("returns null for an invalid native auth token",async()=>{expect(a.decodeToken("invalid.token.here")).toBeNull()}),it("returns null for an empty token",async()=>{expect(a.decodeToken("")).toBeNull()})});
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { decodeToken } from "../decodeToken.mjs";
|
|
1
|
+
import { decodeToken as a } from "../decodeToken.mjs";
|
|
2
2
|
describe("decodeToken", () => {
|
|
3
3
|
it("decodes a valid native auth token", async () => {
|
|
4
|
-
const
|
|
5
|
-
const expectedPayload = {
|
|
4
|
+
const e = "ZXJkMXdoOWMwc2pyMnhuOGh6ZjAybHd3Y3I0amsyczg0dGF0OXVkMmthcTZ6cjd4enB2bDlsNXE4YXdtZXg.YUhSMGNITTZMeTlrWlhadVpYUXVkR1Z0Y0d4aGRHVXRaR0Z3Y0M1dGRXeDBhWFpsY25ONExtTnZiUS5lZjc2YjRjNzZlZjZlMTNhNjM5MDc2N2ZjNzhhODhjYTRiYmI1OTE4YTJiOWRkYzQ0OTQyOTI3NjkzNjUwNjUxLjg2NDAwLmV5SjBhVzFsYzNSaGJYQWlPakUzTXpNME9EazBNREI5.04a986df7f0142837f9b1ca1ae4829f7b471e4c3470602ca6a16f2a4d7c6616c4e7628a93b4ce87d9534e95ab9215f893faeb9e0904e1d834007c16e43b12d01", c = {
|
|
6
5
|
address: "erd1wh9c0sjr2xn8hzf02lwwcr4jk2s84tat9ud2kaq6zr7xzpvl9l5q8awmex",
|
|
7
6
|
blockHash: "ef76b4c76ef6e13a6390767fc78a88ca4bbb5918a2b9ddc44942927693650651",
|
|
8
7
|
body: "aHR0cHM6Ly9kZXZuZXQudGVtcGxhdGUtZGFwcC5tdWx0aXZlcnN4LmNvbQ.ef76b4c76ef6e13a6390767fc78a88ca4bbb5918a2b9ddc44942927693650651.86400.eyJ0aW1lc3RhbXAiOjE3MzM0ODk0MDB9",
|
|
@@ -13,14 +12,10 @@ describe("decodeToken", () => {
|
|
|
13
12
|
signature: "04a986df7f0142837f9b1ca1ae4829f7b471e4c3470602ca6a16f2a4d7c6616c4e7628a93b4ce87d9534e95ab9215f893faeb9e0904e1d834007c16e43b12d01",
|
|
14
13
|
ttl: 86400
|
|
15
14
|
};
|
|
16
|
-
expect(
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
expect(
|
|
21
|
-
});
|
|
22
|
-
it("returns null for an empty token", async () => {
|
|
23
|
-
const token = "";
|
|
24
|
-
expect(decodeToken(token)).toBeNull();
|
|
15
|
+
expect(a(e)).toEqual(c);
|
|
16
|
+
}), it("returns null for an invalid native auth token", async () => {
|
|
17
|
+
expect(a("invalid.token.here")).toBeNull();
|
|
18
|
+
}), it("returns null for an empty token", async () => {
|
|
19
|
+
expect(a("")).toBeNull();
|
|
25
20
|
});
|
|
26
21
|
});
|
|
@@ -1,49 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
const helpers_safeImageUrl = require("../safeImageUrl.js");
|
|
4
|
-
describe("safeImageUrl", () => {
|
|
5
|
-
it("passes through a valid https:// URL unchanged", () => {
|
|
6
|
-
const url = "https://example.com/icon.png";
|
|
7
|
-
expect(helpers_safeImageUrl.safeImageUrl(url)).toBe(url);
|
|
8
|
-
});
|
|
9
|
-
it("rejects an http:// URL and returns the default fallback", () => {
|
|
10
|
-
expect(helpers_safeImageUrl.safeImageUrl("http://example.com/icon.png")).toBe("");
|
|
11
|
-
});
|
|
12
|
-
it("rejects a data: URL", () => {
|
|
13
|
-
expect(helpers_safeImageUrl.safeImageUrl("data:image/png;base64,abc123")).toBe("");
|
|
14
|
-
});
|
|
15
|
-
it("rejects a javascript: URL", () => {
|
|
16
|
-
expect(helpers_safeImageUrl.safeImageUrl("javascript:alert(1)")).toBe("");
|
|
17
|
-
});
|
|
18
|
-
it("rejects a file: URL", () => {
|
|
19
|
-
expect(helpers_safeImageUrl.safeImageUrl("file:///etc/passwd")).toBe("");
|
|
20
|
-
});
|
|
21
|
-
it("rejects a blob: URL", () => {
|
|
22
|
-
expect(helpers_safeImageUrl.safeImageUrl("blob:https://example.com/some-uuid")).toBe("");
|
|
23
|
-
});
|
|
24
|
-
it("rejects an empty string", () => {
|
|
25
|
-
expect(helpers_safeImageUrl.safeImageUrl("")).toBe("");
|
|
26
|
-
});
|
|
27
|
-
it("rejects undefined", () => {
|
|
28
|
-
expect(helpers_safeImageUrl.safeImageUrl(void 0)).toBe("");
|
|
29
|
-
});
|
|
30
|
-
it("rejects a URL longer than 2048 characters", () => {
|
|
31
|
-
const url = "https://example.com/" + "a".repeat(2030);
|
|
32
|
-
expect(url.length).toBeGreaterThan(2048);
|
|
33
|
-
expect(helpers_safeImageUrl.safeImageUrl(url)).toBe("");
|
|
34
|
-
});
|
|
35
|
-
it("allows a URL of exactly 2048 characters", () => {
|
|
36
|
-
const prefix = "https://example.com/";
|
|
37
|
-
const url = prefix + "a".repeat(2048 - prefix.length);
|
|
38
|
-
expect(url.length).toBe(2048);
|
|
39
|
-
expect(helpers_safeImageUrl.safeImageUrl(url)).toBe(url);
|
|
40
|
-
});
|
|
41
|
-
it("returns the custom fallback when URL is invalid", () => {
|
|
42
|
-
const fallback = "https://cdn.example.com/default.svg";
|
|
43
|
-
expect(helpers_safeImageUrl.safeImageUrl("http://bad.example.com/icon.png", fallback)).toBe(
|
|
44
|
-
fallback
|
|
45
|
-
);
|
|
46
|
-
expect(helpers_safeImageUrl.safeImageUrl(void 0, fallback)).toBe(fallback);
|
|
47
|
-
expect(helpers_safeImageUrl.safeImageUrl("javascript:void(0)", fallback)).toBe(fallback);
|
|
48
|
-
});
|
|
49
|
-
});
|
|
2
|
+
"use strict";const t=require("../safeImageUrl.js");describe("safeImageUrl",()=>{it("passes through a valid https:// URL unchanged",()=>{const e="https://example.com/icon.png";expect(t.safeImageUrl(e)).toBe(e)}),it("rejects an http:// URL and returns the default fallback",()=>{expect(t.safeImageUrl("http://example.com/icon.png")).toBe("")}),it("rejects a data: URL",()=>{expect(t.safeImageUrl("data:image/png;base64,abc123")).toBe("")}),it("rejects a javascript: URL",()=>{expect(t.safeImageUrl("javascript:alert(1)")).toBe("")}),it("rejects a file: URL",()=>{expect(t.safeImageUrl("file:///etc/passwd")).toBe("")}),it("rejects a blob: URL",()=>{expect(t.safeImageUrl("blob:https://example.com/some-uuid")).toBe("")}),it("rejects an empty string",()=>{expect(t.safeImageUrl("")).toBe("")}),it("rejects undefined",()=>{expect(t.safeImageUrl(void 0)).toBe("")}),it("rejects a URL longer than 2048 characters",()=>{const e="https://example.com/"+"a".repeat(2030);expect(e.length).toBeGreaterThan(2048),expect(t.safeImageUrl(e)).toBe("")}),it("allows a URL of exactly 2048 characters",()=>{const e="https://example.com/",a=e+"a".repeat(2048-e.length);expect(a.length).toBe(2048),expect(t.safeImageUrl(a)).toBe(a)}),it("returns the custom fallback when URL is invalid",()=>{const e="https://cdn.example.com/default.svg";expect(t.safeImageUrl("http://bad.example.com/icon.png",e)).toBe(e),expect(t.safeImageUrl(void 0,e)).toBe(e),expect(t.safeImageUrl("javascript:void(0)",e)).toBe(e)})});
|
|
@@ -1,47 +1,32 @@
|
|
|
1
|
-
import { safeImageUrl } from "../safeImageUrl.mjs";
|
|
1
|
+
import { safeImageUrl as t } from "../safeImageUrl.mjs";
|
|
2
2
|
describe("safeImageUrl", () => {
|
|
3
3
|
it("passes through a valid https:// URL unchanged", () => {
|
|
4
|
-
const
|
|
5
|
-
expect(
|
|
6
|
-
})
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
it("rejects a
|
|
11
|
-
expect(
|
|
12
|
-
})
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
it("rejects
|
|
17
|
-
expect(
|
|
18
|
-
})
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
expect(
|
|
31
|
-
expect(safeImageUrl(url)).toBe("");
|
|
32
|
-
});
|
|
33
|
-
it("allows a URL of exactly 2048 characters", () => {
|
|
34
|
-
const prefix = "https://example.com/";
|
|
35
|
-
const url = prefix + "a".repeat(2048 - prefix.length);
|
|
36
|
-
expect(url.length).toBe(2048);
|
|
37
|
-
expect(safeImageUrl(url)).toBe(url);
|
|
38
|
-
});
|
|
39
|
-
it("returns the custom fallback when URL is invalid", () => {
|
|
40
|
-
const fallback = "https://cdn.example.com/default.svg";
|
|
41
|
-
expect(safeImageUrl("http://bad.example.com/icon.png", fallback)).toBe(
|
|
42
|
-
fallback
|
|
43
|
-
);
|
|
44
|
-
expect(safeImageUrl(void 0, fallback)).toBe(fallback);
|
|
45
|
-
expect(safeImageUrl("javascript:void(0)", fallback)).toBe(fallback);
|
|
4
|
+
const e = "https://example.com/icon.png";
|
|
5
|
+
expect(t(e)).toBe(e);
|
|
6
|
+
}), it("rejects an http:// URL and returns the default fallback", () => {
|
|
7
|
+
expect(t("http://example.com/icon.png")).toBe("");
|
|
8
|
+
}), it("rejects a data: URL", () => {
|
|
9
|
+
expect(t("data:image/png;base64,abc123")).toBe("");
|
|
10
|
+
}), it("rejects a javascript: URL", () => {
|
|
11
|
+
expect(t("javascript:alert(1)")).toBe("");
|
|
12
|
+
}), it("rejects a file: URL", () => {
|
|
13
|
+
expect(t("file:///etc/passwd")).toBe("");
|
|
14
|
+
}), it("rejects a blob: URL", () => {
|
|
15
|
+
expect(t("blob:https://example.com/some-uuid")).toBe("");
|
|
16
|
+
}), it("rejects an empty string", () => {
|
|
17
|
+
expect(t("")).toBe("");
|
|
18
|
+
}), it("rejects undefined", () => {
|
|
19
|
+
expect(t(void 0)).toBe("");
|
|
20
|
+
}), it("rejects a URL longer than 2048 characters", () => {
|
|
21
|
+
const e = "https://example.com/" + "a".repeat(2030);
|
|
22
|
+
expect(e.length).toBeGreaterThan(2048), expect(t(e)).toBe("");
|
|
23
|
+
}), it("allows a URL of exactly 2048 characters", () => {
|
|
24
|
+
const e = "https://example.com/", a = e + "a".repeat(2048 - e.length);
|
|
25
|
+
expect(a.length).toBe(2048), expect(t(a)).toBe(a);
|
|
26
|
+
}), it("returns the custom fallback when URL is invalid", () => {
|
|
27
|
+
const e = "https://cdn.example.com/default.svg";
|
|
28
|
+
expect(t("http://bad.example.com/icon.png", e)).toBe(
|
|
29
|
+
e
|
|
30
|
+
), expect(t(void 0, e)).toBe(e), expect(t("javascript:void(0)", e)).toBe(e);
|
|
46
31
|
});
|
|
47
32
|
});
|
|
@@ -1,37 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
const helpers_serializeTransaction = require("../serializeTransaction.js");
|
|
4
|
-
const baseTransaction = {
|
|
5
|
-
to: "0x1234567890abcdef1234567890abcdef12345678",
|
|
6
|
-
data: "0x",
|
|
7
|
-
gasLimit: 21000n,
|
|
8
|
-
value: 0n,
|
|
9
|
-
account: "0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef",
|
|
10
|
-
txHash: ""
|
|
11
|
-
};
|
|
12
|
-
describe("serializeTransaction", () => {
|
|
13
|
-
it("serialises a normal small BigInt correctly", () => {
|
|
14
|
-
const tx = { ...baseTransaction, value: 100n };
|
|
15
|
-
const result = JSON.parse(helpers_serializeTransaction.serializeTransaction(tx));
|
|
16
|
-
expect(result.value).toBe("100");
|
|
17
|
-
});
|
|
18
|
-
it("serialises a BigInt at exactly Number.MAX_SAFE_INTEGER correctly", () => {
|
|
19
|
-
const maxSafe = 9007199254740991n;
|
|
20
|
-
const tx = { ...baseTransaction, value: maxSafe };
|
|
21
|
-
const result = JSON.parse(helpers_serializeTransaction.serializeTransaction(tx));
|
|
22
|
-
expect(result.value).toBe("9007199254740991");
|
|
23
|
-
});
|
|
24
|
-
it("serialises 10 ETH in wei (above Number.MAX_SAFE_INTEGER) to the exact string without rounding", () => {
|
|
25
|
-
const tenEthInWei = 10000000000000000000n;
|
|
26
|
-
const tx = { ...baseTransaction, value: tenEthInWei };
|
|
27
|
-
const result = JSON.parse(helpers_serializeTransaction.serializeTransaction(tx));
|
|
28
|
-
expect(result.value).toBe("10000000000000000000");
|
|
29
|
-
});
|
|
30
|
-
it("serialises a value that would be corrupted by Number() to the exact string", () => {
|
|
31
|
-
const precisionLoss = 9007199254740993n;
|
|
32
|
-
const tx = { ...baseTransaction, value: precisionLoss };
|
|
33
|
-
const result = JSON.parse(helpers_serializeTransaction.serializeTransaction(tx));
|
|
34
|
-
expect(result.value).toBe("9007199254740993");
|
|
35
|
-
expect(result.value).not.toBe("9007199254740992");
|
|
36
|
-
});
|
|
37
|
-
});
|
|
2
|
+
"use strict";const s=require("../serializeTransaction.js"),n={to:"0x1234567890abcdef1234567890abcdef12345678",data:"0x",gasLimit:21000n,value:0n,account:"0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef",txHash:""};describe("serializeTransaction",()=>{it("serialises a normal small BigInt correctly",()=>{const a={...n,value:100n},e=JSON.parse(s.serializeTransaction(a));expect(e.value).toBe("100")}),it("serialises a BigInt at exactly Number.MAX_SAFE_INTEGER correctly",()=>{const e={...n,value:9007199254740991n},t=JSON.parse(s.serializeTransaction(e));expect(t.value).toBe("9007199254740991")}),it("serialises 10 ETH in wei (above Number.MAX_SAFE_INTEGER) to the exact string without rounding",()=>{const e={...n,value:10000000000000000000n},t=JSON.parse(s.serializeTransaction(e));expect(t.value).toBe("10000000000000000000")}),it("serialises a value that would be corrupted by Number() to the exact string",()=>{const e={...n,value:9007199254740993n},t=JSON.parse(s.serializeTransaction(e));expect(t.value).toBe("9007199254740993"),expect(t.value).not.toBe("9007199254740992")})});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { serializeTransaction } from "../serializeTransaction.mjs";
|
|
2
|
-
const
|
|
1
|
+
import { serializeTransaction as s } from "../serializeTransaction.mjs";
|
|
2
|
+
const n = {
|
|
3
3
|
to: "0x1234567890abcdef1234567890abcdef12345678",
|
|
4
4
|
data: "0x",
|
|
5
5
|
gasLimit: 21000n,
|
|
@@ -9,27 +9,16 @@ const baseTransaction = {
|
|
|
9
9
|
};
|
|
10
10
|
describe("serializeTransaction", () => {
|
|
11
11
|
it("serialises a normal small BigInt correctly", () => {
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const tenEthInWei = 10000000000000000000n;
|
|
24
|
-
const tx = { ...baseTransaction, value: tenEthInWei };
|
|
25
|
-
const result = JSON.parse(serializeTransaction(tx));
|
|
26
|
-
expect(result.value).toBe("10000000000000000000");
|
|
27
|
-
});
|
|
28
|
-
it("serialises a value that would be corrupted by Number() to the exact string", () => {
|
|
29
|
-
const precisionLoss = 9007199254740993n;
|
|
30
|
-
const tx = { ...baseTransaction, value: precisionLoss };
|
|
31
|
-
const result = JSON.parse(serializeTransaction(tx));
|
|
32
|
-
expect(result.value).toBe("9007199254740993");
|
|
33
|
-
expect(result.value).not.toBe("9007199254740992");
|
|
12
|
+
const a = { ...n, value: 100n }, e = JSON.parse(s(a));
|
|
13
|
+
expect(e.value).toBe("100");
|
|
14
|
+
}), it("serialises a BigInt at exactly Number.MAX_SAFE_INTEGER correctly", () => {
|
|
15
|
+
const e = { ...n, value: 9007199254740991n }, t = JSON.parse(s(e));
|
|
16
|
+
expect(t.value).toBe("9007199254740991");
|
|
17
|
+
}), it("serialises 10 ETH in wei (above Number.MAX_SAFE_INTEGER) to the exact string without rounding", () => {
|
|
18
|
+
const e = { ...n, value: 10000000000000000000n }, t = JSON.parse(s(e));
|
|
19
|
+
expect(t.value).toBe("10000000000000000000");
|
|
20
|
+
}), it("serialises a value that would be corrupted by Number() to the exact string", () => {
|
|
21
|
+
const e = { ...n, value: 9007199254740993n }, t = JSON.parse(s(e));
|
|
22
|
+
expect(t.value).toBe("9007199254740993"), expect(t.value).not.toBe("9007199254740992");
|
|
34
23
|
});
|
|
35
24
|
});
|