refactor: remove snake_case from JS code
This commit is contained in:
parent
ee2342e1ba
commit
98366cfaf1
|
@ -197,7 +197,7 @@ new Vue({
|
|||
a.expanded = false
|
||||
a.accountType = type
|
||||
a.gapLimitExceeded =
|
||||
a.branchIndex === 0 &&
|
||||
!a.isChange &&
|
||||
a.addressIndex >
|
||||
lastAcctiveAddress.addressIndex +
|
||||
this.config.DEFAULT_RECEIVE_GAP_LIMIT
|
||||
|
@ -209,7 +209,7 @@ new Vue({
|
|||
try {
|
||||
const wallet = this.g.user.wallets[0]
|
||||
addressData.amount = amount
|
||||
if (addressData.branchIndex === 0) {
|
||||
if (!addressData.isChange) {
|
||||
const addressWallet = this.walletAccounts.find(
|
||||
w => w.id === addressData.wallet
|
||||
)
|
||||
|
@ -267,9 +267,9 @@ new Vue({
|
|||
|
||||
const addresses = this.addresses.data.filter(
|
||||
a =>
|
||||
(includeChangeAddrs || a.addressIndex === 0) &&
|
||||
(includeChangeAddrs || !a.isChange) &&
|
||||
(includeGapAddrs ||
|
||||
a.addressIndex === 1 ||
|
||||
a.isChange ||
|
||||
a.addressIndex <= walletsLimit[`_${a.wallet}`]) &&
|
||||
!(excludeNoAmount && a.amount === 0) &&
|
||||
(!selectedWalletId || a.wallet === selectedWalletId)
|
||||
|
@ -277,11 +277,12 @@ new Vue({
|
|||
return addresses
|
||||
},
|
||||
openGetFreshAddressDialog: async function (walletId) {
|
||||
const {data: addressData} = await LNbits.api.request(
|
||||
const {data} = await LNbits.api.request(
|
||||
'GET',
|
||||
`/watchonly/api/v1/address/${walletId}`,
|
||||
this.g.user.wallets[0].inkey
|
||||
)
|
||||
const addressData = mapAddressesData(data)
|
||||
|
||||
addressData.note = `Shared on ${currentDateTime()}`
|
||||
const lastAcctiveAddress =
|
||||
|
|
|
@ -5,7 +5,7 @@ const mapAddressesData = a => ({
|
|||
wallet: a.wallet,
|
||||
note: a.note,
|
||||
|
||||
branchIndex: a.branch_index,
|
||||
isChange: a.branch_index === 1,
|
||||
addressIndex: a.address_index,
|
||||
hasActivity: a.has_activity
|
||||
})
|
||||
|
@ -14,7 +14,7 @@ const mapInputToSentHistory = (tx, addressData, vin) => ({
|
|||
sent: true,
|
||||
txId: tx.txid,
|
||||
address: addressData.address,
|
||||
isChange: addressData.branchIndex === 1,
|
||||
isChange: addressData.isChange,
|
||||
amount: vin.prevout.value,
|
||||
date: blockTimeToDate(tx.status.block_time),
|
||||
height: tx.status.block_height,
|
||||
|
@ -27,7 +27,7 @@ const mapOutputToReceiveHistory = (tx, addressData, vout) => ({
|
|||
received: true,
|
||||
txId: tx.txid,
|
||||
address: addressData.address,
|
||||
isChange: addressData.branchIndex === 1,
|
||||
isChange: addressData.isChange,
|
||||
amount: vout.value,
|
||||
date: blockTimeToDate(tx.status.block_time),
|
||||
height: tx.status.block_height,
|
||||
|
@ -41,7 +41,7 @@ const mapUtxoToPsbtInput = utxo => ({
|
|||
vout: utxo.vout,
|
||||
amount: utxo.amount,
|
||||
address: utxo.address,
|
||||
branch_index: utxo.branchIndex,
|
||||
branch_index: utxo.isChange ? 1 : 0,
|
||||
address_index: utxo.addressIndex,
|
||||
masterpub_fingerprint: utxo.masterpubFingerprint,
|
||||
accountType: utxo.accountType,
|
||||
|
@ -51,9 +51,8 @@ const mapUtxoToPsbtInput = utxo => ({
|
|||
const mapAddressDataToUtxo = (wallet, addressData, utxo) => ({
|
||||
id: addressData.id,
|
||||
address: addressData.address,
|
||||
isChange: addressData.branchIndex === 1,
|
||||
isChange: addressData.isChange,
|
||||
addressIndex: addressData.addressIndex,
|
||||
branchIndex: addressData.branchIndex,
|
||||
wallet: addressData.wallet,
|
||||
accountType: addressData.accountType,
|
||||
masterpubFingerprint: wallet.fingerprint,
|
||||
|
|
Loading…
Reference in New Issue
Block a user