@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.cjs CHANGED
@@ -8913,21 +8913,28 @@ var RainbowKitWallet = class _RainbowKitWallet extends LiquidEvmBaseWallet {
8913
8913
  return this.getRawProvider();
8914
8914
  }
8915
8915
  /**
8916
- * Sign EIP-712 typed data using wagmi's signTypedData.
8916
+ * Sign EIP-712 typed data via the raw EIP-1193 provider.
8917
8917
  *
8918
- * The EIP-712 domain uses only (name, version) with no chainId, so signing
8919
- * works regardless of which chain the wallet reports being on.
8918
+ * Bypasses wagmi's signTypedData (which requires the wallet's current chain
8919
+ * to be in the wagmi config) and calls eth_signTypedData_v4 directly.
8920
+ * Since the EIP-712 domain has no chainId, signing is truly chain-agnostic
8921
+ * and works regardless of which chain the wallet is on.
8920
8922
  */
8921
8923
  async signWithProvider(typedData, evmAddress) {
8922
- const { signTypedData } = await import("@wagmi/core");
8923
- const { EIP712Domain: _2, ...types } = typedData.types;
8924
- return signTypedData(this.wagmiConfig, {
8925
- account: evmAddress,
8924
+ const provider = await this.getRawProvider();
8925
+ const data = JSON.stringify({
8926
+ types: typedData.types,
8926
8927
  domain: typedData.domain,
8927
- types,
8928
8928
  primaryType: typedData.primaryType,
8929
8929
  message: typedData.message
8930
8930
  });
8931
+ this.logger.info("Requesting eth_signTypedData_v4", { evmAddress, domain: typedData.domain, primaryType: typedData.primaryType });
8932
+ const signature = await provider.request({
8933
+ method: "eth_signTypedData_v4",
8934
+ params: [evmAddress, data]
8935
+ });
8936
+ this.logger.info("Received signature", { signature: signature?.slice(0, 20) + "..." });
8937
+ return signature;
8931
8938
  }
8932
8939
  /**
8933
8940
  * Build a connectorInfo object from a wagmi account, omitting undefined fields.