mirror of
https://github.com/Qortal/qortal-ui.git
synced 2025-02-11 17:55:51 +00:00
add name to transaction dialog
This commit is contained in:
parent
fc78fa9225
commit
afc02e364f
@ -34,7 +34,7 @@ export default class PaymentTransaction extends TransactionBase {
|
||||
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)
|
||||
@ -55,9 +55,21 @@ export default class PaymentTransaction extends TransactionBase {
|
||||
return html`
|
||||
<table>
|
||||
<tr>
|
||||
<th>${this._dialogto}</th>
|
||||
<td>${Base58.encode(this._recipient)}</td>
|
||||
<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>
|
||||
|
@ -3954,22 +3954,44 @@ class MultiWallet extends LitElement {
|
||||
}
|
||||
}
|
||||
|
||||
const getName = async (recipient)=> {
|
||||
try {
|
||||
|
||||
const getNames = await parentEpml.request("apiCall", {
|
||||
type: "api",
|
||||
url: `/names/address/${recipient}`,
|
||||
})
|
||||
if(getNames?.length > 0 ){
|
||||
return getNames[0].name
|
||||
} else {
|
||||
return ''
|
||||
}
|
||||
} catch (error) {
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
const makeTransactionRequest = async (receiver, lastRef) => {
|
||||
let myReceiver = receiver
|
||||
let mylastRef = lastRef
|
||||
let dialogamount = get("transactions.amount")
|
||||
let dialogAddress = get("login.address")
|
||||
let dialogName = get("login.name")
|
||||
let dialogto = get("transactions.to")
|
||||
|
||||
let recipientName = await getName(myReceiver)
|
||||
let myTxnrequest = await parentEpml.request('transaction', {
|
||||
type: 2,
|
||||
nonce: this.wallets.get(this._selectedWallet).wallet.nonce,
|
||||
params: {
|
||||
recipient: myReceiver,
|
||||
recipientName: recipientName,
|
||||
amount: amount,
|
||||
lastReference: mylastRef,
|
||||
fee: 0.001,
|
||||
dialogamount: dialogamount,
|
||||
dialogto: dialogto,
|
||||
dialogAddress,
|
||||
dialogName
|
||||
},
|
||||
})
|
||||
return myTxnrequest
|
||||
|
Loading…
x
Reference in New Issue
Block a user