Add embeddable wallet balance page
This commit is contained in:
@@ -119,6 +119,7 @@ export class StateService {
|
||||
mempoolTransactions$ = new Subject<Transaction>();
|
||||
mempoolTxPosition$ = new Subject<{ txid: string, position: MempoolPosition, cpfp: CpfpInfo | null}>();
|
||||
mempoolRemovedTransactions$ = new Subject<Transaction>();
|
||||
multiAddressTransactions$ = new Subject<{ [address: string]: { mempool: Transaction[], confirmed: Transaction[], removed: Transaction[] }}>();
|
||||
blockTransactions$ = new Subject<Transaction>();
|
||||
isLoadingWebSocket$ = new ReplaySubject<boolean>(1);
|
||||
isLoadingMempool$ = new BehaviorSubject<boolean>(true);
|
||||
|
||||
@@ -32,6 +32,7 @@ export class WebsocketService {
|
||||
private isTrackingRbf: 'all' | 'fullRbf' | false = false;
|
||||
private isTrackingRbfSummary = false;
|
||||
private isTrackingAddress: string | false = false;
|
||||
private isTrackingAddresses: string[] | false = false;
|
||||
private trackingMempoolBlock: number;
|
||||
private latestGitCommit = '';
|
||||
private onlineCheckTimeout: number;
|
||||
@@ -126,6 +127,9 @@ export class WebsocketService {
|
||||
if (this.isTrackingAddress) {
|
||||
this.startTrackAddress(this.isTrackingAddress);
|
||||
}
|
||||
if (this.isTrackingAddresses) {
|
||||
this.startTrackAddresses(this.isTrackingAddresses);
|
||||
}
|
||||
this.stateService.connectionState$.next(2);
|
||||
}
|
||||
|
||||
@@ -175,6 +179,16 @@ export class WebsocketService {
|
||||
this.isTrackingAddress = false;
|
||||
}
|
||||
|
||||
startTrackAddresses(addresses: string[]) {
|
||||
this.websocketSubject.next({ 'track-addresses': addresses });
|
||||
this.isTrackingAddresses = addresses;
|
||||
}
|
||||
|
||||
stopTrackingAddresses() {
|
||||
this.websocketSubject.next({ 'track-addresses': [] });
|
||||
this.isTrackingAddresses = false;
|
||||
}
|
||||
|
||||
startTrackAsset(asset: string) {
|
||||
this.websocketSubject.next({ 'track-asset': asset });
|
||||
}
|
||||
@@ -374,6 +388,10 @@ export class WebsocketService {
|
||||
});
|
||||
}
|
||||
|
||||
if (response['multi-address-transactions']) {
|
||||
this.stateService.multiAddressTransactions$.next(response['multi-address-transactions']);
|
||||
}
|
||||
|
||||
if (response['block-transactions']) {
|
||||
response['block-transactions'].forEach((addressTransaction: Transaction) => {
|
||||
this.stateService.blockTransactions$.next(addressTransaction);
|
||||
|
||||
Reference in New Issue
Block a user