@cookill/wallet-adapter 3.2.0 → 3.2.2
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 +234 -188
- package/dist/index.cjs +5 -211
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -228
- package/dist/index.d.ts +4 -228
- package/dist/index.js +5 -211
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +5 -1871
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +1 -147
- package/dist/react.d.ts +1 -147
- package/dist/react.js +6 -1846
- package/dist/react.js.map +1 -1
- package/dist/standard.cjs.map +1 -1
- package/dist/standard.js.map +1 -1
- package/package.json +2 -2
package/dist/react.d.cts
CHANGED
|
@@ -1,147 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import React, { ReactNode } from 'react';
|
|
3
|
-
import { WalletAccount, RialoNetwork, ScanConnectStatus, WalletInfo, SignedMessage, TransactionRequest, TransactionResult, REXCapabilities, REXTransactionResult, SfSPosition, SfSCreateParams, SfSCreditBalance, RialoWallet as SheepWallet, ScanConnectURI } from './index.cjs';
|
|
4
|
-
export { NETWORKS, REXAccessPolicy, REXConfig, REXPrivacyMode, ScanConnectSession, SfSUpdateParams, formatAddress, formatBalance, isInstalled, isValidAddress, parseBalance } from './index.cjs';
|
|
5
|
-
export { WalletErrorBoundary, WalletErrorBoundaryProps, withWalletErrorBoundary } from './ErrorBoundary.cjs';
|
|
6
|
-
export { ApprovalPending, ApprovalPendingProps, ConnectionStatus, ConnectionStatusProps, ConnectionStatusType, LoadingSpinner, LoadingSpinnerProps } from './LoadingStates.cjs';
|
|
7
|
-
|
|
8
|
-
interface WalletState {
|
|
9
|
-
status: 'disconnected' | 'connecting' | 'connected' | 'error';
|
|
10
|
-
accounts: WalletAccount[];
|
|
11
|
-
network: RialoNetwork;
|
|
12
|
-
balance: string | null;
|
|
13
|
-
error: Error | null;
|
|
14
|
-
isModalOpen: boolean;
|
|
15
|
-
scanConnectStatus: ScanConnectStatus;
|
|
16
|
-
}
|
|
17
|
-
interface WalletContextValue {
|
|
18
|
-
state: WalletState;
|
|
19
|
-
connected: boolean;
|
|
20
|
-
connecting: boolean;
|
|
21
|
-
activeAccount: WalletAccount | null;
|
|
22
|
-
chainId: string;
|
|
23
|
-
isInstalled: boolean;
|
|
24
|
-
wallets: WalletInfo[];
|
|
25
|
-
connect: () => Promise<WalletAccount[]>;
|
|
26
|
-
disconnect: () => Promise<void>;
|
|
27
|
-
refreshBalance: () => Promise<void>;
|
|
28
|
-
switchNetwork: (network: RialoNetwork) => Promise<void>;
|
|
29
|
-
signMessage: (message: string) => Promise<SignedMessage>;
|
|
30
|
-
signTransaction: (tx: TransactionRequest) => Promise<string>;
|
|
31
|
-
sendTransaction: (tx: TransactionRequest) => Promise<TransactionResult>;
|
|
32
|
-
signAndSendTransaction: (tx: TransactionRequest) => Promise<TransactionResult>;
|
|
33
|
-
getREXCapabilities: () => Promise<REXCapabilities>;
|
|
34
|
-
submitREXTransaction: (tx: TransactionRequest) => Promise<REXTransactionResult>;
|
|
35
|
-
sendGaslessTransaction: (tx: Omit<TransactionRequest, 'gasless'>) => Promise<TransactionResult>;
|
|
36
|
-
getSfSPositions: () => Promise<SfSPosition[]>;
|
|
37
|
-
createSfSPosition: (params: SfSCreateParams) => Promise<SfSPosition>;
|
|
38
|
-
getSfSCredits: () => Promise<SfSCreditBalance>;
|
|
39
|
-
openModal: () => void;
|
|
40
|
-
closeModal: () => void;
|
|
41
|
-
wallet: SheepWallet | null;
|
|
42
|
-
}
|
|
43
|
-
interface WalletProviderProps {
|
|
44
|
-
children: ReactNode;
|
|
45
|
-
network?: RialoNetwork;
|
|
46
|
-
autoConnect?: boolean;
|
|
47
|
-
wallets?: WalletInfo[];
|
|
48
|
-
/** Default relay URL for scan-to-connect */
|
|
49
|
-
scanConnectRelay?: string;
|
|
50
|
-
onConnect?: (accounts: WalletAccount[]) => void;
|
|
51
|
-
onDisconnect?: () => void;
|
|
52
|
-
onError?: (error: Error) => void;
|
|
53
|
-
onNetworkChange?: (network: RialoNetwork) => void;
|
|
54
|
-
}
|
|
55
|
-
declare function WalletProvider({ children, network: initialNetwork, autoConnect, wallets: customWallets, scanConnectRelay, onConnect, onDisconnect, onError, onNetworkChange, }: WalletProviderProps): react_jsx_runtime.JSX.Element;
|
|
56
|
-
declare function useWallet(): WalletContextValue;
|
|
57
|
-
declare function useIsConnected(): boolean;
|
|
58
|
-
declare function useActiveAccount(): WalletAccount | null;
|
|
59
|
-
declare function useAccounts(): WalletAccount[];
|
|
60
|
-
declare function useBalance(): {
|
|
61
|
-
balance: string | null;
|
|
62
|
-
refresh: () => Promise<void>;
|
|
63
|
-
};
|
|
64
|
-
declare function useNetwork(): {
|
|
65
|
-
network: RialoNetwork;
|
|
66
|
-
chainId: string;
|
|
67
|
-
};
|
|
68
|
-
declare function useSwitchNetwork(): {
|
|
69
|
-
switchNetwork: (network: RialoNetwork) => Promise<void>;
|
|
70
|
-
network: RialoNetwork;
|
|
71
|
-
};
|
|
72
|
-
declare function useConnectWallet(): {
|
|
73
|
-
connect: () => Promise<WalletAccount[]>;
|
|
74
|
-
openModal: () => void;
|
|
75
|
-
connecting: boolean;
|
|
76
|
-
connected: boolean;
|
|
77
|
-
isInstalled: boolean;
|
|
78
|
-
error: Error | null;
|
|
79
|
-
};
|
|
80
|
-
declare function useDisconnectWallet(): {
|
|
81
|
-
disconnect: () => Promise<void>;
|
|
82
|
-
connected: boolean;
|
|
83
|
-
};
|
|
84
|
-
declare function useSignMessage(): {
|
|
85
|
-
signMessage: (message: string) => Promise<SignedMessage>;
|
|
86
|
-
connected: boolean;
|
|
87
|
-
};
|
|
88
|
-
declare function useSendTransaction(): {
|
|
89
|
-
sendTransaction: (tx: TransactionRequest) => Promise<TransactionResult>;
|
|
90
|
-
signAndSendTransaction: (tx: TransactionRequest) => Promise<TransactionResult>;
|
|
91
|
-
sendGaslessTransaction: (tx: Omit<TransactionRequest, "gasless">) => Promise<TransactionResult>;
|
|
92
|
-
connected: boolean;
|
|
93
|
-
};
|
|
94
|
-
/** Hook for REX (confidential) transaction capabilities */
|
|
95
|
-
declare function useREX(): {
|
|
96
|
-
capabilities: REXCapabilities | null;
|
|
97
|
-
supported: boolean;
|
|
98
|
-
submitREXTransaction: (tx: TransactionRequest) => Promise<REXTransactionResult>;
|
|
99
|
-
connected: boolean;
|
|
100
|
-
};
|
|
101
|
-
/** Hook for Stake-for-Service (gasless) operations */
|
|
102
|
-
declare function useSfS(): {
|
|
103
|
-
positions: SfSPosition[];
|
|
104
|
-
credits: SfSCreditBalance | null;
|
|
105
|
-
hasCredits: boolean;
|
|
106
|
-
createPosition: (params: SfSCreateParams) => Promise<SfSPosition>;
|
|
107
|
-
sendGasless: (tx: Omit<TransactionRequest, "gasless">) => Promise<TransactionResult>;
|
|
108
|
-
refresh: () => Promise<void>;
|
|
109
|
-
connected: boolean;
|
|
110
|
-
};
|
|
111
|
-
/** Hook for Scan-to-Connect */
|
|
112
|
-
declare function useScanConnect(): {
|
|
113
|
-
scanURI: ScanConnectURI | null;
|
|
114
|
-
status: ScanConnectStatus;
|
|
115
|
-
generateQR: () => Promise<void>;
|
|
116
|
-
approveSession: (sessionId: string) => Promise<WalletAccount[]>;
|
|
117
|
-
rejectSession: (sessionId: string) => Promise<void>;
|
|
118
|
-
};
|
|
119
|
-
interface ConnectButtonProps {
|
|
120
|
-
connectLabel?: string;
|
|
121
|
-
disconnectLabel?: string;
|
|
122
|
-
showAddress?: boolean;
|
|
123
|
-
showBalance?: boolean;
|
|
124
|
-
/** Show feature badges (REX, SfS) */
|
|
125
|
-
showFeatures?: boolean;
|
|
126
|
-
className?: string;
|
|
127
|
-
style?: React.CSSProperties;
|
|
128
|
-
}
|
|
129
|
-
declare function ConnectButton({ connectLabel, disconnectLabel, showAddress, showBalance, showFeatures, className, style, }: ConnectButtonProps): react_jsx_runtime.JSX.Element;
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* @cookill/wallet-adapter — WalletModal
|
|
133
|
-
* Clean, standalone modal with 3 tabs: Extension, Scan-to-Connect, Web Wallet
|
|
134
|
-
*
|
|
135
|
-
* KEY ARCHITECTURE:
|
|
136
|
-
* - Backdrop and dialog are SIBLINGS (prevents click propagation bugs)
|
|
137
|
-
* - All interactive elements use stopPropagation
|
|
138
|
-
* - Tab switching works independently of connection state
|
|
139
|
-
* - Auto-close only fires for NEW connections (not pre-existing)
|
|
140
|
-
* - Connect button in Extension tab calls context's connect() directly
|
|
141
|
-
*/
|
|
142
|
-
interface WalletModalExternalProps {
|
|
143
|
-
scanConnectRelay: string;
|
|
144
|
-
}
|
|
145
|
-
declare function WalletModal({ scanConnectRelay }: WalletModalExternalProps): react_jsx_runtime.JSX.Element | null;
|
|
146
|
-
|
|
147
|
-
export { ConnectButton, type ConnectButtonProps, REXCapabilities, REXTransactionResult, RialoNetwork, ScanConnectStatus, ScanConnectURI, SfSCreateParams, SfSCreditBalance, SfSPosition, SheepWallet, SignedMessage, TransactionRequest, TransactionResult, WalletAccount, type WalletContextValue, WalletInfo, WalletModal, type WalletModalExternalProps, WalletProvider, type WalletProviderProps, type WalletState, useAccounts, useActiveAccount, useBalance, useConnectWallet, useDisconnectWallet, useIsConnected, useNetwork, useREX, useScanConnect, useSendTransaction, useSfS, useSignMessage, useSwitchNetwork, useWallet };
|
|
1
|
+
export { NETWORKS, RialoWallet as SheepWallet, formatAddress, formatBalance, isInstalled, isValidAddress, parseBalance } from './index.cjs';
|
package/dist/react.d.ts
CHANGED
|
@@ -1,147 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import React, { ReactNode } from 'react';
|
|
3
|
-
import { WalletAccount, RialoNetwork, ScanConnectStatus, WalletInfo, SignedMessage, TransactionRequest, TransactionResult, REXCapabilities, REXTransactionResult, SfSPosition, SfSCreateParams, SfSCreditBalance, RialoWallet as SheepWallet, ScanConnectURI } from './index.js';
|
|
4
|
-
export { NETWORKS, REXAccessPolicy, REXConfig, REXPrivacyMode, ScanConnectSession, SfSUpdateParams, formatAddress, formatBalance, isInstalled, isValidAddress, parseBalance } from './index.js';
|
|
5
|
-
export { WalletErrorBoundary, WalletErrorBoundaryProps, withWalletErrorBoundary } from './ErrorBoundary.js';
|
|
6
|
-
export { ApprovalPending, ApprovalPendingProps, ConnectionStatus, ConnectionStatusProps, ConnectionStatusType, LoadingSpinner, LoadingSpinnerProps } from './LoadingStates.js';
|
|
7
|
-
|
|
8
|
-
interface WalletState {
|
|
9
|
-
status: 'disconnected' | 'connecting' | 'connected' | 'error';
|
|
10
|
-
accounts: WalletAccount[];
|
|
11
|
-
network: RialoNetwork;
|
|
12
|
-
balance: string | null;
|
|
13
|
-
error: Error | null;
|
|
14
|
-
isModalOpen: boolean;
|
|
15
|
-
scanConnectStatus: ScanConnectStatus;
|
|
16
|
-
}
|
|
17
|
-
interface WalletContextValue {
|
|
18
|
-
state: WalletState;
|
|
19
|
-
connected: boolean;
|
|
20
|
-
connecting: boolean;
|
|
21
|
-
activeAccount: WalletAccount | null;
|
|
22
|
-
chainId: string;
|
|
23
|
-
isInstalled: boolean;
|
|
24
|
-
wallets: WalletInfo[];
|
|
25
|
-
connect: () => Promise<WalletAccount[]>;
|
|
26
|
-
disconnect: () => Promise<void>;
|
|
27
|
-
refreshBalance: () => Promise<void>;
|
|
28
|
-
switchNetwork: (network: RialoNetwork) => Promise<void>;
|
|
29
|
-
signMessage: (message: string) => Promise<SignedMessage>;
|
|
30
|
-
signTransaction: (tx: TransactionRequest) => Promise<string>;
|
|
31
|
-
sendTransaction: (tx: TransactionRequest) => Promise<TransactionResult>;
|
|
32
|
-
signAndSendTransaction: (tx: TransactionRequest) => Promise<TransactionResult>;
|
|
33
|
-
getREXCapabilities: () => Promise<REXCapabilities>;
|
|
34
|
-
submitREXTransaction: (tx: TransactionRequest) => Promise<REXTransactionResult>;
|
|
35
|
-
sendGaslessTransaction: (tx: Omit<TransactionRequest, 'gasless'>) => Promise<TransactionResult>;
|
|
36
|
-
getSfSPositions: () => Promise<SfSPosition[]>;
|
|
37
|
-
createSfSPosition: (params: SfSCreateParams) => Promise<SfSPosition>;
|
|
38
|
-
getSfSCredits: () => Promise<SfSCreditBalance>;
|
|
39
|
-
openModal: () => void;
|
|
40
|
-
closeModal: () => void;
|
|
41
|
-
wallet: SheepWallet | null;
|
|
42
|
-
}
|
|
43
|
-
interface WalletProviderProps {
|
|
44
|
-
children: ReactNode;
|
|
45
|
-
network?: RialoNetwork;
|
|
46
|
-
autoConnect?: boolean;
|
|
47
|
-
wallets?: WalletInfo[];
|
|
48
|
-
/** Default relay URL for scan-to-connect */
|
|
49
|
-
scanConnectRelay?: string;
|
|
50
|
-
onConnect?: (accounts: WalletAccount[]) => void;
|
|
51
|
-
onDisconnect?: () => void;
|
|
52
|
-
onError?: (error: Error) => void;
|
|
53
|
-
onNetworkChange?: (network: RialoNetwork) => void;
|
|
54
|
-
}
|
|
55
|
-
declare function WalletProvider({ children, network: initialNetwork, autoConnect, wallets: customWallets, scanConnectRelay, onConnect, onDisconnect, onError, onNetworkChange, }: WalletProviderProps): react_jsx_runtime.JSX.Element;
|
|
56
|
-
declare function useWallet(): WalletContextValue;
|
|
57
|
-
declare function useIsConnected(): boolean;
|
|
58
|
-
declare function useActiveAccount(): WalletAccount | null;
|
|
59
|
-
declare function useAccounts(): WalletAccount[];
|
|
60
|
-
declare function useBalance(): {
|
|
61
|
-
balance: string | null;
|
|
62
|
-
refresh: () => Promise<void>;
|
|
63
|
-
};
|
|
64
|
-
declare function useNetwork(): {
|
|
65
|
-
network: RialoNetwork;
|
|
66
|
-
chainId: string;
|
|
67
|
-
};
|
|
68
|
-
declare function useSwitchNetwork(): {
|
|
69
|
-
switchNetwork: (network: RialoNetwork) => Promise<void>;
|
|
70
|
-
network: RialoNetwork;
|
|
71
|
-
};
|
|
72
|
-
declare function useConnectWallet(): {
|
|
73
|
-
connect: () => Promise<WalletAccount[]>;
|
|
74
|
-
openModal: () => void;
|
|
75
|
-
connecting: boolean;
|
|
76
|
-
connected: boolean;
|
|
77
|
-
isInstalled: boolean;
|
|
78
|
-
error: Error | null;
|
|
79
|
-
};
|
|
80
|
-
declare function useDisconnectWallet(): {
|
|
81
|
-
disconnect: () => Promise<void>;
|
|
82
|
-
connected: boolean;
|
|
83
|
-
};
|
|
84
|
-
declare function useSignMessage(): {
|
|
85
|
-
signMessage: (message: string) => Promise<SignedMessage>;
|
|
86
|
-
connected: boolean;
|
|
87
|
-
};
|
|
88
|
-
declare function useSendTransaction(): {
|
|
89
|
-
sendTransaction: (tx: TransactionRequest) => Promise<TransactionResult>;
|
|
90
|
-
signAndSendTransaction: (tx: TransactionRequest) => Promise<TransactionResult>;
|
|
91
|
-
sendGaslessTransaction: (tx: Omit<TransactionRequest, "gasless">) => Promise<TransactionResult>;
|
|
92
|
-
connected: boolean;
|
|
93
|
-
};
|
|
94
|
-
/** Hook for REX (confidential) transaction capabilities */
|
|
95
|
-
declare function useREX(): {
|
|
96
|
-
capabilities: REXCapabilities | null;
|
|
97
|
-
supported: boolean;
|
|
98
|
-
submitREXTransaction: (tx: TransactionRequest) => Promise<REXTransactionResult>;
|
|
99
|
-
connected: boolean;
|
|
100
|
-
};
|
|
101
|
-
/** Hook for Stake-for-Service (gasless) operations */
|
|
102
|
-
declare function useSfS(): {
|
|
103
|
-
positions: SfSPosition[];
|
|
104
|
-
credits: SfSCreditBalance | null;
|
|
105
|
-
hasCredits: boolean;
|
|
106
|
-
createPosition: (params: SfSCreateParams) => Promise<SfSPosition>;
|
|
107
|
-
sendGasless: (tx: Omit<TransactionRequest, "gasless">) => Promise<TransactionResult>;
|
|
108
|
-
refresh: () => Promise<void>;
|
|
109
|
-
connected: boolean;
|
|
110
|
-
};
|
|
111
|
-
/** Hook for Scan-to-Connect */
|
|
112
|
-
declare function useScanConnect(): {
|
|
113
|
-
scanURI: ScanConnectURI | null;
|
|
114
|
-
status: ScanConnectStatus;
|
|
115
|
-
generateQR: () => Promise<void>;
|
|
116
|
-
approveSession: (sessionId: string) => Promise<WalletAccount[]>;
|
|
117
|
-
rejectSession: (sessionId: string) => Promise<void>;
|
|
118
|
-
};
|
|
119
|
-
interface ConnectButtonProps {
|
|
120
|
-
connectLabel?: string;
|
|
121
|
-
disconnectLabel?: string;
|
|
122
|
-
showAddress?: boolean;
|
|
123
|
-
showBalance?: boolean;
|
|
124
|
-
/** Show feature badges (REX, SfS) */
|
|
125
|
-
showFeatures?: boolean;
|
|
126
|
-
className?: string;
|
|
127
|
-
style?: React.CSSProperties;
|
|
128
|
-
}
|
|
129
|
-
declare function ConnectButton({ connectLabel, disconnectLabel, showAddress, showBalance, showFeatures, className, style, }: ConnectButtonProps): react_jsx_runtime.JSX.Element;
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* @cookill/wallet-adapter — WalletModal
|
|
133
|
-
* Clean, standalone modal with 3 tabs: Extension, Scan-to-Connect, Web Wallet
|
|
134
|
-
*
|
|
135
|
-
* KEY ARCHITECTURE:
|
|
136
|
-
* - Backdrop and dialog are SIBLINGS (prevents click propagation bugs)
|
|
137
|
-
* - All interactive elements use stopPropagation
|
|
138
|
-
* - Tab switching works independently of connection state
|
|
139
|
-
* - Auto-close only fires for NEW connections (not pre-existing)
|
|
140
|
-
* - Connect button in Extension tab calls context's connect() directly
|
|
141
|
-
*/
|
|
142
|
-
interface WalletModalExternalProps {
|
|
143
|
-
scanConnectRelay: string;
|
|
144
|
-
}
|
|
145
|
-
declare function WalletModal({ scanConnectRelay }: WalletModalExternalProps): react_jsx_runtime.JSX.Element | null;
|
|
146
|
-
|
|
147
|
-
export { ConnectButton, type ConnectButtonProps, REXCapabilities, REXTransactionResult, RialoNetwork, ScanConnectStatus, ScanConnectURI, SfSCreateParams, SfSCreditBalance, SfSPosition, SheepWallet, SignedMessage, TransactionRequest, TransactionResult, WalletAccount, type WalletContextValue, WalletInfo, WalletModal, type WalletModalExternalProps, WalletProvider, type WalletProviderProps, type WalletState, useAccounts, useActiveAccount, useBalance, useConnectWallet, useDisconnectWallet, useIsConnected, useNetwork, useREX, useScanConnect, useSendTransaction, useSfS, useSignMessage, useSwitchNetwork, useWallet };
|
|
1
|
+
export { NETWORKS, RialoWallet as SheepWallet, formatAddress, formatBalance, isInstalled, isValidAddress, parseBalance } from './index.js';
|