//@ts-nocheck import PrivateKey from '../../../primitives/PrivateKey.js' import { ProtoWallet, WalletInterface, CreateActionResult, SignActionResult, AbortActionResult, ListActionsResult, InternalizeActionResult, ListOutputsResult, RelinquishOutputResult, AcquireCertificateResult, ListCertificatesResult, ProveCertificateResult, RelinquishCertificateResult, DiscoverCertificatesResult, GetHeightResult, GetHeaderResult, KeyDeriverApi, KeyDeriver, GetPublicKeyArgs, PubKeyHex, AuthenticatedResult, GetNetworkResult, GetVersionResult, CachedKeyDeriver } from '../../../wallet/index.js' // Test Mock wallet which extends ProtoWallet but still implements Wallet interface // Unsupported methods throw export class CompletedProtoWallet extends ProtoWallet implements WalletInterface { keyDeriver: KeyDeriver constructor(rootKeyOrKeyDeriver: PrivateKey | 'anyone' | KeyDeriverApi) { super(rootKeyOrKeyDeriver) if (rootKeyOrKeyDeriver instanceof KeyDeriver) { this.keyDeriver = rootKeyOrKeyDeriver } else if ( typeof rootKeyOrKeyDeriver === 'string' || rootKeyOrKeyDeriver instanceof PrivateKey ) { this.keyDeriver = new CachedKeyDeriver(rootKeyOrKeyDeriver) } else { throw new Error('Invalid key deriver provided') } } async isAuthenticated( ): Promise { throw new Error('not implemented') } async waitForAuthentication( ): Promise { throw new Error('not implemented') } async getNetwork( ): Promise { throw new Error('not implemented') } async getVersion( ): Promise { throw new Error('not implemented') } async getPublicKey( args: GetPublicKeyArgs ): Promise<{ publicKey: PubKeyHex }> { if (args.privileged === true) { throw new Error('no privilege support') } if (args.identityKey === true) { if (this.keyDeriver === null || this.keyDeriver === undefined) { throw new Error('keyDeriver is not initialized') } return { publicKey: this.keyDeriver.rootKey.toPublicKey().toString() } } else { if (args.protocolID == null || typeof args.keyID !== 'string' || args.keyID.trim() === '') { throw new Error( 'protocolID and keyID are required if identityKey is false or undefined.' ) } if (this.keyDeriver === null || this.keyDeriver === undefined) { throw new Error('keyDeriver is not initialized') } return { publicKey: this.keyDeriver .derivePublicKey( args.protocolID, args.keyID, typeof args.counterparty === 'string' && args.counterparty.trim() !== '' ? args.counterparty : 'self', Boolean(args.forSelf) ) .toString() } } } async createAction( ): Promise { throw new Error('not implemented') } async signAction( ): Promise { throw new Error('not implemented') } async abortAction( ): Promise { throw new Error('not implemented') } async listActions( ): Promise { throw new Error('not implemented') } async internalizeAction( ): Promise { throw new Error('not implemented') } async listOutputs( ): Promise { throw new Error('not implemented') } async relinquishOutput( ): Promise { throw new Error('not implemented') } async acquireCertificate( ): Promise { throw new Error('not implemented') } async listCertificates( ): Promise { throw new Error('not implemented') } async proveCertificate( ): Promise { throw new Error('not implemented') } async relinquishCertificate( ): Promise { throw new Error('not implemented') } async discoverByIdentityKey( ): Promise { throw new Error('not implemented') } async discoverByAttributes( ): Promise { throw new Error('not implemented') } async getHeight( ): Promise { throw new Error('not implemented') } async getHeaderForHeight( ): Promise { throw new Error('not implemented') } }