wallaby-cash 1.4.0 → 1.5.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.
- package/README.md +3 -3
- package/dist/base.d.ts +20 -19
- package/dist/index.cjs.js +977 -705
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.esm.js +975 -704
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +975 -704
- package/dist/index.js.map +1 -1
- package/dist/lib/auth/index.d.ts +1 -9
- package/dist/lib/utils/constants.d.ts +10 -0
- package/dist/lib/utils/index.d.ts +21 -12
- package/dist/lib/utils/storage.service.d.ts +79 -0
- package/dist/lib/wallet/index.d.ts +2 -2
- package/dist/tests/__mocks__/localStorageMock.d.ts +10 -0
- package/dist/tests/data/config.d.ts +2 -6
- package/dist/tests/data/constants.d.ts +5 -0
- package/dist/types/base.d.ts +53 -0
- package/dist/types/common.d.ts +0 -14
- package/dist/types/index.d.ts +1 -0
- package/dist/types/storage.d.ts +16 -0
- package/package.json +6 -4
- package/dist/lib/utils/utils.d.ts +0 -78
package/README.md
CHANGED
|
@@ -21,11 +21,11 @@ The SDK currently supports the following blockchains:
|
|
|
21
21
|
After installing the library, you can then import and use the SDK.
|
|
22
22
|
|
|
23
23
|
Some configuration params are optional depending on the endpoint.
|
|
24
|
-
`apiKey`, `baseUrl` and `
|
|
24
|
+
`apiKey`, `baseUrl` and `clientAuthToken` are always required, while `userId` and `accessToken` are only required for certain endpoints.
|
|
25
25
|
|
|
26
26
|
To initialize the Wallaby client, simply import the Wallaby class and pass the config object.
|
|
27
27
|
|
|
28
|
-
To understand how to generate and use the `
|
|
28
|
+
To understand how to generate and use the `clientAuthToken` you can refer to authentication docs [here](./authentication/overview#how-to-generate-the-client-jwt).
|
|
29
29
|
|
|
30
30
|
**Example:**
|
|
31
31
|
|
|
@@ -35,7 +35,7 @@ import { Wallaby } from 'wallaby-cash';
|
|
|
35
35
|
const config = {
|
|
36
36
|
apiKey: "071b51027b412a1b8fcttt73684d25mi"
|
|
37
37
|
baseUrl: "https://dev-testnet.wallaby.cash",
|
|
38
|
-
|
|
38
|
+
clientAuthToken: `eyJhbGciOiJSUzI1NiJ9. eyJleHRlcm5hbFVzZXJJZCI6IjU0MDc1ZWNmLWE3MjktNDUxNy05NmE1LTZkMzcwNzFmYTEzZSIsImV4cGlyYXRpb24iOiIyMDIzLTA0LTI1VDExOjU4OjExLTA1OjAwIiwiaGFzaF9zdHJpbmciOiIxOGU4ZDY1NWJmNjUwYmJkZWFlNWEzNjBkMTU1M2Q5YWVkYjU1MjI4NGYxOWZmMDViMzgxZWI0ZjcxNDA2MjQ2In0.jnsGd-H0rBXLQVHLKq2yMNLcvlDKOg1i863czVPLg0sDaO6hDLIez2zfhsEvGAZQCbYKWIAj7KmuCIFLGL5B74eu-__d_OzO2fTGJthzud-MlWcWAjXYnHjGS6WCZ5M_D_i-kyZow9N9SmSX4ccdFV4yPmQVYojqDqBAWlVXddU`,
|
|
39
39
|
userId: "54075ecf-a729-4517-96a5-6d37071fa13e",
|
|
40
40
|
}
|
|
41
41
|
|
package/dist/base.d.ts
CHANGED
|
@@ -1,30 +1,31 @@
|
|
|
1
1
|
import { WallabyConfig, RequestOptions, RequestRoute, WallabyConfigOptions } from './types';
|
|
2
|
+
import StorageService from './lib/utils/storage.service';
|
|
3
|
+
import { LocalStorage } from './types/storage';
|
|
2
4
|
export declare abstract class Base {
|
|
3
5
|
private apiKey;
|
|
4
6
|
private baseUrl;
|
|
7
|
+
private jwt;
|
|
8
|
+
private clientAuthToken;
|
|
5
9
|
userId: string;
|
|
6
|
-
jwt?: string;
|
|
7
10
|
options?: WallabyConfigOptions;
|
|
8
11
|
constructor(config: WallabyConfig);
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
12
|
+
/**
|
|
13
|
+
* @description This library uses `localStorage` as the default storage.
|
|
14
|
+
* If you want to use a different storage, you can pass it in the options object of the Wallaby config.
|
|
15
|
+
* storage: new CustomStorage()
|
|
16
|
+
* {
|
|
17
|
+
* }
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
get deviceStorage(): LocalStorage;
|
|
21
|
+
get device(): Promise<import("./types").DeviceInformation>;
|
|
22
|
+
get settings(): {
|
|
23
|
+
apiKey: string;
|
|
24
|
+
baseUrl: string;
|
|
25
|
+
environment: string;
|
|
26
|
+
network: "mainnet" | "testnet";
|
|
25
27
|
};
|
|
26
|
-
|
|
28
|
+
get storageService(): StorageService;
|
|
27
29
|
protected request<T>(route: RequestRoute, options?: RequestOptions): Promise<T | any>;
|
|
28
30
|
private getRequestHeaders;
|
|
29
|
-
private loadDeviceInformation;
|
|
30
31
|
}
|