@explorins/pers-signer 1.0.32 → 1.0.34

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.
@@ -353,7 +353,7 @@ interface TransactionSigningResult {
353
353
  shouldShowStatus?: boolean;
354
354
  }
355
355
  /**
356
- * Transaction submission result for internal processing
356
+ * Transaction submission result
357
357
  */
358
358
  interface SubmissionResult {
359
359
  submitResult: TransactionRequestResponseDTO;
@@ -363,9 +363,6 @@ interface SubmissionResult {
363
363
  success: boolean;
364
364
  error?: string;
365
365
  }
366
- /**
367
- * Metadata for transaction parameters - string values only
368
- */
369
366
  /**
370
367
  * Authentication tokens required for transaction signing
371
368
  */
@@ -519,24 +516,19 @@ declare class KeyWallet extends AbstractSigner {
519
516
  */
520
517
 
521
518
  /**
522
- * Configuration interface for the PERS Signer SDK
523
- *
524
- * @interface PersSignerConfig
525
- * @property {string} [tenantId] - Optional tenant identifier for multi-tenant applications
526
- * @property {string} [ethersProviderUrl] - Custom Ethereum RPC provider URL
527
- * @property {WebAuthnProvider} webAuthnProvider - WebAuthn provider for secure authentication
528
- * @property {string} [apiUrl] - Custom API base URL (defaults to production)
529
- * @property {string} [relyingPartyName] - WebAuthn relying party name for authentication
530
- * @property {StatusCallback} [globalStatusCallback] - Optional global status callback for all operations
519
+ * Configuration options for the PERS Signer SDK
531
520
  */
532
- interface ExtendedPersSignerConfig {
521
+ interface PersSignerConfig {
533
522
  ethersProviderUrl?: string;
534
- webAuthnProvider: WebAuthnProvider;
535
523
  apiUrl?: string;
536
524
  relyingPartyName?: string;
537
525
  globalStatusCallback?: StatusCallback;
538
526
  }
539
- interface PersSignerConfig extends Omit<ExtendedPersSignerConfig, 'webAuthnProvider'> {
527
+ /**
528
+ * Extended configuration that includes the WebAuthn provider
529
+ */
530
+ interface ExtendedPersSignerConfig extends PersSignerConfig {
531
+ webAuthnProvider: WebAuthnProvider;
540
532
  }
541
533
  /**
542
534
  * PERS Blockchain Signer SDK Class
@@ -1068,4 +1060,4 @@ declare function getReactNativeWebAuthnProvider(): Promise<WebAuthnProvider>;
1068
1060
  declare function createPersSignerSDK(config: PersSignerConfig): Promise<PersSignerSDK>;
1069
1061
 
1070
1062
  export { AuthenticationService, FetchHttpClient, KeyWallet, PersService, PersSignerSDK, ReactNativeConfigProvider, SigningService, SigningStatus, StaticConfigProvider, TransactionErrorHandler, TransactionSigningService, TransactionSubmissionHandler, TransactionValidator, WalletService, WebAuthnCoordinator, WebConfigProvider, createPersSignerSDK, getConfigProvider, getHttpClient, getServiceConfig, getReactNativeWebAuthnProvider as getWebAuthnProvider, setConfigProvider, setHttpClient };
1071
- export type { AuthenticatedUser, ConfigProvider, HttpClient, HttpRequestOptions, HttpResponse, PersSignerConfig, PlatformConfig, StatusCallback, StatusUpdateData, SubmissionResult, TransactionSigningResult, WebAuthnConfig, WebAuthnProvider };
1063
+ export type { AuthenticatedUser, ConfigProvider, ExtendedPersSignerConfig, HttpClient, HttpRequestOptions, HttpResponse, PersSignerConfig, PlatformConfig, StatusCallback, StatusUpdateData, SubmissionResult, TransactionSigningResult, WebAuthnConfig, WebAuthnProvider };
@@ -1779,12 +1779,16 @@ class PersSignerSDK {
1779
1779
  */
1780
1780
  constructor(config) {
1781
1781
  this.config = config;
1782
+ // Safe hostname/origin extraction - window.location may be undefined in React Native
1783
+ const hasWindowLocation = typeof window !== 'undefined' && typeof window.location !== 'undefined';
1784
+ const hostname = hasWindowLocation ? window.location.hostname : 'localhost';
1785
+ const origin = hasWindowLocation ? window.location.origin : undefined;
1782
1786
  setConfigProvider(new WebConfigProvider({
1783
1787
  apiUrl: config.apiUrl || SIGNER_CONFIG.DEFAULT_SIGNER_API_URL,
1784
1788
  relyingParty: {
1785
- id: typeof window !== 'undefined' ? window.location.hostname : 'localhost',
1789
+ id: hostname,
1786
1790
  name: config.relyingPartyName || SIGNER_CONFIG.DEFAULT_RELYING_PARTY_NAME,
1787
- origin: typeof window !== 'undefined' ? window.location.origin : undefined,
1791
+ origin: origin,
1788
1792
  },
1789
1793
  }));
1790
1794
  this.authenticationService = new AuthenticationService(this.config);