@getpara/react-sdk-lite 2.18.0 → 2.20.0
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/aa/hooks/alchemy.d.ts +15 -0
- package/dist/aa/hooks/alchemy.js +9 -0
- package/dist/aa/hooks/biconomy.d.ts +15 -0
- package/dist/aa/hooks/biconomy.js +9 -0
- package/dist/aa/hooks/cdp.d.ts +14 -0
- package/dist/aa/hooks/cdp.js +9 -0
- package/dist/aa/hooks/gelato.d.ts +14 -0
- package/dist/aa/hooks/gelato.js +9 -0
- package/dist/aa/hooks/pimlico.d.ts +15 -0
- package/dist/aa/hooks/pimlico.js +9 -0
- package/dist/aa/hooks/porto.d.ts +15 -0
- package/dist/aa/hooks/porto.js +9 -0
- package/dist/aa/hooks/rhinestone.d.ts +15 -0
- package/dist/aa/hooks/rhinestone.js +9 -0
- package/dist/aa/hooks/safe.d.ts +15 -0
- package/dist/aa/hooks/safe.js +9 -0
- package/dist/aa/hooks/thirdweb.d.ts +13 -0
- package/dist/aa/hooks/thirdweb.js +9 -0
- package/dist/aa/hooks/zerodev.d.ts +15 -0
- package/dist/aa/hooks/zerodev.js +9 -0
- package/dist/aa/useWagmiSignerEnhancer.d.ts +15 -0
- package/dist/aa/useWagmiSignerEnhancer.js +45 -0
- package/dist/index.d.ts +11 -12
- package/dist/index.js +10 -12
- package/dist/modal/ParaModal.js +1 -1
- package/dist/modal/components/Header/hooks/useStepTitle.d.ts +1 -1
- package/dist/modal/components/OnRampComponents/OnRampProviderButton.js +1 -1
- package/dist/modal/components/QuantityInput.js +1 -0
- package/dist/modal/components/SearchableButtonList.js +20 -11
- package/dist/modal/components/flows/account/AddFunds/AddFundsReceive.js +2 -1
- package/dist/modal/components/flows/account/AddFunds/AddFundsSettings.js +1 -0
- package/dist/modal/components/flows/account/Send/context.js +4 -4
- package/dist/modal/components/flows/account/Wallet/Wallet.js +5 -1
- package/dist/modal/constants/walletTypeConfig.js +2 -1
- package/dist/provider/ParaProviderMin.js +46 -54
- package/dist/provider/actions/index.d.ts +2 -34
- package/dist/provider/actions/index.js +43 -34
- package/dist/provider/hooks/mutations/index.d.ts +2 -29
- package/dist/provider/hooks/mutations/index.js +3 -58
- package/dist/provider/hooks/mutations/useAddAuthMethod.d.ts +2 -2
- package/dist/provider/hooks/mutations/useExportPrivateKey.d.ts +24 -4
- package/dist/provider/hooks/mutations/useExportPrivateKey.js +7 -2
- package/dist/provider/hooks/mutations/useSwitchWallets.d.ts +2 -2
- package/dist/provider/hooks/mutations/useVerifyNewAccount.d.ts +2 -2
- package/dist/provider/hooks/queries/index.d.ts +2 -2
- package/dist/provider/hooks/queries/index.js +2 -3
- package/dist/provider/hooks/queries/useAccount.d.ts +14 -69
- package/dist/provider/hooks/queries/useAccount.js +30 -136
- package/dist/provider/hooks/queries/useParaStatus.d.ts +7 -11
- package/dist/provider/hooks/queries/useParaStatus.js +9 -16
- package/dist/provider/hooks/queries/useProfileBalance.js +1 -1
- package/dist/provider/hooks/utils/useAutoSessionKeepAlive.js +14 -10
- package/dist/provider/hooks/utils/useEventListeners.js +1 -1
- package/dist/provider/hooks/utils/useWalletState.d.ts +1 -1
- package/dist/provider/index.d.ts +1 -0
- package/dist/provider/stores/getters.d.ts +1 -1
- package/dist/provider/utils/renameMutations.d.ts +4 -2
- package/package.json +19 -18
- package/dist/aa/alchemy/hook.d.ts +0 -16708
- package/dist/aa/alchemy/hook.js +0 -26
- package/dist/aa/biconomy/hook.d.ts +0 -44
- package/dist/aa/biconomy/hook.js +0 -26
- package/dist/aa/cdp/hook.d.ts +0 -11
- package/dist/aa/cdp/hook.js +0 -26
- package/dist/aa/createSmartAccountHook.d.ts +0 -13
- package/dist/aa/createSmartAccountHook.js +0 -81
- package/dist/aa/gelato/hook.d.ts +0 -11
- package/dist/aa/gelato/hook.js +0 -26
- package/dist/aa/pimlico/hook.d.ts +0 -838
- package/dist/aa/pimlico/hook.js +0 -26
- package/dist/aa/porto/hook.d.ts +0 -12
- package/dist/aa/porto/hook.js +0 -26
- package/dist/aa/rhinestone/hook.d.ts +0 -12
- package/dist/aa/rhinestone/hook.js +0 -26
- package/dist/aa/safe/hook.d.ts +0 -12
- package/dist/aa/safe/hook.js +0 -26
- package/dist/aa/thirdweb/hook.d.ts +0 -12
- package/dist/aa/thirdweb/hook.js +0 -26
- package/dist/aa/types.d.ts +0 -21
- package/dist/aa/types.js +0 -1
- package/dist/aa/zerodev/hook.d.ts +0 -12
- package/dist/aa/zerodev/hook.js +0 -26
- package/dist/modal/components/flows/account/AddFunds/MoonPayEmbed.d.ts +0 -2
- package/dist/modal/components/flows/account/AddFunds/MoonPayEmbed.js +0 -7
- package/dist/provider/actions/getEmbeddedAccount.d.ts +0 -27
- package/dist/provider/actions/getEmbeddedAccount.js +0 -66
- package/dist/provider/actions/getWallet.d.ts +0 -5
- package/dist/provider/actions/getWallet.js +0 -18
- package/dist/provider/hooks/mutations/useAuthenticateWithEmailOrPhone.d.ts +0 -34
- package/dist/provider/hooks/mutations/useAuthenticateWithEmailOrPhone.js +0 -28
- package/dist/provider/hooks/mutations/useAuthenticateWithOAuth.d.ts +0 -34
- package/dist/provider/hooks/mutations/useAuthenticateWithOAuth.js +0 -28
- package/dist/provider/hooks/mutations/useClaimPregenWallets.d.ts +0 -34
- package/dist/provider/hooks/mutations/useClaimPregenWallets.js +0 -31
- package/dist/provider/hooks/mutations/useCreateGuestWallets.d.ts +0 -34
- package/dist/provider/hooks/mutations/useCreateGuestWallets.js +0 -31
- package/dist/provider/hooks/mutations/useCreatePregenWallet.d.ts +0 -34
- package/dist/provider/hooks/mutations/useCreatePregenWallet.js +0 -31
- package/dist/provider/hooks/mutations/useCreatePregenWalletPerType.d.ts +0 -34
- package/dist/provider/hooks/mutations/useCreatePregenWalletPerType.js +0 -28
- package/dist/provider/hooks/mutations/useCreateWallet.d.ts +0 -34
- package/dist/provider/hooks/mutations/useCreateWallet.js +0 -31
- package/dist/provider/hooks/mutations/useCreateWalletPerType.d.ts +0 -34
- package/dist/provider/hooks/mutations/useCreateWalletPerType.js +0 -28
- package/dist/provider/hooks/mutations/useEnable2fa.d.ts +0 -34
- package/dist/provider/hooks/mutations/useEnable2fa.js +0 -28
- package/dist/provider/hooks/mutations/useHasPregenWallet.d.ts +0 -34
- package/dist/provider/hooks/mutations/useHasPregenWallet.js +0 -28
- package/dist/provider/hooks/mutations/useIssueJwt.d.ts +0 -34
- package/dist/provider/hooks/mutations/useIssueJwt.js +0 -28
- package/dist/provider/hooks/mutations/useKeepSessionAlive.d.ts +0 -33
- package/dist/provider/hooks/mutations/useKeepSessionAlive.js +0 -28
- package/dist/provider/hooks/mutations/useLoginExternalWallet.d.ts +0 -34
- package/dist/provider/hooks/mutations/useLoginExternalWallet.js +0 -31
- package/dist/provider/hooks/mutations/useLogout.d.ts +0 -34
- package/dist/provider/hooks/mutations/useLogout.js +0 -28
- package/dist/provider/hooks/mutations/useResendVerificationCode.d.ts +0 -34
- package/dist/provider/hooks/mutations/useResendVerificationCode.js +0 -31
- package/dist/provider/hooks/mutations/useSetup2fa.d.ts +0 -34
- package/dist/provider/hooks/mutations/useSetup2fa.js +0 -28
- package/dist/provider/hooks/mutations/useSignMessage.d.ts +0 -34
- package/dist/provider/hooks/mutations/useSignMessage.js +0 -28
- package/dist/provider/hooks/mutations/useSignTransaction.d.ts +0 -34
- package/dist/provider/hooks/mutations/useSignTransaction.js +0 -31
- package/dist/provider/hooks/mutations/useSignUpOrLogIn.d.ts +0 -34
- package/dist/provider/hooks/mutations/useSignUpOrLogIn.js +0 -31
- package/dist/provider/hooks/mutations/useUpdatePregenWalletIdentifier.d.ts +0 -34
- package/dist/provider/hooks/mutations/useUpdatePregenWalletIdentifier.js +0 -31
- package/dist/provider/hooks/mutations/useVerify2fa.d.ts +0 -34
- package/dist/provider/hooks/mutations/useVerify2fa.js +0 -28
- package/dist/provider/hooks/mutations/useVerifyExternalWallet.d.ts +0 -34
- package/dist/provider/hooks/mutations/useVerifyExternalWallet.js +0 -31
- package/dist/provider/hooks/mutations/useVerifyFarcaster.d.ts +0 -34
- package/dist/provider/hooks/mutations/useVerifyFarcaster.js +0 -31
- package/dist/provider/hooks/mutations/useVerifyOAuth.d.ts +0 -34
- package/dist/provider/hooks/mutations/useVerifyOAuth.js +0 -28
- package/dist/provider/hooks/mutations/useVerifyTelegram.d.ts +0 -34
- package/dist/provider/hooks/mutations/useVerifyTelegram.js +0 -28
- package/dist/provider/hooks/mutations/useWaitForLogin.d.ts +0 -34
- package/dist/provider/hooks/mutations/useWaitForLogin.js +0 -31
- package/dist/provider/hooks/mutations/useWaitForSignup.d.ts +0 -34
- package/dist/provider/hooks/mutations/useWaitForSignup.js +0 -28
- package/dist/provider/hooks/mutations/useWaitForWalletCreation.d.ts +0 -34
- package/dist/provider/hooks/mutations/useWaitForWalletCreation.js +0 -28
- package/dist/provider/hooks/queries/useIsFullyLoggedIn.d.ts +0 -8
- package/dist/provider/hooks/queries/useIsFullyLoggedIn.js +0 -29
- package/dist/provider/hooks/queries/useWallet.d.ts +0 -5
- package/dist/provider/hooks/queries/useWallet.js +0 -26
package/dist/aa/pimlico/hook.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
__async
|
|
4
|
-
} from "../../chunk-MMUBH76A.js";
|
|
5
|
-
import { createSmartAccountHook } from "../createSmartAccountHook.js";
|
|
6
|
-
const PIMLICO_SMART_ACCOUNT_BASE_KEY = "PARA_PIMLICO_SMART_ACCOUNT";
|
|
7
|
-
const usePimlicoSmartAccount = createSmartAccountHook({
|
|
8
|
-
queryKeyBase: PIMLICO_SMART_ACCOUNT_BASE_KEY,
|
|
9
|
-
getQueryKey: (p) => {
|
|
10
|
-
var _a;
|
|
11
|
-
return [p.apiKey, (_a = p.chain) == null ? void 0 : _a.id, p.rpcUrl, p.mode];
|
|
12
|
-
},
|
|
13
|
-
createClient: (params) => __async(void 0, null, function* () {
|
|
14
|
-
let mod;
|
|
15
|
-
try {
|
|
16
|
-
mod = yield import("@getpara/aa-pimlico");
|
|
17
|
-
} catch (e) {
|
|
18
|
-
throw new Error("[@getpara/react-sdk-lite] Please install @getpara/aa-pimlico to use usePimlicoSmartAccount");
|
|
19
|
-
}
|
|
20
|
-
return mod.createPimlicoSmartAccount(params);
|
|
21
|
-
})
|
|
22
|
-
});
|
|
23
|
-
export {
|
|
24
|
-
PIMLICO_SMART_ACCOUNT_BASE_KEY,
|
|
25
|
-
usePimlicoSmartAccount
|
|
26
|
-
};
|
package/dist/aa/porto/hook.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export declare const PORTO_ACCOUNT_BASE_KEY = "PARA_PORTO_ACCOUNT";
|
|
2
|
-
/**
|
|
3
|
-
* React hook to create and manage a Porto smart account.
|
|
4
|
-
*
|
|
5
|
-
* Porto operates in EIP-7702 mode only. No API key required — Porto uses its own relay RPC.
|
|
6
|
-
* On testnets, Porto's relay sponsors gas by default. For mainnet, pass `merchantUrl`.
|
|
7
|
-
*
|
|
8
|
-
* Requires `@getpara/aa-porto` to be installed.
|
|
9
|
-
*/
|
|
10
|
-
export declare const usePortoSmartAccount: (params?: import("@getpara/aa-porto").PortoAccountConfig & {
|
|
11
|
-
enabled?: boolean;
|
|
12
|
-
}) => import("../types.js").UseSmartAccountResult<import("@getpara/viem-v2-integration/aa").SmartAccount7702<any>>;
|
package/dist/aa/porto/hook.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
__async
|
|
4
|
-
} from "../../chunk-MMUBH76A.js";
|
|
5
|
-
import { createSmartAccountHook } from "../createSmartAccountHook.js";
|
|
6
|
-
const PORTO_ACCOUNT_BASE_KEY = "PARA_PORTO_ACCOUNT";
|
|
7
|
-
const usePortoSmartAccount = createSmartAccountHook({
|
|
8
|
-
queryKeyBase: PORTO_ACCOUNT_BASE_KEY,
|
|
9
|
-
getQueryKey: (params) => {
|
|
10
|
-
var _a;
|
|
11
|
-
return [(_a = params.chain) == null ? void 0 : _a.id, params.merchantUrl];
|
|
12
|
-
},
|
|
13
|
-
createClient: (params) => __async(void 0, null, function* () {
|
|
14
|
-
let mod;
|
|
15
|
-
try {
|
|
16
|
-
mod = yield import("@getpara/aa-porto");
|
|
17
|
-
} catch (e) {
|
|
18
|
-
throw new Error("[@getpara/react-sdk-lite] Please install @getpara/aa-porto to use usePortoSmartAccount");
|
|
19
|
-
}
|
|
20
|
-
return mod.createPortoSmartAccount(params);
|
|
21
|
-
})
|
|
22
|
-
});
|
|
23
|
-
export {
|
|
24
|
-
PORTO_ACCOUNT_BASE_KEY,
|
|
25
|
-
usePortoSmartAccount
|
|
26
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export declare const RHINESTONE_SMART_ACCOUNT_BASE_KEY = "PARA_RHINESTONE_SMART_ACCOUNT";
|
|
2
|
-
/**
|
|
3
|
-
* React hook to create and manage a Rhinestone smart account.
|
|
4
|
-
*
|
|
5
|
-
* Rhinestone operates in EIP-4337 mode only. Uses Rhinestone's orchestrator
|
|
6
|
-
* with Pimlico's bundler infrastructure.
|
|
7
|
-
*
|
|
8
|
-
* Requires `@getpara/aa-rhinestone` to be installed.
|
|
9
|
-
*/
|
|
10
|
-
export declare const useRhinestoneSmartAccount: (params?: import("@getpara/aa-rhinestone").RhinestoneSmartAccountConfig & {
|
|
11
|
-
enabled?: boolean;
|
|
12
|
-
}) => import("../types.js").UseSmartAccountResult<import("@getpara/viem-v2-integration/aa").SmartAccount4337<any>>;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
__async
|
|
4
|
-
} from "../../chunk-MMUBH76A.js";
|
|
5
|
-
import { createSmartAccountHook } from "../createSmartAccountHook.js";
|
|
6
|
-
const RHINESTONE_SMART_ACCOUNT_BASE_KEY = "PARA_RHINESTONE_SMART_ACCOUNT";
|
|
7
|
-
const useRhinestoneSmartAccount = createSmartAccountHook({
|
|
8
|
-
queryKeyBase: RHINESTONE_SMART_ACCOUNT_BASE_KEY,
|
|
9
|
-
getQueryKey: (p) => {
|
|
10
|
-
var _a;
|
|
11
|
-
return [(_a = p.chain) == null ? void 0 : _a.id, p.rpcUrl, p.rhinestoneApiKey, p.pimlicoApiKey];
|
|
12
|
-
},
|
|
13
|
-
createClient: (params) => __async(void 0, null, function* () {
|
|
14
|
-
let mod;
|
|
15
|
-
try {
|
|
16
|
-
mod = yield import("@getpara/aa-rhinestone");
|
|
17
|
-
} catch (e) {
|
|
18
|
-
throw new Error("[@getpara/react-sdk-lite] Please install @getpara/aa-rhinestone to use useRhinestoneSmartAccount");
|
|
19
|
-
}
|
|
20
|
-
return mod.createRhinestoneSmartAccount(params);
|
|
21
|
-
})
|
|
22
|
-
});
|
|
23
|
-
export {
|
|
24
|
-
RHINESTONE_SMART_ACCOUNT_BASE_KEY,
|
|
25
|
-
useRhinestoneSmartAccount
|
|
26
|
-
};
|
package/dist/aa/safe/hook.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export declare const SAFE_SMART_ACCOUNT_BASE_KEY = "PARA_SAFE_SMART_ACCOUNT";
|
|
2
|
-
/**
|
|
3
|
-
* React hook to create and manage a Safe smart account.
|
|
4
|
-
*
|
|
5
|
-
* Safe operates in EIP-4337 mode only. Uses permissionless's Safe implementation
|
|
6
|
-
* with Pimlico's bundler and paymaster infrastructure.
|
|
7
|
-
*
|
|
8
|
-
* Requires `@getpara/aa-safe` to be installed.
|
|
9
|
-
*/
|
|
10
|
-
export declare const useSafeSmartAccount: (params?: import("@getpara/aa-safe").SafeSmartAccountConfig & {
|
|
11
|
-
enabled?: boolean;
|
|
12
|
-
}) => import("../types.js").UseSmartAccountResult<import("@getpara/viem-v2-integration/aa").SmartAccount4337<import("permissionless").SmartAccountClient>>;
|
package/dist/aa/safe/hook.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
__async
|
|
4
|
-
} from "../../chunk-MMUBH76A.js";
|
|
5
|
-
import { createSmartAccountHook } from "../createSmartAccountHook.js";
|
|
6
|
-
const SAFE_SMART_ACCOUNT_BASE_KEY = "PARA_SAFE_SMART_ACCOUNT";
|
|
7
|
-
const useSafeSmartAccount = createSmartAccountHook({
|
|
8
|
-
queryKeyBase: SAFE_SMART_ACCOUNT_BASE_KEY,
|
|
9
|
-
getQueryKey: (p) => {
|
|
10
|
-
var _a, _b;
|
|
11
|
-
return [p.pimlicoApiKey, (_a = p.chain) == null ? void 0 : _a.id, p.rpcUrl, p.safeVersion, (_b = p.saltNonce) == null ? void 0 : _b.toString()];
|
|
12
|
-
},
|
|
13
|
-
createClient: (params) => __async(void 0, null, function* () {
|
|
14
|
-
let mod;
|
|
15
|
-
try {
|
|
16
|
-
mod = yield import("@getpara/aa-safe");
|
|
17
|
-
} catch (e) {
|
|
18
|
-
throw new Error("[@getpara/react-sdk-lite] Please install @getpara/aa-safe to use useSafeSmartAccount");
|
|
19
|
-
}
|
|
20
|
-
return mod.createSafeSmartAccount(params);
|
|
21
|
-
})
|
|
22
|
-
});
|
|
23
|
-
export {
|
|
24
|
-
SAFE_SMART_ACCOUNT_BASE_KEY,
|
|
25
|
-
useSafeSmartAccount
|
|
26
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export declare const THIRDWEB_SMART_ACCOUNT_BASE_KEY = "PARA_THIRDWEB_SMART_ACCOUNT";
|
|
2
|
-
/**
|
|
3
|
-
* React hook to create and manage a Thirdweb smart account.
|
|
4
|
-
*
|
|
5
|
-
* Supports both EIP-4337 and EIP-7702 modes. Uses Thirdweb's smart wallet
|
|
6
|
-
* infrastructure with optional gas sponsorship.
|
|
7
|
-
*
|
|
8
|
-
* Requires `@getpara/aa-thirdweb` to be installed.
|
|
9
|
-
*/
|
|
10
|
-
export declare const useThirdwebSmartAccount: (params?: import("@getpara/aa-thirdweb").ThirdwebSmartAccountConfig & {
|
|
11
|
-
enabled?: boolean;
|
|
12
|
-
}) => import("../types.js").UseSmartAccountResult<NonNullable<import("@getpara/viem-v2-integration/aa").SmartAccount4337<import("thirdweb/wallets").Account> | import("@getpara/viem-v2-integration/aa").SmartAccount7702<import("thirdweb/wallets").Account> | null>>;
|
package/dist/aa/thirdweb/hook.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
__async
|
|
4
|
-
} from "../../chunk-MMUBH76A.js";
|
|
5
|
-
import { createSmartAccountHook } from "../createSmartAccountHook.js";
|
|
6
|
-
const THIRDWEB_SMART_ACCOUNT_BASE_KEY = "PARA_THIRDWEB_SMART_ACCOUNT";
|
|
7
|
-
const useThirdwebSmartAccount = createSmartAccountHook({
|
|
8
|
-
queryKeyBase: THIRDWEB_SMART_ACCOUNT_BASE_KEY,
|
|
9
|
-
getQueryKey: (p) => {
|
|
10
|
-
var _a;
|
|
11
|
-
return [p.clientId, (_a = p.chain) == null ? void 0 : _a.id, p.mode, p.sponsorGas, p.factoryAddress, p.accountAddress];
|
|
12
|
-
},
|
|
13
|
-
createClient: (params) => __async(void 0, null, function* () {
|
|
14
|
-
let mod;
|
|
15
|
-
try {
|
|
16
|
-
mod = yield import("@getpara/aa-thirdweb");
|
|
17
|
-
} catch (e) {
|
|
18
|
-
throw new Error("[@getpara/react-sdk-lite] Please install @getpara/aa-thirdweb to use useThirdwebSmartAccount");
|
|
19
|
-
}
|
|
20
|
-
return mod.createThirdwebSmartAccount(params);
|
|
21
|
-
})
|
|
22
|
-
});
|
|
23
|
-
export {
|
|
24
|
-
THIRDWEB_SMART_ACCOUNT_BASE_KEY,
|
|
25
|
-
useThirdwebSmartAccount
|
|
26
|
-
};
|
package/dist/aa/types.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type ParaCore from '@getpara/core-sdk';
|
|
2
|
-
import type { Hex } from 'viem';
|
|
3
|
-
/**
|
|
4
|
-
* Configuration for `createSmartAccountHook` — defines how a provider hook
|
|
5
|
-
* creates its smart account client.
|
|
6
|
-
*/
|
|
7
|
-
export interface SmartAccountHookConfig<TParams, TResult> {
|
|
8
|
-
queryKeyBase: string;
|
|
9
|
-
getQueryKey: (params: TParams) => unknown[];
|
|
10
|
-
createClient: (params: TParams & {
|
|
11
|
-
para: ParaCore;
|
|
12
|
-
address?: Hex;
|
|
13
|
-
}) => Promise<TResult | null>;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Return type of hooks created by `createSmartAccountHook`.
|
|
17
|
-
* Extends React Query's `UseQueryResult` with a convenient `smartAccount` alias.
|
|
18
|
-
*/
|
|
19
|
-
export type UseSmartAccountResult<TResult> = import('@tanstack/react-query').UseQueryResult<TResult | null | undefined, Error> & {
|
|
20
|
-
smartAccount: TResult | null | undefined;
|
|
21
|
-
};
|
package/dist/aa/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export declare const ZERODEV_SMART_ACCOUNT_BASE_KEY = "PARA_ZERODEV_SMART_ACCOUNT";
|
|
2
|
-
/**
|
|
3
|
-
* React hook to create and manage a ZeroDev smart account.
|
|
4
|
-
*
|
|
5
|
-
* Supports both EIP-4337 and EIP-7702 modes. Uses ZeroDev's Kernel account
|
|
6
|
-
* with ECDSA validation and gas sponsorship.
|
|
7
|
-
*
|
|
8
|
-
* Requires `@getpara/aa-zerodev` to be installed.
|
|
9
|
-
*/
|
|
10
|
-
export declare const useZeroDevSmartAccount: (params?: import("@getpara/aa-zerodev").ZeroDevSmartAccountConfig & {
|
|
11
|
-
enabled?: boolean;
|
|
12
|
-
}) => import("../types.js").UseSmartAccountResult<NonNullable<import("@getpara/viem-v2-integration/aa").SmartAccount4337<import("@zerodev/sdk").KernelAccountClient> | import("@getpara/viem-v2-integration/aa").SmartAccount7702<import("@zerodev/sdk").KernelAccountClient> | null>>;
|
package/dist/aa/zerodev/hook.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
__async
|
|
4
|
-
} from "../../chunk-MMUBH76A.js";
|
|
5
|
-
import { createSmartAccountHook } from "../createSmartAccountHook.js";
|
|
6
|
-
const ZERODEV_SMART_ACCOUNT_BASE_KEY = "PARA_ZERODEV_SMART_ACCOUNT";
|
|
7
|
-
const useZeroDevSmartAccount = createSmartAccountHook({
|
|
8
|
-
queryKeyBase: ZERODEV_SMART_ACCOUNT_BASE_KEY,
|
|
9
|
-
getQueryKey: (p) => {
|
|
10
|
-
var _a;
|
|
11
|
-
return [p.projectId, (_a = p.chain) == null ? void 0 : _a.id, p.rpcUrl, p.bundlerUrl, p.paymasterUrl, p.mode];
|
|
12
|
-
},
|
|
13
|
-
createClient: (params) => __async(void 0, null, function* () {
|
|
14
|
-
let mod;
|
|
15
|
-
try {
|
|
16
|
-
mod = yield import("@getpara/aa-zerodev");
|
|
17
|
-
} catch (e) {
|
|
18
|
-
throw new Error("[@getpara/react-sdk-lite] Please install @getpara/aa-zerodev to use useZeroDevSmartAccount");
|
|
19
|
-
}
|
|
20
|
-
return mod.createZeroDevSmartAccount(params);
|
|
21
|
-
})
|
|
22
|
-
});
|
|
23
|
-
export {
|
|
24
|
-
ZERODEV_SMART_ACCOUNT_BASE_KEY,
|
|
25
|
-
useZeroDevSmartAccount
|
|
26
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import ParaWeb, { AuthMethod, PrimaryAuthInfo } from '@getpara/web-sdk';
|
|
2
|
-
type AccountValue = PrimaryAuthInfo & {
|
|
3
|
-
email?: string;
|
|
4
|
-
phone?: `+${number}`;
|
|
5
|
-
farcasterUsername?: string;
|
|
6
|
-
telegramUserId?: string;
|
|
7
|
-
externalWalletAddress?: string;
|
|
8
|
-
wallets: (typeof ParaWeb.prototype)['availableWallets'];
|
|
9
|
-
userId?: string;
|
|
10
|
-
authMethods?: Set<AuthMethod>;
|
|
11
|
-
};
|
|
12
|
-
export type Account = ({
|
|
13
|
-
isConnected: false;
|
|
14
|
-
isGuestMode?: false;
|
|
15
|
-
} & {
|
|
16
|
-
[key in keyof AccountValue]?: undefined;
|
|
17
|
-
}) | ({
|
|
18
|
-
isConnected: true;
|
|
19
|
-
isGuestMode: true;
|
|
20
|
-
} & Pick<AccountValue, 'wallets'> & {
|
|
21
|
-
[key in keyof Omit<AccountValue, 'wallets'>]?: undefined;
|
|
22
|
-
}) | ({
|
|
23
|
-
isConnected: true;
|
|
24
|
-
isGuestMode: false;
|
|
25
|
-
} & AccountValue);
|
|
26
|
-
export declare const getEmbeddedAccount: (para: ParaWeb | undefined, isFullyLoggedIn: boolean | undefined) => Promise<Account>;
|
|
27
|
-
export {};
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
__async
|
|
4
|
-
} from "../../chunk-MMUBH76A.js";
|
|
5
|
-
const getEmbeddedAccount = (para, isFullyLoggedIn) => __async(void 0, null, function* () {
|
|
6
|
-
switch (true) {
|
|
7
|
-
case !para:
|
|
8
|
-
case !(para == null ? void 0 : para.isReady):
|
|
9
|
-
case isFullyLoggedIn === void 0:
|
|
10
|
-
return { isConnected: false };
|
|
11
|
-
}
|
|
12
|
-
if (para.isGuestMode) {
|
|
13
|
-
return {
|
|
14
|
-
isConnected: true,
|
|
15
|
-
isGuestMode: true,
|
|
16
|
-
wallets: para.availableWallets
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
if (!isFullyLoggedIn) {
|
|
20
|
-
return {
|
|
21
|
-
isConnected: false
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
const authInfo = para.authInfo;
|
|
25
|
-
let authMethods;
|
|
26
|
-
try {
|
|
27
|
-
authMethods = yield para.supportedUserAuthMethods();
|
|
28
|
-
} catch (e) {
|
|
29
|
-
authMethods = /* @__PURE__ */ new Set();
|
|
30
|
-
}
|
|
31
|
-
const value = {
|
|
32
|
-
auth: authInfo == null ? void 0 : authInfo.auth,
|
|
33
|
-
authType: authInfo == null ? void 0 : authInfo.authType,
|
|
34
|
-
identifier: authInfo == null ? void 0 : authInfo.identifier,
|
|
35
|
-
userId: para.userId,
|
|
36
|
-
wallets: para.availableWallets,
|
|
37
|
-
isConnected: true,
|
|
38
|
-
isGuestMode: false,
|
|
39
|
-
authMethods
|
|
40
|
-
};
|
|
41
|
-
if (authInfo) {
|
|
42
|
-
switch (authInfo.authType) {
|
|
43
|
-
case "email":
|
|
44
|
-
value.email = authInfo.identifier;
|
|
45
|
-
break;
|
|
46
|
-
case "phone":
|
|
47
|
-
value.phone = authInfo.identifier;
|
|
48
|
-
break;
|
|
49
|
-
case "farcaster":
|
|
50
|
-
value.farcasterUsername = authInfo.identifier;
|
|
51
|
-
break;
|
|
52
|
-
case "telegram":
|
|
53
|
-
value.telegramUserId = authInfo.identifier;
|
|
54
|
-
break;
|
|
55
|
-
case "externalWallet":
|
|
56
|
-
value.externalWalletAddress = authInfo.identifier;
|
|
57
|
-
break;
|
|
58
|
-
default:
|
|
59
|
-
break;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
return value;
|
|
63
|
-
});
|
|
64
|
-
export {
|
|
65
|
-
getEmbeddedAccount
|
|
66
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
__async
|
|
4
|
-
} from "../../chunk-MMUBH76A.js";
|
|
5
|
-
const getWallet = (para, selectedWallet, isConnected) => __async(void 0, null, function* () {
|
|
6
|
-
var _a;
|
|
7
|
-
if (!para) {
|
|
8
|
-
return null;
|
|
9
|
-
}
|
|
10
|
-
const isLoggedIn = isConnected != null ? isConnected : yield para == null ? void 0 : para.isFullyLoggedIn();
|
|
11
|
-
if (!isLoggedIn) {
|
|
12
|
-
return null;
|
|
13
|
-
}
|
|
14
|
-
return (_a = para.findWallet(selectedWallet == null ? void 0 : selectedWallet.id, selectedWallet == null ? void 0 : selectedWallet.type)) != null ? _a : null;
|
|
15
|
-
});
|
|
16
|
-
export {
|
|
17
|
-
getWallet
|
|
18
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { AuthenticateWithEmailOrPhoneParams } from '@getpara/web-sdk';
|
|
2
|
-
export declare const AUTHENTICATE_EMAIL_OR_PHONE_KEY = "AUTHENTICATE_EMAIL_OR_PHONE";
|
|
3
|
-
/**
|
|
4
|
-
* React hook for the `authenticateWithEmailOrPhone` mutation.
|
|
5
|
-
*
|
|
6
|
-
* Returns a mutation result object with all standard fields from `useMutation`, except:
|
|
7
|
-
* - `mutate` and `mutateAsync` are replaced by:
|
|
8
|
-
* - `authenticateWithEmailOrPhone`: function to trigger the mutation (same as `mutate`)
|
|
9
|
-
* - `authenticateWithEmailOrPhoneAsync`: async function to trigger the mutation (same as `mutateAsync`)
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* const { authenticateWithEmailOrPhone, authenticateWithEmailOrPhoneAsync } = useAuthenticateWithEmailOrPhone();
|
|
13
|
-
* authenticateWithEmailOrPhone({ ...params });
|
|
14
|
-
* // or
|
|
15
|
-
* await authenticateWithEmailOrPhoneAsync({ ...params });
|
|
16
|
-
*/
|
|
17
|
-
export declare const useAuthenticateWithEmailOrPhone: () => {
|
|
18
|
-
data: import("@getpara/web-sdk").AuthenticateResponse | undefined;
|
|
19
|
-
variables: AuthenticateWithEmailOrPhoneParams | undefined;
|
|
20
|
-
error: Error | null;
|
|
21
|
-
isError: boolean;
|
|
22
|
-
isIdle: boolean;
|
|
23
|
-
isPending: boolean;
|
|
24
|
-
isSuccess: boolean;
|
|
25
|
-
status: "pending" | "error" | "idle" | "success";
|
|
26
|
-
reset: () => void;
|
|
27
|
-
context: unknown;
|
|
28
|
-
failureCount: number;
|
|
29
|
-
failureReason: Error | null;
|
|
30
|
-
isPaused: boolean;
|
|
31
|
-
submittedAt: number;
|
|
32
|
-
authenticateWithEmailOrPhone: import("@tanstack/react-query").UseMutateFunction<import("@getpara/web-sdk").AuthenticateResponse, Error, AuthenticateWithEmailOrPhoneParams, unknown>;
|
|
33
|
-
authenticateWithEmailOrPhoneAsync: import("@tanstack/react-query").UseMutateAsyncFunction<import("@getpara/web-sdk").AuthenticateResponse, Error, AuthenticateWithEmailOrPhoneParams, unknown>;
|
|
34
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
__async
|
|
4
|
-
} from "../../../chunk-MMUBH76A.js";
|
|
5
|
-
import { useMutation } from "@tanstack/react-query";
|
|
6
|
-
import { useClient } from "../utils/index.js";
|
|
7
|
-
import { renameMutations } from "../../utils/renameMutations.js";
|
|
8
|
-
import { authenticateWithEmailOrPhone } from "../../actions/index.js";
|
|
9
|
-
const AUTHENTICATE_EMAIL_OR_PHONE_KEY = "AUTHENTICATE_EMAIL_OR_PHONE";
|
|
10
|
-
const useAuthenticateWithEmailOrPhone = () => {
|
|
11
|
-
const para = useClient();
|
|
12
|
-
const mutation = useMutation({
|
|
13
|
-
mutationKey: [AUTHENTICATE_EMAIL_OR_PHONE_KEY],
|
|
14
|
-
mutationFn: (params) => __async(void 0, null, function* () {
|
|
15
|
-
try {
|
|
16
|
-
const result = yield authenticateWithEmailOrPhone(para, params);
|
|
17
|
-
return result;
|
|
18
|
-
} catch (error) {
|
|
19
|
-
throw error;
|
|
20
|
-
}
|
|
21
|
-
})
|
|
22
|
-
});
|
|
23
|
-
return renameMutations(mutation, "authenticateWithEmailOrPhone");
|
|
24
|
-
};
|
|
25
|
-
export {
|
|
26
|
-
AUTHENTICATE_EMAIL_OR_PHONE_KEY,
|
|
27
|
-
useAuthenticateWithEmailOrPhone
|
|
28
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { AuthenticateWithOAuthParams } from '@getpara/web-sdk';
|
|
2
|
-
export declare const AUTHENTICATE_OAUTH_KEY = "AUTHENTICATE_OAUTH";
|
|
3
|
-
/**
|
|
4
|
-
* React hook for the `authenticateWithOAuth` mutation.
|
|
5
|
-
*
|
|
6
|
-
* Returns a mutation result object with all standard fields from `useMutation`, except:
|
|
7
|
-
* - `mutate` and `mutateAsync` are replaced by:
|
|
8
|
-
* - `authenticateWithOAuth`: function to trigger the mutation (same as `mutate`)
|
|
9
|
-
* - `authenticateWithOAuthAsync`: async function to trigger the mutation (same as `mutateAsync`)
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* const { authenticateWithOAuth, authenticateWithOAuthAsync } = useAuthenticateWithOAuth();
|
|
13
|
-
* authenticateWithOAuth({ ...params });
|
|
14
|
-
* // or
|
|
15
|
-
* await authenticateWithOAuthAsync({ ...params });
|
|
16
|
-
*/
|
|
17
|
-
export declare const useAuthenticateWithOAuth: () => {
|
|
18
|
-
data: import("@getpara/web-sdk").AuthenticateResponse | undefined;
|
|
19
|
-
variables: AuthenticateWithOAuthParams | undefined;
|
|
20
|
-
error: Error | null;
|
|
21
|
-
isError: boolean;
|
|
22
|
-
isIdle: boolean;
|
|
23
|
-
isPending: boolean;
|
|
24
|
-
isSuccess: boolean;
|
|
25
|
-
status: "pending" | "error" | "idle" | "success";
|
|
26
|
-
reset: () => void;
|
|
27
|
-
context: unknown;
|
|
28
|
-
failureCount: number;
|
|
29
|
-
failureReason: Error | null;
|
|
30
|
-
isPaused: boolean;
|
|
31
|
-
submittedAt: number;
|
|
32
|
-
authenticateWithOAuth: import("@tanstack/react-query").UseMutateFunction<import("@getpara/web-sdk").AuthenticateResponse, Error, AuthenticateWithOAuthParams, unknown>;
|
|
33
|
-
authenticateWithOAuthAsync: import("@tanstack/react-query").UseMutateAsyncFunction<import("@getpara/web-sdk").AuthenticateResponse, Error, AuthenticateWithOAuthParams, unknown>;
|
|
34
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
__async
|
|
4
|
-
} from "../../../chunk-MMUBH76A.js";
|
|
5
|
-
import { useMutation } from "@tanstack/react-query";
|
|
6
|
-
import { useClient } from "../utils/index.js";
|
|
7
|
-
import { renameMutations } from "../../utils/renameMutations.js";
|
|
8
|
-
import { authenticateWithOAuth } from "../../actions/index.js";
|
|
9
|
-
const AUTHENTICATE_OAUTH_KEY = "AUTHENTICATE_OAUTH";
|
|
10
|
-
const useAuthenticateWithOAuth = () => {
|
|
11
|
-
const para = useClient();
|
|
12
|
-
const mutation = useMutation({
|
|
13
|
-
mutationKey: [AUTHENTICATE_OAUTH_KEY],
|
|
14
|
-
mutationFn: (params) => __async(void 0, null, function* () {
|
|
15
|
-
try {
|
|
16
|
-
const result = yield authenticateWithOAuth(para, params);
|
|
17
|
-
return result;
|
|
18
|
-
} catch (error) {
|
|
19
|
-
throw error;
|
|
20
|
-
}
|
|
21
|
-
})
|
|
22
|
-
});
|
|
23
|
-
return renameMutations(mutation, "authenticateWithOAuth");
|
|
24
|
-
};
|
|
25
|
-
export {
|
|
26
|
-
AUTHENTICATE_OAUTH_KEY,
|
|
27
|
-
useAuthenticateWithOAuth
|
|
28
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { ClaimPregenWalletsParams, ClaimPregenWalletsResponse } from '@getpara/web-sdk';
|
|
2
|
-
export declare const CLAIM_PREGEN_WALLETS_KEY = "CLAIM_PREGEN_WALLETS";
|
|
3
|
-
/**
|
|
4
|
-
* React hook for the `claimPregenWallets` mutation.
|
|
5
|
-
*
|
|
6
|
-
* Returns a mutation result object with all standard fields from `useMutation`, except:
|
|
7
|
-
* - `mutate` and `mutateAsync` are replaced by:
|
|
8
|
-
* - `claimPregenWallets`: function to trigger the mutation (same as `mutate`)
|
|
9
|
-
* - `claimPregenWalletsAsync`: async function to trigger the mutation (same as `mutateAsync`)
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* const { claimPregenWallets, claimPregenWalletsAsync } = useClaimPregenWallets();
|
|
13
|
-
* claimPregenWallets({ ...params });
|
|
14
|
-
* // or
|
|
15
|
-
* await claimPregenWalletsAsync({ ...params });
|
|
16
|
-
*/
|
|
17
|
-
export declare const useClaimPregenWallets: () => {
|
|
18
|
-
data: ClaimPregenWalletsResponse;
|
|
19
|
-
variables: ClaimPregenWalletsParams | undefined;
|
|
20
|
-
error: Error | null;
|
|
21
|
-
isError: boolean;
|
|
22
|
-
isIdle: boolean;
|
|
23
|
-
isPending: boolean;
|
|
24
|
-
isSuccess: boolean;
|
|
25
|
-
status: "pending" | "error" | "idle" | "success";
|
|
26
|
-
reset: () => void;
|
|
27
|
-
context: unknown;
|
|
28
|
-
failureCount: number;
|
|
29
|
-
failureReason: Error | null;
|
|
30
|
-
isPaused: boolean;
|
|
31
|
-
submittedAt: number;
|
|
32
|
-
claimPregenWallets: import("@tanstack/react-query").UseMutateFunction<ClaimPregenWalletsResponse, Error, ClaimPregenWalletsParams, unknown>;
|
|
33
|
-
claimPregenWalletsAsync: import("@tanstack/react-query").UseMutateAsyncFunction<ClaimPregenWalletsResponse, Error, ClaimPregenWalletsParams, unknown>;
|
|
34
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
__async
|
|
4
|
-
} from "../../../chunk-MMUBH76A.js";
|
|
5
|
-
import { useMutation } from "@tanstack/react-query";
|
|
6
|
-
import { useClient } from "../utils/index.js";
|
|
7
|
-
import { renameMutations } from "../../utils/renameMutations.js";
|
|
8
|
-
import { claimPregenWallets } from "../../actions/index.js";
|
|
9
|
-
const CLAIM_PREGEN_WALLETS_KEY = "CLAIM_PREGEN_WALLETS";
|
|
10
|
-
const useClaimPregenWallets = () => {
|
|
11
|
-
const para = useClient();
|
|
12
|
-
const mutation = useMutation({
|
|
13
|
-
mutationKey: [CLAIM_PREGEN_WALLETS_KEY],
|
|
14
|
-
mutationFn: (args) => __async(void 0, null, function* () {
|
|
15
|
-
try {
|
|
16
|
-
const result = yield claimPregenWallets(para, args);
|
|
17
|
-
return result;
|
|
18
|
-
} catch (error) {
|
|
19
|
-
throw error;
|
|
20
|
-
}
|
|
21
|
-
})
|
|
22
|
-
});
|
|
23
|
-
return renameMutations(
|
|
24
|
-
mutation,
|
|
25
|
-
"claimPregenWallets"
|
|
26
|
-
);
|
|
27
|
-
};
|
|
28
|
-
export {
|
|
29
|
-
CLAIM_PREGEN_WALLETS_KEY,
|
|
30
|
-
useClaimPregenWallets
|
|
31
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { CreateGuestWalletsResponse } from '@getpara/web-sdk';
|
|
2
|
-
export declare const CREATE_GUEST_WALLETS_KEY = "CREATE_GUEST_WALLETS";
|
|
3
|
-
/**
|
|
4
|
-
* React hook for the `createGuestWallets` mutation.
|
|
5
|
-
*
|
|
6
|
-
* Returns a mutation result object with all standard fields from `useMutation`, except:
|
|
7
|
-
* - `mutate` and `mutateAsync` are replaced by:
|
|
8
|
-
* - `createGuestWallets`: function to trigger the mutation (same as `mutate`)
|
|
9
|
-
* - `createGuestWalletsAsync`: async function to trigger the mutation (same as `mutateAsync`)
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* const { createGuestWallets, createGuestWalletsAsync } = useCCreateGuestWallets();
|
|
13
|
-
* createGuestWallets({ ...params });
|
|
14
|
-
* // or
|
|
15
|
-
* await createGuestWalletsAsync({ ...params });
|
|
16
|
-
*/
|
|
17
|
-
export declare const useCreateGuestWallets: () => {
|
|
18
|
-
data: CreateGuestWalletsResponse | undefined;
|
|
19
|
-
variables: void | undefined;
|
|
20
|
-
error: Error | null;
|
|
21
|
-
isError: boolean;
|
|
22
|
-
isIdle: boolean;
|
|
23
|
-
isPending: boolean;
|
|
24
|
-
isSuccess: boolean;
|
|
25
|
-
status: "pending" | "error" | "idle" | "success";
|
|
26
|
-
reset: () => void;
|
|
27
|
-
context: unknown;
|
|
28
|
-
failureCount: number;
|
|
29
|
-
failureReason: Error | null;
|
|
30
|
-
isPaused: boolean;
|
|
31
|
-
submittedAt: number;
|
|
32
|
-
createGuestWallets: import("@tanstack/react-query").UseMutateFunction<CreateGuestWalletsResponse, Error, void, unknown>;
|
|
33
|
-
createGuestWalletsAsync: import("@tanstack/react-query").UseMutateAsyncFunction<CreateGuestWalletsResponse, Error, void, unknown>;
|
|
34
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
__async
|
|
4
|
-
} from "../../../chunk-MMUBH76A.js";
|
|
5
|
-
import { useMutation } from "@tanstack/react-query";
|
|
6
|
-
import { useClient } from "../utils/index.js";
|
|
7
|
-
import { renameMutations } from "../../utils/renameMutations.js";
|
|
8
|
-
import { createGuestWallets } from "../../actions/index.js";
|
|
9
|
-
const CREATE_GUEST_WALLETS_KEY = "CREATE_GUEST_WALLETS";
|
|
10
|
-
const useCreateGuestWallets = () => {
|
|
11
|
-
const para = useClient();
|
|
12
|
-
const mutation = useMutation({
|
|
13
|
-
mutationKey: [CREATE_GUEST_WALLETS_KEY],
|
|
14
|
-
mutationFn: () => __async(void 0, null, function* () {
|
|
15
|
-
try {
|
|
16
|
-
const result = yield createGuestWallets(para);
|
|
17
|
-
return result;
|
|
18
|
-
} catch (error) {
|
|
19
|
-
throw error;
|
|
20
|
-
}
|
|
21
|
-
})
|
|
22
|
-
});
|
|
23
|
-
return renameMutations(
|
|
24
|
-
mutation,
|
|
25
|
-
"createGuestWallets"
|
|
26
|
-
);
|
|
27
|
-
};
|
|
28
|
-
export {
|
|
29
|
-
CREATE_GUEST_WALLETS_KEY,
|
|
30
|
-
useCreateGuestWallets
|
|
31
|
-
};
|