@dimcool/sdk 0.1.24 → 0.1.26
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/README.md +63 -31
- package/dist/index.cjs +564 -21900
- package/dist/index.d.cts +109 -6
- package/dist/index.d.ts +109 -6
- package/dist/index.js +519 -21866
- package/package.json +4 -1
package/dist/index.d.cts
CHANGED
|
@@ -662,6 +662,52 @@ interface PaginatedNotificationsResponse {
|
|
|
662
662
|
limit: number;
|
|
663
663
|
unreadCount: number;
|
|
664
664
|
}
|
|
665
|
+
type TransactionJobStatus = 'PENDING' | 'PROCESSING' | 'CONFIRMING' | 'COMPLETED' | 'FAILED' | 'CANCELLED';
|
|
666
|
+
type TransactionJobType = 'GAME_PAYOUT_WINNER' | 'GAME_PAYOUT_DRAW' | 'PREDICTION_MARKET_PAYOUT' | 'PREDICTION_MARKET_REFUND' | 'PREDICTION_MARKET_BONUS' | 'REFERRAL_CLAIM' | 'LOBBY_DEPOSIT_REFUND' | 'ESCROW_SWEEP' | 'P2P_TRANSFER_CONFIRM' | 'LOBBY_DEPOSIT_CONFIRM';
|
|
667
|
+
interface TransactionJob {
|
|
668
|
+
id: string;
|
|
669
|
+
type: TransactionJobType;
|
|
670
|
+
status: TransactionJobStatus;
|
|
671
|
+
idempotencyKey: string;
|
|
672
|
+
recipientUserId: string;
|
|
673
|
+
amount: number;
|
|
674
|
+
mint: string;
|
|
675
|
+
gameHistoryId?: string | null;
|
|
676
|
+
contextType?: string | null;
|
|
677
|
+
contextId?: string | null;
|
|
678
|
+
bullmqJobId?: string | null;
|
|
679
|
+
attempts: number;
|
|
680
|
+
maxAttempts: number;
|
|
681
|
+
lastError?: string | null;
|
|
682
|
+
walletTransactionId?: string | null;
|
|
683
|
+
signature?: string | null;
|
|
684
|
+
payload: Record<string, unknown>;
|
|
685
|
+
scheduledFor?: string | null;
|
|
686
|
+
startedAt?: string | null;
|
|
687
|
+
completedAt?: string | null;
|
|
688
|
+
failedAt?: string | null;
|
|
689
|
+
createdAt: string;
|
|
690
|
+
updatedAt: string;
|
|
691
|
+
recipientUser?: {
|
|
692
|
+
id: string;
|
|
693
|
+
username?: string | null;
|
|
694
|
+
};
|
|
695
|
+
}
|
|
696
|
+
interface TransactionQueueStats {
|
|
697
|
+
pending: number;
|
|
698
|
+
processing: number;
|
|
699
|
+
confirming: number;
|
|
700
|
+
completed: number;
|
|
701
|
+
failed: number;
|
|
702
|
+
cancelled: number;
|
|
703
|
+
}
|
|
704
|
+
interface PaginatedTransactionJobs {
|
|
705
|
+
items: TransactionJob[];
|
|
706
|
+
total: number;
|
|
707
|
+
page: number;
|
|
708
|
+
limit: number;
|
|
709
|
+
totalPages: number;
|
|
710
|
+
}
|
|
665
711
|
interface Achievement {
|
|
666
712
|
id: string;
|
|
667
713
|
code: string;
|
|
@@ -699,11 +745,16 @@ interface WalletSigner {
|
|
|
699
745
|
*/
|
|
700
746
|
signMessage: (message: string) => Promise<Uint8Array | string>;
|
|
701
747
|
/**
|
|
702
|
-
* Sign a transaction
|
|
703
|
-
*
|
|
704
|
-
* @returns The signed transaction
|
|
748
|
+
* Sign a transaction and return the signed transaction.
|
|
749
|
+
* Mutually exclusive with signAndSendTransaction — provide exactly one.
|
|
705
750
|
*/
|
|
706
|
-
signTransaction
|
|
751
|
+
signTransaction?: (transaction: Transaction) => Promise<Transaction>;
|
|
752
|
+
/**
|
|
753
|
+
* Sign and send a transaction in one step, returning the signature string.
|
|
754
|
+
* Used by embedded wallets that cannot return signed bytes without also sending.
|
|
755
|
+
* Mutually exclusive with signTransaction — provide exactly one.
|
|
756
|
+
*/
|
|
757
|
+
signAndSendTransaction?: (transaction: Transaction) => Promise<string>;
|
|
707
758
|
}
|
|
708
759
|
interface BalanceResponse {
|
|
709
760
|
sol: number;
|
|
@@ -867,12 +918,22 @@ declare class Wallet {
|
|
|
867
918
|
* @returns The signature
|
|
868
919
|
*/
|
|
869
920
|
signMessage(message: string): Promise<Uint8Array | string>;
|
|
921
|
+
/**
|
|
922
|
+
* Check whether the configured signer uses signAndSendTransaction (client-sent mode).
|
|
923
|
+
*/
|
|
924
|
+
isSignAndSendMode(): boolean;
|
|
870
925
|
/**
|
|
871
926
|
* Sign a transaction using the configured signer
|
|
872
927
|
* @param transaction - The transaction to sign
|
|
873
928
|
* @returns The signed transaction
|
|
874
929
|
*/
|
|
875
930
|
signTransaction(transaction: Transaction): Promise<Transaction>;
|
|
931
|
+
/**
|
|
932
|
+
* Sign and send a transaction using the configured signer (client-sent mode).
|
|
933
|
+
* @param transaction - The transaction to sign and send
|
|
934
|
+
* @returns The transaction signature
|
|
935
|
+
*/
|
|
936
|
+
signAndSendTransaction(transaction: Transaction): Promise<string>;
|
|
876
937
|
/**
|
|
877
938
|
* Get QR code as a data URL for the current user's wallet address.
|
|
878
939
|
* Use as <img src={url} /> in the deposit / add-funds section.
|
|
@@ -931,9 +992,14 @@ declare class Wallet {
|
|
|
931
992
|
* @returns Transaction signature and status
|
|
932
993
|
*/
|
|
933
994
|
submitTransfer(signedTransaction: string, senderAddress: string, recipientAddress: string, amount: number, token?: TransferToken, ataCreated?: boolean, recipientInput?: string): Promise<SubmitTransferResponse>;
|
|
995
|
+
/**
|
|
996
|
+
* Confirm a transfer that was already sent by the client (signAndSendTransaction path).
|
|
997
|
+
*/
|
|
998
|
+
confirmTransferSignature(signature: string, senderAddress: string, recipientAddress: string, amount: number, token?: TransferToken, ataCreated?: boolean, recipientInput?: string): Promise<SubmitTransferResponse>;
|
|
934
999
|
/**
|
|
935
1000
|
* Full transfer flow in one call: prepare -> sign -> submit
|
|
936
1001
|
* Recipient can be username, .sol domain, or Solana address (resolved by backend).
|
|
1002
|
+
* Automatically uses signAndSendTransaction or signTransaction based on signer capability.
|
|
937
1003
|
*/
|
|
938
1004
|
send(recipient: string, amount: number, token?: TransferToken): Promise<SendTransferResponse>;
|
|
939
1005
|
}
|
|
@@ -988,6 +1054,17 @@ declare class Admin {
|
|
|
988
1054
|
category?: CriticalIncidentCategory;
|
|
989
1055
|
}): Promise<PaginatedCriticalIncidents>;
|
|
990
1056
|
resolveCriticalIncident(id: string, resolutionNote?: string): Promise<CriticalIncident>;
|
|
1057
|
+
getTransactionQueueStats(): Promise<TransactionQueueStats>;
|
|
1058
|
+
getTransactionQueueJobs(input?: {
|
|
1059
|
+
status?: TransactionJobStatus;
|
|
1060
|
+
type?: TransactionJobType;
|
|
1061
|
+
userId?: string;
|
|
1062
|
+
page?: number;
|
|
1063
|
+
limit?: number;
|
|
1064
|
+
}): Promise<PaginatedTransactionJobs>;
|
|
1065
|
+
getTransactionQueueJob(id: string): Promise<TransactionJob>;
|
|
1066
|
+
retryTransactionQueueJob(id: string): Promise<TransactionJob>;
|
|
1067
|
+
cancelTransactionQueueJob(id: string): Promise<TransactionJob>;
|
|
991
1068
|
getPlatformFees(input?: {
|
|
992
1069
|
page?: number;
|
|
993
1070
|
limit?: number;
|
|
@@ -2040,10 +2117,16 @@ interface SubmitDepositResponse {
|
|
|
2040
2117
|
signature: string;
|
|
2041
2118
|
status: string;
|
|
2042
2119
|
}
|
|
2120
|
+
interface DepositForLobbyResponse {
|
|
2121
|
+
signature: string;
|
|
2122
|
+
status: string;
|
|
2123
|
+
canProceedToQueue: boolean;
|
|
2124
|
+
}
|
|
2043
2125
|
declare class Escrow {
|
|
2044
2126
|
private http;
|
|
2127
|
+
private wallet;
|
|
2045
2128
|
private logger?;
|
|
2046
|
-
constructor(http: IHttpClient, logger?: ILogger | undefined);
|
|
2129
|
+
constructor(http: IHttpClient, wallet: Wallet, logger?: ILogger | undefined);
|
|
2047
2130
|
/**
|
|
2048
2131
|
* Start the deposit flow for a lobby
|
|
2049
2132
|
* Transitions the lobby to 'preparing' state
|
|
@@ -2063,6 +2146,20 @@ declare class Escrow {
|
|
|
2063
2146
|
* Check the deposit status for all players in a lobby
|
|
2064
2147
|
*/
|
|
2065
2148
|
getDepositStatus(lobbyId: string): Promise<DepositStatusResponse>;
|
|
2149
|
+
/**
|
|
2150
|
+
* Confirm a deposit that was already sent by the client (signAndSendTransaction path).
|
|
2151
|
+
*/
|
|
2152
|
+
confirmDepositSignature(lobbyId: string, signature: string): Promise<{
|
|
2153
|
+
status: string;
|
|
2154
|
+
}>;
|
|
2155
|
+
/**
|
|
2156
|
+
* One-call lobby deposit: start deposits, prepare, sign, submit, and poll until
|
|
2157
|
+
* the current user's deposit is confirmed. Requires sdk.wallet.setSigner() to be set.
|
|
2158
|
+
* Returns when all required deposits are confirmed and the lobby can proceed to queue.
|
|
2159
|
+
*
|
|
2160
|
+
* Automatically uses signAndSendTransaction or signTransaction based on signer capability.
|
|
2161
|
+
*/
|
|
2162
|
+
depositForLobby(lobbyId: string): Promise<DepositForLobbyResponse>;
|
|
2066
2163
|
claimLobbyDepositRefund(lobbyId: string, depositSignature: string): Promise<{
|
|
2067
2164
|
signature: string;
|
|
2068
2165
|
status: string;
|
|
@@ -2652,9 +2749,11 @@ declare class StandaloneWsTransport extends BaseWsTransport {
|
|
|
2652
2749
|
private accessToken;
|
|
2653
2750
|
private reconnectAttempts;
|
|
2654
2751
|
private reconnectTimer;
|
|
2752
|
+
private periodicReconnectInterval;
|
|
2655
2753
|
private maxReconnectAttempts;
|
|
2656
2754
|
private reconnectDelay;
|
|
2657
2755
|
private reconnectDelayMax;
|
|
2756
|
+
private static readonly PERIODIC_RECONNECT_MS;
|
|
2658
2757
|
private wildcardHandlers;
|
|
2659
2758
|
private eventHandlers;
|
|
2660
2759
|
private registeredEvents;
|
|
@@ -2671,6 +2770,10 @@ declare class StandaloneWsTransport extends BaseWsTransport {
|
|
|
2671
2770
|
protected onLeaveRoom(roomName: string): void;
|
|
2672
2771
|
private ensureSocket;
|
|
2673
2772
|
private reconnectWithAuth;
|
|
2773
|
+
/** Clear socket reference so ensureSocket() can create a new connection. */
|
|
2774
|
+
private clearSocketForReconnect;
|
|
2775
|
+
private clearPeriodicReconnect;
|
|
2776
|
+
private startPeriodicReconnect;
|
|
2674
2777
|
private scheduleReconnect;
|
|
2675
2778
|
private getEventHandlers;
|
|
2676
2779
|
private unsubscribeEvent;
|
|
@@ -2727,4 +2830,4 @@ declare class HttpClient implements IHttpClient {
|
|
|
2727
2830
|
private payChallenge;
|
|
2728
2831
|
}
|
|
2729
2832
|
|
|
2730
|
-
export { type AcceptChallengeResponse, type Achievement, Activity, type ActivityFeedItem, type ActivityFeedItemType, type ActivityFeedResponse, type ActivityFeedUser, Admin, type AdminDailyStats, type AdminDailyStatsItem, type AdminGameHistory, type AdminGameHistoryFeeBreakdown, type AdminGameHistoryFeePlayer, type AdminGameHistoryPlayer, type AdminMarketDailyStats, type AdminMarketDailyStatsItem, type AdminMarketDetail, type AdminMarketStats, type AdminStats, type AdminWalletActivityItem, type AdminWalletActivityResponse, type ApiError, type AppNotification, type AppNotificationType, type ApplyReferralCodeResponse, type BalanceResponse, type BetOption, type BroadcastTipRequest, BrowserLocalStorage, Challenges, Chat, type ChatContext, type ChatContextType, type ChatMessage, type ChatMessageReply, type ChatMessageType, type ChatReaction, type ChatReadBy, type ChatState, type ChatStore, type ChatStoreState, type ClaimReferralRewardsResponse, type CreateChallengeRequest, type CreateChallengeResponse, type CreateLobbyRequest, type CreateTicketData, type CriticalIncident, type CriticalIncidentCategory, type CriticalIncidentImpactType, type CriticalIncidentSeverity, type CriticalIncidentStatus, type CriticalIncidentSummary, type CurrentGame, Daily, type DailyParticipant, type DailyRoom, type DailyToken, type DepositStatus, type DepositStatusResponse, type DmThread, type DmThreadsStore, type DmThreadsStoreState, type DonateToGameResponse, ESTIMATED_SOL_FEE_LAMPORTS, Escrow, type EscrowSweepPreview, type EscrowSweepRecord, type FaucetResponse, type FeatureFlag, type FriendRequestItem, type FriendsStore, type FriendsStoreState, type FriendshipStatus, type Game, type GameActionsStore, type GameActionsStoreState, type GameHistoryItem, type GameMetrics, type GamePlayer, type GameStateResponse, type GameStore, type GameStoreState, type GameType, Games, type GenerateHandshakeResponse, type GetTicketsOptions, HttpClient, type IHttpClient, type ILogger, type IStorage, type InviteFriendRequest, type LeaderboardEntry, type LeaderboardQuery, type LeaderboardRange, type LeaderboardResponse, Leaderboards, type LivePlayer, type LivePlayersPage, Lobbies, type Lobby, type LobbyMatchedEvent, type LobbyPlayer, type LobbyStore, type LobbyStoreState, type LogLevel, type LoginResponse, MIN_SOL_TRANSFER_AMOUNT, MIN_TRANSFER_AMOUNT, type MarketBuyResult, type MarketPosition, type MarketSellResult, type MarketState, Markets, type MoneyMinor, NodeStorage, type NotificationEvent, type NotificationsStore, type NotificationsStoreState, type PaginatedCriticalIncidents, type PaginatedFriends, type PaginatedNotificationsResponse, type PaginatedPlatformFees, type PaginatedReports, type PaginatedSearchUsers, type PaginatedSessions, type PaginatedSupportTickets, type PaginatedUsers, type PaymentRequiredChallenge, type PlatformFeeItem, type PrepareDepositResponse, type PrepareTipRequest, type PrepareTipResponse, type PrepareTransferRequest, type PrepareTransferResponse, type PublicUser, type QueueStats, type RedeemResult, type ReferralRewardItem, type ReferralRewardStatus, type ReferralRewardsResponse, type ReferralSummary, type ReferralTreeItem, type ReferralTreeResponse, Referrals, type Report, type ReportCount, type ReportStatus, type ReportUser, Reports, type RetryOptions, SDK, type SDKConfig, SDK_VERSION, SOL_DECIMALS, SOL_MINT, type SdkStore, type SdkUpgradeInfo, type SearchUser, type SendMessageRequest, type SendTipResponse, type SendTransferResponse, type Session, SharedWorkerTransport, Spectate, type SpectatorMetrics, type SpectatorMetricsByUser, StandaloneWsTransport, type SubmitDepositResponse, type SubmitTransferRequest, type SubmitTransferResponse, Support, type SupportMessage, type SupportMessageSenderRole, type SupportTicket, type SupportTicketCategory, type SupportTicketPriority, type SupportTicketStatus, type SupportTicketUser, type SystemMessageType, TOKEN_KEY, TRANSFER_FEE_MINOR, Tips, type TransferToken, type TypingUser, type UpdateTicketData, type User, type UserAchievement, type UserActivity, type UserActivityStatus, type UserStats, type UsernameAvailabilityResponse, Users, type ValidAction, Wallet, type WalletActivityCounterpartyType, type WalletActivityDirection, type WalletActivityItem, type WalletActivityKind, type WalletActivityResponse, type WalletActivityStatus, type WalletClaimAction, type WalletMeta, type WalletResponse, type WalletSigner, type WsEvent, WsEventBus, type WsEventName, type WsTransport, type ConnectionState as WsTransportState, createChatStore, createDmThreadsStore, createFriendsStore, createGameActionsStore, createGameStore, createLobbyStore, createLogger, createNotificationsStore, createSdkStore, isRetryableError, logger, withRetry };
|
|
2833
|
+
export { type AcceptChallengeResponse, type Achievement, Activity, type ActivityFeedItem, type ActivityFeedItemType, type ActivityFeedResponse, type ActivityFeedUser, Admin, type AdminDailyStats, type AdminDailyStatsItem, type AdminGameHistory, type AdminGameHistoryFeeBreakdown, type AdminGameHistoryFeePlayer, type AdminGameHistoryPlayer, type AdminMarketDailyStats, type AdminMarketDailyStatsItem, type AdminMarketDetail, type AdminMarketStats, type AdminStats, type AdminWalletActivityItem, type AdminWalletActivityResponse, type ApiError, type AppNotification, type AppNotificationType, type ApplyReferralCodeResponse, type BalanceResponse, type BetOption, type BroadcastTipRequest, BrowserLocalStorage, Challenges, Chat, type ChatContext, type ChatContextType, type ChatMessage, type ChatMessageReply, type ChatMessageType, type ChatReaction, type ChatReadBy, type ChatState, type ChatStore, type ChatStoreState, type ClaimReferralRewardsResponse, type CreateChallengeRequest, type CreateChallengeResponse, type CreateLobbyRequest, type CreateTicketData, type CriticalIncident, type CriticalIncidentCategory, type CriticalIncidentImpactType, type CriticalIncidentSeverity, type CriticalIncidentStatus, type CriticalIncidentSummary, type CurrentGame, Daily, type DailyParticipant, type DailyRoom, type DailyToken, type DepositForLobbyResponse, type DepositStatus, type DepositStatusResponse, type DmThread, type DmThreadsStore, type DmThreadsStoreState, type DonateToGameResponse, ESTIMATED_SOL_FEE_LAMPORTS, Escrow, type EscrowSweepPreview, type EscrowSweepRecord, type FaucetResponse, type FeatureFlag, type FriendRequestItem, type FriendsStore, type FriendsStoreState, type FriendshipStatus, type Game, type GameActionsStore, type GameActionsStoreState, type GameHistoryItem, type GameMetrics, type GamePlayer, type GameStateResponse, type GameStore, type GameStoreState, type GameType, Games, type GenerateHandshakeResponse, type GetTicketsOptions, HttpClient, type IHttpClient, type ILogger, type IStorage, type InviteFriendRequest, type LeaderboardEntry, type LeaderboardQuery, type LeaderboardRange, type LeaderboardResponse, Leaderboards, type LivePlayer, type LivePlayersPage, Lobbies, type Lobby, type LobbyMatchedEvent, type LobbyPlayer, type LobbyStore, type LobbyStoreState, type LogLevel, type LoginResponse, MIN_SOL_TRANSFER_AMOUNT, MIN_TRANSFER_AMOUNT, type MarketBuyResult, type MarketPosition, type MarketSellResult, type MarketState, Markets, type MoneyMinor, NodeStorage, type NotificationEvent, type NotificationsStore, type NotificationsStoreState, type PaginatedCriticalIncidents, type PaginatedFriends, type PaginatedNotificationsResponse, type PaginatedPlatformFees, type PaginatedReports, type PaginatedSearchUsers, type PaginatedSessions, type PaginatedSupportTickets, type PaginatedTransactionJobs, type PaginatedUsers, type PaymentRequiredChallenge, type PlatformFeeItem, type PrepareDepositResponse, type PrepareTipRequest, type PrepareTipResponse, type PrepareTransferRequest, type PrepareTransferResponse, type PublicUser, type QueueStats, type RedeemResult, type ReferralRewardItem, type ReferralRewardStatus, type ReferralRewardsResponse, type ReferralSummary, type ReferralTreeItem, type ReferralTreeResponse, Referrals, type Report, type ReportCount, type ReportStatus, type ReportUser, Reports, type RetryOptions, SDK, type SDKConfig, SDK_VERSION, SOL_DECIMALS, SOL_MINT, type SdkStore, type SdkUpgradeInfo, type SearchUser, type SendMessageRequest, type SendTipResponse, type SendTransferResponse, type Session, SharedWorkerTransport, Spectate, type SpectatorMetrics, type SpectatorMetricsByUser, StandaloneWsTransport, type SubmitDepositResponse, type SubmitTransferRequest, type SubmitTransferResponse, Support, type SupportMessage, type SupportMessageSenderRole, type SupportTicket, type SupportTicketCategory, type SupportTicketPriority, type SupportTicketStatus, type SupportTicketUser, type SystemMessageType, TOKEN_KEY, TRANSFER_FEE_MINOR, Tips, type TransactionJob, type TransactionJobStatus, type TransactionJobType, type TransactionQueueStats, type TransferToken, type TypingUser, type UpdateTicketData, type User, type UserAchievement, type UserActivity, type UserActivityStatus, type UserStats, type UsernameAvailabilityResponse, Users, type ValidAction, Wallet, type WalletActivityCounterpartyType, type WalletActivityDirection, type WalletActivityItem, type WalletActivityKind, type WalletActivityResponse, type WalletActivityStatus, type WalletClaimAction, type WalletMeta, type WalletResponse, type WalletSigner, type WsEvent, WsEventBus, type WsEventName, type WsTransport, type ConnectionState as WsTransportState, createChatStore, createDmThreadsStore, createFriendsStore, createGameActionsStore, createGameStore, createLobbyStore, createLogger, createNotificationsStore, createSdkStore, isRetryableError, logger, withRetry };
|
package/dist/index.d.ts
CHANGED
|
@@ -662,6 +662,52 @@ interface PaginatedNotificationsResponse {
|
|
|
662
662
|
limit: number;
|
|
663
663
|
unreadCount: number;
|
|
664
664
|
}
|
|
665
|
+
type TransactionJobStatus = 'PENDING' | 'PROCESSING' | 'CONFIRMING' | 'COMPLETED' | 'FAILED' | 'CANCELLED';
|
|
666
|
+
type TransactionJobType = 'GAME_PAYOUT_WINNER' | 'GAME_PAYOUT_DRAW' | 'PREDICTION_MARKET_PAYOUT' | 'PREDICTION_MARKET_REFUND' | 'PREDICTION_MARKET_BONUS' | 'REFERRAL_CLAIM' | 'LOBBY_DEPOSIT_REFUND' | 'ESCROW_SWEEP' | 'P2P_TRANSFER_CONFIRM' | 'LOBBY_DEPOSIT_CONFIRM';
|
|
667
|
+
interface TransactionJob {
|
|
668
|
+
id: string;
|
|
669
|
+
type: TransactionJobType;
|
|
670
|
+
status: TransactionJobStatus;
|
|
671
|
+
idempotencyKey: string;
|
|
672
|
+
recipientUserId: string;
|
|
673
|
+
amount: number;
|
|
674
|
+
mint: string;
|
|
675
|
+
gameHistoryId?: string | null;
|
|
676
|
+
contextType?: string | null;
|
|
677
|
+
contextId?: string | null;
|
|
678
|
+
bullmqJobId?: string | null;
|
|
679
|
+
attempts: number;
|
|
680
|
+
maxAttempts: number;
|
|
681
|
+
lastError?: string | null;
|
|
682
|
+
walletTransactionId?: string | null;
|
|
683
|
+
signature?: string | null;
|
|
684
|
+
payload: Record<string, unknown>;
|
|
685
|
+
scheduledFor?: string | null;
|
|
686
|
+
startedAt?: string | null;
|
|
687
|
+
completedAt?: string | null;
|
|
688
|
+
failedAt?: string | null;
|
|
689
|
+
createdAt: string;
|
|
690
|
+
updatedAt: string;
|
|
691
|
+
recipientUser?: {
|
|
692
|
+
id: string;
|
|
693
|
+
username?: string | null;
|
|
694
|
+
};
|
|
695
|
+
}
|
|
696
|
+
interface TransactionQueueStats {
|
|
697
|
+
pending: number;
|
|
698
|
+
processing: number;
|
|
699
|
+
confirming: number;
|
|
700
|
+
completed: number;
|
|
701
|
+
failed: number;
|
|
702
|
+
cancelled: number;
|
|
703
|
+
}
|
|
704
|
+
interface PaginatedTransactionJobs {
|
|
705
|
+
items: TransactionJob[];
|
|
706
|
+
total: number;
|
|
707
|
+
page: number;
|
|
708
|
+
limit: number;
|
|
709
|
+
totalPages: number;
|
|
710
|
+
}
|
|
665
711
|
interface Achievement {
|
|
666
712
|
id: string;
|
|
667
713
|
code: string;
|
|
@@ -699,11 +745,16 @@ interface WalletSigner {
|
|
|
699
745
|
*/
|
|
700
746
|
signMessage: (message: string) => Promise<Uint8Array | string>;
|
|
701
747
|
/**
|
|
702
|
-
* Sign a transaction
|
|
703
|
-
*
|
|
704
|
-
* @returns The signed transaction
|
|
748
|
+
* Sign a transaction and return the signed transaction.
|
|
749
|
+
* Mutually exclusive with signAndSendTransaction — provide exactly one.
|
|
705
750
|
*/
|
|
706
|
-
signTransaction
|
|
751
|
+
signTransaction?: (transaction: Transaction) => Promise<Transaction>;
|
|
752
|
+
/**
|
|
753
|
+
* Sign and send a transaction in one step, returning the signature string.
|
|
754
|
+
* Used by embedded wallets that cannot return signed bytes without also sending.
|
|
755
|
+
* Mutually exclusive with signTransaction — provide exactly one.
|
|
756
|
+
*/
|
|
757
|
+
signAndSendTransaction?: (transaction: Transaction) => Promise<string>;
|
|
707
758
|
}
|
|
708
759
|
interface BalanceResponse {
|
|
709
760
|
sol: number;
|
|
@@ -867,12 +918,22 @@ declare class Wallet {
|
|
|
867
918
|
* @returns The signature
|
|
868
919
|
*/
|
|
869
920
|
signMessage(message: string): Promise<Uint8Array | string>;
|
|
921
|
+
/**
|
|
922
|
+
* Check whether the configured signer uses signAndSendTransaction (client-sent mode).
|
|
923
|
+
*/
|
|
924
|
+
isSignAndSendMode(): boolean;
|
|
870
925
|
/**
|
|
871
926
|
* Sign a transaction using the configured signer
|
|
872
927
|
* @param transaction - The transaction to sign
|
|
873
928
|
* @returns The signed transaction
|
|
874
929
|
*/
|
|
875
930
|
signTransaction(transaction: Transaction): Promise<Transaction>;
|
|
931
|
+
/**
|
|
932
|
+
* Sign and send a transaction using the configured signer (client-sent mode).
|
|
933
|
+
* @param transaction - The transaction to sign and send
|
|
934
|
+
* @returns The transaction signature
|
|
935
|
+
*/
|
|
936
|
+
signAndSendTransaction(transaction: Transaction): Promise<string>;
|
|
876
937
|
/**
|
|
877
938
|
* Get QR code as a data URL for the current user's wallet address.
|
|
878
939
|
* Use as <img src={url} /> in the deposit / add-funds section.
|
|
@@ -931,9 +992,14 @@ declare class Wallet {
|
|
|
931
992
|
* @returns Transaction signature and status
|
|
932
993
|
*/
|
|
933
994
|
submitTransfer(signedTransaction: string, senderAddress: string, recipientAddress: string, amount: number, token?: TransferToken, ataCreated?: boolean, recipientInput?: string): Promise<SubmitTransferResponse>;
|
|
995
|
+
/**
|
|
996
|
+
* Confirm a transfer that was already sent by the client (signAndSendTransaction path).
|
|
997
|
+
*/
|
|
998
|
+
confirmTransferSignature(signature: string, senderAddress: string, recipientAddress: string, amount: number, token?: TransferToken, ataCreated?: boolean, recipientInput?: string): Promise<SubmitTransferResponse>;
|
|
934
999
|
/**
|
|
935
1000
|
* Full transfer flow in one call: prepare -> sign -> submit
|
|
936
1001
|
* Recipient can be username, .sol domain, or Solana address (resolved by backend).
|
|
1002
|
+
* Automatically uses signAndSendTransaction or signTransaction based on signer capability.
|
|
937
1003
|
*/
|
|
938
1004
|
send(recipient: string, amount: number, token?: TransferToken): Promise<SendTransferResponse>;
|
|
939
1005
|
}
|
|
@@ -988,6 +1054,17 @@ declare class Admin {
|
|
|
988
1054
|
category?: CriticalIncidentCategory;
|
|
989
1055
|
}): Promise<PaginatedCriticalIncidents>;
|
|
990
1056
|
resolveCriticalIncident(id: string, resolutionNote?: string): Promise<CriticalIncident>;
|
|
1057
|
+
getTransactionQueueStats(): Promise<TransactionQueueStats>;
|
|
1058
|
+
getTransactionQueueJobs(input?: {
|
|
1059
|
+
status?: TransactionJobStatus;
|
|
1060
|
+
type?: TransactionJobType;
|
|
1061
|
+
userId?: string;
|
|
1062
|
+
page?: number;
|
|
1063
|
+
limit?: number;
|
|
1064
|
+
}): Promise<PaginatedTransactionJobs>;
|
|
1065
|
+
getTransactionQueueJob(id: string): Promise<TransactionJob>;
|
|
1066
|
+
retryTransactionQueueJob(id: string): Promise<TransactionJob>;
|
|
1067
|
+
cancelTransactionQueueJob(id: string): Promise<TransactionJob>;
|
|
991
1068
|
getPlatformFees(input?: {
|
|
992
1069
|
page?: number;
|
|
993
1070
|
limit?: number;
|
|
@@ -2040,10 +2117,16 @@ interface SubmitDepositResponse {
|
|
|
2040
2117
|
signature: string;
|
|
2041
2118
|
status: string;
|
|
2042
2119
|
}
|
|
2120
|
+
interface DepositForLobbyResponse {
|
|
2121
|
+
signature: string;
|
|
2122
|
+
status: string;
|
|
2123
|
+
canProceedToQueue: boolean;
|
|
2124
|
+
}
|
|
2043
2125
|
declare class Escrow {
|
|
2044
2126
|
private http;
|
|
2127
|
+
private wallet;
|
|
2045
2128
|
private logger?;
|
|
2046
|
-
constructor(http: IHttpClient, logger?: ILogger | undefined);
|
|
2129
|
+
constructor(http: IHttpClient, wallet: Wallet, logger?: ILogger | undefined);
|
|
2047
2130
|
/**
|
|
2048
2131
|
* Start the deposit flow for a lobby
|
|
2049
2132
|
* Transitions the lobby to 'preparing' state
|
|
@@ -2063,6 +2146,20 @@ declare class Escrow {
|
|
|
2063
2146
|
* Check the deposit status for all players in a lobby
|
|
2064
2147
|
*/
|
|
2065
2148
|
getDepositStatus(lobbyId: string): Promise<DepositStatusResponse>;
|
|
2149
|
+
/**
|
|
2150
|
+
* Confirm a deposit that was already sent by the client (signAndSendTransaction path).
|
|
2151
|
+
*/
|
|
2152
|
+
confirmDepositSignature(lobbyId: string, signature: string): Promise<{
|
|
2153
|
+
status: string;
|
|
2154
|
+
}>;
|
|
2155
|
+
/**
|
|
2156
|
+
* One-call lobby deposit: start deposits, prepare, sign, submit, and poll until
|
|
2157
|
+
* the current user's deposit is confirmed. Requires sdk.wallet.setSigner() to be set.
|
|
2158
|
+
* Returns when all required deposits are confirmed and the lobby can proceed to queue.
|
|
2159
|
+
*
|
|
2160
|
+
* Automatically uses signAndSendTransaction or signTransaction based on signer capability.
|
|
2161
|
+
*/
|
|
2162
|
+
depositForLobby(lobbyId: string): Promise<DepositForLobbyResponse>;
|
|
2066
2163
|
claimLobbyDepositRefund(lobbyId: string, depositSignature: string): Promise<{
|
|
2067
2164
|
signature: string;
|
|
2068
2165
|
status: string;
|
|
@@ -2652,9 +2749,11 @@ declare class StandaloneWsTransport extends BaseWsTransport {
|
|
|
2652
2749
|
private accessToken;
|
|
2653
2750
|
private reconnectAttempts;
|
|
2654
2751
|
private reconnectTimer;
|
|
2752
|
+
private periodicReconnectInterval;
|
|
2655
2753
|
private maxReconnectAttempts;
|
|
2656
2754
|
private reconnectDelay;
|
|
2657
2755
|
private reconnectDelayMax;
|
|
2756
|
+
private static readonly PERIODIC_RECONNECT_MS;
|
|
2658
2757
|
private wildcardHandlers;
|
|
2659
2758
|
private eventHandlers;
|
|
2660
2759
|
private registeredEvents;
|
|
@@ -2671,6 +2770,10 @@ declare class StandaloneWsTransport extends BaseWsTransport {
|
|
|
2671
2770
|
protected onLeaveRoom(roomName: string): void;
|
|
2672
2771
|
private ensureSocket;
|
|
2673
2772
|
private reconnectWithAuth;
|
|
2773
|
+
/** Clear socket reference so ensureSocket() can create a new connection. */
|
|
2774
|
+
private clearSocketForReconnect;
|
|
2775
|
+
private clearPeriodicReconnect;
|
|
2776
|
+
private startPeriodicReconnect;
|
|
2674
2777
|
private scheduleReconnect;
|
|
2675
2778
|
private getEventHandlers;
|
|
2676
2779
|
private unsubscribeEvent;
|
|
@@ -2727,4 +2830,4 @@ declare class HttpClient implements IHttpClient {
|
|
|
2727
2830
|
private payChallenge;
|
|
2728
2831
|
}
|
|
2729
2832
|
|
|
2730
|
-
export { type AcceptChallengeResponse, type Achievement, Activity, type ActivityFeedItem, type ActivityFeedItemType, type ActivityFeedResponse, type ActivityFeedUser, Admin, type AdminDailyStats, type AdminDailyStatsItem, type AdminGameHistory, type AdminGameHistoryFeeBreakdown, type AdminGameHistoryFeePlayer, type AdminGameHistoryPlayer, type AdminMarketDailyStats, type AdminMarketDailyStatsItem, type AdminMarketDetail, type AdminMarketStats, type AdminStats, type AdminWalletActivityItem, type AdminWalletActivityResponse, type ApiError, type AppNotification, type AppNotificationType, type ApplyReferralCodeResponse, type BalanceResponse, type BetOption, type BroadcastTipRequest, BrowserLocalStorage, Challenges, Chat, type ChatContext, type ChatContextType, type ChatMessage, type ChatMessageReply, type ChatMessageType, type ChatReaction, type ChatReadBy, type ChatState, type ChatStore, type ChatStoreState, type ClaimReferralRewardsResponse, type CreateChallengeRequest, type CreateChallengeResponse, type CreateLobbyRequest, type CreateTicketData, type CriticalIncident, type CriticalIncidentCategory, type CriticalIncidentImpactType, type CriticalIncidentSeverity, type CriticalIncidentStatus, type CriticalIncidentSummary, type CurrentGame, Daily, type DailyParticipant, type DailyRoom, type DailyToken, type DepositStatus, type DepositStatusResponse, type DmThread, type DmThreadsStore, type DmThreadsStoreState, type DonateToGameResponse, ESTIMATED_SOL_FEE_LAMPORTS, Escrow, type EscrowSweepPreview, type EscrowSweepRecord, type FaucetResponse, type FeatureFlag, type FriendRequestItem, type FriendsStore, type FriendsStoreState, type FriendshipStatus, type Game, type GameActionsStore, type GameActionsStoreState, type GameHistoryItem, type GameMetrics, type GamePlayer, type GameStateResponse, type GameStore, type GameStoreState, type GameType, Games, type GenerateHandshakeResponse, type GetTicketsOptions, HttpClient, type IHttpClient, type ILogger, type IStorage, type InviteFriendRequest, type LeaderboardEntry, type LeaderboardQuery, type LeaderboardRange, type LeaderboardResponse, Leaderboards, type LivePlayer, type LivePlayersPage, Lobbies, type Lobby, type LobbyMatchedEvent, type LobbyPlayer, type LobbyStore, type LobbyStoreState, type LogLevel, type LoginResponse, MIN_SOL_TRANSFER_AMOUNT, MIN_TRANSFER_AMOUNT, type MarketBuyResult, type MarketPosition, type MarketSellResult, type MarketState, Markets, type MoneyMinor, NodeStorage, type NotificationEvent, type NotificationsStore, type NotificationsStoreState, type PaginatedCriticalIncidents, type PaginatedFriends, type PaginatedNotificationsResponse, type PaginatedPlatformFees, type PaginatedReports, type PaginatedSearchUsers, type PaginatedSessions, type PaginatedSupportTickets, type PaginatedUsers, type PaymentRequiredChallenge, type PlatformFeeItem, type PrepareDepositResponse, type PrepareTipRequest, type PrepareTipResponse, type PrepareTransferRequest, type PrepareTransferResponse, type PublicUser, type QueueStats, type RedeemResult, type ReferralRewardItem, type ReferralRewardStatus, type ReferralRewardsResponse, type ReferralSummary, type ReferralTreeItem, type ReferralTreeResponse, Referrals, type Report, type ReportCount, type ReportStatus, type ReportUser, Reports, type RetryOptions, SDK, type SDKConfig, SDK_VERSION, SOL_DECIMALS, SOL_MINT, type SdkStore, type SdkUpgradeInfo, type SearchUser, type SendMessageRequest, type SendTipResponse, type SendTransferResponse, type Session, SharedWorkerTransport, Spectate, type SpectatorMetrics, type SpectatorMetricsByUser, StandaloneWsTransport, type SubmitDepositResponse, type SubmitTransferRequest, type SubmitTransferResponse, Support, type SupportMessage, type SupportMessageSenderRole, type SupportTicket, type SupportTicketCategory, type SupportTicketPriority, type SupportTicketStatus, type SupportTicketUser, type SystemMessageType, TOKEN_KEY, TRANSFER_FEE_MINOR, Tips, type TransferToken, type TypingUser, type UpdateTicketData, type User, type UserAchievement, type UserActivity, type UserActivityStatus, type UserStats, type UsernameAvailabilityResponse, Users, type ValidAction, Wallet, type WalletActivityCounterpartyType, type WalletActivityDirection, type WalletActivityItem, type WalletActivityKind, type WalletActivityResponse, type WalletActivityStatus, type WalletClaimAction, type WalletMeta, type WalletResponse, type WalletSigner, type WsEvent, WsEventBus, type WsEventName, type WsTransport, type ConnectionState as WsTransportState, createChatStore, createDmThreadsStore, createFriendsStore, createGameActionsStore, createGameStore, createLobbyStore, createLogger, createNotificationsStore, createSdkStore, isRetryableError, logger, withRetry };
|
|
2833
|
+
export { type AcceptChallengeResponse, type Achievement, Activity, type ActivityFeedItem, type ActivityFeedItemType, type ActivityFeedResponse, type ActivityFeedUser, Admin, type AdminDailyStats, type AdminDailyStatsItem, type AdminGameHistory, type AdminGameHistoryFeeBreakdown, type AdminGameHistoryFeePlayer, type AdminGameHistoryPlayer, type AdminMarketDailyStats, type AdminMarketDailyStatsItem, type AdminMarketDetail, type AdminMarketStats, type AdminStats, type AdminWalletActivityItem, type AdminWalletActivityResponse, type ApiError, type AppNotification, type AppNotificationType, type ApplyReferralCodeResponse, type BalanceResponse, type BetOption, type BroadcastTipRequest, BrowserLocalStorage, Challenges, Chat, type ChatContext, type ChatContextType, type ChatMessage, type ChatMessageReply, type ChatMessageType, type ChatReaction, type ChatReadBy, type ChatState, type ChatStore, type ChatStoreState, type ClaimReferralRewardsResponse, type CreateChallengeRequest, type CreateChallengeResponse, type CreateLobbyRequest, type CreateTicketData, type CriticalIncident, type CriticalIncidentCategory, type CriticalIncidentImpactType, type CriticalIncidentSeverity, type CriticalIncidentStatus, type CriticalIncidentSummary, type CurrentGame, Daily, type DailyParticipant, type DailyRoom, type DailyToken, type DepositForLobbyResponse, type DepositStatus, type DepositStatusResponse, type DmThread, type DmThreadsStore, type DmThreadsStoreState, type DonateToGameResponse, ESTIMATED_SOL_FEE_LAMPORTS, Escrow, type EscrowSweepPreview, type EscrowSweepRecord, type FaucetResponse, type FeatureFlag, type FriendRequestItem, type FriendsStore, type FriendsStoreState, type FriendshipStatus, type Game, type GameActionsStore, type GameActionsStoreState, type GameHistoryItem, type GameMetrics, type GamePlayer, type GameStateResponse, type GameStore, type GameStoreState, type GameType, Games, type GenerateHandshakeResponse, type GetTicketsOptions, HttpClient, type IHttpClient, type ILogger, type IStorage, type InviteFriendRequest, type LeaderboardEntry, type LeaderboardQuery, type LeaderboardRange, type LeaderboardResponse, Leaderboards, type LivePlayer, type LivePlayersPage, Lobbies, type Lobby, type LobbyMatchedEvent, type LobbyPlayer, type LobbyStore, type LobbyStoreState, type LogLevel, type LoginResponse, MIN_SOL_TRANSFER_AMOUNT, MIN_TRANSFER_AMOUNT, type MarketBuyResult, type MarketPosition, type MarketSellResult, type MarketState, Markets, type MoneyMinor, NodeStorage, type NotificationEvent, type NotificationsStore, type NotificationsStoreState, type PaginatedCriticalIncidents, type PaginatedFriends, type PaginatedNotificationsResponse, type PaginatedPlatformFees, type PaginatedReports, type PaginatedSearchUsers, type PaginatedSessions, type PaginatedSupportTickets, type PaginatedTransactionJobs, type PaginatedUsers, type PaymentRequiredChallenge, type PlatformFeeItem, type PrepareDepositResponse, type PrepareTipRequest, type PrepareTipResponse, type PrepareTransferRequest, type PrepareTransferResponse, type PublicUser, type QueueStats, type RedeemResult, type ReferralRewardItem, type ReferralRewardStatus, type ReferralRewardsResponse, type ReferralSummary, type ReferralTreeItem, type ReferralTreeResponse, Referrals, type Report, type ReportCount, type ReportStatus, type ReportUser, Reports, type RetryOptions, SDK, type SDKConfig, SDK_VERSION, SOL_DECIMALS, SOL_MINT, type SdkStore, type SdkUpgradeInfo, type SearchUser, type SendMessageRequest, type SendTipResponse, type SendTransferResponse, type Session, SharedWorkerTransport, Spectate, type SpectatorMetrics, type SpectatorMetricsByUser, StandaloneWsTransport, type SubmitDepositResponse, type SubmitTransferRequest, type SubmitTransferResponse, Support, type SupportMessage, type SupportMessageSenderRole, type SupportTicket, type SupportTicketCategory, type SupportTicketPriority, type SupportTicketStatus, type SupportTicketUser, type SystemMessageType, TOKEN_KEY, TRANSFER_FEE_MINOR, Tips, type TransactionJob, type TransactionJobStatus, type TransactionJobType, type TransactionQueueStats, type TransferToken, type TypingUser, type UpdateTicketData, type User, type UserAchievement, type UserActivity, type UserActivityStatus, type UserStats, type UsernameAvailabilityResponse, Users, type ValidAction, Wallet, type WalletActivityCounterpartyType, type WalletActivityDirection, type WalletActivityItem, type WalletActivityKind, type WalletActivityResponse, type WalletActivityStatus, type WalletClaimAction, type WalletMeta, type WalletResponse, type WalletSigner, type WsEvent, WsEventBus, type WsEventName, type WsTransport, type ConnectionState as WsTransportState, createChatStore, createDmThreadsStore, createFriendsStore, createGameActionsStore, createGameStore, createLobbyStore, createLogger, createNotificationsStore, createSdkStore, isRetryableError, logger, withRetry };
|