@human.tech/waap-sdk 1.1.0 → 1.2.1

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.
@@ -9,7 +9,7 @@ type PostSilkRequestArgs = {
9
9
  params: any[];
10
10
  interactionRequired: boolean;
11
11
  silkOptions?: {
12
- asyncSigning?: boolean;
12
+ async?: boolean;
13
13
  };
14
14
  };
15
15
  /**
@@ -21,10 +21,16 @@ declare class EthereumProvider extends EventEmitter implements SilkEthereumProvi
21
21
  private currentAccount;
22
22
  private walletConnectProvider;
23
23
  /**
24
- * When true, modal closes immediately on confirm and signing happens in background.
25
- * Events are emitted to notify the app of progress.
24
+ * When true, eth_sendTransaction resolves with the pre-calculated tx hash
25
+ * after signing. Broadcasting continues in the background with events.
26
26
  */
27
- private asyncSigning;
27
+ private asyncTxs;
28
+ /**
29
+ * When true, sends `asyncSigning: true` in silkOptions instead of `async: true`.
30
+ * This mimics the v1 SDK protocol for backward compatibility testing.
31
+ * @internal
32
+ */
33
+ private legacyAsyncSigning;
28
34
  private persistedMethods;
29
35
  /**
30
36
  * We use the internalEventEmitter to emit as events
@@ -37,9 +43,10 @@ declare class EthereumProvider extends EventEmitter implements SilkEthereumProvi
37
43
  * @param customConfig - Silk custom UI configuration
38
44
  * @param project - Silk project configuration
39
45
  * @param useStaging - Whether to use the staging environment
40
- * @param asyncSigning - When true, modal closes on confirm and signing happens in background
46
+ * @param asyncTxs - When true, eth_sendTransaction resolves with tx hash after signing
47
+ * @param legacyAsyncSigning - When true, sends asyncSigning in silkOptions (v1 compat)
41
48
  */
42
- constructor(iframeWindow: Window, referralCode?: string, customConfig?: CustomConfig, project?: ProjectConfig, useStaging?: boolean, asyncSigning?: boolean);
49
+ constructor(iframeWindow: Window, referralCode?: string, customConfig?: CustomConfig, project?: ProjectConfig, useStaging?: boolean, asyncTxs?: boolean, legacyAsyncSigning?: boolean);
43
50
  private initializeWalletConnect;
44
51
  enable(): Promise<unknown>;
45
52
  isConnected(): boolean;
@@ -6,7 +6,7 @@ import { RequestArguments } from './types.js';
6
6
  * Options passed to iframe for transaction behavior
7
7
  */
8
8
  interface SilkOptions {
9
- asyncSigning?: boolean;
9
+ async?: boolean;
10
10
  withPT?: boolean;
11
11
  }
12
12
  /**
@@ -34,11 +34,16 @@ export interface InitSilkOptions {
34
34
  useStaging?: boolean;
35
35
  walletConnectProjectId?: string;
36
36
  /**
37
- * When true, modal closes immediately on confirm and signing happens in background.
38
- * Events are emitted to notify the app of progress (waap_sign_pending, waap_sign_complete, waap_tx_confirmed, etc.)
39
- * Applies to ALL transactions for this SDK instance.
37
+ * When true, eth_sendTransaction resolves with the pre-calculated tx hash
38
+ * immediately after signing. Broadcasting and confirmation continue in the
39
+ * background with events (waap_sign_complete, waap_tx_pending, waap_tx_confirmed, waap_tx_failed).
40
+ * Other signing methods (personal_sign, eth_signTypedData_v4, eth_signTransaction)
41
+ * are unaffected — they always resolve with the signature directly.
42
+ * Applies to ALL eth_sendTransaction calls for this SDK instance.
40
43
  * Default: false
41
44
  */
45
+ asyncTxs?: boolean;
46
+ /** @deprecated Use `asyncTxs` instead. */
42
47
  asyncSigning?: boolean;
43
48
  }
44
49
  export type SilkProvider = SilkEthereumProviderInterface;
@@ -0,0 +1,182 @@
1
+ /**
2
+ * WaaP Sui Wallet - Implements Sui Wallet Standard.
3
+ *
4
+ * This wallet adapter allows dApps using @mysten/dapp-kit to discover
5
+ * and interact with WaaP wallet for Sui blockchain operations.
6
+ *
7
+ * @see https://docs.sui.io/standards/wallet-standard
8
+ */
9
+ import { UIMessageManager } from '../UIMessageManager.js';
10
+ import type { SuiAccount, SuiChain, SuiConnectInput, SuiConnectOutput, SuiSignPersonalMessageInput, SuiSignPersonalMessageOutput, SuiSignAndExecuteTransactionInput, SuiSignAndExecuteTransactionOutput, SuiSignTransactionBlockInput, SuiSignTransactionBlockOutput, SuiSignAndExecuteTransactionBlockInput, SuiSignAndExecuteTransactionBlockOutput, SuiWalletEventListener, WaaPSuiWalletInterface, WalletIcon, InitWaaPSuiOptions } from './types.js';
11
+ /**
12
+ * WaaP Sui Wallet implementation.
13
+ *
14
+ * Implements the Sui Wallet Standard to allow dApps to:
15
+ * - Connect/disconnect
16
+ * - Sign personal messages
17
+ * - (Future) Sign and execute transactions
18
+ */
19
+ export declare class WaaPSuiWallet implements WaaPSuiWalletInterface {
20
+ readonly name = "WaaP";
21
+ readonly version = "1.0.0";
22
+ readonly icon: WalletIcon;
23
+ private _accounts;
24
+ private _chains;
25
+ private walletMessageManager;
26
+ private uiMessageManager;
27
+ private internalEventEmitter;
28
+ private changeListeners;
29
+ /**
30
+ * Creates a new WaaPSuiWallet instance.
31
+ *
32
+ * @param iframeWindow - The contentWindow of the WaaP iframe
33
+ * @param options - Initialization options
34
+ */
35
+ constructor(iframeWindow: Window, options?: InitWaaPSuiOptions);
36
+ /**
37
+ * Refresh accounts by making a silent connect request.
38
+ * Used internally when account changes are detected.
39
+ */
40
+ private refreshAccounts;
41
+ /**
42
+ * Supported chains.
43
+ */
44
+ get chains(): readonly SuiChain[];
45
+ /**
46
+ * Connected accounts.
47
+ */
48
+ get accounts(): readonly SuiAccount[];
49
+ /**
50
+ * UI message manager for showing/hiding modal.
51
+ */
52
+ get ui(): UIMessageManager;
53
+ /**
54
+ * Connect to the wallet.
55
+ */
56
+ connect(input?: SuiConnectInput): Promise<SuiConnectOutput>;
57
+ /**
58
+ * Disconnect from the wallet.
59
+ */
60
+ disconnect(): Promise<void>;
61
+ /**
62
+ * Sign a personal message.
63
+ *
64
+ * @param input - Sign personal message input
65
+ * @returns Signed message result with bytes and signature
66
+ */
67
+ signPersonalMessage(input: SuiSignPersonalMessageInput): Promise<SuiSignPersonalMessageOutput>;
68
+ /**
69
+ * Helper to resolve transaction bytes from various input formats.
70
+ * If the input is a Transaction/TransactionBlock object, it builds it.
71
+ */
72
+ private resolveTransactionBytes;
73
+ /**
74
+ * Sign a transaction.
75
+ *
76
+ * @param input - Sign transaction input with transaction
77
+ * @returns Signed transaction result with bytes and signature
78
+ */
79
+ signTransaction(input: {
80
+ transaction: unknown;
81
+ account: SuiAccount;
82
+ chain?: SuiChain;
83
+ }): Promise<{
84
+ bytes: string;
85
+ signature: string;
86
+ }>;
87
+ /**
88
+ * Sign and execute a transaction.
89
+ *
90
+ * @param input - Sign and execute transaction input
91
+ */
92
+ signAndExecuteTransaction(input: SuiSignAndExecuteTransactionInput): Promise<SuiSignAndExecuteTransactionOutput>;
93
+ /**
94
+ * Switch the active chain.
95
+ */
96
+ switchChain(input: {
97
+ chain: SuiChain;
98
+ }): Promise<void>;
99
+ /**
100
+ * Subscribe to wallet change events.
101
+ *
102
+ * @param event - Event name (currently only 'change')
103
+ * @param listener - Event listener callback
104
+ * @returns Unsubscribe function
105
+ */
106
+ on(event: 'change', listener: SuiWalletEventListener): () => void;
107
+ /**
108
+ * Wallet Standard features property.
109
+ * Required by @mysten/wallet-standard registerWallet.
110
+ */
111
+ get features(): {
112
+ readonly 'standard:connect': {
113
+ readonly version: "1.0.0";
114
+ readonly connect: (input?: SuiConnectInput) => Promise<SuiConnectOutput>;
115
+ };
116
+ readonly 'standard:disconnect': {
117
+ readonly version: "1.0.0";
118
+ readonly disconnect: () => Promise<void>;
119
+ };
120
+ readonly 'standard:events': {
121
+ readonly version: "1.0.0";
122
+ readonly on: (event: "change", listener: SuiWalletEventListener) => () => void;
123
+ };
124
+ readonly 'sui:signPersonalMessage': {
125
+ readonly version: "1.1.0";
126
+ readonly signPersonalMessage: (input: SuiSignPersonalMessageInput) => Promise<SuiSignPersonalMessageOutput>;
127
+ };
128
+ readonly 'sui:signTransaction': {
129
+ readonly version: "2.0.0";
130
+ readonly signTransaction: (input: {
131
+ transaction: unknown;
132
+ account: SuiAccount;
133
+ chain?: SuiChain;
134
+ }) => Promise<{
135
+ bytes: string;
136
+ signature: string;
137
+ }>;
138
+ };
139
+ readonly 'sui:signAndExecuteTransaction': {
140
+ readonly version: "1.0.0";
141
+ readonly signAndExecuteTransaction: (input: SuiSignAndExecuteTransactionInput) => Promise<SuiSignAndExecuteTransactionOutput>;
142
+ };
143
+ readonly 'sui:signTransactionBlock': {
144
+ readonly version: "2.0.0";
145
+ readonly signTransactionBlock: (input: SuiSignTransactionBlockInput) => Promise<SuiSignTransactionBlockOutput>;
146
+ };
147
+ readonly 'sui:signAndExecuteTransactionBlock': {
148
+ readonly version: "1.0.0";
149
+ readonly signAndExecuteTransactionBlock: (input: SuiSignAndExecuteTransactionBlockInput) => Promise<SuiSignAndExecuteTransactionBlockOutput>;
150
+ };
151
+ readonly 'sui:switchChain': {
152
+ readonly version: "1.0.0";
153
+ readonly switchChain: (input: {
154
+ chain: SuiChain;
155
+ }) => Promise<void>;
156
+ };
157
+ };
158
+ /**
159
+ * Legacy method for signing a transaction block.
160
+ * Maps to signTransaction.
161
+ */
162
+ signTransactionBlock(input: SuiSignTransactionBlockInput): Promise<SuiSignTransactionBlockOutput>;
163
+ /**
164
+ * Legacy method for signing and executing a transaction block.
165
+ * Maps to signAndExecuteTransaction.
166
+ */
167
+ signAndExecuteTransactionBlock(input: SuiSignAndExecuteTransactionBlockInput): Promise<SuiSignAndExecuteTransactionBlockOutput>;
168
+ /**
169
+ * Request the user's email address.
170
+ *
171
+ * @returns Promise resolving to the user's email address
172
+ */
173
+ requestEmail(): Promise<string>;
174
+ /**
175
+ * Post a request to the iframe and wait for response.
176
+ */
177
+ private postRequestAndWait;
178
+ /**
179
+ * Notify all change listeners.
180
+ */
181
+ private notifyChange;
182
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Sui Wallet Standard integration for WaaP.
3
+ */
4
+ export { WaaPSuiWallet } from './SuiWallet.js';
5
+ export { initWaaPSui } from './init.js';
6
+ export { registerWaaPSuiWallet } from './register.js';
7
+ export type { SuiAccount, SuiChain, SuiConnectInput, SuiConnectOutput, SuiSignPersonalMessageInput, SuiSignPersonalMessageOutput, SuiSignTransactionInput, SuiSignTransactionOutput, SuiWalletChangeProperties, SuiWalletEventListener, WaaPSuiWalletInterface, WaaPSuiWalletFeatures, InitWaaPSuiOptions, WalletIcon } from './types.js';
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Initialization function for WaaP Sui Wallet.
3
+ */
4
+ import type { InitWaaPSuiOptions, WaaPSuiWalletInterface } from './types.js';
5
+ /**
6
+ * Initialize WaaP Sui Wallet.
7
+ *
8
+ * This creates the WaaP iframe (if needed) and returns a SuiWallet instance
9
+ * that implements the Sui Wallet Standard.
10
+ *
11
+ * @param options - Initialization options
12
+ * @returns WaaPSuiWallet instance
13
+ *
14
+ * @example
15
+ * ```typescript
16
+ * import { initWaaPSui } from '@silk-wallet/silk-wallet-sdk'
17
+ *
18
+ * const suiWallet = initWaaPSui()
19
+ *
20
+ * // Connect to get accounts
21
+ * const { accounts } = await suiWallet.connect()
22
+ *
23
+ * // Sign a message
24
+ * const result = await suiWallet.signPersonalMessage({
25
+ * message: new TextEncoder().encode('Hello, Sui!'),
26
+ * account: accounts[0]
27
+ * })
28
+ * ```
29
+ */
30
+ export declare function initWaaPSui(options?: InitWaaPSuiOptions): WaaPSuiWalletInterface;
@@ -0,0 +1,39 @@
1
+ /**
2
+ * WaaP Sui Wallet Registration
3
+ *
4
+ * Registers the WaaP Sui wallet with the Wallet Standard registry,
5
+ * making it discoverable by dApps using @mysten/dapp-kit.
6
+ *
7
+ * @see https://docs.sui.io/standards/wallet-standard
8
+ */
9
+ import type { InitWaaPSuiOptions, WaaPSuiWalletInterface } from './types.js';
10
+ /**
11
+ * Register WaaP Sui Wallet with the Wallet Standard.
12
+ *
13
+ * This makes the wallet discoverable by dApps using @mysten/dapp-kit.
14
+ * The wallet will appear in the wallet selection UI of any dApp
15
+ * that uses the Sui Wallet Standard.
16
+ *
17
+ * @param iframeWindow - The contentWindow of the WaaP iframe
18
+ * @param options - Initialization options
19
+ * @returns The registered WaaPSuiWallet instance
20
+ *
21
+ * @example
22
+ * ```typescript
23
+ * import { registerWaaPSuiWallet } from '@silk-wallet/silk-wallet-sdk'
24
+ *
25
+ * // Get the iframe element
26
+ * const iframe = document.getElementById('waap-wallet-iframe') as HTMLIFrameElement
27
+ *
28
+ * // Register the wallet (makes it discoverable by dApps)
29
+ * const wallet = registerWaaPSuiWallet(iframe.contentWindow!, { useStaging: false })
30
+ *
31
+ * // The wallet is now available in dapp-kit's wallet list
32
+ * ```
33
+ */
34
+ export declare function registerWaaPSuiWallet(iframeWindow: Window, options?: InitWaaPSuiOptions): WaaPSuiWalletInterface;
35
+ /**
36
+ * Unregister callback type returned by registerWallet.
37
+ * Can be called to remove the wallet from the registry.
38
+ */
39
+ export type UnregisterWallet = () => void;
@@ -0,0 +1,284 @@
1
+ /**
2
+ * Type definitions for Sui Wallet Standard integration.
3
+ *
4
+ * @see https://docs.sui.io/standards/wallet-standard
5
+ */
6
+ /**
7
+ * Sui chain identifiers.
8
+ */
9
+ export type SuiChain = 'sui:mainnet' | 'sui:testnet' | 'sui:devnet' | 'sui:localnet';
10
+ /**
11
+ * Sui account representation following Wallet Standard.
12
+ */
13
+ export interface SuiAccount {
14
+ /** Sui address (32 bytes, 0x-prefixed hex string) */
15
+ readonly address: string;
16
+ /** Compressed public key bytes (33 bytes for Secp256k1) */
17
+ readonly publicKey: Uint8Array;
18
+ /** Supported chains for this account */
19
+ readonly chains: readonly SuiChain[];
20
+ /** Supported features for this account */
21
+ readonly features: readonly string[];
22
+ /** Optional display label */
23
+ readonly label?: string;
24
+ }
25
+ /**
26
+ * Input for sui:signPersonalMessage feature.
27
+ */
28
+ export interface SuiSignPersonalMessageInput {
29
+ /** Message bytes to sign */
30
+ message: Uint8Array;
31
+ /** Account to sign with */
32
+ account: SuiAccount;
33
+ /** Optional chain identifier */
34
+ chain?: SuiChain;
35
+ }
36
+ /**
37
+ * Output from sui:signPersonalMessage feature.
38
+ */
39
+ export interface SuiSignPersonalMessageOutput {
40
+ /** Base64-encoded message bytes */
41
+ bytes: string;
42
+ /** Base64-encoded signature (98 bytes for Secp256k1) */
43
+ signature: string;
44
+ }
45
+ /**
46
+ * Input for sui:signTransaction feature.
47
+ */
48
+ export interface SuiSignTransactionInput {
49
+ /** BCS-serialized transaction bytes */
50
+ transaction: Uint8Array;
51
+ /** Account to sign with */
52
+ account: SuiAccount;
53
+ /** Optional chain identifier */
54
+ chain?: SuiChain;
55
+ }
56
+ /**
57
+ * Output from sui:signTransaction feature.
58
+ */
59
+ export interface SuiSignTransactionOutput {
60
+ /** Base64-encoded transaction bytes */
61
+ bytes: string;
62
+ /** Base64-encoded signature */
63
+ signature: string;
64
+ }
65
+ /**
66
+ * Input for sui:signAndExecuteTransaction feature.
67
+ */
68
+ export interface SuiSignAndExecuteTransactionInput {
69
+ /** BCS-serialized transaction bytes */
70
+ transaction: Uint8Array;
71
+ /** Account to sign with */
72
+ account: SuiAccount;
73
+ /** Optional chain identifier */
74
+ chain?: SuiChain;
75
+ /** Options for execution */
76
+ options?: unknown;
77
+ /** Request type */
78
+ requestType?: 'WaitForEffectsCert' | 'WaitForLocalExecution';
79
+ }
80
+ /**
81
+ * Output from sui:signAndExecuteTransaction feature.
82
+ */
83
+ export interface SuiSignAndExecuteTransactionOutput {
84
+ digest: string;
85
+ effects?: unknown;
86
+ errors?: unknown[];
87
+ [key: string]: unknown;
88
+ }
89
+ /**
90
+ * Connect input options.
91
+ */
92
+ export interface SuiConnectInput {
93
+ /** If true, attempt silent connection without UI prompt */
94
+ silent?: boolean;
95
+ }
96
+ /**
97
+ * Connect output with accounts.
98
+ */
99
+ export interface SuiConnectOutput {
100
+ /** Connected accounts */
101
+ accounts: readonly SuiAccount[];
102
+ }
103
+ /**
104
+ * Input for legacy sui:signTransactionBlock feature.
105
+ */
106
+ export interface SuiSignTransactionBlockInput {
107
+ /** BCS-serialized transaction block bytes */
108
+ transactionBlock: Uint8Array;
109
+ /** Account to sign with */
110
+ account: SuiAccount;
111
+ /** Optional chain identifier */
112
+ chain?: SuiChain;
113
+ }
114
+ /**
115
+ * Output for legacy sui:signTransactionBlock feature.
116
+ */
117
+ export interface SuiSignTransactionBlockOutput extends SuiSignTransactionOutput {
118
+ }
119
+ /**
120
+ * Input for legacy sui:signAndExecuteTransactionBlock feature.
121
+ */
122
+ export interface SuiSignAndExecuteTransactionBlockInput {
123
+ /** BCS-serialized transaction block bytes */
124
+ transactionBlock: Uint8Array;
125
+ /** Account to sign with */
126
+ account: SuiAccount;
127
+ /** Optional chain identifier */
128
+ chain?: SuiChain;
129
+ /** Options for execution */
130
+ options?: unknown;
131
+ /** Request type */
132
+ requestType?: 'WaitForEffectsCert' | 'WaitForLocalExecution';
133
+ }
134
+ /**
135
+ * Output for legacy sui:signAndExecuteTransactionBlock feature.
136
+ */
137
+ export interface SuiSignAndExecuteTransactionBlockOutput extends SuiSignAndExecuteTransactionOutput {
138
+ }
139
+ /**
140
+ * Wallet change event properties.
141
+ */
142
+ export interface SuiWalletChangeProperties {
143
+ chains?: readonly SuiChain[];
144
+ accounts?: readonly SuiAccount[];
145
+ features?: Record<string, unknown>;
146
+ }
147
+ /**
148
+ * Event listener types.
149
+ */
150
+ export type SuiWalletEventListener = (properties: SuiWalletChangeProperties) => void;
151
+ /**
152
+ * Wallet icon type (data URL).
153
+ */
154
+ export type WalletIcon = `data:image/${'svg+xml' | 'webp' | 'png' | 'gif'};base64,${string}`;
155
+ /**
156
+ * Wallet Standard features object.
157
+ */
158
+ export interface WaaPSuiWalletFeatures {
159
+ 'standard:connect': {
160
+ version: '1.0.0';
161
+ connect: (input?: SuiConnectInput) => Promise<SuiConnectOutput>;
162
+ };
163
+ 'standard:disconnect': {
164
+ version: '1.0.0';
165
+ disconnect: () => Promise<void>;
166
+ };
167
+ 'standard:events': {
168
+ version: '1.0.0';
169
+ on: (event: 'change', listener: SuiWalletEventListener) => () => void;
170
+ };
171
+ 'sui:signPersonalMessage': {
172
+ version: '1.1.0';
173
+ signPersonalMessage: (input: SuiSignPersonalMessageInput) => Promise<SuiSignPersonalMessageOutput>;
174
+ };
175
+ 'sui:signTransaction': {
176
+ version: '2.0.0';
177
+ signTransaction: (input: SuiSignTransactionInput) => Promise<SuiSignTransactionOutput>;
178
+ };
179
+ 'sui:switchChain': {
180
+ version: '1.0.0';
181
+ switchChain: (input: {
182
+ chain: SuiChain;
183
+ }) => Promise<void>;
184
+ };
185
+ 'sui:signAndExecuteTransaction': {
186
+ version: '1.0.0';
187
+ signAndExecuteTransaction: (input: SuiSignAndExecuteTransactionInput) => Promise<SuiSignAndExecuteTransactionOutput>;
188
+ };
189
+ 'sui:signTransactionBlock': {
190
+ version: '2.0.0';
191
+ signTransactionBlock: (input: SuiSignTransactionBlockInput) => Promise<SuiSignTransactionBlockOutput>;
192
+ };
193
+ 'sui:signAndExecuteTransactionBlock': {
194
+ version: '1.0.0';
195
+ signAndExecuteTransactionBlock: (input: SuiSignAndExecuteTransactionBlockInput) => Promise<SuiSignAndExecuteTransactionBlockOutput>;
196
+ };
197
+ }
198
+ /**
199
+ * WaaP Sui Wallet interface.
200
+ */
201
+ export interface WaaPSuiWalletInterface {
202
+ /** Wallet name */
203
+ readonly name: string;
204
+ /** Wallet version */
205
+ readonly version: string;
206
+ /** Wallet icon */
207
+ readonly icon: WalletIcon;
208
+ /** Supported chains */
209
+ readonly chains: readonly SuiChain[];
210
+ /** Connected accounts */
211
+ readonly accounts: readonly SuiAccount[];
212
+ /** Wallet Standard features */
213
+ readonly features: WaaPSuiWalletFeatures;
214
+ /**
215
+ * Connect to the wallet.
216
+ */
217
+ connect(input?: SuiConnectInput): Promise<SuiConnectOutput>;
218
+ /**
219
+ * Disconnect from the wallet.
220
+ */
221
+ disconnect(): Promise<void>;
222
+ /**
223
+ * Switch the active chain.
224
+ */
225
+ switchChain(input: {
226
+ chain: SuiChain;
227
+ }): Promise<void>;
228
+ /**
229
+ * Sign a personal message.
230
+ */
231
+ signPersonalMessage(input: SuiSignPersonalMessageInput): Promise<SuiSignPersonalMessageOutput>;
232
+ /**
233
+ * Sign and execute a transaction.
234
+ */
235
+ signAndExecuteTransaction(input: SuiSignAndExecuteTransactionInput): Promise<SuiSignAndExecuteTransactionOutput>;
236
+ /**
237
+ * Sign a transaction block (Legacy).
238
+ */
239
+ signTransactionBlock(input: SuiSignTransactionBlockInput): Promise<SuiSignTransactionBlockOutput>;
240
+ /**
241
+ * Sign and execute a transaction block (Legacy).
242
+ */
243
+ signAndExecuteTransactionBlock(input: SuiSignAndExecuteTransactionBlockInput): Promise<SuiSignAndExecuteTransactionBlockOutput>;
244
+ /**
245
+ * Subscribe to wallet events.
246
+ * @returns Unsubscribe function
247
+ */
248
+ on(event: 'change', listener: SuiWalletEventListener): () => void;
249
+ /** custom WaaP features */
250
+ /**
251
+ * Request the user's email address.
252
+ * @returns Promise resolving to the user's email address
253
+ */
254
+ requestEmail(): Promise<string>;
255
+ }
256
+ /**
257
+ * Initialization options for WaaP Sui Wallet.
258
+ */
259
+ import type { CustomConfig, ProjectConfig, AuthenticationMethod } from '@human.tech/waap-interface-core';
260
+ /**
261
+ * Sui-supported authentication methods (no 'wallet/walletconnect' support yet)
262
+ * Also it is not necessary as @mysten/dapp-kit handles wallet choices
263
+ * todo: maybe add a modal to list out Sui wallets discovered as per Wallet Standard
264
+ */
265
+ export type SuiAuthenticationMethod = Exclude<AuthenticationMethod, 'wallet'>;
266
+ /**
267
+ * Sui-specific custom configuration
268
+ */
269
+ export interface SuiCustomConfig extends Omit<CustomConfig, 'authenticationMethods'> {
270
+ authenticationMethods?: SuiAuthenticationMethod[];
271
+ }
272
+ /**
273
+ * Initialization options for WaaP Sui Wallet.
274
+ */
275
+ export interface InitWaaPSuiOptions {
276
+ /** Use staging environment */
277
+ useStaging?: boolean;
278
+ /** WaaP points referral code */
279
+ referralCode?: string;
280
+ /** WaaP project configuration */
281
+ project?: ProjectConfig;
282
+ /** WaaP custom UI configuration */
283
+ config?: SuiCustomConfig;
284
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@human.tech/waap-sdk",
3
- "version": "1.1.0",
3
+ "version": "1.2.1",
4
4
  "description": "SDK for interacting with WaaP",
5
5
  "source": "src/index.ts",
6
6
  "types": "./dist/index.d.ts",
@@ -20,7 +20,8 @@
20
20
  },
21
21
  "files": [
22
22
  "/dist",
23
- "src/global.d.ts"
23
+ "src/global.d.ts",
24
+ "CHANGELOG.md"
24
25
  ],
25
26
  "engines": {
26
27
  "node": ">=18.0.0"
@@ -62,6 +63,8 @@
62
63
  },
63
64
  "dependencies": {
64
65
  "@metamask/rpc-errors": "^5.1.1",
66
+ "@mysten/sui": "^1.45.2",
67
+ "@mysten/wallet-standard": "^0.13.0",
65
68
  "@reown/appkit": "^1.8.17",
66
69
  "@reown/appkit-adapter-ethers": "^1.8.17",
67
70
  "ethers": "^6.16.0",
@@ -69,8 +72,8 @@
69
72
  "pino-pretty": "^10.2.0",
70
73
  "zod": "^3.21.4",
71
74
  "zod-validation-error": "^1.3.0",
72
- "@human.tech/waap-constants": "0.0.3",
73
- "@human.tech/waap-interface-core": "0.1.2"
75
+ "@human.tech/waap-constants": "0.1.1",
76
+ "@human.tech/waap-interface-core": "0.2.1"
74
77
  },
75
78
  "scripts": {
76
79
  "build": "microbundle",