@dynamic-labs-wallet/browser 0.0.319 → 0.0.320
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/package.json +2 -2
- package/src/backup/encryption/argon2.d.ts +0 -10
- package/src/backup/encryption/argon2.d.ts.map +0 -1
- package/src/backup/encryption/config.d.ts +0 -39
- package/src/backup/encryption/config.d.ts.map +0 -1
- package/src/backup/encryption/constants.d.ts +0 -35
- package/src/backup/encryption/constants.d.ts.map +0 -1
- package/src/backup/encryption/core.d.ts +0 -31
- package/src/backup/encryption/core.d.ts.map +0 -1
- package/src/backup/encryption/pbkdf2.d.ts +0 -10
- package/src/backup/encryption/pbkdf2.d.ts.map +0 -1
- package/src/backup/encryption/types.d.ts +0 -46
- package/src/backup/encryption/types.d.ts.map +0 -1
- package/src/backup/encryption/utils.d.ts +0 -9
- package/src/backup/encryption/utils.d.ts.map +0 -1
- package/src/backup/providers/googleDrive.d.ts +0 -19
- package/src/backup/providers/googleDrive.d.ts.map +0 -1
- package/src/backup/providers/iCloud.d.ts +0 -64
- package/src/backup/providers/iCloud.d.ts.map +0 -1
- package/src/backup/utils.d.ts +0 -14
- package/src/backup/utils.d.ts.map +0 -1
- package/src/client.d.ts +0 -770
- package/src/client.d.ts.map +0 -1
- package/src/constants.d.ts +0 -9
- package/src/constants.d.ts.map +0 -1
- package/src/errorConstants.d.ts +0 -13
- package/src/errorConstants.d.ts.map +0 -1
- package/src/index.d.ts +0 -14
- package/src/index.d.ts.map +0 -1
- package/src/mpc/index.d.ts +0 -5
- package/src/mpc/index.d.ts.map +0 -1
- package/src/mpc/mpc.d.ts +0 -20
- package/src/mpc/mpc.d.ts.map +0 -1
- package/src/mpc/types.d.ts +0 -6
- package/src/mpc/types.d.ts.map +0 -1
- package/src/normalizeAddress.d.ts +0 -7
- package/src/normalizeAddress.d.ts.map +0 -1
- package/src/passwordValidation.d.ts +0 -29
- package/src/passwordValidation.d.ts.map +0 -1
- package/src/queue.d.ts +0 -96
- package/src/queue.d.ts.map +0 -1
- package/src/services/encryption.d.ts +0 -19
- package/src/services/encryption.d.ts.map +0 -1
- package/src/services/localStorage.d.ts +0 -34
- package/src/services/localStorage.d.ts.map +0 -1
- package/src/services/logger.d.ts +0 -6
- package/src/services/logger.d.ts.map +0 -1
- package/src/types.d.ts +0 -129
- package/src/types.d.ts.map +0 -1
- package/src/utils.d.ts +0 -90
- package/src/utils.d.ts.map +0 -1
- package/src/walletState.d.ts +0 -28
- package/src/walletState.d.ts.map +0 -1
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs-wallet/browser",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.320",
|
|
4
4
|
"license": "Licensed under the Dynamic Labs, Inc. Terms Of Service (https://www.dynamic.xyz/terms-conditions)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@dynamic-labs-wallet/core": "0.0.
|
|
7
|
+
"@dynamic-labs-wallet/core": "0.0.320",
|
|
8
8
|
"@dynamic-labs/sdk-api-core": "^0.0.900",
|
|
9
9
|
"argon2id": "1.0.1",
|
|
10
10
|
"axios": "1.13.5",
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { EncryptionConfig } from './config.js';
|
|
2
|
-
import type { KeyDerivationParams } from './types.js';
|
|
3
|
-
/**
|
|
4
|
-
* Derives a key using Argon2id algorithm
|
|
5
|
-
* @param params - Key derivation parameters
|
|
6
|
-
* @param encryptionConfig - Encryption configuration
|
|
7
|
-
* @returns Promise<CryptoKey>
|
|
8
|
-
*/
|
|
9
|
-
export declare const deriveArgon2Key: ({ password, salt }: KeyDerivationParams, encryptionConfig: EncryptionConfig) => Promise<CryptoKey>;
|
|
10
|
-
//# sourceMappingURL=argon2.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"argon2.d.ts","sourceRoot":"","sources":["../../../src/backup/encryption/argon2.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,OAAO,KAAK,EAA0B,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAE9E;;;;;GAKG;AACH,eAAO,MAAM,eAAe,uBACN,mBAAmB,oBACrB,gBAAgB,KACjC,OAAO,CAAC,SAAS,CAyBnB,CAAC"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { EncryptionVersion } from './constants.js';
|
|
2
|
-
import type { Argon2EncryptionConfig, BaseEncryptionConfig } from './types.js';
|
|
3
|
-
/**
|
|
4
|
-
* Encryption configuration for each version
|
|
5
|
-
*/
|
|
6
|
-
export declare const ENCRYPTION_VERSIONS: {
|
|
7
|
-
readonly v1: {
|
|
8
|
-
readonly version: EncryptionVersion.V1_LEGACY;
|
|
9
|
-
readonly algorithm: "AES-GCM";
|
|
10
|
-
readonly keyDerivation: "PBKDF2";
|
|
11
|
-
readonly iterations: 100000;
|
|
12
|
-
readonly hashAlgorithm: "SHA-256";
|
|
13
|
-
readonly algorithmLength: 256;
|
|
14
|
-
};
|
|
15
|
-
readonly v2: {
|
|
16
|
-
readonly version: EncryptionVersion.V2_PBKDF2;
|
|
17
|
-
readonly algorithm: "AES-GCM";
|
|
18
|
-
readonly keyDerivation: "PBKDF2";
|
|
19
|
-
readonly iterations: 1000000;
|
|
20
|
-
readonly hashAlgorithm: "SHA-256";
|
|
21
|
-
readonly algorithmLength: 256;
|
|
22
|
-
};
|
|
23
|
-
readonly v3: Argon2EncryptionConfig;
|
|
24
|
-
};
|
|
25
|
-
/**
|
|
26
|
-
* Type for the encryption configuration
|
|
27
|
-
*/
|
|
28
|
-
export type EncryptionConfig = BaseEncryptionConfig | Argon2EncryptionConfig;
|
|
29
|
-
/**
|
|
30
|
-
* Helper function to get encryption configuration by version string
|
|
31
|
-
* @param version - The version string (e.g., 'v1', 'v2', 'v3')
|
|
32
|
-
* @returns The encryption configuration for the specified version
|
|
33
|
-
*/
|
|
34
|
-
export declare const getEncryptionConfig: (version?: string) => EncryptionConfig;
|
|
35
|
-
/**
|
|
36
|
-
* Check if a configuration uses Argon2
|
|
37
|
-
*/
|
|
38
|
-
export declare const isArgon2Config: (config: EncryptionConfig) => config is Argon2EncryptionConfig;
|
|
39
|
-
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/backup/encryption/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAQL,iBAAiB,EAKlB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAE/E;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;iBA2BzB,sBAAsB;CACnB,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,oBAAoB,GAAG,sBAAsB,CAAC;AAE7E;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,aAAc,MAAM,KAAG,gBAYtD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,WAAY,gBAAgB,KAAG,MAAM,IAAI,sBAEnE,CAAC"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Encryption version identifiers
|
|
3
|
-
*/
|
|
4
|
-
export declare enum EncryptionVersion {
|
|
5
|
-
V1_LEGACY = "v1",
|
|
6
|
-
V2_PBKDF2 = "v2",
|
|
7
|
-
V3_ARGON2 = "v3"
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Current default version for new encryptions
|
|
11
|
-
*/
|
|
12
|
-
export declare const ENCRYPTION_VERSION_CURRENT = EncryptionVersion.V3_ARGON2;
|
|
13
|
-
/**
|
|
14
|
-
* Algorithm constants
|
|
15
|
-
*/
|
|
16
|
-
export declare const PBKDF2_ALGORITHM = "PBKDF2";
|
|
17
|
-
export declare const PBKDF2_HASH_ALGORITHM = "SHA-256";
|
|
18
|
-
export declare const HASH_ALGORITHM = "SHA-256";
|
|
19
|
-
export declare const ARGON2_ALGORITHM = "Argon2id";
|
|
20
|
-
export declare const AES_GCM_ALGORITHM = "AES-GCM";
|
|
21
|
-
export declare const AES_GCM_LENGTH = 256;
|
|
22
|
-
/**
|
|
23
|
-
* Argon2 configuration constants, values were chosen based on RFC (https://www.rfc-editor.org/rfc/rfc9106.html#name-parameter-choice)
|
|
24
|
-
* taking into account that this runs in the client, possibly in smartphones with limited resources
|
|
25
|
-
*/
|
|
26
|
-
export declare const ARGON2_MEMORY_SIZE = 65536;
|
|
27
|
-
export declare const ARGON2_ITERATIONS = 3;
|
|
28
|
-
export declare const ARGON2_PARALLELISM = 2;
|
|
29
|
-
export declare const ARGON2_HASH_LENGTH = 32;
|
|
30
|
-
/**
|
|
31
|
-
* PBKDF2 configuration constants
|
|
32
|
-
*/
|
|
33
|
-
export declare const PBKDF2_ITERATIONS_V1 = 100000;
|
|
34
|
-
export declare const PBKDF2_ITERATIONS_V2 = 1000000;
|
|
35
|
-
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/backup/encryption/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,iBAAiB;IAC3B,SAAS,OAAO;IAChB,SAAS,OAAO;IAChB,SAAS,OAAO;CACjB;AAED;;GAEG;AACH,eAAO,MAAM,0BAA0B,8BAA8B,CAAC;AAEtE;;GAEG;AACH,eAAO,MAAM,gBAAgB,WAAW,CAAC;AACzC,eAAO,MAAM,qBAAqB,YAAY,CAAC;AAC/C,eAAO,MAAM,cAAc,YAAY,CAAC;AACxC,eAAO,MAAM,gBAAgB,aAAa,CAAC;AAC3C,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAC3C,eAAO,MAAM,cAAc,MAAM,CAAC;AAElC;;;GAGG;AACH,eAAO,MAAM,kBAAkB,QAAQ,CAAC;AACxC,eAAO,MAAM,iBAAiB,IAAI,CAAC;AACnC,eAAO,MAAM,kBAAkB,IAAI,CAAC;AACpC,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAErC;;GAEG;AACH,eAAO,MAAM,oBAAoB,SAAS,CAAC;AAC3C,eAAO,MAAM,oBAAoB,UAAU,CAAC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { EncryptionMetadata } from '@dynamic-labs-wallet/core';
|
|
2
|
-
import type { DecryptionData, EncryptedData } from './types.js';
|
|
3
|
-
export declare const INVALID_PASSWORD_ERROR = "Decryption failed: Invalid password. Please check your password and try again.";
|
|
4
|
-
export declare class InvalidPasswordError extends Error {
|
|
5
|
-
constructor();
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Encrypts data using the specified encryption version.
|
|
9
|
-
* Always uses the latest encryption configuration for new encryptions by default.
|
|
10
|
-
*/
|
|
11
|
-
export declare const encryptData: ({ data, password, version, }: {
|
|
12
|
-
data: string;
|
|
13
|
-
password: string;
|
|
14
|
-
version?: string;
|
|
15
|
-
}) => Promise<EncryptedData>;
|
|
16
|
-
/**
|
|
17
|
-
* Decrypts data with version-based configuration.
|
|
18
|
-
* Uses the version field from the data to determine encryption parameters.
|
|
19
|
-
* Falls back to legacy version for backward compatibility if no version is specified.
|
|
20
|
-
* For v3 (Argon2), retries with parallelism=1 if an OperationError occurs.
|
|
21
|
-
*/
|
|
22
|
-
export declare const decryptData: ({ data, password }: {
|
|
23
|
-
data: DecryptionData;
|
|
24
|
-
password: string;
|
|
25
|
-
}) => Promise<string>;
|
|
26
|
-
/**
|
|
27
|
-
* Gets encryption metadata for a specific version.
|
|
28
|
-
* Used when we need to include metadata in legacy systems or APIs that require it.
|
|
29
|
-
*/
|
|
30
|
-
export declare const getEncryptionMetadataForVersion: (version: string) => EncryptionMetadata;
|
|
31
|
-
//# sourceMappingURL=core.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../src/backup/encryption/core.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAMpE,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAuB,MAAM,YAAY,CAAC;AAGrF,eAAO,MAAM,sBAAsB,mFAAmF,CAAC;AAEvH,qBAAa,oBAAqB,SAAQ,KAAK;;CAK9C;AAoBD;;;GAGG;AACH,eAAO,MAAM,WAAW,iCAIrB;IACD,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,KAAG,OAAO,CAAC,aAAa,CA2BxB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,WAAW,uBAA8B;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,KAAG,OAAO,CAAC,MAAM,CAyDhH,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,+BAA+B,YAAa,MAAM,KAAG,kBAmBjE,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { EncryptionConfig } from './config.js';
|
|
2
|
-
import type { KeyDerivationParams } from './types.js';
|
|
3
|
-
/**
|
|
4
|
-
* Derives a key using PBKDF2 algorithm
|
|
5
|
-
* @param params - Key derivation parameters
|
|
6
|
-
* @param encryptionConfig - Encryption configuration
|
|
7
|
-
* @returns Promise<CryptoKey>
|
|
8
|
-
*/
|
|
9
|
-
export declare const derivePBKDF2Key: ({ password, salt }: KeyDerivationParams, encryptionConfig: EncryptionConfig) => Promise<CryptoKey>;
|
|
10
|
-
//# sourceMappingURL=pbkdf2.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pbkdf2.d.ts","sourceRoot":"","sources":["../../../src/backup/encryption/pbkdf2.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAGtD;;;;;GAKG;AACH,eAAO,MAAM,eAAe,uBACN,mBAAmB,oBACrB,gBAAgB,KACjC,OAAO,CAAC,SAAS,CAoBnB,CAAC"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import type { EncryptionVersion } from './constants.js';
|
|
2
|
-
/**
|
|
3
|
-
* Base encryption configuration
|
|
4
|
-
*/
|
|
5
|
-
export interface BaseEncryptionConfig {
|
|
6
|
-
version: EncryptionVersion;
|
|
7
|
-
algorithm: string;
|
|
8
|
-
keyDerivation: string;
|
|
9
|
-
iterations: number;
|
|
10
|
-
hashAlgorithm: string;
|
|
11
|
-
algorithmLength: number;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Argon2-specific encryption configuration
|
|
15
|
-
*/
|
|
16
|
-
export interface Argon2EncryptionConfig extends BaseEncryptionConfig {
|
|
17
|
-
memorySize: number;
|
|
18
|
-
parallelism: number;
|
|
19
|
-
hashLength: number;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Encrypted data structure
|
|
23
|
-
*/
|
|
24
|
-
export interface EncryptedData {
|
|
25
|
-
salt: string;
|
|
26
|
-
iv: string;
|
|
27
|
-
cipher: string;
|
|
28
|
-
version: string;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Decryption input data structure
|
|
32
|
-
*/
|
|
33
|
-
export interface DecryptionData {
|
|
34
|
-
salt: string;
|
|
35
|
-
iv: string;
|
|
36
|
-
cipher: string;
|
|
37
|
-
version?: string;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Key derivation parameters
|
|
41
|
-
*/
|
|
42
|
-
export interface KeyDerivationParams {
|
|
43
|
-
password: string;
|
|
44
|
-
salt: Uint8Array;
|
|
45
|
-
}
|
|
46
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/backup/encryption/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAExD;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,iBAAiB,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,sBAAuB,SAAQ,oBAAoB;IAClE,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,UAAU,CAAC;CAClB"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Utility functions for encryption operations
|
|
3
|
-
* These functions are separated to avoid circular dependencies
|
|
4
|
-
*/
|
|
5
|
-
export declare const bytesToBase64: (arr: Uint8Array) => string;
|
|
6
|
-
export declare const stringToBytes: (str: string) => Uint8Array;
|
|
7
|
-
export declare const base64ToBytes: (base64: string) => Uint8Array;
|
|
8
|
-
export declare const ensureBase64Padding: (str: string) => string;
|
|
9
|
-
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/backup/encryption/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,aAAa,QAAS,UAAU,WAE5C,CAAC;AAEF,eAAO,MAAM,aAAa,QAAS,MAAM,eAExC,CAAC;AAEF,eAAO,MAAM,aAAa,WAAY,MAAM,eAE3C,CAAC;AAGF,eAAO,MAAM,mBAAmB,QAAS,MAAM,KAAG,MAEjD,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export declare const uploadFileToGoogleDriveAppStorage: ({ accessToken, fileName, jsonData, }: {
|
|
2
|
-
accessToken: string;
|
|
3
|
-
fileName: string;
|
|
4
|
-
jsonData: unknown;
|
|
5
|
-
}) => Promise<any>;
|
|
6
|
-
export declare const uploadFileToGoogleDrivePersonal: ({ accessToken, fileName, jsonData, }: {
|
|
7
|
-
accessToken: string;
|
|
8
|
-
fileName: string;
|
|
9
|
-
jsonData: unknown;
|
|
10
|
-
}) => Promise<any>;
|
|
11
|
-
export declare const listFilesFromGoogleDrive: ({ accessToken, fileName, }: {
|
|
12
|
-
accessToken: string;
|
|
13
|
-
fileName: string;
|
|
14
|
-
}) => Promise<any>;
|
|
15
|
-
export declare const downloadFileFromGoogleDrive: ({ accessToken, fileName, }: {
|
|
16
|
-
accessToken: string;
|
|
17
|
-
fileName: string;
|
|
18
|
-
}) => Promise<unknown | null>;
|
|
19
|
-
//# sourceMappingURL=googleDrive.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"googleDrive.d.ts","sourceRoot":"","sources":["../../../src/backup/providers/googleDrive.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iCAAiC,yCAI3C;IACD,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;CACnB,iBAOA,CAAC;AAEF,eAAO,MAAM,+BAA+B,yCAIzC;IACD,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;CACnB,iBAOA,CAAC;AAuCF,eAAO,MAAM,wBAAwB,+BAGlC;IACD,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB,iBAsBA,CAAC;AAEF,eAAO,MAAM,2BAA2B,+BAGrC;IACD,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB,KAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CA6BzB,CAAC"}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import type { BackupData, ICloudConfig } from '@dynamic-labs-wallet/core';
|
|
2
|
-
import type * as CloudKitTypes from 'tsl-apple-cloudkit';
|
|
3
|
-
export type SavedRecord = CloudKitTypes.RecordReceived;
|
|
4
|
-
export type ICloudBackupRecord = {
|
|
5
|
-
recordName: string;
|
|
6
|
-
created: number;
|
|
7
|
-
modified: number;
|
|
8
|
-
backupData: BackupData;
|
|
9
|
-
};
|
|
10
|
-
export type ICloudAuthOptions = {
|
|
11
|
-
pollIntervalMs?: number;
|
|
12
|
-
timeoutMs?: number;
|
|
13
|
-
signal?: AbortSignal;
|
|
14
|
-
};
|
|
15
|
-
export declare const loadCloudKit: () => Promise<void>;
|
|
16
|
-
export declare const configureCloudKit: (config?: ICloudConfig, signInButtonId?: string) => void;
|
|
17
|
-
export declare const resetCloudKitConfig: () => void;
|
|
18
|
-
/**
|
|
19
|
-
* Ensures CloudKit is loaded and configured without requiring the auth flow.
|
|
20
|
-
* Used for checking authentication status before showing sign-in UI.
|
|
21
|
-
*/
|
|
22
|
-
export declare const ensureCloudKitInitialized: (config?: ICloudConfig) => Promise<boolean>;
|
|
23
|
-
/**
|
|
24
|
-
* Check if user is already authenticated using fetchCurrentUserIdentity.
|
|
25
|
-
* This is more reliable than setUpAuth which sometimes returns undefined
|
|
26
|
-
* even when the user has an existing session.
|
|
27
|
-
*/
|
|
28
|
-
export declare const isUserAuthenticated: (container: CloudKitTypes.Container) => Promise<boolean>;
|
|
29
|
-
/**
|
|
30
|
-
* Check if the user is authenticated with iCloud using the default container.
|
|
31
|
-
* Returns false if CloudKit is not configured or user is not authenticated.
|
|
32
|
-
* Optionally accepts config to auto-initialize CloudKit before checking.
|
|
33
|
-
*/
|
|
34
|
-
export declare const isICloudAuthenticated: (config?: ICloudConfig) => Promise<boolean>;
|
|
35
|
-
/**
|
|
36
|
-
* Cancel any ongoing authentication attempt
|
|
37
|
-
*/
|
|
38
|
-
export declare const cancelICloudAuth: () => void;
|
|
39
|
-
export declare const ensureICloudAuth: (onSignInRequired?: () => void, onSignInComplete?: () => void, onAuthStatusUpdate?: (status: string) => void, options?: ICloudAuthOptions) => Promise<void>;
|
|
40
|
-
/**
|
|
41
|
-
* Save backup data to iCloud with retry logic
|
|
42
|
-
* Optionally accepts config to auto-initialize CloudKit before saving.
|
|
43
|
-
*/
|
|
44
|
-
export declare const saveBackupToICloud: (backupData: unknown, retryOptions?: {
|
|
45
|
-
maxAttempts?: number;
|
|
46
|
-
retryInterval?: number;
|
|
47
|
-
}, config?: ICloudConfig) => Promise<SavedRecord>;
|
|
48
|
-
/**
|
|
49
|
-
* List all backups from iCloud
|
|
50
|
-
* Optionally accepts config to auto-initialize CloudKit before listing.
|
|
51
|
-
*/
|
|
52
|
-
export declare const listICloudBackups: (config?: ICloudConfig) => Promise<ICloudBackupRecord[]>;
|
|
53
|
-
/**
|
|
54
|
-
* Retrieve a specific backup from iCloud by record name
|
|
55
|
-
* Optionally accepts config to auto-initialize CloudKit before fetching.
|
|
56
|
-
*/
|
|
57
|
-
export declare const getICloudBackup: (recordName: string, config?: ICloudConfig) => Promise<ICloudBackupRecord | null>;
|
|
58
|
-
/**
|
|
59
|
-
* Delete a backup from iCloud
|
|
60
|
-
* Optionally accepts config to auto-initialize CloudKit before deleting.
|
|
61
|
-
*/
|
|
62
|
-
export declare const deleteICloudBackup: (recordName: string, config?: ICloudConfig) => Promise<void>;
|
|
63
|
-
export declare const initializeCloudKit: (config?: ICloudConfig, signInButtonId?: string, onSignInRequired?: () => void, onSignInComplete?: () => void, onAuthStatusUpdate?: (status: string) => void, authOptions?: ICloudAuthOptions) => Promise<void>;
|
|
64
|
-
//# sourceMappingURL=iCloud.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"iCloud.d.ts","sourceRoot":"","sources":["../../../src/backup/providers/iCloud.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC1E,OAAO,KAAK,KAAK,aAAa,MAAM,oBAAoB,CAAC;AAIzD,MAAM,MAAM,WAAW,GAAG,aAAa,CAAC,cAAc,CAAC;AAEvD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,UAAU,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,CAAC;AAsCF,eAAO,MAAM,YAAY,QAAO,OAAO,CAAC,IAAI,CAkB3C,CAAC;AAEF,eAAO,MAAM,iBAAiB,YAAa,YAAY,mBAAmB,MAAM,KAAG,IA+BlF,CAAC;AAEF,eAAO,MAAM,mBAAmB,QAAO,IAGtC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,yBAAyB,YAAmB,YAAY,KAAG,OAAO,CAAC,OAAO,CAYtF,CAAC;AAaF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,cAAqB,aAAa,CAAC,SAAS,KAAG,OAAO,CAAC,OAAO,CAO7F,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,YAAa,YAAY,KAAG,OAAO,CAAC,OAAO,CAYzE,CAAC;AAEL;;GAEG;AACH,eAAO,MAAM,gBAAgB,QAAO,IAKnC,CAAC;AAEF,eAAO,MAAM,gBAAgB,sBACR,MAAM,IAAI,qBACV,MAAM,IAAI,uBACR,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,YACnC,iBAAiB,KAC1B,OAAO,CAAC,IAAI,CAgHd,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,eACjB,OAAO,iBACJ;IAAE,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAAE,WACtD,YAAY,KACpB,OAAO,CAAC,WAAW,CAuClB,CAAC;AAEL;;;GAGG;AACH,eAAO,MAAM,iBAAiB,YAAa,YAAY,KAAG,OAAO,CAAC,kBAAkB,EAAE,CAuClF,CAAC;AAEL;;;GAGG;AACH,eAAO,MAAM,eAAe,eAAgB,MAAM,WAAW,YAAY,KAAG,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAuCzG,CAAC;AAEL;;;GAGG;AACH,eAAO,MAAM,kBAAkB,eAAgB,MAAM,WAAW,YAAY,KAAG,OAAO,CAAC,IAAI,CAiBvF,CAAC;AAEL,eAAO,MAAM,kBAAkB,YACpB,YAAY,mBACJ,MAAM,qBACJ,MAAM,IAAI,qBACV,MAAM,IAAI,uBACR,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,gBAC/B,iBAAiB,KAC9B,OAAO,CAAC,IAAI,CASd,CAAC"}
|
package/src/backup/utils.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Uploads a backup to Google Drive App
|
|
3
|
-
* @param accessToken - The access token for the Google Drive API
|
|
4
|
-
* @param fileName - The name of the file to upload
|
|
5
|
-
* @param backupData - The data to upload
|
|
6
|
-
* @param accountAddress - The account address associated with the backup
|
|
7
|
-
*/
|
|
8
|
-
export declare const uploadBackupToGoogleDrive: ({ accessToken, fileName, backupData, accountAddress, }: {
|
|
9
|
-
accessToken: string;
|
|
10
|
-
fileName: string;
|
|
11
|
-
backupData: any;
|
|
12
|
-
accountAddress: string;
|
|
13
|
-
}) => Promise<void>;
|
|
14
|
-
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/backup/utils.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,2DAKnC;IACD,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,GAAG,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;CACxB,kBAmDA,CAAC"}
|