@aeternity/aepp-sdk
Version:
SDK for the æternity blockchain
120 lines (85 loc) • 4.22 kB
Markdown
<a id="module_@aeternity/aepp-sdk/es/ae/aens"></a>
## /aepp-sdk/es/ae/aens
Aens module - routines to interact with the æternity naming system
The high-level description of the naming system is
https://github.com/aeternity/protocol/blob/master/AENS.md in the protocol
repository.
**Example**
```js
import Aens from '@aeternity/aepp-sdk/es/ae/aens'
```
* [/aepp-sdk/es/ae/aens](#module_/aepp-sdk/es/ae/aens)
* [Aens([options])](#exp_module_/aepp-sdk/es/ae/aens--Aens) ⇒ `Object` ⏏
* _instance_
* [.update(nameId, target, options)](#exp_module_/aepp-sdk/es/ae/aens--update) ⇒ `Object` ⏏
* [.query(name)](#exp_module_/aepp-sdk/es/ae/aens--query) ⇒ `Promise.<Object>` ⏏
* [.claim(name, salt, [options])](#exp_module_/aepp-sdk/es/ae/aens--claim) ⇒ `Promise.<Object>` ⏏
* [.preclaim(name, [options])](#exp_module_/aepp-sdk/es/ae/aens--preclaim) ⇒ `Promise.<Object>` ⏏
* _async_
* [.transfer(nameId, account, [options])](#exp_module_/aepp-sdk/es/ae/aens--transfer) ⇒ `Promise.<Object>` ⏏
* [.revoke(nameId, [options])](#exp_module_/aepp-sdk/es/ae/aens--revoke) ⇒ `Promise.<Object>` ⏏
<a id="exp_module_@aeternity/aepp-sdk/es/ae/aens--Aens"></a>
### Aens([options]) ⇒ `Object` ⏏
Aens Stamp
Aens provides name-system related methods atop
[Ae](#exp_module_/aepp-sdk/es/ae--Ae) clients.
**Kind**: Exported function
**Returns**: `Object` - Aens instance
**rtype**: `Stamp`
| Param | Type | Default | Description |
| --- | --- | --- | --- |
| [options] | `Object` | <code>{}</code> | Initializer object |
<a id="exp_module_@aeternity/aepp-sdk/es/ae/aens--update"></a>
### .update(nameId, target, options) ⇒ `Object` ⏏
Update an aens entry
**Kind**: instance method of [`/aepp-sdk/es/ae/aens`](#module_/aepp-sdk/es/ae/aens)
| Param | Description |
| --- | --- |
| nameId | domain hash |
| target | new target |
| options | |
<a id="exp_module_@aeternity/aepp-sdk/es/ae/aens--query"></a>
### .query(name) ⇒ `Promise.<Object>` ⏏
Query the status of an AENS registration
**Kind**: instance method of [`/aepp-sdk/es/ae/aens`](#module_/aepp-sdk/es/ae/aens)
| Param | Type |
| --- | --- |
| name | `string` |
<a id="exp_module_@aeternity/aepp-sdk/es/ae/aens--claim"></a>
### .claim(name, salt, [options]) ⇒ `Promise.<Object>` ⏏
Claim a previously preclaimed registration. This can only be done after the
preclaim step
**Kind**: instance method of [`/aepp-sdk/es/ae/aens`](#module_/aepp-sdk/es/ae/aens)
**Returns**: `Promise.<Object>` - the result of the claim
| Param | Type | Default |
| --- | --- | --- |
| name | `String` | |
| salt | `String` | |
| [options] | `Record` | <code>{}</code> |
<a id="exp_module_@aeternity/aepp-sdk/es/ae/aens--preclaim"></a>
### .preclaim(name, [options]) ⇒ `Promise.<Object>` ⏏
Preclaim a name. Sends a hash of the name and a random salt to the node
**Kind**: instance method of [`/aepp-sdk/es/ae/aens`](#module_/aepp-sdk/es/ae/aens)
| Param | Type | Default |
| --- | --- | --- |
| name | `string` | |
| [options] | `Record` | <code>{}</code> |
<a id="exp_module_@aeternity/aepp-sdk/es/ae/aens--transfer"></a>
### .transfer(nameId, account, [options]) ⇒ `Promise.<Object>` ⏏
Transfer a domain to another account
**Kind**: instance method of [`/aepp-sdk/es/ae/aens`](#module_/aepp-sdk/es/ae/aens)
**Category**: async
| Param | Type | Default |
| --- | --- | --- |
| nameId | `String` | |
| account | `String` | |
| [options] | `Object` | <code>{}</code> |
<a id="exp_module_@aeternity/aepp-sdk/es/ae/aens--revoke"></a>
### .revoke(nameId, [options]) ⇒ `Promise.<Object>` ⏏
Revoke a domain
**Kind**: instance method of [`/aepp-sdk/es/ae/aens`](#module_/aepp-sdk/es/ae/aens)
**Category**: async
| Param | Type | Default |
| --- | --- | --- |
| nameId | `String` | |
| [options] | `Object` | <code>{}</code> |