superstack-wallet-sdk 0.5.9 → 0.6.0

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,6 +1,5 @@
1
1
  import { TransactionVersion, Transaction, VersionedTransaction, PublicKey, Connection, TransactionSignature } from '@solana/web3.js';
2
2
  import { BaseMessageSignerWalletAdapter, WalletName, WalletReadyState, SendTransactionOptions } from '@solana/wallet-adapter-base';
3
- import * as viem from 'viem';
4
3
  import * as react from 'react';
5
4
  import react__default, { ReactNode } from 'react';
6
5
 
@@ -223,7 +222,7 @@ interface DeBridgeDlnCreateTxRequest {
223
222
  srcChainPriorityLevel?: string | null;
224
223
  }
225
224
  type BuildTransactionRequest = {
226
- wallet_address?: string | null;
225
+ wallet_address: string;
227
226
  } & ({
228
227
  type: "HyperbeatVaultApprove";
229
228
  data: {
@@ -472,11 +471,11 @@ interface ExchangeRequest {
472
471
  vaultAddress?: string | null;
473
472
  expiresAfter?: number | null;
474
473
  isMainnet?: boolean | null;
475
- walletAddress?: string | null;
474
+ walletAddress: string | null;
476
475
  }
477
476
  interface ExportInitRequest {
478
477
  user_nonce: string;
479
- account_index?: number;
478
+ account_index: number;
480
479
  }
481
480
  interface ExportInitResponse {
482
481
  server_nonce: string;
@@ -484,7 +483,7 @@ interface ExportInitResponse {
484
483
  interface ExportFinishRequest {
485
484
  user_nonce?: string;
486
485
  server_nonce?: string;
487
- account_index?: number;
486
+ account_index: number;
488
487
  is_export: boolean;
489
488
  }
490
489
  interface ExportWallet {
@@ -561,42 +560,26 @@ interface WalletProviderConfig {
561
560
  enablePhantom?: boolean;
562
561
  }
563
562
  declare class WalletClient {
563
+ walletInfo: WalletInfo | null;
564
+ private userId;
564
565
  private api;
565
566
  private middleAccountApi;
566
- private selectedWalletId;
567
567
  private solanaConnection;
568
568
  private ethereumProvider;
569
- private walletInfo;
570
569
  private phantomAdapter;
571
570
  private walletType;
572
- private backupWalletType;
573
571
  private solanaCluster;
574
572
  private ethereumNetwork;
575
573
  private defaultNetwork;
576
- constructor(config: WalletProviderConfig);
577
- private setWallet;
574
+ constructor(config: WalletProviderConfig & {
575
+ setWalletInfo: (walletInfo: WalletInfo | null) => void;
576
+ });
577
+ private setWalletInfo;
578
578
  private setWalletType;
579
- private setBackupWalletType;
580
- getWallet(): WalletInfo | null;
581
- getPhantomAdapter(): PhantomWalletAdapter | null;
582
- getWalletType(): "phantom" | "embedded";
583
- getBackupWalletType(): "phantom_backup" | "embedded_backup";
584
- get wallet(): Wallet | null;
585
- get address(): string | null;
586
- get network(): Network | null;
587
- get ethereumWallet(): Wallet | null;
588
- get ethereumAddress(): string | null;
589
- get solanaWallet(): Wallet | null;
590
- get forwardSolanaWallet(): Wallet | null;
591
- get forwardSolanaAddress(): string | null;
592
- get forwardEthereumWallet(): Wallet | null;
593
- get forwardEthereumAddress(): string | null;
594
- get solanaAddress(): string | null;
595
- get id(): string | null;
596
- get social_links(): Social[] | null;
597
579
  reconnect(isBackup?: boolean): Promise<WalletInfo | null>;
580
+ getPhantomAdapter(): PhantomWalletAdapter | null;
598
581
  connectPhantom(): Promise<WalletInfo | null>;
599
- updateAccountName(name: string, accountIndex?: number): Promise<WalletInfo>;
582
+ updateAccountName(name: string, accountIndex: number): Promise<WalletInfo>;
600
583
  /**
601
584
  * Create, enable, or disable a sub-account
602
585
  * @param request Multi-account request with type and data
@@ -627,7 +610,7 @@ declare class WalletClient {
627
610
  * @param transaction Solana transaction to sign
628
611
  * @returns signed transaction
629
612
  */
630
- signSolanaTransaction(transaction: Transaction | VersionedTransaction): Promise<Transaction | VersionedTransaction>;
613
+ signSolanaTransaction(transaction: Transaction | VersionedTransaction, solanaAddress: string): Promise<Transaction | VersionedTransaction>;
631
614
  /**
632
615
  * This method is used to sign a ethereum eip712 transaction with v2 sign api,
633
616
  * which is disabled in default.
@@ -647,7 +630,7 @@ declare class WalletClient {
647
630
  }>>;
648
631
  primaryType: string;
649
632
  message: Record<string, unknown>;
650
- }): Promise<string>;
633
+ }, ethereumAddress: string): Promise<string>;
651
634
  sendSolanaTransaction(transaction: Uint8Array): Promise<string>;
652
635
  sendEthereumTransaction(signedTransaction: string): Promise<string>;
653
636
  sendEmailVerificationCode(email: string): Promise<void>;
@@ -700,20 +683,18 @@ declare class WalletClient {
700
683
  nonce: string;
701
684
  expires_at: number;
702
685
  }>;
703
- getSession(): Promise<WalletInfo>;
686
+ getAndRefreshSession(): Promise<WalletInfo>;
704
687
  logout(isBackup?: boolean): Promise<void>;
705
688
  getOAuth2ClientId(provider: string): Promise<string>;
706
- setSelectedWallet(walletId: string): void;
707
- getSelectedWallet(): string | null;
708
- getSolanaBalance(): Promise<string>;
709
- getEthereumBalance(): Promise<string>;
689
+ getSolanaBalance(solanaAddress: string): Promise<string>;
690
+ getEthereumBalance(ethereumAddress: string): Promise<string>;
710
691
  fetchCoinbaseToken(address: string, blockchain?: "solana" | "ethereum"): Promise<string>;
711
692
  /**
712
693
  * This method is used to sign a ethereum eip712 transaction with v2 sign api,
713
694
  * which is disabled in default.
714
695
  * @returns viem signer adapter
715
696
  */
716
- viemSignerAdapter(): {
697
+ viemSignerAdapter(ethereumAddress: string): {
717
698
  signTypedData: (params: {
718
699
  domain: {
719
700
  name: string;
@@ -767,13 +748,13 @@ declare class WalletClient {
767
748
  * @param walletAddress Optional wallet address (will be added to request if provided)
768
749
  * @returns Build transaction response with raw transaction
769
750
  */
770
- buildTransaction(request: BuildTransactionRequest, walletAddress?: string): Promise<BuildTransactionResponse>;
751
+ buildTransaction(request: BuildTransactionRequest): Promise<BuildTransactionResponse>;
771
752
  /**
772
753
  * Initialize the export process by generating a server nonce
773
754
  * @param accountIndex Optional account index to export (defaults to 0)
774
755
  * @returns Server nonce for verification
775
756
  */
776
- exportInit(accountIndex?: number): Promise<ExportInitResponse>;
757
+ exportInit(accountIndex: number): Promise<ExportInitResponse>;
777
758
  /**
778
759
  * Finalize the export process and retrieve wallet private keys
779
760
  * @param params Export parameters including nonces and account index
@@ -782,7 +763,7 @@ declare class WalletClient {
782
763
  exportFinal(params: {
783
764
  userNonce: string;
784
765
  serverNonce: string;
785
- accountIndex?: number;
766
+ accountIndex: number;
786
767
  isExport?: boolean;
787
768
  }): Promise<ExportWalletResponse>;
788
769
  /**
@@ -790,7 +771,7 @@ declare class WalletClient {
790
771
  * @param accountIndex Optional account index (defaults to 0)
791
772
  * @returns Previously exported wallet information
792
773
  */
793
- getExportedWallets(accountIndex?: number): Promise<ExportWalletResponse>;
774
+ getExportedWallets(accountIndex: number): Promise<ExportWalletResponse>;
794
775
  /**
795
776
  * Initialize the account closure process
796
777
  * @returns Server nonce for verification
@@ -874,32 +855,6 @@ declare class WalletClient {
874
855
  */
875
856
  exchange(request: ExchangeRequest): Promise<ExchangeResponse>;
876
857
  }
877
- type SignTransactionReturnType<serializer extends viem.SerializeTransactionFn<viem.TransactionSerializable> = viem.SerializeTransactionFn<viem.TransactionSerializable>, transaction extends Parameters<serializer>[0] = Parameters<serializer>[0]> = viem.TransactionSerialized<viem.GetTransactionType<transaction>>;
878
-
879
- interface WalletState$1 {
880
- isAuthenticated: boolean;
881
- isConnecting: boolean;
882
- isInitialized: boolean;
883
- walletInfo: WalletInfo | null;
884
- wallet: WalletClient | null;
885
- session: UserSession | null;
886
- error: string | null;
887
- enableEmail: boolean;
888
- enablePhone: boolean;
889
- enableGoogle: boolean;
890
- enableTwitter: boolean;
891
- enablePhantom: boolean;
892
- }
893
- interface WalletContextValue$1 extends WalletState$1 {
894
- connect: () => Promise<void>;
895
- disconnect: () => void;
896
- }
897
- interface WalletProviderProps {
898
- children: ReactNode;
899
- config: WalletProviderConfig;
900
- }
901
- declare function WalletProvider({ children, config }: WalletProviderProps): react__default.JSX.Element;
902
- declare function useWallet(): WalletContextValue$1;
903
858
 
904
859
  interface WalletState {
905
860
  isAuthenticated: boolean;
@@ -919,12 +874,12 @@ interface WalletContextValue extends WalletState {
919
874
  connect: () => Promise<void>;
920
875
  disconnect: () => void;
921
876
  }
922
- interface WalletProviderBackupProps {
877
+ interface WalletProviderProps {
923
878
  children: ReactNode;
924
879
  config: WalletProviderConfig;
925
880
  }
926
- declare function WalletProviderBackup({ children, config }: WalletProviderBackupProps): react__default.JSX.Element;
927
- declare function useWalletBackup(): WalletContextValue;
881
+ declare function WalletProvider({ children, config }: WalletProviderProps): react__default.JSX.Element;
882
+ declare function useWallet(): WalletContextValue;
928
883
 
929
884
  declare function useConnect(): {
930
885
  connect: () => Promise<void>;
@@ -939,17 +894,6 @@ declare function useWalletStatus(): {
939
894
  isInitialized: boolean;
940
895
  ready: boolean;
941
896
  };
942
- declare function useWalletBackupStatus(): {
943
- isAuthenticated: boolean;
944
- authenticated: boolean;
945
- error: string | null;
946
- session: UserSession | null;
947
- isInitialized: boolean;
948
- ready: boolean;
949
- };
950
- declare function useActiveWallet(): {
951
- wallet: WalletClient | null;
952
- };
953
897
  declare function useLoginModal({ client, isOpen, onClose, onLogin, isLoading }: LoginModalProps): {
954
898
  email: string;
955
899
  setEmail: react.Dispatch<react.SetStateAction<string>>;
@@ -995,7 +939,6 @@ declare const STORAGE_STATE_KEY = "embedded_wallet_state";
995
939
  declare const WALLET_TYPE_KEY = "superstack_wallet_type";
996
940
  declare const BACKUP_WALLET_TYPE_KEY = "superstack_backup_wallet_type";
997
941
  declare const ACCESS_TOKEN_KEY = "embedded_wallet_access_token";
998
- declare const SWITCHED_ACCOUNT_ADDRESS = "switched_account_address";
999
942
  declare const BACKUP_WALLET_INFO = "backup_wallet_info";
1000
943
  interface StorageState {
1001
944
  accessToken: string;
@@ -1007,14 +950,12 @@ declare class Storage {
1007
950
  static saveAccessToken(token: string): void;
1008
951
  static saveWalletType(type: "phantom" | "embedded"): void;
1009
952
  static saveBackupWalletType(type: "phantom_backup" | "embedded_backup"): void;
1010
- static saveSwitchedAccountAddress(address: string): void;
1011
953
  static saveBackupWalletInfo(wallet: WalletInfo): void;
1012
954
  static getWalletType(): "phantom" | "embedded" | null;
1013
955
  static getBackupWalletType(): "phantom_backup" | "embedded_backup" | null;
1014
956
  static getState(): StorageState | null;
1015
957
  static getSocials(): Social[] | null;
1016
958
  static getAccessToken(): string | null;
1017
- static getSwitchedAccountAddress(): string | null;
1018
959
  static getBackupWalletInfo(): WalletInfo | null;
1019
960
  static clear(): void;
1020
961
  static clearBackup(): void;
@@ -1125,9 +1066,9 @@ declare const theme: {
1125
1066
 
1126
1067
  declare const injectStyles: () => void;
1127
1068
 
1128
- declare function useCoinbaseOnramp(): {
1069
+ declare function useCoinbaseOnramp(solanaAddress: string, ethereumAddress: string): {
1129
1070
  getCoinbaseOnrampUrl: (amount: number, blockchain?: "solana" | "ethereum", redirectUrl?: string) => Promise<string>;
1130
1071
  };
1131
1072
 
1132
- export { ACCESS_TOKEN_KEY, BACKUP_WALLET_INFO, BACKUP_WALLET_TYPE_KEY, LighterGroupingType, LighterMarginMode, LighterOrderSide, LighterOrderType, LighterTimeInForce, Network, STORAGE_STATE_KEY, SWITCHED_ACCOUNT_ADDRESS, SocialType, Storage, VaultId, WALLET_TYPE_KEY, WalletClient, WalletProvider, WalletProviderBackup, WalletType, injectStyles, isVersionedTransaction, theme, useActiveWallet, useCoinbaseOnramp, useConnect, useLoginModal, useWallet, useWalletBackup, useWalletBackupStatus, useWalletStatus };
1133
- export type { AccountInfo, ApiResponse, BuildTransactionRequest, BuildTransactionResponse, CloseFinishRequest, CloseFinishResponse, CloseInitRequest, CloseInitResponse, CoinbaseOnrampRequest, DeBridgeDlnCreateTxRequest, ExchangePayload, ExchangeRequest, ExchangeResponse, ExchangeSignature, ExportFinishRequest, ExportInitRequest, ExportInitResponse, ExportWallet, ExportWalletResponse, IModalManager, LighterAuthRequest, LighterAuthResponse, LighterBuildTransactionRequest, LighterBuildTransactionResponse, LighterCancelAllOrdersParams, LighterCancelOrderParams, LighterChangeKeyRequest, LighterChangeKeyResponse, LighterCreateSubAccountParams, LighterGeneralTransferParams, LighterGroupedOrderEntry, LighterGroupedOrdersParams, LighterLeverageParams, LighterOrderParams, LighterTxContext, LighterWithdrawParams, LoginModalProps, LoginType, MiddleAccount, MiddleAccountRequest, MultiAccountRequest, OrderState, SignMessageResponse, SignRequestV1, SignRequestV2, SignRequestV3, SignTransactionResponse, SignTransactionReturnType, Social, SocialInfo, SubAccountInfo, SupportedTransactionVersions, TransactionOrVersionedTransaction, TransferRequest, UnsignedTxV2, UnsignedTxV3, UserSession, Wallet, WalletInfo, WalletProviderConfig };
1073
+ export { ACCESS_TOKEN_KEY, BACKUP_WALLET_INFO, BACKUP_WALLET_TYPE_KEY, LighterGroupingType, LighterMarginMode, LighterOrderSide, LighterOrderType, LighterTimeInForce, Network, STORAGE_STATE_KEY, SocialType, Storage, VaultId, WALLET_TYPE_KEY, WalletClient, WalletProvider, WalletType, injectStyles, isVersionedTransaction, theme, useCoinbaseOnramp, useConnect, useLoginModal, useWallet, useWalletStatus };
1074
+ export type { AccountInfo, ApiResponse, BuildTransactionRequest, BuildTransactionResponse, CloseFinishRequest, CloseFinishResponse, CloseInitRequest, CloseInitResponse, CoinbaseOnrampRequest, DeBridgeDlnCreateTxRequest, ExchangePayload, ExchangeRequest, ExchangeResponse, ExchangeSignature, ExportFinishRequest, ExportInitRequest, ExportInitResponse, ExportWallet, ExportWalletResponse, IModalManager, LighterAuthRequest, LighterAuthResponse, LighterBuildTransactionRequest, LighterBuildTransactionResponse, LighterCancelAllOrdersParams, LighterCancelOrderParams, LighterChangeKeyRequest, LighterChangeKeyResponse, LighterCreateSubAccountParams, LighterGeneralTransferParams, LighterGroupedOrderEntry, LighterGroupedOrdersParams, LighterLeverageParams, LighterOrderParams, LighterTxContext, LighterWithdrawParams, LoginModalProps, LoginType, MiddleAccount, MiddleAccountRequest, MultiAccountRequest, OrderState, SignMessageResponse, SignRequestV1, SignRequestV2, SignRequestV3, SignTransactionResponse, Social, SocialInfo, SubAccountInfo, SupportedTransactionVersions, TransactionOrVersionedTransaction, TransferRequest, UnsignedTxV2, UnsignedTxV3, UserSession, Wallet, WalletInfo, WalletProviderConfig };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "superstack-wallet-sdk",
3
- "version": "0.5.9",
3
+ "version": "0.6.0",
4
4
  "description": "A wallet SDK for superstack",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -1,2 +0,0 @@
1
- import e,{createContext as a,useRef as t,useReducer as n,useCallback as o,useEffect as l,useContext as r}from"react";import{WalletClient as i}from"./client.js";import{ModalManager as c}from"./modal.js";import{Storage as s}from"./storage.js";import{retrieveAndClearCodeVerifierAndChallenge as d}from"./utils/oauth.js";const u={isAuthenticated:!1,isConnecting:!1,isInitialized:!1,walletInfo:null,wallet:null,session:null,error:null,enableEmail:!0,enablePhone:!1,enableGoogle:!0,enableTwitter:!1,enablePhantom:!0},p=a({});function _(e,a){switch(a.type){case"SET_CONNECTING_BACKUP":return{...e,isConnecting:a.payload};case"SET_INITIALIZED_BACKUP":return{...e,isInitialized:a.payload};case"SET_SESSION_BACKUP":return{...e,isAuthenticated:!0,session:a.payload,error:null};case"SET_WALLET_INFO_BACKUP":return{...e,walletInfo:a.payload};case"SET_WALLET_BACKUP":return{...e,wallet:a.payload};case"SET_ERROR_BACKUP":return{...e,error:a.payload};case"RESET_BACKUP":return{...u,isInitialized:!0};default:return e}}function E({children:a,config:r}){var E,h,w,y,T,P;const C=t(null);C.current||(C.current=new i(r));const m=C.current,A=t(null!==(E=r.modalManager)&&void 0!==E?E:null),[b,g]=n(_,{...u,enableEmail:null===(h=r.enableEmail)||void 0===h||h,enablePhone:null!==(w=r.enablePhone)&&void 0!==w&&w,enableGoogle:null===(y=r.enableGoogle)||void 0===y||y,enableTwitter:null!==(T=r.enableTwitter)&&void 0!==T&&T,enablePhantom:null===(P=r.enablePhantom)||void 0===P||P}),{walletInfo:f}=b,N=t(!1),I=o(()=>(A.current||"undefined"==typeof window||(A.current=new c),A.current),[]);l(()=>{r.modalManager&&(A.current=r.modalManager)},[r.modalManager]),l(()=>{!async function(){if(!(f||N.current||b.isInitialized)){N.current=!0;try{const e=await m.reconnect(!0);e&&(g({type:"SET_WALLET_INFO_BACKUP",payload:e}),g({type:"SET_WALLET_BACKUP",payload:m}))}catch(e){console.error("Auto reconnect failed:",e)}finally{g({type:"SET_INITIALIZED_BACKUP",payload:!0})}}}()},[m]),l(()=>{const e=async()=>{try{if(B.isConnecting)return;g({type:"SET_CONNECTING_BACKUP",payload:!0});const e=new URLSearchParams(window.location.search),a=e.get("wallet_oauth_provider"),t=e.get("wallet_oauth_state"),n=e.get("wallet_oauth_code");if(a&&t&&n){const e=d(a);if(!e)throw new Error("No code verifier found");const{codeVerifier:o,codeChallenge:l}=e;let r;if("twitter"===a)r="TwitterOAuth";else{if("google"!==a)throw new Error("Unsupported provider");r="GoogleOAuth"}I().showLoginModal({isBackup:!0,client:m,isLoading:!0,enableEmail:b.enableEmail,enablePhone:b.enablePhone,enableGoogle:b.enableGoogle,enableTwitter:b.enableTwitter,enablePhantom:b.enablePhantom});const i=await m.oauthLogin(r,{state:t,code:n,code_verifier:o});if(i){g({type:"SET_WALLET_INFO_BACKUP",payload:i}),g({type:"SET_WALLET_BACKUP",payload:m});const e=new URL(window.location.href);e.searchParams.delete("wallet_oauth_provider"),e.searchParams.delete("wallet_oauth_state"),e.searchParams.delete("wallet_oauth_code"),history.replaceState(null,"",e.toString())}}}catch(e){console.log("oauth login error: ",e)}finally{g({type:"SET_CONNECTING_BACKUP",payload:!1}),await I().hideModal(!0)}};return e(),window.addEventListener("popstate",e),()=>{window.removeEventListener("popstate",e)}},[]);const S=o(async()=>{try{g({type:"SET_CONNECTING_BACKUP",payload:!0});I().showLoginModal({isBackup:!0,client:m,enableEmail:b.enableEmail,enablePhone:b.enablePhone,enableGoogle:b.enableGoogle,enableTwitter:b.enableTwitter,enablePhantom:b.enablePhantom,onClose:()=>{g({type:"SET_CONNECTING_BACKUP",payload:!1})},onLogin:e=>{g({type:"SET_CONNECTING_BACKUP",payload:!1}),g({type:"SET_WALLET_INFO_BACKUP",payload:e}),g({type:"SET_WALLET_BACKUP",payload:m}),s.saveBackupWalletInfo(e)}})}catch(e){g({type:"SET_ERROR_BACKUP",payload:e instanceof Error?e.message:"Failed to connect"}),g({type:"SET_CONNECTING_BACKUP",payload:!1})}},[m]),L=o(async()=>{await m.logout(!0),g({type:"RESET_BACKUP"})},[m]);l(()=>{var e;"phantom_backup"===s.getBackupWalletType()&&m.getPhantomAdapter()&&(null===(e=m.getPhantomAdapter())||void 0===e||e.on("disconnect",()=>{L()}))},[m]);const B={...b,connect:S,disconnect:L};return e.createElement(p.Provider,{value:B},a)}function h(){const e=r(p);if(!e)throw new Error("useWallet must be used within a WalletProvider");return e}export{E as WalletProviderBackup,h as useWalletBackup};
2
- //# sourceMappingURL=context_backup.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"context_backup.js","sources":["../../../../src/context_backup.tsx"],"sourcesContent":[null],"names":["initialState","isAuthenticated","isConnecting","isInitialized","walletInfo","wallet","session","error","enableEmail","enablePhone","enableGoogle","enableTwitter","enablePhantom","WalletContext","createContext","walletReducer","state","action","type","payload","WalletProviderBackup","children","config","clientRef","useRef","current","WalletClient","client","modalManagerRef","_a","modalManager","dispatch","useReducer","_b","_c","_d","_e","_f","hasAttemptedReconnect","getModalManager","useCallback","window","ModalManager","useEffect","async","reconnect","console","autoReconnect","checkCallback","value","urlParams","URLSearchParams","location","search","walletOauthProvider","get","walletOauthState","walletOauthCode","result","retrieveAndClearCodeVerifierAndChallenge","Error","codeVerifier","codeChallenge","showLoginModal","isBackup","isLoading","oauthLogin","code","code_verifier","newUrl","URL","href","searchParams","delete","history","replaceState","toString","e","log","hideModal","addEventListener","removeEventListener","connect","onClose","onLogin","Storage","saveBackupWalletInfo","message","disconnect","logout","getBackupWalletType","getPhantomAdapter","on","React","createElement","Provider","useWalletBackup","context","useContext"],"mappings":"6TAgCA,MAAMA,EAA4B,CAC9BC,iBAAiB,EACjBC,cAAc,EACdC,eAAe,EACfC,WAAY,KACZC,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QAA1B9D,EAAAF,EAAOgE,2BAAmB,IAAA9D,GAAAA,EAAE+D,GAAG,aAAc,KACzCJ,QAGT,CAAC7D,IAEJ,MAAMsB,EAAQ,IACPjC,EACHkE,UACAM,cAGJ,OAAOK,EAAAC,cAACjF,EAAckF,SAAQ,CAAC9C,MAAOA,GAAQ5B,EAClD,UAEgB2E,IACZ,MAAMC,EAAUC,EAAWrF,GAC3B,IAAKoF,EACD,MAAM,IAAIrC,MAAM,kDAEpB,OAAOqC,CACX"}
@@ -1,28 +0,0 @@
1
- import React, { type ReactNode } from "react";
2
- import { WalletInfo, UserSession } from "./types";
3
- import { WalletClient, WalletProviderConfig } from "./client";
4
- interface WalletState {
5
- isAuthenticated: boolean;
6
- isConnecting: boolean;
7
- isInitialized: boolean;
8
- walletInfo: WalletInfo | null;
9
- wallet: WalletClient | null;
10
- session: UserSession | null;
11
- error: string | null;
12
- enableEmail: boolean;
13
- enablePhone: boolean;
14
- enableGoogle: boolean;
15
- enableTwitter: boolean;
16
- enablePhantom: boolean;
17
- }
18
- interface WalletContextValue extends WalletState {
19
- connect: () => Promise<void>;
20
- disconnect: () => void;
21
- }
22
- interface WalletProviderBackupProps {
23
- children: ReactNode;
24
- config: WalletProviderConfig;
25
- }
26
- export declare function WalletProviderBackup({ children, config }: WalletProviderBackupProps): React.JSX.Element;
27
- export declare function useWalletBackup(): WalletContextValue;
28
- export {};