@multiversx/sdk-dapp-liquidity 1.1.0-alpha.2 → 1.1.0-alpha.21
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 +6 -1
- package/api/getTransactions.d.ts +8 -2
- package/api/getTransactions.js +23 -3
- package/api/getTransactions.mjs +23 -3
- package/api/tests/getChains.spec.js +2 -1
- package/api/tests/getChains.spec.mjs +2 -1
- package/api/tests/getTokens.spec.js +2 -2
- package/api/tests/getTokens.spec.mjs +2 -2
- package/api/tests/getTransactions.spec.js +79 -69
- package/api/tests/getTransactions.spec.mjs +79 -69
- package/constants/index.d.ts +1 -1
- package/constants/index.js +1 -1
- package/constants/index.mjs +1 -1
- package/dto/Chain.dto.d.ts +3 -1
- package/dto/ConfirmRate.dto.d.ts +1 -0
- package/dto/Token.dto.d.ts +7 -2
- package/index.js +44 -16
- package/index.mjs +14 -16
- package/package.json +10 -6
- package/reactjs/components/BridgeForm/BridgeForm.d.ts +3 -1
- package/reactjs/components/BridgeForm/BridgeForm.js +182 -87
- package/reactjs/components/BridgeForm/BridgeForm.mjs +153 -58
- package/reactjs/components/BridgeHistory/BridgeHistory.js +73 -26
- package/reactjs/components/BridgeHistory/BridgeHistory.mjs +68 -21
- package/reactjs/components/Connect/BridgeAccountDisplay.js +2 -5
- package/reactjs/components/Connect/BridgeAccountDisplay.mjs +2 -5
- package/reactjs/components/Connect/CustomConnectButton.js +2 -5
- package/reactjs/components/Connect/CustomConnectButton.mjs +1 -4
- package/reactjs/components/Connect/MvxConnectButton.d.ts +2 -4
- package/reactjs/components/Connect/MvxConnectButton.js +2 -2
- package/reactjs/components/Connect/MvxConnectButton.mjs +2 -2
- package/reactjs/components/Connect/SwitchChainButton.js +2 -6
- package/reactjs/components/Connect/SwitchChainButton.mjs +1 -5
- package/reactjs/components/CopyButton/CopyButton.js +2 -2
- package/reactjs/components/CopyButton/CopyButton.mjs +2 -2
- package/reactjs/components/DisplayAmount/components/AnimateNumber/AnimateNumber.js +5 -5
- package/reactjs/components/Error/Error.d.ts +6 -0
- package/reactjs/components/Error/Error.js +67 -0
- package/reactjs/components/Error/Error.mjs +66 -0
- package/reactjs/components/Error/index.d.ts +1 -0
- package/reactjs/components/Error/index.js +5 -0
- package/reactjs/components/Error/index.mjs +4 -0
- package/reactjs/components/TokenSelector/TokenSelector.d.ts +2 -1
- package/reactjs/components/TokenSelector/TokenSelector.js +17 -9
- package/reactjs/components/TokenSelector/TokenSelector.mjs +13 -5
- package/reactjs/components/TokenSelector/components/ChainSelect/ChainSelect.d.ts +2 -1
- package/reactjs/components/TokenSelector/components/ChainSelect/ChainSelect.js +7 -3
- package/reactjs/components/TokenSelector/components/ChainSelect/ChainSelect.mjs +4 -0
- package/reactjs/components/TokenSelector/components/SelectContent.d.ts +2 -1
- package/reactjs/components/TokenSelector/components/SelectContent.js +12 -9
- package/reactjs/components/TokenSelector/components/SelectContent.mjs +4 -1
- package/reactjs/components/TokenSelector/components/TokenIcon.js +3 -3
- package/reactjs/components/TokenSelector/components/TokenItem.js +9 -9
- package/reactjs/components/TokenSelector/components/TokenItem.mjs +6 -6
- package/reactjs/components/base/MxCard/MxCard.js +2 -2
- package/reactjs/components/base/MxCircleLoader/MxCircleLoader.d.ts +4 -0
- package/reactjs/components/base/MxCircleLoader/MxCircleLoader.js +29 -0
- package/reactjs/components/base/MxCircleLoader/MxCircleLoader.mjs +28 -0
- package/reactjs/components/base/MxCircleLoader/index.d.ts +1 -0
- package/reactjs/components/base/MxCircleLoader/index.js +5 -0
- package/reactjs/components/base/MxCircleLoader/index.mjs +4 -0
- package/reactjs/components/base/MxLink/MxLink.js +2 -2
- package/reactjs/components/base/MxSearch/MxSearch.js +4 -4
- package/reactjs/components/base/MxSlideover/MxSlideover.js +4 -4
- package/reactjs/components/base/MxTooltip/MxTooltip.js +9 -9
- package/reactjs/components/base/MxTooltip/components/TooltipContainer/TooltipContainer.js +2 -2
- package/reactjs/components/index.d.ts +1 -0
- package/reactjs/components/index.js +2 -0
- package/reactjs/components/index.mjs +2 -0
- package/reactjs/context/Web3AppProvider.d.ts +3 -1
- package/reactjs/context/Web3AppProvider.js +7 -5
- package/reactjs/context/Web3AppProvider.mjs +4 -2
- package/reactjs/context/useWeb3App.js +2 -2
- package/reactjs/hooks/index.js +1 -1
- package/reactjs/hooks/index.mjs +1 -1
- package/reactjs/hooks/useAccount.js +1 -5
- package/reactjs/hooks/useAccount.mjs +1 -5
- package/reactjs/hooks/useBalances.d.ts +4 -4
- package/reactjs/hooks/useBalances.js +16 -1
- package/reactjs/hooks/useBalances.mjs +16 -1
- package/reactjs/hooks/useBridgeFormik.js +9 -16
- package/reactjs/hooks/useBridgeFormik.mjs +0 -7
- package/reactjs/hooks/useDebounce.js +3 -3
- package/reactjs/hooks/useFetchBridgeData.d.ts +14 -4
- package/reactjs/hooks/useFetchTokens.d.ts +14 -4
- package/reactjs/hooks/useFetchTokens.js +9 -9
- package/reactjs/hooks/useFetchTokens.mjs +2 -2
- package/reactjs/hooks/useFiatData.d.ts +7 -2
- package/reactjs/hooks/useFiatData.js +6 -6
- package/reactjs/hooks/useFiatData.mjs +1 -1
- package/reactjs/hooks/useGetChainId.js +3 -3
- package/reactjs/hooks/useGetChainId.mjs +1 -1
- package/reactjs/hooks/useResolveTokenChain.js +2 -2
- package/reactjs/hooks/useSendTransactions.js +2 -2
- package/reactjs/hooks/useSignTransaction.d.ts +93 -67
- package/reactjs/hooks/useSignTransaction.js +53 -4
- package/reactjs/hooks/useSignTransaction.mjs +53 -4
- package/reactjs/hooks/validation/useTestHasEnoughFunds.js +3 -3
- package/reactjs/hooks/validation/useTestIsConnected.js +2 -2
- package/reactjs/index.js +44 -16
- package/reactjs/index.mjs +14 -16
- package/reactjs/init/init.d.ts +220 -1
- package/reactjs/init/init.js +34 -10
- package/reactjs/init/init.mjs +31 -7
- package/reactjs/init/tests/init.spec.js +5 -6
- package/reactjs/init/tests/init.spec.mjs +5 -6
- package/reactjs/queries/index.d.ts +0 -1
- package/reactjs/queries/index.js +0 -2
- package/reactjs/queries/index.mjs +1 -3
- package/reactjs/queries/useGetEvmTokensBalances.query.d.ts +8 -3
- package/reactjs/queries/useGetEvmTokensBalances.query.js +15 -18
- package/reactjs/queries/useGetEvmTokensBalances.query.mjs +15 -18
- package/reactjs/queries/useGetHistory.query.d.ts +9 -1
- package/reactjs/queries/useGetHistory.query.js +23 -5
- package/reactjs/queries/useGetHistory.query.mjs +23 -5
- package/reactjs/queries/useGetMvxTokensBalances.query.d.ts +7 -2
- package/reactjs/queries/useGetMvxTokensBalances.query.js +2 -2
- package/reactjs/reexports.d.ts +2 -1
- package/reactjs/reexports.js +41 -13
- package/reactjs/reexports.mjs +11 -13
- package/reactjs/utils/getInitialTokens.d.ts +4 -1
- package/reactjs/utils/getInitialTokens.js +3 -3
- package/reactjs/utils/getInitialTokens.mjs +3 -3
- package/style.css +33 -1730
- package/types/chainType.d.ts +6 -0
- package/types/chainType.js +11 -0
- package/types/chainType.mjs +10 -0
- package/types/transaction.d.ts +28 -0
- package/types/utxo.d.ts +11 -0
- package/types/utxo.js +2 -0
- package/types/utxo.mjs +1 -0
- package/{useBalances-C_69CFoa.mjs → useBalances-Bom1mw1J.mjs} +101 -23
- package/{useBalances-C4YhEYxy.js → useBalances-gZTsFZHe.js} +102 -24
- package/index-BIVnypNe.mjs +0 -108
- package/index-Ben8n3bd.js +0 -58656
- package/index-CnKr4rL1.mjs +0 -91
- package/index-CnuruJNu.js +0 -329
- package/index-DsBh-EBw.js +0 -108
- package/index-iN9APQ6x.mjs +0 -58735
- package/modules/fiat/components/FiatForm/FiatForm.d.ts +0 -9
- package/modules/fiat/components/FiatForm/FiatForm.js +0 -314
- package/modules/fiat/components/FiatForm/FiatForm.mjs +0 -313
- package/modules/fiat/components/FiatForm/components/AmountInput/AmountInput.d.ts +0 -13
- package/modules/fiat/components/FiatForm/components/AmountInput/AmountInput.js +0 -117
- package/modules/fiat/components/FiatForm/components/AmountInput/AmountInput.mjs +0 -116
- package/modules/fiat/components/FiatForm/components/AmountInput/index.d.ts +0 -1
- package/modules/fiat/components/FiatForm/components/AmountInput/index.js +0 -5
- package/modules/fiat/components/FiatForm/components/AmountInput/index.mjs +0 -4
- package/modules/fiat/components/FiatForm/components/RateReloading/RateReloading.d.ts +0 -7
- package/modules/fiat/components/FiatForm/components/RateReloading/RateReloading.js +0 -74
- package/modules/fiat/components/FiatForm/components/RateReloading/RateReloading.mjs +0 -73
- package/modules/fiat/components/FiatForm/components/TokenSelector/TokenSelector.d.ts +0 -14
- package/modules/fiat/components/FiatForm/components/TokenSelector/TokenSelector.js +0 -94
- package/modules/fiat/components/FiatForm/components/TokenSelector/TokenSelector.mjs +0 -93
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectContainer.d.ts +0 -7
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectContainer.js +0 -82
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectContainer.mjs +0 -81
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectContent.d.ts +0 -7
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectContent.js +0 -91
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectContent.mjs +0 -90
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectedOption.d.ts +0 -5
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectedOption.js +0 -30
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectedOption.mjs +0 -29
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenIcon.d.ts +0 -8
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenIcon.js +0 -103
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenIcon.mjs +0 -102
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenItem.d.ts +0 -7
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenItem.js +0 -33
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenItem.mjs +0 -32
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenList.d.ts +0 -7
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenList.js +0 -21
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenList.mjs +0 -20
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenSymbol.d.ts +0 -9
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenSymbol.js +0 -26
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenSymbol.mjs +0 -25
- package/modules/fiat/components/FiatForm/components/TokenSelector/index.d.ts +0 -1
- package/modules/fiat/components/FiatForm/components/TokenSelector/index.js +0 -5
- package/modules/fiat/components/FiatForm/components/TokenSelector/index.mjs +0 -4
- package/modules/fiat/components/FiatForm/index.d.ts +0 -1
- package/modules/fiat/components/FiatForm/index.js +0 -5
- package/modules/fiat/components/FiatForm/index.mjs +0 -4
- package/modules/fiat/components/index.d.ts +0 -1
- package/modules/fiat/components/index.js +0 -5
- package/modules/fiat/components/index.mjs +0 -4
- package/modules/fiat/context/FiatProvider.d.ts +0 -8
- package/modules/fiat/context/FiatProvider.js +0 -24
- package/modules/fiat/context/FiatProvider.mjs +0 -23
- package/modules/fiat/context/queryClient.d.ts +0 -3
- package/modules/fiat/context/queryClient.js +0 -12
- package/modules/fiat/context/queryClient.mjs +0 -11
- package/modules/fiat/context/useFiat.d.ts +0 -1
- package/modules/fiat/context/useFiat.js +0 -13
- package/modules/fiat/context/useFiat.mjs +0 -12
- package/modules/fiat/hooks/index.d.ts +0 -2
- package/modules/fiat/hooks/index.js +0 -7
- package/modules/fiat/hooks/index.mjs +0 -6
- package/modules/fiat/hooks/useFiatData.d.ts +0 -7
- package/modules/fiat/hooks/useFiatData.js +0 -75
- package/modules/fiat/hooks/useFiatData.mjs +0 -74
- package/modules/fiat/hooks/validation/index.d.ts +0 -1
- package/modules/fiat/hooks/validation/index.js +0 -5
- package/modules/fiat/hooks/validation/index.mjs +0 -4
- package/modules/fiat/hooks/validation/useAmountSchema.d.ts +0 -2
- package/modules/fiat/hooks/validation/useAmountSchema.js +0 -27
- package/modules/fiat/hooks/validation/useAmountSchema.mjs +0 -9
- package/modules/fiat/index.d.ts +0 -8
- package/modules/fiat/index.js +0 -22
- package/modules/fiat/index.mjs +0 -21
- package/modules/fiat/init/index.d.ts +0 -2
- package/modules/fiat/init/index.js +0 -5
- package/modules/fiat/init/index.mjs +0 -4
- package/modules/fiat/init/init.d.ts +0 -22
- package/modules/fiat/init/init.js +0 -15
- package/modules/fiat/init/init.mjs +0 -14
- package/modules/fiat/queries/index.d.ts +0 -2
- package/modules/fiat/queries/index.js +0 -7
- package/modules/fiat/queries/index.mjs +0 -6
- package/modules/fiat/queries/useGetRate.mutation.d.ts +0 -6
- package/modules/fiat/queries/useGetRate.mutation.js +0 -20
- package/modules/fiat/queries/useGetRate.mutation.mjs +0 -19
- package/modules/fiat/queries/useGetTokens.query.d.ts +0 -5
- package/modules/fiat/queries/useGetTokens.query.js +0 -33
- package/modules/fiat/queries/useGetTokens.query.mjs +0 -32
- package/react-47kZTyAT.mjs +0 -51
- package/react-B_iI3-1z.mjs +0 -3133
- package/react-BomcNL1v.js +0 -254
- package/react-CqKlu0W0.js +0 -51
- package/react-R_xxu7fN.js +0 -3133
- package/react-cXurUY4Z.mjs +0 -254
- package/reactjs/queries/useGetTokens.query.d.ts +0 -3
- package/reactjs/queries/useGetTokens.query.js +0 -34
- package/reactjs/queries/useGetTokens.query.mjs +0 -33
- package/w3m-modal-Bhg44d6I.js +0 -356
- package/w3m-modal-Br2Ec3MM.mjs +0 -356
|
@@ -1,69 +1,95 @@
|
|
|
1
|
+
import { ServerTransactionInstruction } from '../../types';
|
|
2
|
+
import { Provider } from '@reown/appkit-adapter-solana/react';
|
|
3
|
+
import { BitcoinConnector } from '@reown/appkit-adapter-bitcoin';
|
|
4
|
+
|
|
1
5
|
export declare const useSignTransaction: () => {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
6
|
+
evm: {
|
|
7
|
+
error: null;
|
|
8
|
+
status: "idle";
|
|
9
|
+
reset: () => void;
|
|
10
|
+
context: unknown;
|
|
11
|
+
variables: undefined;
|
|
12
|
+
isError: false;
|
|
13
|
+
isIdle: true;
|
|
14
|
+
isPending: false;
|
|
15
|
+
isSuccess: false;
|
|
16
|
+
failureCount: number;
|
|
17
|
+
failureReason: import('@wagmi/core').SendTransactionErrorType | null;
|
|
18
|
+
isPaused: boolean;
|
|
19
|
+
submittedAt: number;
|
|
20
|
+
sendTransaction: import('wagmi/query').SendTransactionMutate<import('wagmi').Config, unknown>;
|
|
21
|
+
hash: `0x${string}` | undefined;
|
|
22
|
+
signTransaction: import('wagmi/query').SendTransactionMutateAsync<import('wagmi').Config, unknown>;
|
|
23
|
+
} | {
|
|
24
|
+
error: null;
|
|
25
|
+
status: "pending";
|
|
26
|
+
reset: () => void;
|
|
27
|
+
context: unknown;
|
|
28
|
+
variables: import('wagmi/query').SendTransactionVariables<import('wagmi').Config, number>;
|
|
29
|
+
isError: false;
|
|
30
|
+
isIdle: false;
|
|
31
|
+
isPending: true;
|
|
32
|
+
isSuccess: false;
|
|
33
|
+
failureCount: number;
|
|
34
|
+
failureReason: import('@wagmi/core').SendTransactionErrorType | null;
|
|
35
|
+
isPaused: boolean;
|
|
36
|
+
submittedAt: number;
|
|
37
|
+
sendTransaction: import('wagmi/query').SendTransactionMutate<import('wagmi').Config, unknown>;
|
|
38
|
+
hash: `0x${string}` | undefined;
|
|
39
|
+
signTransaction: import('wagmi/query').SendTransactionMutateAsync<import('wagmi').Config, unknown>;
|
|
40
|
+
} | {
|
|
41
|
+
error: import('@wagmi/core').SendTransactionErrorType;
|
|
42
|
+
status: "error";
|
|
43
|
+
reset: () => void;
|
|
44
|
+
context: unknown;
|
|
45
|
+
variables: import('wagmi/query').SendTransactionVariables<import('wagmi').Config, number>;
|
|
46
|
+
isError: true;
|
|
47
|
+
isIdle: false;
|
|
48
|
+
isPending: false;
|
|
49
|
+
isSuccess: false;
|
|
50
|
+
failureCount: number;
|
|
51
|
+
failureReason: import('@wagmi/core').SendTransactionErrorType | null;
|
|
52
|
+
isPaused: boolean;
|
|
53
|
+
submittedAt: number;
|
|
54
|
+
sendTransaction: import('wagmi/query').SendTransactionMutate<import('wagmi').Config, unknown>;
|
|
55
|
+
hash: `0x${string}` | undefined;
|
|
56
|
+
signTransaction: import('wagmi/query').SendTransactionMutateAsync<import('wagmi').Config, unknown>;
|
|
57
|
+
} | {
|
|
58
|
+
error: null;
|
|
59
|
+
status: "success";
|
|
60
|
+
reset: () => void;
|
|
61
|
+
context: unknown;
|
|
62
|
+
variables: import('wagmi/query').SendTransactionVariables<import('wagmi').Config, number>;
|
|
63
|
+
isError: false;
|
|
64
|
+
isIdle: false;
|
|
65
|
+
isPending: false;
|
|
66
|
+
isSuccess: true;
|
|
67
|
+
failureCount: number;
|
|
68
|
+
failureReason: import('@wagmi/core').SendTransactionErrorType | null;
|
|
69
|
+
isPaused: boolean;
|
|
70
|
+
submittedAt: number;
|
|
71
|
+
sendTransaction: import('wagmi/query').SendTransactionMutate<import('wagmi').Config, unknown>;
|
|
72
|
+
hash: `0x${string}` | undefined;
|
|
73
|
+
signTransaction: import('wagmi/query').SendTransactionMutateAsync<import('wagmi').Config, unknown>;
|
|
74
|
+
};
|
|
75
|
+
solana: {
|
|
76
|
+
signTransaction: ({ feePayer, instructions }: {
|
|
77
|
+
feePayer: string;
|
|
78
|
+
instructions: ServerTransactionInstruction[];
|
|
79
|
+
}) => Promise<string | undefined>;
|
|
80
|
+
connection: import('@solana/web3.js').Connection | undefined;
|
|
81
|
+
walletProvider: Provider;
|
|
82
|
+
};
|
|
83
|
+
bitcoin: {
|
|
84
|
+
signTransaction: (params: {
|
|
85
|
+
psbt: string;
|
|
86
|
+
signInputs: {
|
|
87
|
+
address: string;
|
|
88
|
+
index: number;
|
|
89
|
+
sighashTypes: number[];
|
|
90
|
+
}[];
|
|
91
|
+
broadcast: boolean;
|
|
92
|
+
}) => Promise<string>;
|
|
93
|
+
walletProvider: BitcoinConnector;
|
|
94
|
+
};
|
|
69
95
|
};
|
|
@@ -1,17 +1,66 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const react$1 = require("@reown/appkit/react");
|
|
5
|
+
const react = require("@reown/appkit-adapter-solana/react");
|
|
6
|
+
const web3_js = require("@solana/web3.js");
|
|
4
7
|
const wagmi = require("wagmi");
|
|
5
8
|
const useSignTransaction = () => {
|
|
6
9
|
const {
|
|
7
10
|
data: hash,
|
|
8
|
-
sendTransactionAsync:
|
|
11
|
+
sendTransactionAsync: signEvmTransaction,
|
|
9
12
|
...rest
|
|
10
13
|
} = wagmi.useSendTransaction();
|
|
14
|
+
const { connection } = react.useAppKitConnection();
|
|
15
|
+
const { walletProvider: solWalletProvider } = react$1.useAppKitProvider("solana");
|
|
16
|
+
const { walletProvider: btcWalletProvider } = react$1.useAppKitProvider("bip122");
|
|
17
|
+
const signTransactionSolanaTransaction = async ({
|
|
18
|
+
feePayer,
|
|
19
|
+
instructions
|
|
20
|
+
}) => {
|
|
21
|
+
for (const instruction of instructions) {
|
|
22
|
+
const instructionData = Buffer.from(instruction.data);
|
|
23
|
+
const sender = new web3_js.PublicKey(instruction.keys[0].pubkey);
|
|
24
|
+
const receiver = new web3_js.PublicKey(instruction.keys[1].pubkey);
|
|
25
|
+
const transactionInstruction = new web3_js.TransactionInstruction({
|
|
26
|
+
keys: [
|
|
27
|
+
{ pubkey: sender, isSigner: true, isWritable: true },
|
|
28
|
+
{ pubkey: receiver, isSigner: false, isWritable: true }
|
|
29
|
+
],
|
|
30
|
+
programId: new web3_js.PublicKey(instruction.programId),
|
|
31
|
+
data: instructionData
|
|
32
|
+
});
|
|
33
|
+
const transaction = new web3_js.Transaction().add(transactionInstruction);
|
|
34
|
+
transaction.feePayer = new web3_js.PublicKey(feePayer);
|
|
35
|
+
if (connection) {
|
|
36
|
+
transaction.recentBlockhash = (await connection.getLatestBlockhash("confirmed")).blockhash;
|
|
37
|
+
}
|
|
38
|
+
return await solWalletProvider.signAndSendTransaction(transaction);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
const signPSBT = async (params) => {
|
|
42
|
+
if (!btcWalletProvider) {
|
|
43
|
+
throw Error("user is disconnected");
|
|
44
|
+
}
|
|
45
|
+
params.signInputs = [];
|
|
46
|
+
const signature = await btcWalletProvider.signPSBT(params);
|
|
47
|
+
return signature.psbt;
|
|
48
|
+
};
|
|
11
49
|
return {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
50
|
+
evm: {
|
|
51
|
+
hash,
|
|
52
|
+
signTransaction: signEvmTransaction,
|
|
53
|
+
...rest
|
|
54
|
+
},
|
|
55
|
+
solana: {
|
|
56
|
+
signTransaction: signTransactionSolanaTransaction,
|
|
57
|
+
connection,
|
|
58
|
+
walletProvider: solWalletProvider
|
|
59
|
+
},
|
|
60
|
+
bitcoin: {
|
|
61
|
+
signTransaction: signPSBT,
|
|
62
|
+
walletProvider: btcWalletProvider
|
|
63
|
+
}
|
|
15
64
|
};
|
|
16
65
|
};
|
|
17
66
|
exports.useSignTransaction = useSignTransaction;
|
|
@@ -1,14 +1,63 @@
|
|
|
1
|
+
import { useAppKitProvider } from "@reown/appkit/react";
|
|
2
|
+
import { useAppKitConnection } from "@reown/appkit-adapter-solana/react";
|
|
3
|
+
import { PublicKey, TransactionInstruction, Transaction } from "@solana/web3.js";
|
|
1
4
|
import { useSendTransaction } from "wagmi";
|
|
2
5
|
const useSignTransaction = () => {
|
|
3
6
|
const {
|
|
4
7
|
data: hash,
|
|
5
|
-
sendTransactionAsync:
|
|
8
|
+
sendTransactionAsync: signEvmTransaction,
|
|
6
9
|
...rest
|
|
7
10
|
} = useSendTransaction();
|
|
11
|
+
const { connection } = useAppKitConnection();
|
|
12
|
+
const { walletProvider: solWalletProvider } = useAppKitProvider("solana");
|
|
13
|
+
const { walletProvider: btcWalletProvider } = useAppKitProvider("bip122");
|
|
14
|
+
const signTransactionSolanaTransaction = async ({
|
|
15
|
+
feePayer,
|
|
16
|
+
instructions
|
|
17
|
+
}) => {
|
|
18
|
+
for (const instruction of instructions) {
|
|
19
|
+
const instructionData = Buffer.from(instruction.data);
|
|
20
|
+
const sender = new PublicKey(instruction.keys[0].pubkey);
|
|
21
|
+
const receiver = new PublicKey(instruction.keys[1].pubkey);
|
|
22
|
+
const transactionInstruction = new TransactionInstruction({
|
|
23
|
+
keys: [
|
|
24
|
+
{ pubkey: sender, isSigner: true, isWritable: true },
|
|
25
|
+
{ pubkey: receiver, isSigner: false, isWritable: true }
|
|
26
|
+
],
|
|
27
|
+
programId: new PublicKey(instruction.programId),
|
|
28
|
+
data: instructionData
|
|
29
|
+
});
|
|
30
|
+
const transaction = new Transaction().add(transactionInstruction);
|
|
31
|
+
transaction.feePayer = new PublicKey(feePayer);
|
|
32
|
+
if (connection) {
|
|
33
|
+
transaction.recentBlockhash = (await connection.getLatestBlockhash("confirmed")).blockhash;
|
|
34
|
+
}
|
|
35
|
+
return await solWalletProvider.signAndSendTransaction(transaction);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
const signPSBT = async (params) => {
|
|
39
|
+
if (!btcWalletProvider) {
|
|
40
|
+
throw Error("user is disconnected");
|
|
41
|
+
}
|
|
42
|
+
params.signInputs = [];
|
|
43
|
+
const signature = await btcWalletProvider.signPSBT(params);
|
|
44
|
+
return signature.psbt;
|
|
45
|
+
};
|
|
8
46
|
return {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
47
|
+
evm: {
|
|
48
|
+
hash,
|
|
49
|
+
signTransaction: signEvmTransaction,
|
|
50
|
+
...rest
|
|
51
|
+
},
|
|
52
|
+
solana: {
|
|
53
|
+
signTransaction: signTransactionSolanaTransaction,
|
|
54
|
+
connection,
|
|
55
|
+
walletProvider: solWalletProvider
|
|
56
|
+
},
|
|
57
|
+
bitcoin: {
|
|
58
|
+
signTransaction: signPSBT,
|
|
59
|
+
walletProvider: btcWalletProvider
|
|
60
|
+
}
|
|
12
61
|
};
|
|
13
62
|
};
|
|
14
63
|
export {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const
|
|
4
|
+
const React = require("react");
|
|
5
5
|
const reactjs_utils_hasEnoughFunds = require("../../utils/hasEnoughFunds.js");
|
|
6
6
|
const reactjs_utils_testNumber = require("../../utils/testNumber.js");
|
|
7
7
|
const useTestHasEnoughFunds = () => {
|
|
8
|
-
const shouldThrow =
|
|
8
|
+
const shouldThrow = React.useCallback(
|
|
9
9
|
(value, context) => {
|
|
10
10
|
if (!reactjs_utils_testNumber.testNumber(value)) {
|
|
11
11
|
return false;
|
|
@@ -22,7 +22,7 @@ const useTestHasEnoughFunds = () => {
|
|
|
22
22
|
},
|
|
23
23
|
[]
|
|
24
24
|
);
|
|
25
|
-
return
|
|
25
|
+
return React.useCallback(
|
|
26
26
|
(value, context) => {
|
|
27
27
|
if (!shouldThrow(value, context)) {
|
|
28
28
|
return true;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const
|
|
4
|
+
const React = require("react");
|
|
5
5
|
const reactjs_hooks_useAccount = require("../useAccount.js");
|
|
6
6
|
const useTestIsConnected = () => {
|
|
7
7
|
const { address } = reactjs_hooks_useAccount.useAccount();
|
|
8
|
-
return
|
|
8
|
+
return React.useCallback(
|
|
9
9
|
(_value, context) => {
|
|
10
10
|
if (Boolean(address)) {
|
|
11
11
|
return true;
|
package/reactjs/index.js
CHANGED
|
@@ -26,6 +26,7 @@ const reactjs_components_TokenSelector_TokenSelector = require("./components/Tok
|
|
|
26
26
|
const reactjs_components_TransactionToast_TransactionToastContainer = require("./components/TransactionToast/TransactionToastContainer.js");
|
|
27
27
|
const reactjs_components_TransactionToast_TransactionToast = require("./components/TransactionToast/TransactionToast.js");
|
|
28
28
|
const reactjs_components_TrimAddress_TrimAddress = require("./components/TrimAddress/TrimAddress.js");
|
|
29
|
+
const reactjs_components_Error_Error = require("./components/Error/Error.js");
|
|
29
30
|
const reactjs_constants_index = require("./constants/index.js");
|
|
30
31
|
const reactjs_context_Web3AppProvider = require("./context/Web3AppProvider.js");
|
|
31
32
|
const reactjs_context_useWeb3App = require("./context/useWeb3App.js");
|
|
@@ -35,7 +36,7 @@ const reactjs_hooks_validation_useSecondAmountSchema = require("./hooks/validati
|
|
|
35
36
|
const reactjs_hooks_validation_useTestHasEnoughFunds = require("./hooks/validation/useTestHasEnoughFunds.js");
|
|
36
37
|
const reactjs_hooks_validation_useTestIsConnected = require("./hooks/validation/useTestIsConnected.js");
|
|
37
38
|
const reactjs_hooks_useAccount = require("./hooks/useAccount.js");
|
|
38
|
-
const reactjs_hooks_useBalances = require("../useBalances-
|
|
39
|
+
const reactjs_hooks_useBalances = require("../useBalances-gZTsFZHe.js");
|
|
39
40
|
const reactjs_hooks_useBridgeFormik = require("./hooks/useBridgeFormik.js");
|
|
40
41
|
const reactjs_hooks_useDebounce = require("./hooks/useDebounce.js");
|
|
41
42
|
const reactjs_hooks_useFetchBridgeData = require("./hooks/useFetchBridgeData.js");
|
|
@@ -51,7 +52,6 @@ const reactjs_queries_useGetEvmTokensBalances_query = require("./queries/useGetE
|
|
|
51
52
|
const reactjs_queries_useGetHistory_query = require("./queries/useGetHistory.query.js");
|
|
52
53
|
const reactjs_queries_useGetMvxTokensBalances_query = require("./queries/useGetMvxTokensBalances.query.js");
|
|
53
54
|
const reactjs_queries_useGetRate_mutation = require("./queries/useGetRate.mutation.js");
|
|
54
|
-
const reactjs_queries_useGetTokens_query = require("./queries/useGetTokens.query.js");
|
|
55
55
|
const reactjs_utils_delay = require("./utils/delay.js");
|
|
56
56
|
const reactjs_utils_formatAmount = require("./utils/formatAmount.js");
|
|
57
57
|
const reactjs_utils_getCleanStringAmount = require("./utils/getCleanStringAmount.js");
|
|
@@ -64,11 +64,9 @@ const reactjs_utils_pipe = require("./utils/pipe.js");
|
|
|
64
64
|
const reactjs_utils_removeCommas = require("./utils/removeCommas.js");
|
|
65
65
|
const reactjs_utils_roundAmount = require("./utils/roundAmount.js");
|
|
66
66
|
const reactjs_utils_testNumber = require("./utils/testNumber.js");
|
|
67
|
-
const react
|
|
67
|
+
const react = require("@reown/appkit/react");
|
|
68
68
|
const wagmi = require("wagmi");
|
|
69
69
|
const reactjs_constants_chains = require("./constants/chains.js");
|
|
70
|
-
const index = require("../index-DsBh-EBw.js");
|
|
71
|
-
const react = require("../react-CqKlu0W0.js");
|
|
72
70
|
exports.AccountAddress = reactjs_components_AccountAddress_AccountAddress.AccountAddress;
|
|
73
71
|
exports.AmountCard = reactjs_components_AmountCard_AmountCard.AmountCard;
|
|
74
72
|
exports.AmountInput = reactjs_components_AmountInput_AmountInput.AmountInput;
|
|
@@ -93,6 +91,7 @@ exports.TokenSelector = reactjs_components_TokenSelector_TokenSelector.TokenSele
|
|
|
93
91
|
exports.TransactionToastContainer = reactjs_components_TransactionToast_TransactionToastContainer.TransactionToastContainer;
|
|
94
92
|
exports.TransactionToast = reactjs_components_TransactionToast_TransactionToast.TransactionToast;
|
|
95
93
|
exports.TrimAddress = reactjs_components_TrimAddress_TrimAddress.TrimAddress;
|
|
94
|
+
exports.Error = reactjs_components_Error_Error.Error;
|
|
96
95
|
exports.safeDocument = reactjs_constants_index.safeDocument;
|
|
97
96
|
exports.safeWindow = reactjs_constants_index.safeWindow;
|
|
98
97
|
exports.Web3AppContext = reactjs_context_Web3AppProvider.Web3AppContext;
|
|
@@ -124,7 +123,6 @@ exports.useGetHistoryQuery = reactjs_queries_useGetHistory_query.useGetHistoryQu
|
|
|
124
123
|
exports.invalidateMvxTokensBalancesQuery = reactjs_queries_useGetMvxTokensBalances_query.invalidateMvxTokensBalancesQuery;
|
|
125
124
|
exports.useGetMvxTokensBalancesQuery = reactjs_queries_useGetMvxTokensBalances_query.useGetMvxTokensBalancesQuery;
|
|
126
125
|
exports.useGetRateMutation = reactjs_queries_useGetRate_mutation.useGetRateMutation;
|
|
127
|
-
exports.useGetTokensQuery = reactjs_queries_useGetTokens_query.useGetTokensQuery;
|
|
128
126
|
exports.delay = reactjs_utils_delay.delay;
|
|
129
127
|
exports.formatAmount = reactjs_utils_formatAmount.formatAmount;
|
|
130
128
|
exports.getCleanStringAmount = reactjs_utils_getCleanStringAmount.getCleanStringAmount;
|
|
@@ -137,19 +135,49 @@ exports.pipe = reactjs_utils_pipe.pipe;
|
|
|
137
135
|
exports.removeCommas = reactjs_utils_removeCommas.removeCommas;
|
|
138
136
|
exports.roundAmount = reactjs_utils_roundAmount.roundAmount;
|
|
139
137
|
exports.testNumber = reactjs_utils_testNumber.testNumber;
|
|
140
|
-
exports
|
|
138
|
+
Object.defineProperty(exports, "useAppKit", {
|
|
139
|
+
enumerable: true,
|
|
140
|
+
get: () => react.useAppKit
|
|
141
|
+
});
|
|
142
|
+
Object.defineProperty(exports, "useAppKitAccount", {
|
|
143
|
+
enumerable: true,
|
|
144
|
+
get: () => react.useAppKitAccount
|
|
145
|
+
});
|
|
146
|
+
Object.defineProperty(exports, "useAppKitEvents", {
|
|
147
|
+
enumerable: true,
|
|
148
|
+
get: () => react.useAppKitEvents
|
|
149
|
+
});
|
|
150
|
+
Object.defineProperty(exports, "useAppKitNetwork", {
|
|
151
|
+
enumerable: true,
|
|
152
|
+
get: () => react.useAppKitNetwork
|
|
153
|
+
});
|
|
154
|
+
Object.defineProperty(exports, "useAppKitNetworkCore", {
|
|
155
|
+
enumerable: true,
|
|
156
|
+
get: () => react.useAppKitNetworkCore
|
|
157
|
+
});
|
|
158
|
+
Object.defineProperty(exports, "useAppKitProvider", {
|
|
159
|
+
enumerable: true,
|
|
160
|
+
get: () => react.useAppKitProvider
|
|
161
|
+
});
|
|
162
|
+
Object.defineProperty(exports, "useAppKitState", {
|
|
163
|
+
enumerable: true,
|
|
164
|
+
get: () => react.useAppKitState
|
|
165
|
+
});
|
|
166
|
+
Object.defineProperty(exports, "useAppKitTheme", {
|
|
167
|
+
enumerable: true,
|
|
168
|
+
get: () => react.useAppKitTheme
|
|
169
|
+
});
|
|
170
|
+
Object.defineProperty(exports, "useDisconnect", {
|
|
171
|
+
enumerable: true,
|
|
172
|
+
get: () => react.useDisconnect
|
|
173
|
+
});
|
|
174
|
+
Object.defineProperty(exports, "useWalletInfo", {
|
|
175
|
+
enumerable: true,
|
|
176
|
+
get: () => react.useWalletInfo
|
|
177
|
+
});
|
|
141
178
|
Object.defineProperty(exports, "useWaitForTransactionReceipt", {
|
|
142
179
|
enumerable: true,
|
|
143
180
|
get: () => wagmi.useWaitForTransactionReceipt
|
|
144
181
|
});
|
|
145
182
|
exports.ALL_NETWORK_ID = reactjs_constants_chains.ALL_NETWORK_ID;
|
|
146
183
|
exports.chainIdentifier = reactjs_constants_chains.chainIdentifier;
|
|
147
|
-
exports.useAppKit = index.useAppKit;
|
|
148
|
-
exports.useAppKitEvents = index.useAppKitEvents;
|
|
149
|
-
exports.useAppKitProvider = index.useAppKitProvider;
|
|
150
|
-
exports.useAppKitState = index.useAppKitState;
|
|
151
|
-
exports.useAppKitTheme = index.useAppKitTheme;
|
|
152
|
-
exports.useWalletInfo = index.useWalletInfo;
|
|
153
|
-
exports.useAppKitAccount = react.useAppKitAccount;
|
|
154
|
-
exports.useAppKitNetworkCore = react.useAppKitNetworkCore;
|
|
155
|
-
exports.useDisconnect = react.useDisconnect;
|
package/reactjs/index.mjs
CHANGED
|
@@ -23,6 +23,7 @@ import { TokenSelector } from "./components/TokenSelector/TokenSelector.mjs";
|
|
|
23
23
|
import { TransactionToastContainer } from "./components/TransactionToast/TransactionToastContainer.mjs";
|
|
24
24
|
import { TransactionToast } from "./components/TransactionToast/TransactionToast.mjs";
|
|
25
25
|
import { TrimAddress } from "./components/TrimAddress/TrimAddress.mjs";
|
|
26
|
+
import { Error } from "./components/Error/Error.mjs";
|
|
26
27
|
import { safeDocument, safeWindow } from "./constants/index.mjs";
|
|
27
28
|
import { Web3AppContext, Web3AppProvider } from "./context/Web3AppProvider.mjs";
|
|
28
29
|
import { useWeb3App } from "./context/useWeb3App.mjs";
|
|
@@ -32,7 +33,7 @@ import { useSecondAmountSchema } from "./hooks/validation/useSecondAmountSchema.
|
|
|
32
33
|
import { useTestHasEnoughFunds } from "./hooks/validation/useTestHasEnoughFunds.mjs";
|
|
33
34
|
import { useTestIsConnected } from "./hooks/validation/useTestIsConnected.mjs";
|
|
34
35
|
import { useAccount } from "./hooks/useAccount.mjs";
|
|
35
|
-
import { u } from "../useBalances-
|
|
36
|
+
import { u } from "../useBalances-Bom1mw1J.mjs";
|
|
36
37
|
import { BridgeFormikValuesEnum, useBridgeFormik } from "./hooks/useBridgeFormik.mjs";
|
|
37
38
|
import { useDebounce } from "./hooks/useDebounce.mjs";
|
|
38
39
|
import { useFetchBridgeData } from "./hooks/useFetchBridgeData.mjs";
|
|
@@ -48,7 +49,6 @@ import { invalidateEvmTokensBalances, useGetEvmTokensBalancesQuery } from "./que
|
|
|
48
49
|
import { invalidateHistoryQuery, useGetHistoryQuery } from "./queries/useGetHistory.query.mjs";
|
|
49
50
|
import { invalidateMvxTokensBalancesQuery, useGetMvxTokensBalancesQuery } from "./queries/useGetMvxTokensBalances.query.mjs";
|
|
50
51
|
import { useGetRateMutation } from "./queries/useGetRate.mutation.mjs";
|
|
51
|
-
import { useGetTokensQuery } from "./queries/useGetTokens.query.mjs";
|
|
52
52
|
import { delay } from "./utils/delay.mjs";
|
|
53
53
|
import { formatAmount } from "./utils/formatAmount.mjs";
|
|
54
54
|
import { getCleanStringAmount } from "./utils/getCleanStringAmount.mjs";
|
|
@@ -61,11 +61,9 @@ import { pipe } from "./utils/pipe.mjs";
|
|
|
61
61
|
import { removeCommas } from "./utils/removeCommas.mjs";
|
|
62
62
|
import { roundAmount } from "./utils/roundAmount.mjs";
|
|
63
63
|
import { testNumber } from "./utils/testNumber.mjs";
|
|
64
|
-
import {
|
|
64
|
+
import { useAppKit, useAppKitAccount, useAppKitEvents, useAppKitNetwork, useAppKitNetworkCore, useAppKitProvider, useAppKitState, useAppKitTheme, useDisconnect, useWalletInfo } from "@reown/appkit/react";
|
|
65
65
|
import { useWaitForTransactionReceipt } from "wagmi";
|
|
66
66
|
import { ALL_NETWORK_ID, chainIdentifier } from "./constants/chains.mjs";
|
|
67
|
-
import { u as u3, a, e, b, c, d } from "../index-BIVnypNe.mjs";
|
|
68
|
-
import { u as u4, b as b2, a as a2 } from "../react-47kZTyAT.mjs";
|
|
69
67
|
export {
|
|
70
68
|
ALL_NETWORK_ID,
|
|
71
69
|
AccountAddress,
|
|
@@ -79,6 +77,7 @@ export {
|
|
|
79
77
|
CopyButton,
|
|
80
78
|
CustomConnectButton,
|
|
81
79
|
DisplayAmount,
|
|
80
|
+
Error,
|
|
82
81
|
MvxAccountDisplay,
|
|
83
82
|
MvxConnectButton,
|
|
84
83
|
MxButton,
|
|
@@ -117,18 +116,18 @@ export {
|
|
|
117
116
|
testNumber,
|
|
118
117
|
useAccount,
|
|
119
118
|
useAmountSchema,
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
119
|
+
useAppKit,
|
|
120
|
+
useAppKitAccount,
|
|
121
|
+
useAppKitEvents,
|
|
122
|
+
useAppKitNetwork,
|
|
123
|
+
useAppKitNetworkCore,
|
|
124
|
+
useAppKitProvider,
|
|
125
|
+
useAppKitState,
|
|
126
|
+
useAppKitTheme,
|
|
128
127
|
u as useBalances,
|
|
129
128
|
useBridgeFormik,
|
|
130
129
|
useDebounce,
|
|
131
|
-
|
|
130
|
+
useDisconnect,
|
|
132
131
|
useFetchBridgeData,
|
|
133
132
|
useFetchTokens,
|
|
134
133
|
useGetAllTokensQuery,
|
|
@@ -138,7 +137,6 @@ export {
|
|
|
138
137
|
useGetHistoryQuery,
|
|
139
138
|
useGetMvxTokensBalancesQuery,
|
|
140
139
|
useGetRateMutation,
|
|
141
|
-
useGetTokensQuery,
|
|
142
140
|
useResolveTokenChain,
|
|
143
141
|
useSecondAmountSchema,
|
|
144
142
|
useSendTransactions,
|
|
@@ -146,6 +144,6 @@ export {
|
|
|
146
144
|
useTestHasEnoughFunds,
|
|
147
145
|
useTestIsConnected,
|
|
148
146
|
useWaitForTransactionReceipt,
|
|
149
|
-
|
|
147
|
+
useWalletInfo,
|
|
150
148
|
useWeb3App
|
|
151
149
|
};
|