@human.tech/waap-sdk 1.2.4 → 1.3.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.
@@ -65,6 +65,20 @@ export declare class WaaPSuiWallet implements WaaPSuiWalletInterface {
65
65
  * @returns Signed message result with bytes and signature
66
66
  */
67
67
  signPersonalMessage(input: SuiSignPersonalMessageInput): Promise<SuiSignPersonalMessageOutput>;
68
+ /**
69
+ * Extract the destination addresses from BCS-serialized Sui transaction bytes.
70
+ *
71
+ * Unlike EVM transactions where `to` is a top-level field, Sui transaction
72
+ * destinations are embedded in BCS-encoded programmable transaction blocks.
73
+ * We deserialize with Transaction.from() and inspect TransferObjects commands.
74
+ *
75
+ * Only TransferObjects destinations are extracted — MoveCall package addresses
76
+ * are not user-facing recipients and should not be validated against a PT's
77
+ * allowedAddresses list.
78
+ *
79
+ * Returns an empty array if no TransferObjects are found or deserialization fails.
80
+ */
81
+ private extractTransferAddresses;
68
82
  /**
69
83
  * Helper to resolve transaction bytes from various input formats.
70
84
  * If the input is a Transaction/TransactionBlock object, it builds it.
@@ -165,6 +179,13 @@ export declare class WaaPSuiWallet implements WaaPSuiWalletInterface {
165
179
  * Maps to signAndExecuteTransaction.
166
180
  */
167
181
  signAndExecuteTransactionBlock(input: SuiSignAndExecuteTransactionBlockInput): Promise<SuiSignAndExecuteTransactionBlockOutput>;
182
+ /**
183
+ * Request a Permission Token from the user.
184
+ * Allows pre-authorised batches of Sui transactions without individual confirmations.
185
+ *
186
+ * @param params - Allowed addresses, chainId (e.g. "sui:mainnet"), spend limit, expiry
187
+ */
188
+ requestPermissionToken(params: import('./types.js').RequestPermissionTokenParams): Promise<import('./types.js').RequestPermissionTokenResult>;
168
189
  /**
169
190
  * Request the user's email address.
170
191
  *
@@ -4,4 +4,4 @@
4
4
  export { WaaPSuiWallet } from './SuiWallet.js';
5
5
  export { initWaaPSui } from './init.js';
6
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';
7
+ export type { SuiAccount, SuiChain, SuiConnectInput, SuiConnectOutput, SuiSignPersonalMessageInput, SuiSignPersonalMessageOutput, SuiSignTransactionInput, SuiSignTransactionOutput, SuiWalletChangeProperties, SuiWalletEventListener, WaaPSuiWalletInterface, WaaPSuiWalletFeatures, InitWaaPSuiOptions, WalletIcon, RequestPermissionTokenParams, RequestPermissionTokenResult } from './types.js';
@@ -252,11 +252,20 @@ export interface WaaPSuiWalletInterface {
252
252
  * @returns Promise resolving to the user's email address
253
253
  */
254
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>;
255
263
  }
256
264
  /**
257
265
  * Initialization options for WaaP Sui Wallet.
258
266
  */
259
- import type { CustomConfig, ProjectConfig, AuthenticationMethod } from '@human.tech/waap-interface-core';
267
+ import type { CustomConfig, ProjectConfig, AuthenticationMethod, RequestPermissionTokenParams, RequestPermissionTokenResult } from '@human.tech/waap-interface-core';
268
+ export type { RequestPermissionTokenParams, RequestPermissionTokenResult };
260
269
  /**
261
270
  * Sui-supported authentication methods (no 'wallet/walletconnect' support yet)
262
271
  * Also it is not necessary as @mysten/dapp-kit handles wallet choices
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@human.tech/waap-sdk",
3
- "version": "1.2.4",
3
+ "version": "1.3.0",
4
4
  "description": "SDK for interacting with WaaP",
5
5
  "source": "src/index.ts",
6
6
  "types": "./dist/index.d.ts",
@@ -18,12 +18,6 @@
18
18
  "publishConfig": {
19
19
  "access": "public"
20
20
  },
21
- "scripts": {
22
- "build": "microbundle",
23
- "build-to-publish": "microbundle --define process.env.NODE_ENV=production",
24
- "build:inline-deps": "microbundle --external none --define process.env.NODE_ENV=production",
25
- "dev": "microbundle watch"
26
- },
27
21
  "files": [
28
22
  "/dist",
29
23
  "src/global.d.ts",
@@ -56,7 +50,8 @@
56
50
  "eslint": "8.38.0",
57
51
  "eslint-plugin-jest": "^27.2.3",
58
52
  "microbundle": "^0.15.1",
59
- "typescript": "^5.0.4"
53
+ "typescript": "^5.0.4",
54
+ "eslint-config-custom": "0.0.0"
60
55
  },
61
56
  "peerDependencies": {
62
57
  "react": ">=16.8.0"
@@ -67,8 +62,6 @@
67
62
  }
68
63
  },
69
64
  "dependencies": {
70
- "@human.tech/waap-constants": "^0.1.1",
71
- "@human.tech/waap-interface-core": "^0.2.1",
72
65
  "@metamask/rpc-errors": "^5.1.1",
73
66
  "@mysten/sui": "^1.45.2",
74
67
  "@mysten/wallet-standard": "^0.13.0",
@@ -78,6 +71,14 @@
78
71
  "events": "^3.3.0",
79
72
  "pino-pretty": "^10.2.0",
80
73
  "zod": "^3.21.4",
81
- "zod-validation-error": "^1.3.0"
74
+ "zod-validation-error": "^1.3.0",
75
+ "@human.tech/waap-interface-core": "0.3.0",
76
+ "@human.tech/waap-constants": "0.1.2"
77
+ },
78
+ "scripts": {
79
+ "build": "microbundle",
80
+ "build-to-publish": "microbundle --define process.env.NODE_ENV=production",
81
+ "build:inline-deps": "microbundle --external none --define process.env.NODE_ENV=production",
82
+ "dev": "microbundle watch"
82
83
  }
83
- }
84
+ }