mirror of
https://github.com/Qortal/qortal-ui.git
synced 2025-08-13 14:11:31 +00:00
build
config
core
crypto
api
bitcoin
deps
transactions
arbitrary
chat
groups
names
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
.eslintrc.json
.gitattributes
.gitignore
.travis.yml
CONTRIBUTING.md
LICENSE
README.md
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
36 lines
795 B
JavaScript
36 lines
795 B
JavaScript
'use strict'
|
|
import TransactionBase from './TransactionBase.js'
|
|
import { QORT_DECIMALS } from '../constants.js'
|
|
|
|
export default class PaymentTransaction extends TransactionBase {
|
|
constructor() {
|
|
super()
|
|
this.type = 20
|
|
}
|
|
|
|
set recipient(recipient) {
|
|
this._recipient = recipient instanceof Uint8Array ? recipient : this.constructor.Base58.decode(recipient)
|
|
}
|
|
|
|
set amount(amount) {
|
|
this._amount = amount * QORT_DECIMALS
|
|
this._amountBytes = this.constructor.utils.int64ToBytes(amount)
|
|
}
|
|
|
|
set reference(seed) {
|
|
const sha = seed => new Sha512().process(seed).finish().result
|
|
let reference = sha(sha(seed))
|
|
reference += reference
|
|
}
|
|
|
|
get params() {
|
|
const params = super.params
|
|
params.push(
|
|
this._recipient,
|
|
this._amountBytes,
|
|
this._feeBytes
|
|
)
|
|
return params
|
|
}
|
|
}
|