@naculus/connect-native 0.4.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/LICENSE +21 -0
- package/README.md +84 -0
- package/dist/index.cjs +366 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +218 -0
- package/dist/index.d.ts +218 -0
- package/dist/index.js +331 -0
- package/dist/index.js.map +1 -0
- package/package.json +84 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import { InjectedProviderRegistration, NativeWalletConnectOptions } from '@naculus/connect-appkit-react';
|
|
2
|
+
import { StorageAdapter } from '@naculus/wallet-engine';
|
|
3
|
+
import { StorageAdapter as StorageAdapter$1, SessionStorage } from '@naculus/connect-core';
|
|
4
|
+
|
|
5
|
+
/** base58 (Bitcoin alphabet), as Solana addresses and signatures use. */
|
|
6
|
+
declare function base58Encode(bytes: Uint8Array): string;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Coinbase Wallet on React Native through Mobile Wallet Protocol. The app
|
|
10
|
+
* builds the provider — `new EIP1193Provider({ metadata, wallet:
|
|
11
|
+
* Wallets.CoinbaseSmartWallet })` from `@mobile-wallet-protocol/client` —
|
|
12
|
+
* and this registers it as an injected wallet (pass in
|
|
13
|
+
* `config.injectedProviders`); connect with `connectInjected("coinbase-mwp")`.
|
|
14
|
+
*/
|
|
15
|
+
declare function coinbaseMobileWallet(provider: unknown, info?: Partial<InjectedProviderRegistration["info"]>): InjectedProviderRegistration;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The React Native modules this package wires, described by the members it
|
|
19
|
+
* uses. The app passes the real ones (`import AsyncStorage from
|
|
20
|
+
* "@react-native-async-storage/async-storage"`, `import { Linking, Platform }
|
|
21
|
+
* from "react-native"`, …): nothing here imports React Native, so every
|
|
22
|
+
* native peer stays optional and the package loads (and tests) anywhere.
|
|
23
|
+
*/
|
|
24
|
+
/** `@react-native-async-storage/async-storage` default export. */
|
|
25
|
+
interface AsyncStorageLike {
|
|
26
|
+
getItem(key: string): Promise<string | null>;
|
|
27
|
+
setItem(key: string, value: string): Promise<void>;
|
|
28
|
+
removeItem(key: string): Promise<void>;
|
|
29
|
+
getAllKeys(): Promise<readonly string[]>;
|
|
30
|
+
multiRemove(keys: readonly string[]): Promise<void>;
|
|
31
|
+
}
|
|
32
|
+
/** `react-native` `Linking`. */
|
|
33
|
+
interface LinkingLike {
|
|
34
|
+
openURL(url: string): Promise<unknown>;
|
|
35
|
+
canOpenURL(url: string): Promise<boolean>;
|
|
36
|
+
}
|
|
37
|
+
/** `expo-secure-store` (Keychain / Keystore). */
|
|
38
|
+
interface SecureStoreLike {
|
|
39
|
+
getItemAsync(key: string, options?: {
|
|
40
|
+
keychainAccessible?: number;
|
|
41
|
+
}): Promise<string | null>;
|
|
42
|
+
setItemAsync(key: string, value: string, options?: {
|
|
43
|
+
keychainAccessible?: number;
|
|
44
|
+
}): Promise<void>;
|
|
45
|
+
deleteItemAsync(key: string): Promise<void>;
|
|
46
|
+
/** `SecureStore.WHEN_UNLOCKED_THIS_DEVICE_ONLY`. */
|
|
47
|
+
WHEN_UNLOCKED_THIS_DEVICE_ONLY?: number;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* The embedded wallet's storage on a phone: wallet-engine's
|
|
52
|
+
* `KeyStoreStorageAdapter` with its key in iOS Keychain / Android Keystore
|
|
53
|
+
* (`expo-secure-store`, this device only, when unlocked) and the sealed record
|
|
54
|
+
* in AsyncStorage. Sealing happens inside wallet-engine; this only moves two
|
|
55
|
+
* opaque strings. Pass as `embeddedConfig.storage`.
|
|
56
|
+
*
|
|
57
|
+
* Isolation is weaker than the web's worker: React Native has no Web Worker,
|
|
58
|
+
* so signing runs on the JS thread. The Keystore makes the sealed record
|
|
59
|
+
* useless off the device and keeps the key out of AsyncStorage. Needs
|
|
60
|
+
* `crypto.getRandomValues` (`react-native-get-random-values`, which
|
|
61
|
+
* `@walletconnect/react-native-compat` installs).
|
|
62
|
+
*/
|
|
63
|
+
interface KeystoreWalletStorageOptions {
|
|
64
|
+
secureStore: SecureStoreLike;
|
|
65
|
+
asyncStorage: AsyncStorageLike;
|
|
66
|
+
/** Names both the Keystore entry and the AsyncStorage record. */
|
|
67
|
+
name?: string;
|
|
68
|
+
}
|
|
69
|
+
declare function keystoreWalletStorage(options: KeystoreWalletStorageOptions): StorageAdapter;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Solana Mobile Wallet Adapter as a Wallet Standard wallet, for
|
|
73
|
+
* connector-solana's `registerWallet` (pass it in `config.solanaWallets`).
|
|
74
|
+
*
|
|
75
|
+
* Each operation opens one MWA session with `transact` (from
|
|
76
|
+
* `@solana-mobile/mobile-wallet-adapter-protocol-kit`, passed in by the app),
|
|
77
|
+
* re-authorizes with the stored auth token and asks the wallet app. Wire
|
|
78
|
+
* transactions become the Kit `{ messageBytes, signatures }` objects that
|
|
79
|
+
* package expects and back; the signer order is taken from the message.
|
|
80
|
+
*/
|
|
81
|
+
/** MWA's app identity, shown by the wallet. */
|
|
82
|
+
interface MwaAppIdentity {
|
|
83
|
+
name?: string;
|
|
84
|
+
uri?: string;
|
|
85
|
+
icon?: string;
|
|
86
|
+
}
|
|
87
|
+
type KitTransaction = {
|
|
88
|
+
messageBytes: Uint8Array;
|
|
89
|
+
signatures: Record<string, Uint8Array | null>;
|
|
90
|
+
};
|
|
91
|
+
/** The members of the Kit `KitMobileWallet` used here. */
|
|
92
|
+
interface MwaWalletLike {
|
|
93
|
+
authorize(params: {
|
|
94
|
+
identity: MwaAppIdentity;
|
|
95
|
+
chain?: string;
|
|
96
|
+
auth_token?: string;
|
|
97
|
+
}): Promise<{
|
|
98
|
+
accounts: readonly {
|
|
99
|
+
address: string;
|
|
100
|
+
label?: string;
|
|
101
|
+
}[];
|
|
102
|
+
auth_token: string;
|
|
103
|
+
}>;
|
|
104
|
+
deauthorize(params: {
|
|
105
|
+
auth_token: string;
|
|
106
|
+
}): Promise<unknown>;
|
|
107
|
+
signMessages(params: {
|
|
108
|
+
addresses: string[];
|
|
109
|
+
payloads: Uint8Array[];
|
|
110
|
+
}): Promise<Uint8Array[]>;
|
|
111
|
+
signTransactions(params: {
|
|
112
|
+
transactions: KitTransaction[];
|
|
113
|
+
}): Promise<KitTransaction[]>;
|
|
114
|
+
signAndSendTransactions(params: {
|
|
115
|
+
transactions: KitTransaction[];
|
|
116
|
+
}): Promise<Uint8Array[]>;
|
|
117
|
+
}
|
|
118
|
+
type MwaTransact = <T>(callback: (wallet: MwaWalletLike) => Promise<T>) => Promise<T>;
|
|
119
|
+
interface MobileWalletAdapterOptions {
|
|
120
|
+
transact: MwaTransact;
|
|
121
|
+
identity: MwaAppIdentity;
|
|
122
|
+
/** MWA 2.0 chain id: `solana:mainnet`, `solana:devnet` or `solana:testnet`. */
|
|
123
|
+
chain: "solana:mainnet" | "solana:devnet" | "solana:testnet";
|
|
124
|
+
name?: string;
|
|
125
|
+
icon?: string;
|
|
126
|
+
}
|
|
127
|
+
/** Wire transaction → Kit transaction (signatures keyed by signer address). */
|
|
128
|
+
declare function kitTransactionFromWire(wire: Uint8Array): KitTransaction;
|
|
129
|
+
/** Kit transaction → wire, in the message's signer order. */
|
|
130
|
+
declare function wireFromKitTransaction(tx: KitTransaction): Uint8Array;
|
|
131
|
+
declare function createMobileWalletAdapterWallet(options: MobileWalletAdapterOptions): {
|
|
132
|
+
version: "1.0.0";
|
|
133
|
+
name: string;
|
|
134
|
+
icon: string;
|
|
135
|
+
chains: ("solana:mainnet" | "solana:devnet" | "solana:testnet")[];
|
|
136
|
+
readonly accounts: {
|
|
137
|
+
address: string;
|
|
138
|
+
publicKey: Uint8Array<ArrayBufferLike>;
|
|
139
|
+
chains: ("solana:mainnet" | "solana:devnet" | "solana:testnet")[];
|
|
140
|
+
features: string[];
|
|
141
|
+
}[];
|
|
142
|
+
features: {
|
|
143
|
+
"standard:connect": {
|
|
144
|
+
version: string;
|
|
145
|
+
connect: () => Promise<{
|
|
146
|
+
accounts: {
|
|
147
|
+
address: string;
|
|
148
|
+
publicKey: Uint8Array<ArrayBufferLike>;
|
|
149
|
+
chains: ("solana:mainnet" | "solana:devnet" | "solana:testnet")[];
|
|
150
|
+
features: string[];
|
|
151
|
+
}[];
|
|
152
|
+
}>;
|
|
153
|
+
};
|
|
154
|
+
"standard:disconnect": {
|
|
155
|
+
version: string;
|
|
156
|
+
disconnect: () => Promise<void>;
|
|
157
|
+
};
|
|
158
|
+
"standard:events": {
|
|
159
|
+
version: string;
|
|
160
|
+
on: (_event: string, listener: (change: unknown) => void) => () => boolean;
|
|
161
|
+
};
|
|
162
|
+
"solana:signMessage": {
|
|
163
|
+
version: string;
|
|
164
|
+
signMessage: (message: Uint8Array) => Promise<{
|
|
165
|
+
signature: Uint8Array<ArrayBuffer>;
|
|
166
|
+
}>;
|
|
167
|
+
};
|
|
168
|
+
"solana:signTransaction": {
|
|
169
|
+
version: string;
|
|
170
|
+
signTransaction: (transaction: Uint8Array) => Promise<{
|
|
171
|
+
signedTransaction: Uint8Array<ArrayBufferLike>;
|
|
172
|
+
}>;
|
|
173
|
+
};
|
|
174
|
+
"solana:signAndSendTransaction": {
|
|
175
|
+
version: string;
|
|
176
|
+
signAndSendTransaction: (transaction: Uint8Array) => Promise<{
|
|
177
|
+
signature: string;
|
|
178
|
+
}>;
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Tell connect-core it runs in a native app (`Platform.OS` from
|
|
185
|
+
* react-native). React Native cannot be told apart from a browser by
|
|
186
|
+
* `navigator`; without this, connectors record sessions as `desktop-web` and
|
|
187
|
+
* the connector manager does not prefer mobile-capable connectors.
|
|
188
|
+
*/
|
|
189
|
+
declare function setupNaculusNative(os: string): void;
|
|
190
|
+
|
|
191
|
+
/** connect-core `StorageAdapter` over AsyncStorage, under a key prefix. */
|
|
192
|
+
declare function asyncStorageAdapter(storage: AsyncStorageLike, prefix?: string): StorageAdapter$1;
|
|
193
|
+
/**
|
|
194
|
+
* Where `Web3ConnectProvider` persists the connected session on React
|
|
195
|
+
* Native (pass as `config.sessionStorage`); the web default is localStorage.
|
|
196
|
+
*/
|
|
197
|
+
declare function asyncStorageSessionStorage(storage: AsyncStorageLike, key?: string): SessionStorage;
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* WalletConnect on React Native: deep links open through `Linking`. The
|
|
201
|
+
* SignClient builds itself; with `@walletconnect/react-native-compat`
|
|
202
|
+
* imported first in the app's entry file, its storage is AsyncStorage.
|
|
203
|
+
*/
|
|
204
|
+
declare function nativeWalletConnect(linking: LinkingLike): NativeWalletConnectOptions;
|
|
205
|
+
interface WalletLinkTarget {
|
|
206
|
+
id: string;
|
|
207
|
+
name: string;
|
|
208
|
+
/** Deep-link base the WalletConnect URI is appended to, e.g. `metamask://wc`. */
|
|
209
|
+
deepLink: string;
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* The wallets whose apps are installed. iOS answers only for schemes listed
|
|
213
|
+
* under `LSApplicationQueriesSchemes` in Info.plist, Android only for those in
|
|
214
|
+
* the manifest's `<queries>`; anything else reads as not installed.
|
|
215
|
+
*/
|
|
216
|
+
declare function installedWallets(linking: LinkingLike, wallets: readonly WalletLinkTarget[]): Promise<WalletLinkTarget[]>;
|
|
217
|
+
|
|
218
|
+
export { type AsyncStorageLike, type KeystoreWalletStorageOptions, type LinkingLike, type MobileWalletAdapterOptions, type MwaAppIdentity, type MwaTransact, type MwaWalletLike, type SecureStoreLike, type WalletLinkTarget, asyncStorageAdapter, asyncStorageSessionStorage, base58Encode, coinbaseMobileWallet, createMobileWalletAdapterWallet, installedWallets, keystoreWalletStorage, kitTransactionFromWire, nativeWalletConnect, setupNaculusNative, wireFromKitTransaction };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import { InjectedProviderRegistration, NativeWalletConnectOptions } from '@naculus/connect-appkit-react';
|
|
2
|
+
import { StorageAdapter } from '@naculus/wallet-engine';
|
|
3
|
+
import { StorageAdapter as StorageAdapter$1, SessionStorage } from '@naculus/connect-core';
|
|
4
|
+
|
|
5
|
+
/** base58 (Bitcoin alphabet), as Solana addresses and signatures use. */
|
|
6
|
+
declare function base58Encode(bytes: Uint8Array): string;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Coinbase Wallet on React Native through Mobile Wallet Protocol. The app
|
|
10
|
+
* builds the provider — `new EIP1193Provider({ metadata, wallet:
|
|
11
|
+
* Wallets.CoinbaseSmartWallet })` from `@mobile-wallet-protocol/client` —
|
|
12
|
+
* and this registers it as an injected wallet (pass in
|
|
13
|
+
* `config.injectedProviders`); connect with `connectInjected("coinbase-mwp")`.
|
|
14
|
+
*/
|
|
15
|
+
declare function coinbaseMobileWallet(provider: unknown, info?: Partial<InjectedProviderRegistration["info"]>): InjectedProviderRegistration;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The React Native modules this package wires, described by the members it
|
|
19
|
+
* uses. The app passes the real ones (`import AsyncStorage from
|
|
20
|
+
* "@react-native-async-storage/async-storage"`, `import { Linking, Platform }
|
|
21
|
+
* from "react-native"`, …): nothing here imports React Native, so every
|
|
22
|
+
* native peer stays optional and the package loads (and tests) anywhere.
|
|
23
|
+
*/
|
|
24
|
+
/** `@react-native-async-storage/async-storage` default export. */
|
|
25
|
+
interface AsyncStorageLike {
|
|
26
|
+
getItem(key: string): Promise<string | null>;
|
|
27
|
+
setItem(key: string, value: string): Promise<void>;
|
|
28
|
+
removeItem(key: string): Promise<void>;
|
|
29
|
+
getAllKeys(): Promise<readonly string[]>;
|
|
30
|
+
multiRemove(keys: readonly string[]): Promise<void>;
|
|
31
|
+
}
|
|
32
|
+
/** `react-native` `Linking`. */
|
|
33
|
+
interface LinkingLike {
|
|
34
|
+
openURL(url: string): Promise<unknown>;
|
|
35
|
+
canOpenURL(url: string): Promise<boolean>;
|
|
36
|
+
}
|
|
37
|
+
/** `expo-secure-store` (Keychain / Keystore). */
|
|
38
|
+
interface SecureStoreLike {
|
|
39
|
+
getItemAsync(key: string, options?: {
|
|
40
|
+
keychainAccessible?: number;
|
|
41
|
+
}): Promise<string | null>;
|
|
42
|
+
setItemAsync(key: string, value: string, options?: {
|
|
43
|
+
keychainAccessible?: number;
|
|
44
|
+
}): Promise<void>;
|
|
45
|
+
deleteItemAsync(key: string): Promise<void>;
|
|
46
|
+
/** `SecureStore.WHEN_UNLOCKED_THIS_DEVICE_ONLY`. */
|
|
47
|
+
WHEN_UNLOCKED_THIS_DEVICE_ONLY?: number;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* The embedded wallet's storage on a phone: wallet-engine's
|
|
52
|
+
* `KeyStoreStorageAdapter` with its key in iOS Keychain / Android Keystore
|
|
53
|
+
* (`expo-secure-store`, this device only, when unlocked) and the sealed record
|
|
54
|
+
* in AsyncStorage. Sealing happens inside wallet-engine; this only moves two
|
|
55
|
+
* opaque strings. Pass as `embeddedConfig.storage`.
|
|
56
|
+
*
|
|
57
|
+
* Isolation is weaker than the web's worker: React Native has no Web Worker,
|
|
58
|
+
* so signing runs on the JS thread. The Keystore makes the sealed record
|
|
59
|
+
* useless off the device and keeps the key out of AsyncStorage. Needs
|
|
60
|
+
* `crypto.getRandomValues` (`react-native-get-random-values`, which
|
|
61
|
+
* `@walletconnect/react-native-compat` installs).
|
|
62
|
+
*/
|
|
63
|
+
interface KeystoreWalletStorageOptions {
|
|
64
|
+
secureStore: SecureStoreLike;
|
|
65
|
+
asyncStorage: AsyncStorageLike;
|
|
66
|
+
/** Names both the Keystore entry and the AsyncStorage record. */
|
|
67
|
+
name?: string;
|
|
68
|
+
}
|
|
69
|
+
declare function keystoreWalletStorage(options: KeystoreWalletStorageOptions): StorageAdapter;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Solana Mobile Wallet Adapter as a Wallet Standard wallet, for
|
|
73
|
+
* connector-solana's `registerWallet` (pass it in `config.solanaWallets`).
|
|
74
|
+
*
|
|
75
|
+
* Each operation opens one MWA session with `transact` (from
|
|
76
|
+
* `@solana-mobile/mobile-wallet-adapter-protocol-kit`, passed in by the app),
|
|
77
|
+
* re-authorizes with the stored auth token and asks the wallet app. Wire
|
|
78
|
+
* transactions become the Kit `{ messageBytes, signatures }` objects that
|
|
79
|
+
* package expects and back; the signer order is taken from the message.
|
|
80
|
+
*/
|
|
81
|
+
/** MWA's app identity, shown by the wallet. */
|
|
82
|
+
interface MwaAppIdentity {
|
|
83
|
+
name?: string;
|
|
84
|
+
uri?: string;
|
|
85
|
+
icon?: string;
|
|
86
|
+
}
|
|
87
|
+
type KitTransaction = {
|
|
88
|
+
messageBytes: Uint8Array;
|
|
89
|
+
signatures: Record<string, Uint8Array | null>;
|
|
90
|
+
};
|
|
91
|
+
/** The members of the Kit `KitMobileWallet` used here. */
|
|
92
|
+
interface MwaWalletLike {
|
|
93
|
+
authorize(params: {
|
|
94
|
+
identity: MwaAppIdentity;
|
|
95
|
+
chain?: string;
|
|
96
|
+
auth_token?: string;
|
|
97
|
+
}): Promise<{
|
|
98
|
+
accounts: readonly {
|
|
99
|
+
address: string;
|
|
100
|
+
label?: string;
|
|
101
|
+
}[];
|
|
102
|
+
auth_token: string;
|
|
103
|
+
}>;
|
|
104
|
+
deauthorize(params: {
|
|
105
|
+
auth_token: string;
|
|
106
|
+
}): Promise<unknown>;
|
|
107
|
+
signMessages(params: {
|
|
108
|
+
addresses: string[];
|
|
109
|
+
payloads: Uint8Array[];
|
|
110
|
+
}): Promise<Uint8Array[]>;
|
|
111
|
+
signTransactions(params: {
|
|
112
|
+
transactions: KitTransaction[];
|
|
113
|
+
}): Promise<KitTransaction[]>;
|
|
114
|
+
signAndSendTransactions(params: {
|
|
115
|
+
transactions: KitTransaction[];
|
|
116
|
+
}): Promise<Uint8Array[]>;
|
|
117
|
+
}
|
|
118
|
+
type MwaTransact = <T>(callback: (wallet: MwaWalletLike) => Promise<T>) => Promise<T>;
|
|
119
|
+
interface MobileWalletAdapterOptions {
|
|
120
|
+
transact: MwaTransact;
|
|
121
|
+
identity: MwaAppIdentity;
|
|
122
|
+
/** MWA 2.0 chain id: `solana:mainnet`, `solana:devnet` or `solana:testnet`. */
|
|
123
|
+
chain: "solana:mainnet" | "solana:devnet" | "solana:testnet";
|
|
124
|
+
name?: string;
|
|
125
|
+
icon?: string;
|
|
126
|
+
}
|
|
127
|
+
/** Wire transaction → Kit transaction (signatures keyed by signer address). */
|
|
128
|
+
declare function kitTransactionFromWire(wire: Uint8Array): KitTransaction;
|
|
129
|
+
/** Kit transaction → wire, in the message's signer order. */
|
|
130
|
+
declare function wireFromKitTransaction(tx: KitTransaction): Uint8Array;
|
|
131
|
+
declare function createMobileWalletAdapterWallet(options: MobileWalletAdapterOptions): {
|
|
132
|
+
version: "1.0.0";
|
|
133
|
+
name: string;
|
|
134
|
+
icon: string;
|
|
135
|
+
chains: ("solana:mainnet" | "solana:devnet" | "solana:testnet")[];
|
|
136
|
+
readonly accounts: {
|
|
137
|
+
address: string;
|
|
138
|
+
publicKey: Uint8Array<ArrayBufferLike>;
|
|
139
|
+
chains: ("solana:mainnet" | "solana:devnet" | "solana:testnet")[];
|
|
140
|
+
features: string[];
|
|
141
|
+
}[];
|
|
142
|
+
features: {
|
|
143
|
+
"standard:connect": {
|
|
144
|
+
version: string;
|
|
145
|
+
connect: () => Promise<{
|
|
146
|
+
accounts: {
|
|
147
|
+
address: string;
|
|
148
|
+
publicKey: Uint8Array<ArrayBufferLike>;
|
|
149
|
+
chains: ("solana:mainnet" | "solana:devnet" | "solana:testnet")[];
|
|
150
|
+
features: string[];
|
|
151
|
+
}[];
|
|
152
|
+
}>;
|
|
153
|
+
};
|
|
154
|
+
"standard:disconnect": {
|
|
155
|
+
version: string;
|
|
156
|
+
disconnect: () => Promise<void>;
|
|
157
|
+
};
|
|
158
|
+
"standard:events": {
|
|
159
|
+
version: string;
|
|
160
|
+
on: (_event: string, listener: (change: unknown) => void) => () => boolean;
|
|
161
|
+
};
|
|
162
|
+
"solana:signMessage": {
|
|
163
|
+
version: string;
|
|
164
|
+
signMessage: (message: Uint8Array) => Promise<{
|
|
165
|
+
signature: Uint8Array<ArrayBuffer>;
|
|
166
|
+
}>;
|
|
167
|
+
};
|
|
168
|
+
"solana:signTransaction": {
|
|
169
|
+
version: string;
|
|
170
|
+
signTransaction: (transaction: Uint8Array) => Promise<{
|
|
171
|
+
signedTransaction: Uint8Array<ArrayBufferLike>;
|
|
172
|
+
}>;
|
|
173
|
+
};
|
|
174
|
+
"solana:signAndSendTransaction": {
|
|
175
|
+
version: string;
|
|
176
|
+
signAndSendTransaction: (transaction: Uint8Array) => Promise<{
|
|
177
|
+
signature: string;
|
|
178
|
+
}>;
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Tell connect-core it runs in a native app (`Platform.OS` from
|
|
185
|
+
* react-native). React Native cannot be told apart from a browser by
|
|
186
|
+
* `navigator`; without this, connectors record sessions as `desktop-web` and
|
|
187
|
+
* the connector manager does not prefer mobile-capable connectors.
|
|
188
|
+
*/
|
|
189
|
+
declare function setupNaculusNative(os: string): void;
|
|
190
|
+
|
|
191
|
+
/** connect-core `StorageAdapter` over AsyncStorage, under a key prefix. */
|
|
192
|
+
declare function asyncStorageAdapter(storage: AsyncStorageLike, prefix?: string): StorageAdapter$1;
|
|
193
|
+
/**
|
|
194
|
+
* Where `Web3ConnectProvider` persists the connected session on React
|
|
195
|
+
* Native (pass as `config.sessionStorage`); the web default is localStorage.
|
|
196
|
+
*/
|
|
197
|
+
declare function asyncStorageSessionStorage(storage: AsyncStorageLike, key?: string): SessionStorage;
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* WalletConnect on React Native: deep links open through `Linking`. The
|
|
201
|
+
* SignClient builds itself; with `@walletconnect/react-native-compat`
|
|
202
|
+
* imported first in the app's entry file, its storage is AsyncStorage.
|
|
203
|
+
*/
|
|
204
|
+
declare function nativeWalletConnect(linking: LinkingLike): NativeWalletConnectOptions;
|
|
205
|
+
interface WalletLinkTarget {
|
|
206
|
+
id: string;
|
|
207
|
+
name: string;
|
|
208
|
+
/** Deep-link base the WalletConnect URI is appended to, e.g. `metamask://wc`. */
|
|
209
|
+
deepLink: string;
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* The wallets whose apps are installed. iOS answers only for schemes listed
|
|
213
|
+
* under `LSApplicationQueriesSchemes` in Info.plist, Android only for those in
|
|
214
|
+
* the manifest's `<queries>`; anything else reads as not installed.
|
|
215
|
+
*/
|
|
216
|
+
declare function installedWallets(linking: LinkingLike, wallets: readonly WalletLinkTarget[]): Promise<WalletLinkTarget[]>;
|
|
217
|
+
|
|
218
|
+
export { type AsyncStorageLike, type KeystoreWalletStorageOptions, type LinkingLike, type MobileWalletAdapterOptions, type MwaAppIdentity, type MwaTransact, type MwaWalletLike, type SecureStoreLike, type WalletLinkTarget, asyncStorageAdapter, asyncStorageSessionStorage, base58Encode, coinbaseMobileWallet, createMobileWalletAdapterWallet, installedWallets, keystoreWalletStorage, kitTransactionFromWire, nativeWalletConnect, setupNaculusNative, wireFromKitTransaction };
|