Skip to content

Conversation

pinheadmz
Copy link
Contributor

Closes #491

"Create bitcoin address" button now connects to the wallet interface and gets a new address. It generates a QR code and everything clears when switching wallets. It should also save the label if used.

newaddr

Copy link
Contributor

@MarnixCroes MarnixCroes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested,
I did not encounter any issues✅

@@ -208,6 +208,14 @@ Page {
}
}

function clear() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move to the root? It is a reasonable function at the component level.

}
}

Connections {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try to not rely on walletController, move this to DesktopWallets where walletController is already referenced, add an id to RequestPayment and call clear().

@@ -16,6 +16,7 @@ Page {
background: null

property int requestCounter: 0
property WalletQmlModel wallet: walletController.selectedWallet
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make required and move binding to DesktopWallets:

        RequestPayment {
            wallet: walletController.selectedWallet
        }

@@ -63,6 +63,16 @@ QString WalletQmlModel::name() const
return QString::fromStdString(m_wallet->getWalletName());
}

QString WalletQmlModel::newAddress(QString label)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe rename to getNewAddress.

@@ -198,8 +199,10 @@ Page {
requestCounter = requestCounter + 1
clearRequest.visible = true
title.text = qsTr("Payment request #" + requestCounter)
address.text = "bc1q f5xe y2tf 89k9 zy6k gnru wszy 5fsa truy 9te1 bu"
qrImage.code = "bc1qf5xey2tf89k9zy6kgnruwszy5fsatruy9te1bu"
var newAddress = root.wallet.newAddress(label.text)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const address = root.wallet.getNewAddress(label.text)
qrImage.code = address
address.text = address.replace(/(.{4})/g, "$1 ").trim()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Address is incorrect for network type
3 participants