@d13co/use-wallet 4.5.9 → 4.5.10

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/dist/index.d.cts CHANGED
@@ -603,10 +603,12 @@ declare class RainbowKitWallet extends LiquidEvmBaseWallet {
603
603
  private getRawProvider;
604
604
  getEvmProvider(): Promise<any>;
605
605
  /**
606
- * Sign EIP-712 typed data using wagmi's signTypedData.
606
+ * Sign EIP-712 typed data via the raw EIP-1193 provider.
607
607
  *
608
- * The EIP-712 domain uses only (name, version) with no chainId, so signing
609
- * works regardless of which chain the wallet reports being on.
608
+ * Bypasses wagmi's signTypedData (which requires the wallet's current chain
609
+ * to be in the wagmi config) and calls eth_signTypedData_v4 directly.
610
+ * Since the EIP-712 domain has no chainId, signing is truly chain-agnostic
611
+ * and works regardless of which chain the wallet is on.
610
612
  */
611
613
  protected signWithProvider(typedData: SignTypedDataParams, evmAddress: string): Promise<string>;
612
614
  /**
package/dist/index.d.ts CHANGED
@@ -603,10 +603,12 @@ declare class RainbowKitWallet extends LiquidEvmBaseWallet {
603
603
  private getRawProvider;
604
604
  getEvmProvider(): Promise<any>;
605
605
  /**
606
- * Sign EIP-712 typed data using wagmi's signTypedData.
606
+ * Sign EIP-712 typed data via the raw EIP-1193 provider.
607
607
  *
608
- * The EIP-712 domain uses only (name, version) with no chainId, so signing
609
- * works regardless of which chain the wallet reports being on.
608
+ * Bypasses wagmi's signTypedData (which requires the wallet's current chain
609
+ * to be in the wagmi config) and calls eth_signTypedData_v4 directly.
610
+ * Since the EIP-712 domain has no chainId, signing is truly chain-agnostic
611
+ * and works regardless of which chain the wallet is on.
610
612
  */
611
613
  protected signWithProvider(typedData: SignTypedDataParams, evmAddress: string): Promise<string>;
612
614
  /**
package/dist/index.js CHANGED
@@ -8868,21 +8868,28 @@ var RainbowKitWallet = class _RainbowKitWallet extends LiquidEvmBaseWallet {
8868
8868
  return this.getRawProvider();
8869
8869
  }
8870
8870
  /**
8871
- * Sign EIP-712 typed data using wagmi's signTypedData.
8871
+ * Sign EIP-712 typed data via the raw EIP-1193 provider.
8872
8872
  *
8873
- * The EIP-712 domain uses only (name, version) with no chainId, so signing
8874
- * works regardless of which chain the wallet reports being on.
8873
+ * Bypasses wagmi's signTypedData (which requires the wallet's current chain
8874
+ * to be in the wagmi config) and calls eth_signTypedData_v4 directly.
8875
+ * Since the EIP-712 domain has no chainId, signing is truly chain-agnostic
8876
+ * and works regardless of which chain the wallet is on.
8875
8877
  */
8876
8878
  async signWithProvider(typedData, evmAddress) {
8877
- const { signTypedData } = await import("@wagmi/core");
8878
- const { EIP712Domain: _2, ...types } = typedData.types;
8879
- return signTypedData(this.wagmiConfig, {
8880
- account: evmAddress,
8879
+ const provider = await this.getRawProvider();
8880
+ const data = JSON.stringify({
8881
+ types: typedData.types,
8881
8882
  domain: typedData.domain,
8882
- types,
8883
8883
  primaryType: typedData.primaryType,
8884
8884
  message: typedData.message
8885
8885
  });
8886
+ this.logger.info("Requesting eth_signTypedData_v4", { evmAddress, domain: typedData.domain, primaryType: typedData.primaryType });
8887
+ const signature = await provider.request({
8888
+ method: "eth_signTypedData_v4",
8889
+ params: [evmAddress, data]
8890
+ });
8891
+ this.logger.info("Received signature", { signature: signature?.slice(0, 20) + "..." });
8892
+ return signature;
8886
8893
  }
8887
8894
  /**
8888
8895
  * Build a connectorInfo object from a wagmi account, omitting undefined fields.