@fenelabs/fene-sdk 0.3.6 → 0.3.7
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.mts +8 -5
- package/dist/index.d.ts +8 -5
- package/dist/index.js +6 -2
- package/dist/index.mjs +6 -2
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -9,14 +9,17 @@ interface PaginatedResponse<T> {
|
|
|
9
9
|
};
|
|
10
10
|
}
|
|
11
11
|
interface NonceResponse {
|
|
12
|
-
address: string;
|
|
13
12
|
nonce: string;
|
|
14
13
|
message: string;
|
|
15
14
|
}
|
|
15
|
+
interface AuthVerifyRequest {
|
|
16
|
+
address: Address;
|
|
17
|
+
signature: string;
|
|
18
|
+
nonce: string;
|
|
19
|
+
}
|
|
16
20
|
interface AuthResponse {
|
|
17
21
|
token: string;
|
|
18
|
-
|
|
19
|
-
role: 'validator' | 'delegator' | 'public';
|
|
22
|
+
role: 'validator' | 'delegator';
|
|
20
23
|
expires_at: number;
|
|
21
24
|
}
|
|
22
25
|
declare enum ValidatorStatus {
|
|
@@ -210,7 +213,7 @@ declare class ResonanceClient {
|
|
|
210
213
|
private request;
|
|
211
214
|
private executeRequest;
|
|
212
215
|
getNonce(address: Address): Promise<NonceResponse>;
|
|
213
|
-
verify(
|
|
216
|
+
verify(params: AuthVerifyRequest): Promise<AuthResponse>;
|
|
214
217
|
getValidators(): Promise<ValidatorSummary[]>;
|
|
215
218
|
getActiveValidators(): Promise<ValidatorSummary[]>;
|
|
216
219
|
getCandidates(): Promise<ValidatorSummary[]>;
|
|
@@ -307,4 +310,4 @@ declare function isAuthError(error: unknown): boolean;
|
|
|
307
310
|
*/
|
|
308
311
|
declare function isNotFoundError(error: unknown): boolean;
|
|
309
312
|
|
|
310
|
-
export { type APIErrorResponse, type Address, type AuthResponse, type AvatarResponse, type DailyBlockStats, type Delegator, type DelegatorRewards, type DelegatorStake, DelegatorStatus, type EpochInfo, ErrorCode, type ErrorCodeType, type GeoNode, type GeoStats, type GeoUpdateRequest, type NetworkAPR, type NetworkStats, type NonceResponse, type PaginatedResponse, type ReferralKey, type RequestContext, ResonanceClient, type ResonanceClientConfig, ResonanceError, type ResponseContext, type RewardHistory, type UploadResponse, type Validator, type ValidatorAPR, ValidatorStatus, type ValidatorSummary, type WhitelistCheckRequest, type WhitelistCheckResponse, createResonanceClient, hasErrorCode, isAuthError, isNetworkError, isNotFoundError, isResonanceError };
|
|
313
|
+
export { type APIErrorResponse, type Address, type AuthResponse, type AuthVerifyRequest, type AvatarResponse, type DailyBlockStats, type Delegator, type DelegatorRewards, type DelegatorStake, DelegatorStatus, type EpochInfo, ErrorCode, type ErrorCodeType, type GeoNode, type GeoStats, type GeoUpdateRequest, type NetworkAPR, type NetworkStats, type NonceResponse, type PaginatedResponse, type ReferralKey, type RequestContext, ResonanceClient, type ResonanceClientConfig, ResonanceError, type ResponseContext, type RewardHistory, type UploadResponse, type Validator, type ValidatorAPR, ValidatorStatus, type ValidatorSummary, type WhitelistCheckRequest, type WhitelistCheckResponse, createResonanceClient, hasErrorCode, isAuthError, isNetworkError, isNotFoundError, isResonanceError };
|
package/dist/index.d.ts
CHANGED
|
@@ -9,14 +9,17 @@ interface PaginatedResponse<T> {
|
|
|
9
9
|
};
|
|
10
10
|
}
|
|
11
11
|
interface NonceResponse {
|
|
12
|
-
address: string;
|
|
13
12
|
nonce: string;
|
|
14
13
|
message: string;
|
|
15
14
|
}
|
|
15
|
+
interface AuthVerifyRequest {
|
|
16
|
+
address: Address;
|
|
17
|
+
signature: string;
|
|
18
|
+
nonce: string;
|
|
19
|
+
}
|
|
16
20
|
interface AuthResponse {
|
|
17
21
|
token: string;
|
|
18
|
-
|
|
19
|
-
role: 'validator' | 'delegator' | 'public';
|
|
22
|
+
role: 'validator' | 'delegator';
|
|
20
23
|
expires_at: number;
|
|
21
24
|
}
|
|
22
25
|
declare enum ValidatorStatus {
|
|
@@ -210,7 +213,7 @@ declare class ResonanceClient {
|
|
|
210
213
|
private request;
|
|
211
214
|
private executeRequest;
|
|
212
215
|
getNonce(address: Address): Promise<NonceResponse>;
|
|
213
|
-
verify(
|
|
216
|
+
verify(params: AuthVerifyRequest): Promise<AuthResponse>;
|
|
214
217
|
getValidators(): Promise<ValidatorSummary[]>;
|
|
215
218
|
getActiveValidators(): Promise<ValidatorSummary[]>;
|
|
216
219
|
getCandidates(): Promise<ValidatorSummary[]>;
|
|
@@ -307,4 +310,4 @@ declare function isAuthError(error: unknown): boolean;
|
|
|
307
310
|
*/
|
|
308
311
|
declare function isNotFoundError(error: unknown): boolean;
|
|
309
312
|
|
|
310
|
-
export { type APIErrorResponse, type Address, type AuthResponse, type AvatarResponse, type DailyBlockStats, type Delegator, type DelegatorRewards, type DelegatorStake, DelegatorStatus, type EpochInfo, ErrorCode, type ErrorCodeType, type GeoNode, type GeoStats, type GeoUpdateRequest, type NetworkAPR, type NetworkStats, type NonceResponse, type PaginatedResponse, type ReferralKey, type RequestContext, ResonanceClient, type ResonanceClientConfig, ResonanceError, type ResponseContext, type RewardHistory, type UploadResponse, type Validator, type ValidatorAPR, ValidatorStatus, type ValidatorSummary, type WhitelistCheckRequest, type WhitelistCheckResponse, createResonanceClient, hasErrorCode, isAuthError, isNetworkError, isNotFoundError, isResonanceError };
|
|
313
|
+
export { type APIErrorResponse, type Address, type AuthResponse, type AuthVerifyRequest, type AvatarResponse, type DailyBlockStats, type Delegator, type DelegatorRewards, type DelegatorStake, DelegatorStatus, type EpochInfo, ErrorCode, type ErrorCodeType, type GeoNode, type GeoStats, type GeoUpdateRequest, type NetworkAPR, type NetworkStats, type NonceResponse, type PaginatedResponse, type ReferralKey, type RequestContext, ResonanceClient, type ResonanceClientConfig, ResonanceError, type ResponseContext, type RewardHistory, type UploadResponse, type Validator, type ValidatorAPR, ValidatorStatus, type ValidatorSummary, type WhitelistCheckRequest, type WhitelistCheckResponse, createResonanceClient, hasErrorCode, isAuthError, isNetworkError, isNotFoundError, isResonanceError };
|
package/dist/index.js
CHANGED
|
@@ -294,10 +294,14 @@ var ResonanceClient = class {
|
|
|
294
294
|
async getNonce(address) {
|
|
295
295
|
return this.request(`/eth/v1/auth/nonce?address=${address}`);
|
|
296
296
|
}
|
|
297
|
-
async verify(
|
|
297
|
+
async verify(params) {
|
|
298
298
|
const result = await this.request("/eth/v1/auth/verify", {
|
|
299
299
|
method: "POST",
|
|
300
|
-
body: JSON.stringify({
|
|
300
|
+
body: JSON.stringify({
|
|
301
|
+
address: params.address,
|
|
302
|
+
signature: params.signature,
|
|
303
|
+
nonce: params.nonce
|
|
304
|
+
})
|
|
301
305
|
});
|
|
302
306
|
this.token = result.token;
|
|
303
307
|
return result;
|
package/dist/index.mjs
CHANGED
|
@@ -259,10 +259,14 @@ var ResonanceClient = class {
|
|
|
259
259
|
async getNonce(address) {
|
|
260
260
|
return this.request(`/eth/v1/auth/nonce?address=${address}`);
|
|
261
261
|
}
|
|
262
|
-
async verify(
|
|
262
|
+
async verify(params) {
|
|
263
263
|
const result = await this.request("/eth/v1/auth/verify", {
|
|
264
264
|
method: "POST",
|
|
265
|
-
body: JSON.stringify({
|
|
265
|
+
body: JSON.stringify({
|
|
266
|
+
address: params.address,
|
|
267
|
+
signature: params.signature,
|
|
268
|
+
nonce: params.nonce
|
|
269
|
+
})
|
|
266
270
|
});
|
|
267
271
|
this.token = result.token;
|
|
268
272
|
return result;
|
package/package.json
CHANGED