forked from Qortal/qortal-ui
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
795 B
36 lines
795 B
2 years ago
|
'use strict'
|
||
3 years ago
|
import TransactionBase from './TransactionBase.js'
|
||
|
import { QORT_DECIMALS } from '../constants.js'
|
||
|
|
||
|
export default class PaymentTransaction extends TransactionBase {
|
||
2 years ago
|
constructor() {
|
||
|
super()
|
||
|
this.type = 20
|
||
|
}
|
||
3 years ago
|
|
||
2 years ago
|
set recipient(recipient) {
|
||
|
this._recipient = recipient instanceof Uint8Array ? recipient : this.constructor.Base58.decode(recipient)
|
||
|
}
|
||
3 years ago
|
|
||
2 years ago
|
set amount(amount) {
|
||
|
this._amount = amount * QORT_DECIMALS
|
||
|
this._amountBytes = this.constructor.utils.int64ToBytes(amount)
|
||
|
}
|
||
3 years ago
|
|
||
2 years ago
|
set reference(seed) {
|
||
|
const sha = seed => new Sha512().process(seed).finish().result
|
||
|
let reference = sha(sha(seed))
|
||
|
reference += reference
|
||
|
}
|
||
|
|
||
|
get params() {
|
||
|
const params = super.params
|
||
|
params.push(
|
||
|
this._recipient,
|
||
|
this._amountBytes,
|
||
|
this._feeBytes
|
||
|
)
|
||
|
return params
|
||
|
}
|
||
3 years ago
|
}
|