@0xsequence/connect 5.0.7 → 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/components/CryptoOption.d.ts +2 -2
- package/dist/cjs/components/CryptoOption.d.ts.map +1 -1
- package/dist/cjs/components/CryptoOption.js +3 -3
- package/dist/cjs/components/CryptoOption.js.map +1 -1
- 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/components/CryptoOption.d.ts +2 -2
- package/dist/esm/components/CryptoOption.d.ts.map +1 -1
- package/dist/esm/components/CryptoOption.js +3 -3
- package/dist/esm/components/CryptoOption.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
|
@@ -7,8 +7,8 @@ interface CryptoOptionProps {
|
|
|
7
7
|
onClick: () => void;
|
|
8
8
|
isSelected: boolean;
|
|
9
9
|
disabled: boolean;
|
|
10
|
-
|
|
10
|
+
showInsufficientFundsWarning?: boolean | undefined;
|
|
11
11
|
}
|
|
12
|
-
export declare const CryptoOption: ({ currencyName, chainId, iconUrl, symbol, price, onClick, isSelected,
|
|
12
|
+
export declare const CryptoOption: ({ currencyName, chainId, iconUrl, symbol, price, onClick, isSelected, showInsufficientFundsWarning, disabled }: CryptoOptionProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
export {};
|
|
14
14
|
//# sourceMappingURL=CryptoOption.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CryptoOption.d.ts","sourceRoot":"","sources":["../../../src/components/CryptoOption.tsx"],"names":[],"mappings":"AAIA,UAAU,iBAAiB;IACzB,YAAY,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,UAAU,EAAE,OAAO,CAAA;IACnB,QAAQ,EAAE,OAAO,CAAA;IACjB,
|
|
1
|
+
{"version":3,"file":"CryptoOption.d.ts","sourceRoot":"","sources":["../../../src/components/CryptoOption.tsx"],"names":[],"mappings":"AAIA,UAAU,iBAAiB;IACzB,YAAY,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,UAAU,EAAE,OAAO,CAAA;IACnB,QAAQ,EAAE,OAAO,CAAA;IACjB,4BAA4B,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CACnD;AAED,eAAO,MAAM,YAAY,GAAI,gHAU1B,iBAAiB,4CAsDnB,CAAA"}
|
|
@@ -4,9 +4,9 @@ exports.CryptoOption = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const design_system_1 = require("@0xsequence/design-system");
|
|
6
6
|
const SelectedIndicator_1 = require("./SelectedIndicator");
|
|
7
|
-
const CryptoOption = ({ currencyName, chainId, iconUrl, symbol, price, onClick, isSelected,
|
|
7
|
+
const CryptoOption = ({ currencyName, chainId, iconUrl, symbol, price, onClick, isSelected, showInsufficientFundsWarning = undefined, disabled }) => {
|
|
8
8
|
const onClickCard = () => {
|
|
9
|
-
if (!
|
|
9
|
+
if (!showInsufficientFundsWarning && !disabled) {
|
|
10
10
|
onClick();
|
|
11
11
|
}
|
|
12
12
|
};
|
|
@@ -16,7 +16,7 @@ const CryptoOption = ({ currencyName, chainId, iconUrl, symbol, price, onClick,
|
|
|
16
16
|
}, children: currencyName }), (0, jsx_runtime_1.jsx)(design_system_1.Text, { className: "whitespace-nowrap", variant: "normal", color: "muted", ellipsis: true, style: {
|
|
17
17
|
overflow: 'hidden',
|
|
18
18
|
width: '215px'
|
|
19
|
-
}, children: `${price} ${symbol}` })] })] }), (0, jsx_runtime_1.
|
|
19
|
+
}, children: `${price} ${symbol}` })] })] }), (0, jsx_runtime_1.jsx)("div", { className: "flex flex-row justify-center items-center gap-3", children: showInsufficientFundsWarning ? ((0, jsx_runtime_1.jsx)("div", { className: "flex flex-col text-center justify-between items-end", children: (0, jsx_runtime_1.jsx)(design_system_1.Text, { variant: "small", color: "negative", children: "Insufficient funds" }) })) : ((0, jsx_runtime_1.jsx)(SelectedIndicator_1.SelectedIndicator, { selected: isSelected })) })] }));
|
|
20
20
|
};
|
|
21
21
|
exports.CryptoOption = CryptoOption;
|
|
22
22
|
//# sourceMappingURL=CryptoOption.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CryptoOption.js","sourceRoot":"","sources":["../../../src/components/CryptoOption.tsx"],"names":[],"mappings":";;;;AAAA,6DAAkE;AAElE,2DAAuD;AAchD,MAAM,YAAY,GAAG,CAAC,EAC3B,YAAY,EACZ,OAAO,EACP,OAAO,EACP,MAAM,EACN,KAAK,EACL,OAAO,EACP,UAAU,EACV,
|
|
1
|
+
{"version":3,"file":"CryptoOption.js","sourceRoot":"","sources":["../../../src/components/CryptoOption.tsx"],"names":[],"mappings":";;;;AAAA,6DAAkE;AAElE,2DAAuD;AAchD,MAAM,YAAY,GAAG,CAAC,EAC3B,YAAY,EACZ,OAAO,EACP,OAAO,EACP,MAAM,EACN,KAAK,EACL,OAAO,EACP,UAAU,EACV,4BAA4B,GAAG,SAAS,EACxC,QAAQ,EACU,EAAE,EAAE;IACtB,MAAM,WAAW,GAAG,GAAG,EAAE;QACvB,IAAI,CAAC,4BAA4B,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC/C,OAAO,EAAE,CAAA;QACX,CAAC;IACH,CAAC,CAAA;IAED,OAAO,CACL,wBAAC,oBAAI,IAAC,SAAS,EAAC,gDAAgD,EAAC,OAAO,EAAE,WAAW,aACnF,iCAAK,SAAS,EAAC,qBAAqB,aAClC,gCAAK,SAAS,EAAC,OAAO,YACpB,uBAAC,0BAAU,IAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAC,IAAI,EAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,gBAAgB,SAAG,GACzF,EACN,iCAAK,SAAS,EAAC,+BAA+B,aAC5C,uBAAC,oBAAI,IACH,SAAS,EAAC,mBAAmB,EAC7B,OAAO,EAAC,QAAQ,EAChB,UAAU,EAAC,MAAM,EACjB,KAAK,EAAC,SAAS,EACf,QAAQ,QACR,KAAK,EAAE;oCACL,QAAQ,EAAE,QAAQ;oCAClB,QAAQ,EAAE,OAAO;iCAClB,YAEA,YAAY,GACR,EACP,uBAAC,oBAAI,IACH,SAAS,EAAC,mBAAmB,EAC7B,OAAO,EAAC,QAAQ,EAChB,KAAK,EAAC,OAAO,EACb,QAAQ,QACR,KAAK,EAAE;oCACL,QAAQ,EAAE,QAAQ;oCAClB,KAAK,EAAE,OAAO;iCACf,YAEA,GAAG,KAAK,IAAI,MAAM,EAAE,GAChB,IACH,IACF,EACN,gCAAK,SAAS,EAAC,iDAAiD,YAC7D,4BAA4B,CAAC,CAAC,CAAC,CAC9B,gCAAK,SAAS,EAAC,qDAAqD,YAClE,uBAAC,oBAAI,IAAC,OAAO,EAAC,OAAO,EAAC,KAAK,EAAC,UAAU,mCAE/B,GACH,CACP,CAAC,CAAC,CAAC,CACF,uBAAC,qCAAiB,IAAC,QAAQ,EAAE,UAAU,GAAI,CAC5C,GACG,IACD,CACR,CAAA;AACH,CAAC,CAAA;AAhEY,QAAA,YAAY,gBAgExB"}
|
|
@@ -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,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"}
|
|
@@ -2,7 +2,33 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useChain = void 0;
|
|
4
4
|
const wagmi_1 = require("wagmi");
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Hook for retrieving chain configuration information from wagmi's chain configurations
|
|
7
|
+
*
|
|
8
|
+
* This hook provides functionality to:
|
|
9
|
+
* - Get the configuration for the currently connected chain
|
|
10
|
+
* - Get the configuration for a specific chain by ID
|
|
11
|
+
* - Access chain-specific details like name, network configuration, RPC URLs, and block explorers
|
|
12
|
+
*
|
|
13
|
+
* The hook is commonly used in conjunction with other Sequence hooks to access chain-specific
|
|
14
|
+
* information when working with transactions, indexer clients, or network-specific features.
|
|
15
|
+
*
|
|
16
|
+
* @see {@link https://docs.sequence.xyz/sdk/web/hooks/useChain} for more detailed documentation.
|
|
17
|
+
*
|
|
18
|
+
* @param chainId - Optional chain ID to get configuration for a specific chain. If not provided, returns the current chain's configuration.
|
|
19
|
+
* @returns Chain configuration object for the specified or current chain, or undefined if not found
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```tsx
|
|
23
|
+
* // Get current chain configuration
|
|
24
|
+
* const currentChain = useChain();
|
|
25
|
+
* console.log('Current chain name:', currentChain?.name);
|
|
26
|
+
*
|
|
27
|
+
* // Get configuration for a specific chain
|
|
28
|
+
* const ethereumChain = useChain(1); // Ethereum Mainnet
|
|
29
|
+
* console.log('Ethereum chain details:', ethereumChain);
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
6
32
|
const useChain = (chainId) => {
|
|
7
33
|
const chains = (0, wagmi_1.useChains)();
|
|
8
34
|
const currentChainId = (0, wagmi_1.useChainId)();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useChain.js","sourceRoot":"","sources":["../../../src/hooks/useChain.ts"],"names":[],"mappings":";;;AAAA,iCAA6C;
|
|
1
|
+
{"version":3,"file":"useChain.js","sourceRoot":"","sources":["../../../src/hooks/useChain.ts"],"names":[],"mappings":";;;AAAA,iCAA6C;AAG7C;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACI,MAAM,QAAQ,GAAG,CAAC,OAAgB,EAAqB,EAAE;IAC9D,MAAM,MAAM,GAAG,IAAA,iBAAS,GAAE,CAAA;IAC1B,MAAM,cAAc,GAAG,IAAA,kBAAU,GAAE,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;AALY,QAAA,QAAQ,YAKpB"}
|
|
@@ -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"}
|
|
@@ -3,6 +3,47 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.useCheckWaasFeeOptions = useCheckWaasFeeOptions;
|
|
5
5
|
const wagmi_1 = require("wagmi");
|
|
6
|
+
/**
|
|
7
|
+
* Hook for checking transaction fee options in Sequence WaaS (Wallet as a Service)
|
|
8
|
+
*
|
|
9
|
+
* This hook provides functionality to:
|
|
10
|
+
* - Check if a transaction will be sponsored
|
|
11
|
+
* - Get available fee options for unsponsored transactions
|
|
12
|
+
* - Retrieve fee quotes for transactions
|
|
13
|
+
*
|
|
14
|
+
* The hook is commonly used in conjunction with `useWaasFeeOptions` to handle fee payments
|
|
15
|
+
* for unsponsored transactions. It's particularly useful in
|
|
16
|
+
* wallet interfaces and transaction confirmation flows.
|
|
17
|
+
*
|
|
18
|
+
* @see {@link https://docs.sequence.xyz/sdk/web/hooks/useCheckWaasFeeOptions} for more detailed documentation.
|
|
19
|
+
*
|
|
20
|
+
* @returns A function that accepts transaction details and returns fee information
|
|
21
|
+
* @returns.feeQuote - The fee quote for the transaction if available
|
|
22
|
+
* @returns.feeOptions - Available fee payment options if the transaction is not sponsored
|
|
23
|
+
* @returns.isSponsored - Whether the transaction is sponsored (true) or requires fee payment (false)
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```tsx
|
|
27
|
+
* import { useCheckWaasFeeOptions } from '@0xsequence/connect'
|
|
28
|
+
*
|
|
29
|
+
* const YourComponent = () => {
|
|
30
|
+
* const checkFeeOptions = useCheckWaasFeeOptions()
|
|
31
|
+
*
|
|
32
|
+
* const handleTransaction = async () => {
|
|
33
|
+
* const { isSponsored, feeOptions, feeQuote } = await checkFeeOptions({
|
|
34
|
+
* transactions: [transaction],
|
|
35
|
+
* chainId: 1 // Ethereum Mainnet
|
|
36
|
+
* })
|
|
37
|
+
*
|
|
38
|
+
* if (!isSponsored && feeOptions) {
|
|
39
|
+
* // Handle fee options for unsponsored transaction
|
|
40
|
+
* console.log('Available fee options:', feeOptions)
|
|
41
|
+
* console.log('Fee quote:', feeQuote)
|
|
42
|
+
* }
|
|
43
|
+
* }
|
|
44
|
+
* }
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
6
47
|
function useCheckWaasFeeOptions() {
|
|
7
48
|
const connections = (0, wagmi_1.useConnections)();
|
|
8
49
|
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;;
|
|
1
|
+
{"version":3,"file":"useCheckWaasFeeOptions.js","sourceRoot":"","sources":["../../../src/hooks/useCheckWaasFeeOptions.ts"],"names":[],"mappings":";AAAA,YAAY,CAAA;;AA8CZ,wDA4BC;AAvED,iCAAsC;AAEtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,SAAgB,sBAAsB;IAKpC,MAAM,WAAW,GAAG,IAAA,sBAAc,GAAE,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"}
|
|
@@ -2,6 +2,38 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useDirectEcosystemConnect = void 0;
|
|
4
4
|
const wagmi_1 = require("wagmi");
|
|
5
|
+
/**
|
|
6
|
+
* Hook to directly connect to an ecosystem wallet with email
|
|
7
|
+
*
|
|
8
|
+
* @returns A function that triggers the ecosystem wallet connection
|
|
9
|
+
* @throws {Error} If the ecosystem wallet connector is not found among available connectors
|
|
10
|
+
*
|
|
11
|
+
* The returned function accepts:
|
|
12
|
+
* - `auxData` (optional) - Additional data to pass to the ecosystem connector during connection
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```tsx
|
|
16
|
+
* const triggerConnect = useDirectEcosystemConnect()
|
|
17
|
+
*
|
|
18
|
+
* // Connect without auxiliary data
|
|
19
|
+
* await triggerConnect()
|
|
20
|
+
*
|
|
21
|
+
* // Connect with auxiliary data
|
|
22
|
+
* await triggerConnect({
|
|
23
|
+
* someKey: 'someValue',
|
|
24
|
+
* anotherKey: 123
|
|
25
|
+
* })
|
|
26
|
+
*
|
|
27
|
+
* // Handle connection errors
|
|
28
|
+
* try {
|
|
29
|
+
* await triggerConnect()
|
|
30
|
+
* } catch (error) {
|
|
31
|
+
* if (error.message === 'Ecosystem wallet connector not found') {
|
|
32
|
+
* console.error('Ecosystem wallet is not configured')
|
|
33
|
+
* }
|
|
34
|
+
* }
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
5
37
|
const useDirectEcosystemConnect = () => {
|
|
6
38
|
const { connectors, connect } = (0, wagmi_1.useConnect)();
|
|
7
39
|
const triggerConnect = async (auxData) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDirectEcosystemConnect.js","sourceRoot":"","sources":["../../../src/hooks/useDirectEcosystemConnect.ts"],"names":[],"mappings":";;;AAAA,iCAAkC;
|
|
1
|
+
{"version":3,"file":"useDirectEcosystemConnect.js","sourceRoot":"","sources":["../../../src/hooks/useDirectEcosystemConnect.ts"],"names":[],"mappings":";;;AAAA,iCAAkC;AAIlC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACI,MAAM,yBAAyB,GAAG,GAAG,EAAE;IAC5C,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,IAAA,kBAAU,GAAE,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;AApBY,QAAA,yBAAyB,6BAoBrC"}
|
|
@@ -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
|
*
|
|
@@ -8,7 +8,7 @@ const ConnectModal_1 = require("../contexts/ConnectModal");
|
|
|
8
8
|
* This hook provides a method to open and close the connect modal, and access its current open state.
|
|
9
9
|
* The Connect modal provides various wallet connection options including Sequence wallet and external wallets.
|
|
10
10
|
*
|
|
11
|
-
*
|
|
11
|
+
* @see {@link https://docs.sequence.xyz/sdk/web/hooks/useOpenConnectModal} for more detailed documentation.
|
|
12
12
|
*
|
|
13
13
|
* @returns An object containing function to control the Connect modal and its state {@link UseOpenConnectModalReturnType}
|
|
14
14
|
*
|
|
@@ -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"}
|
|
@@ -2,6 +2,23 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useProjectAccessKey = void 0;
|
|
4
4
|
const ConnectConfig_js_1 = require("../contexts/ConnectConfig.js");
|
|
5
|
+
/**
|
|
6
|
+
* Hook to access the project access key from the Sequence Connect configuration.
|
|
7
|
+
*
|
|
8
|
+
* The project access key is a required configuration parameter used to authenticate and
|
|
9
|
+
* identify your application with Sequence services. It is used across various SDK features
|
|
10
|
+
* including marketplace integration and wallet connections.
|
|
11
|
+
*
|
|
12
|
+
* @see {@link https://docs.sequence.xyz/sdk/web/hooks/useProjectAccessKey} for more detailed documentation.
|
|
13
|
+
*
|
|
14
|
+
* @returns {string} The project access key configured for the application
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* const projectAccessKey = useProjectAccessKey()
|
|
19
|
+
* const marketplaceClient = new MarketplaceIndexer(apiUrl, projectAccessKey)
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
5
22
|
const useProjectAccessKey = () => {
|
|
6
23
|
const { projectAccessKey } = (0, ConnectConfig_js_1.useConnectConfigContext)();
|
|
7
24
|
return projectAccessKey;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useProjectAccessKey.js","sourceRoot":"","sources":["../../../src/hooks/useProjectAccessKey.ts"],"names":[],"mappings":";;;AAAA,mEAAsE;
|
|
1
|
+
{"version":3,"file":"useProjectAccessKey.js","sourceRoot":"","sources":["../../../src/hooks/useProjectAccessKey.ts"],"names":[],"mappings":";;;AAAA,mEAAsE;AAEtE;;;;;;;;;;;;;;;;GAgBG;AACI,MAAM,mBAAmB,GAAG,GAAG,EAAE;IACtC,MAAM,EAAE,gBAAgB,EAAE,GAAG,IAAA,0CAAuB,GAAE,CAAA;IAEtD,OAAO,gBAAgB,CAAA;AACzB,CAAC,CAAA;AAJY,QAAA,mBAAmB,uBAI/B"}
|
|
@@ -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"}
|
|
@@ -5,6 +5,26 @@ exports.useSignInEmail = void 0;
|
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const wagmi_1 = require("wagmi");
|
|
7
7
|
const localStorage_1 = require("../constants/localStorage");
|
|
8
|
+
/**
|
|
9
|
+
* Hook to retrieve the email address associated with the currently connected wallet.
|
|
10
|
+
*
|
|
11
|
+
* This hook monitors the connection status and retrieves the stored email address when a wallet
|
|
12
|
+
* is connected. It works with both WaaS (Wallet-as-a-Service) and universal wallet types.
|
|
13
|
+
* The email is cleared when the wallet is disconnected.
|
|
14
|
+
*
|
|
15
|
+
* @see {@link https://docs.sequence.xyz/sdk/web/hooks/useSignInEmail} for more detailed documentation.
|
|
16
|
+
*
|
|
17
|
+
* @returns {string | null} The email address of the connected wallet user, or null if not connected
|
|
18
|
+
* or no email is associated
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* const email = useSignInEmail()
|
|
23
|
+
* if (email) {
|
|
24
|
+
* console.log('Connected user email:', email)
|
|
25
|
+
* }
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
8
28
|
const useSignInEmail = () => {
|
|
9
29
|
const { storage } = (0, wagmi_1.useConfig)();
|
|
10
30
|
const { isConnected } = (0, wagmi_1.useAccount)();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSignInEmail.js","sourceRoot":"","sources":["../../../src/hooks/useSignInEmail.ts"],"names":[],"mappings":";AAAA,YAAY,CAAA;;;AAEZ,iCAA2C;AAC3C,iCAA6C;AAE7C,4DAA2D;
|
|
1
|
+
{"version":3,"file":"useSignInEmail.js","sourceRoot":"","sources":["../../../src/hooks/useSignInEmail.ts"],"names":[],"mappings":";AAAA,YAAY,CAAA;;;AAEZ,iCAA2C;AAC3C,iCAA6C;AAE7C,4DAA2D;AAE3D;;;;;;;;;;;;;;;;;;;GAmBG;AACI,MAAM,cAAc,GAAG,GAAG,EAAE;IACjC,MAAM,EAAE,OAAO,EAAE,GAAG,IAAA,iBAAS,GAAE,CAAA;IAC/B,MAAM,EAAE,WAAW,EAAE,GAAG,IAAA,kBAAU,GAAE,CAAA;IACpC,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAAgB,IAAI,CAAC,CAAA;IAEvD,MAAM,UAAU,GAAG,KAAK,IAAI,EAAE;QAC5B,MAAM,WAAW,GAAG,MAAM,OAAO,EAAE,OAAO,CAAC,8BAAe,CAAC,eAAe,CAAC,CAAA;QAE3E,QAAQ,CAAC,WAAqB,CAAC,CAAA;IACjC,CAAC,CAAA;IAED,IAAA,iBAAS,EAAC,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;AApBY,QAAA,cAAc,kBAoB1B"}
|
|
@@ -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"}
|
|
@@ -2,6 +2,32 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useTheme = void 0;
|
|
4
4
|
const Theme_1 = require("../contexts/Theme");
|
|
5
|
+
/**
|
|
6
|
+
* Hook to access and modify the theme and modal position settings.
|
|
7
|
+
*
|
|
8
|
+
* This hook provides access to the current theme (light/dark) and modal position settings,
|
|
9
|
+
* along with functions to update these values. The modal position can be set to various
|
|
10
|
+
* predefined positions on the screen.
|
|
11
|
+
*
|
|
12
|
+
* @see {@link https://docs.sequence.xyz/sdk/web/hooks/useTheme} for more detailed documentation.
|
|
13
|
+
*
|
|
14
|
+
* @returns {Object} An object containing:
|
|
15
|
+
* - `theme` - The current theme setting
|
|
16
|
+
* - `setTheme` - Function to update the theme
|
|
17
|
+
* - `position` - The current modal position ('center', 'top-right', 'bottom-left', etc.)
|
|
18
|
+
* - `setPosition` - Function to update the modal position
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* const { theme, setTheme, position, setPosition } = useTheme()
|
|
23
|
+
*
|
|
24
|
+
* // Change theme
|
|
25
|
+
* setTheme('dark')
|
|
26
|
+
*
|
|
27
|
+
* // Update modal position
|
|
28
|
+
* setPosition('top-right')
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
5
31
|
const useTheme = () => {
|
|
6
32
|
const { setTheme, theme, position, setPosition } = (0, Theme_1.useThemeContext)();
|
|
7
33
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTheme.js","sourceRoot":"","sources":["../../../src/hooks/useTheme.ts"],"names":[],"mappings":";;;AAAA,6CAAmD;
|
|
1
|
+
{"version":3,"file":"useTheme.js","sourceRoot":"","sources":["../../../src/hooks/useTheme.ts"],"names":[],"mappings":";;;AAAA,6CAAmD;AAEnD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACI,MAAM,QAAQ,GAAG,GAAG,EAAE;IAC3B,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,IAAA,uBAAe,GAAE,CAAA;IAEpE,OAAO;QACL,QAAQ;QACR,KAAK;QACL,QAAQ;QACR,WAAW;KACZ,CAAA;AACH,CAAC,CAAA;AATY,QAAA,QAAQ,YASpB"}
|
|
@@ -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"}
|