Skip to content
This repository was archived by the owner on May 3, 2026. It is now read-only.
Closed

U #120

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
8a82ac6
refactor: add create clipboard item functions for object creation
kylemccullen Feb 23, 2025
9efc53a
store date on clipboard item and display date ago on history list
kylemccullen Feb 23, 2025
16fa029
add rolloff clipboard history setting option
kylemccullen Feb 24, 2025
8771be3
fix linting, update history rolloff options
kylemccullen Feb 27, 2025
e982fc7
update packages
kylemccullen Nov 26, 2025
7aab07f
Merge pull request #102 from BrantaOps/feature/89
kylemccullen Nov 26, 2025
524af6b
update checkout flow to use guardrail v2
kylemccullen Nov 27, 2025
e0e87c3
cleanup
kylemccullen Nov 27, 2025
4cfd2db
fix broken links
kylemccullen Nov 27, 2025
4d8a2d6
Merge pull request #108 from BrantaOps/feature/106
kylemccullen Nov 27, 2025
6ddf56b
Merge pull request #109 from BrantaOps/feature/107
kylemccullen Nov 27, 2025
4ff9632
update doc links
kylemccullen Nov 27, 2025
5dd8a8c
remove all non-generic logos from dropdown
kylemccullen Nov 27, 2025
f4dc73a
add branta branding to the app
kylemccullen Nov 27, 2025
a6f5263
Merge pull request #115 from BrantaOps/feature/110
kylemccullen Nov 28, 2025
980f774
Merge pull request #116 from BrantaOps/feature/111
kylemccullen Nov 28, 2025
d5f4fd6
confirmation modal when turning checkout mode on
kylemccullen Dec 3, 2025
cc75dd6
wording
kylemccullen Dec 3, 2025
b268404
prevent word-break on clipboard history detail type
kylemccullen Dec 3, 2025
a75962d
Merge pull request #118 from BrantaOps/develop
kylemccullen Dec 3, 2025
321774a
Merge pull request #117 from BrantaOps/feature/112
kylemccullen Dec 3, 2025
70dc326
prefix highlight addresses
kylemccullen Dec 3, 2025
05aa6f3
fix tests
kylemccullen Dec 3, 2025
0b4d878
Merge pull request #119 from BrantaOps/feature/114
kylemccullen Dec 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Disclaimer: This is pre-release software and may contain bugs or incomplete features. Use at your own risk. Feedback and contributions are welcome!

Read more on our [documentation site.](https://docs.branta.pro/)
Read more on our [documentation site.](https://developer.branta.pro/core)

<img width="500" alt="Screenshot 2025-01-22 at 1 17 32 PM" src="https://github.com/user-attachments/assets/98bd51a8-46d1-4fbe-9091-3c0c2452c3db" />
<img width="500" alt="Screenshot 2025-01-22 at 1 19 21 PM" src="https://github.com/user-attachments/assets/616272d3-c085-4f1a-a1dc-3fb2f2cb8124" />
Expand Down
48 changes: 3 additions & 45 deletions app/lib/verify-address.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { verifyXpub, getPrefix } from './verify-address';
import { verifyXpub } from './verify-address';

describe('verifyXpub', () => {

test('Native Segwit', () => {
const valid = 'xpub6CZbGEd4YL33sqfx5ZxEqgANx9p7KV6qai4LbmkSZCH28ueYEboWPDYnoaXWqP3hig9J7VzbC4QaLwPi3YzpdxmnEdy5USMpqEULzHyMcAm';
expect(verifyXpub(valid)).toBe(true);
Expand Down Expand Up @@ -42,48 +41,7 @@ describe('verifyXpub', () => {
expect(verifyXpub(invalid)).toBe(false);
});

test('ypub', () => {
});

test('zpub', () => {
});
});


describe('getPrefix', () => {

test('1', () => {
const address = '1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa';
expect(getPrefix(address)).toBe("1");
});

test('3', () => {
const address = '3J98t1WpEZ73CNmQviecrnyiWrnqRhWNLy';
expect(getPrefix(address)).toBe("3");
});

test('bc1q', () => {
const address = 'bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kygt080';
expect(getPrefix(address)).toBe("bc1q");
});

test('bc1p', () => {
const address = 'bc1p5d7rjq7g6rdk2yhzks9smlaqtedr4dekq08ge8ztwac72sfr9rusxg3297';
expect(getPrefix(address)).toBe("bc1p");
});
test('ypub', () => {});

test('tb1q', () => {
const address = 'tb1q6l2jt0ysay05yg2af0zx87p06vdyf4rhcp6npe';
expect(getPrefix(address)).toBe("tb1q");
});

test('tb1p', () => {
const address = 'tb1p6rgz84xkrn8l96s7vx6jd7xae34gs22c9a20q5p86esfj4qr3c0q3k5jjs';
expect(getPrefix(address)).toBe("tb1p");
});

test('garbage', () => {
const address = 'garbage';
expect(getPrefix(address)).toBe("");
});
test('zpub', () => {});
});
60 changes: 10 additions & 50 deletions app/lib/verify-address.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Address, AddressType } from "../../src/app/shared/models/address";
import { AddressClipboardItem } from "../../src/app/shared/models/clipboard-item";
import { AddressClipboardItem, createAddressClipboardItem } from "../../src/app/shared/models/clipboard-item";
import { ExtendedPublicKey, PolicyType, Wallet } from "../../src/app/shared/models/wallet.model";

const bitcoin = require('bitcoinjs-lib');
Expand All @@ -11,34 +11,6 @@ bitcoin.initEccLib(ecc);

const MAX_ACCOUNT = 1;

export function getPrefix(address: string) {
if (address.startsWith('1')) {
return '1';
}

if (address.startsWith('3')) {
return '3';
}

if (address.startsWith('bc1q')) {
return 'bc1q';
}

if (address.startsWith('bc1p')) {
return 'bc1p';
}

if (address.startsWith('tb1q')) {
return 'tb1q';
}

if (address.startsWith('tb1p')) {
return 'tb1p';
}

return '';
}

export function getAllAddresses(wallet: Wallet, i: number): Address[] {
var bip32 = BIP32Factory(ecc);

Expand All @@ -50,12 +22,9 @@ export function getAllAddresses(wallet: Wallet, i: number): Address[] {
]
.map((type) => {
var address = getSingleSigAddress(wallet, 0, i, type, bip32);
var prefix = getPrefix(address);

return {
value: address,
prefix: prefix,
remainder: address.replace(new RegExp(`^${prefix}`), ''),
type: type.toString(),
selected: false
} as Address;
Expand All @@ -64,19 +33,16 @@ export function getAllAddresses(wallet: Wallet, i: number): Address[] {
return [AddressType.PayToWitnessPublicKeyHash, AddressType.PayToScriptHash]
.map((type) => {
var address = getMultiSigAddress(wallet, 0, i, type, bip32);
var prefix = getPrefix(address);

return {
value: address,
prefix: prefix,
remainder: address.replace(new RegExp(`^${prefix}`), ''),
type: type.toString(),
selected: false
} as Address;
});
}
}


function getNetwork(wallet: Wallet) {
return (wallet.keys[0].value.startsWith('tpub')) ? bitcoin.networks.testnet : bitcoin.networks.bitcoin;
}
Expand Down Expand Up @@ -145,14 +111,11 @@ function singleSig(wallet: Wallet, address: string, account: number, i: number,
return null;
}

return {
name: 'Bitcoin Address',
value: address,
address: address,
wallet: wallet,
return createAddressClipboardItem({
address,
wallet,
derivationPath: `${account}/${i}`,
private: false
};
});
}

function toHex(key: ExtendedPublicKey, account: number, i: number, bip32: any) {
Expand All @@ -172,14 +135,11 @@ function multiSig(wallet: Wallet, address: string, account: number, i: number, b
return null;
}

return {
name: 'Bitcoin Address',
value: address,
address: address,
wallet: wallet,
return createAddressClipboardItem({
address,
wallet,
derivationPath: `${account}/${i}`,
private: false
};
});
}

export function verifyAddress(wallets: Wallet[], address: string): AddressClipboardItem | null {
Expand Down
2 changes: 1 addition & 1 deletion app/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ function createWindow() {

const contextMenu = Menu.buildFromTemplate([
{ label: 'Open', type: 'normal', click: () => mainWindow.show() },
{ label: 'Help', type: 'normal', click: () => openUrl('https://docs.branta.pro') },
{ label: 'Help', type: 'normal', click: () => openUrl('https://developer.branta.pro/core') },
{ label: '', type: 'separator' },
{ label: 'Quit', type: 'normal', click: forceQuit },
{ label: `Version ${packageJson.version}`, type: 'normal', enabled: false }
Expand Down
Loading
Loading