diff --git a/src/utils/sp-address.utils.ts b/src/utils/sp-address.utils.ts index 90cee47..4405ef8 100755 --- a/src/utils/sp-address.utils.ts +++ b/src/utils/sp-address.utils.ts @@ -169,10 +169,25 @@ export async function prepareAndSendPairingTx(secondDeviceAddress: string) { } catch (e) { throw e; } - // Create the process + + // Prompt the user for a username. + const userName = prompt("Please enter your user name:"); + if (!userName) { + throw new Error("User name is required for the pairing process."); + } + + // Create the process after a delay. setTimeout(async () => { - const relayAddress = service.getAllRelays(); - const createPairingProcessReturn = await service.createPairingProcess([secondDeviceAddress], relayAddress[0].spAddress, 1); + const relayAddress = service.getAllRelays(); + + // Pass the userName as an additional parameter. + const createPairingProcessReturn = await service.createPairingProcess( + userName, + [secondDeviceAddress], + relayAddress[0].spAddress, + 1, + userName + ); if (!createPairingProcessReturn.updated_process) { throw new Error('createPairingProcess returned an empty new process'); // This should never happen