@getpara/react-core 2.19.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/index.d.ts +37 -0
- package/dist/index.js +73 -0
- package/dist/mutations.d.ts +29 -0
- package/dist/mutations.js +60 -0
- package/dist/package.json +4 -0
- package/dist/provider/ParaProviderCore.d.ts +85 -0
- package/dist/provider/ParaProviderCore.js +124 -0
- package/dist/provider/actions/getEmbeddedAccount.d.ts +28 -0
- package/dist/provider/actions/getEmbeddedAccount.js +82 -0
- package/dist/provider/actions/getWallet.js +34 -0
- package/dist/provider/actions/index.d.ts +38 -0
- package/dist/provider/actions/index.js +75 -0
- package/dist/provider/actions/utils.d.ts +4 -0
- package/dist/provider/actions/utils.js +32 -0
- package/dist/provider/hooks/aa/alchemy.d.ts +22 -0
- package/dist/provider/hooks/aa/alchemy.js +47 -0
- package/dist/provider/hooks/aa/biconomy.d.ts +22 -0
- package/dist/provider/hooks/aa/biconomy.js +47 -0
- package/dist/provider/hooks/aa/cdp.d.ts +21 -0
- package/dist/provider/hooks/aa/cdp.js +47 -0
- package/dist/provider/hooks/aa/createSmartAccountHook.d.ts +18 -0
- package/dist/provider/hooks/aa/createSmartAccountHook.js +96 -0
- package/dist/provider/hooks/aa/gelato.d.ts +21 -0
- package/dist/provider/hooks/aa/gelato.js +47 -0
- package/dist/provider/hooks/aa/index.d.ts +12 -0
- package/dist/provider/hooks/aa/index.js +48 -0
- package/dist/provider/hooks/aa/pimlico.d.ts +22 -0
- package/dist/provider/hooks/aa/pimlico.js +47 -0
- package/dist/provider/hooks/aa/porto.d.ts +22 -0
- package/dist/provider/hooks/aa/porto.js +47 -0
- package/dist/provider/hooks/aa/rhinestone.d.ts +22 -0
- package/dist/provider/hooks/aa/rhinestone.js +47 -0
- package/dist/provider/hooks/aa/safe.d.ts +22 -0
- package/dist/provider/hooks/aa/safe.js +47 -0
- package/dist/provider/hooks/aa/thirdweb.d.ts +18 -0
- package/dist/provider/hooks/aa/thirdweb.js +47 -0
- package/dist/provider/hooks/aa/types.d.ts +34 -0
- package/dist/provider/hooks/aa/types.js +0 -0
- package/dist/provider/hooks/aa/zerodev.d.ts +22 -0
- package/dist/provider/hooks/aa/zerodev.js +47 -0
- package/dist/provider/hooks/index.d.ts +4 -0
- package/dist/provider/hooks/index.js +4 -0
- package/dist/provider/hooks/mutations/index.d.ts +30 -0
- package/dist/provider/hooks/mutations/index.js +92 -0
- package/dist/provider/hooks/mutations/useAuthenticateWithEmailOrPhone.d.ts +34 -0
- package/dist/provider/hooks/mutations/useAuthenticateWithEmailOrPhone.js +39 -0
- package/dist/provider/hooks/mutations/useAuthenticateWithOAuth.d.ts +34 -0
- package/dist/provider/hooks/mutations/useAuthenticateWithOAuth.js +39 -0
- package/dist/provider/hooks/mutations/useClaimPregenWallets.d.ts +34 -0
- package/dist/provider/hooks/mutations/useClaimPregenWallets.js +42 -0
- package/dist/provider/hooks/mutations/useCreateGuestWallets.d.ts +34 -0
- package/dist/provider/hooks/mutations/useCreateGuestWallets.js +42 -0
- package/dist/provider/hooks/mutations/useCreatePregenWallet.d.ts +34 -0
- package/dist/provider/hooks/mutations/useCreatePregenWallet.js +42 -0
- package/dist/provider/hooks/mutations/useCreatePregenWalletPerType.d.ts +34 -0
- package/dist/provider/hooks/mutations/useCreatePregenWalletPerType.js +39 -0
- package/dist/provider/hooks/mutations/useCreateWallet.d.ts +34 -0
- package/dist/provider/hooks/mutations/useCreateWallet.js +42 -0
- package/dist/provider/hooks/mutations/useCreateWalletPerType.d.ts +34 -0
- package/dist/provider/hooks/mutations/useCreateWalletPerType.js +39 -0
- package/dist/provider/hooks/mutations/useEnable2fa.d.ts +34 -0
- package/dist/provider/hooks/mutations/useEnable2fa.js +39 -0
- package/dist/provider/hooks/mutations/useExportPrivateKey.d.ts +39 -0
- package/dist/provider/hooks/mutations/useExportPrivateKey.js +63 -0
- package/dist/provider/hooks/mutations/useHasPregenWallet.d.ts +34 -0
- package/dist/provider/hooks/mutations/useHasPregenWallet.js +39 -0
- package/dist/provider/hooks/mutations/useIssueJwt.d.ts +34 -0
- package/dist/provider/hooks/mutations/useIssueJwt.js +39 -0
- package/dist/provider/hooks/mutations/useKeepSessionAlive.d.ts +33 -0
- package/dist/provider/hooks/mutations/useKeepSessionAlive.js +39 -0
- package/dist/provider/hooks/mutations/useLoginExternalWallet.d.ts +34 -0
- package/dist/provider/hooks/mutations/useLoginExternalWallet.js +42 -0
- package/dist/provider/hooks/mutations/useLogout.d.ts +34 -0
- package/dist/provider/hooks/mutations/useLogout.js +39 -0
- package/dist/provider/hooks/mutations/useResendVerificationCode.d.ts +34 -0
- package/dist/provider/hooks/mutations/useResendVerificationCode.js +42 -0
- package/dist/provider/hooks/mutations/useSetup2fa.d.ts +34 -0
- package/dist/provider/hooks/mutations/useSetup2fa.js +39 -0
- package/dist/provider/hooks/mutations/useSignMessage.d.ts +34 -0
- package/dist/provider/hooks/mutations/useSignMessage.js +39 -0
- package/dist/provider/hooks/mutations/useSignTransaction.d.ts +34 -0
- package/dist/provider/hooks/mutations/useSignTransaction.js +42 -0
- package/dist/provider/hooks/mutations/useSignUpOrLogIn.d.ts +34 -0
- package/dist/provider/hooks/mutations/useSignUpOrLogIn.js +42 -0
- package/dist/provider/hooks/mutations/useUpdatePregenWalletIdentifier.d.ts +34 -0
- package/dist/provider/hooks/mutations/useUpdatePregenWalletIdentifier.js +42 -0
- package/dist/provider/hooks/mutations/useVerify2fa.d.ts +34 -0
- package/dist/provider/hooks/mutations/useVerify2fa.js +39 -0
- package/dist/provider/hooks/mutations/useVerifyExternalWallet.d.ts +34 -0
- package/dist/provider/hooks/mutations/useVerifyExternalWallet.js +42 -0
- package/dist/provider/hooks/mutations/useVerifyFarcaster.js +43 -0
- package/dist/provider/hooks/mutations/useVerifyNewAccount.d.ts +34 -0
- package/dist/provider/hooks/mutations/useVerifyNewAccount.js +42 -0
- package/dist/provider/hooks/mutations/useVerifyOAuth.js +40 -0
- package/dist/provider/hooks/mutations/useVerifyTelegram.js +40 -0
- package/dist/provider/hooks/mutations/useWaitForLogin.d.ts +34 -0
- package/dist/provider/hooks/mutations/useWaitForLogin.js +42 -0
- package/dist/provider/hooks/mutations/useWaitForSignup.d.ts +34 -0
- package/dist/provider/hooks/mutations/useWaitForSignup.js +39 -0
- package/dist/provider/hooks/mutations/useWaitForWalletCreation.d.ts +34 -0
- package/dist/provider/hooks/mutations/useWaitForWalletCreation.js +39 -0
- package/dist/provider/hooks/queries/createAccountHook.d.ts +49 -0
- package/dist/provider/hooks/queries/createAccountHook.js +132 -0
- package/dist/provider/hooks/queries/index.d.ts +5 -0
- package/dist/provider/hooks/queries/index.js +20 -0
- package/dist/provider/hooks/queries/useAccount.d.ts +65 -0
- package/dist/provider/hooks/queries/useAccount.js +65 -0
- package/dist/provider/hooks/queries/useIsFullyLoggedIn.d.ts +7 -0
- package/dist/provider/hooks/queries/useIsFullyLoggedIn.js +49 -0
- package/dist/provider/hooks/queries/useParaStatus.d.ts +15 -0
- package/dist/provider/hooks/queries/useParaStatus.js +32 -0
- package/dist/provider/hooks/queries/useWallet.js +43 -0
- package/dist/provider/hooks/utils/index.d.ts +2 -0
- package/dist/provider/hooks/utils/index.js +6 -0
- package/dist/provider/hooks/utils/useClient.d.ts +7 -0
- package/dist/provider/hooks/utils/useClient.js +8 -0
- package/dist/provider/hooks/utils/useCoreWalletState.d.ts +17 -0
- package/dist/provider/hooks/utils/useCoreWalletState.js +47 -0
- package/dist/provider/index.d.ts +5 -0
- package/dist/provider/index.js +11 -0
- package/dist/provider/stores/CoreStoreContext.d.ts +13 -0
- package/dist/provider/stores/CoreStoreContext.js +14 -0
- package/dist/provider/stores/createCoreStore.d.ts +26 -0
- package/dist/provider/stores/createCoreStore.js +61 -0
- package/dist/provider/stores/index.d.ts +4 -0
- package/dist/provider/stores/index.js +9 -0
- package/dist/provider/stores/slices/client.d.ts +3 -0
- package/dist/provider/stores/slices/client.js +7 -0
- package/dist/provider/stores/slices/config.d.ts +3 -0
- package/dist/provider/stores/slices/config.js +9 -0
- package/dist/provider/stores/slices/index.d.ts +4 -0
- package/dist/provider/stores/slices/index.js +10 -0
- package/dist/provider/stores/slices/paraState.d.ts +3 -0
- package/dist/provider/stores/slices/paraState.js +7 -0
- package/dist/provider/stores/slices/wallet.d.ts +3 -0
- package/dist/provider/stores/slices/wallet.js +11 -0
- package/dist/provider/stores/types.d.ts +28 -0
- package/dist/provider/stores/types.js +0 -0
- package/dist/provider/utils/renameMutations.d.ts +11 -0
- package/dist/provider/utils/renameMutations.js +39 -0
- package/dist/queries.d.ts +2 -0
- package/dist/queries.js +6 -0
- package/package.json +73 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
var __async = (__this, __arguments, generator) => {
|
|
2
|
+
return new Promise((resolve, reject) => {
|
|
3
|
+
var fulfilled = (value) => {
|
|
4
|
+
try {
|
|
5
|
+
step(generator.next(value));
|
|
6
|
+
} catch (e) {
|
|
7
|
+
reject(e);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
var rejected = (value) => {
|
|
11
|
+
try {
|
|
12
|
+
step(generator.throw(value));
|
|
13
|
+
} catch (e) {
|
|
14
|
+
reject(e);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
18
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
import { useMutation } from "@tanstack/react-query";
|
|
22
|
+
import { useClient } from "../utils/index.js";
|
|
23
|
+
import { renameMutations } from "../../utils/renameMutations.js";
|
|
24
|
+
import { authenticateWithOAuth } from "../../actions/index.js";
|
|
25
|
+
const AUTHENTICATE_OAUTH_KEY = "AUTHENTICATE_OAUTH";
|
|
26
|
+
const useAuthenticateWithOAuth = () => {
|
|
27
|
+
const para = useClient();
|
|
28
|
+
const mutation = useMutation({
|
|
29
|
+
mutationKey: [AUTHENTICATE_OAUTH_KEY],
|
|
30
|
+
mutationFn: (params) => __async(void 0, null, function* () {
|
|
31
|
+
return authenticateWithOAuth(para, params);
|
|
32
|
+
})
|
|
33
|
+
});
|
|
34
|
+
return renameMutations(mutation, "authenticateWithOAuth");
|
|
35
|
+
};
|
|
36
|
+
export {
|
|
37
|
+
AUTHENTICATE_OAUTH_KEY,
|
|
38
|
+
useAuthenticateWithOAuth
|
|
39
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ClaimPregenWalletsParams } from '@getpara/core-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
|
+
error: Error;
|
|
19
|
+
isSuccess: boolean;
|
|
20
|
+
data: string;
|
|
21
|
+
variables: ClaimPregenWalletsParams;
|
|
22
|
+
isError: boolean;
|
|
23
|
+
isIdle: boolean;
|
|
24
|
+
isPending: boolean;
|
|
25
|
+
status: "error" | "idle" | "pending" | "success";
|
|
26
|
+
reset: () => void;
|
|
27
|
+
context: unknown;
|
|
28
|
+
failureCount: number;
|
|
29
|
+
failureReason: Error;
|
|
30
|
+
isPaused: boolean;
|
|
31
|
+
submittedAt: number;
|
|
32
|
+
claimPregenWallets: import("@tanstack/react-query").UseMutateFunction<string, Error, ClaimPregenWalletsParams, unknown>;
|
|
33
|
+
claimPregenWalletsAsync: import("@tanstack/react-query").UseMutateAsyncFunction<string, Error, ClaimPregenWalletsParams, unknown>;
|
|
34
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
var __async = (__this, __arguments, generator) => {
|
|
2
|
+
return new Promise((resolve, reject) => {
|
|
3
|
+
var fulfilled = (value) => {
|
|
4
|
+
try {
|
|
5
|
+
step(generator.next(value));
|
|
6
|
+
} catch (e) {
|
|
7
|
+
reject(e);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
var rejected = (value) => {
|
|
11
|
+
try {
|
|
12
|
+
step(generator.throw(value));
|
|
13
|
+
} catch (e) {
|
|
14
|
+
reject(e);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
18
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
import { useMutation } from "@tanstack/react-query";
|
|
22
|
+
import { useClient } from "../utils/index.js";
|
|
23
|
+
import { renameMutations } from "../../utils/renameMutations.js";
|
|
24
|
+
import { claimPregenWallets } from "../../actions/index.js";
|
|
25
|
+
const CLAIM_PREGEN_WALLETS_KEY = "CLAIM_PREGEN_WALLETS";
|
|
26
|
+
const useClaimPregenWallets = () => {
|
|
27
|
+
const para = useClient();
|
|
28
|
+
const mutation = useMutation({
|
|
29
|
+
mutationKey: [CLAIM_PREGEN_WALLETS_KEY],
|
|
30
|
+
mutationFn: (args) => __async(void 0, null, function* () {
|
|
31
|
+
return claimPregenWallets(para, args);
|
|
32
|
+
})
|
|
33
|
+
});
|
|
34
|
+
return renameMutations(
|
|
35
|
+
mutation,
|
|
36
|
+
"claimPregenWallets"
|
|
37
|
+
);
|
|
38
|
+
};
|
|
39
|
+
export {
|
|
40
|
+
CLAIM_PREGEN_WALLETS_KEY,
|
|
41
|
+
useClaimPregenWallets
|
|
42
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { CreateGuestWalletsResponse } from '@getpara/core-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 } = useCreateGuestWallets();
|
|
13
|
+
* createGuestWallets();
|
|
14
|
+
* // or
|
|
15
|
+
* await createGuestWalletsAsync();
|
|
16
|
+
*/
|
|
17
|
+
export declare const useCreateGuestWallets: () => {
|
|
18
|
+
error: Error;
|
|
19
|
+
isSuccess: boolean;
|
|
20
|
+
data: CreateGuestWalletsResponse;
|
|
21
|
+
variables: void;
|
|
22
|
+
isError: boolean;
|
|
23
|
+
isIdle: boolean;
|
|
24
|
+
isPending: boolean;
|
|
25
|
+
status: "error" | "idle" | "pending" | "success";
|
|
26
|
+
reset: () => void;
|
|
27
|
+
context: unknown;
|
|
28
|
+
failureCount: number;
|
|
29
|
+
failureReason: Error;
|
|
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
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
var __async = (__this, __arguments, generator) => {
|
|
2
|
+
return new Promise((resolve, reject) => {
|
|
3
|
+
var fulfilled = (value) => {
|
|
4
|
+
try {
|
|
5
|
+
step(generator.next(value));
|
|
6
|
+
} catch (e) {
|
|
7
|
+
reject(e);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
var rejected = (value) => {
|
|
11
|
+
try {
|
|
12
|
+
step(generator.throw(value));
|
|
13
|
+
} catch (e) {
|
|
14
|
+
reject(e);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
18
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
import { useMutation } from "@tanstack/react-query";
|
|
22
|
+
import { useClient } from "../utils/index.js";
|
|
23
|
+
import { renameMutations } from "../../utils/renameMutations.js";
|
|
24
|
+
import { createGuestWallets } from "../../actions/index.js";
|
|
25
|
+
const CREATE_GUEST_WALLETS_KEY = "CREATE_GUEST_WALLETS";
|
|
26
|
+
const useCreateGuestWallets = () => {
|
|
27
|
+
const para = useClient();
|
|
28
|
+
const mutation = useMutation({
|
|
29
|
+
mutationKey: [CREATE_GUEST_WALLETS_KEY],
|
|
30
|
+
mutationFn: () => __async(void 0, null, function* () {
|
|
31
|
+
return createGuestWallets(para);
|
|
32
|
+
})
|
|
33
|
+
});
|
|
34
|
+
return renameMutations(
|
|
35
|
+
mutation,
|
|
36
|
+
"createGuestWallets"
|
|
37
|
+
);
|
|
38
|
+
};
|
|
39
|
+
export {
|
|
40
|
+
CREATE_GUEST_WALLETS_KEY,
|
|
41
|
+
useCreateGuestWallets
|
|
42
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { CreatePregenWalletParams } from '@getpara/core-sdk';
|
|
2
|
+
export declare const CREATE_PREGEN_WALLET_KEY = "CREATE_PREGEN_WALLET";
|
|
3
|
+
/**
|
|
4
|
+
* React hook for the `createPregenWallet` mutation.
|
|
5
|
+
*
|
|
6
|
+
* Returns a mutation result object with all standard fields from `useMutation`, except:
|
|
7
|
+
* - `mutate` and `mutateAsync` are replaced by:
|
|
8
|
+
* - `createPregenWallet`: function to trigger the mutation (same as `mutate`)
|
|
9
|
+
* - `createPregenWalletAsync`: async function to trigger the mutation (same as `mutateAsync`)
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* const { createPregenWallet, createPregenWalletAsync } = useCreatePregenWallet();
|
|
13
|
+
* createPregenWallet({ ...params });
|
|
14
|
+
* // or
|
|
15
|
+
* await createPregenWalletAsync({ ...params });
|
|
16
|
+
*/
|
|
17
|
+
export declare const useCreatePregenWallet: () => {
|
|
18
|
+
error: Error;
|
|
19
|
+
isSuccess: boolean;
|
|
20
|
+
data: import("@getpara/core-sdk").Wallet;
|
|
21
|
+
variables: CreatePregenWalletParams;
|
|
22
|
+
isError: boolean;
|
|
23
|
+
isIdle: boolean;
|
|
24
|
+
isPending: boolean;
|
|
25
|
+
status: "error" | "idle" | "pending" | "success";
|
|
26
|
+
reset: () => void;
|
|
27
|
+
context: unknown;
|
|
28
|
+
failureCount: number;
|
|
29
|
+
failureReason: Error;
|
|
30
|
+
isPaused: boolean;
|
|
31
|
+
submittedAt: number;
|
|
32
|
+
createPregenWallet: import("@tanstack/react-query").UseMutateFunction<import("@getpara/core-sdk").Wallet, Error, CreatePregenWalletParams, unknown>;
|
|
33
|
+
createPregenWalletAsync: import("@tanstack/react-query").UseMutateAsyncFunction<import("@getpara/core-sdk").Wallet, Error, CreatePregenWalletParams, unknown>;
|
|
34
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
var __async = (__this, __arguments, generator) => {
|
|
2
|
+
return new Promise((resolve, reject) => {
|
|
3
|
+
var fulfilled = (value) => {
|
|
4
|
+
try {
|
|
5
|
+
step(generator.next(value));
|
|
6
|
+
} catch (e) {
|
|
7
|
+
reject(e);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
var rejected = (value) => {
|
|
11
|
+
try {
|
|
12
|
+
step(generator.throw(value));
|
|
13
|
+
} catch (e) {
|
|
14
|
+
reject(e);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
18
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
import { useMutation } from "@tanstack/react-query";
|
|
22
|
+
import { useClient } from "../utils/index.js";
|
|
23
|
+
import { renameMutations } from "../../utils/renameMutations.js";
|
|
24
|
+
import { createPregenWallet } from "../../actions/index.js";
|
|
25
|
+
const CREATE_PREGEN_WALLET_KEY = "CREATE_PREGEN_WALLET";
|
|
26
|
+
const useCreatePregenWallet = () => {
|
|
27
|
+
const para = useClient();
|
|
28
|
+
const mutation = useMutation({
|
|
29
|
+
mutationKey: [CREATE_PREGEN_WALLET_KEY],
|
|
30
|
+
mutationFn: (args) => __async(void 0, null, function* () {
|
|
31
|
+
return createPregenWallet(para, args);
|
|
32
|
+
})
|
|
33
|
+
});
|
|
34
|
+
return renameMutations(
|
|
35
|
+
mutation,
|
|
36
|
+
"createPregenWallet"
|
|
37
|
+
);
|
|
38
|
+
};
|
|
39
|
+
export {
|
|
40
|
+
CREATE_PREGEN_WALLET_KEY,
|
|
41
|
+
useCreatePregenWallet
|
|
42
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { CreatePregenWalletPerTypeParams, CreatePregenWalletPerTypeResponse } from '@getpara/core-sdk';
|
|
2
|
+
export declare const CREATE_PREGEN_WALLET_PER_TYPE_KEY = "CREATE_PREGEN_WALLET_PER_TYPE";
|
|
3
|
+
/**
|
|
4
|
+
* React hook for the `createPregenWalletPerType` mutation.
|
|
5
|
+
*
|
|
6
|
+
* Returns a mutation result object with all standard fields from `useMutation`, except:
|
|
7
|
+
* - `mutate` and `mutateAsync` are replaced by:
|
|
8
|
+
* - `createPregenWalletPerType`: function to trigger the mutation (same as `mutate`)
|
|
9
|
+
* - `createPregenWalletPerTypeAsync`: async function to trigger the mutation (same as `mutateAsync`)
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* const { createPregenWalletPerType, createPregenWalletPerTypeAsync } = useCreatePregenWalletPerType();
|
|
13
|
+
* createPregenWalletPerType({ ...params });
|
|
14
|
+
* // or
|
|
15
|
+
* await createPregenWalletPerTypeAsync({ ...params });
|
|
16
|
+
*/
|
|
17
|
+
export declare const useCreatePregenWalletPerType: () => {
|
|
18
|
+
error: Error;
|
|
19
|
+
isSuccess: boolean;
|
|
20
|
+
data: CreatePregenWalletPerTypeResponse;
|
|
21
|
+
variables: CreatePregenWalletPerTypeParams;
|
|
22
|
+
isError: boolean;
|
|
23
|
+
isIdle: boolean;
|
|
24
|
+
isPending: boolean;
|
|
25
|
+
status: "error" | "idle" | "pending" | "success";
|
|
26
|
+
reset: () => void;
|
|
27
|
+
context: unknown;
|
|
28
|
+
failureCount: number;
|
|
29
|
+
failureReason: Error;
|
|
30
|
+
isPaused: boolean;
|
|
31
|
+
submittedAt: number;
|
|
32
|
+
createPregenWalletPerType: import("@tanstack/react-query").UseMutateFunction<CreatePregenWalletPerTypeResponse, Error, CreatePregenWalletPerTypeParams, unknown>;
|
|
33
|
+
createPregenWalletPerTypeAsync: import("@tanstack/react-query").UseMutateAsyncFunction<CreatePregenWalletPerTypeResponse, Error, CreatePregenWalletPerTypeParams, unknown>;
|
|
34
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
var __async = (__this, __arguments, generator) => {
|
|
2
|
+
return new Promise((resolve, reject) => {
|
|
3
|
+
var fulfilled = (value) => {
|
|
4
|
+
try {
|
|
5
|
+
step(generator.next(value));
|
|
6
|
+
} catch (e) {
|
|
7
|
+
reject(e);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
var rejected = (value) => {
|
|
11
|
+
try {
|
|
12
|
+
step(generator.throw(value));
|
|
13
|
+
} catch (e) {
|
|
14
|
+
reject(e);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
18
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
import { useMutation } from "@tanstack/react-query";
|
|
22
|
+
import { useClient } from "../utils/index.js";
|
|
23
|
+
import { renameMutations } from "../../utils/renameMutations.js";
|
|
24
|
+
import { createPregenWalletPerType } from "../../actions/index.js";
|
|
25
|
+
const CREATE_PREGEN_WALLET_PER_TYPE_KEY = "CREATE_PREGEN_WALLET_PER_TYPE";
|
|
26
|
+
const useCreatePregenWalletPerType = () => {
|
|
27
|
+
const para = useClient();
|
|
28
|
+
const mutation = useMutation({
|
|
29
|
+
mutationKey: [CREATE_PREGEN_WALLET_PER_TYPE_KEY],
|
|
30
|
+
mutationFn: (args) => __async(void 0, null, function* () {
|
|
31
|
+
return createPregenWalletPerType(para, args);
|
|
32
|
+
})
|
|
33
|
+
});
|
|
34
|
+
return renameMutations(mutation, "createPregenWalletPerType");
|
|
35
|
+
};
|
|
36
|
+
export {
|
|
37
|
+
CREATE_PREGEN_WALLET_PER_TYPE_KEY,
|
|
38
|
+
useCreatePregenWalletPerType
|
|
39
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { CreateWalletParams, CreateWalletResponse } from '@getpara/core-sdk';
|
|
2
|
+
export declare const CREATE_WALLET_KEY = "CREATE_WALLET";
|
|
3
|
+
/**
|
|
4
|
+
* React hook for the `createWallet` mutation.
|
|
5
|
+
*
|
|
6
|
+
* Returns a mutation result object with all standard fields from `useMutation`, except:
|
|
7
|
+
* - `mutate` and `mutateAsync` are replaced by:
|
|
8
|
+
* - `createWallet`: function to trigger the mutation (same as `mutate`)
|
|
9
|
+
* - `createWalletAsync`: async function to trigger the mutation (same as `mutateAsync`)
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* const { createWallet, createWalletAsync } = useCreateWallet();
|
|
13
|
+
* createWallet({ ...params });
|
|
14
|
+
* // or
|
|
15
|
+
* await createWalletAsync({ ...params });
|
|
16
|
+
*/
|
|
17
|
+
export declare const useCreateWallet: () => {
|
|
18
|
+
error: Error;
|
|
19
|
+
isSuccess: boolean;
|
|
20
|
+
data: CreateWalletResponse;
|
|
21
|
+
variables: void | CreateWalletParams;
|
|
22
|
+
isError: boolean;
|
|
23
|
+
isIdle: boolean;
|
|
24
|
+
isPending: boolean;
|
|
25
|
+
status: "error" | "idle" | "pending" | "success";
|
|
26
|
+
reset: () => void;
|
|
27
|
+
context: unknown;
|
|
28
|
+
failureCount: number;
|
|
29
|
+
failureReason: Error;
|
|
30
|
+
isPaused: boolean;
|
|
31
|
+
submittedAt: number;
|
|
32
|
+
createWallet: import("@tanstack/react-query").UseMutateFunction<CreateWalletResponse, Error, void | CreateWalletParams, unknown>;
|
|
33
|
+
createWalletAsync: import("@tanstack/react-query").UseMutateAsyncFunction<CreateWalletResponse, Error, void | CreateWalletParams, unknown>;
|
|
34
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
var __async = (__this, __arguments, generator) => {
|
|
2
|
+
return new Promise((resolve, reject) => {
|
|
3
|
+
var fulfilled = (value) => {
|
|
4
|
+
try {
|
|
5
|
+
step(generator.next(value));
|
|
6
|
+
} catch (e) {
|
|
7
|
+
reject(e);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
var rejected = (value) => {
|
|
11
|
+
try {
|
|
12
|
+
step(generator.throw(value));
|
|
13
|
+
} catch (e) {
|
|
14
|
+
reject(e);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
18
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
import { useMutation } from "@tanstack/react-query";
|
|
22
|
+
import { useClient } from "../utils/index.js";
|
|
23
|
+
import { renameMutations } from "../../utils/renameMutations.js";
|
|
24
|
+
import { createWallet } from "../../actions/index.js";
|
|
25
|
+
const CREATE_WALLET_KEY = "CREATE_WALLET";
|
|
26
|
+
const useCreateWallet = () => {
|
|
27
|
+
const para = useClient();
|
|
28
|
+
const mutation = useMutation({
|
|
29
|
+
mutationKey: [CREATE_WALLET_KEY],
|
|
30
|
+
mutationFn: (..._0) => __async(void 0, [..._0], function* (args = {}) {
|
|
31
|
+
return createWallet(para, args);
|
|
32
|
+
})
|
|
33
|
+
});
|
|
34
|
+
return renameMutations(
|
|
35
|
+
mutation,
|
|
36
|
+
"createWallet"
|
|
37
|
+
);
|
|
38
|
+
};
|
|
39
|
+
export {
|
|
40
|
+
CREATE_WALLET_KEY,
|
|
41
|
+
useCreateWallet
|
|
42
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { CreateWalletPerTypeParams, CreateWalletPerTypeResponse } from '@getpara/core-sdk';
|
|
2
|
+
export declare const CREATE_WALLET_PER_TYPE_KEY = "CREATE_WALLET_PER_TYPE";
|
|
3
|
+
/**
|
|
4
|
+
* React hook for the `createWalletPerType` mutation.
|
|
5
|
+
*
|
|
6
|
+
* Returns a mutation result object with all standard fields from `useMutation`, except:
|
|
7
|
+
* - `mutate` and `mutateAsync` are replaced by:
|
|
8
|
+
* - `createWalletPerType`: function to trigger the mutation (same as `mutate`)
|
|
9
|
+
* - `createWalletPerTypeAsync`: async function to trigger the mutation (same as `mutateAsync`)
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* const { createWalletPerType, createWalletPerTypeAsync } = useCreateWalletPerType();
|
|
13
|
+
* createWalletPerType({ ...params });
|
|
14
|
+
* // or
|
|
15
|
+
* await createWalletPerTypeAsync({ ...params });
|
|
16
|
+
*/
|
|
17
|
+
export declare const useCreateWalletPerType: () => {
|
|
18
|
+
error: Error;
|
|
19
|
+
isSuccess: boolean;
|
|
20
|
+
data: CreateWalletPerTypeResponse;
|
|
21
|
+
variables: void | CreateWalletPerTypeParams;
|
|
22
|
+
isError: boolean;
|
|
23
|
+
isIdle: boolean;
|
|
24
|
+
isPending: boolean;
|
|
25
|
+
status: "error" | "idle" | "pending" | "success";
|
|
26
|
+
reset: () => void;
|
|
27
|
+
context: unknown;
|
|
28
|
+
failureCount: number;
|
|
29
|
+
failureReason: Error;
|
|
30
|
+
isPaused: boolean;
|
|
31
|
+
submittedAt: number;
|
|
32
|
+
createWalletPerType: import("@tanstack/react-query").UseMutateFunction<CreateWalletPerTypeResponse, Error, void | CreateWalletPerTypeParams, unknown>;
|
|
33
|
+
createWalletPerTypeAsync: import("@tanstack/react-query").UseMutateAsyncFunction<CreateWalletPerTypeResponse, Error, void | CreateWalletPerTypeParams, unknown>;
|
|
34
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
var __async = (__this, __arguments, generator) => {
|
|
2
|
+
return new Promise((resolve, reject) => {
|
|
3
|
+
var fulfilled = (value) => {
|
|
4
|
+
try {
|
|
5
|
+
step(generator.next(value));
|
|
6
|
+
} catch (e) {
|
|
7
|
+
reject(e);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
var rejected = (value) => {
|
|
11
|
+
try {
|
|
12
|
+
step(generator.throw(value));
|
|
13
|
+
} catch (e) {
|
|
14
|
+
reject(e);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
18
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
import { useMutation } from "@tanstack/react-query";
|
|
22
|
+
import { useClient } from "../utils/index.js";
|
|
23
|
+
import { renameMutations } from "../../utils/renameMutations.js";
|
|
24
|
+
import { createWalletPerType } from "../../actions/index.js";
|
|
25
|
+
const CREATE_WALLET_PER_TYPE_KEY = "CREATE_WALLET_PER_TYPE";
|
|
26
|
+
const useCreateWalletPerType = () => {
|
|
27
|
+
const para = useClient();
|
|
28
|
+
const mutation = useMutation({
|
|
29
|
+
mutationKey: [CREATE_WALLET_PER_TYPE_KEY],
|
|
30
|
+
mutationFn: (..._0) => __async(void 0, [..._0], function* (args = {}) {
|
|
31
|
+
return createWalletPerType(para, args);
|
|
32
|
+
})
|
|
33
|
+
});
|
|
34
|
+
return renameMutations(mutation, "createWalletPerType");
|
|
35
|
+
};
|
|
36
|
+
export {
|
|
37
|
+
CREATE_WALLET_PER_TYPE_KEY,
|
|
38
|
+
useCreateWalletPerType
|
|
39
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Enable2faParams } from '@getpara/core-sdk';
|
|
2
|
+
export declare const ENABLE_2FA_KEY = "ENABLE_2FA";
|
|
3
|
+
/**
|
|
4
|
+
* React hook for the `enable2fa` mutation.
|
|
5
|
+
*
|
|
6
|
+
* Returns a mutation result object with all standard fields from `useMutation`, except:
|
|
7
|
+
* - `mutate` and `mutateAsync` are replaced by:
|
|
8
|
+
* - `enable2fa`: function to trigger the mutation (same as `mutate`)
|
|
9
|
+
* - `enable2faAsync`: async function to trigger the mutation (same as `mutateAsync`)
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* const { enable2fa, enable2faAsync } = useEnable2fa();
|
|
13
|
+
* enable2fa({ ...params });
|
|
14
|
+
* // or
|
|
15
|
+
* await enable2faAsync({ ...params });
|
|
16
|
+
*/
|
|
17
|
+
export declare const useEnable2fa: () => {
|
|
18
|
+
error: Error;
|
|
19
|
+
isSuccess: boolean;
|
|
20
|
+
data: void;
|
|
21
|
+
variables: Enable2faParams;
|
|
22
|
+
isError: boolean;
|
|
23
|
+
isIdle: boolean;
|
|
24
|
+
isPending: boolean;
|
|
25
|
+
status: "error" | "idle" | "pending" | "success";
|
|
26
|
+
reset: () => void;
|
|
27
|
+
context: unknown;
|
|
28
|
+
failureCount: number;
|
|
29
|
+
failureReason: Error;
|
|
30
|
+
isPaused: boolean;
|
|
31
|
+
submittedAt: number;
|
|
32
|
+
enable2fa: import("@tanstack/react-query").UseMutateFunction<void, Error, Enable2faParams, unknown>;
|
|
33
|
+
enable2faAsync: import("@tanstack/react-query").UseMutateAsyncFunction<void, Error, Enable2faParams, unknown>;
|
|
34
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
var __async = (__this, __arguments, generator) => {
|
|
2
|
+
return new Promise((resolve, reject) => {
|
|
3
|
+
var fulfilled = (value) => {
|
|
4
|
+
try {
|
|
5
|
+
step(generator.next(value));
|
|
6
|
+
} catch (e) {
|
|
7
|
+
reject(e);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
var rejected = (value) => {
|
|
11
|
+
try {
|
|
12
|
+
step(generator.throw(value));
|
|
13
|
+
} catch (e) {
|
|
14
|
+
reject(e);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
18
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
import { useMutation } from "@tanstack/react-query";
|
|
22
|
+
import { useClient } from "../utils/index.js";
|
|
23
|
+
import { renameMutations } from "../../utils/renameMutations.js";
|
|
24
|
+
import { enable2fa } from "../../actions/index.js";
|
|
25
|
+
const ENABLE_2FA_KEY = "ENABLE_2FA";
|
|
26
|
+
const useEnable2fa = () => {
|
|
27
|
+
const para = useClient();
|
|
28
|
+
const mutation = useMutation({
|
|
29
|
+
mutationKey: [ENABLE_2FA_KEY],
|
|
30
|
+
mutationFn: (args) => __async(void 0, null, function* () {
|
|
31
|
+
return enable2fa(para, args);
|
|
32
|
+
})
|
|
33
|
+
});
|
|
34
|
+
return renameMutations(mutation, "enable2fa");
|
|
35
|
+
};
|
|
36
|
+
export {
|
|
37
|
+
ENABLE_2FA_KEY,
|
|
38
|
+
useEnable2fa
|
|
39
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { ExportPrivateKeyResponse } from '@getpara/core-sdk';
|
|
2
|
+
export declare const EXPORT_PRIVATE_KEY_KEY = "EXPORT_PRIVATE_KEY";
|
|
3
|
+
/**
|
|
4
|
+
* React hook for the `exportPrivateKey` mutation.
|
|
5
|
+
*
|
|
6
|
+
* Returns the portal URL for the export flow. On web, open this URL in a popup
|
|
7
|
+
* (`shouldOpenPopup: true`). On React Native, load this URL in a WebView.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* const { exportPrivateKey, exportPrivateKeyAsync } = useExportPrivateKey();
|
|
11
|
+
* const { url } = await exportPrivateKeyAsync({ walletId: '...' });
|
|
12
|
+
*/
|
|
13
|
+
export declare const useExportPrivateKey: () => {
|
|
14
|
+
error: Error;
|
|
15
|
+
isSuccess: boolean;
|
|
16
|
+
data: ExportPrivateKeyResponse;
|
|
17
|
+
variables: {
|
|
18
|
+
walletId?: string;
|
|
19
|
+
shouldOpenPopup?: boolean;
|
|
20
|
+
};
|
|
21
|
+
isError: boolean;
|
|
22
|
+
isIdle: boolean;
|
|
23
|
+
isPending: boolean;
|
|
24
|
+
status: "error" | "idle" | "pending" | "success";
|
|
25
|
+
reset: () => void;
|
|
26
|
+
context: unknown;
|
|
27
|
+
failureCount: number;
|
|
28
|
+
failureReason: Error;
|
|
29
|
+
isPaused: boolean;
|
|
30
|
+
submittedAt: number;
|
|
31
|
+
exportPrivateKey: import("@tanstack/react-query").UseMutateFunction<ExportPrivateKeyResponse, Error, {
|
|
32
|
+
walletId?: string;
|
|
33
|
+
shouldOpenPopup?: boolean;
|
|
34
|
+
}, unknown>;
|
|
35
|
+
exportPrivateKeyAsync: import("@tanstack/react-query").UseMutateAsyncFunction<ExportPrivateKeyResponse, Error, {
|
|
36
|
+
walletId?: string;
|
|
37
|
+
shouldOpenPopup?: boolean;
|
|
38
|
+
}, unknown>;
|
|
39
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
17
|
+
var __async = (__this, __arguments, generator) => {
|
|
18
|
+
return new Promise((resolve, reject) => {
|
|
19
|
+
var fulfilled = (value) => {
|
|
20
|
+
try {
|
|
21
|
+
step(generator.next(value));
|
|
22
|
+
} catch (e) {
|
|
23
|
+
reject(e);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
var rejected = (value) => {
|
|
27
|
+
try {
|
|
28
|
+
step(generator.throw(value));
|
|
29
|
+
} catch (e) {
|
|
30
|
+
reject(e);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
34
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
import { useMutation } from "@tanstack/react-query";
|
|
38
|
+
import { useClient } from "../utils/index.js";
|
|
39
|
+
import { renameMutations } from "../../utils/renameMutations.js";
|
|
40
|
+
import { exportPrivateKey } from "../../actions/index.js";
|
|
41
|
+
import { useWallet } from "../queries/index.js";
|
|
42
|
+
const EXPORT_PRIVATE_KEY_KEY = "EXPORT_PRIVATE_KEY";
|
|
43
|
+
const useExportPrivateKey = () => {
|
|
44
|
+
const para = useClient();
|
|
45
|
+
const { data: activeWallet } = useWallet();
|
|
46
|
+
const mutation = useMutation({
|
|
47
|
+
mutationKey: [EXPORT_PRIVATE_KEY_KEY],
|
|
48
|
+
mutationFn: (args) => __async(void 0, null, function* () {
|
|
49
|
+
const result = yield exportPrivateKey(para, __spreadValues({
|
|
50
|
+
walletId: activeWallet == null ? void 0 : activeWallet.id
|
|
51
|
+
}, args));
|
|
52
|
+
return result;
|
|
53
|
+
})
|
|
54
|
+
});
|
|
55
|
+
return renameMutations(
|
|
56
|
+
mutation,
|
|
57
|
+
"exportPrivateKey"
|
|
58
|
+
);
|
|
59
|
+
};
|
|
60
|
+
export {
|
|
61
|
+
EXPORT_PRIVATE_KEY_KEY,
|
|
62
|
+
useExportPrivateKey
|
|
63
|
+
};
|