@argent/x-shared 1.31.0 → 1.31.1
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.
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Address } from '../chains/starknet/address';
|
|
2
|
-
import { OnchainRecovery } from './schema';
|
|
2
|
+
import { OnchainRecovery, StartOnchainRecovery } from './schema';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* IOnchainRecoveryService interface
|
|
6
6
|
*/
|
|
7
7
|
export interface IOnchainRecoveryService {
|
|
8
|
-
startRecovery(address: Address, feeToken: Address, publicKey: string, privateKey: string): Promise<
|
|
8
|
+
startRecovery(address: Address, feeToken: Address, publicKey: string, privateKey: string): Promise<StartOnchainRecovery>;
|
|
9
9
|
getRecovery(address: Address, recoveryId?: number): Promise<OnchainRecovery>;
|
|
10
10
|
cancelRecovery(address: Address, feeToken: Address, publicKey: string, privateKey: string): Promise<void>;
|
|
11
11
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Address } from '../chains/starknet/address';
|
|
2
2
|
import { IHttpService } from '../http';
|
|
3
3
|
import { IOnchainRecoveryService } from './IOnchainRecoveryService';
|
|
4
|
-
import { OnchainRecovery } from './schema';
|
|
4
|
+
import { OnchainRecovery, StartOnchainRecovery } from './schema';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* RecoveryService class implements IRecoveryService interface.
|
|
@@ -10,7 +10,29 @@ export declare class OnchainRecoveryService implements IOnchainRecoveryService {
|
|
|
10
10
|
protected readonly apiBase: string;
|
|
11
11
|
private readonly httpService;
|
|
12
12
|
constructor(apiBase: string, httpService: IHttpService);
|
|
13
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Starts the recovery process for a given address.
|
|
15
|
+
* @param address - The address to recover.
|
|
16
|
+
* @param feeToken - The token to be used for the recovery fee.
|
|
17
|
+
* @param publicKey - The public key of the signer.
|
|
18
|
+
* @param privateKey - The private key of the signer.
|
|
19
|
+
* @returns A promise that resolves to the recovery details.
|
|
20
|
+
*/
|
|
21
|
+
startRecovery(address: Address, feeToken: Address, publicKey: string, privateKey: string): Promise<StartOnchainRecovery>;
|
|
22
|
+
/**
|
|
23
|
+
* Retrieves the on-chain recovery details for a given address and recovery ID.
|
|
24
|
+
* If no recovery ID is provided, it retrieves the latest recovery details.
|
|
25
|
+
* @param address - The address to retrieve the recovery details for.
|
|
26
|
+
* @param recoveryId - (Optional) The recovery ID to retrieve the details for. If not provided, retrieves the latest recovery details.
|
|
27
|
+
* @returns A promise that resolves to the on-chain recovery details.
|
|
28
|
+
*/
|
|
14
29
|
getRecovery(address: Address, recoveryId?: number): Promise<OnchainRecovery>;
|
|
15
|
-
|
|
30
|
+
/**
|
|
31
|
+
* Cancels the on-chain recovery process for a given address.
|
|
32
|
+
* @param address - The address for which to cancel the recovery process.
|
|
33
|
+
* @param publicKey - The public key of the signer.
|
|
34
|
+
* @param privateKey - The private key of the signer.
|
|
35
|
+
* @returns A promise that resolves when the recovery process is successfully canceled.
|
|
36
|
+
*/
|
|
37
|
+
cancelRecovery(address: Address, publicKey: string, privateKey: string): Promise<void>;
|
|
16
38
|
}
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
|
|
3
|
+
export declare const startOnchainRecoverySchema: z.ZodObject<{
|
|
4
|
+
recoveryId: z.ZodNumber;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
recoveryId: number;
|
|
7
|
+
}, {
|
|
8
|
+
recoveryId: number;
|
|
9
|
+
}>;
|
|
3
10
|
export declare const recoveryBodySchema: z.ZodObject<{
|
|
4
11
|
feeToken: z.ZodEffects<z.ZodPipeline<z.ZodString, z.ZodEffects<z.ZodString, string, string>>, `0x${string}`, string>;
|
|
5
12
|
signerSignature: z.ZodObject<{
|
|
@@ -55,17 +62,28 @@ export declare const recoveryBodySchema: z.ZodObject<{
|
|
|
55
62
|
}>;
|
|
56
63
|
export declare const recoveryStatusSchema: z.ZodEnum<["ONGOING", "COMPLETED", "ERROR", "CANCELLED", "AWAITING_FUNDS"]>;
|
|
57
64
|
export declare const onchainRecoverySchema: z.ZodObject<{
|
|
58
|
-
status: z.ZodEnum<["ONGOING", "COMPLETED", "ERROR", "CANCELLED", "AWAITING_FUNDS"]
|
|
65
|
+
status: z.ZodOptional<z.ZodEnum<["ONGOING", "COMPLETED", "ERROR", "CANCELLED", "AWAITING_FUNDS"]>>;
|
|
59
66
|
recoveryId: z.ZodOptional<z.ZodNumber>;
|
|
60
|
-
completionTime: z.ZodArray<z.ZodNumber, "many"
|
|
67
|
+
completionTime: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
61
68
|
}, "strip", z.ZodTypeAny, {
|
|
62
|
-
status
|
|
63
|
-
completionTime: number[];
|
|
69
|
+
status?: "ONGOING" | "COMPLETED" | "ERROR" | "CANCELLED" | "AWAITING_FUNDS" | undefined;
|
|
64
70
|
recoveryId?: number | undefined;
|
|
71
|
+
completionTime?: number[] | undefined;
|
|
65
72
|
}, {
|
|
66
|
-
status
|
|
67
|
-
completionTime: number[];
|
|
73
|
+
status?: "ONGOING" | "COMPLETED" | "ERROR" | "CANCELLED" | "AWAITING_FUNDS" | undefined;
|
|
68
74
|
recoveryId?: number | undefined;
|
|
75
|
+
completionTime?: number[] | undefined;
|
|
69
76
|
}>;
|
|
70
|
-
export
|
|
77
|
+
export declare const startOnchainRecoveryErrorStatusSchema: z.ZodEnum<["undeployedAccount", "notEnoughToPayFees"]>;
|
|
78
|
+
export declare const startOnchainRecoveryErrorSchema: z.ZodObject<{
|
|
79
|
+
status: z.ZodEnum<["undeployedAccount", "notEnoughToPayFees"]>;
|
|
80
|
+
}, "strip", z.ZodTypeAny, {
|
|
81
|
+
status: "undeployedAccount" | "notEnoughToPayFees";
|
|
82
|
+
}, {
|
|
83
|
+
status: "undeployedAccount" | "notEnoughToPayFees";
|
|
84
|
+
}>;
|
|
85
|
+
export type StartOnchainRecovery = z.infer<typeof startOnchainRecoverySchema>;
|
|
71
86
|
export type OnchainRecovery = z.infer<typeof onchainRecoverySchema>;
|
|
87
|
+
export type RecoveryStatus = z.infer<typeof recoveryStatusSchema>;
|
|
88
|
+
export type StartOnchainRecoveryError = z.infer<typeof startOnchainRecoveryErrorSchema>;
|
|
89
|
+
export type StartOnchainRecoveryErrorStatus = z.infer<typeof startOnchainRecoveryErrorStatusSchema>;
|