@0xsequence/connect 5.0.8 → 5.0.9
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/cjs/constants/version.d.ts +1 -1
- package/dist/cjs/constants/version.js +1 -1
- package/dist/cjs/hooks/useChain.d.ts +29 -1
- package/dist/cjs/hooks/useChain.d.ts.map +1 -1
- package/dist/cjs/hooks/useChain.js +27 -1
- package/dist/cjs/hooks/useChain.js.map +1 -1
- package/dist/cjs/hooks/useCheckWaasFeeOptions.d.ts +41 -0
- package/dist/cjs/hooks/useCheckWaasFeeOptions.d.ts.map +1 -1
- package/dist/cjs/hooks/useCheckWaasFeeOptions.js +41 -0
- package/dist/cjs/hooks/useCheckWaasFeeOptions.js.map +1 -1
- package/dist/cjs/hooks/useDirectEcosystemConnect.d.ts +32 -0
- package/dist/cjs/hooks/useDirectEcosystemConnect.d.ts.map +1 -1
- package/dist/cjs/hooks/useDirectEcosystemConnect.js +32 -0
- package/dist/cjs/hooks/useDirectEcosystemConnect.js.map +1 -1
- package/dist/cjs/hooks/useOpenConnectModal.d.ts +1 -1
- package/dist/cjs/hooks/useOpenConnectModal.js +1 -1
- package/dist/cjs/hooks/useProjectAccessKey.d.ts +17 -0
- package/dist/cjs/hooks/useProjectAccessKey.d.ts.map +1 -1
- package/dist/cjs/hooks/useProjectAccessKey.js +17 -0
- package/dist/cjs/hooks/useProjectAccessKey.js.map +1 -1
- package/dist/cjs/hooks/useSignInEmail.d.ts +20 -0
- package/dist/cjs/hooks/useSignInEmail.d.ts.map +1 -1
- package/dist/cjs/hooks/useSignInEmail.js +20 -0
- package/dist/cjs/hooks/useSignInEmail.js.map +1 -1
- package/dist/cjs/hooks/useTheme.d.ts +26 -0
- package/dist/cjs/hooks/useTheme.d.ts.map +1 -1
- package/dist/cjs/hooks/useTheme.js +26 -0
- package/dist/cjs/hooks/useTheme.js.map +1 -1
- package/dist/cjs/hooks/useWaasConfirmationHandler.d.ts +39 -0
- package/dist/cjs/hooks/useWaasConfirmationHandler.d.ts.map +1 -1
- package/dist/cjs/hooks/useWaasConfirmationHandler.js +39 -0
- package/dist/cjs/hooks/useWaasConfirmationHandler.js.map +1 -1
- package/dist/cjs/hooks/useWaasEmailAuth.d.ts +46 -0
- package/dist/cjs/hooks/useWaasEmailAuth.d.ts.map +1 -1
- package/dist/cjs/hooks/useWaasEmailAuth.js +46 -0
- package/dist/cjs/hooks/useWaasEmailAuth.js.map +1 -1
- package/dist/cjs/hooks/useWaasEmailConflict.d.ts +39 -0
- package/dist/cjs/hooks/useWaasEmailConflict.d.ts.map +1 -1
- package/dist/cjs/hooks/useWaasEmailConflict.js +39 -0
- package/dist/cjs/hooks/useWaasEmailConflict.js.map +1 -1
- package/dist/cjs/hooks/useWaasGetLinkedWalletsSignature.d.ts +60 -0
- package/dist/cjs/hooks/useWaasGetLinkedWalletsSignature.d.ts.map +1 -1
- package/dist/cjs/hooks/useWaasGetLinkedWalletsSignature.js +50 -0
- package/dist/cjs/hooks/useWaasGetLinkedWalletsSignature.js.map +1 -1
- package/dist/cjs/hooks/useWaasLinkWallet.d.ts +57 -0
- package/dist/cjs/hooks/useWaasLinkWallet.d.ts.map +1 -1
- package/dist/cjs/hooks/useWaasLinkWallet.js +42 -0
- package/dist/cjs/hooks/useWaasLinkWallet.js.map +1 -1
- package/dist/cjs/hooks/useWalletSettings.d.ts +28 -0
- package/dist/cjs/hooks/useWalletSettings.d.ts.map +1 -1
- package/dist/cjs/hooks/useWalletSettings.js +28 -0
- package/dist/cjs/hooks/useWalletSettings.js.map +1 -1
- package/dist/cjs/hooks/useWallets.d.ts.map +1 -1
- package/dist/cjs/hooks/useWallets.js +17 -1
- package/dist/cjs/hooks/useWallets.js.map +1 -1
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/hooks/useChain.d.ts +29 -1
- package/dist/esm/hooks/useChain.d.ts.map +1 -1
- package/dist/esm/hooks/useChain.js +27 -1
- package/dist/esm/hooks/useChain.js.map +1 -1
- package/dist/esm/hooks/useCheckWaasFeeOptions.d.ts +41 -0
- package/dist/esm/hooks/useCheckWaasFeeOptions.d.ts.map +1 -1
- package/dist/esm/hooks/useCheckWaasFeeOptions.js +41 -0
- package/dist/esm/hooks/useCheckWaasFeeOptions.js.map +1 -1
- package/dist/esm/hooks/useDirectEcosystemConnect.d.ts +32 -0
- package/dist/esm/hooks/useDirectEcosystemConnect.d.ts.map +1 -1
- package/dist/esm/hooks/useDirectEcosystemConnect.js +32 -0
- package/dist/esm/hooks/useDirectEcosystemConnect.js.map +1 -1
- package/dist/esm/hooks/useOpenConnectModal.d.ts +1 -1
- package/dist/esm/hooks/useOpenConnectModal.js +1 -1
- package/dist/esm/hooks/useProjectAccessKey.d.ts +17 -0
- package/dist/esm/hooks/useProjectAccessKey.d.ts.map +1 -1
- package/dist/esm/hooks/useProjectAccessKey.js +17 -0
- package/dist/esm/hooks/useProjectAccessKey.js.map +1 -1
- package/dist/esm/hooks/useSignInEmail.d.ts +20 -0
- package/dist/esm/hooks/useSignInEmail.d.ts.map +1 -1
- package/dist/esm/hooks/useSignInEmail.js +20 -0
- package/dist/esm/hooks/useSignInEmail.js.map +1 -1
- package/dist/esm/hooks/useTheme.d.ts +26 -0
- package/dist/esm/hooks/useTheme.d.ts.map +1 -1
- package/dist/esm/hooks/useTheme.js +26 -0
- package/dist/esm/hooks/useTheme.js.map +1 -1
- package/dist/esm/hooks/useWaasConfirmationHandler.d.ts +39 -0
- package/dist/esm/hooks/useWaasConfirmationHandler.d.ts.map +1 -1
- package/dist/esm/hooks/useWaasConfirmationHandler.js +39 -0
- package/dist/esm/hooks/useWaasConfirmationHandler.js.map +1 -1
- package/dist/esm/hooks/useWaasEmailAuth.d.ts +46 -0
- package/dist/esm/hooks/useWaasEmailAuth.d.ts.map +1 -1
- package/dist/esm/hooks/useWaasEmailAuth.js +46 -0
- package/dist/esm/hooks/useWaasEmailAuth.js.map +1 -1
- package/dist/esm/hooks/useWaasEmailConflict.d.ts +39 -0
- package/dist/esm/hooks/useWaasEmailConflict.d.ts.map +1 -1
- package/dist/esm/hooks/useWaasEmailConflict.js +39 -0
- package/dist/esm/hooks/useWaasEmailConflict.js.map +1 -1
- package/dist/esm/hooks/useWaasGetLinkedWalletsSignature.d.ts +60 -0
- package/dist/esm/hooks/useWaasGetLinkedWalletsSignature.d.ts.map +1 -1
- package/dist/esm/hooks/useWaasGetLinkedWalletsSignature.js +50 -0
- package/dist/esm/hooks/useWaasGetLinkedWalletsSignature.js.map +1 -1
- package/dist/esm/hooks/useWaasLinkWallet.d.ts +57 -0
- package/dist/esm/hooks/useWaasLinkWallet.d.ts.map +1 -1
- package/dist/esm/hooks/useWaasLinkWallet.js +42 -0
- package/dist/esm/hooks/useWaasLinkWallet.js.map +1 -1
- package/dist/esm/hooks/useWalletSettings.d.ts +28 -0
- package/dist/esm/hooks/useWalletSettings.d.ts.map +1 -1
- package/dist/esm/hooks/useWalletSettings.js +28 -0
- package/dist/esm/hooks/useWalletSettings.js.map +1 -1
- package/dist/esm/hooks/useWallets.d.ts.map +1 -1
- package/dist/esm/hooks/useWallets.js +17 -1
- package/dist/esm/hooks/useWallets.js.map +1 -1
- package/package.json +2 -2
|
@@ -36,6 +36,15 @@ const getLinkedWallets = async (apiClient, args, headers, signal) => {
|
|
|
36
36
|
}));
|
|
37
37
|
return linkedWallets;
|
|
38
38
|
};
|
|
39
|
+
// --- Listener pattern for cross-instance updates ---
|
|
40
|
+
const linkedWalletsListeners = new Set();
|
|
41
|
+
const notifyLinkedWalletsListeners = () => {
|
|
42
|
+
// Use setTimeout to ensure notification happens after the current execution context,
|
|
43
|
+
// allowing React state updates to potentially settle before listeners run.
|
|
44
|
+
setTimeout(() => {
|
|
45
|
+
linkedWalletsListeners.forEach(listener => listener());
|
|
46
|
+
}, 0);
|
|
47
|
+
};
|
|
39
48
|
const useLinkedWallets = (args, options = {}) => {
|
|
40
49
|
const apiClient = (0, hooks_1.useAPIClient)();
|
|
41
50
|
const [data, setData] = (0, react_1.useState)(undefined);
|
|
@@ -67,10 +76,15 @@ const useLinkedWallets = (args, options = {}) => {
|
|
|
67
76
|
setIsLoading(false);
|
|
68
77
|
}
|
|
69
78
|
}, [apiClient, args.parentWalletAddress, args.signatureChainId, options.enabled]);
|
|
70
|
-
// Fetch on mount
|
|
79
|
+
// Fetch on mount, when dependencies change, and register/unregister listener
|
|
71
80
|
(0, react_1.useEffect)(() => {
|
|
81
|
+
// Register the listener
|
|
82
|
+
linkedWalletsListeners.add(fetchData);
|
|
83
|
+
// Initial fetch
|
|
72
84
|
fetchData();
|
|
85
|
+
// Cleanup: remove listener and abort ongoing request
|
|
73
86
|
return () => {
|
|
87
|
+
linkedWalletsListeners.delete(fetchData);
|
|
74
88
|
abortControllerRef.current?.abort();
|
|
75
89
|
};
|
|
76
90
|
}, [fetchData]);
|
|
@@ -80,6 +94,8 @@ const useLinkedWallets = (args, options = {}) => {
|
|
|
80
94
|
const refetch = async () => {
|
|
81
95
|
clearCache();
|
|
82
96
|
await fetchData();
|
|
97
|
+
// Notify other hook instances after successful fetch
|
|
98
|
+
notifyLinkedWalletsListeners();
|
|
83
99
|
};
|
|
84
100
|
return {
|
|
85
101
|
data,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWallets.js","sourceRoot":"","sources":["../../../src/hooks/useWallets.ts"],"names":[],"mappings":";AAAA,YAAY,CAAA;;;AAGZ,6CAAgD;AAChD,iCAAgE;AAChE,iCAAuH;AAEvH,2DAAiF;AAGjF,yFAAqF;AAMrF,wCAAwC;AACxC,MAAM,gBAAgB,GAAG,CAAC,IAA0B,EAAU,EAAE,CAC9D,8BAA8B,IAAI,CAAC,mBAAmB,IAAI,IAAI,CAAC,gBAAgB,EAAE,CAAA;AAEnF,MAAM,gBAAgB,GAAG,KAAK,EAC5B,SAA4B,EAC5B,IAA0B,EAC1B,OAAgB,EAChB,MAAoB,EACU,EAAE;IAChC,MAAM,UAAU,GAAG,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,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,8BAA8B,EAAE,KAAK,CAAC,CAAA;QACtD,CAAC;IACH,CAAC,CAAA;IAED,OAAO;QACL,OAAO;QACP,aAAa;QACb,eAAe;QACf,gBAAgB;QAChB,oBAAoB;KACrB,CAAA;AACH,CAAC,CAAA;AAhFY,QAAA,UAAU,cAgFtB;AAED,MAAM,gBAAgB,GAAG,CAAC,SAAoB,EAAE,EAAE;IAChD,MAAM,aAAa,GAAG,SAAS,CAAC,IAAI,CAAA;IACpC,MAAM,mBAAmB,GAAI,SAAS,CAAC,OAAe,EAAE,IAAI,CAAA;IAE5D,IAAI,aAAa,KAAK,2CAAiC,EAAE,CAAC;QACxD,OAAO,oBAAoB,CAAA;IAC7B,CAAC;IAED,OAAO,mBAAmB,IAAI,aAAa,CAAA;AAC7C,CAAC,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const WEB_SDK_VERSION = "5.0.
|
|
1
|
+
export declare const WEB_SDK_VERSION = "5.0.9";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const WEB_SDK_VERSION = '5.0.
|
|
1
|
+
export const WEB_SDK_VERSION = '5.0.9';
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
|
@@ -1,2 +1,30 @@
|
|
|
1
|
-
|
|
1
|
+
import { Chain } from 'wagmi/chains';
|
|
2
|
+
/**
|
|
3
|
+
* Hook for retrieving chain configuration information from wagmi's chain configurations
|
|
4
|
+
*
|
|
5
|
+
* This hook provides functionality to:
|
|
6
|
+
* - Get the configuration for the currently connected chain
|
|
7
|
+
* - Get the configuration for a specific chain by ID
|
|
8
|
+
* - Access chain-specific details like name, network configuration, RPC URLs, and block explorers
|
|
9
|
+
*
|
|
10
|
+
* The hook is commonly used in conjunction with other Sequence hooks to access chain-specific
|
|
11
|
+
* information when working with transactions, indexer clients, or network-specific features.
|
|
12
|
+
*
|
|
13
|
+
* @see {@link https://docs.sequence.xyz/sdk/web/hooks/useChain} for more detailed documentation.
|
|
14
|
+
*
|
|
15
|
+
* @param chainId - Optional chain ID to get configuration for a specific chain. If not provided, returns the current chain's configuration.
|
|
16
|
+
* @returns Chain configuration object for the specified or current chain, or undefined if not found
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* // Get current chain configuration
|
|
21
|
+
* const currentChain = useChain();
|
|
22
|
+
* console.log('Current chain name:', currentChain?.name);
|
|
23
|
+
*
|
|
24
|
+
* // Get configuration for a specific chain
|
|
25
|
+
* const ethereumChain = useChain(1); // Ethereum Mainnet
|
|
26
|
+
* console.log('Ethereum chain details:', ethereumChain);
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export declare const useChain: (chainId?: number) => Chain | undefined;
|
|
2
30
|
//# sourceMappingURL=useChain.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useChain.d.ts","sourceRoot":"","sources":["../../../src/hooks/useChain.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useChain.d.ts","sourceRoot":"","sources":["../../../src/hooks/useChain.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AAEpC;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,QAAQ,GAAI,UAAU,MAAM,KAAG,KAAK,GAAG,SAKnD,CAAA"}
|
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
import { useChainId, useChains } from 'wagmi';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Hook for retrieving chain configuration information from wagmi's chain configurations
|
|
4
|
+
*
|
|
5
|
+
* This hook provides functionality to:
|
|
6
|
+
* - Get the configuration for the currently connected chain
|
|
7
|
+
* - Get the configuration for a specific chain by ID
|
|
8
|
+
* - Access chain-specific details like name, network configuration, RPC URLs, and block explorers
|
|
9
|
+
*
|
|
10
|
+
* The hook is commonly used in conjunction with other Sequence hooks to access chain-specific
|
|
11
|
+
* information when working with transactions, indexer clients, or network-specific features.
|
|
12
|
+
*
|
|
13
|
+
* @see {@link https://docs.sequence.xyz/sdk/web/hooks/useChain} for more detailed documentation.
|
|
14
|
+
*
|
|
15
|
+
* @param chainId - Optional chain ID to get configuration for a specific chain. If not provided, returns the current chain's configuration.
|
|
16
|
+
* @returns Chain configuration object for the specified or current chain, or undefined if not found
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* // Get current chain configuration
|
|
21
|
+
* const currentChain = useChain();
|
|
22
|
+
* console.log('Current chain name:', currentChain?.name);
|
|
23
|
+
*
|
|
24
|
+
* // Get configuration for a specific chain
|
|
25
|
+
* const ethereumChain = useChain(1); // Ethereum Mainnet
|
|
26
|
+
* console.log('Ethereum chain details:', ethereumChain);
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
3
29
|
export const useChain = (chainId) => {
|
|
4
30
|
const chains = useChains();
|
|
5
31
|
const currentChainId = useChainId();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useChain.js","sourceRoot":"","sources":["../../../src/hooks/useChain.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"useChain.js","sourceRoot":"","sources":["../../../src/hooks/useChain.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAG7C;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,OAAgB,EAAqB,EAAE;IAC9D,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAC1B,MAAM,cAAc,GAAG,UAAU,EAAE,CAAA;IAEnC,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,KAAK,cAAc,CAAC,CAAC,CAAA;AAC7F,CAAC,CAAA"}
|
|
@@ -1,4 +1,45 @@
|
|
|
1
1
|
import { FeeOption, Transaction } from '@0xsequence/waas';
|
|
2
|
+
/**
|
|
3
|
+
* Hook for checking transaction fee options in Sequence WaaS (Wallet as a Service)
|
|
4
|
+
*
|
|
5
|
+
* This hook provides functionality to:
|
|
6
|
+
* - Check if a transaction will be sponsored
|
|
7
|
+
* - Get available fee options for unsponsored transactions
|
|
8
|
+
* - Retrieve fee quotes for transactions
|
|
9
|
+
*
|
|
10
|
+
* The hook is commonly used in conjunction with `useWaasFeeOptions` to handle fee payments
|
|
11
|
+
* for unsponsored transactions. It's particularly useful in
|
|
12
|
+
* wallet interfaces and transaction confirmation flows.
|
|
13
|
+
*
|
|
14
|
+
* @see {@link https://docs.sequence.xyz/sdk/web/hooks/useCheckWaasFeeOptions} for more detailed documentation.
|
|
15
|
+
*
|
|
16
|
+
* @returns A function that accepts transaction details and returns fee information
|
|
17
|
+
* @returns.feeQuote - The fee quote for the transaction if available
|
|
18
|
+
* @returns.feeOptions - Available fee payment options if the transaction is not sponsored
|
|
19
|
+
* @returns.isSponsored - Whether the transaction is sponsored (true) or requires fee payment (false)
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```tsx
|
|
23
|
+
* import { useCheckWaasFeeOptions } from '@0xsequence/connect'
|
|
24
|
+
*
|
|
25
|
+
* const YourComponent = () => {
|
|
26
|
+
* const checkFeeOptions = useCheckWaasFeeOptions()
|
|
27
|
+
*
|
|
28
|
+
* const handleTransaction = async () => {
|
|
29
|
+
* const { isSponsored, feeOptions, feeQuote } = await checkFeeOptions({
|
|
30
|
+
* transactions: [transaction],
|
|
31
|
+
* chainId: 1 // Ethereum Mainnet
|
|
32
|
+
* })
|
|
33
|
+
*
|
|
34
|
+
* if (!isSponsored && feeOptions) {
|
|
35
|
+
* // Handle fee options for unsponsored transaction
|
|
36
|
+
* console.log('Available fee options:', feeOptions)
|
|
37
|
+
* console.log('Fee quote:', feeQuote)
|
|
38
|
+
* }
|
|
39
|
+
* }
|
|
40
|
+
* }
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
2
43
|
export declare function useCheckWaasFeeOptions(): (params: {
|
|
3
44
|
transactions: Transaction[];
|
|
4
45
|
chainId: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCheckWaasFeeOptions.d.ts","sourceRoot":"","sources":["../../../src/hooks/useCheckWaasFeeOptions.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAGzD,wBAAgB,sBAAsB,IAAI,CAAC,MAAM,EAAE;IAAE,YAAY,EAAE,WAAW,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,KAAK,OAAO,CAAC;IAC9G,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;IAC5B,UAAU,EAAE,SAAS,EAAE,GAAG,SAAS,CAAA;IACnC,WAAW,EAAE,OAAO,CAAA;CACrB,CAAC,CAwBD"}
|
|
1
|
+
{"version":3,"file":"useCheckWaasFeeOptions.d.ts","sourceRoot":"","sources":["../../../src/hooks/useCheckWaasFeeOptions.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAGzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,wBAAgB,sBAAsB,IAAI,CAAC,MAAM,EAAE;IAAE,YAAY,EAAE,WAAW,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,KAAK,OAAO,CAAC;IAC9G,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;IAC5B,UAAU,EAAE,SAAS,EAAE,GAAG,SAAS,CAAA;IACnC,WAAW,EAAE,OAAO,CAAA;CACrB,CAAC,CAwBD"}
|
|
@@ -1,5 +1,46 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { useConnections } from 'wagmi';
|
|
3
|
+
/**
|
|
4
|
+
* Hook for checking transaction fee options in Sequence WaaS (Wallet as a Service)
|
|
5
|
+
*
|
|
6
|
+
* This hook provides functionality to:
|
|
7
|
+
* - Check if a transaction will be sponsored
|
|
8
|
+
* - Get available fee options for unsponsored transactions
|
|
9
|
+
* - Retrieve fee quotes for transactions
|
|
10
|
+
*
|
|
11
|
+
* The hook is commonly used in conjunction with `useWaasFeeOptions` to handle fee payments
|
|
12
|
+
* for unsponsored transactions. It's particularly useful in
|
|
13
|
+
* wallet interfaces and transaction confirmation flows.
|
|
14
|
+
*
|
|
15
|
+
* @see {@link https://docs.sequence.xyz/sdk/web/hooks/useCheckWaasFeeOptions} for more detailed documentation.
|
|
16
|
+
*
|
|
17
|
+
* @returns A function that accepts transaction details and returns fee information
|
|
18
|
+
* @returns.feeQuote - The fee quote for the transaction if available
|
|
19
|
+
* @returns.feeOptions - Available fee payment options if the transaction is not sponsored
|
|
20
|
+
* @returns.isSponsored - Whether the transaction is sponsored (true) or requires fee payment (false)
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* import { useCheckWaasFeeOptions } from '@0xsequence/connect'
|
|
25
|
+
*
|
|
26
|
+
* const YourComponent = () => {
|
|
27
|
+
* const checkFeeOptions = useCheckWaasFeeOptions()
|
|
28
|
+
*
|
|
29
|
+
* const handleTransaction = async () => {
|
|
30
|
+
* const { isSponsored, feeOptions, feeQuote } = await checkFeeOptions({
|
|
31
|
+
* transactions: [transaction],
|
|
32
|
+
* chainId: 1 // Ethereum Mainnet
|
|
33
|
+
* })
|
|
34
|
+
*
|
|
35
|
+
* if (!isSponsored && feeOptions) {
|
|
36
|
+
* // Handle fee options for unsponsored transaction
|
|
37
|
+
* console.log('Available fee options:', feeOptions)
|
|
38
|
+
* console.log('Fee quote:', feeQuote)
|
|
39
|
+
* }
|
|
40
|
+
* }
|
|
41
|
+
* }
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
3
44
|
export function useCheckWaasFeeOptions() {
|
|
4
45
|
const connections = useConnections();
|
|
5
46
|
const waasConnector = connections.find(c => c.connector.id.includes('waas'))?.connector;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCheckWaasFeeOptions.js","sourceRoot":"","sources":["../../../src/hooks/useCheckWaasFeeOptions.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAGZ,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAEtC,MAAM,UAAU,sBAAsB;IAKpC,MAAM,WAAW,GAAG,cAAc,EAAE,CAAA;IACpC,MAAM,aAAa,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,SAAS,CAAA;IAEvF,OAAO,KAAK,EAAE,EAAE,YAAY,EAAE,OAAO,EAAE,EAAE,EAAE;QACzC,IAAI,CAAC,aAAa,EAAE,CAAC;YACnB,OAAO;gBACL,QAAQ,EAAE,SAAS;gBACnB,UAAU,EAAE,SAAS;gBACrB,WAAW,EAAE,IAAI;aAClB,CAAA;QACH,CAAC;QAED,MAAM,YAAY,GAAI,aAAqB,CAAC,oBAAoB,CAAA;QAChE,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,OAAO;gBACL,QAAQ,EAAE,SAAS;gBACnB,UAAU,EAAE,SAAS;gBACrB,WAAW,EAAE,IAAI;aAClB,CAAA;QACH,CAAC;QAED,OAAO,YAAY,CAAC,0BAA0B,CAAC,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC,CAAA;IAC3E,CAAC,CAAA;AACH,CAAC"}
|
|
1
|
+
{"version":3,"file":"useCheckWaasFeeOptions.js","sourceRoot":"","sources":["../../../src/hooks/useCheckWaasFeeOptions.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAGZ,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAEtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,MAAM,UAAU,sBAAsB;IAKpC,MAAM,WAAW,GAAG,cAAc,EAAE,CAAA;IACpC,MAAM,aAAa,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,SAAS,CAAA;IAEvF,OAAO,KAAK,EAAE,EAAE,YAAY,EAAE,OAAO,EAAE,EAAE,EAAE;QACzC,IAAI,CAAC,aAAa,EAAE,CAAC;YACnB,OAAO;gBACL,QAAQ,EAAE,SAAS;gBACnB,UAAU,EAAE,SAAS;gBACrB,WAAW,EAAE,IAAI;aAClB,CAAA;QACH,CAAC;QAED,MAAM,YAAY,GAAI,aAAqB,CAAC,oBAAoB,CAAA;QAChE,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,OAAO;gBACL,QAAQ,EAAE,SAAS;gBACnB,UAAU,EAAE,SAAS;gBACrB,WAAW,EAAE,IAAI;aAClB,CAAA;QACH,CAAC;QAED,OAAO,YAAY,CAAC,0BAA0B,CAAC,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC,CAAA;IAC3E,CAAC,CAAA;AACH,CAAC"}
|
|
@@ -1,2 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook to directly connect to an ecosystem wallet with email
|
|
3
|
+
*
|
|
4
|
+
* @returns A function that triggers the ecosystem wallet connection
|
|
5
|
+
* @throws {Error} If the ecosystem wallet connector is not found among available connectors
|
|
6
|
+
*
|
|
7
|
+
* The returned function accepts:
|
|
8
|
+
* - `auxData` (optional) - Additional data to pass to the ecosystem connector during connection
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* const triggerConnect = useDirectEcosystemConnect()
|
|
13
|
+
*
|
|
14
|
+
* // Connect without auxiliary data
|
|
15
|
+
* await triggerConnect()
|
|
16
|
+
*
|
|
17
|
+
* // Connect with auxiliary data
|
|
18
|
+
* await triggerConnect({
|
|
19
|
+
* someKey: 'someValue',
|
|
20
|
+
* anotherKey: 123
|
|
21
|
+
* })
|
|
22
|
+
*
|
|
23
|
+
* // Handle connection errors
|
|
24
|
+
* try {
|
|
25
|
+
* await triggerConnect()
|
|
26
|
+
* } catch (error) {
|
|
27
|
+
* if (error.message === 'Ecosystem wallet connector not found') {
|
|
28
|
+
* console.error('Ecosystem wallet is not configured')
|
|
29
|
+
* }
|
|
30
|
+
* }
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
1
33
|
export declare const useDirectEcosystemConnect: () => (auxData?: Record<string, unknown>) => Promise<void>;
|
|
2
34
|
//# sourceMappingURL=useDirectEcosystemConnect.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDirectEcosystemConnect.d.ts","sourceRoot":"","sources":["../../../src/hooks/useDirectEcosystemConnect.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,yBAAyB,mBAGI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,kBAiBhE,CAAA"}
|
|
1
|
+
{"version":3,"file":"useDirectEcosystemConnect.d.ts","sourceRoot":"","sources":["../../../src/hooks/useDirectEcosystemConnect.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,eAAO,MAAM,yBAAyB,mBAGI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,kBAiBhE,CAAA"}
|
|
@@ -1,4 +1,36 @@
|
|
|
1
1
|
import { useConnect } from 'wagmi';
|
|
2
|
+
/**
|
|
3
|
+
* Hook to directly connect to an ecosystem wallet with email
|
|
4
|
+
*
|
|
5
|
+
* @returns A function that triggers the ecosystem wallet connection
|
|
6
|
+
* @throws {Error} If the ecosystem wallet connector is not found among available connectors
|
|
7
|
+
*
|
|
8
|
+
* The returned function accepts:
|
|
9
|
+
* - `auxData` (optional) - Additional data to pass to the ecosystem connector during connection
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* const triggerConnect = useDirectEcosystemConnect()
|
|
14
|
+
*
|
|
15
|
+
* // Connect without auxiliary data
|
|
16
|
+
* await triggerConnect()
|
|
17
|
+
*
|
|
18
|
+
* // Connect with auxiliary data
|
|
19
|
+
* await triggerConnect({
|
|
20
|
+
* someKey: 'someValue',
|
|
21
|
+
* anotherKey: 123
|
|
22
|
+
* })
|
|
23
|
+
*
|
|
24
|
+
* // Handle connection errors
|
|
25
|
+
* try {
|
|
26
|
+
* await triggerConnect()
|
|
27
|
+
* } catch (error) {
|
|
28
|
+
* if (error.message === 'Ecosystem wallet connector not found') {
|
|
29
|
+
* console.error('Ecosystem wallet is not configured')
|
|
30
|
+
* }
|
|
31
|
+
* }
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
2
34
|
export const useDirectEcosystemConnect = () => {
|
|
3
35
|
const { connectors, connect } = useConnect();
|
|
4
36
|
const triggerConnect = async (auxData) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDirectEcosystemConnect.js","sourceRoot":"","sources":["../../../src/hooks/useDirectEcosystemConnect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAIlC,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAG,EAAE;IAC5C,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,UAAU,EAAE,CAAA;IAE5C,MAAM,cAAc,GAAG,KAAK,EAAE,OAAiC,EAAE,EAAE;QACjE,MAAM,kBAAkB,GAAG,UAAU,CAAC,IAAI,CACxC,CAAC,SAAS,EAAmC,EAAE,CAAC,SAAS,CAAC,IAAI,KAAK,kBAAkB,CACtF,CAAA;QAED,IAAI,CAAC,kBAAkB,EAAE,CAAC;YACxB,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAA;QACzD,CAAC;QAED,IAAI,OAAO,EAAE,CAAC;YACZ,kBAAkB,CAAC,OAAO,GAAG,OAAO,CAAA;QACtC,CAAC;QAED,OAAO,OAAO,CAAC,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAAC,CAAA;IACnD,CAAC,CAAA;IAED,OAAO,cAAc,CAAA;AACvB,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"useDirectEcosystemConnect.js","sourceRoot":"","sources":["../../../src/hooks/useDirectEcosystemConnect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAIlC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAG,EAAE;IAC5C,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,UAAU,EAAE,CAAA;IAE5C,MAAM,cAAc,GAAG,KAAK,EAAE,OAAiC,EAAE,EAAE;QACjE,MAAM,kBAAkB,GAAG,UAAU,CAAC,IAAI,CACxC,CAAC,SAAS,EAAmC,EAAE,CAAC,SAAS,CAAC,IAAI,KAAK,kBAAkB,CACtF,CAAA;QAED,IAAI,CAAC,kBAAkB,EAAE,CAAC;YACxB,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAA;QACzD,CAAC;QAED,IAAI,OAAO,EAAE,CAAC;YACZ,kBAAkB,CAAC,OAAO,GAAG,OAAO,CAAA;QACtC,CAAC;QAED,OAAO,OAAO,CAAC,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAAC,CAAA;IACnD,CAAC,CAAA;IAED,OAAO,cAAc,CAAA;AACvB,CAAC,CAAA"}
|
|
@@ -14,7 +14,7 @@ type UseOpenConnectModalReturnType = {
|
|
|
14
14
|
* This hook provides a method to open and close the connect modal, and access its current open state.
|
|
15
15
|
* The Connect modal provides various wallet connection options including Sequence wallet and external wallets.
|
|
16
16
|
*
|
|
17
|
-
*
|
|
17
|
+
* @see {@link https://docs.sequence.xyz/sdk/web/hooks/useOpenConnectModal} for more detailed documentation.
|
|
18
18
|
*
|
|
19
19
|
* @returns An object containing function to control the Connect modal and its state {@link UseOpenConnectModalReturnType}
|
|
20
20
|
*
|
|
@@ -5,7 +5,7 @@ import { useConnectModalContext } from '../contexts/ConnectModal';
|
|
|
5
5
|
* This hook provides a method to open and close the connect modal, and access its current open state.
|
|
6
6
|
* The Connect modal provides various wallet connection options including Sequence wallet and external wallets.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
8
|
+
* @see {@link https://docs.sequence.xyz/sdk/web/hooks/useOpenConnectModal} for more detailed documentation.
|
|
9
9
|
*
|
|
10
10
|
* @returns An object containing function to control the Connect modal and its state {@link UseOpenConnectModalReturnType}
|
|
11
11
|
*
|
|
@@ -1,2 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook to access the project access key from the Sequence Connect configuration.
|
|
3
|
+
*
|
|
4
|
+
* The project access key is a required configuration parameter used to authenticate and
|
|
5
|
+
* identify your application with Sequence services. It is used across various SDK features
|
|
6
|
+
* including marketplace integration and wallet connections.
|
|
7
|
+
*
|
|
8
|
+
* @see {@link https://docs.sequence.xyz/sdk/web/hooks/useProjectAccessKey} for more detailed documentation.
|
|
9
|
+
*
|
|
10
|
+
* @returns {string} The project access key configured for the application
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* const projectAccessKey = useProjectAccessKey()
|
|
15
|
+
* const marketplaceClient = new MarketplaceIndexer(apiUrl, projectAccessKey)
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
1
18
|
export declare const useProjectAccessKey: () => string;
|
|
2
19
|
//# sourceMappingURL=useProjectAccessKey.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useProjectAccessKey.d.ts","sourceRoot":"","sources":["../../../src/hooks/useProjectAccessKey.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,mBAAmB,cAI/B,CAAA"}
|
|
1
|
+
{"version":3,"file":"useProjectAccessKey.d.ts","sourceRoot":"","sources":["../../../src/hooks/useProjectAccessKey.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,mBAAmB,cAI/B,CAAA"}
|
|
@@ -1,4 +1,21 @@
|
|
|
1
1
|
import { useConnectConfigContext } from '../contexts/ConnectConfig.js';
|
|
2
|
+
/**
|
|
3
|
+
* Hook to access the project access key from the Sequence Connect configuration.
|
|
4
|
+
*
|
|
5
|
+
* The project access key is a required configuration parameter used to authenticate and
|
|
6
|
+
* identify your application with Sequence services. It is used across various SDK features
|
|
7
|
+
* including marketplace integration and wallet connections.
|
|
8
|
+
*
|
|
9
|
+
* @see {@link https://docs.sequence.xyz/sdk/web/hooks/useProjectAccessKey} for more detailed documentation.
|
|
10
|
+
*
|
|
11
|
+
* @returns {string} The project access key configured for the application
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* const projectAccessKey = useProjectAccessKey()
|
|
16
|
+
* const marketplaceClient = new MarketplaceIndexer(apiUrl, projectAccessKey)
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
2
19
|
export const useProjectAccessKey = () => {
|
|
3
20
|
const { projectAccessKey } = useConnectConfigContext();
|
|
4
21
|
return projectAccessKey;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useProjectAccessKey.js","sourceRoot":"","sources":["../../../src/hooks/useProjectAccessKey.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAA;AAEtE,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,EAAE;IACtC,MAAM,EAAE,gBAAgB,EAAE,GAAG,uBAAuB,EAAE,CAAA;IAEtD,OAAO,gBAAgB,CAAA;AACzB,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"useProjectAccessKey.js","sourceRoot":"","sources":["../../../src/hooks/useProjectAccessKey.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAA;AAEtE;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,EAAE;IACtC,MAAM,EAAE,gBAAgB,EAAE,GAAG,uBAAuB,EAAE,CAAA;IAEtD,OAAO,gBAAgB,CAAA;AACzB,CAAC,CAAA"}
|
|
@@ -1,2 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook to retrieve the email address associated with the currently connected wallet.
|
|
3
|
+
*
|
|
4
|
+
* This hook monitors the connection status and retrieves the stored email address when a wallet
|
|
5
|
+
* is connected. It works with both WaaS (Wallet-as-a-Service) and universal wallet types.
|
|
6
|
+
* The email is cleared when the wallet is disconnected.
|
|
7
|
+
*
|
|
8
|
+
* @see {@link https://docs.sequence.xyz/sdk/web/hooks/useSignInEmail} for more detailed documentation.
|
|
9
|
+
*
|
|
10
|
+
* @returns {string | null} The email address of the connected wallet user, or null if not connected
|
|
11
|
+
* or no email is associated
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* const email = useSignInEmail()
|
|
16
|
+
* if (email) {
|
|
17
|
+
* console.log('Connected user email:', email)
|
|
18
|
+
* }
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
1
21
|
export declare const useSignInEmail: () => string | null;
|
|
2
22
|
//# sourceMappingURL=useSignInEmail.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSignInEmail.d.ts","sourceRoot":"","sources":["../../../src/hooks/useSignInEmail.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,cAAc,qBAoB1B,CAAA"}
|
|
1
|
+
{"version":3,"file":"useSignInEmail.d.ts","sourceRoot":"","sources":["../../../src/hooks/useSignInEmail.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,cAAc,qBAoB1B,CAAA"}
|
|
@@ -2,6 +2,26 @@
|
|
|
2
2
|
import { useEffect, useState } from 'react';
|
|
3
3
|
import { useConfig, useAccount } from 'wagmi';
|
|
4
4
|
import { LocalStorageKey } from '../constants/localStorage';
|
|
5
|
+
/**
|
|
6
|
+
* Hook to retrieve the email address associated with the currently connected wallet.
|
|
7
|
+
*
|
|
8
|
+
* This hook monitors the connection status and retrieves the stored email address when a wallet
|
|
9
|
+
* is connected. It works with both WaaS (Wallet-as-a-Service) and universal wallet types.
|
|
10
|
+
* The email is cleared when the wallet is disconnected.
|
|
11
|
+
*
|
|
12
|
+
* @see {@link https://docs.sequence.xyz/sdk/web/hooks/useSignInEmail} for more detailed documentation.
|
|
13
|
+
*
|
|
14
|
+
* @returns {string | null} The email address of the connected wallet user, or null if not connected
|
|
15
|
+
* or no email is associated
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* const email = useSignInEmail()
|
|
20
|
+
* if (email) {
|
|
21
|
+
* console.log('Connected user email:', email)
|
|
22
|
+
* }
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
5
25
|
export const useSignInEmail = () => {
|
|
6
26
|
const { storage } = useConfig();
|
|
7
27
|
const { isConnected } = useAccount();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSignInEmail.js","sourceRoot":"","sources":["../../../src/hooks/useSignInEmail.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC3C,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAE7C,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAE3D,MAAM,CAAC,MAAM,cAAc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AAI,EAAE;QAC5B,MAAM,WAAW,GAAG,MAAM,OAAO,EAAE,OAAO,CAAC,eAAe,CAAC,eAAe,CAAC,CAAA;QAE3E,QAAQ,CAAC,WAAqB,CAAC,CAAA;IACjC,CAAC,CAAA;IAED,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,WAAW,EAAE,CAAC;YAChB,UAAU,EAAE,CAAA;QACd,CAAC;aAAM,CAAC;YACN,QAAQ,CAAC,IAAI,CAAC,CAAA;QAChB,CAAC;IACH,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAA;IAEjB,OAAO,KAAK,CAAA;AACd,CAAC,CAAA"}
|
|
@@ -1,3 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook to access and modify the theme and modal position settings.
|
|
3
|
+
*
|
|
4
|
+
* This hook provides access to the current theme (light/dark) and modal position settings,
|
|
5
|
+
* along with functions to update these values. The modal position can be set to various
|
|
6
|
+
* predefined positions on the screen.
|
|
7
|
+
*
|
|
8
|
+
* @see {@link https://docs.sequence.xyz/sdk/web/hooks/useTheme} for more detailed documentation.
|
|
9
|
+
*
|
|
10
|
+
* @returns {Object} An object containing:
|
|
11
|
+
* - `theme` - The current theme setting
|
|
12
|
+
* - `setTheme` - Function to update the theme
|
|
13
|
+
* - `position` - The current modal position ('center', 'top-right', 'bottom-left', etc.)
|
|
14
|
+
* - `setPosition` - Function to update the modal position
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* const { theme, setTheme, position, setPosition } = useTheme()
|
|
19
|
+
*
|
|
20
|
+
* // Change theme
|
|
21
|
+
* setTheme('dark')
|
|
22
|
+
*
|
|
23
|
+
* // Update modal position
|
|
24
|
+
* setPosition('top-right')
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
1
27
|
export declare const useTheme: () => {
|
|
2
28
|
setTheme: import("react").Dispatch<import("react").SetStateAction<import("@0xsequence/design-system").Theme>>;
|
|
3
29
|
theme: import("@0xsequence/design-system").Theme;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../../src/hooks/useTheme.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ;;;;;CASpB,CAAA"}
|
|
1
|
+
{"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../../src/hooks/useTheme.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,QAAQ;;;;;CASpB,CAAA"}
|
|
@@ -1,4 +1,30 @@
|
|
|
1
1
|
import { useThemeContext } from '../contexts/Theme';
|
|
2
|
+
/**
|
|
3
|
+
* Hook to access and modify the theme and modal position settings.
|
|
4
|
+
*
|
|
5
|
+
* This hook provides access to the current theme (light/dark) and modal position settings,
|
|
6
|
+
* along with functions to update these values. The modal position can be set to various
|
|
7
|
+
* predefined positions on the screen.
|
|
8
|
+
*
|
|
9
|
+
* @see {@link https://docs.sequence.xyz/sdk/web/hooks/useTheme} for more detailed documentation.
|
|
10
|
+
*
|
|
11
|
+
* @returns {Object} An object containing:
|
|
12
|
+
* - `theme` - The current theme setting
|
|
13
|
+
* - `setTheme` - Function to update the theme
|
|
14
|
+
* - `position` - The current modal position ('center', 'top-right', 'bottom-left', etc.)
|
|
15
|
+
* - `setPosition` - Function to update the modal position
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* const { theme, setTheme, position, setPosition } = useTheme()
|
|
20
|
+
*
|
|
21
|
+
* // Change theme
|
|
22
|
+
* setTheme('dark')
|
|
23
|
+
*
|
|
24
|
+
* // Update modal position
|
|
25
|
+
* setPosition('top-right')
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
2
28
|
export const useTheme = () => {
|
|
3
29
|
const { setTheme, theme, position, setPosition } = useThemeContext();
|
|
4
30
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTheme.js","sourceRoot":"","sources":["../../../src/hooks/useTheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAEnD,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,EAAE;IAC3B,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,eAAe,EAAE,CAAA;IAEpE,OAAO;QACL,QAAQ;QACR,KAAK;QACL,QAAQ;QACR,WAAW;KACZ,CAAA;AACH,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"useTheme.js","sourceRoot":"","sources":["../../../src/hooks/useTheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAEnD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,EAAE;IAC3B,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,eAAe,EAAE,CAAA;IAEpE,OAAO;QACL,QAAQ;QACR,KAAK;QACL,QAAQ;QACR,WAAW;KACZ,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -6,5 +6,44 @@ export type WaasRequestConfirmation = {
|
|
|
6
6
|
txs?: commons.transaction.Transaction[];
|
|
7
7
|
chainId?: number;
|
|
8
8
|
};
|
|
9
|
+
/**
|
|
10
|
+
* Hook to handle transaction and message signing confirmations for WaaS (Wallet-as-a-Service) connections.
|
|
11
|
+
*
|
|
12
|
+
* This hook sets up confirmation handlers for signing transactions and messages when using a WaaS connector.
|
|
13
|
+
* It manages the state of pending confirmations and provides functions to confirm or reject signing requests.
|
|
14
|
+
*
|
|
15
|
+
* @param waasConnector - The WaaS connector instance to handle confirmations for (optional)
|
|
16
|
+
*
|
|
17
|
+
* @returns A tuple containing:
|
|
18
|
+
* - [0] {@link WaasRequestConfirmation} | undefined - The current pending request confirmation info or undefined if none
|
|
19
|
+
* - [1] `(id: string) => void` - Function to confirm a pending request by ID
|
|
20
|
+
* - [2] `(id: string) => void` - Function to reject a pending request by ID
|
|
21
|
+
*
|
|
22
|
+
* The {@link WaasRequestConfirmation} object contains:
|
|
23
|
+
* - `id` - Unique identifier for the request
|
|
24
|
+
* - `type` - Either 'signTransaction' or 'signMessage'
|
|
25
|
+
* - `message?` - Optional message to sign (for signMessage requests)
|
|
26
|
+
* - `txs?` - Optional array of transactions (for signTransaction requests)
|
|
27
|
+
* - `chainId?` - Optional chain ID for the request
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```tsx
|
|
31
|
+
* const [
|
|
32
|
+
* pendingRequestConfirmation,
|
|
33
|
+
* confirmPendingRequest,
|
|
34
|
+
* rejectPendingRequest
|
|
35
|
+
* ] = useWaasConfirmationHandler(waasConnector)
|
|
36
|
+
*
|
|
37
|
+
* // When user confirms the request
|
|
38
|
+
* if (pendingRequestConfirmation) {
|
|
39
|
+
* confirmPendingRequest(pendingRequestConfirmation.id)
|
|
40
|
+
* }
|
|
41
|
+
*
|
|
42
|
+
* // When user rejects the request
|
|
43
|
+
* if (pendingRequestConfirmation) {
|
|
44
|
+
* rejectPendingRequest(pendingRequestConfirmation.id)
|
|
45
|
+
* }
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
9
48
|
export declare function useWaasConfirmationHandler(waasConnector?: any): [WaasRequestConfirmation | undefined, (id: string) => void, (id: string) => void];
|
|
10
49
|
//# sourceMappingURL=useWaasConfirmationHandler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWaasConfirmationHandler.d.ts","sourceRoot":"","sources":["../../../src/hooks/useWaasConfirmationHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAO1C,MAAM,MAAM,uBAAuB,GAAG;IACpC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,iBAAiB,GAAG,aAAa,CAAA;IACvC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,GAAG,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,WAAW,EAAE,CAAA;IACvC,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,wBAAgB,0BAA0B,CACxC,aAAa,CAAC,EAAE,GAAG,GAClB,CAAC,uBAAuB,GAAG,SAAS,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC,CAkDnF"}
|
|
1
|
+
{"version":3,"file":"useWaasConfirmationHandler.d.ts","sourceRoot":"","sources":["../../../src/hooks/useWaasConfirmationHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAO1C,MAAM,MAAM,uBAAuB,GAAG;IACpC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,iBAAiB,GAAG,aAAa,CAAA;IACvC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,GAAG,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,WAAW,EAAE,CAAA;IACvC,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAgB,0BAA0B,CACxC,aAAa,CAAC,EAAE,GAAG,GAClB,CAAC,uBAAuB,GAAG,SAAS,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC,CAkDnF"}
|