@velora-dex/widget 0.4.5 → 0.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/Updaters.d.ts.map +1 -1
- package/dist/core/Updaters.js +2 -0
- package/dist/core/Updaters.js.map +1 -1
- package/dist/hooks/permit/hooks/common/useWalletSupportsPermit.d.ts.map +1 -1
- package/dist/hooks/permit/hooks/common/useWalletSupportsPermit.js +28 -12
- package/dist/hooks/permit/hooks/common/useWalletSupportsPermit.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Updaters.d.ts","sourceRoot":"","sources":["../../src/core/Updaters.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Updaters.d.ts","sourceRoot":"","sources":["../../src/core/Updaters.tsx"],"names":[],"mappings":"AAqBA,eAAO,MAAM,QAAQ,YAwDpB,CAAC"}
|
package/dist/core/Updaters.js
CHANGED
|
@@ -18,6 +18,7 @@ import { useActivateConfigEffect } from './state/configEffectAtom.js';
|
|
|
18
18
|
import { useOnPriceUpdates } from '../events/hooks/useOnPriceUpdates.js';
|
|
19
19
|
import { useBridgeProtocolsQuery } from '../hooks/swap/prices/delta/queries/bridgeProtocols/useBridgeProtocols.js';
|
|
20
20
|
import { useCacheMinViemClient } from '../hooks/useMinViemClient.js';
|
|
21
|
+
import { useIsAccountContract } from '../hooks/getCode/useIsAccountContract.js';
|
|
21
22
|
|
|
22
23
|
const Updaters = () => {
|
|
23
24
|
const $ = distExports.c(2);
|
|
@@ -50,6 +51,7 @@ const Updaters = () => {
|
|
|
50
51
|
useTokenFromPermit1Nonce();
|
|
51
52
|
useTokenFromPermit2AllowanceQuery();
|
|
52
53
|
useTokenFromPermit2TransferFromNonce();
|
|
54
|
+
useIsAccountContract();
|
|
53
55
|
useSafeInfo();
|
|
54
56
|
useCanBatchTxs();
|
|
55
57
|
useOnWalletConnected();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Updaters.js","sources":["../../src/core/Updaters.tsx"],"sourcesContent":["import { useTokenFromPermit1Nonce } from \"@/hooks/permit/hooks/permit1/useTokenFromPermit1Nonce\";\nimport { useTokenFromPermit2TransferFromNonce } from \"@/hooks/permit/hooks/permit2/useTokenFromPermit2TransferFromNonce\";\nimport { useTokenFromPermit2AllowanceQuery } from \"@/hooks/permit/hooks/permit2/useTokenFromPermit2Allowance\";\nimport { useTokenFromPermitInfo } from \"@/hooks/permit/hooks/permit1/useTokenFromPermitInfo\";\nimport { useGetContracts } from \"@/hooks/sdk/useGetContracts\";\nimport { useGetBridgeInfo } from \"@/hooks/useBridgeInfo\";\nimport { useFetchTokenLists } from \"@/tokens/queries\";\nimport { usePrefetchTokenBalances } from \"@/hooks/tokens/useAllTokensWithFilter\";\nimport { useSafeInfo } from \"@/lib/web3/wagmi/isInsideSafeIframe\";\nimport { useCanBatchTxs } from \"@/hooks/batch/useCanBatchTxs\";\nimport { useOnWalletConnected } from \"@/events/hooks/useOnWalletConnect\";\nimport { useActivateEffects as useActivateEventEffects } from \"@/events/hooks/useActivateEffects\";\nimport { useActivateEffects as useActivateTransactionEffects } from \"@/transactions/state/hooks/useActivateEffects\";\nimport { useActivateEffects as useActivateTokenListEffects } from \"@/tokens/lists/state/effects\";\nimport { useActivateFormInputEffects } from \"./inputs/state/setTokenByAddressAtom\";\nimport { useActivateConfigEffect } from \"./state/configEffectAtom\";\nimport { useOnPriceUpdates } from \"@/events/hooks/useOnPriceUpdates\";\nimport { useBridgeProtocolsQuery } from \"@/hooks/swap/prices/delta/queries/bridgeProtocols/useBridgeProtocols\";\nimport { useCacheMinViemClient } from \"@/hooks/useMinViemClient\";\n\nexport const Updaters = () => {\n // fetch tokens from currently enabled lists\n useFetchTokenLists();\n // activate effects for token lists\n useActivateTokenListEffects();\n\n // all balances that would be fetched in TokenSelector for current chain\n usePrefetchTokenBalances();\n useGetBridgeInfo({ mode: \"swap\" }); // @TODO: prefetch instead\n useGetBridgeInfo({ mode: \"limit\" });\n useGetContracts(); // @TODO: prefetch instead\n useBridgeProtocolsQuery();\n\n // for each selected tokenFrom detect its supported Permit1\n useTokenFromPermitInfo();\n // for each selected tokenFrom keep track of Token.nonce if available on Token\n useTokenFromPermit1Nonce();\n // for each selected tokenFrom keep track of given allowance to Permit2 contract\n useTokenFromPermit2AllowanceQuery();\n // global Permit2 TransferFrom nonce, not token-specific but for chain=Token.network\n useTokenFromPermit2TransferFromNonce();\n\n // check ahead of opening ConnectWallets drawer to prevent Safe button appearing\n // if we are not in a non-Safe iframe\n useSafeInfo();\n\n // check if wallet can batch txs\n useCanBatchTxs();\n\n // events when wallet is connected\n useOnWalletConnected();\n\n // events when price state updates\n useOnPriceUpdates();\n\n // activate effects for state atoms\n useActivateEventEffects();\n\n // activate effects for transaction atoms\n useActivateTransactionEffects();\n\n // activate effects for form input atoms\n useActivateFormInputEffects();\n\n // activate widget config effects\n useActivateConfigEffect();\n\n // keep one subscriber to useConnectorClient query at all times\n // to avoid async client creation on useMinViemClient mount\n // and first minClient being undefined for a short time\n useCacheMinViemClient();\n\n return null;\n};\n"],"names":["Updaters","$","_c","useFetchTokenLists","useActivateTokenListEffects","usePrefetchTokenBalances","t0","Symbol","for","mode","useGetBridgeInfo","t1","useGetContracts","useBridgeProtocolsQuery","useTokenFromPermitInfo","useTokenFromPermit1Nonce","useTokenFromPermit2AllowanceQuery","useTokenFromPermit2TransferFromNonce","useSafeInfo","useCanBatchTxs","useOnWalletConnected","useOnPriceUpdates","useActivateEventEffects","useActivateTransactionEffects","useActivateFormInputEffects","useActivateConfigEffect","useCacheMinViemClient"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Updaters.js","sources":["../../src/core/Updaters.tsx"],"sourcesContent":["import { useTokenFromPermit1Nonce } from \"@/hooks/permit/hooks/permit1/useTokenFromPermit1Nonce\";\nimport { useTokenFromPermit2TransferFromNonce } from \"@/hooks/permit/hooks/permit2/useTokenFromPermit2TransferFromNonce\";\nimport { useTokenFromPermit2AllowanceQuery } from \"@/hooks/permit/hooks/permit2/useTokenFromPermit2Allowance\";\nimport { useTokenFromPermitInfo } from \"@/hooks/permit/hooks/permit1/useTokenFromPermitInfo\";\nimport { useGetContracts } from \"@/hooks/sdk/useGetContracts\";\nimport { useGetBridgeInfo } from \"@/hooks/useBridgeInfo\";\nimport { useFetchTokenLists } from \"@/tokens/queries\";\nimport { usePrefetchTokenBalances } from \"@/hooks/tokens/useAllTokensWithFilter\";\nimport { useSafeInfo } from \"@/lib/web3/wagmi/isInsideSafeIframe\";\nimport { useCanBatchTxs } from \"@/hooks/batch/useCanBatchTxs\";\nimport { useOnWalletConnected } from \"@/events/hooks/useOnWalletConnect\";\nimport { useActivateEffects as useActivateEventEffects } from \"@/events/hooks/useActivateEffects\";\nimport { useActivateEffects as useActivateTransactionEffects } from \"@/transactions/state/hooks/useActivateEffects\";\nimport { useActivateEffects as useActivateTokenListEffects } from \"@/tokens/lists/state/effects\";\nimport { useActivateFormInputEffects } from \"./inputs/state/setTokenByAddressAtom\";\nimport { useActivateConfigEffect } from \"./state/configEffectAtom\";\nimport { useOnPriceUpdates } from \"@/events/hooks/useOnPriceUpdates\";\nimport { useBridgeProtocolsQuery } from \"@/hooks/swap/prices/delta/queries/bridgeProtocols/useBridgeProtocols\";\nimport { useCacheMinViemClient } from \"@/hooks/useMinViemClient\";\nimport { useIsAccountContract } from \"@/hooks/getCode/useIsAccountContract\";\n\nexport const Updaters = () => {\n // fetch tokens from currently enabled lists\n useFetchTokenLists();\n // activate effects for token lists\n useActivateTokenListEffects();\n\n // all balances that would be fetched in TokenSelector for current chain\n usePrefetchTokenBalances();\n useGetBridgeInfo({ mode: \"swap\" }); // @TODO: prefetch instead\n useGetBridgeInfo({ mode: \"limit\" });\n useGetContracts(); // @TODO: prefetch instead\n useBridgeProtocolsQuery();\n\n // for each selected tokenFrom detect its supported Permit1\n useTokenFromPermitInfo();\n // for each selected tokenFrom keep track of Token.nonce if available on Token\n useTokenFromPermit1Nonce();\n // for each selected tokenFrom keep track of given allowance to Permit2 contract\n useTokenFromPermit2AllowanceQuery();\n // global Permit2 TransferFrom nonce, not token-specific but for chain=Token.network\n useTokenFromPermit2TransferFromNonce();\n\n // check if wallet is a contract on every network\n useIsAccountContract();\n\n // check ahead of opening ConnectWallets drawer to prevent Safe button appearing\n // if we are not in a non-Safe iframe\n useSafeInfo();\n\n // check if wallet can batch txs\n useCanBatchTxs();\n\n // events when wallet is connected\n useOnWalletConnected();\n\n // events when price state updates\n useOnPriceUpdates();\n\n // activate effects for state atoms\n useActivateEventEffects();\n\n // activate effects for transaction atoms\n useActivateTransactionEffects();\n\n // activate effects for form input atoms\n useActivateFormInputEffects();\n\n // activate widget config effects\n useActivateConfigEffect();\n\n // keep one subscriber to useConnectorClient query at all times\n // to avoid async client creation on useMinViemClient mount\n // and first minClient being undefined for a short time\n useCacheMinViemClient();\n\n return null;\n};\n"],"names":["Updaters","$","_c","useFetchTokenLists","useActivateTokenListEffects","usePrefetchTokenBalances","t0","Symbol","for","mode","useGetBridgeInfo","t1","useGetContracts","useBridgeProtocolsQuery","useTokenFromPermitInfo","useTokenFromPermit1Nonce","useTokenFromPermit2AllowanceQuery","useTokenFromPermit2TransferFromNonce","useIsAccountContract","useSafeInfo","useCanBatchTxs","useOnWalletConnected","useOnPriceUpdates","useActivateEventEffects","useActivateTransactionEffects","useActivateFormInputEffects","useActivateConfigEffect","useCacheMinViemClient"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAqBO,MAAMA,WAAWA,MAAA;AAAA,EAAA,MAAAC,CAAAA,GAAAC,cAAA,CAAA,CAAA;AAEtBC,EAAAA,kBAAAA,EAAmB;AAEnBC,EAAAA,kBAAAA,EAA4B;AAG5BC,EAAAA,wBAAAA,EAAyB;AAAC,EAAA,IAAAC,EAAAA;AAAA,EAAA,IAAAL,EAAA,CAAA,CAAA,KAAAM,MAAAA,CAAAC,GAAAA,CAAA,2BAAA,CAAA,EAAA;AACTF,IAA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"mappings":"AAEA,KAAK,6BAA6B,GAAG;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,wBAAgB,uBAAuB,IAAI,6BAA6B,
|
|
1
|
+
{"version":3,"file":"useWalletSupportsPermit.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/permit/hooks/common/useWalletSupportsPermit.ts"],"names":[],"mappings":"AAEA,KAAK,6BAA6B,GAAG;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,wBAAgB,uBAAuB,IAAI,6BAA6B,CAcvE"}
|
|
@@ -2,23 +2,39 @@ import { d as distExports } from '../../../../_virtual/index.js';
|
|
|
2
2
|
import { useIsAccountContract } from '../../../getCode/useIsAccountContract.js';
|
|
3
3
|
|
|
4
4
|
function useWalletSupportsPermit() {
|
|
5
|
-
const $ = distExports.c(
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
let
|
|
10
|
-
if ($[0] !== t0
|
|
11
|
-
|
|
12
|
-
permit1: t0,
|
|
13
|
-
permit2: t1
|
|
14
|
-
};
|
|
5
|
+
const $ = distExports.c(5);
|
|
6
|
+
const {
|
|
7
|
+
data: t0
|
|
8
|
+
} = useIsAccountContract();
|
|
9
|
+
let t1;
|
|
10
|
+
if ($[0] !== t0) {
|
|
11
|
+
t1 = t0 === void 0 ? {} : t0;
|
|
15
12
|
$[0] = t0;
|
|
16
13
|
$[1] = t1;
|
|
14
|
+
} else {
|
|
15
|
+
t1 = $[1];
|
|
16
|
+
}
|
|
17
|
+
const {
|
|
18
|
+
isContract,
|
|
19
|
+
isDelegatedEOA
|
|
20
|
+
} = t1;
|
|
21
|
+
const isWalletContract = isContract ?? false;
|
|
22
|
+
const isWalletDelegatedEOA = isDelegatedEOA ?? false;
|
|
23
|
+
const t2 = !isWalletContract;
|
|
24
|
+
const t3 = !isWalletContract && !isWalletDelegatedEOA;
|
|
25
|
+
let t4;
|
|
26
|
+
if ($[2] !== t2 || $[3] !== t3) {
|
|
27
|
+
t4 = {
|
|
28
|
+
permit1: t2,
|
|
29
|
+
permit2: t3
|
|
30
|
+
};
|
|
17
31
|
$[2] = t2;
|
|
32
|
+
$[3] = t3;
|
|
33
|
+
$[4] = t4;
|
|
18
34
|
} else {
|
|
19
|
-
|
|
35
|
+
t4 = $[4];
|
|
20
36
|
}
|
|
21
|
-
return
|
|
37
|
+
return t4;
|
|
22
38
|
}
|
|
23
39
|
|
|
24
40
|
export { useWalletSupportsPermit };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWalletSupportsPermit.js","sources":["../../../../../src/hooks/permit/hooks/common/useWalletSupportsPermit.ts"],"sourcesContent":["import { useIsAccountContract } from \"@/hooks/getCode/useIsAccountContract\";\n\ntype UseWalletSupportsPermitResult = {\n permit1: boolean;\n permit2: boolean;\n};\n\nexport function useWalletSupportsPermit(): UseWalletSupportsPermitResult {\n const
|
|
1
|
+
{"version":3,"file":"useWalletSupportsPermit.js","sources":["../../../../../src/hooks/permit/hooks/common/useWalletSupportsPermit.ts"],"sourcesContent":["import { useIsAccountContract } from \"@/hooks/getCode/useIsAccountContract\";\n\ntype UseWalletSupportsPermitResult = {\n permit1: boolean;\n permit2: boolean;\n};\n\nexport function useWalletSupportsPermit(): UseWalletSupportsPermitResult {\n const { data: { isContract, isDelegatedEOA } = {} } = useIsAccountContract();\n // Multisig Smart Wallet signature can't be encoded for permitMethodArgs\n // simpler to just disable for all Smart Contract Wallets, multisig and not\n const isWalletContract = isContract ?? false;\n // When Permit2 calls DelegatedEOA.isValidSignature(hash, signature),\n // it expects a 65 bytes signature, but delta compact signatures are 64 bytes and it breaks.\n const isWalletDelegatedEOA = isDelegatedEOA ?? false;\n\n return {\n permit1: !isWalletContract,\n permit2: !isWalletContract && !isWalletDelegatedEOA,\n // @TODO enable for Permit2 Delta when support is added\n };\n}\n"],"names":["useWalletSupportsPermit","$","_c","data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