@nibgate/sdk 0.2.17 → 0.2.18
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/nibgate.js +26120 -47
- package/dist/nibgate.js.map +4 -4
- package/dist/nibgate.min.js +93 -34
- package/dist/nibgate.min.js.map +4 -4
- package/package.json +1 -1
- package/src/browser/evm-gateway.js +12 -16
package/package.json
CHANGED
|
@@ -122,22 +122,18 @@ export function createEvmGatewayUnlock(resource, options = {}) {
|
|
|
122
122
|
network,
|
|
123
123
|
signer: {
|
|
124
124
|
address: currentAddress,
|
|
125
|
-
signTypedData: (typedData) => {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
...typedData.types
|
|
138
|
-
}
|
|
139
|
-
};
|
|
140
|
-
return evm.request({ method: 'eth_signTypedData_v4', params: [currentAddress, stringifyJson(enriched)] });
|
|
125
|
+
signTypedData: async (typedData) => {
|
|
126
|
+
const { createWalletClient, custom } = await import('viem');
|
|
127
|
+
const wc = createWalletClient({ transport: custom(evm) });
|
|
128
|
+
// Use viem's signTypedData — handles EIP-712 encoding correctly
|
|
129
|
+
// across all wallets (MetaMask, Rabby, etc.)
|
|
130
|
+
return wc.signTypedData({
|
|
131
|
+
account: currentAddress,
|
|
132
|
+
domain: typedData.domain,
|
|
133
|
+
types: typedData.types,
|
|
134
|
+
primaryType: typedData.primaryType,
|
|
135
|
+
message: typedData.message
|
|
136
|
+
});
|
|
141
137
|
}
|
|
142
138
|
},
|
|
143
139
|
clientModule: options.circleClientModule
|