@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,397 @@
|
|
|
1
|
+
//#region ../silk-interface-core/dist/esm/messages/index.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Method names for request and response messages
|
|
4
|
+
*/
|
|
5
|
+
declare enum SILK_METHOD {
|
|
6
|
+
eth_requestAccounts = "eth_requestAccounts" // https://eips.ethereum.org/EIPS/eip-1102
|
|
7
|
+
,
|
|
8
|
+
eth_accounts = "eth_accounts",
|
|
9
|
+
eth_sendTransaction = "eth_sendTransaction",
|
|
10
|
+
eth_signTransaction = "eth_signTransaction",
|
|
11
|
+
eth_getBalance = "eth_getBalance",
|
|
12
|
+
personal_sign = "personal_sign",
|
|
13
|
+
eth_signTypedData_v4 = "eth_signTypedData_v4",
|
|
14
|
+
eth_chainId = "eth_chainId",
|
|
15
|
+
net_version = "net_version",
|
|
16
|
+
wallet_switchEthereumChain = "wallet_switchEthereumChain",
|
|
17
|
+
wallet_addEthereumChain = "wallet_addEthereumChain",
|
|
18
|
+
eth_estimateGas = "eth_estimateGas",
|
|
19
|
+
eth_blockNumber = "eth_blockNumber",
|
|
20
|
+
eth_getCode = "eth_getCode",
|
|
21
|
+
eth_call = "eth_call",
|
|
22
|
+
eth_getTransactionReceipt = "eth_getTransactionReceipt",
|
|
23
|
+
eth_getTransactionByHash = "eth_getTransactionByHash",
|
|
24
|
+
eth_accountsChanged = "eth_accountsChanged",
|
|
25
|
+
sui_connect = "sui_connect",
|
|
26
|
+
sui_disconnect = "sui_disconnect",
|
|
27
|
+
sui_getAccounts = "sui_getAccounts",
|
|
28
|
+
sui_signPersonalMessage = "sui_signPersonalMessage",
|
|
29
|
+
sui_signTransaction = "sui_signTransaction",
|
|
30
|
+
sui_signAndExecuteTransaction = "sui_signAndExecuteTransaction",
|
|
31
|
+
sui_switchChain = "sui_switchChain",
|
|
32
|
+
show_modal = "show_modal",
|
|
33
|
+
hide_modal = "hide_modal",
|
|
34
|
+
login = "login",
|
|
35
|
+
auto_conn = "auto_conn",
|
|
36
|
+
logout = "logout",
|
|
37
|
+
set_points_referral_code = "set_points_referral_code",
|
|
38
|
+
set_project = "set_project",
|
|
39
|
+
silk_requestEmail = "silk_requestEmail",
|
|
40
|
+
silk_requestSbt = "silk_requestSbt",
|
|
41
|
+
set_custom_config = "set_custom_config",
|
|
42
|
+
safe = "safe",
|
|
43
|
+
set_is_mobile = "set_is_mobile",
|
|
44
|
+
project_init = "project_init",
|
|
45
|
+
gastank_get_settings = "gastank_get_settings",
|
|
46
|
+
gastank_update_settings = "gastank_update_settings",
|
|
47
|
+
gastank_topup = "gastank_topup",
|
|
48
|
+
customization_get = "customization_get",
|
|
49
|
+
customization_update = "customization_update",
|
|
50
|
+
orcid = "orcid",
|
|
51
|
+
waap_requestPermissionToken = "waap_requestPermissionToken",
|
|
52
|
+
waap_getAccountStatus = "waap_getAccountStatus",
|
|
53
|
+
waap_getPermissionTokenStatus = "waap_getPermissionTokenStatus",
|
|
54
|
+
waap_clearPermissionToken = "waap_clearPermissionToken",
|
|
55
|
+
solana_connect = "solana_connect",
|
|
56
|
+
solana_disconnect = "solana_disconnect",
|
|
57
|
+
solana_signMessage = "solana_signMessage",
|
|
58
|
+
solana_signTransaction = "solana_signTransaction",
|
|
59
|
+
solana_signAllTransactions = "solana_signAllTransactions",
|
|
60
|
+
solana_signAndSendTransaction = "solana_signAndSendTransaction",
|
|
61
|
+
set_signing_mode = "set_signing_mode",
|
|
62
|
+
enter_lite_mode = "enter_lite_mode"
|
|
63
|
+
}
|
|
64
|
+
/** Portable-session protection selected by a current WaaP SDK integration. */
|
|
65
|
+
type WaaPSessionProtection = 'bearer' | 'dpop';
|
|
66
|
+
declare enum JSON_RPC_METHOD {
|
|
67
|
+
eth_requestAccounts = "eth_requestAccounts",
|
|
68
|
+
eth_accounts = "eth_accounts",
|
|
69
|
+
eth_sendTransaction = "eth_sendTransaction",
|
|
70
|
+
eth_signTransaction = "eth_signTransaction",
|
|
71
|
+
eth_getBalance = "eth_getBalance",
|
|
72
|
+
personal_sign = "personal_sign",
|
|
73
|
+
eth_signTypedData_v4 = "eth_signTypedData_v4",
|
|
74
|
+
eth_chainId = "eth_chainId",
|
|
75
|
+
net_version = "net_version",
|
|
76
|
+
wallet_switchEthereumChain = "wallet_switchEthereumChain",
|
|
77
|
+
wallet_addEthereumChain = "wallet_addEthereumChain",
|
|
78
|
+
eth_estimateGas = "eth_estimateGas",
|
|
79
|
+
eth_blockNumber = "eth_blockNumber",
|
|
80
|
+
eth_getCode = "eth_getCode",
|
|
81
|
+
eth_call = "eth_call",
|
|
82
|
+
eth_getTransactionReceipt = "eth_getTransactionReceipt",
|
|
83
|
+
eth_getTransactionByHash = "eth_getTransactionByHash"
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Notification names
|
|
87
|
+
*/
|
|
88
|
+
declare enum SILK_NOTIFICATION {
|
|
89
|
+
ready = "ready",
|
|
90
|
+
connect = "connect",
|
|
91
|
+
account_changed = "account_changed",
|
|
92
|
+
mobile_oauth_success = "mobile_oauth_success",
|
|
93
|
+
mobile_oauth_error = "mobile_oauth_error",
|
|
94
|
+
tx_pending = "waap_txPending",
|
|
95
|
+
tx_2fa_required = "waap_tx2faRequired",
|
|
96
|
+
tx_signed = "waap_txSigned",
|
|
97
|
+
tx_confirmed = "waap_txConfirmed",
|
|
98
|
+
tx_failed = "waap_txFailed",
|
|
99
|
+
squid_pending = "waap_squid_pending",
|
|
100
|
+
squid_ready = "waap_squid_ready",
|
|
101
|
+
squid_failed = "waap_squid_failed",
|
|
102
|
+
request_cancel = "waap_requestCancel"
|
|
103
|
+
}
|
|
104
|
+
type SilkNotificationData = keyof typeof SILK_NOTIFICATION;
|
|
105
|
+
//#endregion
|
|
106
|
+
//#region ../silk-interface-core/dist/esm/index.d.ts
|
|
107
|
+
type SilkMessage = {
|
|
108
|
+
target: 'silk';
|
|
109
|
+
};
|
|
110
|
+
type SilkRequest = SilkMessage & {
|
|
111
|
+
id: string;
|
|
112
|
+
messageType: 'request';
|
|
113
|
+
method: keyof typeof SILK_METHOD;
|
|
114
|
+
params: any[];
|
|
115
|
+
interactionRequired?: boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Transaction behavior options.
|
|
118
|
+
* `async` enables async transaction mode for eth_sendTransaction.
|
|
119
|
+
*/
|
|
120
|
+
silkOptions?: {
|
|
121
|
+
async?: boolean;
|
|
122
|
+
/** @deprecated Use `async` instead. Kept for v1 SDK backward compatibility. */
|
|
123
|
+
asyncSigning?: boolean;
|
|
124
|
+
is2FARequest?: boolean;
|
|
125
|
+
withPT?: boolean;
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
type AuthenticationMethod = 'email' | 'phone' | 'social' | 'biometrics' | 'wallet';
|
|
129
|
+
type SocialProvider = 'discord' | 'github' | 'google' | 'twitter' | 'bluesky' | 'telegram';
|
|
130
|
+
interface ProjectConfig {
|
|
131
|
+
name?: string;
|
|
132
|
+
entryTitle?: string;
|
|
133
|
+
logo?: string;
|
|
134
|
+
projectId?: string;
|
|
135
|
+
termsOfServiceUrl?: string;
|
|
136
|
+
privacyPolicyUrl?: string;
|
|
137
|
+
authSuccessUrl?: string;
|
|
138
|
+
authErrorUrl?: string;
|
|
139
|
+
emailLogoCid?: string;
|
|
140
|
+
appId?: string;
|
|
141
|
+
nativeRedirect?: string;
|
|
142
|
+
universalRedirect?: string;
|
|
143
|
+
}
|
|
144
|
+
interface StylesConfig {
|
|
145
|
+
darkMode?: boolean;
|
|
146
|
+
}
|
|
147
|
+
interface CustomConfig {
|
|
148
|
+
authenticationMethods?: AuthenticationMethod[];
|
|
149
|
+
allowedSocials?: SocialProvider[];
|
|
150
|
+
styles?: StylesConfig;
|
|
151
|
+
showSecured?: boolean;
|
|
152
|
+
}
|
|
153
|
+
type BaseSilkResponse = SilkMessage & {
|
|
154
|
+
id: string;
|
|
155
|
+
messageType: 'response';
|
|
156
|
+
method: string;
|
|
157
|
+
};
|
|
158
|
+
/**
|
|
159
|
+
* Versioned terminal-operation metadata. This is additive: SDK consumers keep
|
|
160
|
+
* reading `data` / `error`, while observability-aware consumers can correlate
|
|
161
|
+
* a terminal wallet result to the original iframe request without parsing
|
|
162
|
+
* method-specific payloads.
|
|
163
|
+
*/
|
|
164
|
+
interface SilkOperationResult {
|
|
165
|
+
version: 1;
|
|
166
|
+
requestId: string;
|
|
167
|
+
status: 'succeeded' | 'failed' | 'cancelled';
|
|
168
|
+
phase: 'complete';
|
|
169
|
+
error?: {
|
|
170
|
+
code: string;
|
|
171
|
+
message: string;
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
/** Additive cancellation notification sent from the SDK host to the iframe. */
|
|
175
|
+
interface SilkRequestCancellation {
|
|
176
|
+
type: typeof SILK_NOTIFICATION.request_cancel;
|
|
177
|
+
requestId: string;
|
|
178
|
+
method: string;
|
|
179
|
+
}
|
|
180
|
+
type SilkResponse = BaseSilkResponse & {
|
|
181
|
+
data?: any;
|
|
182
|
+
error?: any;
|
|
183
|
+
operation?: SilkOperationResult;
|
|
184
|
+
} & ({
|
|
185
|
+
data: any;
|
|
186
|
+
error?: never;
|
|
187
|
+
} | {
|
|
188
|
+
data?: never;
|
|
189
|
+
error: any;
|
|
190
|
+
});
|
|
191
|
+
type CredentialType = 'kyc' | 'phone';
|
|
192
|
+
/**
|
|
193
|
+
* Parameters for waap_requestPermissionToken RPC method.
|
|
194
|
+
* Apps use this to request a Permission Token from the user.
|
|
195
|
+
*/
|
|
196
|
+
interface RequestPermissionTokenParams {
|
|
197
|
+
/** Canonical `evm:<id>`, `sui:<network>`, or `solana:<network>` chain. */
|
|
198
|
+
chain: `evm:${number}` | `sui:${string}` | `solana:${string}`;
|
|
199
|
+
/** Optional only on request; the wallet signs an explicit `tap` default. */
|
|
200
|
+
walletMode?: 'tap' | 'squid';
|
|
201
|
+
/** Contract addresses that the PT should allow transactions to */
|
|
202
|
+
allowedAddresses: string[];
|
|
203
|
+
/** Optional USD spend limit; omit or use null for address-only scope. */
|
|
204
|
+
requestedAmountUsd?: number | string | null;
|
|
205
|
+
/** Requested expiry duration in seconds (max 7200 = 2 hours) */
|
|
206
|
+
requestedExpirySeconds: number;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Result of waap_requestPermissionToken RPC method.
|
|
210
|
+
*/
|
|
211
|
+
interface RequestPermissionTokenResult {
|
|
212
|
+
/** Whether the user approved and signed the PT */
|
|
213
|
+
success: boolean;
|
|
214
|
+
/** Error message if the request failed */
|
|
215
|
+
error?: string;
|
|
216
|
+
}
|
|
217
|
+
//#endregion
|
|
218
|
+
//#region src/lib/walletTarget.d.ts
|
|
219
|
+
/** Named wallet deployments understood by the browser SDK. */
|
|
220
|
+
type WaaPEnvironment = 'development' | 'staging' | 'production';
|
|
221
|
+
/**
|
|
222
|
+
* Select the wallet iframe deployment explicitly. `walletOrigin` is intended
|
|
223
|
+
* for a local wallet build or a partner-owned preview environment; it must be
|
|
224
|
+
* an origin, not a URL path.
|
|
225
|
+
*/
|
|
226
|
+
interface WaaPWalletTargetOptions {
|
|
227
|
+
environment?: WaaPEnvironment;
|
|
228
|
+
walletOrigin?: string;
|
|
229
|
+
/** @deprecated Use `environment: 'staging'` instead. */
|
|
230
|
+
useStaging?: boolean;
|
|
231
|
+
}
|
|
232
|
+
/** Validate and normalize an iframe target origin before it becomes security state. */
|
|
233
|
+
declare function validateWalletOrigin(value: string): string;
|
|
234
|
+
/**
|
|
235
|
+
* Resolve the one origin used for iframe creation, all postMessage calls, and
|
|
236
|
+
* incoming message checks. Explicit origins win over named environments, which
|
|
237
|
+
* win over the legacy staging flag and the existing compiled SDK default.
|
|
238
|
+
*/
|
|
239
|
+
declare function resolveWalletOrigin(options?: WaaPWalletTargetOptions): string;
|
|
240
|
+
//#endregion
|
|
241
|
+
//#region src/lib/provider/types.d.ts
|
|
242
|
+
interface RequestArguments {
|
|
243
|
+
method: string;
|
|
244
|
+
params?: unknown[] | object;
|
|
245
|
+
async?: boolean;
|
|
246
|
+
withPT?: boolean;
|
|
247
|
+
/** Abort this wallet request and remove it from the iframe queue. */
|
|
248
|
+
signal?: AbortSignal;
|
|
249
|
+
/** SDK-side timeout for this request; not forwarded to the iframe. */
|
|
250
|
+
timeoutMs?: number;
|
|
251
|
+
}
|
|
252
|
+
interface EthereumProviderInterface {
|
|
253
|
+
enable(): Promise<unknown>;
|
|
254
|
+
isConnected(): boolean;
|
|
255
|
+
request(args: RequestArguments): Promise<unknown>;
|
|
256
|
+
on(event: string, listener: (...args: any[]) => void): this;
|
|
257
|
+
removeListener(event: string, listener: (...args: any[]) => void): this;
|
|
258
|
+
}
|
|
259
|
+
type LoginResponse = 'waap' | 'human' | 'injected' | 'walletconnect' | null;
|
|
260
|
+
/** The explicit signing family selected by an initializer. */
|
|
261
|
+
type WaaPAccountMode = 'tap' | 'squid';
|
|
262
|
+
type WaaPConversionState = 'not_required' | 'required' | 'pending' | 'complete' | 'failed' |
|
|
263
|
+
/**
|
|
264
|
+
* The wallet holds a signing key that does not derive its own address, so it
|
|
265
|
+
* cannot sign for it. Distinct from `failed`: retrying achieves nothing, the
|
|
266
|
+
* user's original key is intact, and resolving it needs operator action.
|
|
267
|
+
*/
|
|
268
|
+
'mismatched';
|
|
269
|
+
/**
|
|
270
|
+
* Public-safe local session information. It never includes authentication
|
|
271
|
+
* material, key shares, policy tokens, policies, or profile data.
|
|
272
|
+
*/
|
|
273
|
+
interface WaaPAccountStatus {
|
|
274
|
+
authenticated: boolean;
|
|
275
|
+
loginMethod: LoginResponse;
|
|
276
|
+
/** Preferred name for `mode`; retained alongside it for readability. */
|
|
277
|
+
activeMode: WaaPAccountMode | null;
|
|
278
|
+
mode: WaaPAccountMode;
|
|
279
|
+
conversion: WaaPConversionState;
|
|
280
|
+
tap: null | {
|
|
281
|
+
t1: {
|
|
282
|
+
evm: string;
|
|
283
|
+
sui: string;
|
|
284
|
+
};
|
|
285
|
+
t2: {
|
|
286
|
+
solana: string;
|
|
287
|
+
};
|
|
288
|
+
};
|
|
289
|
+
squid: null | {
|
|
290
|
+
sqd1: {
|
|
291
|
+
evm: string;
|
|
292
|
+
};
|
|
293
|
+
sqd2: {
|
|
294
|
+
sui: string;
|
|
295
|
+
solana: string;
|
|
296
|
+
};
|
|
297
|
+
};
|
|
298
|
+
/** Convenience view of connected public facade accounts. */
|
|
299
|
+
accounts: {
|
|
300
|
+
evm?: string;
|
|
301
|
+
sui?: string;
|
|
302
|
+
solana?: string;
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Options form of `login()`. Passed instead of a custom provider, which is
|
|
307
|
+
* distinguished at runtime by its EIP-1193 `request` method.
|
|
308
|
+
*/
|
|
309
|
+
interface WaaPLoginOptions {
|
|
310
|
+
/**
|
|
311
|
+
* Open the login UI even when the wallet could restore an existing session.
|
|
312
|
+
* Use it for an explicit "switch account" affordance; the default resolves
|
|
313
|
+
* a valid session without presenting UI.
|
|
314
|
+
*/
|
|
315
|
+
force?: boolean;
|
|
316
|
+
customProvider?: EthereumProviderInterface;
|
|
317
|
+
}
|
|
318
|
+
/** Common WaaP lifecycle extension beside chain-standard interfaces. */
|
|
319
|
+
interface WaaPSessionExtension {
|
|
320
|
+
login(customProvider?: unknown): Promise<LoginResponse>;
|
|
321
|
+
logout(): Promise<void>;
|
|
322
|
+
getLoginMethod(): LoginResponse;
|
|
323
|
+
/** Redacted canonical TAP/Squid snapshot from the wallet iframe. */
|
|
324
|
+
getAccountStatus(): Promise<WaaPAccountStatus>;
|
|
325
|
+
}
|
|
326
|
+
/** The dapp-visible scope of a wallet-owned Permission Token. */
|
|
327
|
+
interface PermissionTokenQuery {
|
|
328
|
+
chainId: number | string;
|
|
329
|
+
sender: string;
|
|
330
|
+
}
|
|
331
|
+
/** Redacted Permission Token metadata; never includes the signed token. */
|
|
332
|
+
interface PermissionTokenStatus {
|
|
333
|
+
present: boolean;
|
|
334
|
+
applicable: boolean;
|
|
335
|
+
chainId?: number | string;
|
|
336
|
+
sender?: string;
|
|
337
|
+
allowedAddresses?: string[];
|
|
338
|
+
amountUsd?: string;
|
|
339
|
+
expiresAt?: string;
|
|
340
|
+
reason?: 'missing' | 'expired' | 'chain_mismatch' | 'sender_mismatch';
|
|
341
|
+
}
|
|
342
|
+
interface PermissionTokenClearResult {
|
|
343
|
+
cleared: boolean;
|
|
344
|
+
}
|
|
345
|
+
interface SilkEthereumProviderInterface extends EthereumProviderInterface {
|
|
346
|
+
isSilk: boolean;
|
|
347
|
+
connected: boolean;
|
|
348
|
+
login(customProviderOrOptions?: any): Promise<LoginResponse>;
|
|
349
|
+
logout(): Promise<unknown>;
|
|
350
|
+
getLoginMethod(): LoginResponse;
|
|
351
|
+
getAccountStatus(): WaaPAccountStatus;
|
|
352
|
+
session: WaaPSessionExtension;
|
|
353
|
+
requestEmail(): Promise<unknown>;
|
|
354
|
+
requestSBT(type: CredentialType): Promise<unknown>;
|
|
355
|
+
requestPermissionToken(params: RequestPermissionTokenParams): Promise<unknown>;
|
|
356
|
+
getPermissionTokenStatus(query: PermissionTokenQuery): Promise<PermissionTokenStatus>;
|
|
357
|
+
clearPermissionToken(query: PermissionTokenQuery): Promise<PermissionTokenClearResult>;
|
|
358
|
+
toggleDarkMode(): Promise<void>;
|
|
359
|
+
/** Mount (if deferred) and complete the wallet handshake ahead of use. */
|
|
360
|
+
preload(): Promise<void>;
|
|
361
|
+
/** Release SDK message listeners and the shared wallet iframe. */
|
|
362
|
+
destroy(): void;
|
|
363
|
+
}
|
|
364
|
+
interface InitSilkOptions extends WaaPWalletTargetOptions {
|
|
365
|
+
referralCode?: string;
|
|
366
|
+
project?: ProjectConfig;
|
|
367
|
+
config?: CustomConfig;
|
|
368
|
+
walletConnectProjectId?: string;
|
|
369
|
+
/**
|
|
370
|
+
* Wallet session transport. Defaults to fail-closed DPoP. Select `bearer`
|
|
371
|
+
* only for an integration that cannot use the iframe's WebCrypto/IndexedDB
|
|
372
|
+
* DPoP key.
|
|
373
|
+
*/
|
|
374
|
+
sessionProtection?: WaaPSessionProtection;
|
|
375
|
+
/**
|
|
376
|
+
* When true, the wallet iframe is mounted only by `preload()` or the first
|
|
377
|
+
* wallet operation. The default warms it after the browser becomes idle;
|
|
378
|
+
* pass `false` to mount eagerly during initialization.
|
|
379
|
+
*/
|
|
380
|
+
deferIframe?: boolean;
|
|
381
|
+
/**
|
|
382
|
+
* When true, eth_sendTransaction resolves with `{ pendingTxId, status:
|
|
383
|
+
* 'pending' }` immediately after signing. Broadcasting and confirmation
|
|
384
|
+
* continue in the background with waap lifecycle events; the canonical
|
|
385
|
+
* transaction hash is available after node acceptance.
|
|
386
|
+
* Other signing methods (personal_sign, eth_signTypedData_v4, eth_signTransaction)
|
|
387
|
+
* are unaffected — they always resolve with the signature directly.
|
|
388
|
+
* Applies to ALL eth_sendTransaction calls for this SDK instance.
|
|
389
|
+
* Default: false
|
|
390
|
+
*/
|
|
391
|
+
asyncTxs?: boolean;
|
|
392
|
+
/** @deprecated Use `asyncTxs` instead. */
|
|
393
|
+
asyncSigning?: boolean;
|
|
394
|
+
}
|
|
395
|
+
type SilkProvider = SilkEthereumProviderInterface;
|
|
396
|
+
//#endregion
|
|
397
|
+
export { SILK_METHOD as A, RequestPermissionTokenResult as C, SocialProvider as D, SilkResponse as E, WaaPSessionProtection as M, StylesConfig as O, RequestPermissionTokenParams as S, SilkRequestCancellation as T, validateWalletOrigin as _, PermissionTokenQuery as a, CustomConfig as b, SilkEthereumProviderInterface as c, WaaPAccountStatus as d, WaaPLoginOptions as f, resolveWalletOrigin as g, WaaPWalletTargetOptions as h, PermissionTokenClearResult as i, SilkNotificationData as j, JSON_RPC_METHOD as k, SilkProvider as l, WaaPEnvironment as m, InitSilkOptions as n, PermissionTokenStatus as o, WaaPSessionExtension as p, LoginResponse as r, RequestArguments as s, EthereumProviderInterface as t, WaaPAccountMode as u, AuthenticationMethod as v, SilkRequest as w, ProjectConfig as x, CredentialType as y };
|