superstack-wallet-sdk 0.4.8 → 0.4.10
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/esm/src/client.js +1 -1
- package/dist/esm/src/client.js.map +1 -1
- package/dist/esm/src/types.js.map +1 -1
- package/dist/esm/types/client.d.ts +27 -1
- package/dist/esm/types/hooks.d.ts +1 -1
- package/dist/esm/types/types.d.ts +14 -1
- package/dist/index.cjs +6 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +43 -4
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import react__default, { ReactNode } from 'react';
|
|
|
7
7
|
type SupportedTransactionVersions = ReadonlySet<TransactionVersion> | null | undefined;
|
|
8
8
|
type TransactionOrVersionedTransaction<S extends SupportedTransactionVersions> = S extends null | undefined ? Transaction : Transaction | VersionedTransaction;
|
|
9
9
|
declare function isVersionedTransaction(transaction: Transaction | VersionedTransaction): transaction is VersionedTransaction;
|
|
10
|
-
type LoginType = "TwitterOAuth" | "GoogleOAuth" | "Phantom" | "Okx" | "Email" | "Phone" | "Telegram" | "TelegramOAuth" | "MetaMask" | "Rabby" | "Coinbase";
|
|
10
|
+
type LoginType = "TwitterOAuth" | "GoogleOAuth" | "Phantom" | "Okx" | "Email" | "Phone" | "Telegram" | "TelegramOAuth" | "MetaMask" | "Rabby" | "Coinbase" | "WalletConnect";
|
|
11
11
|
declare enum Network {
|
|
12
12
|
Solana = "Solana",
|
|
13
13
|
Ethereum = "Ethereum"
|
|
@@ -135,6 +135,19 @@ interface OrderState {
|
|
|
135
135
|
payment_address: string;
|
|
136
136
|
received: number;
|
|
137
137
|
}
|
|
138
|
+
interface TransferRequest {
|
|
139
|
+
user_id: string;
|
|
140
|
+
from: string;
|
|
141
|
+
to: string;
|
|
142
|
+
amount: string;
|
|
143
|
+
decimals: number;
|
|
144
|
+
token: string;
|
|
145
|
+
network: Network;
|
|
146
|
+
chain_id: number;
|
|
147
|
+
}
|
|
148
|
+
interface TransferResponse {
|
|
149
|
+
tx_hash: string;
|
|
150
|
+
}
|
|
138
151
|
|
|
139
152
|
interface PhantomWalletAdapterConfig {
|
|
140
153
|
}
|
|
@@ -276,7 +289,7 @@ declare class WalletClient {
|
|
|
276
289
|
client_id: string;
|
|
277
290
|
}>;
|
|
278
291
|
getSignChallenge(params: {
|
|
279
|
-
method: "phantom" | "metamask" | "rabby" | "coinbase";
|
|
292
|
+
method: "phantom" | "metamask" | "rabby" | "coinbase" | "walletconnect";
|
|
280
293
|
id: string;
|
|
281
294
|
}): Promise<{
|
|
282
295
|
challenge: string;
|
|
@@ -325,6 +338,32 @@ declare class WalletClient {
|
|
|
325
338
|
* @returns order status
|
|
326
339
|
*/
|
|
327
340
|
getOrderState(orderId: string): Promise<OrderState>;
|
|
341
|
+
/**
|
|
342
|
+
* Transfer tokens using the server-side transfer API
|
|
343
|
+
* @param params Transfer parameters
|
|
344
|
+
* @returns Transaction hash
|
|
345
|
+
*/
|
|
346
|
+
transfer(params: {
|
|
347
|
+
from: string;
|
|
348
|
+
to: string;
|
|
349
|
+
amount: string;
|
|
350
|
+
decimals: number;
|
|
351
|
+
token: string;
|
|
352
|
+
network: Network;
|
|
353
|
+
chain_id: number;
|
|
354
|
+
}): Promise<string>;
|
|
355
|
+
/**
|
|
356
|
+
* Transfer Ethereum tokens (ERC-20 or native ETH)
|
|
357
|
+
* @param params Transfer parameters
|
|
358
|
+
* @returns Transaction hash
|
|
359
|
+
*/
|
|
360
|
+
transferEthereum(params: {
|
|
361
|
+
to: string;
|
|
362
|
+
amount: string;
|
|
363
|
+
decimals: number;
|
|
364
|
+
token: string;
|
|
365
|
+
chain_id: number;
|
|
366
|
+
}): Promise<string>;
|
|
328
367
|
}
|
|
329
368
|
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>>;
|
|
330
369
|
|
|
@@ -387,7 +426,7 @@ declare function useLoginModal({ client, isOpen, onClose, onLogin, isLoading, }:
|
|
|
387
426
|
handleCodeSubmit: (code?: string, emailInput?: string) => Promise<void>;
|
|
388
427
|
handlePhoneCodeSubmit: (code?: string, phoneInput?: string) => Promise<void>;
|
|
389
428
|
handleSendPhoneVerificationCode: (phoneInput?: string) => Promise<void>;
|
|
390
|
-
handleGetChallenge: (address: string, method?: "metamask" | "phantom" | "rabby" | "coinbase") => Promise<{
|
|
429
|
+
handleGetChallenge: (address: string, method?: "metamask" | "phantom" | "rabby" | "coinbase" | "walletconnect") => Promise<{
|
|
391
430
|
challenge: string;
|
|
392
431
|
nonce: string;
|
|
393
432
|
expires_at: number;
|
|
@@ -538,4 +577,4 @@ declare function useCoinbaseOnramp(): {
|
|
|
538
577
|
};
|
|
539
578
|
|
|
540
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 };
|
|
541
|
-
export type { AccountInfo, ApiResponse, CoinbaseOnrampRequest, IModalManager, LoginModalProps, LoginType, MiddleAccount, MiddleAccountRequest, OrderState, SignMessageResponse, SignRequestV1, SignRequestV2, SignTransactionResponse, SignTransactionReturnType, Social, SocialInfo, SupportedTransactionVersions, TransactionOrVersionedTransaction, UnsignedTx, UserSession, Wallet, WalletInfo, WalletProviderConfig };
|
|
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 };
|