Monorepo stuff

Signed-off-by: James Zuccon <zuccon@gmail.com>
This commit is contained in:
James Zuccon
2024-09-02 20:05:35 +10:00
parent f2210e631a
commit 2ac7af4069
62 changed files with 13227 additions and 149 deletions
+38
View File
@@ -0,0 +1,38 @@
import { Blockchain, WalletHD } from '@xo/wallet';
import { WalletP2PKHVue, useWalletP2PKHVue } from './wallet-p2pkh-vue.js';
import { computed, ref, shallowRef } from 'vue';
import { HdPrivateNodeValid } from '@bitauth/libauth';
export class WalletHDVue extends WalletHD<WalletP2PKHVue> {
// Reactive State.
public rShouldMonitor = ref(false);
public rWallets = shallowRef<Array<WalletP2PKHVue>>([]);
// Computeds.
public rBalance = computed(() => {
return this.rWallets.value.reduce(
(total, node) => total + node.rBalance.value,
0
);
});
constructor(
node: HdPrivateNodeValid,
electrum: Blockchain,
walletFactory = useWalletP2PKHVue
) {
super(node, electrum, walletFactory);
this.events.on(
'walletsUpdated',
(wallets) => (this.rWallets.value = wallets)
);
this.events.on(
'shouldMonitorUpdated',
(shouldMonitor) => (this.rShouldMonitor.value = shouldMonitor)
);
}
}