navio-blsct
Version:
TypeScript bindings for the `libblsct` library used by the [Navio](https://nav.io/) blockchain to construct confidential transactions based on the BLS12-381 curve.
26 lines (20 loc) • 532 B
text/typescript
import {
fromTxKeyToSpendingKey,
fromTxKeyToViewKey
} from '../../blsct'
import { Scalar } from '../../scalar'
import { SpendingKey } from './txKeyDesc/spendingKey'
import { ViewKey } from './txKeyDesc/viewKey'
export class TxKey extends Scalar {
constructor(obj?: any) {
super(obj)
}
toSpendingKey(): SpendingKey {
const obj = fromTxKeyToSpendingKey(this.value())
return new SpendingKey(obj)
}
toViewKey(): ViewKey {
const obj = fromTxKeyToViewKey(this.value())
return new ViewKey(obj)
}
}