@openfort/openfort-js 0.7.7 → 0.7.9

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
@@ -1,7 +1,3 @@
1
- import { SessionKey, AuthResponse, OAuthProvider as OAuthProvider$1, InitializeOAuthOptions as InitializeOAuthOptions$1, InitAuthResponse, SIWEInitResponse, ThirdPartyOAuthProvider as ThirdPartyOAuthProvider$1, TokenType as TokenType$1, AuthPlayerResponse as AuthPlayerResponse$1, Auth, TransactionIntentResponse as TransactionIntentResponse$1, SessionResponse as SessionResponse$1, EmbeddedState as EmbeddedState$1, SDKOverrides as SDKOverrides$1 } from 'types';
2
- import { SDKConfiguration as SDKConfiguration$1 } from 'config';
3
- import { Provider as Provider$1 } from 'evm/types';
4
-
5
1
  declare type Bytes = ArrayLike<number>;
6
2
  declare type BytesLike = Bytes | string;
7
3
  interface Hexable {
@@ -56,121 +52,6 @@ interface TypedDataField {
56
52
  type: string;
57
53
  }
58
54
 
59
- interface ShieldAuthentication {
60
- auth: AuthType;
61
- token: string;
62
- authProvider?: string;
63
- tokenType?: string;
64
- }
65
- declare enum AuthType {
66
- OPENFORT = "openfort",
67
- CUSTOM = "custom"
68
- }
69
-
70
- declare class Openfort {
71
- private signer?;
72
- private readonly authManager;
73
- private readonly config;
74
- private readonly backendApiClients;
75
- private readonly instanceManager;
76
- private readonly iframeManager;
77
- private readonly openfortEventEmitter;
78
- constructor(sdkConfiguration: SDKConfiguration$1);
79
- logout(): Promise<void>;
80
- getEthereumProvider(options?: {
81
- announceProvider: boolean;
82
- policy?: string;
83
- }): Provider$1;
84
- private flushSigner;
85
- configureSessionKey(): SessionKey;
86
- configureEmbeddedSigner(chainId?: number, shieldAuthentication?: ShieldAuthentication, recoveryPassword?: string): Promise<void>;
87
- private newEmbeddedSigner;
88
- loginWithEmailPassword({ email, password, }: {
89
- email: string;
90
- password: string;
91
- }): Promise<AuthResponse>;
92
- signUpWithEmailPassword({ email, password, options, }: {
93
- email: string;
94
- password: string;
95
- options?: {
96
- data: {
97
- name: string;
98
- };
99
- };
100
- }): Promise<AuthResponse>;
101
- requestEmailVerification({ email, redirectUrl }: {
102
- email: string;
103
- redirectUrl: string;
104
- }): Promise<void>;
105
- resetPassword({ email, password, state }: {
106
- email: string;
107
- password: string;
108
- state: string;
109
- }): Promise<void>;
110
- requestResetPassword({ email, redirectUrl }: {
111
- email: string;
112
- redirectUrl: string;
113
- }): Promise<void>;
114
- verifyEmail({ email, state }: {
115
- email: string;
116
- state: string;
117
- }): Promise<void>;
118
- initOAuth({ provider, options }: {
119
- provider: OAuthProvider$1;
120
- options?: InitializeOAuthOptions$1;
121
- }): Promise<InitAuthResponse>;
122
- initLinkOAuth({ provider, playerToken, options }: {
123
- provider: OAuthProvider$1;
124
- playerToken: string;
125
- options?: InitializeOAuthOptions$1;
126
- }): Promise<InitAuthResponse>;
127
- poolOAuth(key: string): Promise<AuthResponse>;
128
- initSIWE({ address }: {
129
- address: string;
130
- }): Promise<SIWEInitResponse>;
131
- authenticateWithThirdPartyProvider({ provider, token, tokenType }: {
132
- provider: ThirdPartyOAuthProvider$1;
133
- token: string;
134
- tokenType: TokenType$1;
135
- }): Promise<AuthPlayerResponse$1>;
136
- authenticateWithSIWE({ signature, message, walletClientType, connectorType, }: {
137
- signature: string;
138
- message: string;
139
- walletClientType: string;
140
- connectorType: string;
141
- }): Promise<AuthResponse>;
142
- storeCredentials(auth: Auth): void;
143
- sendSignatureTransactionIntentRequest(transactionIntentId: string, userOperationHash?: string | null, signature?: string | null): Promise<TransactionIntentResponse$1>;
144
- signMessage(message: string | Uint8Array, options?: {
145
- hashMessage?: boolean;
146
- arrayifyMessage?: boolean;
147
- }): Promise<string>;
148
- signTypedData(domain: TypedDataDomain, types: Record<string, Array<TypedDataField>>, value: Record<string, any>): Promise<string>;
149
- sendRegisterSessionRequest(sessionId: string, signature: string, optimistic?: boolean): Promise<SessionResponse$1>;
150
- private recoverSigner;
151
- private waitSigner;
152
- getEmbeddedState(): EmbeddedState$1;
153
- private credentialsProvided;
154
- getAccessToken(): string | null;
155
- isLoaded(): boolean;
156
- getUser(): Promise<AuthPlayerResponse$1>;
157
- validateAndRefreshToken(): Promise<void>;
158
- }
159
-
160
- declare enum ShieldAuthProvider {
161
- OPENFORT = "openfort",
162
- CUSTOM = "custom"
163
- }
164
-
165
- interface ShieldOptions {
166
- baseURL?: string;
167
- apiKey: string;
168
- }
169
-
170
- interface ShieldAuthOptions {
171
- authProvider: ShieldAuthProvider;
172
- }
173
-
174
55
  declare enum EmbeddedState {
175
56
  NONE = 0,
176
57
  UNAUTHENTICATED = 1,
@@ -178,6 +59,28 @@ declare enum EmbeddedState {
178
59
  CREATING_ACCOUNT = 3,
179
60
  READY = 4
180
61
  }
62
+ type SessionKey = {
63
+ address: string;
64
+ isRegistered: boolean;
65
+ };
66
+ declare enum AuthType {
67
+ OPENFORT = "openfort",
68
+ THIRD_PARTY = "thirdParty"
69
+ }
70
+ type Auth = {
71
+ player?: string;
72
+ accessToken: string;
73
+ refreshToken: string;
74
+ };
75
+ type InitAuthResponse = {
76
+ url: string;
77
+ key: string;
78
+ };
79
+ type SIWEInitResponse = {
80
+ address: string;
81
+ nonce: string;
82
+ expiresAt: number;
83
+ };
181
84
  type InitializeOAuthOptions = {
182
85
  usePooling?: boolean;
183
86
  /** A URL to send the user to after they are confirmed. */
@@ -419,59 +322,12 @@ interface AuthPlayerResponse {
419
322
  'createdAt': number;
420
323
  'linkedAccounts': Array<LinkedAccountResponse>;
421
324
  }
422
-
423
- /**
424
- * ProviderErrors should take priority over RpcErrorCodes
425
- * https://eips.ethereum.org/EIPS/eip-1193#provider-errors
426
- * https://eips.ethereum.org/EIPS/eip-1474#error-codes
427
- */
428
- declare enum ProviderErrorCode {
429
- USER_REJECTED_REQUEST = 4001,
430
- UNAUTHORIZED = 4100,
431
- UNSUPPORTED_METHOD = 4200,
432
- DISCONNECTED = 4900
433
- }
434
- declare enum RpcErrorCode {
435
- RPC_SERVER_ERROR = -32000,
436
- INVALID_REQUEST = -32600,
437
- METHOD_NOT_FOUND = -32601,
438
- INVALID_PARAMS = -32602,
439
- INTERNAL_ERROR = -32603,
440
- PARSE_ERROR = -32700,
441
- TRANSACTION_REJECTED = -32003
442
- }
443
- declare class JsonRpcError extends Error {
444
- readonly message: string;
445
- readonly code: ProviderErrorCode | RpcErrorCode;
446
- constructor(code: ProviderErrorCode | RpcErrorCode, message: string);
325
+ interface AuthResponse {
326
+ 'player': AuthPlayerResponse;
327
+ 'token': string;
328
+ 'refreshToken': string;
447
329
  }
448
330
 
449
- interface RequestArguments {
450
- method: string;
451
- params?: Array<any>;
452
- }
453
- type JsonRpcRequestPayload = RequestArguments & {
454
- jsonrpc?: string;
455
- id?: string | number;
456
- };
457
- interface JsonRpcRequestCallback {
458
- (err: JsonRpcError | null, result?: JsonRpcResponsePayload | (JsonRpcResponsePayload | null)[] | null): void;
459
- }
460
- interface JsonRpcResponsePayload {
461
- result?: Array<any> | null;
462
- error?: JsonRpcError | null;
463
- jsonrpc?: string;
464
- id?: string | number;
465
- }
466
- type Provider = {
467
- request: (request: RequestArguments) => Promise<any>;
468
- sendAsync: (request: JsonRpcRequestPayload | JsonRpcRequestPayload[], callback: JsonRpcRequestCallback) => void;
469
- send: (request: string | JsonRpcRequestPayload | JsonRpcRequestPayload[], callbackOrParams?: JsonRpcRequestCallback | Array<any>, callback?: JsonRpcRequestCallback) => void;
470
- on: (event: string, listener: (...args: any[]) => void) => void;
471
- removeListener: (event: string, listener: (...args: any[]) => void) => void;
472
- isOpenfort: boolean;
473
- };
474
-
475
331
  /**
476
332
  * Openfort API
477
333
  * Complete Openfort API references and guides can be found at: https://openfort.xyz/docs
@@ -590,8 +446,419 @@ declare class SDKConfiguration {
590
446
  constructor({ baseConfiguration, shieldConfiguration, overrides, }: {
591
447
  baseConfiguration: OpenfortConfiguration;
592
448
  shieldConfiguration?: ShieldConfiguration;
593
- overrides?: SDKOverrides$1;
449
+ overrides?: SDKOverrides;
594
450
  });
595
451
  }
596
452
 
597
- export { AuthPlayerResponse, AuthType, BasicAuthProvider, EmbeddedState, InitializeOAuthOptions, OAuthProvider, OpenfortConfiguration, Provider, SDKConfiguration, SDKOverrides, SessionResponse, ShieldAuthOptions, ShieldAuthentication, ShieldConfiguration, ShieldOptions, ThirdPartyOAuthProvider, TokenType, TransactionIntentResponse, TypedDataDomain, TypedDataField, Openfort as default };
453
+ /**
454
+ * ProviderErrors should take priority over RpcErrorCodes
455
+ * https://eips.ethereum.org/EIPS/eip-1193#provider-errors
456
+ * https://eips.ethereum.org/EIPS/eip-1474#error-codes
457
+ */
458
+ declare enum ProviderErrorCode {
459
+ USER_REJECTED_REQUEST = 4001,
460
+ UNAUTHORIZED = 4100,
461
+ UNSUPPORTED_METHOD = 4200,
462
+ DISCONNECTED = 4900
463
+ }
464
+ declare enum RpcErrorCode {
465
+ RPC_SERVER_ERROR = -32000,
466
+ INVALID_REQUEST = -32600,
467
+ METHOD_NOT_FOUND = -32601,
468
+ INVALID_PARAMS = -32602,
469
+ INTERNAL_ERROR = -32603,
470
+ PARSE_ERROR = -32700,
471
+ TRANSACTION_REJECTED = -32003
472
+ }
473
+ declare class JsonRpcError extends Error {
474
+ readonly message: string;
475
+ readonly code: ProviderErrorCode | RpcErrorCode;
476
+ constructor(code: ProviderErrorCode | RpcErrorCode, message: string);
477
+ }
478
+
479
+ interface RequestArguments {
480
+ method: string;
481
+ params?: Array<any>;
482
+ }
483
+ type JsonRpcRequestPayload = RequestArguments & {
484
+ jsonrpc?: string;
485
+ id?: string | number;
486
+ };
487
+ interface JsonRpcRequestCallback {
488
+ (err: JsonRpcError | null, result?: JsonRpcResponsePayload | (JsonRpcResponsePayload | null)[] | null): void;
489
+ }
490
+ interface JsonRpcResponsePayload {
491
+ result?: Array<any> | null;
492
+ error?: JsonRpcError | null;
493
+ jsonrpc?: string;
494
+ id?: string | number;
495
+ }
496
+ type Provider = {
497
+ request: (request: RequestArguments) => Promise<any>;
498
+ sendAsync: (request: JsonRpcRequestPayload | JsonRpcRequestPayload[], callback: JsonRpcRequestCallback) => void;
499
+ send: (request: string | JsonRpcRequestPayload | JsonRpcRequestPayload[], callbackOrParams?: JsonRpcRequestCallback | Array<any>, callback?: JsonRpcRequestCallback) => void;
500
+ on: (event: string, listener: (...args: any[]) => void) => void;
501
+ removeListener: (event: string, listener: (...args: any[]) => void) => void;
502
+ isOpenfort: boolean;
503
+ };
504
+
505
+ interface ShieldAuthentication {
506
+ auth: ShieldAuthType;
507
+ token: string;
508
+ authProvider?: string;
509
+ tokenType?: string;
510
+ }
511
+ declare enum ShieldAuthType {
512
+ OPENFORT = "openfort",
513
+ CUSTOM = "custom"
514
+ }
515
+
516
+ declare class Openfort {
517
+ private signer?;
518
+ private readonly authManager;
519
+ private readonly config;
520
+ private readonly backendApiClients;
521
+ private readonly instanceManager;
522
+ private readonly iframeManager;
523
+ private readonly openfortEventEmitter;
524
+ constructor(sdkConfiguration: SDKConfiguration);
525
+ /**
526
+ * Logs the user out by flushing the signer and removing credentials.
527
+ */
528
+ logout(): Promise<void>;
529
+ /**
530
+ * Returns an Ethereum provider using the configured signer.
531
+ *
532
+ * @param options - Configuration options for the Ethereum provider.
533
+ * @returns A Provider instance.
534
+ * @throws {OpenfortError} If the signer is not an EmbeddedSigner.
535
+ */
536
+ getEthereumProvider(options?: {
537
+ announceProvider: boolean;
538
+ policy?: string;
539
+ }): Provider;
540
+ /**
541
+ * Configures a session key and returns the session key details.
542
+ *
543
+ * @returns A SessionKey object containing the address and registration status.
544
+ */
545
+ configureSessionKey(): SessionKey;
546
+ /**
547
+ * Configures an embedded signer.
548
+ *
549
+ * @param chainId - The chain ID for the embedded signer.
550
+ * @param shieldAuthentication - Shield authentication details.
551
+ * @param recoveryPassword - Recovery password.
552
+ */
553
+ configureEmbeddedSigner(chainId?: number, shieldAuthentication?: ShieldAuthentication, recoveryPassword?: string): Promise<void>;
554
+ /**
555
+ * Logs in a user with email and password.
556
+ *
557
+ * @param email - User's email.
558
+ * @param password - User's password.
559
+ * @returns An AuthResponse object containing authentication details.
560
+ */
561
+ logInWithEmailPassword({ email, password }: {
562
+ email: string;
563
+ password: string;
564
+ }): Promise<AuthResponse>;
565
+ /**
566
+ * Signs up a new user with email and password.
567
+ *
568
+ * @param email - User's email.
569
+ * @param password - User's password.
570
+ * @param options - Additional options for the sign-up process.
571
+ * @returns An AuthResponse object containing authentication details.
572
+ */
573
+ signUpWithEmailPassword({ email, password, options }: {
574
+ email: string;
575
+ password: string;
576
+ options?: {
577
+ data: {
578
+ name: string;
579
+ };
580
+ };
581
+ }): Promise<AuthResponse>;
582
+ /**
583
+ * Links an email and password to an existing account using an authentication token.
584
+ *
585
+ * @param email - User's email.
586
+ * @param password - User's password.
587
+ * @param authToken - Authentication token.
588
+ * @returns An AuthPlayerResponse object.
589
+ */
590
+ linkEmailPassword({ email, password, authToken }: {
591
+ email: string;
592
+ password: string;
593
+ authToken: string;
594
+ }): Promise<AuthPlayerResponse>;
595
+ /**
596
+ * Unlinks an email and password from an existing account using an authentication token.
597
+ *
598
+ * @param email - User's email.
599
+ * @param authToken - Authentication token.
600
+ * @returns An AuthPlayerResponse object.
601
+ */
602
+ unlinkEmailPassword({ email, authToken }: {
603
+ email: string;
604
+ authToken: string;
605
+ }): Promise<AuthPlayerResponse>;
606
+ /**
607
+ * Requests an email verification link.
608
+ *
609
+ * @param email - User's email.
610
+ * @param redirectUrl - Redirect URL after verification.
611
+ */
612
+ requestEmailVerification({ email, redirectUrl }: {
613
+ email: string;
614
+ redirectUrl: string;
615
+ }): Promise<void>;
616
+ /**
617
+ * Resets the user's password.
618
+ *
619
+ * @param email - User's email.
620
+ * @param password - New password.
621
+ * @param state - Verification state.
622
+ */
623
+ resetPassword({ email, password, state }: {
624
+ email: string;
625
+ password: string;
626
+ state: string;
627
+ }): Promise<void>;
628
+ /**
629
+ * Requests a password reset link.
630
+ *
631
+ * @param email - User's email.
632
+ * @param redirectUrl - Redirect URL after resetting password.
633
+ */
634
+ requestResetPassword({ email, redirectUrl }: {
635
+ email: string;
636
+ redirectUrl: string;
637
+ }): Promise<void>;
638
+ /**
639
+ * Verifies the user's email.
640
+ *
641
+ * @param email - User's email.
642
+ * @param state - Verification state.
643
+ */
644
+ verifyEmail({ email, state }: {
645
+ email: string;
646
+ state: string;
647
+ }): Promise<void>;
648
+ /**
649
+ * Initializes an OAuth authentication process.
650
+ *
651
+ * @param provider - OAuth provider.
652
+ * @param options - Additional options for initialization.
653
+ * @returns An InitAuthResponse object.
654
+ */
655
+ initOAuth({ provider, options }: {
656
+ provider: OAuthProvider;
657
+ options?: InitializeOAuthOptions;
658
+ }): Promise<InitAuthResponse>;
659
+ /**
660
+ * Initializes an OAuth linking process.
661
+ *
662
+ * @param provider - OAuth provider.
663
+ * @param authToken - Authentication token.
664
+ * @param options - Additional options for initialization.
665
+ * @returns An InitAuthResponse object.
666
+ */
667
+ initLinkOAuth({ provider, authToken, options }: {
668
+ provider: OAuthProvider;
669
+ authToken: string;
670
+ options?: InitializeOAuthOptions;
671
+ }): Promise<InitAuthResponse>;
672
+ /**
673
+ * Unlinks an OAuth provider from the account.
674
+ *
675
+ * @param provider - OAuth provider.
676
+ * @param authToken - Authentication token.
677
+ * @returns An AuthPlayerResponse object.
678
+ */
679
+ unlinkOAuth({ provider, authToken }: {
680
+ provider: OAuthProvider;
681
+ authToken: string;
682
+ }): Promise<AuthPlayerResponse>;
683
+ /**
684
+ * Polls for OAuth authentication completion.
685
+ *
686
+ * @param key - OAuth polling key.
687
+ * @returns An AuthResponse object.
688
+ */
689
+ poolOAuth(key: string): Promise<AuthResponse>;
690
+ /**
691
+ * Authenticates using a third-party OAuth provider.
692
+ *
693
+ * @param provider - Third-party OAuth provider.
694
+ * @param token - OAuth token.
695
+ * @param tokenType - Type of the OAuth token.
696
+ * @returns An AuthPlayerResponse object.
697
+ */
698
+ authenticateWithThirdPartyProvider({ provider, token, tokenType }: {
699
+ provider: ThirdPartyOAuthProvider;
700
+ token: string;
701
+ tokenType: TokenType;
702
+ }): Promise<AuthPlayerResponse>;
703
+ /**
704
+ * Initializes Sign-In with Ethereum (SIWE).
705
+ *
706
+ * @param address - Ethereum address.
707
+ * @returns A SIWEInitResponse object.
708
+ */
709
+ initSIWE({ address }: {
710
+ address: string;
711
+ }): Promise<SIWEInitResponse>;
712
+ /**
713
+ * Authenticates using Sign-In with Ethereum (SIWE).
714
+ *
715
+ * @param signature - SIWE signature.
716
+ * @param message - SIWE message.
717
+ * @param walletClientType - Wallet client type.
718
+ * @param connectorType - Connector type.
719
+ * @returns An AuthResponse object.
720
+ */
721
+ authenticateWithSIWE({ signature, message, walletClientType, connectorType, }: {
722
+ signature: string;
723
+ message: string;
724
+ walletClientType: string;
725
+ connectorType: string;
726
+ }): Promise<AuthResponse>;
727
+ /**
728
+ * Links a wallet using SIWE.
729
+ *
730
+ * @param signature - SIWE signature.
731
+ * @param message - SIWE message.
732
+ * @param walletClientType - Wallet client type.
733
+ * @param connectorType - Connector type.
734
+ * @param authToken - Authentication token.
735
+ * @returns An AuthPlayerResponse object.
736
+ */
737
+ linkWallet({ signature, message, walletClientType, connectorType, authToken, }: {
738
+ signature: string;
739
+ message: string;
740
+ walletClientType: string;
741
+ connectorType: string;
742
+ authToken: string;
743
+ }): Promise<AuthPlayerResponse>;
744
+ /**
745
+ * Unlinks a wallet.
746
+ *
747
+ * @param address - Wallet address.
748
+ * @param authToken - Authentication token.
749
+ * @returns An AuthPlayerResponse object.
750
+ */
751
+ unlinkWallet({ address, authToken }: {
752
+ address: string;
753
+ authToken: string;
754
+ }): Promise<AuthPlayerResponse>;
755
+ /**
756
+ * Stores authentication credentials.
757
+ *
758
+ * @param auth - Authentication details.
759
+ */
760
+ storeCredentials(auth: Auth): void;
761
+ /**
762
+ * Sends a signature transaction intent request.
763
+ *
764
+ * @param transactionIntentId - Transaction intent ID.
765
+ * @param userOperationHash - User operation hash.
766
+ * @param signature - Transaction signature.
767
+ * @param optimistic - Whether the request is optimistic.
768
+ * @returns A TransactionIntentResponse object.
769
+ * @throws {OpenfortError} If no userOperationHash or signature is provided.
770
+ */
771
+ sendSignatureTransactionIntentRequest(transactionIntentId: string, userOperationHash?: string | null, signature?: string | null, optimistic?: boolean): Promise<TransactionIntentResponse>;
772
+ /**
773
+ * Signs a message.
774
+ *
775
+ * @param message - Message to sign.
776
+ * @param options - Additional options for signing.
777
+ * @returns The signature.
778
+ * @throws {OpenfortError} If no signer is configured.
779
+ */
780
+ signMessage(message: string | Uint8Array, options?: {
781
+ hashMessage?: boolean;
782
+ arrayifyMessage?: boolean;
783
+ }): Promise<string>;
784
+ /**
785
+ * Signs typed data.
786
+ *
787
+ * @param domain - EIP-712 domain.
788
+ * @param types - Typed data types.
789
+ * @param value - Typed data value.
790
+ * @returns The signature.
791
+ * @throws {OpenfortError} If no signer is configured.
792
+ */
793
+ signTypedData(domain: TypedDataDomain, types: Record<string, Array<TypedDataField>>, value: Record<string, any>): Promise<string>;
794
+ /**
795
+ * Sends a session registration request.
796
+ *
797
+ * @param sessionId - Session ID.
798
+ * @param signature - Session signature.
799
+ * @param optimistic - Whether the request is optimistic.
800
+ * @returns A SessionResponse object.
801
+ */
802
+ sendRegisterSessionRequest(sessionId: string, signature: string, optimistic?: boolean): Promise<SessionResponse>;
803
+ /**
804
+ * Gets the embedded state of the current session.
805
+ *
806
+ * @returns The embedded state.
807
+ */
808
+ getEmbeddedState(): EmbeddedState;
809
+ /**
810
+ * Gets the current access token.
811
+ *
812
+ * @returns The access token, or null if not available.
813
+ */
814
+ getAccessToken(): string | null;
815
+ /**
816
+ * Retrieves the user details.
817
+ *
818
+ * @returns An AuthPlayerResponse object.
819
+ * @throws {OpenfortError} If no access token is found.
820
+ */
821
+ getUser(): Promise<AuthPlayerResponse>;
822
+ /**
823
+ * Validates and refreshes the access token if needed.
824
+ */
825
+ validateAndRefreshToken(): Promise<void>;
826
+ private credentialsProvided;
827
+ private recoverSigner;
828
+ private waitSigner;
829
+ private newEmbeddedSigner;
830
+ private flushSigner;
831
+ }
832
+
833
+ declare enum OpenfortErrorType {
834
+ AUTHENTICATION_ERROR = "AUTHENTICATION_ERROR",
835
+ INVALID_CONFIGURATION = "INVALID_CONFIGURATION",
836
+ NOT_LOGGED_IN_ERROR = "NOT_LOGGED_IN_ERROR",
837
+ REFRESH_TOKEN_ERROR = "REFRESH_TOKEN_ERROR",
838
+ USER_REGISTRATION_ERROR = "USER_REGISTRATION_ERROR",
839
+ LOGOUT_ERROR = "LOGOUT_ERROR",
840
+ OPERATION_NOT_SUPPORTED_ERROR = "OPERATION_NOT_SUPPORTED_ERROR",
841
+ MISSING_SESSION_SIGNER_ERROR = "MISSING_SESSION_SIGNER_ERROR",
842
+ MISSING_EMBEDDED_SIGNER_ERROR = "MISSING_EMBEDDED_SIGNER_ERROR",
843
+ MISSING_SIGNER_ERROR = "MISSING_SIGNER_ERROR"
844
+ }
845
+ declare class OpenfortError extends Error {
846
+ type: OpenfortErrorType;
847
+ constructor(message: string, type: OpenfortErrorType);
848
+ }
849
+
850
+ declare enum ShieldAuthProvider {
851
+ OPENFORT = "openfort",
852
+ CUSTOM = "custom"
853
+ }
854
+
855
+ interface ShieldOptions {
856
+ baseURL?: string;
857
+ apiKey: string;
858
+ }
859
+
860
+ interface ShieldAuthOptions {
861
+ authProvider: ShieldAuthProvider;
862
+ }
863
+
864
+ export { AuthPlayerResponse, AuthType, BasicAuthProvider, EmbeddedState, InitializeOAuthOptions, OAuthProvider, OpenfortConfiguration, OpenfortError, Provider, SDKConfiguration, SDKOverrides, SessionResponse, ShieldAuthOptions, ShieldAuthType, ShieldAuthentication, ShieldConfiguration, ShieldOptions, ThirdPartyOAuthProvider, TokenType, TransactionIntentResponse, TypedDataDomain, TypedDataField, Openfort as default };