wallaby-cash 2.0.1-alpha.3 → 2.0.1-alpha.31

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 (42) hide show
  1. package/README.md +8 -4
  2. package/dist/base.d.ts +11 -5
  3. package/dist/helpers/json-safe-parse.d.ts +1 -0
  4. package/dist/index.cjs.js +3182 -2666
  5. package/dist/index.cjs.js.map +1 -1
  6. package/dist/index.d.ts +6 -1
  7. package/dist/index.esm.js +3183 -2667
  8. package/dist/index.esm.js.map +1 -1
  9. package/dist/index.js +3183 -2667
  10. package/dist/index.js.map +1 -1
  11. package/dist/lib/auth/auth.model.d.ts +102 -0
  12. package/dist/lib/auth/auth.service.d.ts +59 -14
  13. package/dist/lib/auth/passkey.service.d.ts +77 -0
  14. package/dist/lib/transactions/index.d.ts +6 -17
  15. package/dist/lib/transactions/transactions.model.d.ts +22 -0
  16. package/dist/lib/utils/cipher.service.d.ts +144 -53
  17. package/dist/lib/utils/constants.d.ts +4 -0
  18. package/dist/lib/utils/is-jwt-expired.d.ts +2 -0
  19. package/dist/lib/wallet/index.d.ts +2 -0
  20. package/dist/lib/wallet/wallet-data.service.d.ts +89 -0
  21. package/dist/lib/wallet/wallet-handlers.service.d.ts +71 -0
  22. package/dist/lib/wallet/wallet.service.d.ts +76 -127
  23. package/dist/package.json +19 -3
  24. package/dist/routes/wallet.d.ts +5 -0
  25. package/dist/types/auth.d.ts +35 -18
  26. package/dist/types/base.d.ts +20 -2
  27. package/dist/types/common.d.ts +8 -3
  28. package/dist/types/storage.d.ts +3 -0
  29. package/dist/types/transactions.d.ts +5 -3
  30. package/dist/types/wallet.d.ts +41 -28
  31. package/package.json +19 -3
  32. package/dist/helpers/base64.d.ts +0 -2
  33. package/dist/tests/__mocks__/localStorageMock.d.ts +0 -10
  34. package/dist/tests/data/assets.d.ts +0 -89
  35. package/dist/tests/data/auth.d.ts +0 -11
  36. package/dist/tests/data/config.d.ts +0 -2
  37. package/dist/tests/data/credentials.data.d.ts +0 -12
  38. package/dist/tests/data/index.d.ts +0 -7
  39. package/dist/tests/data/merchants.d.ts +0 -8
  40. package/dist/tests/data/system.d.ts +0 -47
  41. package/dist/tests/data/user.d.ts +0 -32
  42. package/dist/tests/data/wallet.data.d.ts +0 -69
package/README.md CHANGED
@@ -1,23 +1,27 @@
1
- # Getting started
1
+ # Wallaby Cash SDK
2
+
3
+ The SDK leverages Wallaby API as a gateway to web3 and the blockchain.
2
4
 
3
5
  ## Overview
4
6
 
5
7
  [![npm version](https://badge.fury.io/js/wallaby-cash.svg)](https://badge.fury.io/js/wallaby-cash)
6
-
7
- The SDK leverages Wallaby API as a gateway to web3 and the blockchain.
8
+ [![codecov](https://codecov.io/gh/WALLABY-WaaS/wallaby-sdk-js/branch/feat%2Fwallaby-cash-v2/graph/badge.svg?token=4HRLAUCK7S)](https://codecov.io/gh/WALLABY-WaaS/wallaby-sdk-js)
8
9
 
9
10
  The SDK currently supports the following blockchains:
10
11
 
11
12
  - Algorand
12
13
  - Avalanche
14
+ - Base
15
+ - Binance chain
13
16
  - Bitcoin
14
17
  - Ethereum
15
18
  - Polygon
19
+ - Sui
16
20
 
17
21
  ## Install the SDK
18
22
 
19
23
  ```javascript
20
- npm install wallaby-cash
24
+ npm install wallaby-cash@latest
21
25
  ```
22
26
 
23
27
  ## Client Initialization
package/dist/base.d.ts CHANGED
@@ -1,13 +1,13 @@
1
- import { WallabyConfig, RequestOptions, RequestRoute, WallabyConfigOptions } from './types';
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
4
  export declare abstract class Base {
5
+ userId: string;
5
6
  private apiKey;
6
7
  private baseUrl;
7
- private jwt?;
8
8
  private clientAuthToken;
9
- userId: string;
10
- options?: WallabyConfigOptions;
9
+ protected deviceAuthType: AuthType;
10
+ protected options?: WallabyConfigOptions;
11
11
  constructor(config: WallabyConfig);
12
12
  /**
13
13
  * This library uses `localStorage` as the default storage.
@@ -20,7 +20,13 @@ export declare abstract class Base {
20
20
  /**
21
21
  * @protected
22
22
  */
23
- protected get device(): Promise<import("./types").DeviceInformation>;
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
+ };
24
30
  /**
25
31
  * @private
26
32
  */
@@ -0,0 +1 @@
1
+ export declare function safeJsonParse<T>(jsonString: string): T | null;