4
1
mirror of https://github.com/Qortal/qortal-ui.git synced 2025-02-12 02:05:51 +00:00
qortal-ui/crypto/api/transactions/TransferPrivsTransaction.js

42 lines
1.1 KiB
JavaScript
Raw Normal View History

'use strict'
2022-12-31 18:54:54 +01:00
import TransactionBase from './TransactionBase.js'
2023-11-05 14:30:07 +01:00
import {store} from '../../api.js'
import {QORT_DECIMALS} from '../constants.js'
2022-12-31 18:54:54 +01:00
export default class TransferPrivsTransaction extends TransactionBase {
constructor() {
super()
this.type = 40
}
2022-12-31 18:54:54 +01:00
render(html) {
const conf = store.getState().config
return html`
2022-12-31 18:54:54 +01:00
Are you sure to transfer privileges to this account ?
<div style="background: #eee; padding: 8px; margin: 8px 0; border-radius: 5px;">
<span style="color: #000;">${this.theRecipient}</span>
</div>
On pressing confirm, the transfer privileges request will be sent!
`
}
2022-12-31 18:54:54 +01:00
set recipient(recipient) {
this._recipient = recipient instanceof Uint8Array ? recipient : this.constructor.Base58.decode(recipient)
this.theRecipient = recipient
}
2022-12-31 18:54:54 +01:00
set fee(fee) {
this._fee = fee * QORT_DECIMALS
this._feeBytes = this.constructor.utils.int64ToBytes(this._fee)
}
2022-12-31 18:54:54 +01:00
get params() {
const params = super.params
params.push(
this._recipient,
this._feeBytes
)
return params
}
}