Skip to content

Commit

Permalink
Feat/benfen (#385)
Browse files Browse the repository at this point in the history
* feat: add benfen chain

* fix: remove publickey, add benfen big data transaction

* fix: delete benfen skipForceUpdateCheck

* fix: delete support detection

* chore: delete unuse code

* fix: lint

* fix: change benfen limit in 4.12.0.

* fix: lint
  • Loading branch information
wabicai authored Nov 29, 2024
1 parent 7c4ba81 commit 93c33d5
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 37 deletions.
14 changes: 7 additions & 7 deletions packages/core/src/api/benfen/BenfenGetAddress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ export default class BenfenGetAddress extends BaseMethod<HardwareBenfenGetAddres
});
}

getVersionRange() {
return {
model_touch: {
min: '4.10.3',
},
};
}
// getVersionRange() {
// return {
// model_touch: {
// min: '4.12.0',
// },
// };
// }

async run() {
const supportsBatchPublicKey = supportBatchPublicKey(this.device?.features);
Expand Down
14 changes: 7 additions & 7 deletions packages/core/src/api/benfen/BenfenGetPublicKey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ export default class BenfenGetPublicKey extends BaseMethod<any> {
});
}

getVersionRange() {
return {
model_touch: {
min: '4.10.3',
},
};
}
// getVersionRange() {
// return {
// model_touch: {
// min: '4.12.0',
// },
// };
// }

async run() {
const res = await this.device.commands.typedCall('BatchGetPublickeys', 'EcdsaPublicKeys', {
Expand Down
14 changes: 7 additions & 7 deletions packages/core/src/api/benfen/BenfenSignMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ export default class BenfenSignMessage extends BaseMethod<HardwareBenfenSignMess
};
}

getVersionRange() {
return {
model_touch: {
min: '4.10.3',
},
};
}
// getVersionRange() {
// return {
// model_touch: {
// min: '4.12.0',
// },
// };
// }

async run() {
const response = await this.device.commands.typedCall(
Expand Down
25 changes: 9 additions & 16 deletions packages/core/src/api/benfen/BenfenSignTransaction.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import {
BenfenSignTx as HardwareBenfenSignTx,
TypedCall,
BenfenSignedTx,
MessageType,
} from '@onekeyfe/hd-transport';
import { BenfenSignTx, TypedCall, BenfenSignedTx, MessageType } from '@onekeyfe/hd-transport';

import { bytesToHex } from '@noble/hashes/utils';
import { UI_REQUEST } from '../../constants/ui-request';
import { validatePath } from '../helpers/pathUtils';
Expand All @@ -12,9 +8,6 @@ import { validateParams } from '../helpers/paramsValidator';
import { formatAnyHex } from '../helpers/hexUtils';
import type { TypedResponseMessage } from '../../device/DeviceCommands';

type BenfenSignTx = Omit<HardwareBenfenSignTx, 'data_initial_chunk' | 'data_length'> &
HardwareBenfenSignTx;

export default class BenfenSignTransaction extends BaseMethod<BenfenSignTx> {
init() {
this.checkDeviceId = true;
Expand All @@ -36,13 +29,13 @@ export default class BenfenSignTransaction extends BaseMethod<BenfenSignTx> {
};
}

getVersionRange() {
return {
model_touch: {
min: '4.10.2',
},
};
}
// getVersionRange() {
// return {
// model_touch: {
// min: '4.12.0',
// },
// };
// }

chunkByteSize = 1024;

Expand Down

0 comments on commit 93c33d5

Please sign in to comment.