Check if client is paired before creating pairing process

This commit is contained in:
Sosthene 2024-12-17 11:53:21 +01:00
parent 06a5d8b467
commit 9e83e0ff9b

View File

@ -132,6 +132,9 @@ export default class Services {
}
public async createPairingProcess(pairWith: string[], relayAddress: string, feeRate: number): Promise<ApiReturn> {
if (this.sdkClient.is_paired()) {
throw new Error('Device already paired');
}
const myAddress: string = this.sdkClient.get_address();
pairWith.push(myAddress);
const newKey = this.sdkClient.get_new_keypair();