1
0
mirror of https://github.com/Qortal/qortal-ui.git synced 2025-08-10 20:51:27 +00:00
Files
build
config
core
crypto
api
bitcoin
deps
transactions
arbitrary
chat
groups
names
polls
reward-share
RemoveRewardShareTransaction.js
RewardShareTransaction.js
trade-portal
AirdropTransaction.js
DelegationTransaction.js
DeployAtTransaction.js
MessageTransaction.js
PaymentTransaction.js
PublicizeTransaction.js
TransactionBase.js
TransferPrivsTransaction.js
arbitraryV3.js
processTransaction.js
registerName_dnsthing.js
transactions.js
utils
wallet
PhraseWallet.js
api.js
constants.js
createTransaction.js
createWallet.js
decryptStoredWallet.js
fetch-request.js
kdf.js
registerUsername.js
storeWallet.js
tradeRequest.js
api.js
api_deps.js
config.js
img
lib
locales
plugins
scripts
snap
splash
.editorconfig
.gitattributes
.gitignore
CONTRIBUTING.md
LICENSE
README.md
build-setup.js
build.bat
build.js
build.sh
electron-builder.yml
electron.js
package-lock.json
package.json
run_server.bat
server.js
set-up-snap.sh
watch-inline.js
watch.js
qortal-ui/crypto/api/transactions/reward-share/RemoveRewardShareTransaction.js
2024-05-10 18:00:47 +02:00

61 lines
1.6 KiB
JavaScript

import TransactionBase from '../TransactionBase'
import publicKeyToAddress from '../../wallet/publicKeyToAddress'
import { Base58 } from '../../deps/deps'
import { DYNAMIC_FEE_TIMESTAMP } from '../../constants'
export default class RemoveRewardShareTransaction extends TransactionBase {
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)
if (new Date(this._timestamp).getTime() >= DYNAMIC_FEE_TIMESTAMP) {
this.fee = _address === recipient ? 0 : 0.01
} else {
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
}
}