@human.tech/waap-sdk 1.3.0 → 2.0.0
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 +12 -0
- package/dist/index.d.mts +967 -0
- package/dist/index.d.ts +967 -15
- package/dist/index.js +2191 -2
- package/dist/index.mjs +2162 -0
- package/package.json +15 -34
- 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/lib/sui/types.d.ts
DELETED
|
@@ -1,293 +0,0 @@
|
|
|
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
|
-
* Request a Permission Token from the user.
|
|
257
|
-
* Allows pre-authorised batches of Sui transactions without individual confirmations.
|
|
258
|
-
*
|
|
259
|
-
* @param params - Allowed addresses, chainId (e.g. "sui:mainnet"), spend limit, expiry
|
|
260
|
-
* @returns Promise resolving to a RequestPermissionTokenResult
|
|
261
|
-
*/
|
|
262
|
-
requestPermissionToken(params: RequestPermissionTokenParams): Promise<RequestPermissionTokenResult>;
|
|
263
|
-
}
|
|
264
|
-
/**
|
|
265
|
-
* Initialization options for WaaP Sui Wallet.
|
|
266
|
-
*/
|
|
267
|
-
import type { CustomConfig, ProjectConfig, AuthenticationMethod, RequestPermissionTokenParams, RequestPermissionTokenResult } from '@human.tech/waap-interface-core';
|
|
268
|
-
export type { RequestPermissionTokenParams, RequestPermissionTokenResult };
|
|
269
|
-
/**
|
|
270
|
-
* Sui-supported authentication methods (no 'wallet/walletconnect' support yet)
|
|
271
|
-
* Also it is not necessary as @mysten/dapp-kit handles wallet choices
|
|
272
|
-
* todo: maybe add a modal to list out Sui wallets discovered as per Wallet Standard
|
|
273
|
-
*/
|
|
274
|
-
export type SuiAuthenticationMethod = Exclude<AuthenticationMethod, 'wallet'>;
|
|
275
|
-
/**
|
|
276
|
-
* Sui-specific custom configuration
|
|
277
|
-
*/
|
|
278
|
-
export interface SuiCustomConfig extends Omit<CustomConfig, 'authenticationMethods'> {
|
|
279
|
-
authenticationMethods?: SuiAuthenticationMethod[];
|
|
280
|
-
}
|
|
281
|
-
/**
|
|
282
|
-
* Initialization options for WaaP Sui Wallet.
|
|
283
|
-
*/
|
|
284
|
-
export interface InitWaaPSuiOptions {
|
|
285
|
-
/** Use staging environment */
|
|
286
|
-
useStaging?: boolean;
|
|
287
|
-
/** WaaP points referral code */
|
|
288
|
-
referralCode?: string;
|
|
289
|
-
/** WaaP project configuration */
|
|
290
|
-
project?: ProjectConfig;
|
|
291
|
-
/** WaaP custom UI configuration */
|
|
292
|
-
config?: SuiCustomConfig;
|
|
293
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WaaP Component
|
|
3
|
-
*
|
|
4
|
-
* A custom HTML element that allows developers to control where the WaaP wallet
|
|
5
|
-
* renders in their UI. When present, the wallet will render inside this component
|
|
6
|
-
* instead of as a centered modal with backdrop.
|
|
7
|
-
*
|
|
8
|
-
* Usage in HTML:
|
|
9
|
-
* ```html
|
|
10
|
-
* <waap-wallet></waap-wallet>
|
|
11
|
-
* ```
|
|
12
|
-
*
|
|
13
|
-
* Usage in React/JSX:
|
|
14
|
-
* ```tsx
|
|
15
|
-
* function App() {
|
|
16
|
-
* return <waap-wallet style={{ width: '400px', height: '600px' }} />
|
|
17
|
-
* }
|
|
18
|
-
* ```
|
|
19
|
-
*/
|
|
20
|
-
/**
|
|
21
|
-
* Custom HTML element for WaaP wallet
|
|
22
|
-
* Only defined in browser environments to avoid SSR issues
|
|
23
|
-
*/
|
|
24
|
-
declare let WaapWalletElement: any;
|
|
25
|
-
/**
|
|
26
|
-
* Check if a WaaP component exists in the DOM (internal use)
|
|
27
|
-
*/
|
|
28
|
-
export declare function hasWaapComponent(): boolean;
|
|
29
|
-
/**
|
|
30
|
-
* Get the WaaP component container element (internal use)
|
|
31
|
-
*/
|
|
32
|
-
export declare function getWaapComponentContainer(): HTMLElement | null;
|
|
33
|
-
/**
|
|
34
|
-
* Export the custom element class for advanced use cases
|
|
35
|
-
* Most users won't need this - just use <waap-wallet> in your HTML/JSX
|
|
36
|
-
*/
|
|
37
|
-
export { WaapWalletElement as WaaP };
|
package/dist/ui/index.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { InitSilkOptions, SilkEthereumProviderInterface } from '../lib/provider/types.js';
|
|
2
|
-
/**
|
|
3
|
-
* @param referralCode - WaaP points referral code
|
|
4
|
-
* @param customConfig - WaaP custom UI configuration
|
|
5
|
-
* @param project - WaaP project configuration
|
|
6
|
-
* @param useStaging - Whether to use the staging environment
|
|
7
|
-
* @param walletConnectProjectId - WalletConnect project ID (only required when passing `wallet` to `authenticationMethods`)
|
|
8
|
-
* @param walletConnectOptionalChains - Optional chains to use for WalletConnect
|
|
9
|
-
*/
|
|
10
|
-
declare const initWaaP: (params?: InitSilkOptions) => SilkEthereumProviderInterface;
|
|
11
|
-
export { initWaaP };
|