superstack-wallet-sdk 0.4.10 → 0.4.12

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
@@ -141,12 +141,53 @@ interface TransferRequest {
141
141
  to: string;
142
142
  amount: string;
143
143
  decimals: number;
144
- token: string;
144
+ token?: string;
145
145
  network: Network;
146
146
  chain_id: number;
147
147
  }
148
- interface TransferResponse {
149
- tx_hash: string;
148
+ declare enum VaultId {
149
+ HyperbeatUltraHype = "HyperbeatUltraHype",
150
+ HyperbeatUltraUbtc = "HyperbeatUltraUbtc",
151
+ HyperbeatUsdt = "HyperbeatUsdt",
152
+ HyperbeatUsdc = "HyperbeatUsdc",
153
+ VentualsVlp = "VentualsVlp",
154
+ DnHype = "DnHype",
155
+ DnPump = "DnPump"
156
+ }
157
+ type BuildTransactionRequest = {
158
+ type: "HyperbeatVaultApprove";
159
+ data: {
160
+ vault_id: VaultId;
161
+ token: string;
162
+ amount: string;
163
+ };
164
+ } | {
165
+ type: "HyperbeatVaultDepositInstant";
166
+ data: {
167
+ vault_id: VaultId;
168
+ token: string;
169
+ amount: string;
170
+ min_receive_amount?: string | null;
171
+ referrer_id?: string | null;
172
+ };
173
+ } | {
174
+ type: "HyperbeatVaultRedeemInstant";
175
+ data: {
176
+ vault_id: VaultId;
177
+ token: string;
178
+ amount: string;
179
+ min_receive_amount?: string | null;
180
+ };
181
+ } | {
182
+ type: "HyperbeatVaultRedeemRequest";
183
+ data: {
184
+ vault_id: VaultId;
185
+ token: string;
186
+ amount: string;
187
+ };
188
+ };
189
+ interface BuildTransactionResponse {
190
+ raw_transaction: string;
150
191
  }
151
192
 
152
193
  interface PhantomWalletAdapterConfig {
@@ -341,29 +382,23 @@ declare class WalletClient {
341
382
  /**
342
383
  * Transfer tokens using the server-side transfer API
343
384
  * @param params Transfer parameters
344
- * @returns Transaction hash
385
+ * @returns Transfer response (tx hash and raw tx)
345
386
  */
346
387
  transfer(params: {
347
388
  from: string;
348
389
  to: string;
349
390
  amount: string;
350
391
  decimals: number;
351
- token: string;
392
+ token?: string;
352
393
  network: Network;
353
394
  chain_id: number;
354
- }): Promise<string>;
395
+ }): Promise<BuildTransactionResponse>;
355
396
  /**
356
- * Transfer Ethereum tokens (ERC-20 or native ETH)
357
- * @param params Transfer parameters
358
- * @returns Transaction hash
397
+ * Build a transaction using the server-side build transaction API
398
+ * @param request Build transaction request
399
+ * @returns Build transaction response with raw transaction
359
400
  */
360
- transferEthereum(params: {
361
- to: string;
362
- amount: string;
363
- decimals: number;
364
- token: string;
365
- chain_id: number;
366
- }): Promise<string>;
401
+ buildTransaction(request: BuildTransactionRequest): Promise<BuildTransactionResponse>;
367
402
  }
368
403
  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>>;
369
404
 
@@ -576,5 +611,5 @@ declare function useCoinbaseOnramp(): {
576
611
  getCoinbaseOnrampUrl: (amount: number, blockchain?: "solana" | "ethereum", redirectUrl?: string) => Promise<string>;
577
612
  };
578
613
 
579
- export { ACCESS_TOKEN_KEY, Network, STORAGE_STATE_KEY, SocialType, Storage, WALLET_TYPE_KEY, WalletClient, WalletProvider, WalletType, injectStyles, isVersionedTransaction, theme, useActiveWallet, useCoinbaseOnramp, useConnect, useLoginModal, useWallet, useWalletStatus };
580
- export type { AccountInfo, ApiResponse, CoinbaseOnrampRequest, IModalManager, LoginModalProps, LoginType, MiddleAccount, MiddleAccountRequest, OrderState, SignMessageResponse, SignRequestV1, SignRequestV2, SignTransactionResponse, SignTransactionReturnType, Social, SocialInfo, SupportedTransactionVersions, TransactionOrVersionedTransaction, TransferRequest, TransferResponse, UnsignedTx, UserSession, Wallet, WalletInfo, WalletProviderConfig };
614
+ export { ACCESS_TOKEN_KEY, Network, STORAGE_STATE_KEY, SocialType, Storage, VaultId, WALLET_TYPE_KEY, WalletClient, WalletProvider, WalletType, injectStyles, isVersionedTransaction, theme, useActiveWallet, useCoinbaseOnramp, useConnect, useLoginModal, useWallet, useWalletStatus };
615
+ export type { AccountInfo, ApiResponse, BuildTransactionRequest, BuildTransactionResponse, CoinbaseOnrampRequest, IModalManager, LoginModalProps, LoginType, MiddleAccount, MiddleAccountRequest, OrderState, SignMessageResponse, SignRequestV1, SignRequestV2, SignTransactionResponse, SignTransactionReturnType, Social, SocialInfo, SupportedTransactionVersions, TransactionOrVersionedTransaction, TransferRequest, UnsignedTx, UserSession, Wallet, WalletInfo, WalletProviderConfig };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "superstack-wallet-sdk",
3
- "version": "0.4.10",
3
+ "version": "0.4.12",
4
4
  "description": "A wallet SDK for superstack",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",