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.
56 lines
1.5 KiB
56 lines
1.5 KiB
2 years ago
|
'use strict'
|
||
|
import TransactionBase from '../TransactionBase.js'
|
||
3 years ago
|
import publicKeyToAddress from '../../wallet/publicKeyToAddress.js'
|
||
2 years ago
|
import { Base58 } from '../../deps/deps.js'
|
||
3 years ago
|
|
||
|
export default class RemoveRewardShareTransaction extends TransactionBase {
|
||
2 years ago
|
constructor() {
|
||
|
super()
|
||
|
this.type = 38
|
||
|
}
|
||
|
|
||
|
render(html) {
|
||
|
return html`
|
||
|
${this._rewarddialog5}
|
||
|
<div style="background: #eee; padding: 8px; margin: 8px 0; border-radius: 5px;">
|
||
|
<span style="color: #000;">${this.constructor.Base58.encode(this._recipient)}</span>
|
||
|
</div>
|
||
|
${this._rewarddialog6}
|
||
|
`
|
||
|
}
|
||
|
|
||
|
set rewarddialog5(rewarddialog5) {
|
||
|
this._rewarddialog5 = rewarddialog5
|
||
|
}
|
||
|
|
||
|
set rewarddialog6(rewarddialog6) {
|
||
|
this._rewarddialog6 = rewarddialog6
|
||
|
}
|
||
|
|
||
|
set rewardShareKeyPairPublicKey(rewardShareKeyPairPublicKey) {
|
||
|
this._rewardShareKeyPairPublicKey = Base58.decode(rewardShareKeyPairPublicKey)
|
||
|
}
|
||
|
|
||
|
set recipient(recipient) {
|
||
|
const _address = publicKeyToAddress(this._keyPair.publicKey)
|
||
|
this._recipient = recipient instanceof Uint8Array ? recipient : this.constructor.Base58.decode(recipient)
|
||
|
this.fee = _address === recipient ? 0 : 0.001
|
||
|
}
|
||
|
|
||
|
set percentageShare(share) {
|
||
|
this._percentageShare = share * 100
|
||
|
this._percentageShareBytes = this.constructor.utils.int64ToBytes(this._percentageShare)
|
||
|
}
|
||
|
|
||
|
get params() {
|
||
|
const params = super.params
|
||
|
params.push(
|
||
|
this._recipient,
|
||
|
this._rewardShareKeyPairPublicKey,
|
||
|
this._percentageShareBytes,
|
||
|
this._feeBytes
|
||
|
)
|
||
|
return params
|
||
|
}
|
||
3 years ago
|
}
|