@human.tech/waap-sdk 2.0.0 → 2.1.0-staging-fb27bb
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/CHANGELOG.md +23 -0
- package/README.md +167 -216
- package/dist/WaaPError-C5nPcaKk.d.mts +168 -0
- package/dist/WaaPError-XLgIXUgh.d.ts +168 -0
- package/dist/WalletConnect-BTT6LtUu.d.mts +33 -0
- package/dist/WalletConnect-BTT6LtUu.d.ts +33 -0
- package/dist/WalletConnect-Deg7_JmH.mjs +4 -0
- package/dist/WalletConnect-G-lbqknM.js +4 -0
- package/dist/asyncSigning-B0KrmKk7.js +1 -0
- package/dist/asyncSigning-CzqBbYDP.mjs +1 -0
- package/dist/esm-B4jz8Emb.mjs +1 -0
- package/dist/esm-D5fDQenf.js +1 -0
- package/dist/evm-Ch-aWWat.js +1 -0
- package/dist/evm-DHVrAmEw.mjs +1 -0
- package/dist/evm.d.mts +7 -0
- package/dist/evm.d.ts +7 -0
- package/dist/evm.js +1 -0
- package/dist/evm.mjs +1 -0
- package/dist/index-CMSufeMa.d.ts +775 -0
- package/dist/index-CdKntlzX.d.mts +775 -0
- package/dist/index.d.mts +239 -933
- package/dist/index.d.ts +239 -933
- package/dist/index.js +1 -2191
- package/dist/index.mjs +1 -2162
- package/dist/initializerContext-0oKHzvQG.d.ts +21 -0
- package/dist/initializerContext-C39PUnGi.d.mts +21 -0
- package/dist/react.d.mts +2 -0
- package/dist/react.d.ts +2 -0
- package/dist/react.js +1 -0
- package/dist/react.mjs +1 -0
- package/dist/register-4Afr2Jx8.js +1 -0
- package/dist/register-CBlzg5ln.d.ts +107 -0
- package/dist/register-CNgjA0yl.mjs +1 -0
- package/dist/register-CxsUwgKJ.d.ts +282 -0
- package/dist/register-DIZnKDHF.mjs +1 -0
- package/dist/register-LmdJdvzn.d.mts +282 -0
- package/dist/register-QjrsOe7r.d.mts +107 -0
- package/dist/register-ozKwGWOb.js +1 -0
- package/dist/solana.d.mts +5 -0
- package/dist/solana.d.ts +5 -0
- package/dist/solana.js +1 -0
- package/dist/solana.mjs +1 -0
- package/dist/sui.d.mts +5 -0
- package/dist/sui.d.ts +5 -0
- package/dist/sui.js +1 -0
- package/dist/sui.mjs +1 -0
- package/dist/types-DexmJNke.d.mts +397 -0
- package/dist/types-DexmJNke.d.ts +397 -0
- package/dist/ui-16QpbEyG.js +1 -0
- package/dist/ui-BAYRtDQg.mjs +1 -0
- package/dist/useWaapAuth-BrqAhAn2.d.ts +246 -0
- package/dist/useWaapAuth-C5I7QqyW.d.mts +246 -0
- package/dist/useWaapAuth-DHIeb4yc.mjs +1 -0
- package/dist/useWaapAuth-Z_ONicYr.js +1 -0
- package/dist/walletconnect.d.mts +2 -0
- package/dist/walletconnect.d.ts +2 -0
- package/dist/walletconnect.js +1 -0
- package/dist/walletconnect.mjs +1 -0
- package/package.json +53 -18
|
@@ -0,0 +1,775 @@
|
|
|
1
|
+
import { C as RequestPermissionTokenResult, M as WaaPSessionProtection, S as RequestPermissionTokenParams, a as PermissionTokenQuery, b as CustomConfig, c as SilkEthereumProviderInterface, d as WaaPAccountStatus, h as WaaPWalletTargetOptions, i as PermissionTokenClearResult, n as InitSilkOptions, o as PermissionTokenStatus, p as WaaPSessionExtension, r as LoginResponse, v as AuthenticationMethod, x as ProjectConfig } from "./types-DexmJNke.mjs";
|
|
2
|
+
//#region src/lib/sui/types.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Sui chain identifiers.
|
|
5
|
+
*/
|
|
6
|
+
type SuiChain = 'sui:mainnet' | 'sui:testnet' | 'sui:devnet' | 'sui:localnet';
|
|
7
|
+
/**
|
|
8
|
+
* Sui account representation following Wallet Standard.
|
|
9
|
+
*/
|
|
10
|
+
interface SuiAccount {
|
|
11
|
+
/** Sui address (32 bytes, 0x-prefixed hex string) */
|
|
12
|
+
readonly address: string;
|
|
13
|
+
/** Compressed public key bytes (33 bytes for Secp256k1) */
|
|
14
|
+
readonly publicKey: Uint8Array;
|
|
15
|
+
/** Supported chains for this account */
|
|
16
|
+
readonly chains: readonly SuiChain[];
|
|
17
|
+
/** Supported features for this account */
|
|
18
|
+
readonly features: readonly string[];
|
|
19
|
+
/** Optional display label */
|
|
20
|
+
readonly label?: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Input for sui:signPersonalMessage feature.
|
|
24
|
+
*/
|
|
25
|
+
interface SuiSignPersonalMessageInput {
|
|
26
|
+
/** Message bytes to sign */
|
|
27
|
+
message: Uint8Array;
|
|
28
|
+
/** Account to sign with */
|
|
29
|
+
account: SuiAccount;
|
|
30
|
+
/** Optional chain identifier */
|
|
31
|
+
chain?: SuiChain;
|
|
32
|
+
/** Cancel the pending iframe request without changing wallet-standard payloads. */
|
|
33
|
+
signal?: AbortSignal;
|
|
34
|
+
/** SDK-side timeout for a non-interactive iframe request, in milliseconds. */
|
|
35
|
+
timeoutMs?: number;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Output from sui:signPersonalMessage feature.
|
|
39
|
+
*/
|
|
40
|
+
interface SuiSignPersonalMessageOutput {
|
|
41
|
+
/** Base64-encoded message bytes */
|
|
42
|
+
bytes: string;
|
|
43
|
+
/** Base64-encoded signature (98 bytes for Secp256k1) */
|
|
44
|
+
signature: string;
|
|
45
|
+
}
|
|
46
|
+
/** Bytes, base64 bytes, or a transaction-like object the runtime can build. */
|
|
47
|
+
type SuiTransactionInput = Uint8Array | readonly number[] | string | {
|
|
48
|
+
build?: (...args: any[]) => Promise<Uint8Array> | Uint8Array;
|
|
49
|
+
serialize?: (...args: any[]) => Promise<Uint8Array | string> | Uint8Array | string;
|
|
50
|
+
toJSON?: () => Promise<unknown> | unknown;
|
|
51
|
+
/**
|
|
52
|
+
* Present on some Mysten Transaction versions. WaaP only consumes it
|
|
53
|
+
* when it returns bytes; a transaction with build() remains valid when
|
|
54
|
+
* this method returns the SDK's structured transaction data.
|
|
55
|
+
*/
|
|
56
|
+
getData?: () => unknown;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Input for sui:signTransaction feature.
|
|
60
|
+
*/
|
|
61
|
+
interface SuiSignTransactionInput {
|
|
62
|
+
/** BCS bytes, base64 BCS, or a transaction-like object. */
|
|
63
|
+
transaction: SuiTransactionInput;
|
|
64
|
+
/** Account to sign with */
|
|
65
|
+
account: SuiAccount;
|
|
66
|
+
/** Optional chain identifier */
|
|
67
|
+
chain?: SuiChain;
|
|
68
|
+
signal?: AbortSignal;
|
|
69
|
+
timeoutMs?: number;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Output from sui:signTransaction feature.
|
|
73
|
+
*/
|
|
74
|
+
interface SuiSignTransactionOutput {
|
|
75
|
+
/** Base64-encoded transaction bytes */
|
|
76
|
+
bytes: string;
|
|
77
|
+
/** Base64-encoded signature */
|
|
78
|
+
signature: string;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Input for sui:signAndExecuteTransaction feature.
|
|
82
|
+
*/
|
|
83
|
+
interface SuiSignAndExecuteTransactionInput {
|
|
84
|
+
/** BCS bytes, base64 BCS, or a transaction-like object. */
|
|
85
|
+
transaction: SuiTransactionInput;
|
|
86
|
+
/** Account to sign with */
|
|
87
|
+
account: SuiAccount;
|
|
88
|
+
/** Optional chain identifier */
|
|
89
|
+
chain?: SuiChain;
|
|
90
|
+
/** Options for execution */
|
|
91
|
+
options?: unknown;
|
|
92
|
+
/** Request type */
|
|
93
|
+
requestType?: 'WaitForEffectsCert' | 'WaitForLocalExecution';
|
|
94
|
+
signal?: AbortSignal;
|
|
95
|
+
timeoutMs?: number;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Output from sui:signAndExecuteTransaction feature.
|
|
99
|
+
*/
|
|
100
|
+
interface SuiSignAndExecuteTransactionOutput {
|
|
101
|
+
digest: string;
|
|
102
|
+
effects?: unknown;
|
|
103
|
+
errors?: unknown[];
|
|
104
|
+
[key: string]: unknown;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Connect input options.
|
|
108
|
+
*/
|
|
109
|
+
interface SuiConnectInput {
|
|
110
|
+
/** If true, attempt silent connection without UI prompt */
|
|
111
|
+
silent?: boolean;
|
|
112
|
+
signal?: AbortSignal;
|
|
113
|
+
timeoutMs?: number;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Connect output with accounts.
|
|
117
|
+
*/
|
|
118
|
+
interface SuiConnectOutput {
|
|
119
|
+
/** Connected accounts */
|
|
120
|
+
accounts: readonly SuiAccount[];
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Input for legacy sui:signTransactionBlock feature.
|
|
124
|
+
*/
|
|
125
|
+
interface SuiSignTransactionBlockInput {
|
|
126
|
+
/** BCS-serialized transaction block bytes */
|
|
127
|
+
transactionBlock: Uint8Array;
|
|
128
|
+
/** Account to sign with */
|
|
129
|
+
account: SuiAccount;
|
|
130
|
+
/** Optional chain identifier */
|
|
131
|
+
chain?: SuiChain;
|
|
132
|
+
signal?: AbortSignal;
|
|
133
|
+
timeoutMs?: number;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Output for legacy sui:signTransactionBlock feature.
|
|
137
|
+
*/
|
|
138
|
+
interface SuiSignTransactionBlockOutput extends SuiSignTransactionOutput {}
|
|
139
|
+
/**
|
|
140
|
+
* Input for legacy sui:signAndExecuteTransactionBlock feature.
|
|
141
|
+
*/
|
|
142
|
+
interface SuiSignAndExecuteTransactionBlockInput {
|
|
143
|
+
/** BCS-serialized transaction block bytes */
|
|
144
|
+
transactionBlock: Uint8Array;
|
|
145
|
+
/** Account to sign with */
|
|
146
|
+
account: SuiAccount;
|
|
147
|
+
/** Optional chain identifier */
|
|
148
|
+
chain?: SuiChain;
|
|
149
|
+
/** Options for execution */
|
|
150
|
+
options?: unknown;
|
|
151
|
+
/** Request type */
|
|
152
|
+
requestType?: 'WaitForEffectsCert' | 'WaitForLocalExecution';
|
|
153
|
+
signal?: AbortSignal;
|
|
154
|
+
timeoutMs?: number;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Output for legacy sui:signAndExecuteTransactionBlock feature.
|
|
158
|
+
*/
|
|
159
|
+
interface SuiSignAndExecuteTransactionBlockOutput extends SuiSignAndExecuteTransactionOutput {}
|
|
160
|
+
/**
|
|
161
|
+
* Wallet change event properties.
|
|
162
|
+
*/
|
|
163
|
+
interface SuiWalletChangeProperties {
|
|
164
|
+
chains?: readonly SuiChain[];
|
|
165
|
+
accounts?: readonly SuiAccount[];
|
|
166
|
+
features?: Record<string, unknown>;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Event listener types.
|
|
170
|
+
*/
|
|
171
|
+
type SuiWalletEventListener = (properties: SuiWalletChangeProperties) => void;
|
|
172
|
+
/**
|
|
173
|
+
* Wallet icon type (data URL).
|
|
174
|
+
*/
|
|
175
|
+
type WalletIcon = `data:image/${'svg+xml' | 'webp' | 'png' | 'gif'};base64,${string}`;
|
|
176
|
+
/**
|
|
177
|
+
* Wallet Standard features object.
|
|
178
|
+
*/
|
|
179
|
+
interface WaaPSuiWalletFeatures {
|
|
180
|
+
'standard:connect': {
|
|
181
|
+
version: '1.0.0';
|
|
182
|
+
connect: (input?: SuiConnectInput) => Promise<SuiConnectOutput>;
|
|
183
|
+
};
|
|
184
|
+
'standard:disconnect': {
|
|
185
|
+
version: '1.0.0';
|
|
186
|
+
disconnect: () => Promise<void>;
|
|
187
|
+
};
|
|
188
|
+
'standard:events': {
|
|
189
|
+
version: '1.0.0';
|
|
190
|
+
on: (event: 'change', listener: SuiWalletEventListener) => () => void;
|
|
191
|
+
};
|
|
192
|
+
'sui:signPersonalMessage': {
|
|
193
|
+
version: '1.1.0';
|
|
194
|
+
signPersonalMessage: (input: SuiSignPersonalMessageInput) => Promise<SuiSignPersonalMessageOutput>;
|
|
195
|
+
};
|
|
196
|
+
'sui:signTransaction': {
|
|
197
|
+
version: '2.0.0';
|
|
198
|
+
signTransaction: (input: SuiSignTransactionInput) => Promise<SuiSignTransactionOutput>;
|
|
199
|
+
};
|
|
200
|
+
'sui:switchChain': {
|
|
201
|
+
version: '1.0.0';
|
|
202
|
+
switchChain: (input: {
|
|
203
|
+
chain: SuiChain;
|
|
204
|
+
}) => Promise<void>;
|
|
205
|
+
};
|
|
206
|
+
'sui:signAndExecuteTransaction': {
|
|
207
|
+
version: '1.0.0';
|
|
208
|
+
signAndExecuteTransaction: (input: SuiSignAndExecuteTransactionInput) => Promise<SuiSignAndExecuteTransactionOutput>;
|
|
209
|
+
};
|
|
210
|
+
'sui:signTransactionBlock': {
|
|
211
|
+
version: '2.0.0';
|
|
212
|
+
signTransactionBlock: (input: SuiSignTransactionBlockInput) => Promise<SuiSignTransactionBlockOutput>;
|
|
213
|
+
};
|
|
214
|
+
'sui:signAndExecuteTransactionBlock': {
|
|
215
|
+
version: '1.0.0';
|
|
216
|
+
signAndExecuteTransactionBlock: (input: SuiSignAndExecuteTransactionBlockInput) => Promise<SuiSignAndExecuteTransactionBlockOutput>;
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* WaaP Sui Wallet interface.
|
|
221
|
+
*/
|
|
222
|
+
interface WaaPSuiWalletInterface {
|
|
223
|
+
/** Wallet name */
|
|
224
|
+
readonly name: string;
|
|
225
|
+
/** Wallet version */
|
|
226
|
+
readonly version: string;
|
|
227
|
+
/** Wallet icon */
|
|
228
|
+
readonly icon: WalletIcon;
|
|
229
|
+
/** Supported chains */
|
|
230
|
+
readonly chains: readonly SuiChain[];
|
|
231
|
+
/** Connected accounts */
|
|
232
|
+
readonly accounts: readonly SuiAccount[];
|
|
233
|
+
/** Public-safe local connection status for this facade. */
|
|
234
|
+
getAccountStatus(): WaaPAccountStatus;
|
|
235
|
+
session: WaaPSessionExtension;
|
|
236
|
+
/** Wallet Standard features */
|
|
237
|
+
readonly features: WaaPSuiWalletFeatures;
|
|
238
|
+
/**
|
|
239
|
+
* Connect to the wallet.
|
|
240
|
+
*/
|
|
241
|
+
connect(input?: SuiConnectInput): Promise<SuiConnectOutput>;
|
|
242
|
+
/** Open the WaaP login flow without connecting this chain facade. */
|
|
243
|
+
login(): Promise<LoginResponse>;
|
|
244
|
+
/** End the WaaP session without implying a chain disconnect is a logout. */
|
|
245
|
+
logout(): Promise<void>;
|
|
246
|
+
getLoginMethod(): LoginResponse;
|
|
247
|
+
/**
|
|
248
|
+
* Disconnect from the wallet.
|
|
249
|
+
*/
|
|
250
|
+
disconnect(): Promise<void>;
|
|
251
|
+
/** Release SDK message listeners owned by this Sui facade. */
|
|
252
|
+
destroy(): void;
|
|
253
|
+
/** Mount (if deferred) and complete the wallet handshake ahead of use. */
|
|
254
|
+
preload(): Promise<void>;
|
|
255
|
+
/**
|
|
256
|
+
* Switch the active chain.
|
|
257
|
+
*/
|
|
258
|
+
switchChain(input: {
|
|
259
|
+
chain: SuiChain;
|
|
260
|
+
}): Promise<void>;
|
|
261
|
+
/**
|
|
262
|
+
* Sign a personal message.
|
|
263
|
+
*/
|
|
264
|
+
signPersonalMessage(input: SuiSignPersonalMessageInput): Promise<SuiSignPersonalMessageOutput>;
|
|
265
|
+
/**
|
|
266
|
+
* Sign a BCS-serialized transaction without broadcasting it.
|
|
267
|
+
*/
|
|
268
|
+
signTransaction(input: SuiSignTransactionInput): Promise<SuiSignTransactionOutput>;
|
|
269
|
+
/**
|
|
270
|
+
* Sign and execute a transaction.
|
|
271
|
+
*/
|
|
272
|
+
signAndExecuteTransaction(input: SuiSignAndExecuteTransactionInput): Promise<SuiSignAndExecuteTransactionOutput>;
|
|
273
|
+
/**
|
|
274
|
+
* Sign a transaction block (Legacy).
|
|
275
|
+
*/
|
|
276
|
+
signTransactionBlock(input: SuiSignTransactionBlockInput): Promise<SuiSignTransactionBlockOutput>;
|
|
277
|
+
/**
|
|
278
|
+
* Sign and execute a transaction block (Legacy).
|
|
279
|
+
*/
|
|
280
|
+
signAndExecuteTransactionBlock(input: SuiSignAndExecuteTransactionBlockInput): Promise<SuiSignAndExecuteTransactionBlockOutput>;
|
|
281
|
+
/**
|
|
282
|
+
* Subscribe to wallet events. Supports the Wallet-Standard `change` event
|
|
283
|
+
* plus EVM-style `connect` / `accountsChanged` (so cross-chain hooks like
|
|
284
|
+
* `useWaapAuth` can subscribe to any facade uniformly).
|
|
285
|
+
* @returns Unsubscribe function
|
|
286
|
+
*/
|
|
287
|
+
on(event: 'change', listener: SuiWalletEventListener): () => void;
|
|
288
|
+
on(event: string, listener: (...args: any[]) => void): () => void;
|
|
289
|
+
/** Remove a `connect` / `accountsChanged` listener. */
|
|
290
|
+
removeListener(event: string, listener: (...args: any[]) => void): void;
|
|
291
|
+
/** custom WaaP features */
|
|
292
|
+
/**
|
|
293
|
+
* Request the user's email address.
|
|
294
|
+
* @returns Promise resolving to the user's email address
|
|
295
|
+
*/
|
|
296
|
+
requestEmail(): Promise<string>;
|
|
297
|
+
/**
|
|
298
|
+
* Request a Permission Token from the user.
|
|
299
|
+
* Allows pre-authorised batches of Sui transactions without individual confirmations.
|
|
300
|
+
*
|
|
301
|
+
* @param params - Allowed addresses, chainId (e.g. "sui:mainnet"), spend limit, expiry
|
|
302
|
+
* @returns Promise resolving to a RequestPermissionTokenResult
|
|
303
|
+
*/
|
|
304
|
+
requestPermissionToken(params: RequestPermissionTokenParams): Promise<RequestPermissionTokenResult>;
|
|
305
|
+
getPermissionTokenStatus(query: PermissionTokenQuery): Promise<PermissionTokenStatus>;
|
|
306
|
+
clearPermissionToken(query: PermissionTokenQuery): Promise<PermissionTokenClearResult>;
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Sui-supported authentication methods (no 'wallet/walletconnect' support yet)
|
|
310
|
+
* Also it is not necessary as @mysten/dapp-kit handles wallet choices
|
|
311
|
+
* todo: maybe add a modal to list out Sui wallets discovered as per Wallet Standard
|
|
312
|
+
*/
|
|
313
|
+
type SuiAuthenticationMethod = Exclude<AuthenticationMethod, 'wallet'>;
|
|
314
|
+
/**
|
|
315
|
+
* Sui-specific custom configuration
|
|
316
|
+
*/
|
|
317
|
+
interface SuiCustomConfig extends Omit<CustomConfig, 'authenticationMethods'> {
|
|
318
|
+
authenticationMethods?: SuiAuthenticationMethod[];
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* Initialization options for WaaP Sui Wallet.
|
|
322
|
+
*/
|
|
323
|
+
interface InitWaaPSuiOptions extends WaaPWalletTargetOptions {
|
|
324
|
+
/** WaaP points referral code */
|
|
325
|
+
referralCode?: string;
|
|
326
|
+
/** WaaP project configuration */
|
|
327
|
+
project?: ProjectConfig;
|
|
328
|
+
/** WaaP custom UI configuration */
|
|
329
|
+
config?: SuiCustomConfig;
|
|
330
|
+
/** Wallet session transport; defaults to DPoP, with explicit bearer fallback. */
|
|
331
|
+
sessionProtection?: WaaPSessionProtection;
|
|
332
|
+
/**
|
|
333
|
+
* Defer iframe navigation until `preload()` or the first wallet operation.
|
|
334
|
+
* The default warms the iframe at browser idle; pass `false` to mount eagerly.
|
|
335
|
+
*/
|
|
336
|
+
deferIframe?: boolean;
|
|
337
|
+
}
|
|
338
|
+
//#endregion
|
|
339
|
+
//#region src/lib/solana/types.d.ts
|
|
340
|
+
/** A Solana cluster identifier (CAIP-2-ish, matching wallet-adapter usage). */
|
|
341
|
+
type SolanaChain = 'solana:mainnet' | 'solana:devnet' | 'solana:testnet' | 'solana:localnet';
|
|
342
|
+
/** A connected Solana account. */
|
|
343
|
+
interface SolanaAccount {
|
|
344
|
+
/** base58-encoded address. */
|
|
345
|
+
address: string;
|
|
346
|
+
/** Raw 32-byte ed25519 public key. */
|
|
347
|
+
publicKey: Uint8Array;
|
|
348
|
+
chains: readonly SolanaChain[];
|
|
349
|
+
features: readonly `${string}:${string}`[];
|
|
350
|
+
}
|
|
351
|
+
/** Public Wallet Standard features supported by the WaaP Solana wallet. */
|
|
352
|
+
type WaaPSolanaWalletFeatures = {
|
|
353
|
+
'standard:connect': {
|
|
354
|
+
version: '1.0.0';
|
|
355
|
+
connect: (input?: {
|
|
356
|
+
silent?: boolean;
|
|
357
|
+
}) => Promise<SolanaConnectOutput>;
|
|
358
|
+
};
|
|
359
|
+
'standard:disconnect': {
|
|
360
|
+
version: '1.0.0';
|
|
361
|
+
disconnect: () => Promise<void>;
|
|
362
|
+
};
|
|
363
|
+
'standard:events': {
|
|
364
|
+
version: '1.0.0';
|
|
365
|
+
on: (event: 'change', listener: SolanaWalletEventListener) => () => void;
|
|
366
|
+
};
|
|
367
|
+
'solana:signMessage': {
|
|
368
|
+
version: '1.1.0';
|
|
369
|
+
signMessage: (...inputs: readonly SolanaStandardSignMessageInput[]) => Promise<readonly SolanaStandardSignMessageOutput[]>;
|
|
370
|
+
};
|
|
371
|
+
'solana:signTransaction': {
|
|
372
|
+
version: '1.0.0';
|
|
373
|
+
supportedTransactionVersions: readonly ('legacy' | 0)[];
|
|
374
|
+
signTransaction: (...inputs: readonly SolanaStandardSignTransactionInput[]) => Promise<readonly SolanaStandardSignTransactionOutput[]>;
|
|
375
|
+
};
|
|
376
|
+
'solana:signAndSendTransaction': {
|
|
377
|
+
version: '1.0.0';
|
|
378
|
+
supportedTransactionVersions: readonly ('legacy' | 0)[];
|
|
379
|
+
signAndSendTransaction: (...inputs: readonly SolanaStandardSignAndSendTransactionInput[]) => Promise<readonly SolanaStandardSignAndSendTransactionOutput[]>;
|
|
380
|
+
};
|
|
381
|
+
};
|
|
382
|
+
/** Solana Wallet Standard's variadic message-signing input. */
|
|
383
|
+
interface SolanaStandardSignMessageInput {
|
|
384
|
+
account: SolanaAccount;
|
|
385
|
+
message: Uint8Array;
|
|
386
|
+
}
|
|
387
|
+
interface SolanaStandardSignMessageOutput {
|
|
388
|
+
signedMessage: Uint8Array;
|
|
389
|
+
signature: Uint8Array;
|
|
390
|
+
signatureType?: 'ed25519';
|
|
391
|
+
}
|
|
392
|
+
/** Solana Wallet Standard's serialized-transaction signing input. */
|
|
393
|
+
interface SolanaStandardSignTransactionInput {
|
|
394
|
+
account: SolanaAccount;
|
|
395
|
+
transaction: Uint8Array;
|
|
396
|
+
chain?: SolanaChain;
|
|
397
|
+
options?: {
|
|
398
|
+
preflightCommitment?: 'processed' | 'confirmed' | 'finalized';
|
|
399
|
+
minContextSlot?: number;
|
|
400
|
+
};
|
|
401
|
+
}
|
|
402
|
+
interface SolanaStandardSignTransactionOutput {
|
|
403
|
+
signedTransaction: Uint8Array;
|
|
404
|
+
}
|
|
405
|
+
interface SolanaStandardSignAndSendTransactionInput extends SolanaStandardSignTransactionInput {
|
|
406
|
+
chain: SolanaChain;
|
|
407
|
+
options?: SolanaStandardSignTransactionInput['options'] & {
|
|
408
|
+
commitment?: 'processed' | 'confirmed' | 'finalized';
|
|
409
|
+
skipPreflight?: boolean;
|
|
410
|
+
maxRetries?: number;
|
|
411
|
+
};
|
|
412
|
+
}
|
|
413
|
+
interface SolanaStandardSignAndSendTransactionOutput {
|
|
414
|
+
signature: Uint8Array;
|
|
415
|
+
}
|
|
416
|
+
interface SolanaConnectInput {
|
|
417
|
+
/** Silent (non-interactive) reconnect. */
|
|
418
|
+
silent?: boolean;
|
|
419
|
+
signal?: AbortSignal;
|
|
420
|
+
timeoutMs?: number;
|
|
421
|
+
}
|
|
422
|
+
interface SolanaConnectOutput {
|
|
423
|
+
accounts: readonly SolanaAccount[];
|
|
424
|
+
}
|
|
425
|
+
interface SolanaSignMessageInput {
|
|
426
|
+
message: Uint8Array;
|
|
427
|
+
account: SolanaAccount;
|
|
428
|
+
signal?: AbortSignal;
|
|
429
|
+
timeoutMs?: number;
|
|
430
|
+
}
|
|
431
|
+
interface SolanaSignMessageOutput {
|
|
432
|
+
/** The message that was signed. */
|
|
433
|
+
signedMessage: Uint8Array;
|
|
434
|
+
/** The 64-byte ed25519 signature. */
|
|
435
|
+
signature: Uint8Array;
|
|
436
|
+
}
|
|
437
|
+
interface SolanaSignTransactionInput {
|
|
438
|
+
/** A serialized VersionedTransaction (bytes) or a `@solana/web3.js` tx object. */
|
|
439
|
+
transaction: Uint8Array | {
|
|
440
|
+
serialize(): Uint8Array;
|
|
441
|
+
};
|
|
442
|
+
account: SolanaAccount;
|
|
443
|
+
chain?: SolanaChain;
|
|
444
|
+
signal?: AbortSignal;
|
|
445
|
+
timeoutMs?: number;
|
|
446
|
+
/** Use a matching permission token when the wallet has one. */
|
|
447
|
+
withPT?: boolean;
|
|
448
|
+
}
|
|
449
|
+
interface SolanaSignTransactionOutput {
|
|
450
|
+
/** The signed, serialized transaction bytes. */
|
|
451
|
+
signedTransaction: Uint8Array;
|
|
452
|
+
/** The 64-byte ed25519 signature. */
|
|
453
|
+
signature: Uint8Array;
|
|
454
|
+
}
|
|
455
|
+
interface SolanaSignAndSendTransactionInput extends SolanaSignTransactionInput {
|
|
456
|
+
options?: {
|
|
457
|
+
skipPreflight?: boolean;
|
|
458
|
+
maxRetries?: number;
|
|
459
|
+
};
|
|
460
|
+
}
|
|
461
|
+
interface SolanaSignAndSendTransactionOutput {
|
|
462
|
+
/** base58 transaction signature (the on-chain txid). */
|
|
463
|
+
signature: string;
|
|
464
|
+
}
|
|
465
|
+
type SolanaWalletEventListener = (properties: {
|
|
466
|
+
chains?: readonly SolanaChain[];
|
|
467
|
+
features?: WaaPSolanaWalletFeatures;
|
|
468
|
+
accounts?: readonly SolanaAccount[];
|
|
469
|
+
}) => void;
|
|
470
|
+
interface InitWaaPSolanaOptions extends WaaPWalletTargetOptions {
|
|
471
|
+
referralCode?: string;
|
|
472
|
+
project?: ProjectConfig;
|
|
473
|
+
config?: CustomConfig;
|
|
474
|
+
/** Wallet session transport; defaults to DPoP, with explicit bearer fallback. */
|
|
475
|
+
sessionProtection?: WaaPSessionProtection;
|
|
476
|
+
/**
|
|
477
|
+
* Defer iframe navigation until `preload()` or the first wallet operation.
|
|
478
|
+
* The default warms the iframe at browser idle; pass `false` to mount eagerly.
|
|
479
|
+
*/
|
|
480
|
+
deferIframe?: boolean;
|
|
481
|
+
}
|
|
482
|
+
interface WaaPSolanaProviderInterface {
|
|
483
|
+
readonly name: string;
|
|
484
|
+
readonly version: string;
|
|
485
|
+
/** Wallet Standard icon data URI. */
|
|
486
|
+
readonly icon: `data:image/${'svg+xml' | 'webp' | 'png' | 'gif'};base64,${string}`;
|
|
487
|
+
readonly chains: readonly SolanaChain[];
|
|
488
|
+
readonly accounts: readonly SolanaAccount[];
|
|
489
|
+
/** Wallet Standard capabilities exposed by this Solana facade. */
|
|
490
|
+
readonly features: WaaPSolanaWalletFeatures;
|
|
491
|
+
/** Public-safe local connection status for this facade. */
|
|
492
|
+
getAccountStatus(): WaaPAccountStatus;
|
|
493
|
+
session: WaaPSessionExtension;
|
|
494
|
+
/** Open the WaaP login flow without connecting this chain facade. */
|
|
495
|
+
login(): Promise<LoginResponse>;
|
|
496
|
+
/** End the WaaP session without implying a chain disconnect is a logout. */
|
|
497
|
+
logout(): Promise<void>;
|
|
498
|
+
getLoginMethod(): LoginResponse;
|
|
499
|
+
connect(input?: SolanaConnectInput): Promise<SolanaConnectOutput>;
|
|
500
|
+
disconnect(): Promise<void>;
|
|
501
|
+
/** Release SDK message listeners owned by this Solana facade. */
|
|
502
|
+
destroy(): void;
|
|
503
|
+
/** Mount (if deferred) and complete the wallet handshake ahead of use. */
|
|
504
|
+
preload(): Promise<void>;
|
|
505
|
+
signMessage(input: SolanaSignMessageInput): Promise<SolanaSignMessageOutput>;
|
|
506
|
+
signTransaction(input: SolanaSignTransactionInput): Promise<SolanaSignTransactionOutput>;
|
|
507
|
+
signAndSendTransaction(input: SolanaSignAndSendTransactionInput): Promise<SolanaSignAndSendTransactionOutput>;
|
|
508
|
+
requestPermissionToken(params: RequestPermissionTokenParams): Promise<RequestPermissionTokenResult>;
|
|
509
|
+
getPermissionTokenStatus(query: PermissionTokenQuery): Promise<PermissionTokenStatus>;
|
|
510
|
+
clearPermissionToken(query: PermissionTokenQuery): Promise<PermissionTokenClearResult>;
|
|
511
|
+
/**
|
|
512
|
+
* Subscribe to wallet events. Supports `change` plus EVM-style `connect` /
|
|
513
|
+
* `accountsChanged` (so cross-chain hooks like `useWaapAuth` can subscribe to
|
|
514
|
+
* any facade uniformly).
|
|
515
|
+
* @returns Unsubscribe function
|
|
516
|
+
*/
|
|
517
|
+
on(event: 'change', listener: SolanaWalletEventListener): () => void;
|
|
518
|
+
on(event: string, listener: (...args: any[]) => void): () => void;
|
|
519
|
+
/** Remove a `connect` / `accountsChanged` listener. */
|
|
520
|
+
removeListener(event: string, listener: (...args: any[]) => void): void;
|
|
521
|
+
}
|
|
522
|
+
//#endregion
|
|
523
|
+
//#region src/ui/index.d.ts
|
|
524
|
+
/** Chain selected by a direct WaaP initializer. */
|
|
525
|
+
type WaaPChain = 'evm' | 'sui' | 'solana';
|
|
526
|
+
/**
|
|
527
|
+
* Shared options for the direct WaaP initializers.
|
|
528
|
+
*
|
|
529
|
+
* This deliberately has no chain selector so the published `2.0.0`
|
|
530
|
+
* `InitWaaPOptions` remains assignable to the legacy EVM overload.
|
|
531
|
+
*/
|
|
532
|
+
interface InitWaaPOptions extends Omit<InitWaaPSuiOptions, 'config'> {
|
|
533
|
+
/** Shared wallet configuration; EVM may additionally allow `wallet`. */
|
|
534
|
+
config?: InitSilkOptions['config'];
|
|
535
|
+
/** WalletConnect project ID (required only when offering the `wallet` auth method). */
|
|
536
|
+
walletConnectProjectId?: string;
|
|
537
|
+
/** Forwarded to the EVM provider: resolve eth_sendTransaction on tx-hash. */
|
|
538
|
+
asyncTxs?: boolean;
|
|
539
|
+
/** @deprecated Use `asyncTxs` instead. */
|
|
540
|
+
asyncSigning?: boolean;
|
|
541
|
+
}
|
|
542
|
+
/**
|
|
543
|
+
* `InitWaaPOptions` plus a direct native-chain selector.
|
|
544
|
+
*
|
|
545
|
+
* Omit `chain` to retain the published EVM EIP-1193 return type.
|
|
546
|
+
*/
|
|
547
|
+
interface InitWaaPChainOptions extends InitWaaPOptions {
|
|
548
|
+
chain?: WaaPChain;
|
|
549
|
+
}
|
|
550
|
+
type LegacyInitWaaPEvmOptions = InitWaaPOptions & {
|
|
551
|
+
chain?: 'evm';
|
|
552
|
+
};
|
|
553
|
+
type LegacyInitWaaPSuiOptions = Omit<InitWaaPChainOptions, 'chain' | 'config'> & {
|
|
554
|
+
chain: 'sui';
|
|
555
|
+
config?: InitWaaPSuiOptions['config'];
|
|
556
|
+
};
|
|
557
|
+
type LegacyInitWaaPSolanaOptions = InitWaaPChainOptions & {
|
|
558
|
+
chain: 'solana';
|
|
559
|
+
};
|
|
560
|
+
/**
|
|
561
|
+
* Initialize the TAP wallet.
|
|
562
|
+
*
|
|
563
|
+
* Existing `initWaaP(options)` calls retain their EVM provider behavior. Use
|
|
564
|
+
* `chain: 'sui'` or `chain: 'solana'` to select a direct Wallet Standard
|
|
565
|
+
* facade. Use `initWaaPMulti({ chains })` for a shared multichain wallet.
|
|
566
|
+
*/
|
|
567
|
+
declare function initWaaP(options?: LegacyInitWaaPEvmOptions): SilkEthereumProviderInterface;
|
|
568
|
+
declare function initWaaP(options: LegacyInitWaaPSuiOptions): WaaPSuiWalletInterface;
|
|
569
|
+
declare function initWaaP(options: LegacyInitWaaPSolanaOptions): WaaPSolanaProviderInterface;
|
|
570
|
+
/** Accepts a runtime-selected chain when callers cannot preserve a literal. */
|
|
571
|
+
declare function initWaaP(options: InitWaaPChainOptions): SilkEthereumProviderInterface | WaaPSuiWalletInterface | WaaPSolanaProviderInterface;
|
|
572
|
+
/**
|
|
573
|
+
* Options for the multichain `initWaaPSquid` entry point.
|
|
574
|
+
*
|
|
575
|
+
* "Squid" is the public brand name for WaaP's pre-created shared-dwallet
|
|
576
|
+
* signing (IKA LITE). It is NOT the deprecated per-user-DKG engine — the
|
|
577
|
+
* internals run exclusively through the lite flow.
|
|
578
|
+
*
|
|
579
|
+
* Extends the Sui options with the EVM-side `walletConnectProjectId` and
|
|
580
|
+
* `asyncTxs` — both are forwarded to the underlying EVM provider (they were
|
|
581
|
+
* previously dropped). `deferIframe` is supported across the shared facades;
|
|
582
|
+
* call `preload()` after the host application's LCP to warm it explicitly.
|
|
583
|
+
*/
|
|
584
|
+
interface InitWaaPSquidOptions extends InitWaaPSuiOptions {
|
|
585
|
+
/**
|
|
586
|
+
* Chain facades to expose. Defaults to all three Squid chains; this scopes
|
|
587
|
+
* SDK/UI loading, not the current dual-curve Squid provisioning transaction.
|
|
588
|
+
*/
|
|
589
|
+
chains?: readonly WaaPSquidChain[];
|
|
590
|
+
/** WalletConnect project ID (required only when offering the `wallet` auth method). */
|
|
591
|
+
walletConnectProjectId?: string;
|
|
592
|
+
/** Forwarded to the EVM provider: resolve eth_sendTransaction on tx-hash. */
|
|
593
|
+
asyncTxs?: boolean;
|
|
594
|
+
}
|
|
595
|
+
type WaaPSquidChain = 'evm' | 'sui' | 'solana';
|
|
596
|
+
declare const ALL_SQUID_CHAINS: readonly ["evm", "sui", "solana"];
|
|
597
|
+
/** Public, non-secret lifecycle of the two-curve Squid account. */
|
|
598
|
+
type WaaPSquidStatusState = 'absent' | 'provisioning' | 'awaiting-network' | 'active' | 'failed';
|
|
599
|
+
interface WaaPSquidStatus {
|
|
600
|
+
state: WaaPSquidStatusState;
|
|
601
|
+
/** Public create-transaction digest; usable as the current operation ID. */
|
|
602
|
+
operationId?: string;
|
|
603
|
+
transactionDigest?: string;
|
|
604
|
+
message?: string;
|
|
605
|
+
}
|
|
606
|
+
/**
|
|
607
|
+
* Options for the multichain TAP entry point.
|
|
608
|
+
*
|
|
609
|
+
* Unlike calling independent chain initializers, `initWaaPMulti({ chains })`
|
|
610
|
+
* makes their facades share one wallet iframe and one authenticated session.
|
|
611
|
+
* It is useful to applications which present all supported TAP chains in one
|
|
612
|
+
* surface, while `initWaaP({ chain: 'sui' })` remains the best choice for a
|
|
613
|
+
* single-chain integration.
|
|
614
|
+
*/
|
|
615
|
+
interface InitWaaPMultiOptions extends InitWaaPOptions {
|
|
616
|
+
/** Chain facades to expose from one shared wallet iframe. */
|
|
617
|
+
chains: readonly WaaPChain[];
|
|
618
|
+
}
|
|
619
|
+
/** @deprecated Use `InitWaaPMultiOptions`. */
|
|
620
|
+
type InitWaaPTapOptions = InitWaaPMultiOptions;
|
|
621
|
+
declare const ALL_TAP_CHAINS: readonly ["evm", "sui", "solana"];
|
|
622
|
+
type FacadeFor<Chains extends readonly WaaPSquidChain[], Chain extends WaaPSquidChain, Facade> = Chain extends Chains[number] ? Facade : Record<never, never>;
|
|
623
|
+
type LegacyAuthFor<Chains extends readonly WaaPSquidChain[]> = WaaPSquidChain extends Chains[number] ? {
|
|
624
|
+
/**
|
|
625
|
+
* @deprecated Use the chain-neutral `session` event surface instead.
|
|
626
|
+
* This EVM alias remains for all-chain integrations.
|
|
627
|
+
*/
|
|
628
|
+
auth: SilkEthereumProviderInterface;
|
|
629
|
+
} : Record<never, never>;
|
|
630
|
+
/** Chain-neutral authentication and lifecycle events for a Squid wallet. */
|
|
631
|
+
interface WaaPSquidSession extends WaaPSessionExtension {
|
|
632
|
+
/** Read the public Squid lifecycle from this shared SDK controller. */
|
|
633
|
+
getSquidStatus(): WaaPSquidStatus;
|
|
634
|
+
on(event: string, listener: (...args: any[]) => void): WaaPSquidSession;
|
|
635
|
+
removeListener(event: string, listener: (...args: any[]) => void): WaaPSquidSession;
|
|
636
|
+
}
|
|
637
|
+
/** Explicit Squid account lifecycle, separate from chain-specific facades. */
|
|
638
|
+
interface WaaPSquidLifecycle {
|
|
639
|
+
/** Create or restore the required Squid signing entries after login. */
|
|
640
|
+
onboard(): Promise<void>;
|
|
641
|
+
/** Read the current public lifecycle without exposing wallet internals. */
|
|
642
|
+
getStatus(): WaaPSquidStatus;
|
|
643
|
+
/** Trigger onboarding and return the immediately observable lifecycle. */
|
|
644
|
+
onboardWithStatus(): Promise<WaaPSquidStatus>;
|
|
645
|
+
}
|
|
646
|
+
/** Chain-neutral authentication and lifecycle events for a TAP wallet. */
|
|
647
|
+
interface WaaPTapSession extends WaaPSessionExtension {
|
|
648
|
+
on(event: string, listener: (...args: any[]) => void): WaaPTapSession;
|
|
649
|
+
removeListener(event: string, listener: (...args: any[]) => void): WaaPTapSession;
|
|
650
|
+
}
|
|
651
|
+
/**
|
|
652
|
+
* The multichain surface returned by `initWaaPMulti({ chains })`.
|
|
653
|
+
*
|
|
654
|
+
* All selected facades use one wallet iframe, so a single login establishes
|
|
655
|
+
* the session consumed by EVM, Sui, and Solana. TAP does not have a separate
|
|
656
|
+
* provisioning step; connect and sign through the requested native facade.
|
|
657
|
+
*/
|
|
658
|
+
type WaaPTap<Chains extends readonly WaaPChain[] = typeof ALL_TAP_CHAINS> = {
|
|
659
|
+
/** Combined public-safe local status for the shared TAP initializer. */
|
|
660
|
+
getAccountStatus: () => WaaPAccountStatus;
|
|
661
|
+
/** Shared canonical authentication, status, and lifecycle event surface. */
|
|
662
|
+
session: WaaPTapSession;
|
|
663
|
+
/** Mount (if deferred) and complete the shared iframe handshake. */
|
|
664
|
+
preload: () => Promise<void>;
|
|
665
|
+
/** Release all facades and their shared wallet iframe. */
|
|
666
|
+
destroy: () => void;
|
|
667
|
+
} & FacadeFor<Chains, 'evm', {
|
|
668
|
+
/** EIP-1193 provider (EVM). */ evm: SilkEthereumProviderInterface;
|
|
669
|
+
/** @deprecated Use `evm`. */ ethereum: SilkEthereumProviderInterface;
|
|
670
|
+
}> & FacadeFor<Chains, 'sui', {
|
|
671
|
+
sui: WaaPSuiWalletInterface;
|
|
672
|
+
}> & FacadeFor<Chains, 'solana', {
|
|
673
|
+
/** Solana Wallet Standard adapter. */ solana: WaaPSolanaProviderInterface;
|
|
674
|
+
}>;
|
|
675
|
+
/**
|
|
676
|
+
* The multichain surface returned by `initWaaPSquid`.
|
|
677
|
+
*
|
|
678
|
+
* All three chain facades share ONE wallet iframe. Squid account creation is
|
|
679
|
+
* explicit: call `onboard()` after login. Initialization and login alone never
|
|
680
|
+
* create a shared-DWallet account.
|
|
681
|
+
*
|
|
682
|
+
* ### Events
|
|
683
|
+
* All three facades emit `connect` and `accountsChanged` on a successful
|
|
684
|
+
* (non-silent) `connect()`/`login()`, so `useWaapAuth` and similar hooks work
|
|
685
|
+
* against any of them. The Sui/Solana facades additionally emit the
|
|
686
|
+
* Wallet-Standard `change` event; subscribe with `.on(event, listener)` and
|
|
687
|
+
* unsubscribe via the returned fn or `.removeListener(event, listener)`.
|
|
688
|
+
*
|
|
689
|
+
* ### Error style
|
|
690
|
+
* - `ethereum` follows EIP-1193: rejected requests surface the provider error
|
|
691
|
+
* object (`{ code, message, ... }`) per spec — match on `error.code`.
|
|
692
|
+
* - `sui` / `solana` throw `WaaPError` at the iframe transport boundary. Its
|
|
693
|
+
* stable `code` and optional operation metadata make cancellation, timeout,
|
|
694
|
+
* user/policy rejection, and wallet errors safe to handle programmatically.
|
|
695
|
+
*/
|
|
696
|
+
type WaaPSquid<Chains extends readonly WaaPSquidChain[] = typeof ALL_SQUID_CHAINS> = {
|
|
697
|
+
/**
|
|
698
|
+
* Explicitly create or restore the Squid account for both curves. Call this
|
|
699
|
+
* after login and before connecting or signing through a Squid facade.
|
|
700
|
+
*/
|
|
701
|
+
onboard: () => Promise<void>;
|
|
702
|
+
/** Preferred explicit owner of Squid onboarding. */
|
|
703
|
+
squid: WaaPSquidLifecycle;
|
|
704
|
+
/** Read the lifecycle of the two-curve Squid account. */
|
|
705
|
+
getSquidStatus: () => WaaPSquidStatus;
|
|
706
|
+
/** Combined public-safe local status for the one Squid initializer family. */
|
|
707
|
+
getAccountStatus: () => WaaPAccountStatus;
|
|
708
|
+
/** Shared canonical authentication, status, and lifecycle event surface. */
|
|
709
|
+
session: WaaPSquidSession;
|
|
710
|
+
/** Mount (if deferred) and complete the shared iframe handshake. */
|
|
711
|
+
preload: () => Promise<void>;
|
|
712
|
+
/** Release all three facades and their shared wallet iframe. */
|
|
713
|
+
destroy: () => void;
|
|
714
|
+
} & FacadeFor<Chains, 'evm', {
|
|
715
|
+
/** EIP-1193 provider (EVM). */ evm: SilkEthereumProviderInterface;
|
|
716
|
+
/** @deprecated Use `evm`. */ ethereum: SilkEthereumProviderInterface;
|
|
717
|
+
}> & FacadeFor<Chains, 'sui', {
|
|
718
|
+
sui: WaaPSuiWalletInterface;
|
|
719
|
+
}> & FacadeFor<Chains, 'solana', {
|
|
720
|
+
/** Solana Wallet Standard adapter. */ solana: WaaPSolanaProviderInterface;
|
|
721
|
+
}> & LegacyAuthFor<Chains>;
|
|
722
|
+
/**
|
|
723
|
+
* Initialize the multichain WaaP "Squid" wallet (EVM + Sui + Solana).
|
|
724
|
+
*
|
|
725
|
+
* Creates a single wallet iframe and returns the chain facades plus an
|
|
726
|
+
* `onboard()` trigger. Internals use the Lite protocol core
|
|
727
|
+
* (`@human.tech/ika-lite`) through the wallet's Squid adapter and `signLite` —
|
|
728
|
+
* never the deprecated per-user-DKG engine.
|
|
729
|
+
*
|
|
730
|
+
* @example
|
|
731
|
+
* ```ts
|
|
732
|
+
* const waap = initWaaPSquid({ chains: ['evm', 'sui'] })
|
|
733
|
+
* await waap.session.login()
|
|
734
|
+
* await waap.squid.onboard() // explicit create/restore for sqd1 + sqd2
|
|
735
|
+
* const { accounts } = await waap.sui.connect()
|
|
736
|
+
* ```
|
|
737
|
+
*/
|
|
738
|
+
declare function initWaaPSquid<const Chains extends readonly WaaPSquidChain[]>(options: InitWaaPSquidOptions & {
|
|
739
|
+
chains: Chains;
|
|
740
|
+
}): WaaPSquid<Chains>;
|
|
741
|
+
declare function initWaaPSquid(options?: InitWaaPSquidOptions): WaaPSquid;
|
|
742
|
+
/**
|
|
743
|
+
* Initialize a shared multichain TAP wallet. TAP accounts are restored by the
|
|
744
|
+
* normal authenticated wallet session.
|
|
745
|
+
*
|
|
746
|
+
* @example
|
|
747
|
+
* ```ts
|
|
748
|
+
* const waap = initWaaPMulti({ chains: ['evm', 'sui', 'solana'] })
|
|
749
|
+
* await waap.session.login()
|
|
750
|
+
* const { accounts } = await waap.sui.connect()
|
|
751
|
+
* ```
|
|
752
|
+
*/
|
|
753
|
+
declare function initWaaPMulti<const Chains extends readonly WaaPChain[]>(options: InitWaaPMultiOptions & {
|
|
754
|
+
chains: Chains;
|
|
755
|
+
}): WaaPTap<Chains>;
|
|
756
|
+
/**
|
|
757
|
+
* @deprecated Use `initWaaP({ chain: 'sui' })` instead.
|
|
758
|
+
*
|
|
759
|
+
* This compatibility wrapper keeps the standalone Sui Wallet Standard return
|
|
760
|
+
* shape while routing through the one TAP composition path.
|
|
761
|
+
*/
|
|
762
|
+
declare function initWaaPSui(options?: InitWaaPSuiOptions): WaaPSuiWalletInterface;
|
|
763
|
+
/**
|
|
764
|
+
* @deprecated Use `initWaaP({ chain: 'solana' })` instead.
|
|
765
|
+
*
|
|
766
|
+
* Keeps the legacy standalone Wallet Standard return shape for existing apps.
|
|
767
|
+
*/
|
|
768
|
+
declare function initWaaPSolana(options?: InitWaaPSolanaOptions): WaaPSolanaProviderInterface;
|
|
769
|
+
/** @deprecated Use `initWaaPMulti({ chains })` instead. */
|
|
770
|
+
declare function initWaaPTap<const Chains extends readonly WaaPChain[]>(options: InitWaaPTapOptions & {
|
|
771
|
+
chains: Chains;
|
|
772
|
+
}): WaaPTap<Chains>;
|
|
773
|
+
declare function initWaaPTap(options?: Partial<InitWaaPTapOptions>): WaaPTap;
|
|
774
|
+
//#endregion
|
|
775
|
+
export { SuiSignTransactionBlockOutput as $, SolanaSignTransactionInput as A, WaaPSolanaWalletFeatures as B, SolanaChain as C, SolanaSignAndSendTransactionOutput as D, SolanaSignAndSendTransactionInput as E, SolanaStandardSignMessageOutput as F, SuiConnectOutput as G, SuiAccount as H, SolanaStandardSignTransactionInput as I, SuiSignAndExecuteTransactionInput as J, SuiSignAndExecuteTransactionBlockInput as K, SolanaStandardSignTransactionOutput as L, SolanaStandardSignAndSendTransactionInput as M, SolanaStandardSignAndSendTransactionOutput as N, SolanaSignMessageInput as O, SolanaStandardSignMessageInput as P, SuiSignTransactionBlockInput as Q, SolanaWalletEventListener as R, SolanaAccount as S, SolanaConnectOutput as T, SuiChain as U, InitWaaPSuiOptions as V, SuiConnectInput as W, SuiSignPersonalMessageInput as X, SuiSignAndExecuteTransactionOutput as Y, SuiSignPersonalMessageOutput as Z, initWaaPSolana as _, InitWaaPTapOptions as a, WaaPSuiWalletInterface as at, initWaaPTap as b, WaaPSquidChain as c, WaaPSquidStatus as d, SuiSignTransactionInput as et, WaaPSquidStatusState as f, initWaaPMulti as g, initWaaP as h, InitWaaPSquidOptions as i, WaaPSuiWalletFeatures as it, SolanaSignTransactionOutput as j, SolanaSignMessageOutput as k, WaaPSquidLifecycle as l, WaaPTapSession as m, InitWaaPMultiOptions as n, SuiTransactionInput as nt, WaaPChain as o, WalletIcon as ot, WaaPTap as p, SuiSignAndExecuteTransactionBlockOutput as q, InitWaaPOptions as r, SuiWalletEventListener as rt, WaaPSquid as s, InitWaaPChainOptions as t, SuiSignTransactionOutput as tt, WaaPSquidSession as u, initWaaPSquid as v, SolanaConnectInput as w, InitWaaPSolanaOptions as x, initWaaPSui as y, WaaPSolanaProviderInterface as z };
|