es/ae/aens.js
async function claim (name, salt, waitForHeight, options = {}) {
  const opt = R.merge(this.Ae.defaults, options)
  // wait until block was mined before send claim transaction
  // if (waitForHeight) await this.awaitHeight(waitForHeight, { attempts: 200 })
  const claimTx = await this.nameClaimTx(R.merge(opt, {
    accountId: await this.address(),
    nameSalt: salt,
    name: `nm_${encodeBase58Check(Buffer.from(name))}`
  }))

  const result = await this.send(claimTx, opt)

  return {
    ...result,
    ...(await this.aensQuery(name))
  }
}
async function claim (name, salt, waitForHeight, options = {}) {
  const opt = R.merge(this.Ae.defaults, options)
  // wait until block was mined before send claim transaction
  // if (waitForHeight) await this.awaitHeight(waitForHeight, { attempts: 200 })
  const claimTx = await this.nameClaimTx(R.merge(opt, {
    accountId: await this.address(),
    nameSalt: salt,
    name: `nm_${encodeBase58Check(Buffer.from(name))}`
  }))

  const result = await this.send(claimTx, opt)

  return {
    ...result,
    ...(await this.aensQuery(name))
  }
}
async function claim ( name , salt , waitForHeight , options = { } ) { const opt = R . merge ( this . Ae . defaults , options ) // wait until block was mined before send claim transaction // if (waitForHeight) await this.awaitHeight(waitForHeight, { attempts: 200 }) const claimTx = await this . nameClaimTx ( R . merge ( opt , { accountId : await this . address ( ) , nameSalt : salt , name : ` ${ encodeBase58Check ( Buffer . from ( name ) ) } ` } ) ) const result = await this . send ( claimTx , opt ) return { ... result , ... ( await this . aensQuery ( name ) ) } }
Claim a previously preclaimed registration. This can only be done after the
preclaim step
@instance
@function
@alias module:@aeternity/aepp-sdk/es/ae/aens
@param {String} name
@param {String} salt
@param {Number} waitForHeight
@param {Record} [options={}]
@return {Promise<Object>} the result of the claim
Claim a previously preclaimed registration . This can only be done after the preclaim step