@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.
Files changed (59) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +167 -216
  3. package/dist/WaaPError-C5nPcaKk.d.mts +168 -0
  4. package/dist/WaaPError-XLgIXUgh.d.ts +168 -0
  5. package/dist/WalletConnect-BTT6LtUu.d.mts +33 -0
  6. package/dist/WalletConnect-BTT6LtUu.d.ts +33 -0
  7. package/dist/WalletConnect-Deg7_JmH.mjs +4 -0
  8. package/dist/WalletConnect-G-lbqknM.js +4 -0
  9. package/dist/asyncSigning-B0KrmKk7.js +1 -0
  10. package/dist/asyncSigning-CzqBbYDP.mjs +1 -0
  11. package/dist/esm-B4jz8Emb.mjs +1 -0
  12. package/dist/esm-D5fDQenf.js +1 -0
  13. package/dist/evm-Ch-aWWat.js +1 -0
  14. package/dist/evm-DHVrAmEw.mjs +1 -0
  15. package/dist/evm.d.mts +7 -0
  16. package/dist/evm.d.ts +7 -0
  17. package/dist/evm.js +1 -0
  18. package/dist/evm.mjs +1 -0
  19. package/dist/index-CMSufeMa.d.ts +775 -0
  20. package/dist/index-CdKntlzX.d.mts +775 -0
  21. package/dist/index.d.mts +239 -933
  22. package/dist/index.d.ts +239 -933
  23. package/dist/index.js +1 -2191
  24. package/dist/index.mjs +1 -2162
  25. package/dist/initializerContext-0oKHzvQG.d.ts +21 -0
  26. package/dist/initializerContext-C39PUnGi.d.mts +21 -0
  27. package/dist/react.d.mts +2 -0
  28. package/dist/react.d.ts +2 -0
  29. package/dist/react.js +1 -0
  30. package/dist/react.mjs +1 -0
  31. package/dist/register-4Afr2Jx8.js +1 -0
  32. package/dist/register-CBlzg5ln.d.ts +107 -0
  33. package/dist/register-CNgjA0yl.mjs +1 -0
  34. package/dist/register-CxsUwgKJ.d.ts +282 -0
  35. package/dist/register-DIZnKDHF.mjs +1 -0
  36. package/dist/register-LmdJdvzn.d.mts +282 -0
  37. package/dist/register-QjrsOe7r.d.mts +107 -0
  38. package/dist/register-ozKwGWOb.js +1 -0
  39. package/dist/solana.d.mts +5 -0
  40. package/dist/solana.d.ts +5 -0
  41. package/dist/solana.js +1 -0
  42. package/dist/solana.mjs +1 -0
  43. package/dist/sui.d.mts +5 -0
  44. package/dist/sui.d.ts +5 -0
  45. package/dist/sui.js +1 -0
  46. package/dist/sui.mjs +1 -0
  47. package/dist/types-DexmJNke.d.mts +397 -0
  48. package/dist/types-DexmJNke.d.ts +397 -0
  49. package/dist/ui-16QpbEyG.js +1 -0
  50. package/dist/ui-BAYRtDQg.mjs +1 -0
  51. package/dist/useWaapAuth-BrqAhAn2.d.ts +246 -0
  52. package/dist/useWaapAuth-C5I7QqyW.d.mts +246 -0
  53. package/dist/useWaapAuth-DHIeb4yc.mjs +1 -0
  54. package/dist/useWaapAuth-Z_ONicYr.js +1 -0
  55. package/dist/walletconnect.d.mts +2 -0
  56. package/dist/walletconnect.d.ts +2 -0
  57. package/dist/walletconnect.js +1 -0
  58. package/dist/walletconnect.mjs +1 -0
  59. package/package.json +53 -18
@@ -0,0 +1,21 @@
1
+ import { M as WaaPSessionProtection, b as CustomConfig, x as ProjectConfig } from "./types-DexmJNke.js";
2
+ import { EventEmitter } from "events";
3
+ //#region src/lib/UIMessageManager.d.ts
4
+ declare enum UI_EVENT_NAMES {
5
+ show_modal = "show_modal",
6
+ hide_modal = "hide_modal"
7
+ }
8
+ declare class UIMessageManager extends EventEmitter {
9
+ constructor();
10
+ }
11
+ //#endregion
12
+ //#region src/lib/initializerContext.d.ts
13
+ type WaaPInitializerOptions = {
14
+ referralCode?: string;
15
+ project?: ProjectConfig;
16
+ config?: CustomConfig;
17
+ chains?: readonly ('evm' | 'sui' | 'solana')[];
18
+ sessionProtection?: WaaPSessionProtection;
19
+ };
20
+ //#endregion
21
+ export { UIMessageManager as n, UI_EVENT_NAMES as r, WaaPInitializerOptions as t };
@@ -0,0 +1,21 @@
1
+ import { M as WaaPSessionProtection, b as CustomConfig, x as ProjectConfig } from "./types-DexmJNke.mjs";
2
+ import { EventEmitter } from "events";
3
+ //#region src/lib/UIMessageManager.d.ts
4
+ declare enum UI_EVENT_NAMES {
5
+ show_modal = "show_modal",
6
+ hide_modal = "hide_modal"
7
+ }
8
+ declare class UIMessageManager extends EventEmitter {
9
+ constructor();
10
+ }
11
+ //#endregion
12
+ //#region src/lib/initializerContext.d.ts
13
+ type WaaPInitializerOptions = {
14
+ referralCode?: string;
15
+ project?: ProjectConfig;
16
+ config?: CustomConfig;
17
+ chains?: readonly ('evm' | 'sui' | 'solana')[];
18
+ sessionProtection?: WaaPSessionProtection;
19
+ };
20
+ //#endregion
21
+ export { UIMessageManager as n, UI_EVENT_NAMES as r, WaaPInitializerOptions as t };
@@ -0,0 +1,2 @@
1
+ import { a as useWaapTransaction, i as UseWaapTransactionReturn, n as TxState, r as UseWaapTransactionOptions, t as useWaapAuth } from "./useWaapAuth-C5I7QqyW.mjs";
2
+ export { type TxState, type UseWaapTransactionOptions, type UseWaapTransactionReturn, useWaapAuth, useWaapTransaction };
@@ -0,0 +1,2 @@
1
+ import { a as useWaapTransaction, i as UseWaapTransactionReturn, n as TxState, r as UseWaapTransactionOptions, t as useWaapAuth } from "./useWaapAuth-BrqAhAn2.js";
2
+ export { type TxState, type UseWaapTransactionOptions, type UseWaapTransactionReturn, useWaapAuth, useWaapTransaction };
package/dist/react.js ADDED
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./useWaapAuth-Z_ONicYr.js");exports.useWaapAuth=e.t,exports.useWaapTransaction=e.n;
package/dist/react.mjs ADDED
@@ -0,0 +1 @@
1
+ import{n as e,t}from"./useWaapAuth-DHIeb4yc.mjs";export{t as useWaapAuth,e as useWaapTransaction};
@@ -0,0 +1 @@
1
+ const e=require("./ui-16QpbEyG.js");let t=require("@mysten/wallet-standard");function n(n,r={}){let i=new e.c(n,r);return(0,t.registerWallet)(i),i}Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return n}});
@@ -0,0 +1,107 @@
1
+ import { C as RequestPermissionTokenResult, S as RequestPermissionTokenParams, a as PermissionTokenQuery, d as WaaPAccountStatus, i as PermissionTokenClearResult, o as PermissionTokenStatus, p as WaaPSessionExtension, r as LoginResponse, u as WaaPAccountMode } from "./types-DexmJNke.js";
2
+ import { A as SolanaSignTransactionInput, B as WaaPSolanaWalletFeatures, C as SolanaChain, D as SolanaSignAndSendTransactionOutput, E as SolanaSignAndSendTransactionInput, O as SolanaSignMessageInput, R as SolanaWalletEventListener, S as SolanaAccount, T as SolanaConnectOutput, j as SolanaSignTransactionOutput, k as SolanaSignMessageOutput, w as SolanaConnectInput, x as InitWaaPSolanaOptions, z as WaaPSolanaProviderInterface } from "./index-CMSufeMa.js";
3
+ import { n as UIMessageManager, t as WaaPInitializerOptions } from "./initializerContext-0oKHzvQG.js";
4
+ //#region src/lib/solana/SolanaProvider.d.ts
5
+ declare class WaaPSolanaProvider implements WaaPSolanaProviderInterface {
6
+ /**
7
+ * Last conversion state the wallet actually reported. The synchronous status
8
+ * accessor cannot await the iframe, and previously answered `complete` for any
9
+ * logged-in user — a definite claim it had no basis for. `pending` here means
10
+ * "not yet resolved", which is the truth until `getCanonicalAccountStatus`
11
+ * runs.
12
+ */
13
+ private lastKnownConversion;
14
+ readonly name = "WaaP";
15
+ readonly version = "1.0.0";
16
+ readonly icon = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2NCA2NCI+PHJlY3Qgd2lkdGg9IjY0IiBoZWlnaHQ9IjY0IiByeD0iMTYiIGZpbGw9IiMxMTE4MmMiLz48cGF0aCBkPSJNMTYgNDhoMzJMMzIgMTZ6IiBmaWxsPSIjN2NkNGZmIi8+PC9zdmc+";
17
+ private _accounts;
18
+ private accountMode;
19
+ private loginMethod;
20
+ private _chains;
21
+ private walletMessageManager;
22
+ private uiMessageManager;
23
+ private internalEventEmitter;
24
+ private changeListeners;
25
+ private ensureIframe?;
26
+ private iframeMounted;
27
+ private initializerOptions;
28
+ private initializerPromise;
29
+ private initializedIframeWindow;
30
+ constructor(iframeWindow: Window | null, options?: InitWaaPSolanaOptions, ensureIframe?: () => Window | null, initializerOptions?: WaaPInitializerOptions);
31
+ /** Release listeners owned by this Solana facade. */
32
+ destroy(): void;
33
+ private ensureIframeMounted;
34
+ /** Warm the iframe after the host app's LCP without opening wallet UI. */
35
+ preload(): Promise<void>;
36
+ private ensureInitialized;
37
+ get chains(): readonly SolanaChain[];
38
+ get accounts(): readonly SolanaAccount[];
39
+ /**
40
+ * Solana Wallet Standard capabilities. The standard methods are variadic;
41
+ * WaaP handles them sequentially so each request retains its own approval
42
+ * and iframe interaction rather than racing multiple approval dialogs.
43
+ */
44
+ get features(): WaaPSolanaWalletFeatures;
45
+ get ui(): UIMessageManager;
46
+ getAccountStatus(): WaaPAccountStatus;
47
+ get session(): WaaPSessionExtension;
48
+ getCanonicalAccountStatus(): Promise<WaaPAccountStatus>;
49
+ /** @internal Initializers set this once; applications select a mode by initializer. */
50
+ setAccountMode(mode: WaaPAccountMode): void;
51
+ /** @internal Tell the iframe which initializer family owns this facade. */
52
+ selectAccountMode(mode: WaaPAccountMode, options?: WaaPInitializerOptions): Promise<void>;
53
+ /** @internal Shared multichain initializers propagate their EVM login here. */
54
+ setLoginMethod(loginMethod: LoginResponse): void;
55
+ getLoginMethod(): LoginResponse;
56
+ login(): Promise<LoginResponse>;
57
+ logout(): Promise<void>;
58
+ private refreshAccounts;
59
+ /**
60
+ * The iframe posts publicKey as a number[] (postMessage can't carry a
61
+ * Uint8Array reliably across all bridges). Normalize back to Uint8Array.
62
+ */
63
+ private normalizeAccounts;
64
+ connect(input?: SolanaConnectInput): Promise<SolanaConnectOutput>;
65
+ /** Read an existing iframe session without opening the wallet modal. */
66
+ private restoreSession;
67
+ /** Keep the local Wallet Standard facade aligned with the iframe session. */
68
+ private syncLoginMethodFromCanonicalStatus;
69
+ disconnect(): Promise<void>;
70
+ signMessage(input: SolanaSignMessageInput): Promise<SolanaSignMessageOutput>;
71
+ signTransaction(input: SolanaSignTransactionInput): Promise<SolanaSignTransactionOutput>;
72
+ signAndSendTransaction(input: SolanaSignAndSendTransactionInput): Promise<SolanaSignAndSendTransactionOutput>;
73
+ private signStandardMessages;
74
+ private signStandardTransactions;
75
+ private signAndSendStandardTransactions;
76
+ private asSupportedChain;
77
+ private broadcastOptions;
78
+ requestPermissionToken(params: RequestPermissionTokenParams): Promise<RequestPermissionTokenResult>;
79
+ getPermissionTokenStatus(query: PermissionTokenQuery): Promise<PermissionTokenStatus>;
80
+ clearPermissionToken(query: PermissionTokenQuery): Promise<PermissionTokenClearResult>;
81
+ /**
82
+ * Accept either raw bytes or a `@solana/web3.js` (Versioned)Transaction with
83
+ * a `.serialize()` method. Object serialization runs in the dApp context
84
+ * where the tx library is available.
85
+ */
86
+ private resolveTransactionBytes;
87
+ on(event: 'change', listener: SolanaWalletEventListener): () => void;
88
+ on(event: string, listener: (...args: any[]) => void): () => void;
89
+ /**
90
+ * Remove a previously registered `connect` / `accountsChanged` listener.
91
+ * (`change` listeners are removed via the unsubscribe fn returned by `on`.)
92
+ */
93
+ removeListener(event: string, listener: (...args: any[]) => void): void;
94
+ private postRequestAndWait;
95
+ private notifyChange;
96
+ }
97
+ //#endregion
98
+ //#region src/lib/solana/register.d.ts
99
+ /**
100
+ * Register a WaaP Solana Wallet Standard instance for discovery by compatible
101
+ * dapps. `initWaaP({ chain: 'solana' })` is the recommended
102
+ * standalone initializer; use this
103
+ * explicit form when the host application owns Wallet Standard discovery.
104
+ */
105
+ declare function registerWaaPSolanaWallet(iframeWindow: Window, options?: InitWaaPSolanaOptions): WaaPSolanaProviderInterface;
106
+ //#endregion
107
+ export { WaaPSolanaProvider as n, registerWaaPSolanaWallet as t };
@@ -0,0 +1 @@
1
+ import{s as e}from"./ui-BAYRtDQg.mjs";import{registerWallet as t}from"@wallet-standard/wallet";function n(n,r={}){let i=new e(n,r);return i.setAccountMode(`tap`),i.selectAccountMode(`tap`).catch(()=>void 0),t(i),i}export{n as t};
@@ -0,0 +1,282 @@
1
+ import { C as RequestPermissionTokenResult, S as RequestPermissionTokenParams, a as PermissionTokenQuery, d as WaaPAccountStatus, i as PermissionTokenClearResult, o as PermissionTokenStatus, p as WaaPSessionExtension, r as LoginResponse, u as WaaPAccountMode } from "./types-DexmJNke.js";
2
+ import { $ as SuiSignTransactionBlockOutput, G as SuiConnectOutput, H as SuiAccount, J as SuiSignAndExecuteTransactionInput, K as SuiSignAndExecuteTransactionBlockInput, Q as SuiSignTransactionBlockInput, U as SuiChain, V as InitWaaPSuiOptions, W as SuiConnectInput, X as SuiSignPersonalMessageInput, Y as SuiSignAndExecuteTransactionOutput, Z as SuiSignPersonalMessageOutput, at as WaaPSuiWalletInterface, ot as WalletIcon, q as SuiSignAndExecuteTransactionBlockOutput, rt as SuiWalletEventListener } from "./index-CMSufeMa.js";
3
+ import { n as UIMessageManager, t as WaaPInitializerOptions } from "./initializerContext-0oKHzvQG.js";
4
+ //#region src/lib/sui/SuiWallet.d.ts
5
+ /**
6
+ * WaaP Sui Wallet implementation.
7
+ *
8
+ * Implements the Sui Wallet Standard to allow dApps to:
9
+ * - Connect/disconnect
10
+ * - Sign personal messages
11
+ * - (Future) Sign and execute transactions
12
+ */
13
+ declare class WaaPSuiWallet implements WaaPSuiWalletInterface {
14
+ /**
15
+ * Last conversion state the wallet actually reported. The synchronous status
16
+ * accessor cannot await the iframe, and previously answered `complete` for any
17
+ * logged-in user — a definite claim it had no basis for. `pending` here means
18
+ * "not yet resolved", which is the truth until `getCanonicalAccountStatus`
19
+ * runs.
20
+ */
21
+ private lastKnownConversion;
22
+ readonly name = "WaaP";
23
+ readonly version = "1.0.0";
24
+ readonly icon: WalletIcon;
25
+ private _accounts;
26
+ private accountMode;
27
+ private loginMethod;
28
+ private _chains;
29
+ private walletMessageManager;
30
+ private uiMessageManager;
31
+ private internalEventEmitter;
32
+ private changeListeners;
33
+ private ensureIframe?;
34
+ private iframeMounted;
35
+ private initializerOptions;
36
+ private initializerPromise;
37
+ private initializedIframeWindow;
38
+ /**
39
+ * Creates a new WaaPSuiWallet instance.
40
+ *
41
+ * @param iframeWindow - The contentWindow of the WaaP iframe
42
+ * @param options - Initialization options
43
+ */
44
+ constructor(iframeWindow: Window | null, options?: InitWaaPSuiOptions, ensureIframe?: () => Window | null, initializerOptions?: WaaPInitializerOptions);
45
+ /** Release listeners owned by this Sui facade. */
46
+ destroy(): void;
47
+ private ensureIframeMounted;
48
+ /** Warm the iframe after the host app's LCP without opening wallet UI. */
49
+ preload(): Promise<void>;
50
+ private ensureInitialized;
51
+ /**
52
+ * Refresh accounts by making a silent connect request.
53
+ * Used internally when account changes are detected.
54
+ */
55
+ private refreshAccounts;
56
+ /**
57
+ * Supported chains.
58
+ */
59
+ get chains(): readonly SuiChain[];
60
+ /**
61
+ * Connected accounts.
62
+ */
63
+ get accounts(): readonly SuiAccount[];
64
+ /**
65
+ * UI message manager for showing/hiding modal.
66
+ */
67
+ get ui(): UIMessageManager;
68
+ getAccountStatus(): WaaPAccountStatus;
69
+ get session(): WaaPSessionExtension;
70
+ getCanonicalAccountStatus(): Promise<WaaPAccountStatus>;
71
+ /** @internal Initializers set this once; applications select a mode by initializer. */
72
+ setAccountMode(mode: WaaPAccountMode): void;
73
+ /** @internal Tell the iframe which initializer family owns this facade. */
74
+ selectAccountMode(mode: WaaPAccountMode, options?: WaaPInitializerOptions): Promise<void>;
75
+ /** @internal Shared multichain initializers propagate their EVM login here. */
76
+ setLoginMethod(loginMethod: LoginResponse): void;
77
+ getLoginMethod(): LoginResponse;
78
+ login(): Promise<LoginResponse>;
79
+ logout(): Promise<void>;
80
+ /**
81
+ * Connect to the wallet.
82
+ */
83
+ connect(input?: SuiConnectInput): Promise<SuiConnectOutput>;
84
+ /** Read an existing iframe session without opening the wallet modal. */
85
+ private restoreSession;
86
+ /** Keep the local Wallet Standard facade aligned with the iframe session. */
87
+ private syncLoginMethodFromCanonicalStatus;
88
+ /**
89
+ * Disconnect from the wallet.
90
+ */
91
+ disconnect(): Promise<void>;
92
+ /**
93
+ * Sign a personal message.
94
+ *
95
+ * @param input - Sign personal message input
96
+ * @returns Signed message result with bytes and signature
97
+ */
98
+ signPersonalMessage(input: SuiSignPersonalMessageInput): Promise<SuiSignPersonalMessageOutput>;
99
+ /**
100
+ * Extract the destination addresses from BCS-serialized Sui transaction bytes.
101
+ *
102
+ * Unlike EVM transactions where `to` is a top-level field, Sui transaction
103
+ * destinations are embedded in BCS-encoded programmable transaction blocks.
104
+ * We deserialize with Transaction.from() and inspect TransferObjects commands.
105
+ *
106
+ * Only TransferObjects destinations are extracted — MoveCall package addresses
107
+ * are not user-facing recipients and should not be validated against a PT's
108
+ * allowedAddresses list.
109
+ *
110
+ * Returns an empty array if no TransferObjects are found or deserialization fails.
111
+ */
112
+ private extractTransferAddresses;
113
+ /**
114
+ * Helper to resolve transaction bytes from various input formats.
115
+ * If the input is a Transaction/TransactionBlock object, it builds it.
116
+ */
117
+ private resolveTransactionBytes;
118
+ /**
119
+ * Sign a transaction.
120
+ *
121
+ * @param input - Sign transaction input with transaction
122
+ * @returns Signed transaction result with bytes and signature
123
+ */
124
+ signTransaction(input: {
125
+ transaction: unknown;
126
+ account: SuiAccount;
127
+ chain?: SuiChain;
128
+ signal?: AbortSignal;
129
+ timeoutMs?: number;
130
+ }): Promise<{
131
+ bytes: string;
132
+ signature: string;
133
+ }>;
134
+ /**
135
+ * Sign and execute a transaction.
136
+ *
137
+ * @param input - Sign and execute transaction input
138
+ */
139
+ signAndExecuteTransaction(input: SuiSignAndExecuteTransactionInput): Promise<SuiSignAndExecuteTransactionOutput>;
140
+ /**
141
+ * Switch the active chain.
142
+ */
143
+ switchChain(input: {
144
+ chain: SuiChain;
145
+ }): Promise<void>;
146
+ /**
147
+ * Subscribe to wallet change events.
148
+ *
149
+ * Supports the Wallet-Standard `change` event, plus EVM-style `connect` /
150
+ * `accountsChanged` events so cross-chain hooks (e.g. `useWaapAuth`) can
151
+ * subscribe to any facade uniformly.
152
+ *
153
+ * @param event - `'change'` | `'connect'` | `'accountsChanged'`
154
+ * @param listener - Event listener callback
155
+ * @returns Unsubscribe function
156
+ */
157
+ on(event: 'change', listener: SuiWalletEventListener): () => void;
158
+ on(event: string, listener: (...args: any[]) => void): () => void;
159
+ /**
160
+ * Remove a previously registered `connect` / `accountsChanged` listener.
161
+ * (`change` listeners are removed via the unsubscribe fn returned by `on`.)
162
+ */
163
+ removeListener(event: string, listener: (...args: any[]) => void): void;
164
+ /**
165
+ * Wallet Standard features property.
166
+ * Required by @mysten/wallet-standard registerWallet.
167
+ */
168
+ get features(): {
169
+ readonly 'standard:connect': {
170
+ readonly version: "1.0.0";
171
+ readonly connect: (input?: SuiConnectInput) => Promise<SuiConnectOutput>;
172
+ };
173
+ readonly 'standard:disconnect': {
174
+ readonly version: "1.0.0";
175
+ readonly disconnect: () => Promise<void>;
176
+ };
177
+ readonly 'standard:events': {
178
+ readonly version: "1.0.0";
179
+ readonly on: {
180
+ (event: "change", listener: SuiWalletEventListener): () => void;
181
+ (event: string, listener: (...args: any[]) => void): () => void;
182
+ };
183
+ };
184
+ readonly 'sui:signPersonalMessage': {
185
+ readonly version: "1.1.0";
186
+ readonly signPersonalMessage: (input: SuiSignPersonalMessageInput) => Promise<SuiSignPersonalMessageOutput>;
187
+ };
188
+ readonly 'sui:signTransaction': {
189
+ readonly version: "2.0.0";
190
+ readonly signTransaction: (input: {
191
+ transaction: unknown;
192
+ account: SuiAccount;
193
+ chain?: SuiChain;
194
+ signal?: AbortSignal;
195
+ timeoutMs?: number;
196
+ }) => Promise<{
197
+ bytes: string;
198
+ signature: string;
199
+ }>;
200
+ };
201
+ readonly 'sui:signAndExecuteTransaction': {
202
+ readonly version: "1.0.0";
203
+ readonly signAndExecuteTransaction: (input: SuiSignAndExecuteTransactionInput) => Promise<SuiSignAndExecuteTransactionOutput>;
204
+ };
205
+ readonly 'sui:signTransactionBlock': {
206
+ readonly version: "2.0.0";
207
+ readonly signTransactionBlock: (input: SuiSignTransactionBlockInput) => Promise<SuiSignTransactionBlockOutput>;
208
+ };
209
+ readonly 'sui:signAndExecuteTransactionBlock': {
210
+ readonly version: "1.0.0";
211
+ readonly signAndExecuteTransactionBlock: (input: SuiSignAndExecuteTransactionBlockInput) => Promise<SuiSignAndExecuteTransactionBlockOutput>;
212
+ };
213
+ readonly 'sui:switchChain': {
214
+ readonly version: "1.0.0";
215
+ readonly switchChain: (input: {
216
+ chain: SuiChain;
217
+ }) => Promise<void>;
218
+ };
219
+ };
220
+ /**
221
+ * Legacy method for signing a transaction block.
222
+ * Maps to signTransaction.
223
+ */
224
+ signTransactionBlock(input: SuiSignTransactionBlockInput): Promise<SuiSignTransactionBlockOutput>;
225
+ /**
226
+ * Legacy method for signing and executing a transaction block.
227
+ * Maps to signAndExecuteTransaction.
228
+ */
229
+ signAndExecuteTransactionBlock(input: SuiSignAndExecuteTransactionBlockInput): Promise<SuiSignAndExecuteTransactionBlockOutput>;
230
+ /**
231
+ * Request a Permission Token from the user.
232
+ * Allows pre-authorised batches of Sui transactions without individual confirmations.
233
+ *
234
+ * @param params - Allowed addresses, chainId (e.g. "sui:mainnet"), spend limit, expiry
235
+ */
236
+ requestPermissionToken(params: RequestPermissionTokenParams): Promise<RequestPermissionTokenResult>;
237
+ getPermissionTokenStatus(query: PermissionTokenQuery): Promise<PermissionTokenStatus>;
238
+ clearPermissionToken(query: PermissionTokenQuery): Promise<PermissionTokenClearResult>;
239
+ /**
240
+ * Request the user's email address.
241
+ *
242
+ * @returns Promise resolving to the user's email address
243
+ */
244
+ requestEmail(): Promise<string>;
245
+ /**
246
+ * Post a request to the iframe and wait for response.
247
+ */
248
+ private postRequestAndWait;
249
+ /**
250
+ * Notify all change listeners.
251
+ */
252
+ private notifyChange;
253
+ }
254
+ //#endregion
255
+ //#region src/lib/sui/register.d.ts
256
+ /**
257
+ * Register WaaP Sui Wallet with the Wallet Standard.
258
+ *
259
+ * This makes the wallet discoverable by dApps using @mysten/dapp-kit.
260
+ * The wallet will appear in the wallet selection UI of any dApp
261
+ * that uses the Sui Wallet Standard.
262
+ *
263
+ * @param iframeWindow - The contentWindow of the WaaP iframe
264
+ * @param options - Initialization options
265
+ * @returns The registered WaaPSuiWallet instance
266
+ *
267
+ * @example
268
+ * ```typescript
269
+ * import { registerWaaPSuiWallet } from '@human.tech/waap-sdk'
270
+ *
271
+ * // Get the iframe element
272
+ * const iframe = document.getElementById('waap-wallet-iframe') as HTMLIFrameElement
273
+ *
274
+ * // Register the wallet (makes it discoverable by dApps)
275
+ * const wallet = registerWaaPSuiWallet(iframe.contentWindow!, { useStaging: false })
276
+ *
277
+ * // The wallet is now available in dapp-kit's wallet list
278
+ * ```
279
+ */
280
+ declare function registerWaaPSuiWallet(iframeWindow: Window, options?: InitWaaPSuiOptions): WaaPSuiWalletInterface;
281
+ //#endregion
282
+ export { WaaPSuiWallet as n, registerWaaPSuiWallet as t };
@@ -0,0 +1 @@
1
+ import{c as e}from"./ui-BAYRtDQg.mjs";import{registerWallet as t}from"@mysten/wallet-standard";function n(n,r={}){let i=new e(n,r);return t(i),i}export{n as t};