@fernolab/wallet-adapter-svelte 0.1.0
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/components/WalletButton.svelte +152 -0
- package/dist/components/WalletButton.svelte.d.ts +6 -0
- package/dist/components/WalletListButton.svelte +48 -0
- package/dist/components/WalletListButton.svelte.d.ts +8 -0
- package/dist/components/WalletModal.svelte +360 -0
- package/dist/components/WalletModal.svelte.d.ts +7 -0
- package/dist/components/WalletProvider.svelte +25 -0
- package/dist/components/WalletProvider.svelte.d.ts +8 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.js +3 -0
- package/dist/config.d.ts +2 -0
- package/dist/config.js +2 -0
- package/dist/environment.d.ts +1 -0
- package/dist/environment.js +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +4 -0
- package/dist/wallet/mobile-detection.d.ts +3 -0
- package/dist/wallet/mobile-detection.js +27 -0
- package/dist/wallet/types.d.ts +3 -0
- package/dist/wallet/types.js +1 -0
- package/dist/wallet/wallet.svelte.d.ts +56 -0
- package/dist/wallet/wallet.svelte.js +672 -0
- package/package.json +71 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { StandardWallet } from './types.js';
|
|
2
|
+
import { adaptWallet, dedupeStandardWallets, isSolanaWallet, type IdentifierString, type InjectedWallet, type WalletAccount } from '@fernolab/wallet-adapter-core';
|
|
3
|
+
export { adaptWallet, dedupeStandardWallets, isSolanaWallet };
|
|
4
|
+
export declare const RUNTIME_DEBUG_MODES: readonly ["auto", "desktop", "ios", "android", "phantom", "solflare", "jupiter", "backpack"];
|
|
5
|
+
export type RuntimeDebugMode = (typeof RUNTIME_DEBUG_MODES)[number];
|
|
6
|
+
interface SignMessageResult {
|
|
7
|
+
signature: string | Uint8Array;
|
|
8
|
+
signatureType?: string;
|
|
9
|
+
signedMessage: string | Uint8Array;
|
|
10
|
+
}
|
|
11
|
+
type ConnectionStatus = 'disconnected' | 'connecting' | 'connected';
|
|
12
|
+
type WalletEventCallback = (wallet: StandardWallet | null) => void;
|
|
13
|
+
/**
|
|
14
|
+
* Determine Solana chain identifier from RPC endpoint
|
|
15
|
+
*/
|
|
16
|
+
export declare function resolveChainFromEndpoint(endpoint: string): IdentifierString;
|
|
17
|
+
export declare function createWalletStore(): {
|
|
18
|
+
readonly rpcEndpoint: string;
|
|
19
|
+
readonly availableWallets: StandardWallet[];
|
|
20
|
+
readonly standardWallet: StandardWallet | null;
|
|
21
|
+
readonly standardAccount: WalletAccount | null;
|
|
22
|
+
readonly publicKey: string | null;
|
|
23
|
+
readonly connected: boolean;
|
|
24
|
+
readonly connecting: boolean;
|
|
25
|
+
readonly signing: boolean;
|
|
26
|
+
readonly connectionStatus: ConnectionStatus;
|
|
27
|
+
readonly useMWA: boolean;
|
|
28
|
+
readonly shortAddress: string;
|
|
29
|
+
readonly isInitialized: boolean;
|
|
30
|
+
readonly error: Error | null;
|
|
31
|
+
readonly mobileRuntime: import("@fernolab/wallet-adapter-core").MobileRuntime;
|
|
32
|
+
readonly runtimeLabel: string;
|
|
33
|
+
readonly runtimeDebugMode: "auto" | "desktop" | "ios" | "android" | "phantom" | "solflare" | "jupiter" | "backpack";
|
|
34
|
+
readonly runtimeDebugModes: readonly ["auto", "desktop", "ios", "android", "phantom", "solflare", "jupiter", "backpack"];
|
|
35
|
+
readonly detectedInjectedWallets: InjectedWallet[];
|
|
36
|
+
readonly detectedWalletBrowserName: string | null;
|
|
37
|
+
readonly mobileWalletLinks: {
|
|
38
|
+
name: string;
|
|
39
|
+
url: string;
|
|
40
|
+
}[];
|
|
41
|
+
readonly mobileWalletAdapterWallet: StandardWallet | null;
|
|
42
|
+
readonly mobileWalletAdapterName: string;
|
|
43
|
+
readonly mobileWalletAdapterDisplayName: string;
|
|
44
|
+
initialize: (endpoint?: string) => Promise<void>;
|
|
45
|
+
refreshAvailableWallets: () => Promise<void>;
|
|
46
|
+
setRuntimeDebugMode: (mode: RuntimeDebugMode | string) => Promise<void>;
|
|
47
|
+
connectStandard: (wallet: StandardWallet) => Promise<void>;
|
|
48
|
+
connectMobileWalletAdapter: () => Promise<void>;
|
|
49
|
+
connectWalletBrowser: () => Promise<void>;
|
|
50
|
+
disconnect: () => Promise<void>;
|
|
51
|
+
signMessage: (message: string | Uint8Array) => Promise<SignMessageResult>;
|
|
52
|
+
onWalletChange: (callback: WalletEventCallback) => () => void;
|
|
53
|
+
clearError: () => void;
|
|
54
|
+
};
|
|
55
|
+
export type WalletStore = ReturnType<typeof createWalletStore>;
|
|
56
|
+
export declare const wallet: WalletStore;
|