@human.tech/waap-sdk 1.3.0 → 2.1.0-staging-56d55d
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 +35 -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 +273 -0
- package/dist/index.d.ts +273 -15
- package/dist/index.js +1 -2
- package/dist/index.mjs +1 -0
- 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 +59 -43
- package/dist/hooks/useWaapTransaction.d.ts +0 -84
- package/dist/index.js.map +0 -1
- package/dist/index.modern.mjs +0 -2
- package/dist/index.modern.mjs.map +0 -1
- package/dist/index.module.js +0 -2
- package/dist/index.module.js.map +0 -1
- package/dist/index.umd.js +0 -2
- package/dist/index.umd.js.map +0 -1
- package/dist/lib/UIMessageManager.d.ts +0 -19
- package/dist/lib/WalletConnect.d.ts +0 -30
- package/dist/lib/WalletMessageManager.d.ts +0 -59
- package/dist/lib/provider/EthereumProvider.d.ts +0 -108
- package/dist/lib/provider/EthereumProviderExtension.d.ts +0 -26
- package/dist/lib/provider/requests.d.ts +0 -17
- package/dist/lib/provider/types.d.ts +0 -49
- package/dist/lib/provider/utils.d.ts +0 -4
- package/dist/lib/sui/SuiWallet.d.ts +0 -203
- package/dist/lib/sui/index.d.ts +0 -7
- package/dist/lib/sui/init.d.ts +0 -30
- package/dist/lib/sui/register.d.ts +0 -39
- package/dist/lib/sui/types.d.ts +0 -293
- package/dist/ui/WaapComponent.d.ts +0 -37
- package/dist/ui/index.d.ts +0 -11
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import { A as SILK_METHOD, C as RequestPermissionTokenResult, D as SocialProvider, M as WaaPSessionProtection, O as StylesConfig, S as RequestPermissionTokenParams, _ as validateWalletOrigin, a as PermissionTokenQuery, b as CustomConfig, c as SilkEthereumProviderInterface, d as WaaPAccountStatus, f as WaaPLoginOptions, g as resolveWalletOrigin, h as WaaPWalletTargetOptions, i as PermissionTokenClearResult, k as JSON_RPC_METHOD, l as SilkProvider, m as WaaPEnvironment, n as InitSilkOptions, o as PermissionTokenStatus, p as WaaPSessionExtension, r as LoginResponse, s as RequestArguments, t as EthereumProviderInterface, u as WaaPAccountMode, v as AuthenticationMethod, x as ProjectConfig, y as CredentialType } from "./types-DexmJNke.mjs";
|
|
2
|
+
import { _ as WAAP_EVENTS, a as useWaapTransaction, c as AsyncEventType, d as AsyncSignPendingEvent, f as AsyncTxConfirmedEvent, g as SilkOptions, h as AsyncTxResponse, i as UseWaapTransactionReturn, l as AsyncSignCompleteEvent, m as AsyncTxPendingEvent, n as TxState, o as Async2faRequiredEvent, p as AsyncTxFailedEvent, r as UseWaapTransactionOptions, s as AsyncEvent, t as useWaapAuth, u as AsyncSignFailedEvent } from "./useWaapAuth-C5I7QqyW.mjs";
|
|
3
|
+
import { a as CancelWaaPPreload, c as preloadWaaPOnIdle, d as WaaPIframeLifecyclePhase, f as getWaaPIframeDiagnostics, h as WalletMessageManager, i as normalizeWaaPError, l as WaaPIframeDiagnostics, m as PostSilkRequestArgs, n as WaaPErrorCode, o as WaaPIdlePreloadOptions, p as subscribeWaaPIframeLifecycle, r as WaaPOperationMetadata, s as WaaPPreloadTarget, t as WaaPError, u as WaaPIframeLifecycleEvent } from "./WaaPError-C5nPcaKk.mjs";
|
|
4
|
+
import { A as SolanaSignTransactionInput, B as WaaPSolanaWalletFeatures, C as SolanaChain, D as SolanaSignAndSendTransactionOutput, E as SolanaSignAndSendTransactionInput, F as SolanaStandardSignMessageOutput, G as SuiConnectOutput, H as SuiAccount, I as SolanaStandardSignTransactionInput, J as SuiSignAndExecuteTransactionInput, L as SolanaStandardSignTransactionOutput, M as SolanaStandardSignAndSendTransactionInput, N as SolanaStandardSignAndSendTransactionOutput, O as SolanaSignMessageInput, P as SolanaStandardSignMessageInput, S as SolanaAccount, T as SolanaConnectOutput, U as SuiChain, V as InitWaaPSuiOptions, W as SuiConnectInput, X as SuiSignPersonalMessageInput, Y as SuiSignAndExecuteTransactionOutput, Z as SuiSignPersonalMessageOutput, _ as initWaaPSolana, a as InitWaaPTapOptions, at as WaaPSuiWalletInterface, b as initWaaPTap, c as WaaPSquidChain, d as WaaPSquidStatus, et as SuiSignTransactionInput, f as WaaPSquidStatusState, g as initWaaPMulti, h as initWaaP, i as InitWaaPSquidOptions, it as WaaPSuiWalletFeatures, j as SolanaSignTransactionOutput, k as SolanaSignMessageOutput, l as WaaPSquidLifecycle, m as WaaPTapSession, n as InitWaaPMultiOptions, nt as SuiTransactionInput, o as WaaPChain, p as WaaPTap, r as InitWaaPOptions, s as WaaPSquid, t as InitWaaPChainOptions, tt as SuiSignTransactionOutput, u as WaaPSquidSession, v as initWaaPSquid, w as SolanaConnectInput, x as InitWaaPSolanaOptions, y as initWaaPSui, z as WaaPSolanaProviderInterface } from "./index-CdKntlzX.mjs";
|
|
5
|
+
import { t as SilkWalletConnect } from "./WalletConnect-BTT6LtUu.mjs";
|
|
6
|
+
import { n as UIMessageManager, r as UI_EVENT_NAMES } from "./initializerContext-C39PUnGi.mjs";
|
|
7
|
+
import { n as WaaPSuiWallet, t as registerWaaPSuiWallet } from "./register-LmdJdvzn.mjs";
|
|
8
|
+
import { n as WaaPSolanaProvider, t as registerWaaPSolanaWallet } from "./register-QjrsOe7r.mjs";
|
|
9
|
+
import { EventEmitter } from "events";
|
|
10
|
+
//#region ../silk-interface-core/dist/esm/types/squidLifecycle.d.ts
|
|
11
|
+
/**
|
|
12
|
+
* Types for the multichain LITE ("Squid" brand) onboarding lifecycle.
|
|
13
|
+
*
|
|
14
|
+
* `initWaaPSquid` onboards both curves (secp256k1 → EVM, ed25519 → Sui +
|
|
15
|
+
* Solana) through one PTB, so all three chain addresses become ready together.
|
|
16
|
+
*/
|
|
17
|
+
/** Event types emitted during the Squid onboarding lifecycle. */
|
|
18
|
+
type SquidLifecycleEventType = 'waap_squid_pending' | 'waap_squid_ready' | 'waap_squid_failed';
|
|
19
|
+
/** Emitted while Squid onboarding is in progress. */
|
|
20
|
+
interface SquidPendingEvent {
|
|
21
|
+
/** Opaque SDK-to-iframe correlation value for one onboarding attempt. */
|
|
22
|
+
lifecycleId?: string;
|
|
23
|
+
/** Human-readable progress, e.g. IKA network DKG verification. */
|
|
24
|
+
message?: string;
|
|
25
|
+
/** Sui digest of the create PTB when a DWallet is awaiting verification. */
|
|
26
|
+
transactionDigest?: string;
|
|
27
|
+
}
|
|
28
|
+
/** Emitted when the Squid DWallets are ready for signing. */
|
|
29
|
+
interface SquidReadyEvent {
|
|
30
|
+
/** Opaque correlation value echoed from the pending onboarding attempt. */
|
|
31
|
+
lifecycleId?: string;
|
|
32
|
+
/** secp256k1 Lite DWallet → EVM address. */
|
|
33
|
+
evm: string;
|
|
34
|
+
/** ed25519 Lite DWallet → Sui address. */
|
|
35
|
+
sui: string;
|
|
36
|
+
/** ed25519 Lite DWallet → Solana address. */
|
|
37
|
+
solana: string;
|
|
38
|
+
}
|
|
39
|
+
/** Emitted when Squid onboarding fails. */
|
|
40
|
+
interface SquidFailedEvent {
|
|
41
|
+
/** Opaque correlation value echoed from the pending onboarding attempt. */
|
|
42
|
+
lifecycleId?: string;
|
|
43
|
+
error: string;
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region src/ui/WaapComponent.d.ts
|
|
47
|
+
/**
|
|
48
|
+
* WaaP Component
|
|
49
|
+
*
|
|
50
|
+
* A custom HTML element that allows developers to control where the WaaP wallet
|
|
51
|
+
* renders in their UI. When present, the wallet will render inside this component
|
|
52
|
+
* instead of as a centered modal with backdrop.
|
|
53
|
+
*
|
|
54
|
+
* Usage in HTML:
|
|
55
|
+
* ```html
|
|
56
|
+
* <waap-wallet></waap-wallet>
|
|
57
|
+
* ```
|
|
58
|
+
*
|
|
59
|
+
* Usage in React/JSX:
|
|
60
|
+
* ```tsx
|
|
61
|
+
* function App() {
|
|
62
|
+
* return <waap-wallet style={{ width: '400px', height: '600px' }} />
|
|
63
|
+
* }
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
/**
|
|
67
|
+
* Custom HTML element for WaaP wallet
|
|
68
|
+
* Only defined in browser environments to avoid SSR issues
|
|
69
|
+
*/
|
|
70
|
+
declare let WaapWalletElement: any;
|
|
71
|
+
//#endregion
|
|
72
|
+
//#region src/lib/provider/EthereumProviderExtension.d.ts
|
|
73
|
+
declare class EthereumProviderExtension extends EventEmitter implements EthereumProviderInterface {
|
|
74
|
+
readonly isSilk = true;
|
|
75
|
+
connected: boolean;
|
|
76
|
+
config: CustomConfig;
|
|
77
|
+
constructor(customConfig?: CustomConfig);
|
|
78
|
+
sendToExtension(args: RequestArguments): Promise<unknown>;
|
|
79
|
+
request(args: RequestArguments): Promise<unknown>;
|
|
80
|
+
enable(): Promise<unknown>;
|
|
81
|
+
isConnected(): boolean;
|
|
82
|
+
login(): Promise<unknown>;
|
|
83
|
+
requestSBT(type: CredentialType): Promise<unknown>;
|
|
84
|
+
toggleDarkMode(): Promise<void>;
|
|
85
|
+
safe(): Promise<unknown>;
|
|
86
|
+
}
|
|
87
|
+
//#endregion
|
|
88
|
+
//#region src/lib/provider/EthereumProvider.d.ts
|
|
89
|
+
declare class EthereumProvider extends EventEmitter implements SilkEthereumProviderInterface {
|
|
90
|
+
/**
|
|
91
|
+
* Last conversion state the wallet actually reported. The synchronous status
|
|
92
|
+
* accessor cannot await the iframe, and previously answered `complete` for any
|
|
93
|
+
* logged-in user — a definite claim it had no basis for. `pending` means "not
|
|
94
|
+
* yet resolved", which is the truth until `getCanonicalAccountStatus` runs.
|
|
95
|
+
*/
|
|
96
|
+
private lastKnownConversion;
|
|
97
|
+
readonly isSilk = true;
|
|
98
|
+
readonly isWaaP = true;
|
|
99
|
+
connected: boolean;
|
|
100
|
+
walletMessageManager: WalletMessageManager;
|
|
101
|
+
uiMessageManager: UIMessageManager;
|
|
102
|
+
config: CustomConfig;
|
|
103
|
+
private currentAccount;
|
|
104
|
+
private accountMode;
|
|
105
|
+
private walletConnectProvider;
|
|
106
|
+
/**
|
|
107
|
+
* When true, eth_sendTransaction resolves with the signed transaction hash.
|
|
108
|
+
* Broadcasting continues in the background with lifecycle events.
|
|
109
|
+
*/
|
|
110
|
+
private asyncTxs;
|
|
111
|
+
/**
|
|
112
|
+
* When true, sends `asyncSigning: true` in silkOptions instead of `async: true`.
|
|
113
|
+
* This mimics the v1 SDK protocol for backward compatibility testing.
|
|
114
|
+
* @internal
|
|
115
|
+
*/
|
|
116
|
+
private legacyAsyncSigning;
|
|
117
|
+
private persistedMethods;
|
|
118
|
+
/**
|
|
119
|
+
* We use the internalEventEmitter to emit as events
|
|
120
|
+
* Silk messages posted to the window.
|
|
121
|
+
*/
|
|
122
|
+
internalEventEmitter: EventEmitter;
|
|
123
|
+
/**
|
|
124
|
+
* @param iframeWindow - The contentWindow of the iframe of the Silk website.
|
|
125
|
+
* @param referralCode - Silk points referral code
|
|
126
|
+
* @param customConfig - Silk custom UI configuration
|
|
127
|
+
* @param project - Silk project configuration
|
|
128
|
+
* @param walletOrigin - Resolved wallet iframe origin
|
|
129
|
+
* @param asyncTxs - When true, eth_sendTransaction resolves with the signed transaction hash while broadcasting continues in the background
|
|
130
|
+
* @param legacyAsyncSigning - When true, sends asyncSigning in silkOptions (v1 compat)
|
|
131
|
+
*/
|
|
132
|
+
/**
|
|
133
|
+
* `deferIframe` mode: called on first use to create the iframe and return its
|
|
134
|
+
* contentWindow. Undefined in eager mode. Once invoked, `iframeMounted` flips
|
|
135
|
+
* true and the referral/project/config setup is replayed against the iframe.
|
|
136
|
+
*/
|
|
137
|
+
private ensureIframe?;
|
|
138
|
+
private iframeMounted;
|
|
139
|
+
private referralCode?;
|
|
140
|
+
private project?;
|
|
141
|
+
private customConfig?;
|
|
142
|
+
private initializerChains;
|
|
143
|
+
private sessionProtection?;
|
|
144
|
+
private initializerPromise;
|
|
145
|
+
/** Shared silent session probe for concurrent signing/connect requests. */
|
|
146
|
+
private sessionProbe;
|
|
147
|
+
private initializedIframeWindow;
|
|
148
|
+
constructor(iframeWindow: Window | null, referralCode?: string, customConfig?: CustomConfig, project?: ProjectConfig, walletOrigin?: string, asyncTxs?: boolean, legacyAsyncSigning?: boolean, ensureIframe?: () => Window | null, initializerChains?: readonly ('evm' | 'sui' | 'solana')[], sessionProtection?: WaaPSessionProtection);
|
|
149
|
+
private initializeWalletConnect;
|
|
150
|
+
/**
|
|
151
|
+
* Select the initialized signer family and atomically apply its public
|
|
152
|
+
* config. The wallet still accepts the old mode-only envelope, so released
|
|
153
|
+
* SDKs and old integrations remain wire-compatible.
|
|
154
|
+
*/
|
|
155
|
+
initializeIframeContext(): Promise<void>;
|
|
156
|
+
/**
|
|
157
|
+
* Reapply this facade's signer family after a restored wallet session has
|
|
158
|
+
* hydrated. The one-time initializer intentionally cannot do this itself:
|
|
159
|
+
* a persisted wallet-store selection may hydrate after the first envelope.
|
|
160
|
+
*
|
|
161
|
+
* @internal Shared initializers use this after login; applications should
|
|
162
|
+
* select their family by calling the appropriate public initializer.
|
|
163
|
+
*/
|
|
164
|
+
reassertIframeAccountMode(): Promise<void>;
|
|
165
|
+
/**
|
|
166
|
+
* In `deferIframe` mode, create the iframe on first use and point the message
|
|
167
|
+
* manager at it. Initialization is then performed by the operation that
|
|
168
|
+
* required the iframe. No-op in eager mode / once
|
|
169
|
+
* already mounted.
|
|
170
|
+
*/
|
|
171
|
+
private ensureIframeMounted;
|
|
172
|
+
/** Ensure every public wallet operation supports deferred mounting. */
|
|
173
|
+
private ensureInitialized;
|
|
174
|
+
/** Warm the iframe after the host app's LCP without opening wallet UI. */
|
|
175
|
+
preload(): Promise<void>;
|
|
176
|
+
enable(): Promise<unknown>;
|
|
177
|
+
isConnected(): boolean;
|
|
178
|
+
/** Public-safe status for this initializer family. */
|
|
179
|
+
getAccountStatus(): WaaPAccountStatus;
|
|
180
|
+
get session(): WaaPSessionExtension;
|
|
181
|
+
/** Fetch the canonical, redacted account snapshot from the wallet iframe. */
|
|
182
|
+
getCanonicalAccountStatus(): Promise<WaaPAccountStatus>;
|
|
183
|
+
/** @internal Initializers set this once; applications select a mode by initializer. */
|
|
184
|
+
setAccountMode(mode: WaaPAccountMode): void;
|
|
185
|
+
request(args: RequestArguments): Promise<unknown>;
|
|
186
|
+
login(customProvider?: EthereumProviderInterface): Promise<LoginResponse>;
|
|
187
|
+
login(options: WaaPLoginOptions): Promise<LoginResponse>;
|
|
188
|
+
logout(): Promise<unknown>;
|
|
189
|
+
/** Release listeners owned by this EVM facade. */
|
|
190
|
+
destroy(): void;
|
|
191
|
+
private cleanupInvalidLoginState;
|
|
192
|
+
/**
|
|
193
|
+
* Helper method to set up window.waap for WaaP
|
|
194
|
+
*/
|
|
195
|
+
private setupWaaP;
|
|
196
|
+
/**
|
|
197
|
+
* Helper method to set up window.silk for injected wallets (e.g., MetaMask)
|
|
198
|
+
*/
|
|
199
|
+
private setupInjectedWallet;
|
|
200
|
+
/**
|
|
201
|
+
* Helper method to set up window.silk for WalletConnect
|
|
202
|
+
*/
|
|
203
|
+
private setupWalletConnect;
|
|
204
|
+
/**
|
|
205
|
+
* Helper method to set up window.silk for auto-connect with injected wallets
|
|
206
|
+
*/
|
|
207
|
+
private setupAutoConnectInjected;
|
|
208
|
+
/**
|
|
209
|
+
* Helper method to set up window.silk for auto-connect with WalletConnect
|
|
210
|
+
*/
|
|
211
|
+
private setupAutoConnectWalletConnect;
|
|
212
|
+
/**
|
|
213
|
+
* Attempts to auto-connect using previously stored login method
|
|
214
|
+
* @param method - The RPC method being called
|
|
215
|
+
* @returns Promise<unknown> if auto-connect succeeds, null if it should fall through to normal flow
|
|
216
|
+
*/
|
|
217
|
+
private attemptAutoConnect;
|
|
218
|
+
/**
|
|
219
|
+
* Coalesce concurrent silent session restores. This avoids repeating the
|
|
220
|
+
* status plus auto-connect round trips for a burst of signing requests.
|
|
221
|
+
*/
|
|
222
|
+
private restorePersistedWaaPSession;
|
|
223
|
+
/** Probe the iframe's actual WaaP session without ever presenting wallet UI. */
|
|
224
|
+
private probeWaaPSession;
|
|
225
|
+
getLoginMethod(): LoginResponse;
|
|
226
|
+
toggleDarkMode(): Promise<void>;
|
|
227
|
+
safe(): Promise<void>;
|
|
228
|
+
orcid(): Promise<void>;
|
|
229
|
+
/**
|
|
230
|
+
* INTERNAL METHOD: Gas tank administration operations
|
|
231
|
+
* This method is ONLY accessible from the Dev Portal domain
|
|
232
|
+
* It's not included in the public typing to hide it from regular dApps
|
|
233
|
+
*/
|
|
234
|
+
portal(feature: 'gastank' | 'customization' | 'project', operation: 'get' | 'update' | 'topup' | 'init', payload?: any): Promise<unknown>;
|
|
235
|
+
requestEmail(): Promise<unknown>;
|
|
236
|
+
/**
|
|
237
|
+
* Request a Permission Token from the user.
|
|
238
|
+
* Allows pre-authorized transactions without individual confirmations.
|
|
239
|
+
* @param params - Permission token parameters (allowed addresses, chain, limits, expiry)
|
|
240
|
+
* @returns Promise<RequestPermissionTokenResult>
|
|
241
|
+
*/
|
|
242
|
+
requestPermissionToken(params: RequestPermissionTokenParams): Promise<unknown>;
|
|
243
|
+
getPermissionTokenStatus(query: PermissionTokenQuery): Promise<PermissionTokenStatus>;
|
|
244
|
+
clearPermissionToken(query: PermissionTokenQuery): Promise<PermissionTokenClearResult>;
|
|
245
|
+
/**
|
|
246
|
+
* Prompt the user to mint a Zeronym SBT.
|
|
247
|
+
* @returns string or null - The address of the owner of the SBT, or null
|
|
248
|
+
* if the user already minted the SBT.
|
|
249
|
+
*/
|
|
250
|
+
requestSBT(type: CredentialType): Promise<unknown>;
|
|
251
|
+
}
|
|
252
|
+
//#endregion
|
|
253
|
+
//#region src/lib/provider/requests.d.ts
|
|
254
|
+
/**
|
|
255
|
+
* Options passed to iframe for transaction behavior
|
|
256
|
+
*/
|
|
257
|
+
interface WaaPRequestOptions {
|
|
258
|
+
async?: boolean;
|
|
259
|
+
withPT?: boolean;
|
|
260
|
+
/** Timeout for non-interactive requests, in milliseconds. SDK-side only, not forwarded to the iframe. */
|
|
261
|
+
timeoutMs?: number;
|
|
262
|
+
/** Cancel this SDK wait and remove its queued iframe request. */
|
|
263
|
+
signal?: AbortSignal;
|
|
264
|
+
}
|
|
265
|
+
/** Whether a standard EIP-1193 request must show wallet UI. */
|
|
266
|
+
declare const rpcMethodRequiresUI: (method: JSON_RPC_METHOD) => boolean;
|
|
267
|
+
/**
|
|
268
|
+
* Send request to wallet in iframe, and upon receiving the wallet's response
|
|
269
|
+
* or error, hide modal and return wallet's response or throw wallet's error.
|
|
270
|
+
*/
|
|
271
|
+
declare function handleWalletRequestAndResponse(args: RequestArguments, interactionRequired: boolean, walletMessageManager: WalletMessageManager, internalProviderEventEmitter: EventEmitter, silkOptions?: WaaPRequestOptions): Promise<any>;
|
|
272
|
+
//#endregion
|
|
273
|
+
export { type Async2faRequiredEvent, type AsyncEvent, type AsyncEventType, type AsyncSignCompleteEvent, type AsyncSignFailedEvent, type AsyncSignPendingEvent, type AsyncTxConfirmedEvent, type AsyncTxFailedEvent, type AsyncTxPendingEvent, type AsyncTxResponse, type AuthenticationMethod, type CancelWaaPPreload, type CredentialType, EthereumProvider, EthereumProviderExtension, type InitSilkOptions, type InitWaaPChainOptions, type InitWaaPMultiOptions, type InitWaaPOptions, type InitWaaPSolanaOptions, type InitWaaPSquidOptions, type InitWaaPSuiOptions, type InitWaaPTapOptions, type PermissionTokenClearResult, type PermissionTokenQuery, type PermissionTokenStatus, type PostSilkRequestArgs, type PostSilkRequestArgs as PostWaaPRequestArgs, type ProjectConfig, type RequestPermissionTokenParams, type RequestPermissionTokenResult, SILK_METHOD, SILK_METHOD as WAAP_METHOD, type SilkEthereumProviderInterface, type SilkEthereumProviderInterface as WaaPEthereumProviderInterface, type SilkOptions, type SilkProvider, type SilkProvider as WaaPProvider, SilkWalletConnect, SilkWalletConnect as WaaPWalletConnect, type SocialProvider, type SolanaAccount, type SolanaChain, type SolanaConnectInput, type SolanaConnectOutput, type SolanaSignAndSendTransactionInput, type SolanaSignAndSendTransactionOutput, type SolanaSignMessageInput, type SolanaSignMessageOutput, type SolanaSignTransactionInput, type SolanaSignTransactionOutput, type SolanaStandardSignAndSendTransactionInput, type SolanaStandardSignAndSendTransactionOutput, type SolanaStandardSignMessageInput, type SolanaStandardSignMessageOutput, type SolanaStandardSignTransactionInput, type SolanaStandardSignTransactionOutput, type SquidFailedEvent, type SquidLifecycleEventType, type SquidPendingEvent, type SquidReadyEvent, type StylesConfig, type SuiAccount, type SuiChain, type SuiConnectInput, type SuiConnectOutput, type SuiSignAndExecuteTransactionInput, type SuiSignAndExecuteTransactionOutput, type SuiSignPersonalMessageInput, type SuiSignPersonalMessageOutput, type SuiSignTransactionInput, type SuiSignTransactionOutput, type SuiTransactionInput, type TxState, UIMessageManager, UI_EVENT_NAMES, type UseWaapTransactionOptions, type UseWaapTransactionReturn, WAAP_EVENTS, WaapWalletElement as WaaP, type WaaPAccountMode, type WaaPAccountStatus, type WaaPChain, type WaaPEnvironment, WaaPError, type WaaPErrorCode, type WaaPIdlePreloadOptions, type WaaPIframeDiagnostics, type WaaPIframeLifecycleEvent, type WaaPIframeLifecyclePhase, type WaaPLoginOptions, type WaaPOperationMetadata, type WaaPPreloadTarget, type WaaPSessionProtection, WaaPSolanaProvider, type WaaPSolanaProviderInterface, type WaaPSolanaWalletFeatures, type WaaPSquid, type WaaPSquidChain, type WaaPSquidLifecycle, type WaaPSquidSession, type WaaPSquidStatus, type WaaPSquidStatusState, WaaPSuiWallet, type WaaPSuiWalletFeatures, type WaaPSuiWalletInterface, type WaaPTap, type WaaPTapSession, type WaaPWalletTargetOptions, WalletMessageManager, getWaaPIframeDiagnostics, handleWalletRequestAndResponse, initWaaP, initWaaPMulti, initWaaPSolana, initWaaPSquid, initWaaPSui, initWaaPTap, normalizeWaaPError, preloadWaaPOnIdle, registerWaaPSolanaWallet, registerWaaPSuiWallet, resolveWalletOrigin, rpcMethodRequiresUI, subscribeWaaPIframeLifecycle, useWaapAuth, useWaapTransaction, validateWalletOrigin };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,273 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { A as SILK_METHOD, C as RequestPermissionTokenResult, D as SocialProvider, M as WaaPSessionProtection, O as StylesConfig, S as RequestPermissionTokenParams, _ as validateWalletOrigin, a as PermissionTokenQuery, b as CustomConfig, c as SilkEthereumProviderInterface, d as WaaPAccountStatus, f as WaaPLoginOptions, g as resolveWalletOrigin, h as WaaPWalletTargetOptions, i as PermissionTokenClearResult, k as JSON_RPC_METHOD, l as SilkProvider, m as WaaPEnvironment, n as InitSilkOptions, o as PermissionTokenStatus, p as WaaPSessionExtension, r as LoginResponse, s as RequestArguments, t as EthereumProviderInterface, u as WaaPAccountMode, v as AuthenticationMethod, x as ProjectConfig, y as CredentialType } from "./types-DexmJNke.js";
|
|
2
|
+
import { _ as WAAP_EVENTS, a as useWaapTransaction, c as AsyncEventType, d as AsyncSignPendingEvent, f as AsyncTxConfirmedEvent, g as SilkOptions, h as AsyncTxResponse, i as UseWaapTransactionReturn, l as AsyncSignCompleteEvent, m as AsyncTxPendingEvent, n as TxState, o as Async2faRequiredEvent, p as AsyncTxFailedEvent, r as UseWaapTransactionOptions, s as AsyncEvent, t as useWaapAuth, u as AsyncSignFailedEvent } from "./useWaapAuth-BrqAhAn2.js";
|
|
3
|
+
import { a as CancelWaaPPreload, c as preloadWaaPOnIdle, d as WaaPIframeLifecyclePhase, f as getWaaPIframeDiagnostics, h as WalletMessageManager, i as normalizeWaaPError, l as WaaPIframeDiagnostics, m as PostSilkRequestArgs, n as WaaPErrorCode, o as WaaPIdlePreloadOptions, p as subscribeWaaPIframeLifecycle, r as WaaPOperationMetadata, s as WaaPPreloadTarget, t as WaaPError, u as WaaPIframeLifecycleEvent } from "./WaaPError-XLgIXUgh.js";
|
|
4
|
+
import { A as SolanaSignTransactionInput, B as WaaPSolanaWalletFeatures, C as SolanaChain, D as SolanaSignAndSendTransactionOutput, E as SolanaSignAndSendTransactionInput, F as SolanaStandardSignMessageOutput, G as SuiConnectOutput, H as SuiAccount, I as SolanaStandardSignTransactionInput, J as SuiSignAndExecuteTransactionInput, L as SolanaStandardSignTransactionOutput, M as SolanaStandardSignAndSendTransactionInput, N as SolanaStandardSignAndSendTransactionOutput, O as SolanaSignMessageInput, P as SolanaStandardSignMessageInput, S as SolanaAccount, T as SolanaConnectOutput, U as SuiChain, V as InitWaaPSuiOptions, W as SuiConnectInput, X as SuiSignPersonalMessageInput, Y as SuiSignAndExecuteTransactionOutput, Z as SuiSignPersonalMessageOutput, _ as initWaaPSolana, a as InitWaaPTapOptions, at as WaaPSuiWalletInterface, b as initWaaPTap, c as WaaPSquidChain, d as WaaPSquidStatus, et as SuiSignTransactionInput, f as WaaPSquidStatusState, g as initWaaPMulti, h as initWaaP, i as InitWaaPSquidOptions, it as WaaPSuiWalletFeatures, j as SolanaSignTransactionOutput, k as SolanaSignMessageOutput, l as WaaPSquidLifecycle, m as WaaPTapSession, n as InitWaaPMultiOptions, nt as SuiTransactionInput, o as WaaPChain, p as WaaPTap, r as InitWaaPOptions, s as WaaPSquid, t as InitWaaPChainOptions, tt as SuiSignTransactionOutput, u as WaaPSquidSession, v as initWaaPSquid, w as SolanaConnectInput, x as InitWaaPSolanaOptions, y as initWaaPSui, z as WaaPSolanaProviderInterface } from "./index-CMSufeMa.js";
|
|
5
|
+
import { t as SilkWalletConnect } from "./WalletConnect-BTT6LtUu.js";
|
|
6
|
+
import { n as UIMessageManager, r as UI_EVENT_NAMES } from "./initializerContext-0oKHzvQG.js";
|
|
7
|
+
import { n as WaaPSuiWallet, t as registerWaaPSuiWallet } from "./register-CxsUwgKJ.js";
|
|
8
|
+
import { n as WaaPSolanaProvider, t as registerWaaPSolanaWallet } from "./register-CBlzg5ln.js";
|
|
9
|
+
import { EventEmitter } from "events";
|
|
10
|
+
//#region ../silk-interface-core/dist/esm/types/squidLifecycle.d.ts
|
|
11
|
+
/**
|
|
12
|
+
* Types for the multichain LITE ("Squid" brand) onboarding lifecycle.
|
|
13
|
+
*
|
|
14
|
+
* `initWaaPSquid` onboards both curves (secp256k1 → EVM, ed25519 → Sui +
|
|
15
|
+
* Solana) through one PTB, so all three chain addresses become ready together.
|
|
16
|
+
*/
|
|
17
|
+
/** Event types emitted during the Squid onboarding lifecycle. */
|
|
18
|
+
type SquidLifecycleEventType = 'waap_squid_pending' | 'waap_squid_ready' | 'waap_squid_failed';
|
|
19
|
+
/** Emitted while Squid onboarding is in progress. */
|
|
20
|
+
interface SquidPendingEvent {
|
|
21
|
+
/** Opaque SDK-to-iframe correlation value for one onboarding attempt. */
|
|
22
|
+
lifecycleId?: string;
|
|
23
|
+
/** Human-readable progress, e.g. IKA network DKG verification. */
|
|
24
|
+
message?: string;
|
|
25
|
+
/** Sui digest of the create PTB when a DWallet is awaiting verification. */
|
|
26
|
+
transactionDigest?: string;
|
|
27
|
+
}
|
|
28
|
+
/** Emitted when the Squid DWallets are ready for signing. */
|
|
29
|
+
interface SquidReadyEvent {
|
|
30
|
+
/** Opaque correlation value echoed from the pending onboarding attempt. */
|
|
31
|
+
lifecycleId?: string;
|
|
32
|
+
/** secp256k1 Lite DWallet → EVM address. */
|
|
33
|
+
evm: string;
|
|
34
|
+
/** ed25519 Lite DWallet → Sui address. */
|
|
35
|
+
sui: string;
|
|
36
|
+
/** ed25519 Lite DWallet → Solana address. */
|
|
37
|
+
solana: string;
|
|
38
|
+
}
|
|
39
|
+
/** Emitted when Squid onboarding fails. */
|
|
40
|
+
interface SquidFailedEvent {
|
|
41
|
+
/** Opaque correlation value echoed from the pending onboarding attempt. */
|
|
42
|
+
lifecycleId?: string;
|
|
43
|
+
error: string;
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region src/ui/WaapComponent.d.ts
|
|
47
|
+
/**
|
|
48
|
+
* WaaP Component
|
|
49
|
+
*
|
|
50
|
+
* A custom HTML element that allows developers to control where the WaaP wallet
|
|
51
|
+
* renders in their UI. When present, the wallet will render inside this component
|
|
52
|
+
* instead of as a centered modal with backdrop.
|
|
53
|
+
*
|
|
54
|
+
* Usage in HTML:
|
|
55
|
+
* ```html
|
|
56
|
+
* <waap-wallet></waap-wallet>
|
|
57
|
+
* ```
|
|
58
|
+
*
|
|
59
|
+
* Usage in React/JSX:
|
|
60
|
+
* ```tsx
|
|
61
|
+
* function App() {
|
|
62
|
+
* return <waap-wallet style={{ width: '400px', height: '600px' }} />
|
|
63
|
+
* }
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
/**
|
|
67
|
+
* Custom HTML element for WaaP wallet
|
|
68
|
+
* Only defined in browser environments to avoid SSR issues
|
|
69
|
+
*/
|
|
70
|
+
declare let WaapWalletElement: any;
|
|
71
|
+
//#endregion
|
|
72
|
+
//#region src/lib/provider/EthereumProviderExtension.d.ts
|
|
73
|
+
declare class EthereumProviderExtension extends EventEmitter implements EthereumProviderInterface {
|
|
74
|
+
readonly isSilk = true;
|
|
75
|
+
connected: boolean;
|
|
76
|
+
config: CustomConfig;
|
|
77
|
+
constructor(customConfig?: CustomConfig);
|
|
78
|
+
sendToExtension(args: RequestArguments): Promise<unknown>;
|
|
79
|
+
request(args: RequestArguments): Promise<unknown>;
|
|
80
|
+
enable(): Promise<unknown>;
|
|
81
|
+
isConnected(): boolean;
|
|
82
|
+
login(): Promise<unknown>;
|
|
83
|
+
requestSBT(type: CredentialType): Promise<unknown>;
|
|
84
|
+
toggleDarkMode(): Promise<void>;
|
|
85
|
+
safe(): Promise<unknown>;
|
|
86
|
+
}
|
|
87
|
+
//#endregion
|
|
88
|
+
//#region src/lib/provider/EthereumProvider.d.ts
|
|
89
|
+
declare class EthereumProvider extends EventEmitter implements SilkEthereumProviderInterface {
|
|
90
|
+
/**
|
|
91
|
+
* Last conversion state the wallet actually reported. The synchronous status
|
|
92
|
+
* accessor cannot await the iframe, and previously answered `complete` for any
|
|
93
|
+
* logged-in user — a definite claim it had no basis for. `pending` means "not
|
|
94
|
+
* yet resolved", which is the truth until `getCanonicalAccountStatus` runs.
|
|
95
|
+
*/
|
|
96
|
+
private lastKnownConversion;
|
|
97
|
+
readonly isSilk = true;
|
|
98
|
+
readonly isWaaP = true;
|
|
99
|
+
connected: boolean;
|
|
100
|
+
walletMessageManager: WalletMessageManager;
|
|
101
|
+
uiMessageManager: UIMessageManager;
|
|
102
|
+
config: CustomConfig;
|
|
103
|
+
private currentAccount;
|
|
104
|
+
private accountMode;
|
|
105
|
+
private walletConnectProvider;
|
|
106
|
+
/**
|
|
107
|
+
* When true, eth_sendTransaction resolves with the signed transaction hash.
|
|
108
|
+
* Broadcasting continues in the background with lifecycle events.
|
|
109
|
+
*/
|
|
110
|
+
private asyncTxs;
|
|
111
|
+
/**
|
|
112
|
+
* When true, sends `asyncSigning: true` in silkOptions instead of `async: true`.
|
|
113
|
+
* This mimics the v1 SDK protocol for backward compatibility testing.
|
|
114
|
+
* @internal
|
|
115
|
+
*/
|
|
116
|
+
private legacyAsyncSigning;
|
|
117
|
+
private persistedMethods;
|
|
118
|
+
/**
|
|
119
|
+
* We use the internalEventEmitter to emit as events
|
|
120
|
+
* Silk messages posted to the window.
|
|
121
|
+
*/
|
|
122
|
+
internalEventEmitter: EventEmitter;
|
|
123
|
+
/**
|
|
124
|
+
* @param iframeWindow - The contentWindow of the iframe of the Silk website.
|
|
125
|
+
* @param referralCode - Silk points referral code
|
|
126
|
+
* @param customConfig - Silk custom UI configuration
|
|
127
|
+
* @param project - Silk project configuration
|
|
128
|
+
* @param walletOrigin - Resolved wallet iframe origin
|
|
129
|
+
* @param asyncTxs - When true, eth_sendTransaction resolves with the signed transaction hash while broadcasting continues in the background
|
|
130
|
+
* @param legacyAsyncSigning - When true, sends asyncSigning in silkOptions (v1 compat)
|
|
131
|
+
*/
|
|
132
|
+
/**
|
|
133
|
+
* `deferIframe` mode: called on first use to create the iframe and return its
|
|
134
|
+
* contentWindow. Undefined in eager mode. Once invoked, `iframeMounted` flips
|
|
135
|
+
* true and the referral/project/config setup is replayed against the iframe.
|
|
136
|
+
*/
|
|
137
|
+
private ensureIframe?;
|
|
138
|
+
private iframeMounted;
|
|
139
|
+
private referralCode?;
|
|
140
|
+
private project?;
|
|
141
|
+
private customConfig?;
|
|
142
|
+
private initializerChains;
|
|
143
|
+
private sessionProtection?;
|
|
144
|
+
private initializerPromise;
|
|
145
|
+
/** Shared silent session probe for concurrent signing/connect requests. */
|
|
146
|
+
private sessionProbe;
|
|
147
|
+
private initializedIframeWindow;
|
|
148
|
+
constructor(iframeWindow: Window | null, referralCode?: string, customConfig?: CustomConfig, project?: ProjectConfig, walletOrigin?: string, asyncTxs?: boolean, legacyAsyncSigning?: boolean, ensureIframe?: () => Window | null, initializerChains?: readonly ('evm' | 'sui' | 'solana')[], sessionProtection?: WaaPSessionProtection);
|
|
149
|
+
private initializeWalletConnect;
|
|
150
|
+
/**
|
|
151
|
+
* Select the initialized signer family and atomically apply its public
|
|
152
|
+
* config. The wallet still accepts the old mode-only envelope, so released
|
|
153
|
+
* SDKs and old integrations remain wire-compatible.
|
|
154
|
+
*/
|
|
155
|
+
initializeIframeContext(): Promise<void>;
|
|
156
|
+
/**
|
|
157
|
+
* Reapply this facade's signer family after a restored wallet session has
|
|
158
|
+
* hydrated. The one-time initializer intentionally cannot do this itself:
|
|
159
|
+
* a persisted wallet-store selection may hydrate after the first envelope.
|
|
160
|
+
*
|
|
161
|
+
* @internal Shared initializers use this after login; applications should
|
|
162
|
+
* select their family by calling the appropriate public initializer.
|
|
163
|
+
*/
|
|
164
|
+
reassertIframeAccountMode(): Promise<void>;
|
|
165
|
+
/**
|
|
166
|
+
* In `deferIframe` mode, create the iframe on first use and point the message
|
|
167
|
+
* manager at it. Initialization is then performed by the operation that
|
|
168
|
+
* required the iframe. No-op in eager mode / once
|
|
169
|
+
* already mounted.
|
|
170
|
+
*/
|
|
171
|
+
private ensureIframeMounted;
|
|
172
|
+
/** Ensure every public wallet operation supports deferred mounting. */
|
|
173
|
+
private ensureInitialized;
|
|
174
|
+
/** Warm the iframe after the host app's LCP without opening wallet UI. */
|
|
175
|
+
preload(): Promise<void>;
|
|
176
|
+
enable(): Promise<unknown>;
|
|
177
|
+
isConnected(): boolean;
|
|
178
|
+
/** Public-safe status for this initializer family. */
|
|
179
|
+
getAccountStatus(): WaaPAccountStatus;
|
|
180
|
+
get session(): WaaPSessionExtension;
|
|
181
|
+
/** Fetch the canonical, redacted account snapshot from the wallet iframe. */
|
|
182
|
+
getCanonicalAccountStatus(): Promise<WaaPAccountStatus>;
|
|
183
|
+
/** @internal Initializers set this once; applications select a mode by initializer. */
|
|
184
|
+
setAccountMode(mode: WaaPAccountMode): void;
|
|
185
|
+
request(args: RequestArguments): Promise<unknown>;
|
|
186
|
+
login(customProvider?: EthereumProviderInterface): Promise<LoginResponse>;
|
|
187
|
+
login(options: WaaPLoginOptions): Promise<LoginResponse>;
|
|
188
|
+
logout(): Promise<unknown>;
|
|
189
|
+
/** Release listeners owned by this EVM facade. */
|
|
190
|
+
destroy(): void;
|
|
191
|
+
private cleanupInvalidLoginState;
|
|
192
|
+
/**
|
|
193
|
+
* Helper method to set up window.waap for WaaP
|
|
194
|
+
*/
|
|
195
|
+
private setupWaaP;
|
|
196
|
+
/**
|
|
197
|
+
* Helper method to set up window.silk for injected wallets (e.g., MetaMask)
|
|
198
|
+
*/
|
|
199
|
+
private setupInjectedWallet;
|
|
200
|
+
/**
|
|
201
|
+
* Helper method to set up window.silk for WalletConnect
|
|
202
|
+
*/
|
|
203
|
+
private setupWalletConnect;
|
|
204
|
+
/**
|
|
205
|
+
* Helper method to set up window.silk for auto-connect with injected wallets
|
|
206
|
+
*/
|
|
207
|
+
private setupAutoConnectInjected;
|
|
208
|
+
/**
|
|
209
|
+
* Helper method to set up window.silk for auto-connect with WalletConnect
|
|
210
|
+
*/
|
|
211
|
+
private setupAutoConnectWalletConnect;
|
|
212
|
+
/**
|
|
213
|
+
* Attempts to auto-connect using previously stored login method
|
|
214
|
+
* @param method - The RPC method being called
|
|
215
|
+
* @returns Promise<unknown> if auto-connect succeeds, null if it should fall through to normal flow
|
|
216
|
+
*/
|
|
217
|
+
private attemptAutoConnect;
|
|
218
|
+
/**
|
|
219
|
+
* Coalesce concurrent silent session restores. This avoids repeating the
|
|
220
|
+
* status plus auto-connect round trips for a burst of signing requests.
|
|
221
|
+
*/
|
|
222
|
+
private restorePersistedWaaPSession;
|
|
223
|
+
/** Probe the iframe's actual WaaP session without ever presenting wallet UI. */
|
|
224
|
+
private probeWaaPSession;
|
|
225
|
+
getLoginMethod(): LoginResponse;
|
|
226
|
+
toggleDarkMode(): Promise<void>;
|
|
227
|
+
safe(): Promise<void>;
|
|
228
|
+
orcid(): Promise<void>;
|
|
229
|
+
/**
|
|
230
|
+
* INTERNAL METHOD: Gas tank administration operations
|
|
231
|
+
* This method is ONLY accessible from the Dev Portal domain
|
|
232
|
+
* It's not included in the public typing to hide it from regular dApps
|
|
233
|
+
*/
|
|
234
|
+
portal(feature: 'gastank' | 'customization' | 'project', operation: 'get' | 'update' | 'topup' | 'init', payload?: any): Promise<unknown>;
|
|
235
|
+
requestEmail(): Promise<unknown>;
|
|
236
|
+
/**
|
|
237
|
+
* Request a Permission Token from the user.
|
|
238
|
+
* Allows pre-authorized transactions without individual confirmations.
|
|
239
|
+
* @param params - Permission token parameters (allowed addresses, chain, limits, expiry)
|
|
240
|
+
* @returns Promise<RequestPermissionTokenResult>
|
|
241
|
+
*/
|
|
242
|
+
requestPermissionToken(params: RequestPermissionTokenParams): Promise<unknown>;
|
|
243
|
+
getPermissionTokenStatus(query: PermissionTokenQuery): Promise<PermissionTokenStatus>;
|
|
244
|
+
clearPermissionToken(query: PermissionTokenQuery): Promise<PermissionTokenClearResult>;
|
|
245
|
+
/**
|
|
246
|
+
* Prompt the user to mint a Zeronym SBT.
|
|
247
|
+
* @returns string or null - The address of the owner of the SBT, or null
|
|
248
|
+
* if the user already minted the SBT.
|
|
249
|
+
*/
|
|
250
|
+
requestSBT(type: CredentialType): Promise<unknown>;
|
|
251
|
+
}
|
|
252
|
+
//#endregion
|
|
253
|
+
//#region src/lib/provider/requests.d.ts
|
|
254
|
+
/**
|
|
255
|
+
* Options passed to iframe for transaction behavior
|
|
256
|
+
*/
|
|
257
|
+
interface WaaPRequestOptions {
|
|
258
|
+
async?: boolean;
|
|
259
|
+
withPT?: boolean;
|
|
260
|
+
/** Timeout for non-interactive requests, in milliseconds. SDK-side only, not forwarded to the iframe. */
|
|
261
|
+
timeoutMs?: number;
|
|
262
|
+
/** Cancel this SDK wait and remove its queued iframe request. */
|
|
263
|
+
signal?: AbortSignal;
|
|
264
|
+
}
|
|
265
|
+
/** Whether a standard EIP-1193 request must show wallet UI. */
|
|
266
|
+
declare const rpcMethodRequiresUI: (method: JSON_RPC_METHOD) => boolean;
|
|
267
|
+
/**
|
|
268
|
+
* Send request to wallet in iframe, and upon receiving the wallet's response
|
|
269
|
+
* or error, hide modal and return wallet's response or throw wallet's error.
|
|
270
|
+
*/
|
|
271
|
+
declare function handleWalletRequestAndResponse(args: RequestArguments, interactionRequired: boolean, walletMessageManager: WalletMessageManager, internalProviderEventEmitter: EventEmitter, silkOptions?: WaaPRequestOptions): Promise<any>;
|
|
272
|
+
//#endregion
|
|
273
|
+
export { type Async2faRequiredEvent, type AsyncEvent, type AsyncEventType, type AsyncSignCompleteEvent, type AsyncSignFailedEvent, type AsyncSignPendingEvent, type AsyncTxConfirmedEvent, type AsyncTxFailedEvent, type AsyncTxPendingEvent, type AsyncTxResponse, type AuthenticationMethod, type CancelWaaPPreload, type CredentialType, EthereumProvider, EthereumProviderExtension, type InitSilkOptions, type InitWaaPChainOptions, type InitWaaPMultiOptions, type InitWaaPOptions, type InitWaaPSolanaOptions, type InitWaaPSquidOptions, type InitWaaPSuiOptions, type InitWaaPTapOptions, type PermissionTokenClearResult, type PermissionTokenQuery, type PermissionTokenStatus, type PostSilkRequestArgs, type PostSilkRequestArgs as PostWaaPRequestArgs, type ProjectConfig, type RequestPermissionTokenParams, type RequestPermissionTokenResult, SILK_METHOD, SILK_METHOD as WAAP_METHOD, type SilkEthereumProviderInterface, type SilkEthereumProviderInterface as WaaPEthereumProviderInterface, type SilkOptions, type SilkProvider, type SilkProvider as WaaPProvider, SilkWalletConnect, SilkWalletConnect as WaaPWalletConnect, type SocialProvider, type SolanaAccount, type SolanaChain, type SolanaConnectInput, type SolanaConnectOutput, type SolanaSignAndSendTransactionInput, type SolanaSignAndSendTransactionOutput, type SolanaSignMessageInput, type SolanaSignMessageOutput, type SolanaSignTransactionInput, type SolanaSignTransactionOutput, type SolanaStandardSignAndSendTransactionInput, type SolanaStandardSignAndSendTransactionOutput, type SolanaStandardSignMessageInput, type SolanaStandardSignMessageOutput, type SolanaStandardSignTransactionInput, type SolanaStandardSignTransactionOutput, type SquidFailedEvent, type SquidLifecycleEventType, type SquidPendingEvent, type SquidReadyEvent, type StylesConfig, type SuiAccount, type SuiChain, type SuiConnectInput, type SuiConnectOutput, type SuiSignAndExecuteTransactionInput, type SuiSignAndExecuteTransactionOutput, type SuiSignPersonalMessageInput, type SuiSignPersonalMessageOutput, type SuiSignTransactionInput, type SuiSignTransactionOutput, type SuiTransactionInput, type TxState, UIMessageManager, UI_EVENT_NAMES, type UseWaapTransactionOptions, type UseWaapTransactionReturn, WAAP_EVENTS, WaapWalletElement as WaaP, type WaaPAccountMode, type WaaPAccountStatus, type WaaPChain, type WaaPEnvironment, WaaPError, type WaaPErrorCode, type WaaPIdlePreloadOptions, type WaaPIframeDiagnostics, type WaaPIframeLifecycleEvent, type WaaPIframeLifecyclePhase, type WaaPLoginOptions, type WaaPOperationMetadata, type WaaPPreloadTarget, type WaaPSessionProtection, WaaPSolanaProvider, type WaaPSolanaProviderInterface, type WaaPSolanaWalletFeatures, type WaaPSquid, type WaaPSquidChain, type WaaPSquidLifecycle, type WaaPSquidSession, type WaaPSquidStatus, type WaaPSquidStatusState, WaaPSuiWallet, type WaaPSuiWalletFeatures, type WaaPSuiWalletInterface, type WaaPTap, type WaaPTapSession, type WaaPWalletTargetOptions, WalletMessageManager, getWaaPIframeDiagnostics, handleWalletRequestAndResponse, initWaaP, initWaaPMulti, initWaaPSolana, initWaaPSquid, initWaaPSui, initWaaPTap, normalizeWaaPError, preloadWaaPOnIdle, registerWaaPSolanaWallet, registerWaaPSuiWallet, resolveWalletOrigin, rpcMethodRequiresUI, subscribeWaaPIframeLifecycle, useWaapAuth, useWaapTransaction, validateWalletOrigin };
|