-
-
Notifications
You must be signed in to change notification settings - Fork 251
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
32 additions
and
18 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
packages/connect/src/api/binance/api/binanceAbstractMethods.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { Capability } from '@trezor/protobuf/src/messages-schema'; | ||
import { AbstractMethod, Payload } from '../../../core/AbstractMethod'; | ||
import { CallMethodPayload } from '../../../events'; | ||
import { getFirmwareRange } from '../../common/paramsValidator'; | ||
import { getMiscNetwork } from '../../../data/coinInfo'; | ||
|
||
export abstract class BinanceAbstractMethod< | ||
Name extends CallMethodPayload['method'], | ||
Params = undefined, | ||
> extends AbstractMethod<Name, Params> { | ||
requiredDeviceCapabilities = [Capability.Binance]; | ||
|
||
constructor(message: { id?: number; payload: Payload<Name> }) { | ||
super(message); | ||
this.firmwareRange = getFirmwareRange(this.name, getMiscNetwork('BNB'), this.firmwareRange); | ||
} | ||
|
||
// firmwareRangeRequirements could be defined here instead of config.ts | ||
// loading coin-specific protobuf could be done here | ||
// anything else? | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters