Skip to content

Commit fb00650

Browse files
fix: eip 712 (#581)
1 parent 245ea17 commit fb00650

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

packages/core/src/api/evm/EVMSignTypedData.ts

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -401,20 +401,15 @@ export default class EVMSignTypedData extends BaseMethod<EVMSignTypedDataParams>
401401

402402
const { addressN, chainId } = this.params;
403403

404+
// Classic1s / ClassicPure 3.14.0+, supported EthereumSignTypedDataOneKey
405+
const supportEip712OnClassic = existCapability(
406+
this.device.features,
407+
Enum_Capability.Capability_EthereumTypedData
408+
);
409+
404410
// For Classic、Mini device we use EthereumSignTypedData
405411
const deviceType = getDeviceType(this.device.features);
406-
if (DeviceModelToTypes.model_mini.includes(deviceType)) {
407-
// Classic1s / ClassicPure 3.14.0+, supported EthereumSignTypedDataOneKey
408-
const currentVersion = getDeviceFirmwareVersion(this.device.features).join('.');
409-
const isClassic1sOrPure =
410-
deviceType === EDeviceType.Classic1s || deviceType === EDeviceType.ClassicPure;
411-
if (
412-
(isClassic1sOrPure && semver.gte(currentVersion, '3.14.0')) ||
413-
existCapability(this.device.features, Enum_Capability.Capability_EthereumTypedData)
414-
) {
415-
return this.signTypedData();
416-
}
417-
412+
if (DeviceModelToTypes.model_mini.includes(deviceType) && !supportEip712OnClassic) {
418413
validateParams(this.params, [
419414
{ name: 'domainHash', type: 'hexString', required: true },
420415
{ name: 'messageHash', type: 'hexString', required: true },

0 commit comments

Comments
 (0)