@explorins/pers-signer 1.0.16 → 1.0.17

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 CHANGED
@@ -103,6 +103,54 @@ interface HealthCheckResponse {
103
103
  success: boolean;
104
104
  }
105
105
 
106
+ /**
107
+ * Types for WebAuthn provider abstraction
108
+ */
109
+ interface WebAuthnProvider {
110
+ create(challenge: any): Promise<any>;
111
+ sign(challenge: any): Promise<any>;
112
+ }
113
+ interface WebAuthnConfig {
114
+ relyingParty: {
115
+ id: string;
116
+ name: string;
117
+ origin?: string;
118
+ };
119
+ }
120
+
121
+ /**
122
+ * Shared type definitions for the blockchain signer shared library
123
+ */
124
+
125
+ /**
126
+ * Authentication types for 3-function split architecture
127
+ */
128
+ interface AuthenticatedUser {
129
+ identifier: string;
130
+ signerAuthToken: string;
131
+ persAccessToken: string;
132
+ tenantId: string;
133
+ expiresAt: number;
134
+ }
135
+ /**
136
+ * Service configuration options
137
+ */
138
+ interface ServiceConfig {
139
+ apiUrl: string;
140
+ environment: 'development' | 'staging' | 'production';
141
+ timeout?: number;
142
+ retryAttempts?: number;
143
+ }
144
+ /**
145
+ * Error types for service operations
146
+ */
147
+ interface ServiceError {
148
+ code: string;
149
+ message: string;
150
+ details?: any;
151
+ timestamp: Date;
152
+ }
153
+
106
154
  /**
107
155
  * Wallet management service
108
156
  * Updated for v1 API endpoints per migration reference
@@ -223,21 +271,6 @@ declare class PersService {
223
271
  static getTransactionDataForSigning(transactionResponse: TransactionRequestResponseDTO): _explorins_pers_shared_browser.CounterfactualWalletTransactionResponse | _explorins_web3_ts_types.LegacyTransaction;
224
272
  }
225
273
 
226
- /**
227
- * Types for WebAuthn provider abstraction
228
- */
229
- interface WebAuthnProvider {
230
- create(challenge: any): Promise<any>;
231
- sign(challenge: any): Promise<any>;
232
- }
233
- interface WebAuthnConfig {
234
- relyingParty: {
235
- id: string;
236
- name: string;
237
- origin?: string;
238
- };
239
- }
240
-
241
274
  /**
242
275
  * Key service response types and interfaces
243
276
  */
@@ -389,39 +422,6 @@ declare class SigningService {
389
422
  signBatch(authToken: string, walletId: string, requests: SigningRequest[]): Promise<CompleteSignatureResponse['data'][]>;
390
423
  }
391
424
 
392
- /**
393
- * Shared type definitions for the blockchain signer shared library
394
- */
395
-
396
- /**
397
- * Authentication types for 3-function split architecture
398
- */
399
- interface AuthenticatedUser {
400
- identifier: string;
401
- signerAuthToken: string;
402
- persAccessToken: string;
403
- tenantId: string;
404
- expiresAt: number;
405
- }
406
- /**
407
- * Service configuration options
408
- */
409
- interface ServiceConfig {
410
- apiUrl: string;
411
- environment: 'development' | 'staging' | 'production';
412
- timeout?: number;
413
- retryAttempts?: number;
414
- }
415
- /**
416
- * Error types for service operations
417
- */
418
- interface ServiceError {
419
- code: string;
420
- message: string;
421
- details?: any;
422
- timestamp: Date;
423
- }
424
-
425
425
  interface GetWalletResponse {
426
426
  id: string;
427
427
  signingKey: {
@@ -526,7 +526,7 @@ interface TransactionSigningParams {
526
526
  */
527
527
  declare class TransactionSigningService {
528
528
  private webAuthnProvider;
529
- constructor(config: PersSignerConfig);
529
+ constructor(config: ExtendedPersSignerConfig);
530
530
  /**
531
531
  * Prepare transaction for signing - fetch and validate
532
532
  */
@@ -789,6 +789,28 @@ declare function setHttpClient(client: HttpClient): void;
789
789
  */
790
790
  declare function getHttpClient(): HttpClient;
791
791
 
792
+ /**
793
+ * Wallet list response from WalletService
794
+ */
795
+ interface WalletListResponse {
796
+ items: WalletItem[];
797
+ }
798
+ /**
799
+ * Individual wallet item from wallet list - compatible with KeyWallet constructor
800
+ */
801
+ interface WalletItem {
802
+ id: string;
803
+ address: string;
804
+ network: string;
805
+ status: string;
806
+ signingKey?: unknown;
807
+ dateCreated?: string;
808
+ custodial?: boolean;
809
+ tags?: string[];
810
+ boundToEvmNetwork?: boolean;
811
+ [key: string]: unknown;
812
+ }
813
+
792
814
  /**
793
815
  * PERS Blockchain Signer SDK
794
816
  *
@@ -828,13 +850,14 @@ declare function getHttpClient(): HttpClient;
828
850
  * @property {string} [apiUrl] - Custom API base URL (defaults to production)
829
851
  * @property {string} [relyingPartyName] - WebAuthn relying party name for authentication
830
852
  */
831
- interface PersSignerConfig {
832
- tenantId?: string;
853
+ interface ExtendedPersSignerConfig {
833
854
  ethersProviderUrl?: string;
834
855
  webAuthnProvider: WebAuthnProvider;
835
856
  apiUrl?: string;
836
857
  relyingPartyName?: string;
837
858
  }
859
+ interface PersSignerConfig extends Omit<ExtendedPersSignerConfig, 'webAuthnProvider'> {
860
+ }
838
861
  /**
839
862
  * PERS Blockchain Signer SDK Class
840
863
  *
@@ -857,10 +880,10 @@ declare class PersSignerSDK {
857
880
  /**
858
881
  * Initialize the PERS Signer SDK
859
882
  *
860
- * @param {PersSignerConfig} config - SDK configuration object
883
+ * @param {ExtendedPersSignerConfig} config - SDK configuration object
861
884
  * @throws {Error} If required configuration is missing
862
885
  */
863
- constructor(config: PersSignerConfig);
886
+ constructor(config: ExtendedPersSignerConfig);
864
887
  /**
865
888
  * Authenticate user and cache session for 5 minutes
866
889
  *
@@ -1010,29 +1033,7 @@ declare class PersSignerSDK {
1010
1033
  * });
1011
1034
  * ```
1012
1035
  */
1013
- declare function createPersSignerSDK(config: PersSignerConfig): PersSignerSDK;
1014
-
1015
- /**
1016
- * Wallet list response from WalletService
1017
- */
1018
- interface WalletListResponse {
1019
- items: WalletItem[];
1020
- }
1021
- /**
1022
- * Individual wallet item from wallet list - compatible with KeyWallet constructor
1023
- */
1024
- interface WalletItem {
1025
- id: string;
1026
- address: string;
1027
- network: string;
1028
- status: string;
1029
- signingKey?: unknown;
1030
- dateCreated?: string;
1031
- custodial?: boolean;
1032
- tags?: string[];
1033
- boundToEvmNetwork?: boolean;
1034
- [key: string]: unknown;
1035
- }
1036
+ declare function createPersSignerSDK(config: ExtendedPersSignerConfig): PersSignerSDK;
1036
1037
 
1037
1038
  /**
1038
1039
  * Authenticated user with all required tokens
@@ -1051,7 +1052,7 @@ declare class AuthenticationService {
1051
1052
  private signerToken;
1052
1053
  private config;
1053
1054
  private webAuthnProvider;
1054
- constructor(config: PersSignerConfig);
1055
+ constructor(config: ExtendedPersSignerConfig);
1055
1056
  /**
1056
1057
  * Login with PERS token to get signer JWT
1057
1058
  * @param persToken - PERS JWT from PERS authentication
package/dist/index.esm.js CHANGED
@@ -1897,7 +1897,7 @@ class PersSignerSDK {
1897
1897
  /**
1898
1898
  * Initialize the PERS Signer SDK
1899
1899
  *
1900
- * @param {PersSignerConfig} config - SDK configuration object
1900
+ * @param {ExtendedPersSignerConfig} config - SDK configuration object
1901
1901
  * @throws {Error} If required configuration is missing
1902
1902
  */
1903
1903
  constructor(config) {
@@ -1942,7 +1942,7 @@ class PersSignerSDK {
1942
1942
  throw new Error('Invalid or expired JWT token');
1943
1943
  }
1944
1944
  const identifier = payload.identifierEmail || payload.email || payload.userId;
1945
- const tenantId = payload.tenantId || this.config.tenantId || '';
1945
+ const tenantId = payload.tenantId || '';
1946
1946
  if (!identifier) {
1947
1947
  throw new Error('JWT token missing user identifier (identifierEmail, email, or userId)');
1948
1948
  }