spectrum-finance/ergo-sdk-js

Better type for `Registers`

mkermani144 opened this issue · 0 comments

It seems that Registers type is not narrow enough:

export type Registers = {[key: string]: HexString}

The user may provide any string value as key, which is not correct.

It can be fixed easily with a mapped type:

- export type Registers = {[key: string]: HexString} 
+ export type Registers = {[Key in RegisterId]: HexString}