@carrot-protocol/boost-http-client 0.1.6 → 0.1.7-bug-fix-api-integration-dev-4e0eb09
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/dist/index.d.ts +1 -1
- package/dist/index.js +4 -0
- package/dist/types.d.ts +1 -1
- package/package.json +1 -1
- package/src/index.ts +6 -1
- package/src/types.ts +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ export declare class Client {
|
|
|
25
25
|
* @param user wallet public key
|
|
26
26
|
* @returns User details
|
|
27
27
|
*/
|
|
28
|
-
getUser(user
|
|
28
|
+
getUser(user?: web3.PublicKey): Promise<GetUserResponse>;
|
|
29
29
|
/**
|
|
30
30
|
* Get market details for the carrot boost market
|
|
31
31
|
* @returns Market details
|
package/dist/index.js
CHANGED
|
@@ -101,6 +101,10 @@ class Client {
|
|
|
101
101
|
* @returns User details
|
|
102
102
|
*/
|
|
103
103
|
async getUser(user) {
|
|
104
|
+
// use loaded wallet if not provided
|
|
105
|
+
if (!user) {
|
|
106
|
+
user = this.address();
|
|
107
|
+
}
|
|
104
108
|
const body = await handleApiCall(() => this.http.get(`/user?user=${user.toString()}`));
|
|
105
109
|
const response = JSON.parse(body);
|
|
106
110
|
return response;
|
package/dist/types.d.ts
CHANGED
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -90,7 +90,12 @@ export class Client {
|
|
|
90
90
|
* @param user wallet public key
|
|
91
91
|
* @returns User details
|
|
92
92
|
*/
|
|
93
|
-
async getUser(user
|
|
93
|
+
async getUser(user?: web3.PublicKey): Promise<GetUserResponse> {
|
|
94
|
+
// use loaded wallet if not provided
|
|
95
|
+
if (!user) {
|
|
96
|
+
user = this.address();
|
|
97
|
+
}
|
|
98
|
+
|
|
94
99
|
const body = await handleApiCall(() =>
|
|
95
100
|
this.http.get(`/user?user=${user.toString()}`),
|
|
96
101
|
);
|