@human.tech/waap-sdk 1.2.0 → 1.2.2

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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@human.tech/waap-sdk",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
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"
@@ -71,8 +72,8 @@
71
72
  "pino-pretty": "^10.2.0",
72
73
  "zod": "^3.21.4",
73
74
  "zod-validation-error": "^1.3.0",
74
- "@human.tech/waap-constants": "0.1.0",
75
- "@human.tech/waap-interface-core": "0.2.0"
75
+ "@human.tech/waap-constants": "0.1.1",
76
+ "@human.tech/waap-interface-core": "0.2.1"
76
77
  },
77
78
  "scripts": {
78
79
  "build": "microbundle",