superstack-wallet-sdk 0.6.3 → 0.6.5

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
@@ -54,6 +54,19 @@ interface WalletInfo {
54
54
  is_exported: boolean;
55
55
  access_token?: string;
56
56
  }
57
+ declare enum AccountMode {
58
+ Basic = "Basic",
59
+ Advanced = "Advanced",
60
+ Unified = "Unified"
61
+ }
62
+ interface SingleCreditAccountInfo {
63
+ address: string;
64
+ created_at: number;
65
+ }
66
+ interface CreditAccountInfo {
67
+ account_mode: AccountMode;
68
+ hypercore?: SingleCreditAccountInfo | null;
69
+ }
57
70
  interface SubAccountInfo {
58
71
  account_index: number;
59
72
  secondary_index: number;
@@ -61,13 +74,12 @@ interface SubAccountInfo {
61
74
  created_at: number;
62
75
  is_exported: boolean;
63
76
  is_enabled: boolean;
77
+ credit_account: CreditAccountInfo;
64
78
  }
65
79
  interface AccountInfo {
66
80
  name: string | null;
67
81
  sub_accounts: SubAccountInfo[];
68
- credit_account: {
69
- is_unified_account: boolean;
70
- };
82
+ credit_account: CreditAccountInfo;
71
83
  }
72
84
  type MultiAccountRequest = {
73
85
  type: "Create";
@@ -110,6 +122,32 @@ interface SignRequestV3 {
110
122
  address: string;
111
123
  tx: UnsignedTxV3;
112
124
  }
125
+ interface Eip712TypedData {
126
+ domain: {
127
+ name: string;
128
+ version: string;
129
+ chainId: number;
130
+ verifyingContract: `0x${string}`;
131
+ };
132
+ types: Record<string, Array<{
133
+ name: string;
134
+ type: string;
135
+ }>>;
136
+ primaryType: string;
137
+ message: Record<string, unknown>;
138
+ }
139
+ type AuthPayload = {
140
+ EthereumEip712: Eip712TypedData;
141
+ };
142
+ interface AuthRequestV3 {
143
+ user_id: string;
144
+ network: string;
145
+ address: string;
146
+ payload: AuthPayload;
147
+ }
148
+ interface AuthResponse {
149
+ signature: string;
150
+ }
113
151
  interface UserSession {
114
152
  id: string;
115
153
  userId: string;
@@ -838,6 +876,23 @@ declare class WalletClient {
838
876
  Solana: string;
839
877
  };
840
878
  }): Promise<string>;
879
+ /**
880
+ * Raw v3 auth API - Authenticate with EIP-712 typed data
881
+ * Note: v3 auth API only supports Ethereum EIP-712 authentication
882
+ * The domain fields (name, version, chainId, verifyingContract) are automatically set to the fixed auth domain values
883
+ * @param params Auth parameters including network, address, types, primaryType, and message
884
+ * @returns Auth response with signature
885
+ */
886
+ authV3(params: {
887
+ network: Network;
888
+ address: string;
889
+ types: Record<string, Array<{
890
+ name: string;
891
+ type: string;
892
+ }>>;
893
+ primaryType: string;
894
+ message: Record<string, unknown>;
895
+ }): Promise<string>;
841
896
  /**
842
897
  * Build a Lighter transaction using the server-side build transaction API
843
898
  * @param request Lighter build transaction request (with optional wallet_address field)
@@ -1111,5 +1166,5 @@ interface OAuthLinkRes {
1111
1166
  declare function getTwitterOAuth2Link(params: AuthLinkQueryParams): Promise<string>;
1112
1167
  declare function getGoogleOAuth2Link(params: AuthLinkQueryParams): Promise<string>;
1113
1168
 
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 };
1169
+ export { ACCESS_TOKEN_KEY, AccountMode, 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 };
1170
+ export type { AccountInfo, ApiResponse, AuthLinkQueryParams, AuthPayload, AuthRequestV3, AuthResponse, BuildTransactionRequest, BuildTransactionResponse, CloseFinishRequest, CloseFinishResponse, CloseInitRequest, CloseInitResponse, CoinbaseOnrampRequest, CreditAccountInfo, DeBridgeDlnCreateTxRequest, Eip712TypedData, 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, SingleCreditAccountInfo, 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.3",
3
+ "version": "0.6.5",
4
4
  "description": "A wallet SDK for superstack",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -93,5 +93,6 @@
93
93
  "ts-jest": "^29.1.2",
94
94
  "tslib": "^2.6.2",
95
95
  "typescript": "^5.3.3"
96
- }
96
+ },
97
+ "packageManager": "pnpm@10.25.0+sha512.5e82639027af37cf832061bcc6d639c219634488e0f2baebe785028a793de7b525ffcd3f7ff574f5e9860654e098fe852ba8ac5dd5cefe1767d23a020a92f501"
97
98
  }