superstack-wallet-sdk 0.6.0 → 0.6.3

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
@@ -65,6 +65,9 @@ interface SubAccountInfo {
65
65
  interface AccountInfo {
66
66
  name: string | null;
67
67
  sub_accounts: SubAccountInfo[];
68
+ credit_account: {
69
+ is_unified_account: boolean;
70
+ };
68
71
  }
69
72
  type MultiAccountRequest = {
70
73
  type: "Create";
@@ -666,6 +669,19 @@ declare class WalletClient {
666
669
  network?: Network;
667
670
  isBackup?: boolean;
668
671
  }): Promise<WalletInfo | null>;
672
+ bind(type: LoginType, params: {
673
+ state?: string;
674
+ code?: string;
675
+ redirect_uri?: string;
676
+ code_verifier?: string;
677
+ email?: string;
678
+ phone?: string;
679
+ wallet_address?: string;
680
+ challenge?: string;
681
+ signature?: string;
682
+ network?: Network;
683
+ isBackup?: boolean;
684
+ }): Promise<WalletInfo | null>;
669
685
  oauthInit(params: {
670
686
  provider: string;
671
687
  redirect_uri: string;
@@ -871,7 +887,7 @@ interface WalletState {
871
887
  enablePhantom: boolean;
872
888
  }
873
889
  interface WalletContextValue extends WalletState {
874
- connect: () => Promise<void>;
890
+ connect: (hideLoginModal?: boolean) => Promise<void>;
875
891
  disconnect: () => void;
876
892
  }
877
893
  interface WalletProviderProps {
@@ -882,7 +898,7 @@ declare function WalletProvider({ children, config }: WalletProviderProps): reac
882
898
  declare function useWallet(): WalletContextValue;
883
899
 
884
900
  declare function useConnect(): {
885
- connect: () => Promise<void>;
901
+ connect: (hideLoginModal?: boolean) => Promise<void>;
886
902
  disconnect: () => void;
887
903
  isConnecting: boolean;
888
904
  };
@@ -940,6 +956,7 @@ declare const WALLET_TYPE_KEY = "superstack_wallet_type";
940
956
  declare const BACKUP_WALLET_TYPE_KEY = "superstack_backup_wallet_type";
941
957
  declare const ACCESS_TOKEN_KEY = "embedded_wallet_access_token";
942
958
  declare const BACKUP_WALLET_INFO = "backup_wallet_info";
959
+ declare const IS_GOOGLE_AUTH_BIND = "is_google_auth_bind";
943
960
  interface StorageState {
944
961
  accessToken: string;
945
962
  socials: Social[];
@@ -951,8 +968,10 @@ declare class Storage {
951
968
  static saveWalletType(type: "phantom" | "embedded"): void;
952
969
  static saveBackupWalletType(type: "phantom_backup" | "embedded_backup"): void;
953
970
  static saveBackupWalletInfo(wallet: WalletInfo): void;
971
+ static saveIsGoogleAuthBind(type: boolean): void;
954
972
  static getWalletType(): "phantom" | "embedded" | null;
955
973
  static getBackupWalletType(): "phantom_backup" | "embedded_backup" | null;
974
+ static getIsGoogleAuthBind(): boolean | null;
956
975
  static getState(): StorageState | null;
957
976
  static getSocials(): Social[] | null;
958
977
  static getAccessToken(): string | null;
@@ -1070,5 +1089,27 @@ declare function useCoinbaseOnramp(solanaAddress: string, ethereumAddress: strin
1070
1089
  getCoinbaseOnrampUrl: (amount: number, blockchain?: "solana" | "ethereum", redirectUrl?: string) => Promise<string>;
1071
1090
  };
1072
1091
 
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 };
1092
+ declare function buildOAuthState(provider: string): string;
1093
+ declare function buildCodeVerifierAndChallenge(provider: string): Promise<{
1094
+ codeVerifier: string;
1095
+ codeChallenge: string;
1096
+ }>;
1097
+ declare function retrieveAndClearCodeVerifierAndChallenge(provider: string): {
1098
+ codeVerifier: string;
1099
+ codeChallenge: string;
1100
+ } | null;
1101
+ declare function retrieveAndClearState(provider: string): string | null;
1102
+ interface AuthLinkQueryParams {
1103
+ client_id: string;
1104
+ redirect_uri: string;
1105
+ state: string;
1106
+ code_challenge: string;
1107
+ }
1108
+ interface OAuthLinkRes {
1109
+ url: string;
1110
+ }
1111
+ declare function getTwitterOAuth2Link(params: AuthLinkQueryParams): Promise<string>;
1112
+ declare function getGoogleOAuth2Link(params: AuthLinkQueryParams): Promise<string>;
1113
+
1114
+ export { ACCESS_TOKEN_KEY, BACKUP_WALLET_INFO, BACKUP_WALLET_TYPE_KEY, IS_GOOGLE_AUTH_BIND, LighterGroupingType, LighterMarginMode, LighterOrderSide, LighterOrderType, LighterTimeInForce, Network, STORAGE_STATE_KEY, SocialType, Storage, VaultId, WALLET_TYPE_KEY, WalletClient, WalletProvider, WalletType, buildCodeVerifierAndChallenge, buildOAuthState, getGoogleOAuth2Link, getTwitterOAuth2Link, injectStyles, isVersionedTransaction, retrieveAndClearCodeVerifierAndChallenge, retrieveAndClearState, theme, useCoinbaseOnramp, useConnect, useLoginModal, useWallet, useWalletStatus };
1115
+ export type { AccountInfo, ApiResponse, AuthLinkQueryParams, 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, OAuthLinkRes, 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.6.0",
3
+ "version": "0.6.3",
4
4
  "description": "A wallet SDK for superstack",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",