wallaby-cash 2.1.1-alpha.1 → 2.2.1-alpha.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.
Files changed (45) hide show
  1. package/README.md +16 -0
  2. package/dist/base.d.ts +16 -9
  3. package/dist/eth-crypto-utils/createIdentity.d.ts +1 -0
  4. package/dist/generated/api.d.ts +9167 -0
  5. package/dist/helpers/json-safe-parse.d.ts +2 -1
  6. package/dist/helpers/lock-manager.service.d.ts +20 -0
  7. package/dist/helpers/logger.d.ts +2 -1
  8. package/dist/helpers/validation.d.ts +4 -0
  9. package/dist/helpers/with-lock.d.ts +5 -0
  10. package/dist/index.cjs.js +6359 -5890
  11. package/dist/index.cjs.js.map +1 -1
  12. package/dist/index.d.ts +11 -2
  13. package/dist/index.esm.js +6328 -5890
  14. package/dist/index.esm.js.map +1 -1
  15. package/dist/index.js +6328 -5890
  16. package/dist/index.js.map +1 -1
  17. package/dist/lib/api/api.d.ts +18 -0
  18. package/dist/lib/api/index.d.ts +1 -0
  19. package/dist/lib/auth/auth.model.d.ts +5 -1
  20. package/dist/lib/auth/auth.service.d.ts +14 -24
  21. package/dist/lib/auth/authenticator.d.ts +3 -1
  22. package/dist/lib/auth/passkey.service.d.ts +14 -11
  23. package/dist/lib/index.d.ts +1 -0
  24. package/dist/lib/merchants/index.d.ts +2 -2
  25. package/dist/lib/transactions/index.d.ts +6 -7
  26. package/dist/lib/utils/cipher.service.d.ts +34 -3
  27. package/dist/lib/utils/constants.d.ts +12 -1
  28. package/dist/lib/utils/index.d.ts +10 -1
  29. package/dist/lib/utils/storage.service.d.ts +9 -2
  30. package/dist/lib/wallet/wallet-data.service.d.ts +20 -19
  31. package/dist/lib/wallet/wallet-handlers.service.d.ts +8 -16
  32. package/dist/lib/wallet/wallet.service.d.ts +40 -19
  33. package/dist/package.json +31 -9
  34. package/dist/types/auth.d.ts +13 -6
  35. package/dist/types/base.d.ts +2 -2
  36. package/dist/types/common.d.ts +50 -12
  37. package/dist/types/error-response-codes.d.ts +17 -1
  38. package/dist/types/index.d.ts +1 -0
  39. package/dist/types/merchants.d.ts +1 -0
  40. package/dist/types/passkey-error-codes.d.ts +3 -0
  41. package/dist/types/storage.d.ts +1 -4
  42. package/dist/types/transactions.d.ts +20 -9
  43. package/dist/types/wallet.d.ts +67 -18
  44. package/package.json +31 -9
  45. package/dist/helpers/base64.d.ts +0 -3
package/README.md CHANGED
@@ -10,13 +10,19 @@ The SDK leverages Wallaby API as a gateway to web3 and the blockchain.
10
10
  The SDK currently supports the following blockchains:
11
11
 
12
12
  - Algorand
13
+ - Aptos
13
14
  - Avalanche
14
15
  - Base
15
16
  - Binance chain
16
17
  - Bitcoin
17
18
  - Bsc
19
+ - Canton
18
20
  - Ethereum
21
+ - Hedera
22
+ - Injective
19
23
  - Polygon
24
+ - Polymesh
25
+ - Sei
20
26
  - Sui
21
27
 
22
28
  ## Install the SDK
@@ -60,3 +66,13 @@ wallaby.wallets.getTokenBalance()
60
66
  wallaby.transactions.transfer()
61
67
  wallaby.system.getSupportedBlockchains()
62
68
  ```
69
+
70
+ ## Generated API
71
+
72
+ The `wallaby-sdk-js` includes automatically generated TypeScript types from the API Swagger specification:
73
+
74
+ - **Types are generated automatically** during build process from `https://staging-testnet.wallaby.cash/swagger-json`
75
+ - **Generated files location**: `src/generated/`
76
+ - **Error codes included**: All API error codes are available as TypeScript enums
77
+ - **Local development**: Use `npm run generate:types:local` to generate from local `swagger.json`
78
+ - **Custom API endpoint**: Set `WALLABY_SWAGGER_URL` environment variable
package/dist/base.d.ts CHANGED
@@ -1,6 +1,9 @@
1
- import { WallabyConfig, RequestOptions, RequestRoute, WallabyConfigOptions, AuthType } from './types';
1
+ import { AuthType, WallabyConfig, RequestOptions, RequestRoute, WallabyConfigOptions } 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';
6
+ import { Api as GeneratedApiClient } from './generated/api';
4
7
  export declare abstract class Base {
5
8
  userId: string;
6
9
  private apiKey;
@@ -8,6 +11,9 @@ export declare abstract class Base {
8
11
  private clientAuthToken;
9
12
  protected deviceAuthType: AuthType;
10
13
  protected options?: WallabyConfigOptions;
14
+ protected lockManager: LockManagerService;
15
+ protected cipher: Cipher;
16
+ protected api: GeneratedApiClient<any>;
11
17
  constructor(config: WallabyConfig);
12
18
  set setClientAuthToken(token: string);
13
19
  private _initializeClientAuthToken;
@@ -18,7 +24,7 @@ export declare abstract class Base {
18
24
  * {
19
25
  * }
20
26
  */
21
- get deviceStorage(): LocalStorage;
27
+ get deviceLocalStorage(): LocalStorage;
22
28
  /**
23
29
  * @private
24
30
  */
@@ -26,14 +32,15 @@ export declare abstract class Base {
26
32
  /**
27
33
  * @protected
28
34
  */
29
- get storageService(): StorageService;
35
+ get localStorageService(): StorageService;
30
36
  /**
31
- *
32
- * This is the main request method that is used to make requests to the Wallaby API.
33
- * @param { RequestRoute } route full route object to the request endpoint.
34
- * @param { RequestOptions } options Extends the `RequestInit` interface to include a payload and queryParams.
35
- * @returns Promise of <T> where T is the type of the response.
37
+ * Main request method for making API calls to the Wallaby API.
38
+ * @param route - Route configuration object containing the endpoint path and HTTP method
39
+ * @param options - Optional request options including payload and query parameters
40
+ * @returns Promise resolving to the typed response data
41
+ * @throws Error if the API returns an error response or network failure occurs
36
42
  */
37
- protected request<T>(route: RequestRoute, options?: RequestOptions): Promise<T | any>;
43
+ protected request<T>(route: RequestRoute, options?: RequestOptions): Promise<T>;
38
44
  private _getRequestHeaders;
45
+ protected securityWorker(securityData: any): Promise<any>;
39
46
  }
@@ -1,4 +1,5 @@
1
1
  export declare const DEFAULT_ENTROPY_BYTES = 32;
2
+ export declare const MINIMUM_SHANNON_ENTROPY = 4;
2
3
  /**
3
4
  * creates a new private key
4
5
  * @param { Uint8Array } entropy - optional entropy to create the private key