mirror of
https://github.com/Qortal/qortal-ui.git
synced 2025-02-14 11:15:50 +00:00
Add update name transaction
This commit is contained in:
parent
b8d5f5784d
commit
5a34bf8512
@ -0,0 +1,73 @@
|
||||
'use strict'
|
||||
import TransactionBase from '../TransactionBase.js'
|
||||
import { QORT_DECIMALS } from '../../constants.js'
|
||||
|
||||
export default class UpdateNameTransaction extends TransactionBase {
|
||||
constructor() {
|
||||
super()
|
||||
this.type = 4
|
||||
}
|
||||
|
||||
render(html) {
|
||||
return html`
|
||||
${this._dialogUpdateName1}
|
||||
<div style="background: #eee; padding: 8px; margin: 8px 0; border-radius: 5px;">
|
||||
<span style="color: #000;">${this.nameText}</span>
|
||||
</div>
|
||||
${this._dialogUpdateName2}
|
||||
<div style="background: #eee; padding: 8px; margin: 8px 0; border-radius: 5px;">
|
||||
<span style="color: #000;">${this.newNameText}</span>
|
||||
</div>
|
||||
${this._dialogUpdateName3}
|
||||
`
|
||||
}
|
||||
|
||||
set dialogUpdateName1(dialogUpdateName1) {
|
||||
this._dialogUpdateName1 = dialogUpdateName1
|
||||
}
|
||||
|
||||
set dialogUpdateName1(dialogUpdateName1) {
|
||||
this._dialogUpdateName1 = dialogUpdateName1
|
||||
}
|
||||
|
||||
set dialogUpdateName2(dialogUpdateName2) {
|
||||
this._dialogUpdateName2 = dialogUpdateName2
|
||||
}
|
||||
|
||||
set fee(fee) {
|
||||
this._fee = fee * QORT_DECIMALS
|
||||
this._feeBytes = this.constructor.utils.int64ToBytes(this._fee)
|
||||
}
|
||||
|
||||
set name(name) {
|
||||
this.nameText = name
|
||||
this._nameBytes = this.constructor.utils.stringtoUTF8Array(name)
|
||||
this._nameLength = this.constructor.utils.int32ToBytes(this._nameBytes.length)
|
||||
}
|
||||
|
||||
set newName(mewName) {
|
||||
this.newNameText = newName
|
||||
this._newNameBytes = this.constructor.utils.stringtoUTF8Array(mewName)
|
||||
this._newNameLength = this.constructor.utils.int32ToBytes(this._newNameBytes.length)
|
||||
}
|
||||
|
||||
set value(value) {
|
||||
this.valueText = value.length === 0 ? "Registered Name on the Qortal Chain" : value
|
||||
this._valueBytes = this.constructor.utils.stringtoUTF8Array(this.valueText)
|
||||
this._valueLength = this.constructor.utils.int32ToBytes(this._valueBytes.length)
|
||||
}
|
||||
|
||||
get params() {
|
||||
const params = super.params
|
||||
params.push(
|
||||
this._nameLength,
|
||||
this._nameBytes,
|
||||
this._newNameLength,
|
||||
this._newNameBytes,
|
||||
this._valueLength,
|
||||
this._valueBytes,
|
||||
this._feeBytes
|
||||
)
|
||||
return params
|
||||
}
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
import PaymentTransaction from './PaymentTransaction.js'
|
||||
import RegisterNameTransaction from './names/RegisterNameTransaction.js'
|
||||
import UpdateNameTransaction from './names/UpdateNameTransaction.js'
|
||||
import SellNameTransacion from './names/SellNameTransacion.js'
|
||||
import CancelSellNameTransacion from './names/CancelSellNameTransacion.js'
|
||||
import BuyNameTransacion from './names/BuyNameTransacion.js'
|
||||
@ -25,6 +26,7 @@ import TransferPrivsTransaction from './TransferPrivsTransaction.js'
|
||||
export const transactionTypes = {
|
||||
2: PaymentTransaction,
|
||||
3: RegisterNameTransaction,
|
||||
4: UpdateNameTransaction,
|
||||
5: SellNameTransacion,
|
||||
6: CancelSellNameTransacion,
|
||||
7: BuyNameTransacion,
|
||||
|
Loading…
x
Reference in New Issue
Block a user