@multiversx/sdk-dapp-liquidity 0.2.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +186 -0
- package/all-networks-EJIVYZ_i.mjs +4 -0
- package/all-networks-NYACMyeN.js +4 -0
- package/api/confirmRate.d.ts +11 -0
- package/api/confirmRate.js +30 -0
- package/api/confirmRate.mjs +29 -0
- package/api/getChains.d.ts +6 -0
- package/api/getChains.js +12 -0
- package/api/getChains.mjs +11 -0
- package/api/getRate.d.ts +10 -0
- package/api/getRate.js +28 -0
- package/api/getRate.mjs +27 -0
- package/api/getTokens.d.ts +7 -0
- package/api/getTokens.js +14 -0
- package/api/getTokens.mjs +13 -0
- package/api/getTokensBalances.d.ts +8 -0
- package/api/getTokensBalances.js +17 -0
- package/api/getTokensBalances.mjs +16 -0
- package/api/getTransactions.d.ts +7 -0
- package/api/getTransactions.js +14 -0
- package/api/getTransactions.mjs +13 -0
- package/api/index.d.ts +7 -0
- package/api/index.js +17 -0
- package/api/index.mjs +16 -0
- package/api/sendTransactions.d.ts +11 -0
- package/api/sendTransactions.js +29 -0
- package/api/sendTransactions.mjs +28 -0
- package/api/tests/confirmRate.spec.d.ts +1 -0
- package/api/tests/confirmRate.spec.js +124 -0
- package/api/tests/confirmRate.spec.mjs +122 -0
- package/api/tests/getChains.spec.d.ts +1 -0
- package/api/tests/getChains.spec.js +37 -0
- package/api/tests/getChains.spec.mjs +35 -0
- package/api/tests/getRate.spec.d.ts +1 -0
- package/api/tests/getRate.spec.js +83 -0
- package/api/tests/getRate.spec.mjs +81 -0
- package/api/tests/getTokens.spec.d.ts +1 -0
- package/api/tests/getTokens.spec.js +60 -0
- package/api/tests/getTokens.spec.mjs +58 -0
- package/api/tests/getTransactions.spec.d.ts +1 -0
- package/api/tests/getTransactions.spec.js +89 -0
- package/api/tests/getTransactions.spec.mjs +87 -0
- package/api/tests/sendTransactions.spec.d.ts +1 -0
- package/api/tests/sendTransactions.spec.js +83 -0
- package/api/tests/sendTransactions.spec.mjs +81 -0
- package/bignumber-B8vjg9qn.js +1334 -0
- package/bignumber-CKZkoo0g.mjs +1334 -0
- package/constants/index.d.ts +1 -0
- package/constants/index.js +5 -0
- package/constants/index.mjs +4 -0
- package/default-BYtXv70Z.mjs +4 -0
- package/default-H3AbmzFV.js +4 -0
- package/dto/Chain.dto.d.ts +16 -0
- package/dto/Chain.dto.js +2 -0
- package/dto/Chain.dto.mjs +1 -0
- package/dto/ConfirmRate.dto.d.ts +11 -0
- package/dto/ConfirmRate.dto.js +2 -0
- package/dto/ConfirmRate.dto.mjs +1 -0
- package/dto/Token.dto.d.ts +14 -0
- package/dto/Token.dto.js +2 -0
- package/dto/Token.dto.mjs +1 -0
- package/dto/TokenBalance.dto.d.ts +4 -0
- package/dto/TokenBalance.dto.js +2 -0
- package/dto/TokenBalance.dto.mjs +1 -0
- package/dto/Transaction.dto.d.ts +14 -0
- package/dto/Transaction.dto.js +2 -0
- package/dto/Transaction.dto.mjs +1 -0
- package/dto/index.d.ts +5 -0
- package/dto/index.js +2 -0
- package/dto/index.mjs +1 -0
- package/helpers/base64Utils.d.ts +3 -0
- package/helpers/base64Utils.js +32 -0
- package/helpers/base64Utils.mjs +31 -0
- package/helpers/decodeLoginToken.d.ts +9 -0
- package/helpers/decodeLoginToken.js +28 -0
- package/helpers/decodeLoginToken.mjs +27 -0
- package/helpers/decodeToken.d.ts +11 -0
- package/helpers/decodeToken.js +40 -0
- package/helpers/decodeToken.mjs +39 -0
- package/helpers/getApiURL.d.ts +1 -0
- package/helpers/getApiURL.js +8 -0
- package/helpers/getApiURL.mjs +7 -0
- package/helpers/getBridgeURL.d.ts +1 -0
- package/helpers/getBridgeURL.js +8 -0
- package/helpers/getBridgeURL.mjs +7 -0
- package/helpers/getMvxApiURL.d.ts +1 -0
- package/helpers/getMvxApiURL.js +8 -0
- package/helpers/getMvxApiURL.mjs +7 -0
- package/helpers/getMvxChainId.d.ts +1 -0
- package/helpers/getMvxChainId.js +8 -0
- package/helpers/getMvxChainId.mjs +7 -0
- package/helpers/getMvxExplorerAddress.d.ts +1 -0
- package/helpers/getMvxExplorerAddress.js +8 -0
- package/helpers/getMvxExplorerAddress.mjs +7 -0
- package/helpers/index.d.ts +9 -0
- package/helpers/index.js +23 -0
- package/helpers/index.mjs +22 -0
- package/helpers/serializeTransaction.d.ts +3 -0
- package/helpers/serializeTransaction.js +9 -0
- package/helpers/serializeTransaction.mjs +8 -0
- package/helpers/tests/base64Utils.spec.d.ts +1 -0
- package/helpers/tests/base64Utils.spec.js +30 -0
- package/helpers/tests/base64Utils.spec.mjs +28 -0
- package/helpers/tests/decodeLoginToken.spec.d.ts +1 -0
- package/helpers/tests/decodeLoginToken.spec.js +35 -0
- package/helpers/tests/decodeLoginToken.spec.mjs +33 -0
- package/helpers/tests/decodeToken.spec.d.ts +1 -0
- package/helpers/tests/decodeToken.spec.js +28 -0
- package/helpers/tests/decodeToken.spec.mjs +26 -0
- package/index-B9WqxUXM.mjs +91 -0
- package/index-BXwpbIDQ.mjs +107 -0
- package/index-CnudU77V.js +329 -0
- package/index-DSnomXRI.mjs +68025 -0
- package/index-DZHiA1sX.js +107 -0
- package/index-cvy2-uZ_.js +67946 -0
- package/index.d.ts +6 -0
- package/index.js +189 -0
- package/index.mjs +185 -0
- package/package.json +107 -0
- package/react-B9sQBOh0.mjs +3040 -0
- package/react-BaXyw3AO.js +3040 -0
- package/react-CNXJSTCv.js +38 -0
- package/react-CSQpf1zk.mjs +38 -0
- package/reactjs/components/AccountAddress/AccountAddress.d.ts +6 -0
- package/reactjs/components/AccountAddress/AccountAddress.js +25 -0
- package/reactjs/components/AccountAddress/AccountAddress.mjs +24 -0
- package/reactjs/components/AccountAddress/index.d.ts +1 -0
- package/reactjs/components/AccountAddress/index.js +5 -0
- package/reactjs/components/AccountAddress/index.mjs +4 -0
- package/reactjs/components/AmountCard/AmountCard.d.ts +6 -0
- package/reactjs/components/AmountCard/AmountCard.js +33 -0
- package/reactjs/components/AmountCard/AmountCard.mjs +32 -0
- package/reactjs/components/AmountCard/index.d.ts +1 -0
- package/reactjs/components/AmountCard/index.js +5 -0
- package/reactjs/components/AmountCard/index.mjs +4 -0
- package/reactjs/components/AmountInput/AmountInput.d.ts +13 -0
- package/reactjs/components/AmountInput/AmountInput.js +61 -0
- package/reactjs/components/AmountInput/AmountInput.mjs +60 -0
- package/reactjs/components/AmountInput/index.d.ts +1 -0
- package/reactjs/components/AmountInput/index.js +5 -0
- package/reactjs/components/AmountInput/index.mjs +4 -0
- package/reactjs/components/BridgeForm/BridgeForm.d.ts +16 -0
- package/reactjs/components/BridgeForm/BridgeForm.js +680 -0
- package/reactjs/components/BridgeForm/BridgeForm.mjs +679 -0
- package/reactjs/components/BridgeForm/index.d.ts +1 -0
- package/reactjs/components/BridgeForm/index.js +5 -0
- package/reactjs/components/BridgeForm/index.mjs +4 -0
- package/reactjs/components/BridgeHistory/BridgeHistory.d.ts +4 -0
- package/reactjs/components/BridgeHistory/BridgeHistory.js +233 -0
- package/reactjs/components/BridgeHistory/BridgeHistory.mjs +232 -0
- package/reactjs/components/BridgeHistory/index.d.ts +1 -0
- package/reactjs/components/BridgeHistory/index.js +5 -0
- package/reactjs/components/BridgeHistory/index.mjs +4 -0
- package/reactjs/components/Connect/BridgeAccountDisplay.d.ts +6 -0
- package/reactjs/components/Connect/BridgeAccountDisplay.js +85 -0
- package/reactjs/components/Connect/BridgeAccountDisplay.mjs +84 -0
- package/reactjs/components/Connect/BridgeConnectButton.d.ts +7 -0
- package/reactjs/components/Connect/BridgeConnectButton.js +26 -0
- package/reactjs/components/Connect/BridgeConnectButton.mjs +25 -0
- package/reactjs/components/Connect/CustomConnectButton.d.ts +7 -0
- package/reactjs/components/Connect/CustomConnectButton.js +42 -0
- package/reactjs/components/Connect/CustomConnectButton.mjs +41 -0
- package/reactjs/components/Connect/MvxAccountDisplay.d.ts +9 -0
- package/reactjs/components/Connect/MvxAccountDisplay.js +75 -0
- package/reactjs/components/Connect/MvxAccountDisplay.mjs +74 -0
- package/reactjs/components/Connect/MvxConnectButton.d.ts +11 -0
- package/reactjs/components/Connect/MvxConnectButton.js +43 -0
- package/reactjs/components/Connect/MvxConnectButton.mjs +42 -0
- package/reactjs/components/Connect/SwitchChainButton.d.ts +7 -0
- package/reactjs/components/Connect/SwitchChainButton.js +33 -0
- package/reactjs/components/Connect/SwitchChainButton.mjs +32 -0
- package/reactjs/components/Connect/index.d.ts +6 -0
- package/reactjs/components/Connect/index.js +15 -0
- package/reactjs/components/Connect/index.mjs +14 -0
- package/reactjs/components/CopyButton/CopyButton.d.ts +6 -0
- package/reactjs/components/CopyButton/CopyButton.js +42 -0
- package/reactjs/components/CopyButton/CopyButton.mjs +41 -0
- package/reactjs/components/CopyButton/index.d.ts +1 -0
- package/reactjs/components/CopyButton/index.js +5 -0
- package/reactjs/components/CopyButton/index.mjs +4 -0
- package/reactjs/components/CopyButton/utils/copyToClipboard.d.ts +1 -0
- package/reactjs/components/CopyButton/utils/copyToClipboard.js +38 -0
- package/reactjs/components/CopyButton/utils/copyToClipboard.mjs +37 -0
- package/reactjs/components/CopyButton/utils/index.d.ts +1 -0
- package/reactjs/components/CopyButton/utils/index.js +5 -0
- package/reactjs/components/CopyButton/utils/index.mjs +4 -0
- package/reactjs/components/DisplayAmount/DisplayAmount.d.ts +21 -0
- package/reactjs/components/DisplayAmount/DisplayAmount.js +91 -0
- package/reactjs/components/DisplayAmount/DisplayAmount.mjs +90 -0
- package/reactjs/components/DisplayAmount/components/AnimateNumber/AnimateNumber.d.ts +7 -0
- package/reactjs/components/DisplayAmount/components/AnimateNumber/AnimateNumber.js +40 -0
- package/reactjs/components/DisplayAmount/components/AnimateNumber/AnimateNumber.mjs +39 -0
- package/reactjs/components/DisplayAmount/components/AnimateNumber/index.d.ts +0 -0
- package/reactjs/components/DisplayAmount/components/AnimateNumber/index.js +2 -0
- package/reactjs/components/DisplayAmount/components/AnimateNumber/index.mjs +1 -0
- package/reactjs/components/DisplayAmount/components/PrecisedAmount/PrecisedAmount.d.ts +14 -0
- package/reactjs/components/DisplayAmount/components/PrecisedAmount/PrecisedAmount.js +62 -0
- package/reactjs/components/DisplayAmount/components/PrecisedAmount/PrecisedAmount.mjs +61 -0
- package/reactjs/components/DisplayAmount/components/index.d.ts +0 -0
- package/reactjs/components/DisplayAmount/components/index.js +2 -0
- package/reactjs/components/DisplayAmount/components/index.mjs +1 -0
- package/reactjs/components/DisplayAmount/index.d.ts +1 -0
- package/reactjs/components/DisplayAmount/index.js +5 -0
- package/reactjs/components/DisplayAmount/index.mjs +4 -0
- package/reactjs/components/DisplayAmount/utils/index.d.ts +1 -0
- package/reactjs/components/DisplayAmount/utils/index.js +5 -0
- package/reactjs/components/DisplayAmount/utils/index.mjs +4 -0
- package/reactjs/components/DisplayAmount/utils/truncateAmount.d.ts +1 -0
- package/reactjs/components/DisplayAmount/utils/truncateAmount.js +22 -0
- package/reactjs/components/DisplayAmount/utils/truncateAmount.mjs +21 -0
- package/reactjs/components/SmallLoader/SmallLoader.d.ts +4 -0
- package/reactjs/components/SmallLoader/SmallLoader.js +22 -0
- package/reactjs/components/SmallLoader/SmallLoader.mjs +21 -0
- package/reactjs/components/SmallLoader/index.d.ts +1 -0
- package/reactjs/components/SmallLoader/index.js +5 -0
- package/reactjs/components/SmallLoader/index.mjs +4 -0
- package/reactjs/components/TokenSelector/TokenSelector.d.ts +16 -0
- package/reactjs/components/TokenSelector/TokenSelector.js +158 -0
- package/reactjs/components/TokenSelector/TokenSelector.mjs +157 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/ChainSelect.d.ts +8 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/ChainSelect.js +86 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/ChainSelect.mjs +85 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/components/ChainOptionLabel.d.ts +11 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/components/ChainOptionLabel.js +45 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/components/ChainOptionLabel.mjs +44 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/components/FormatChainOptionLabel.d.ts +6 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/components/FormatChainOptionLabel.js +19 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/components/FormatChainOptionLabel.mjs +18 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/components/IndicatorSeparator.d.ts +3 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/components/IndicatorSeparator.js +7 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/components/IndicatorSeparator.mjs +6 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/components/SelectedChainOption.d.ts +4 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/components/SelectedChainOption.js +33 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/components/SelectedChainOption.mjs +32 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/types/chainSelectOption.d.ts +10 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/types/chainSelectOption.js +2 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/types/chainSelectOption.mjs +1 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/types/partialChainOption.d.ts +10 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/types/partialChainOption.js +2 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/types/partialChainOption.mjs +1 -0
- package/reactjs/components/TokenSelector/components/SelectContainer.d.ts +7 -0
- package/reactjs/components/TokenSelector/components/SelectContainer.js +41 -0
- package/reactjs/components/TokenSelector/components/SelectContainer.mjs +40 -0
- package/reactjs/components/TokenSelector/components/SelectContent.d.ts +10 -0
- package/reactjs/components/TokenSelector/components/SelectContent.js +93 -0
- package/reactjs/components/TokenSelector/components/SelectContent.mjs +92 -0
- package/reactjs/components/TokenSelector/components/SelectedOption.d.ts +5 -0
- package/reactjs/components/TokenSelector/components/SelectedOption.js +29 -0
- package/reactjs/components/TokenSelector/components/SelectedOption.mjs +28 -0
- package/reactjs/components/TokenSelector/components/TokenIcon.d.ts +8 -0
- package/reactjs/components/TokenSelector/components/TokenIcon.js +82 -0
- package/reactjs/components/TokenSelector/components/TokenIcon.mjs +81 -0
- package/reactjs/components/TokenSelector/components/TokenItem.d.ts +7 -0
- package/reactjs/components/TokenSelector/components/TokenItem.js +69 -0
- package/reactjs/components/TokenSelector/components/TokenItem.mjs +68 -0
- package/reactjs/components/TokenSelector/components/TokenList.d.ts +7 -0
- package/reactjs/components/TokenSelector/components/TokenList.js +21 -0
- package/reactjs/components/TokenSelector/components/TokenList.mjs +20 -0
- package/reactjs/components/TokenSelector/components/TokenSymbol.d.ts +9 -0
- package/reactjs/components/TokenSelector/components/TokenSymbol.js +26 -0
- package/reactjs/components/TokenSelector/components/TokenSymbol.mjs +25 -0
- package/reactjs/components/TokenSelector/index.d.ts +1 -0
- package/reactjs/components/TokenSelector/index.js +5 -0
- package/reactjs/components/TokenSelector/index.mjs +4 -0
- package/reactjs/components/TransactionToast/TransactionToast.d.ts +9 -0
- package/reactjs/components/TransactionToast/TransactionToast.js +54 -0
- package/reactjs/components/TransactionToast/TransactionToast.mjs +53 -0
- package/reactjs/components/TransactionToast/TransactionToastContainer.d.ts +3 -0
- package/reactjs/components/TransactionToast/TransactionToastContainer.js +21 -0
- package/reactjs/components/TransactionToast/TransactionToastContainer.mjs +20 -0
- package/reactjs/components/TransactionToast/index.d.ts +2 -0
- package/reactjs/components/TransactionToast/index.js +7 -0
- package/reactjs/components/TransactionToast/index.mjs +6 -0
- package/reactjs/components/TrimAddress/TrimAddress.d.ts +8 -0
- package/reactjs/components/TrimAddress/TrimAddress.js +26 -0
- package/reactjs/components/TrimAddress/TrimAddress.mjs +25 -0
- package/reactjs/components/TrimAddress/index.d.ts +1 -0
- package/reactjs/components/TrimAddress/index.js +5 -0
- package/reactjs/components/TrimAddress/index.mjs +4 -0
- package/reactjs/components/base/MxButton/MxButton.d.ts +13 -0
- package/reactjs/components/base/MxButton/MxButton.js +72 -0
- package/reactjs/components/base/MxButton/MxButton.mjs +71 -0
- package/reactjs/components/base/MxButton/index.d.ts +1 -0
- package/reactjs/components/base/MxButton/index.js +5 -0
- package/reactjs/components/base/MxButton/index.mjs +4 -0
- package/reactjs/components/base/MxCard/MxCard.d.ts +10 -0
- package/reactjs/components/base/MxCard/MxCard.js +55 -0
- package/reactjs/components/base/MxCard/MxCard.mjs +54 -0
- package/reactjs/components/base/MxCard/index.d.ts +1 -0
- package/reactjs/components/base/MxCard/index.js +5 -0
- package/reactjs/components/base/MxCard/index.mjs +4 -0
- package/reactjs/components/base/MxLink/MxLink.d.ts +10 -0
- package/reactjs/components/base/MxLink/MxLink.js +71 -0
- package/reactjs/components/base/MxLink/MxLink.mjs +70 -0
- package/reactjs/components/base/MxLink/index.d.ts +1 -0
- package/reactjs/components/base/MxLink/index.js +5 -0
- package/reactjs/components/base/MxLink/index.mjs +4 -0
- package/reactjs/components/base/MxSearch/MxSearch.d.ts +10 -0
- package/reactjs/components/base/MxSearch/MxSearch.js +70 -0
- package/reactjs/components/base/MxSearch/MxSearch.mjs +69 -0
- package/reactjs/components/base/MxSearch/index.d.ts +1 -0
- package/reactjs/components/base/MxSearch/index.js +5 -0
- package/reactjs/components/base/MxSearch/index.mjs +4 -0
- package/reactjs/components/base/MxSlideover/MxSlideover.d.ts +10 -0
- package/reactjs/components/base/MxSlideover/MxSlideover.js +79 -0
- package/reactjs/components/base/MxSlideover/MxSlideover.mjs +78 -0
- package/reactjs/components/base/MxSlideover/index.d.ts +1 -0
- package/reactjs/components/base/MxSlideover/index.js +5 -0
- package/reactjs/components/base/MxSlideover/index.mjs +4 -0
- package/reactjs/components/base/MxTooltip/MxTooltip.d.ts +23 -0
- package/reactjs/components/base/MxTooltip/MxTooltip.js +163 -0
- package/reactjs/components/base/MxTooltip/MxTooltip.mjs +162 -0
- package/reactjs/components/base/MxTooltip/components/TooltipContainer/TooltipContainer.d.ts +11 -0
- package/reactjs/components/base/MxTooltip/components/TooltipContainer/TooltipContainer.js +34 -0
- package/reactjs/components/base/MxTooltip/components/TooltipContainer/TooltipContainer.mjs +33 -0
- package/reactjs/components/base/MxTooltip/components/TooltipContainer/index.d.ts +1 -0
- package/reactjs/components/base/MxTooltip/components/TooltipContainer/index.js +5 -0
- package/reactjs/components/base/MxTooltip/components/TooltipContainer/index.mjs +4 -0
- package/reactjs/components/base/MxTooltip/components/TooltipContent/TooltipContent.d.ts +13 -0
- package/reactjs/components/base/MxTooltip/components/TooltipContent/TooltipContent.js +28 -0
- package/reactjs/components/base/MxTooltip/components/TooltipContent/TooltipContent.mjs +27 -0
- package/reactjs/components/base/MxTooltip/components/TooltipContent/index.d.ts +1 -0
- package/reactjs/components/base/MxTooltip/components/TooltipContent/index.js +5 -0
- package/reactjs/components/base/MxTooltip/components/TooltipContent/index.mjs +4 -0
- package/reactjs/components/base/MxTooltip/components/index.d.ts +2 -0
- package/reactjs/components/base/MxTooltip/components/index.js +7 -0
- package/reactjs/components/base/MxTooltip/components/index.mjs +6 -0
- package/reactjs/components/base/MxTooltip/index.d.ts +1 -0
- package/reactjs/components/base/MxTooltip/index.js +5 -0
- package/reactjs/components/base/MxTooltip/index.mjs +4 -0
- package/reactjs/components/base/index.d.ts +6 -0
- package/reactjs/components/base/index.js +15 -0
- package/reactjs/components/base/index.mjs +14 -0
- package/reactjs/components/index.d.ts +13 -0
- package/reactjs/components/index.js +51 -0
- package/reactjs/components/index.mjs +50 -0
- package/reactjs/constants/chains.d.ts +35 -0
- package/reactjs/constants/chains.js +38 -0
- package/reactjs/constants/chains.mjs +37 -0
- package/reactjs/constants/index.d.ts +3 -0
- package/reactjs/constants/index.js +12 -0
- package/reactjs/constants/index.mjs +11 -0
- package/reactjs/context/Web3AppProvider.d.ts +12 -0
- package/reactjs/context/Web3AppProvider.js +29 -0
- package/reactjs/context/Web3AppProvider.mjs +28 -0
- package/reactjs/context/queryClient.d.ts +3 -0
- package/reactjs/context/queryClient.js +12 -0
- package/reactjs/context/queryClient.mjs +11 -0
- package/reactjs/context/useWeb3App.d.ts +1 -0
- package/reactjs/context/useWeb3App.js +13 -0
- package/reactjs/context/useWeb3App.mjs +12 -0
- package/reactjs/hooks/index.d.ts +11 -0
- package/reactjs/hooks/index.js +32 -0
- package/reactjs/hooks/index.mjs +31 -0
- package/reactjs/hooks/useAccount.d.ts +77 -0
- package/reactjs/hooks/useAccount.js +18 -0
- package/reactjs/hooks/useAccount.mjs +17 -0
- package/reactjs/hooks/useBalances.d.ts +10 -0
- package/reactjs/hooks/useBalances.js +7 -0
- package/reactjs/hooks/useBalances.mjs +6 -0
- package/reactjs/hooks/useBridgeFormik.d.ts +98 -0
- package/reactjs/hooks/useBridgeFormik.js +182 -0
- package/reactjs/hooks/useBridgeFormik.mjs +181 -0
- package/reactjs/hooks/useDebounce.d.ts +1 -0
- package/reactjs/hooks/useDebounce.js +14 -0
- package/reactjs/hooks/useDebounce.mjs +13 -0
- package/reactjs/hooks/useFetchBridgeData.d.ts +45 -0
- package/reactjs/hooks/useFetchBridgeData.js +44 -0
- package/reactjs/hooks/useFetchBridgeData.mjs +43 -0
- package/reactjs/hooks/useFetchTokens.d.ts +42 -0
- package/reactjs/hooks/useFetchTokens.js +105 -0
- package/reactjs/hooks/useFetchTokens.mjs +104 -0
- package/reactjs/hooks/useGetChainId.d.ts +1 -0
- package/reactjs/hooks/useGetChainId.js +12 -0
- package/reactjs/hooks/useGetChainId.mjs +11 -0
- package/reactjs/hooks/useResolveTokenChain.d.ts +9 -0
- package/reactjs/hooks/useResolveTokenChain.js +21 -0
- package/reactjs/hooks/useResolveTokenChain.mjs +20 -0
- package/reactjs/hooks/useSendTransactions.d.ts +3 -0
- package/reactjs/hooks/useSendTransactions.js +19 -0
- package/reactjs/hooks/useSendTransactions.mjs +18 -0
- package/reactjs/hooks/useSignTransaction.d.ts +69 -0
- package/reactjs/hooks/useSignTransaction.js +17 -0
- package/reactjs/hooks/useSignTransaction.mjs +16 -0
- package/reactjs/hooks/validation/index.d.ts +4 -0
- package/reactjs/hooks/validation/index.js +11 -0
- package/reactjs/hooks/validation/index.mjs +10 -0
- package/reactjs/hooks/validation/useAmountSchema.d.ts +2 -0
- package/reactjs/hooks/validation/useAmountSchema.js +31 -0
- package/reactjs/hooks/validation/useAmountSchema.mjs +13 -0
- package/reactjs/hooks/validation/useSecondAmountSchema.d.ts +2 -0
- package/reactjs/hooks/validation/useSecondAmountSchema.js +27 -0
- package/reactjs/hooks/validation/useSecondAmountSchema.mjs +9 -0
- package/reactjs/hooks/validation/useTestHasEnoughFunds.d.ts +3 -0
- package/reactjs/hooks/validation/useTestHasEnoughFunds.js +38 -0
- package/reactjs/hooks/validation/useTestHasEnoughFunds.mjs +37 -0
- package/reactjs/hooks/validation/useTestIsConnected.d.ts +3 -0
- package/reactjs/hooks/validation/useTestIsConnected.js +21 -0
- package/reactjs/hooks/validation/useTestIsConnected.mjs +20 -0
- package/reactjs/index.d.ts +10 -0
- package/reactjs/index.js +153 -0
- package/reactjs/index.mjs +149 -0
- package/reactjs/init/index.d.ts +1 -0
- package/reactjs/init/index.js +5 -0
- package/reactjs/init/index.mjs +4 -0
- package/reactjs/init/init.d.ts +48 -0
- package/reactjs/init/init.js +53 -0
- package/reactjs/init/init.mjs +35 -0
- package/reactjs/init/tests/init.spec.d.ts +1 -0
- package/reactjs/init/tests/init.spec.js +108 -0
- package/reactjs/init/tests/init.spec.mjs +106 -0
- package/reactjs/queries/index.d.ts +7 -0
- package/reactjs/queries/index.js +20 -0
- package/reactjs/queries/index.mjs +19 -0
- package/reactjs/queries/useGetAllTokens.query.d.ts +3 -0
- package/reactjs/queries/useGetAllTokens.query.js +31 -0
- package/reactjs/queries/useGetAllTokens.query.mjs +30 -0
- package/reactjs/queries/useGetChains.query.d.ts +3 -0
- package/reactjs/queries/useGetChains.query.js +31 -0
- package/reactjs/queries/useGetChains.query.mjs +30 -0
- package/reactjs/queries/useGetEvmTokensBalances.query.d.ts +22 -0
- package/reactjs/queries/useGetEvmTokensBalances.query.js +78 -0
- package/reactjs/queries/useGetEvmTokensBalances.query.mjs +77 -0
- package/reactjs/queries/useGetHistory.query.d.ts +4 -0
- package/reactjs/queries/useGetHistory.query.js +47 -0
- package/reactjs/queries/useGetHistory.query.mjs +46 -0
- package/reactjs/queries/useGetMvxTokensBalances.query.d.ts +23 -0
- package/reactjs/queries/useGetMvxTokensBalances.query.js +60 -0
- package/reactjs/queries/useGetMvxTokensBalances.query.mjs +59 -0
- package/reactjs/queries/useGetRate.mutation.d.ts +6 -0
- package/reactjs/queries/useGetRate.mutation.js +19 -0
- package/reactjs/queries/useGetRate.mutation.mjs +18 -0
- package/reactjs/queries/useGetTokens.query.d.ts +3 -0
- package/reactjs/queries/useGetTokens.query.js +34 -0
- package/reactjs/queries/useGetTokens.query.mjs +33 -0
- package/reactjs/reexports.d.ts +6 -0
- package/reactjs/reexports.js +21 -0
- package/reactjs/reexports.mjs +17 -0
- package/reactjs/utils/delay.d.ts +1 -0
- package/reactjs/utils/delay.js +7 -0
- package/reactjs/utils/delay.mjs +6 -0
- package/reactjs/utils/formatAmount.d.ts +7 -0
- package/reactjs/utils/formatAmount.js +24 -0
- package/reactjs/utils/formatAmount.mjs +23 -0
- package/reactjs/utils/getCleanStringAmount.d.ts +4 -0
- package/reactjs/utils/getCleanStringAmount.js +12 -0
- package/reactjs/utils/getCleanStringAmount.mjs +11 -0
- package/reactjs/utils/getCompletePathname.d.ts +1 -0
- package/reactjs/utils/getCompletePathname.js +6 -0
- package/reactjs/utils/getCompletePathname.mjs +5 -0
- package/reactjs/utils/getInitialTokens.d.ts +8 -0
- package/reactjs/utils/getInitialTokens.js +13 -0
- package/reactjs/utils/getInitialTokens.mjs +12 -0
- package/reactjs/utils/hasEnoughFunds.d.ts +5 -0
- package/reactjs/utils/hasEnoughFunds.js +20 -0
- package/reactjs/utils/hasEnoughFunds.mjs +19 -0
- package/reactjs/utils/index.d.ts +12 -0
- package/reactjs/utils/index.js +27 -0
- package/reactjs/utils/index.mjs +26 -0
- package/reactjs/utils/isStringFloat.d.ts +1 -0
- package/reactjs/utils/isStringFloat.js +22 -0
- package/reactjs/utils/isStringFloat.mjs +21 -0
- package/reactjs/utils/mxClsx.d.ts +3 -0
- package/reactjs/utils/mxClsx.js +21 -0
- package/reactjs/utils/mxClsx.mjs +20 -0
- package/reactjs/utils/pipe.d.ts +7 -0
- package/reactjs/utils/pipe.js +26 -0
- package/reactjs/utils/pipe.mjs +25 -0
- package/reactjs/utils/removeCommas.d.ts +1 -0
- package/reactjs/utils/removeCommas.js +7 -0
- package/reactjs/utils/removeCommas.mjs +6 -0
- package/reactjs/utils/roundAmount.d.ts +1 -0
- package/reactjs/utils/roundAmount.js +41 -0
- package/reactjs/utils/roundAmount.mjs +40 -0
- package/reactjs/utils/testNumber.d.ts +1 -0
- package/reactjs/utils/testNumber.js +5 -0
- package/reactjs/utils/testNumber.mjs +4 -0
- package/store/inMemoryStore.d.ts +12 -0
- package/store/inMemoryStore.js +40 -0
- package/store/inMemoryStore.mjs +39 -0
- package/types/batchTransactions.d.ts +6 -0
- package/types/batchTransactions.js +2 -0
- package/types/batchTransactions.mjs +1 -0
- package/types/index.d.ts +4 -0
- package/types/index.js +2 -0
- package/types/index.mjs +1 -0
- package/types/rate.d.ts +11 -0
- package/types/rate.js +2 -0
- package/types/rate.mjs +1 -0
- package/types/token.d.ts +12 -0
- package/types/token.js +2 -0
- package/types/token.mjs +1 -0
- package/types/transaction.d.ts +14 -0
- package/types/transaction.js +2 -0
- package/types/transaction.mjs +1 -0
- package/useBalances-Bxtc4GNK.js +199 -0
- package/useBalances-DA3zEruz.mjs +199 -0
- package/w3m-modal-DCcF1qEB.js +356 -0
- package/w3m-modal-DK3G5GJp.mjs +356 -0
package/README.md
ADDED
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
# @multiversx/mx-sdk-dapp-liquidity
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Generic SDK for multi-chain wallet connections and transaction signing.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @multiversx/mx-sdk-dapp-liquidity
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Commands
|
|
14
|
+
|
|
15
|
+
### Install dependencies
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
yarn
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### Start
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
yarn start
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Build
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
yarn build
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Build and watch
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
yarn build:watch
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Test
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
yarn test
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Lint
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
yarn lint
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Release (publish)
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
yarn publish-package
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Release next version (publish)
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
yarn publish-package-next
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Usage
|
|
64
|
+
|
|
65
|
+
```css
|
|
66
|
+
@import 'node_modules/@multiversx/mx-sdk-dapp-liquidity/style.css';
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
```tsx
|
|
70
|
+
import { init, Web3AppProvider, AppKitNetwork, BridgeForm, TransactionToastContainer } from '@multiversx/sdk-dapp-liquidity';
|
|
71
|
+
|
|
72
|
+
const metadata = {
|
|
73
|
+
name: 'AppName',
|
|
74
|
+
description: 'AppName Example',
|
|
75
|
+
url: 'https://example.com', // origin must match your domain & subdomain
|
|
76
|
+
icons: ['https://avatars.githubusercontent.com/u/179229932']
|
|
77
|
+
};
|
|
78
|
+
const projectId = "@reown project id";
|
|
79
|
+
const provider = init({
|
|
80
|
+
/**
|
|
81
|
+
* @reown AppKit options
|
|
82
|
+
*/
|
|
83
|
+
appKitOptions: {
|
|
84
|
+
allowUnsupportedChain: true,
|
|
85
|
+
projectId,
|
|
86
|
+
metadata,
|
|
87
|
+
connectorImages: {
|
|
88
|
+
injected: 'https://avatars.githubusercontent.com/u/179229932',
|
|
89
|
+
walletConnect: 'https://avatars.githubusercontent.com/u/37784886?s=200&v=4',
|
|
90
|
+
"io.metamask": 'https://avatars.githubusercontent.com/u/11744586?s=200&v=4',
|
|
91
|
+
"com.trustwallet.app": 'https://avatars.githubusercontent.com/u/32179889?s=200&v=4',
|
|
92
|
+
},
|
|
93
|
+
themeMode: "dark",
|
|
94
|
+
themeVariables: {
|
|
95
|
+
"--w3m-font-family": "Roobert,system-ui,sans-serif",
|
|
96
|
+
},
|
|
97
|
+
features: {
|
|
98
|
+
email: false,
|
|
99
|
+
socials: false,
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
/**
|
|
103
|
+
* WagmiAdapter config
|
|
104
|
+
*/
|
|
105
|
+
adapterConfig: {
|
|
106
|
+
ssr: true,
|
|
107
|
+
},
|
|
108
|
+
/**
|
|
109
|
+
* Accepted chain IDs. The chains with ids [31, 44, 54] will be ignored as these are mapped to the mvx networks as [1, D, T]
|
|
110
|
+
*/
|
|
111
|
+
acceptedChainIDs: ["97", "4002"],
|
|
112
|
+
/**
|
|
113
|
+
* Accepted connectors IDs
|
|
114
|
+
*/
|
|
115
|
+
acceptedConnectorsIDs: [
|
|
116
|
+
'io.metamask',
|
|
117
|
+
'com.trustwallet.app',
|
|
118
|
+
'walletconnect'
|
|
119
|
+
],
|
|
120
|
+
/**
|
|
121
|
+
* Liquidity API URL
|
|
122
|
+
*/
|
|
123
|
+
apiURL: "https://devnet-tools.multiversx.com/liquidity-sdk",
|
|
124
|
+
/**
|
|
125
|
+
* Bridge URL. This is used to redirect the user to the bridge status page for tracking transactions (history). Will be removed in the next major release.
|
|
126
|
+
*/
|
|
127
|
+
bridgeURL: "https://devnet-bridge.multiversx.com",
|
|
128
|
+
/**
|
|
129
|
+
* MultiversX API URL
|
|
130
|
+
*/
|
|
131
|
+
mvxApiURL: "https://devnet-api.multiversx.com",
|
|
132
|
+
/**
|
|
133
|
+
* MultiversX Explorer URL
|
|
134
|
+
*/
|
|
135
|
+
mvxExplorerAddress: "https://devnet-explorer.multiversx.com",
|
|
136
|
+
/**
|
|
137
|
+
* MultiversX Chain ID
|
|
138
|
+
* Possible options 31 | 44 | 54 which are mapped to 1 | D | T
|
|
139
|
+
*/
|
|
140
|
+
mvxChainId: "44",
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
const App = () => {
|
|
144
|
+
const [showHistory, setShowHistory] = useState(false);
|
|
145
|
+
|
|
146
|
+
const mvxAccount = useGetAccount();
|
|
147
|
+
const evmAccount = useAccount();
|
|
148
|
+
const nativeAuthToken = useGetNativeAuthToken();
|
|
149
|
+
|
|
150
|
+
const onConnectToMvx = async () => {
|
|
151
|
+
// Login to MultiversX
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
const onDisconnectFromMvx = async () => {
|
|
155
|
+
// Logout from MultiversX
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
const onHistoryClose = () => {
|
|
159
|
+
setShowHistory(false);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
return (
|
|
163
|
+
// Wrap your app with Web3AppProvider to enable multi-chain connections
|
|
164
|
+
<Web3AppProvider appKit={provider.appKit} config={provider.config} options={provider.options}>
|
|
165
|
+
<BridgeForm
|
|
166
|
+
mvxChainId={"44"}
|
|
167
|
+
mvxAddress={mvxAccount?.address}
|
|
168
|
+
username={mvxAccount?.username}
|
|
169
|
+
nativeAuthToken={nativeAuthToken}
|
|
170
|
+
callbackRoute={"/deposit"}
|
|
171
|
+
showHistory={showHistory}
|
|
172
|
+
onSuccessfullySentTransaction={(txHashes) => {
|
|
173
|
+
// DO SOMETHING
|
|
174
|
+
}}
|
|
175
|
+
onFailedSentTransaction={() => {
|
|
176
|
+
// DO SOMETHING
|
|
177
|
+
}}
|
|
178
|
+
onHistoryClose={onHistoryClose}
|
|
179
|
+
onMvxConnect={onConnectToMvx}
|
|
180
|
+
onMvxDisconnect={onDisconnectFromMvx}
|
|
181
|
+
/>
|
|
182
|
+
<TransactionToastContainer theme="colored" />
|
|
183
|
+
</Web3AppProvider>
|
|
184
|
+
)
|
|
185
|
+
}
|
|
186
|
+
```
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const AllNetworks = "data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_800_5975)'%3e%3crect%20width='16'%20height='16'%20rx='4'%20fill='%23627EEA'/%3e%3cg%20clip-path='url(%23clip1_800_5975)'%3e%3cpath%20d='M8%2016C12.4183%2016%2016%2012.4183%2016%208C16%203.58172%2012.4183%200%208%200C3.58172%200%200%203.58172%200%208C0%2012.4183%203.58172%2016%208%2016Z'%20fill='%23627EEA'/%3e%3cpath%20d='M8.24902%202V6.435L11.9975%208.11L8.24902%202Z'%20fill='white'%20fill-opacity='0.602'/%3e%3cpath%20d='M8.249%202L4.5%208.11L8.249%206.435V2Z'%20fill='white'/%3e%3cpath%20d='M8.24902%2010.9841V13.9976L12%208.80811L8.24902%2010.9841Z'%20fill='white'%20fill-opacity='0.602'/%3e%3cpath%20d='M8.249%2013.9976V10.9836L4.5%208.80811L8.249%2013.9976Z'%20fill='white'/%3e%3cpath%20d='M8.24902%2010.2865L11.9975%208.11004L8.24902%206.43604V10.2865Z'%20fill='white'%20fill-opacity='0.2'/%3e%3cpath%20d='M4.5%208.11004L8.249%2010.2865V6.43604L4.5%208.11004Z'%20fill='white'%20fill-opacity='0.602'/%3e%3c/g%3e%3c/g%3e%3crect%20x='8'%20y='8'%20width='16'%20height='16'%20rx='4'%20fill='%23F0B90B'/%3e%3cpath%20d='M12.703%2015.9785L11.3515%2017.3252L10%2015.9785L11.3515%2014.6319L12.703%2015.9785ZM16%2012.6933L18.3168%2015.0166L19.6683%2013.67L17.3515%2011.3466L16%2010L14.6485%2011.3466L12.3168%2013.67L13.6683%2015.0166L16%2012.6933ZM20.6485%2014.6319L19.297%2015.9785L20.6485%2017.3252C21.1763%2016.7993%2021.4722%2016.5044%2022%2015.9785L20.6485%2014.6319ZM16%2019.2489L13.6832%2016.9404L12.3168%2018.2871L14.6337%2020.5956L15.9852%2021.9422L17.3366%2020.5956L19.6683%2018.2871L18.3168%2016.9404L16%2019.2489ZM16%2017.3252L17.3515%2015.9785L16%2014.6319L14.6485%2015.9785L16%2017.3252Z'%20fill='white'/%3e%3cdefs%3e%3cclipPath%20id='clip0_800_5975'%3e%3crect%20width='16'%20height='16'%20rx='4'%20fill='white'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_800_5975'%3e%3crect%20width='16'%20height='16'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
|
|
2
|
+
export {
|
|
3
|
+
AllNetworks as A
|
|
4
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
const AllNetworks = "data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_800_5975)'%3e%3crect%20width='16'%20height='16'%20rx='4'%20fill='%23627EEA'/%3e%3cg%20clip-path='url(%23clip1_800_5975)'%3e%3cpath%20d='M8%2016C12.4183%2016%2016%2012.4183%2016%208C16%203.58172%2012.4183%200%208%200C3.58172%200%200%203.58172%200%208C0%2012.4183%203.58172%2016%208%2016Z'%20fill='%23627EEA'/%3e%3cpath%20d='M8.24902%202V6.435L11.9975%208.11L8.24902%202Z'%20fill='white'%20fill-opacity='0.602'/%3e%3cpath%20d='M8.249%202L4.5%208.11L8.249%206.435V2Z'%20fill='white'/%3e%3cpath%20d='M8.24902%2010.9841V13.9976L12%208.80811L8.24902%2010.9841Z'%20fill='white'%20fill-opacity='0.602'/%3e%3cpath%20d='M8.249%2013.9976V10.9836L4.5%208.80811L8.249%2013.9976Z'%20fill='white'/%3e%3cpath%20d='M8.24902%2010.2865L11.9975%208.11004L8.24902%206.43604V10.2865Z'%20fill='white'%20fill-opacity='0.2'/%3e%3cpath%20d='M4.5%208.11004L8.249%2010.2865V6.43604L4.5%208.11004Z'%20fill='white'%20fill-opacity='0.602'/%3e%3c/g%3e%3c/g%3e%3crect%20x='8'%20y='8'%20width='16'%20height='16'%20rx='4'%20fill='%23F0B90B'/%3e%3cpath%20d='M12.703%2015.9785L11.3515%2017.3252L10%2015.9785L11.3515%2014.6319L12.703%2015.9785ZM16%2012.6933L18.3168%2015.0166L19.6683%2013.67L17.3515%2011.3466L16%2010L14.6485%2011.3466L12.3168%2013.67L13.6683%2015.0166L16%2012.6933ZM20.6485%2014.6319L19.297%2015.9785L20.6485%2017.3252C21.1763%2016.7993%2021.4722%2016.5044%2022%2015.9785L20.6485%2014.6319ZM16%2019.2489L13.6832%2016.9404L12.3168%2018.2871L14.6337%2020.5956L15.9852%2021.9422L17.3366%2020.5956L19.6683%2018.2871L18.3168%2016.9404L16%2019.2489ZM16%2017.3252L17.3515%2015.9785L16%2014.6319L14.6485%2015.9785L16%2017.3252Z'%20fill='white'/%3e%3cdefs%3e%3cclipPath%20id='clip0_800_5975'%3e%3crect%20width='16'%20height='16'%20rx='4'%20fill='white'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_800_5975'%3e%3crect%20width='16'%20height='16'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
|
|
4
|
+
exports.AllNetworks = AllNetworks;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ServerTransaction } from '../types/transaction';
|
|
2
|
+
import { ConfirmRateDto } from '../dto/ConfirmRate.dto.ts';
|
|
3
|
+
import { AxiosResponse } from 'axios';
|
|
4
|
+
|
|
5
|
+
type ConfirmRateProps = {
|
|
6
|
+
url: string;
|
|
7
|
+
nativeAuthToken: string;
|
|
8
|
+
body: ConfirmRateDto;
|
|
9
|
+
};
|
|
10
|
+
export declare function confirmRate({ url, nativeAuthToken, body }: ConfirmRateProps): Promise<AxiosResponse<ServerTransaction[]>>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const axios = require("axios");
|
|
5
|
+
const helpers_decodeToken = require("../helpers/decodeToken.js");
|
|
6
|
+
async function confirmRate({
|
|
7
|
+
url,
|
|
8
|
+
nativeAuthToken,
|
|
9
|
+
body
|
|
10
|
+
}) {
|
|
11
|
+
var _a;
|
|
12
|
+
const config = {
|
|
13
|
+
baseURL: url,
|
|
14
|
+
headers: {
|
|
15
|
+
Authorization: `Bearer ${nativeAuthToken}`
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
if (!nativeAuthToken) {
|
|
19
|
+
(_a = config.headers) == null ? true : delete _a.Authorization;
|
|
20
|
+
}
|
|
21
|
+
const decodedToken = await helpers_decodeToken.decodeToken(nativeAuthToken);
|
|
22
|
+
if (config.headers.set) {
|
|
23
|
+
config.headers.set({
|
|
24
|
+
...config.headers,
|
|
25
|
+
origin: (decodedToken == null ? void 0 : decodedToken.origin) ?? ""
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
return await axios.post(`/rate/confirm`, body, config);
|
|
29
|
+
}
|
|
30
|
+
exports.confirmRate = confirmRate;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import axios from "axios";
|
|
2
|
+
import { decodeToken } from "../helpers/decodeToken.mjs";
|
|
3
|
+
async function confirmRate({
|
|
4
|
+
url,
|
|
5
|
+
nativeAuthToken,
|
|
6
|
+
body
|
|
7
|
+
}) {
|
|
8
|
+
var _a;
|
|
9
|
+
const config = {
|
|
10
|
+
baseURL: url,
|
|
11
|
+
headers: {
|
|
12
|
+
Authorization: `Bearer ${nativeAuthToken}`
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
if (!nativeAuthToken) {
|
|
16
|
+
(_a = config.headers) == null ? true : delete _a.Authorization;
|
|
17
|
+
}
|
|
18
|
+
const decodedToken = await decodeToken(nativeAuthToken);
|
|
19
|
+
if (config.headers.set) {
|
|
20
|
+
config.headers.set({
|
|
21
|
+
...config.headers,
|
|
22
|
+
origin: (decodedToken == null ? void 0 : decodedToken.origin) ?? ""
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
return await axios.post(`/rate/confirm`, body, config);
|
|
26
|
+
}
|
|
27
|
+
export {
|
|
28
|
+
confirmRate
|
|
29
|
+
};
|
package/api/getChains.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const axios = require("axios");
|
|
5
|
+
async function getChains({
|
|
6
|
+
url
|
|
7
|
+
}) {
|
|
8
|
+
return await axios.get("/chains", {
|
|
9
|
+
baseURL: url
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
exports.getChains = getChains;
|
package/api/getRate.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RateRequestBody, RateRequestResponse } from 'types/rate';
|
|
2
|
+
import { AxiosResponse } from 'axios';
|
|
3
|
+
|
|
4
|
+
interface RateProps {
|
|
5
|
+
url: string;
|
|
6
|
+
nativeAuthToken: string;
|
|
7
|
+
body: RateRequestBody;
|
|
8
|
+
}
|
|
9
|
+
export declare function getRate({ url, nativeAuthToken, body }: RateProps): Promise<AxiosResponse<RateRequestResponse>>;
|
|
10
|
+
export {};
|
package/api/getRate.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const axios = require("axios");
|
|
5
|
+
const helpers_decodeToken = require("../helpers/decodeToken.js");
|
|
6
|
+
async function getRate({
|
|
7
|
+
url,
|
|
8
|
+
nativeAuthToken,
|
|
9
|
+
body
|
|
10
|
+
}) {
|
|
11
|
+
var _a;
|
|
12
|
+
const config = {
|
|
13
|
+
baseURL: url,
|
|
14
|
+
headers: {
|
|
15
|
+
Authorization: `Bearer ${nativeAuthToken}`
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
if (!nativeAuthToken) {
|
|
19
|
+
(_a = config.headers) == null ? true : delete _a.Authorization;
|
|
20
|
+
}
|
|
21
|
+
const decodedToken = await helpers_decodeToken.decodeToken(nativeAuthToken);
|
|
22
|
+
config.headers = {
|
|
23
|
+
...config.headers,
|
|
24
|
+
origin: decodedToken == null ? void 0 : decodedToken.origin
|
|
25
|
+
};
|
|
26
|
+
return await axios.post(`/rate`, body, config);
|
|
27
|
+
}
|
|
28
|
+
exports.getRate = getRate;
|
package/api/getRate.mjs
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import axios from "axios";
|
|
2
|
+
import { decodeToken } from "../helpers/decodeToken.mjs";
|
|
3
|
+
async function getRate({
|
|
4
|
+
url,
|
|
5
|
+
nativeAuthToken,
|
|
6
|
+
body
|
|
7
|
+
}) {
|
|
8
|
+
var _a;
|
|
9
|
+
const config = {
|
|
10
|
+
baseURL: url,
|
|
11
|
+
headers: {
|
|
12
|
+
Authorization: `Bearer ${nativeAuthToken}`
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
if (!nativeAuthToken) {
|
|
16
|
+
(_a = config.headers) == null ? true : delete _a.Authorization;
|
|
17
|
+
}
|
|
18
|
+
const decodedToken = await decodeToken(nativeAuthToken);
|
|
19
|
+
config.headers = {
|
|
20
|
+
...config.headers,
|
|
21
|
+
origin: decodedToken == null ? void 0 : decodedToken.origin
|
|
22
|
+
};
|
|
23
|
+
return await axios.post(`/rate`, body, config);
|
|
24
|
+
}
|
|
25
|
+
export {
|
|
26
|
+
getRate
|
|
27
|
+
};
|
package/api/getTokens.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const axios = require("axios");
|
|
5
|
+
async function getTokens({
|
|
6
|
+
url,
|
|
7
|
+
chainId
|
|
8
|
+
}) {
|
|
9
|
+
const endpoint = chainId ? `/tokens/${chainId}` : "/tokens";
|
|
10
|
+
return await axios.get(endpoint, {
|
|
11
|
+
baseURL: url
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
exports.getTokens = getTokens;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TokenBalanceDTO } from '../dto/TokenBalance.dto';
|
|
2
|
+
import { AxiosResponse } from 'axios';
|
|
3
|
+
|
|
4
|
+
export declare function getTokensBalances({ url, userAddress, chainId }: {
|
|
5
|
+
url: string;
|
|
6
|
+
userAddress: string;
|
|
7
|
+
chainId: string;
|
|
8
|
+
}): Promise<AxiosResponse<TokenBalanceDTO[]>>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const axios = require("axios");
|
|
5
|
+
async function getTokensBalances({
|
|
6
|
+
url,
|
|
7
|
+
userAddress,
|
|
8
|
+
chainId
|
|
9
|
+
}) {
|
|
10
|
+
return await axios.get(
|
|
11
|
+
`/tokens/balances/${userAddress}/${chainId}`,
|
|
12
|
+
{
|
|
13
|
+
baseURL: url
|
|
14
|
+
}
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
exports.getTokensBalances = getTokensBalances;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import axios from "axios";
|
|
2
|
+
async function getTokensBalances({
|
|
3
|
+
url,
|
|
4
|
+
userAddress,
|
|
5
|
+
chainId
|
|
6
|
+
}) {
|
|
7
|
+
return await axios.get(
|
|
8
|
+
`/tokens/balances/${userAddress}/${chainId}`,
|
|
9
|
+
{
|
|
10
|
+
baseURL: url
|
|
11
|
+
}
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
getTokensBalances
|
|
16
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const axios = require("axios");
|
|
5
|
+
async function getTransactions({
|
|
6
|
+
url,
|
|
7
|
+
userWalletAddress
|
|
8
|
+
}) {
|
|
9
|
+
const endpoint = userWalletAddress ? `/transactions/${userWalletAddress}` : "/transactions";
|
|
10
|
+
return await axios.get(endpoint, {
|
|
11
|
+
baseURL: url
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
exports.getTransactions = getTransactions;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import axios from "axios";
|
|
2
|
+
async function getTransactions({
|
|
3
|
+
url,
|
|
4
|
+
userWalletAddress
|
|
5
|
+
}) {
|
|
6
|
+
const endpoint = userWalletAddress ? `/transactions/${userWalletAddress}` : "/transactions";
|
|
7
|
+
return await axios.get(endpoint, {
|
|
8
|
+
baseURL: url
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
getTransactions
|
|
13
|
+
};
|
package/api/index.d.ts
ADDED
package/api/index.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const api_confirmRate = require("./confirmRate.js");
|
|
5
|
+
const api_getChains = require("./getChains.js");
|
|
6
|
+
const api_getRate = require("./getRate.js");
|
|
7
|
+
const api_getTokens = require("./getTokens.js");
|
|
8
|
+
const api_getTokensBalances = require("./getTokensBalances.js");
|
|
9
|
+
const api_getTransactions = require("./getTransactions.js");
|
|
10
|
+
const api_sendTransactions = require("./sendTransactions.js");
|
|
11
|
+
exports.confirmRate = api_confirmRate.confirmRate;
|
|
12
|
+
exports.getChains = api_getChains.getChains;
|
|
13
|
+
exports.getRate = api_getRate.getRate;
|
|
14
|
+
exports.getTokens = api_getTokens.getTokens;
|
|
15
|
+
exports.getTokensBalances = api_getTokensBalances.getTokensBalances;
|
|
16
|
+
exports.getTransactions = api_getTransactions.getTransactions;
|
|
17
|
+
exports.sendTransactions = api_sendTransactions.sendTransactions;
|
package/api/index.mjs
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { confirmRate } from "./confirmRate.mjs";
|
|
2
|
+
import { getChains } from "./getChains.mjs";
|
|
3
|
+
import { getRate } from "./getRate.mjs";
|
|
4
|
+
import { getTokens } from "./getTokens.mjs";
|
|
5
|
+
import { getTokensBalances } from "./getTokensBalances.mjs";
|
|
6
|
+
import { getTransactions } from "./getTransactions.mjs";
|
|
7
|
+
import { sendTransactions } from "./sendTransactions.mjs";
|
|
8
|
+
export {
|
|
9
|
+
confirmRate,
|
|
10
|
+
getChains,
|
|
11
|
+
getRate,
|
|
12
|
+
getTokens,
|
|
13
|
+
getTokensBalances,
|
|
14
|
+
getTransactions,
|
|
15
|
+
sendTransactions
|
|
16
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ServerTransaction } from '../types/transaction';
|
|
2
|
+
import { BatchTransactions } from '../types/batchTransactions';
|
|
3
|
+
import { AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
4
|
+
|
|
5
|
+
export type SendTransactionsType = {
|
|
6
|
+
transactions: ServerTransaction[];
|
|
7
|
+
url: string;
|
|
8
|
+
token: string;
|
|
9
|
+
axiosConfig?: AxiosRequestConfig;
|
|
10
|
+
};
|
|
11
|
+
export declare const sendTransactions: ({ transactions, url, token, axiosConfig }: SendTransactionsType) => Promise<AxiosResponse<BatchTransactions>>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const axios = require("axios");
|
|
5
|
+
const helpers_serializeTransaction = require("../helpers/serializeTransaction.js");
|
|
6
|
+
const sendTransactions = async ({
|
|
7
|
+
transactions,
|
|
8
|
+
url,
|
|
9
|
+
token,
|
|
10
|
+
axiosConfig
|
|
11
|
+
}) => {
|
|
12
|
+
const config = {
|
|
13
|
+
baseURL: url,
|
|
14
|
+
headers: {
|
|
15
|
+
"Content-Type": "application/json",
|
|
16
|
+
Accept: "application/json",
|
|
17
|
+
Authorization: `Bearer ${token}`
|
|
18
|
+
},
|
|
19
|
+
...axiosConfig
|
|
20
|
+
};
|
|
21
|
+
return axios.post(
|
|
22
|
+
`/transactions`,
|
|
23
|
+
transactions.map(
|
|
24
|
+
(transaction) => JSON.parse(helpers_serializeTransaction.serializeTransaction(transaction))
|
|
25
|
+
),
|
|
26
|
+
config
|
|
27
|
+
);
|
|
28
|
+
};
|
|
29
|
+
exports.sendTransactions = sendTransactions;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import axios from "axios";
|
|
2
|
+
import { serializeTransaction } from "../helpers/serializeTransaction.mjs";
|
|
3
|
+
const sendTransactions = async ({
|
|
4
|
+
transactions,
|
|
5
|
+
url,
|
|
6
|
+
token,
|
|
7
|
+
axiosConfig
|
|
8
|
+
}) => {
|
|
9
|
+
const config = {
|
|
10
|
+
baseURL: url,
|
|
11
|
+
headers: {
|
|
12
|
+
"Content-Type": "application/json",
|
|
13
|
+
Accept: "application/json",
|
|
14
|
+
Authorization: `Bearer ${token}`
|
|
15
|
+
},
|
|
16
|
+
...axiosConfig
|
|
17
|
+
};
|
|
18
|
+
return axios.post(
|
|
19
|
+
`/transactions`,
|
|
20
|
+
transactions.map(
|
|
21
|
+
(transaction) => JSON.parse(serializeTransaction(transaction))
|
|
22
|
+
),
|
|
23
|
+
config
|
|
24
|
+
);
|
|
25
|
+
};
|
|
26
|
+
export {
|
|
27
|
+
sendTransactions
|
|
28
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|