Blockchain Traits
This commit is contained in:
@@ -1,8 +1,15 @@
|
||||
import { BaseWallet } from './base-wallet.js';
|
||||
import { type TransactionTemplate, type WalletDependencies } from './types.js';
|
||||
import {
|
||||
type TransactionTemplate,
|
||||
type WalletBlockchain,
|
||||
type WalletDependencies,
|
||||
} from './types.js';
|
||||
import { TransactionBuilder } from './transaction-builder.js';
|
||||
|
||||
import { type BaseBlockchain, type BlockchainTransaction } from '../blockchain';
|
||||
import {
|
||||
type AddressStatusPayload,
|
||||
type BlockchainTransaction,
|
||||
} from '../blockchain';
|
||||
import { type BaseStore, Activities, StoreInMemory } from '../storage';
|
||||
|
||||
import {
|
||||
@@ -116,7 +123,7 @@ export class WalletP2PKH extends BaseWallet {
|
||||
|
||||
// Dependencies.
|
||||
public readonly activities: Activities;
|
||||
public readonly blockchain: BaseBlockchain;
|
||||
public readonly blockchain: WalletBlockchain;
|
||||
public readonly cache: BaseStore;
|
||||
|
||||
// Genesis Data.
|
||||
@@ -408,11 +415,14 @@ export class WalletP2PKH extends BaseWallet {
|
||||
await this.blockchain.broadcastTransaction(generatedTxBytes);
|
||||
}
|
||||
|
||||
private async onAddressNotification(status: string | null) {
|
||||
private async onAddressNotification(
|
||||
_address: string,
|
||||
payload?: AddressStatusPayload,
|
||||
) {
|
||||
// If wallet state has changed...
|
||||
if (status !== this.status) {
|
||||
if (payload && payload.status !== this.status) {
|
||||
// Set our new status.
|
||||
this.status = status;
|
||||
this.status = payload.status;
|
||||
|
||||
// Emit an event.
|
||||
this.emit('stateUpdated', this.status);
|
||||
|
||||
Reference in New Issue
Block a user