// Check availability
const available = await ens.available('myname.eth');
// Get registration price
const price = await ens.rentPrice('myname', 365 * 24 * 60 * 60); // 1 year
// Register (2-step commit-reveal)
const commitment = await ens.makeCommitment({
name: 'myname',
owner: userAddress,
duration: 365 * 24 * 60 * 60,
secret: randomBytes(32),
});
await ens.commit({ commitment, signer });
// Wait 1 minute...
await ens.register({
name: 'myname',
owner: userAddress,
duration: 365 * 24 * 60 * 60,
secret,
signer,
});