4
1
mirror of https://github.com/Qortal/qortal-ui.git synced 2025-02-21 22:55:48 +00:00
qortal-ui/crypto/api/transactions/groups/CreateGroupTransaction.js

99 lines
2.7 KiB
JavaScript
Raw Normal View History

import TransactionBase from '../TransactionBase'
import { QORT_DECIMALS } from '../../constants'
2021-12-25 14:39:47 +01:00
export default class CreateGroupTransaction extends TransactionBase {
constructor() {
super()
this.type = 22
}
2021-12-25 14:39:47 +01:00
render(html) {
return html`
${this._groupdialog5}
<div style="background: #eee; padding: 8px; margin: 8px 0; border-radius: 5px;">
<div><span style="color: #000;">${this._groupdialog7}: ${this._rGroupName}</span></div>
<hr style="border: 2px solid #03a9f4;">
<div><span style="color: #000;">${this._groupdialog8}: ${this._rGroupDesc}</span></div>
<hr style="border: 2px solid #03a9f4;">
<div><span style="color: #000;">${this._groupdialog9}: ${this._rGroupTypeDesc}</span></div>
</div>
${this._groupdialog6}
`
}
2021-12-25 14:39:47 +01:00
set groupdialog5(groupdialog5) {
this._groupdialog5 = groupdialog5
}
2022-04-21 20:36:41 +02:00
set groupdialog6(groupdialog6) {
this._groupdialog6 = groupdialog6
}
2022-04-21 20:36:41 +02:00
set groupdialog7(groupdialog7) {
this._groupdialog7 = groupdialog7
}
2022-04-21 20:36:41 +02:00
set groupdialog8(groupdialog8) {
this._groupdialog8 = groupdialog8
}
2022-04-21 20:36:41 +02:00
set groupdialog9(groupdialog9) {
this._groupdialog9 = groupdialog9
}
2022-04-21 20:36:41 +02:00
set groupTypeDesc(groupTypeDesc) {
this._rGroupTypeDesc = groupTypeDesc
}
set fee(fee) {
this._fee = fee * QORT_DECIMALS
this._feeBytes = this.constructor.utils.int64ToBytes(this._fee)
}
2021-12-25 14:39:47 +01:00
set rGroupName(rGroupName) {
this._rGroupName = rGroupName
this._rGroupNameBytes = this.constructor.utils.stringtoUTF8Array(this._rGroupName)
this._rGroupNameLength = this.constructor.utils.int32ToBytes(this._rGroupNameBytes.length)
}
2021-12-25 14:39:47 +01:00
set rGroupDesc(rGroupDesc) {
this._rGroupDesc = rGroupDesc
this._rGroupDescBytes = this.constructor.utils.stringtoUTF8Array(this._rGroupDesc)
this._rGroupDescLength = this.constructor.utils.int32ToBytes(this._rGroupDescBytes.length)
}
2021-12-25 14:39:47 +01:00
set rGroupType(rGroupType) {
this._rGroupType = new Uint8Array(1)
this._rGroupType[0] = rGroupType
}
2021-12-25 14:39:47 +01:00
set rGroupApprovalThreshold(rGroupApprovalThreshold) {
this._rGroupApprovalThreshold = new Uint8Array(1)
this._rGroupApprovalThreshold[0] = rGroupApprovalThreshold
}
2021-12-25 14:39:47 +01:00
set rGroupMinimumBlockDelay(rGroupMinimumBlockDelay) {
this._rGroupMinimumBlockDelayBytes = this.constructor.utils.int32ToBytes(rGroupMinimumBlockDelay)
}
2021-12-25 14:39:47 +01:00
set rGroupMaximumBlockDelay(rGroupMaximumBlockDelay) {
this._rGroupMaximumBlockDelayBytes = this.constructor.utils.int32ToBytes(rGroupMaximumBlockDelay)
}
2021-12-25 14:39:47 +01:00
get params() {
const params = super.params
params.push(
this._rGroupNameLength,
this._rGroupNameBytes,
this._rGroupDescLength,
this._rGroupDescBytes,
this._rGroupType,
this._rGroupApprovalThreshold,
this._rGroupMinimumBlockDelayBytes,
this._rGroupMaximumBlockDelayBytes,
this._feeBytes
)
return params
}
}