wallaby-cash 2.0.1-alpha.34 → 2.0.1-alpha.35
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/README.md +3 -0
- package/dist/base.d.ts +9 -13
- package/dist/eth-crypto-utils/createIdentity.d.ts +1 -0
- package/dist/helpers/json-safe-parse.d.ts +2 -1
- package/dist/helpers/lock-manager.service.d.ts +20 -0
- package/dist/helpers/validation.d.ts +4 -0
- package/dist/helpers/with-lock.d.ts +5 -0
- package/dist/index.cjs.js +4401 -5200
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +4421 -5220
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +4421 -5220
- package/dist/index.js.map +1 -1
- package/dist/lib/auth/auth.service.d.ts +13 -3
- package/dist/lib/auth/authenticator.d.ts +22 -0
- package/dist/lib/auth/index.d.ts +1 -0
- package/dist/lib/auth/passkey.model.d.ts +5 -0
- package/dist/lib/auth/passkey.service.d.ts +6 -10
- package/dist/lib/auth/platform.d.ts +95 -0
- package/dist/lib/merchants/index.d.ts +9 -0
- package/dist/lib/transactions/index.d.ts +3 -4
- package/dist/lib/utils/cipher.service.d.ts +34 -3
- package/dist/lib/utils/constants.d.ts +11 -0
- package/dist/lib/utils/index.d.ts +5 -1
- package/dist/lib/utils/is-jwt-expired.d.ts +1 -1
- package/dist/lib/utils/storage.service.d.ts +39 -17
- package/dist/lib/wallet/wallet-handlers.service.d.ts +9 -8
- package/dist/lib/wallet/wallet.service.d.ts +53 -8
- package/dist/package.json +7 -3
- package/dist/routes/auth.d.ts +5 -0
- package/dist/routes/wallet.d.ts +5 -0
- package/dist/types/auth.d.ts +25 -0
- package/dist/types/base.d.ts +5 -3
- package/dist/types/common.d.ts +14 -7
- package/dist/types/passkey-error-codes.d.ts +29 -0
- package/dist/types/storage.d.ts +2 -1
- package/dist/types/transactions.d.ts +1 -0
- package/dist/types/wallet.d.ts +6 -5
- package/package.json +7 -3
package/README.md
CHANGED
package/dist/base.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { WallabyConfig, RequestOptions, RequestRoute, WallabyConfigOptions, AuthType } from './types';
|
|
2
2
|
import { StorageService } from './lib/utils/storage.service';
|
|
3
3
|
import { LocalStorage } from './types/storage';
|
|
4
|
+
import { LockManagerService } from './helpers/lock-manager.service';
|
|
5
|
+
import { Cipher } from './lib/utils/cipher.service';
|
|
4
6
|
export declare abstract class Base {
|
|
5
7
|
userId: string;
|
|
6
8
|
private apiKey;
|
|
@@ -8,7 +10,11 @@ export declare abstract class Base {
|
|
|
8
10
|
private clientAuthToken;
|
|
9
11
|
protected deviceAuthType: AuthType;
|
|
10
12
|
protected options?: WallabyConfigOptions;
|
|
13
|
+
protected lockManager: LockManagerService;
|
|
14
|
+
protected cipher: Cipher;
|
|
11
15
|
constructor(config: WallabyConfig);
|
|
16
|
+
set setClientAuthToken(token: string);
|
|
17
|
+
private _initializeClientAuthToken;
|
|
12
18
|
/**
|
|
13
19
|
* This library uses `localStorage` as the default storage.
|
|
14
20
|
* If you want to use a different storage, you can pass it in the options object of the Wallaby config.
|
|
@@ -16,17 +22,7 @@ export declare abstract class Base {
|
|
|
16
22
|
* {
|
|
17
23
|
* }
|
|
18
24
|
*/
|
|
19
|
-
get
|
|
20
|
-
/**
|
|
21
|
-
* @protected
|
|
22
|
-
*/
|
|
23
|
-
protected get device(): {
|
|
24
|
-
deviceAuthType: AuthType;
|
|
25
|
-
then<TResult1 = import("./types").DeviceInformation, TResult2 = never>(onfulfilled?: ((value: import("./types").DeviceInformation) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<TResult1 | TResult2>;
|
|
26
|
-
catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null | undefined): Promise<import("./types").DeviceInformation | TResult>;
|
|
27
|
-
finally(onfinally?: (() => void) | null | undefined): Promise<import("./types").DeviceInformation>;
|
|
28
|
-
[Symbol.toStringTag]: string;
|
|
29
|
-
};
|
|
25
|
+
get deviceLocalStorage(): LocalStorage;
|
|
30
26
|
/**
|
|
31
27
|
* @private
|
|
32
28
|
*/
|
|
@@ -34,7 +30,7 @@ export declare abstract class Base {
|
|
|
34
30
|
/**
|
|
35
31
|
* @protected
|
|
36
32
|
*/
|
|
37
|
-
get
|
|
33
|
+
get localStorageService(): StorageService;
|
|
38
34
|
/**
|
|
39
35
|
*
|
|
40
36
|
* This is the main request method that is used to make requests to the Wallaby API.
|
|
@@ -43,5 +39,5 @@ export declare abstract class Base {
|
|
|
43
39
|
* @returns Promise of <T> where T is the type of the response.
|
|
44
40
|
*/
|
|
45
41
|
protected request<T>(route: RequestRoute, options?: RequestOptions): Promise<T | any>;
|
|
46
|
-
private
|
|
42
|
+
private _getRequestHeaders;
|
|
47
43
|
}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export declare function safeJsonParse<T>(jsonString: string): T
|
|
1
|
+
export declare function safeJsonParse<T>(jsonString: string): T;
|
|
2
|
+
export declare function isJsonString(str: string): boolean;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare class LockManagerService {
|
|
2
|
+
private activeLocks;
|
|
3
|
+
/**
|
|
4
|
+
* Acquires a lock for the given key and executes the operation
|
|
5
|
+
* @param key - Unique identifier for the lock (e.g., 'changePassword', 'wallet-create')
|
|
6
|
+
* @param operation - The async operation to execute while locked
|
|
7
|
+
* @returns Promise that resolves with the operation result
|
|
8
|
+
*/
|
|
9
|
+
withLock<T>(key: string, operation: () => Promise<T>): Promise<T>;
|
|
10
|
+
/**
|
|
11
|
+
* Check if a specific operation is currently locked
|
|
12
|
+
* @param key - The lock key to check
|
|
13
|
+
* @returns boolean indicating if the operation is locked
|
|
14
|
+
*/
|
|
15
|
+
isLocked(key: string): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Clear all locks (useful for testing or cleanup)
|
|
18
|
+
*/
|
|
19
|
+
clearAllLocks(): void;
|
|
20
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Decorator that automatically applies a lock to a method
|
|
3
|
+
* @param lockKey - The key to use for locking. If not provided, uses className:methodName
|
|
4
|
+
*/
|
|
5
|
+
export declare function WithLock(lockKey?: string): <T extends (...args: any[]) => Promise<any>>(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T> | void;
|