mirror of
https://github.com/Qortal/qortal-ui.git
synced 2025-07-30 05:31:26 +00:00
build
config
core
crypto
api
bitcoin
deps
transactions
arbitrary
chat
groups
names
polls
reward-share
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
.eslintignore
.eslintrc.json
.gitattributes
.gitignore
.travis.yml
CONTRIBUTING.md
LICENSE
README.md
blog-test.json
build-setup.js
build.bat
build.js
build.sh
electron-builder.yml
electron.js
install-dependencies.sh
package-lock.json
package.json
push-updates-with-travis-build.sh
run_server.bat
server.js
set-up-snap.sh
watch-inline.js
watch.js
64 lines
1.4 KiB
JavaScript
64 lines
1.4 KiB
JavaScript
'use strict'
|
|
import TransactionBase from './TransactionBase.js'
|
|
import Base58 from '../deps/Base58.js'
|
|
import { store } from '../../api.js'
|
|
|
|
export default class PaymentTransaction extends TransactionBase {
|
|
constructor() {
|
|
super()
|
|
this.type = 2
|
|
}
|
|
|
|
render(html) {
|
|
const conf = store.getState().config
|
|
return html`
|
|
<table>
|
|
<tr>
|
|
<th>${this._dialogto}:</th>
|
|
</tr>
|
|
<tr>
|
|
<td>${this.dialogAddress} ${' '}-</td>
|
|
<td>${Base58.encode(this._recipient)}</td>
|
|
</tr>
|
|
${this.recipientName ? html`
|
|
<tr>
|
|
<td>${this.dialogName} ${' '}-</td>
|
|
<td>${this.recipientName}</td>
|
|
</tr>
|
|
` : ''}
|
|
<tr>
|
|
<th>${this._dialogamount}</th>
|
|
<td>${this._amount / conf.coin.decimals} ${conf.coin.symbol}</td>
|
|
</tr>
|
|
</table>
|
|
`
|
|
}
|
|
|
|
set recipient(recipient) {
|
|
this._recipient = recipient instanceof Uint8Array ? recipient : this.constructor.Base58.decode(recipient)
|
|
}
|
|
|
|
set dialogto(dialogto) {
|
|
this._dialogto = dialogto
|
|
}
|
|
|
|
set dialogamount(dialogamount) {
|
|
this._dialogamount = dialogamount
|
|
}
|
|
|
|
set amount(amount) {
|
|
this._amount = Math.round(amount * store.getState().config.coin.decimals)
|
|
this._amountBytes = this.constructor.utils.int64ToBytes(this._amount)
|
|
}
|
|
|
|
get params() {
|
|
const params = super.params
|
|
params.push(
|
|
this._recipient,
|
|
this._amountBytes,
|
|
this._feeBytes
|
|
)
|
|
return params
|
|
}
|
|
}
|