@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 +15 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.js +15 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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
|
|
606
|
+
* Sign EIP-712 typed data via the raw EIP-1193 provider.
|
|
607
607
|
*
|
|
608
|
-
*
|
|
609
|
-
*
|
|
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
|
|
606
|
+
* Sign EIP-712 typed data via the raw EIP-1193 provider.
|
|
607
607
|
*
|
|
608
|
-
*
|
|
609
|
-
*
|
|
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
|
|
8871
|
+
* Sign EIP-712 typed data via the raw EIP-1193 provider.
|
|
8872
8872
|
*
|
|
8873
|
-
*
|
|
8874
|
-
*
|
|
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
|
|
8878
|
-
const
|
|
8879
|
-
|
|
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.
|