@nibgate/sdk 0.2.16 → 0.2.17
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 +15 -1
- package/dist/nibgate.js.map +2 -2
- package/dist/nibgate.min.js +5 -5
- package/dist/nibgate.min.js.map +3 -3
- package/package.json +1 -1
- package/src/browser/evm-gateway.js +17 -1
package/package.json
CHANGED
|
@@ -122,7 +122,23 @@ export function createEvmGatewayUnlock(resource, options = {}) {
|
|
|
122
122
|
network,
|
|
123
123
|
signer: {
|
|
124
124
|
address: currentAddress,
|
|
125
|
-
signTypedData: (typedData) =>
|
|
125
|
+
signTypedData: (typedData) => {
|
|
126
|
+
// Some MetaMask versions require EIP712Domain to be explicitly
|
|
127
|
+
// present in the types object for correct hash computation.
|
|
128
|
+
const enriched = {
|
|
129
|
+
...typedData,
|
|
130
|
+
types: {
|
|
131
|
+
EIP712Domain: [
|
|
132
|
+
{ name: 'name', type: 'string' },
|
|
133
|
+
{ name: 'version', type: 'string' },
|
|
134
|
+
{ name: 'chainId', type: 'uint256' },
|
|
135
|
+
{ name: 'verifyingContract', type: 'address' }
|
|
136
|
+
],
|
|
137
|
+
...typedData.types
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
return evm.request({ method: 'eth_signTypedData_v4', params: [currentAddress, stringifyJson(enriched)] });
|
|
141
|
+
}
|
|
126
142
|
},
|
|
127
143
|
clientModule: options.circleClientModule
|
|
128
144
|
});
|