diff --git a/.env b/.env
index 55c3f5b15e..12fbf6e279 100644
--- a/.env
+++ b/.env
@@ -1,2 +1,2 @@
-TAG=v5.0.0-rc.1
-COMPILER_TAG=v3.2.0
+TAG=v5.0.0-rc.3
+COMPILER_TAG=v4.0.0-rc5
diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md
index fbf269d3c7..6481fed2b8 100644
--- a/.github/ISSUE_TEMPLATE.md
+++ b/.github/ISSUE_TEMPLATE.md
@@ -1,35 +1,29 @@
-Issue tracker is **ONLY** used for reporting bugs. NO NEW FEATURE ACCEPTED! Use [stackoverflow](https://stackoverflow.com/tags/aeternity) for supporting issues.
+**Note: for support questions, please use the [forum](https://forum.aeternity.com)**. This repository's issues are reserved for feature requests and bug reports.
-
+* **I'm submitting a ...**
+ - [ ] bug report
+ - [ ] feature request
+ - [ ] support request => Please do not submit support request here, see note at the top of this template.
-## Expected Behavior
-
-## Current Behavior
-
+* **Do you want to request a *feature* or report a *bug*?**
-## Possible Solution
-
+* **What is the current behavior?**
-## Steps to Reproduce
-
-
-1.
-2.
-3.
-4.
+* **If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem**
-## Environment / Context
-
-
-
+* **What is the expected behavior?**
-
+* **What is the motivation / use case for changing the behavior?**
-## [Node](https://github.com/aeternity/aeternity/releases) Version
+* **Please tell us about your environment:**
+
+ - Node Version: v0.0.0
+ - Protocol Version: 1
+ - Compiler version: v0.0.0
+ - VM Version: aevm | fate
+ - SDK Version: v0.0.0
+ - Environment: browser | nodejs
-## Detailed Description
-
-## Possible Implementation
-
+* **Other information** (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. forum, telegram, etc)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1592d1a1cc..bf26f71035 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,7 +1,60 @@
-# [4.7.0](https://github.com/aeternity/aepp-sdk-js/compare/2.4.0...4.7.0) (2019-09-11)
+# [5.0.0](https://github.com/aeternity/aepp-sdk-js/compare/4.7.0...5.0.0) (2019-10-04)
+
+
+### Bug Fixes
+
+* **rpc:** fix resolution rpc ops ([#669](https://github.com/aeternity/aepp-sdk-js/issues/669)) ([abd7c56](https://github.com/aeternity/aepp-sdk-js/commit/abd7c56))
+
+
+### Code Refactoring
+
+* **ACI:** rework Sophia Option type representation ([#691](https://github.com/aeternity/aepp-sdk-js/issues/691)) ([0dbb2fe](https://github.com/aeternity/aepp-sdk-js/commit/0dbb2fe))
+
+
+### Features
+
+* **AENS:** Add ability to spend by name ([#682](https://github.com/aeternity/aepp-sdk-js/issues/682)) ([0d43804](https://github.com/aeternity/aepp-sdk-js/commit/0d43804))
+* **AENS:** Add ability to claim contract, oracle, SC ([#671](https://github.com/aeternity/aepp-sdk-js/issues/671)) ([49fd0fd](https://github.com/aeternity/aepp-sdk-js/commit/49fd0fd))
+* **GA:** enbale GA ([#692](https://github.com/aeternity/aepp-sdk-js/issues/692)) ([eded912](https://github.com/aeternity/aepp-sdk-js/commit/eded912))
+* **Lima:** Lima compatibility ([#683](https://github.com/aeternity/aepp-sdk-js/issues/683)) ([a88042e](https://github.com/aeternity/aepp-sdk-js/commit/a88042e)), closes [#632](https://github.com/aeternity/aepp-sdk-js/issues/632) [#653](https://github.com/aeternity/aepp-sdk-js/issues/653) [#658](https://github.com/aeternity/aepp-sdk-js/issues/658) [#660](https://github.com/aeternity/aepp-sdk-js/issues/660) [#680](https://github.com/aeternity/aepp-sdk-js/issues/680) [#693](https://github.com/aeternity/aepp-sdk-js/issues/693) [#687](https://github.com/aeternity/aepp-sdk-js/issues/687)
+ - AENS auction support
+ - compiler 4.0.0 support
+ - node 5.0.0 support
+ - SDK use `FATE` for contract by default
+* **AE**: Add pointers verification for spend by name
+
+### BREAKING CHANGES
+
+* **aci:** Change Sophia option type representation in ACI
+```js
+// from
+await contract.methods.optionFn(Promise.resolve(1) || Promise.reject())
+// to
+await contract.methods.optionFn(1 || undefined)
+```
+# [5.0.0-next.1](https://github.com/aeternity/aepp-sdk-js/compare/4.6.0...4.7.0-next.1) (2019-09-10)
+
+
+### Bug Fixes
+
+* **package:** update serialize-javascript to version 2.0.0 ([#647](https://github.com/aeternity/aepp-sdk-js/issues/647)) ([1ddb392](https://github.com/aeternity/aepp-sdk-js/commit/1ddb392))
+
+
+### Features
+
+* **Contract/ACI** Add `payable` feature
+* **Compiler:** Compiler 4.0.0 compatibility ([#632](https://github.com/aeternity/aepp-sdk-js/issues/632)) ([d5f1632](https://github.com/aeternity/aepp-sdk-js/commit/d5f1632))
+* **Contract/ACI:** Add ability to use contract with external namespaces(`include "someLib"`) ([#653](https://github.com/aeternity/aepp-sdk-js/issues/653)) ([9708b43](https://github.com/aeternity/aepp-sdk-js/commit/9708b43))
+
+
+
+
+# [4.7.0](https://github.com/aeternity/aepp-sdk-js/compare/2.4.0...4.7.0) (2019-09-11)
+
+
### Features
* **Oracle:** Add methods for polling queries [#637](https://github.com/aeternity/aepp-sdk-js/pull/637)
diff --git a/docker-compose.yml b/docker-compose.yml
index 153c6c96b1..3e2d28726d 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -20,7 +20,7 @@ services:
expose: [3013, 3113, 3014, 3114]
environment:
EPOCH_CONFIG: /home/aeternity/aeternity_node.yaml
- command: -aecore expected_mine_rate ${EPOCH_MINE_RATE:-5000}
+ command: bin/aeternity console -noinput -aecore expected_mine_rate ${EPOCH_MINE_RATE:-5000}
volumes:
- ${PWD}/docker/aeternity_node_mean16.yaml:/home/aeternity/aeternity_node.yaml
- ${PWD}/docker/keys/node:/home/aeternity/node/keys
diff --git a/docker/aeternity_node_mean16.yaml b/docker/aeternity_node_mean16.yaml
index a580c0198f..321023a4ba 100644
--- a/docker/aeternity_node_mean16.yaml
+++ b/docker/aeternity_node_mean16.yaml
@@ -24,6 +24,7 @@ chain:
"1": 0
"2": 2
"3": 4
+ "4": 6
mining:
autostart: true
diff --git a/docs/api/account.md b/docs/api/account.md
index 78052f2148..29738947e9 100644
--- a/docs/api/account.md
+++ b/docs/api/account.md
@@ -3,7 +3,6 @@
## @aeternity/aepp-sdk/es/account
Account module
-**Export**: Account
**Example**
```js
import Account from '@aeternity/aepp-sdk/es/account'
diff --git a/docs/api/account/memory.md b/docs/api/account/memory.md
index 264ce55716..2e3fa0cd1f 100644
--- a/docs/api/account/memory.md
+++ b/docs/api/account/memory.md
@@ -3,7 +3,6 @@
## @aeternity/aepp-sdk/es/account/memory
Memory Account module
-**Export**: MemoryAccount
**Example**
```js
import MemoryAccount from '@aeternity/aepp-sdk/es/account/memory'
diff --git a/docs/api/account/selector.md b/docs/api/account/selector.md
index a270959d7f..316ccc2ac6 100644
--- a/docs/api/account/selector.md
+++ b/docs/api/account/selector.md
@@ -5,7 +5,6 @@ Accounts Selector module
This is the complement to [@aeternity/aepp-sdk/es/accounts](#module_@aeternity/aepp-sdk/es/accounts).
-**Export**: Selector
**Example**
```js
import Selector from '@aeternity/aepp-sdk/es/account/selector'
diff --git a/docs/api/accounts.md b/docs/api/accounts.md
index f507246bed..88bb506b60 100644
--- a/docs/api/accounts.md
+++ b/docs/api/accounts.md
@@ -3,7 +3,6 @@
## @aeternity/aepp-sdk/es/accounts
Accounts module
-**Export**: Accounts
**Example**
```js
import Accounts from '@aeternity/aepp-sdk/es/accounts'
diff --git a/docs/api/ae.md b/docs/api/ae.md
index 5e79fc6f81..41686321d7 100644
--- a/docs/api/ae.md
+++ b/docs/api/ae.md
@@ -3,7 +3,6 @@
## @aeternity/aepp-sdk/es/ae
Ae module
-**Export**: Ae
**Example**
```js
import Ae from '@aeternity/aepp-sdk/es/ae'
@@ -11,11 +10,14 @@ import Ae from '@aeternity/aepp-sdk/es/ae'
* [@aeternity/aepp-sdk/es/ae](#module_@aeternity/aepp-sdk/es/ae)
* [Ae([options])](#exp_module_@aeternity/aepp-sdk/es/ae--Ae) ⇒ `Object` ⏏
- * [.destroyInstance()](#module_@aeternity/aepp-sdk/es/ae--Ae+destroyInstance) ⇒ `void`
- * _async_
- * [.send(tx, [options])](#module_@aeternity/aepp-sdk/es/ae--Ae+send) ⇒ `String` \| `String`
- * [.spend(amount, recipientId, options)](#module_@aeternity/aepp-sdk/es/ae--Ae+spend) ⇒ `String` \| `String`
- * [.transferFunds(percentage, recipientId, options)](#module_@aeternity/aepp-sdk/es/ae--Ae+transferFunds) ⇒ `String` \| `String`
+ * _instance_
+ * [.destroyInstance()](#module_@aeternity/aepp-sdk/es/ae--Ae+destroyInstance) ⇒ `void`
+ * _async_
+ * [.send(tx, [options])](#module_@aeternity/aepp-sdk/es/ae--Ae+send) ⇒ `String` \| `String`
+ * [.spend(amount, recipientId, options)](#module_@aeternity/aepp-sdk/es/ae--Ae+spend) ⇒ `String` \| `String`
+ * [.transferFunds(percentage, recipientId, options)](#module_@aeternity/aepp-sdk/es/ae--Ae+transferFunds) ⇒ `String` \| `String`
+ * _inner_
+ * [~resolveRecipientName(nameOrAddress, verify)](#module_@aeternity/aepp-sdk/es/ae--Ae..resolveRecipientName) ⇒ `String`
@@ -76,7 +78,7 @@ Send tokens to another account
| Param | Type | Description |
| --- | --- | --- |
| amount | `Number` \| `String` | Amount to spend |
-| recipientId | `String` | Address of recipient account |
+| recipientId | `String` | Address or Name of recipient account |
| options | `Object` | Options |
@@ -95,3 +97,16 @@ Send a percentage of funds to another account
| recipientId | `String` | Address of recipient account |
| options | `Object` | Options |
+
+
+#### Ae~resolveRecipientName(nameOrAddress, verify) ⇒ `String`
+Resolve AENS name and return name hash
+
+**Kind**: inner method of [`Ae`](#exp_module_@aeternity/aepp-sdk/es/ae--Ae)
+**Returns**: `String` - Address or AENS name hash
+
+| Param | Type |
+| --- | --- |
+| nameOrAddress | `String` |
+| verify | |
+
diff --git a/docs/api/ae/aens.md b/docs/api/ae/aens.md
index cf7dd0aac9..3190ef29c5 100644
--- a/docs/api/ae/aens.md
+++ b/docs/api/ae/aens.md
@@ -7,7 +7,6 @@ The high-level description of the naming system is
https://github.com/aeternity/protocol/blob/master/AENS.md in the protocol
repository.
-**Export**: Aens
**Example**
```js
import Aens from '@aeternity/aepp-sdk/es/ae/aens'
@@ -15,6 +14,8 @@ import Aens from '@aeternity/aepp-sdk/es/ae/aens'
* [@aeternity/aepp-sdk/es/ae/aens](#module_@aeternity/aepp-sdk/es/ae/aens)
* [Aens([options])](#exp_module_@aeternity/aepp-sdk/es/ae/aens--Aens) ⇒ `Object` ⏏
+ * _global_
+ * [exports.isNameValid(name, [throwError])](#exp_module_@aeternity/aepp-sdk/es/ae/aens--exports.isNameValid) ⇒ ⏏
* _instance_
* [.update(nameId, target, options)](#exp_module_@aeternity/aepp-sdk/es/ae/aens--update) ⇒ `Object` ⏏
* [.query(name)](#exp_module_@aeternity/aepp-sdk/es/ae/aens--query) ⇒ `Promise.<Object>` ⏏
@@ -40,6 +41,23 @@ Aens provides name-system related methods atop
| --- | --- | --- | --- |
| [options] | `Object` | {}
| Initializer object |
+
+
+### exports.isNameValid(name, [throwError]) ⇒ ⏏
+Is name valid
+
+**Kind**: global method of [`@aeternity/aepp-sdk/es/ae/aens`](#module_@aeternity/aepp-sdk/es/ae/aens)
+**Returns**: Boolean
+**Throws**:
+
+- Error
+
+
+| Param | Type | Default | Description |
+| --- | --- | --- | --- |
+| name | `string` | | |
+| [throwError] | `boolean` | true
| Throw error on invalid |
+
### .update(nameId, target, options) ⇒ `Object` ⏏
diff --git a/docs/api/ae/aepp.md b/docs/api/ae/aepp.md
index b39d6cd4a0..16f59e8f6e 100644
--- a/docs/api/ae/aepp.md
+++ b/docs/api/ae/aepp.md
@@ -3,7 +3,6 @@
## @aeternity/aepp-sdk/es/ae/aepp
Aepp module
-**Export**: Aepp
**Example**
```js
import Ae from '@aeternity/aepp-sdk/es/ae/aepp'
diff --git a/docs/api/ae/contract.md b/docs/api/ae/contract.md
index 2d0ce74b73..8292ecb9e7 100644
--- a/docs/api/ae/contract.md
+++ b/docs/api/ae/contract.md
@@ -6,7 +6,6 @@ Contract module - routines to interact with the æternity contract
High level documentation of the contracts are available at
https://github.com/aeternity/protocol/tree/master/contracts and
-**Export**: Contract
**Example**
```js
import Contract from '@aeternity/aepp-sdk/es/ae/contract' (Using tree-shaking)
@@ -17,19 +16,19 @@ import { Contract } from '@aeternity/aepp-sdk' (Using bundle)
```
* [@aeternity/aepp-sdk/es/ae/contract](#module_@aeternity/aepp-sdk/es/ae/contract)
- * [exports.Contract([options])](#exp_module_@aeternity/aepp-sdk/es/ae/contract--exports.Contract) ⇒ `Object` ⏏
+ * [exports.ContractAPI([options])](#exp_module_@aeternity/aepp-sdk/es/ae/contract--exports.ContractAPI) ⇒ `Object` ⏏
* _async_
* [handleCallError(result)](#exp_module_@aeternity/aepp-sdk/es/ae/contract--handleCallError) ⇒ `Promise.<void>` ⏏
- * [contractEncodeCall(source, name, args)](#exp_module_@aeternity/aepp-sdk/es/ae/contract--contractEncodeCall) ⇒ `Promise.<String>` ⏏
- * [contractDecodeData(source, fn, callValue, callResult, options)](#exp_module_@aeternity/aepp-sdk/es/ae/contract--contractDecodeData) ⇒ `Promise.<String>` ⏏
- * [contractCallStatic(source, address, name, args, options, top, options)](#exp_module_@aeternity/aepp-sdk/es/ae/contract--contractCallStatic) ⇒ `Promise.<Object>` ⏏
- * [contractCall(source, address, name, args, options)](#exp_module_@aeternity/aepp-sdk/es/ae/contract--contractCall) ⇒ `Promise.<Object>` ⏏
- * [contractDeploy(code, source, initState, options)](#exp_module_@aeternity/aepp-sdk/es/ae/contract--contractDeploy) ⇒ `Promise.<Object>` ⏏
- * [contractCompile(source, options)](#exp_module_@aeternity/aepp-sdk/es/ae/contract--contractCompile) ⇒ `Promise.<Object>` ⏏
+ * [contractEncodeCall(source, name, args, [options])](#exp_module_@aeternity/aepp-sdk/es/ae/contract--contractEncodeCall) ⇒ `Promise.<String>` ⏏
+ * [contractDecodeData(source, fn, callValue, callResult, [options])](#exp_module_@aeternity/aepp-sdk/es/ae/contract--contractDecodeData) ⇒ `Promise.<String>` ⏏
+ * [contractCallStatic(source, address, name, args, [options], bytecode, options, filesystem)](#exp_module_@aeternity/aepp-sdk/es/ae/contract--contractCallStatic) ⇒ `Promise.<Object>` ⏏
+ * [contractCall(source, address, name, args, [options])](#exp_module_@aeternity/aepp-sdk/es/ae/contract--contractCall) ⏏
+ * [contractDeploy(code, source, initState, [options])](#exp_module_@aeternity/aepp-sdk/es/ae/contract--contractDeploy) ⇒ `Promise.<Object>` ⏏
+ * [contractCompile(source, [options])](#exp_module_@aeternity/aepp-sdk/es/ae/contract--contractCompile) ⇒ `Promise.<Object>` ⏏
-
+
-### exports.Contract([options]) ⇒ `Object` ⏏
+### exports.ContractAPI([options]) ⇒ `Object` ⏏
Contract Stamp
Provide contract implementation
@@ -80,34 +79,38 @@ Handle contract call error
-### contractEncodeCall(source, name, args) ⇒ `Promise.<String>` ⏏
+### contractEncodeCall(source, name, args, [options]) ⇒ `Promise.<String>` ⏏
Encode call data for contract call
**Kind**: Exported function
**Category**: async
-| Param | Type | Description |
-| --- | --- | --- |
-| source | `String` | Contract source code |
-| name | `String` | Name of function to call |
-| args | `Array` | Argument's for call |
+| Param | Type | Default | Description |
+| --- | --- | --- | --- |
+| source | `String` | | Contract source code |
+| name | `String` | | Name of function to call |
+| args | `Array` | | Argument's for call |
+| [options] | `Object` | {}
| Options |
+| [options.filesystem] | `Object` | {}
| Contract external namespaces map |
+| [options.backend] | `Object` | 'fate'
| Compiler backend |
-### contractDecodeData(source, fn, callValue, callResult, options) ⇒ `Promise.<String>` ⏏
+### contractDecodeData(source, fn, callValue, callResult, [options]) ⇒ `Promise.<String>` ⏏
Decode contract call result data
**Kind**: Exported function
**Returns**: `Promise.<String>` - Result object
**Category**: async
-| Param | Type | Description |
-| --- | --- | --- |
-| source | `String` | source code |
-| fn | `String` | function name |
-| callValue | `String` | result call data |
-| callResult | `String` | result status |
-| options | | |
+| Param | Type | Default | Description |
+| --- | --- | --- | --- |
+| source | `String` | | source code |
+| fn | `String` | | function name |
+| callValue | `String` | | result call data |
+| callResult | `String` | | result status |
+| [options] | `Object` | {}
| Options |
+| [options.filesystem] | `Object` | {}
| Contract external namespaces map |
**Example**
```js
@@ -115,22 +118,24 @@ const decodedData = await client.contractDecodeData(SourceCode ,'functionName',
```
-### contractCallStatic(source, address, name, args, options, top, options) ⇒ `Promise.<Object>` ⏏
+### contractCallStatic(source, address, name, args, [options], bytecode, options, filesystem) ⇒ `Promise.<Object>` ⏏
Static contract call(using dry-run)
**Kind**: Exported function
**Returns**: `Promise.<Object>` - Result object
**Category**: async
-| Param | Type | Description |
-| --- | --- | --- |
-| source | `String` | Contract source code |
-| address | `String` | Contract address |
-| name | `String` | Name of function to call |
-| args | `Array` | Argument's for call function |
-| options | `Object` | [options={}] Options |
-| top | `String` | [options.top] Block hash on which you want to call contract |
-| options | `String` | [options.options] Transaction options (fee, ttl, gas, amount, deposit) |
+| Param | Type | Default | Description |
+| --- | --- | --- | --- |
+| source | `String` | | Contract source code |
+| address | `String` | | Contract address |
+| name | `String` | | Name of function to call |
+| args | `Array` | | Argument's for call function |
+| [options] | `Object` | {}
| Options |
+| [options.top] | `String` | | Block hash on which you want to call contract |
+| bytecode | | | |
+| options | `String` | | [options.options] Transaction options (fee, ttl, gas, amount, deposit) |
+| filesystem | `Object` | | [options.options.filesystem] Contract external namespaces map |
**Example**
```js
@@ -142,20 +147,20 @@ const callResult = await client.contractCallStatic(source, address, fnName, args
```
-### contractCall(source, address, name, args, options) ⇒ `Promise.<Object>` ⏏
+### contractCall(source, address, name, args, [options]) ⏏
Call contract function
**Kind**: Exported function
-**Returns**: `Promise.<Object>` - Result object
**Category**: async
-| Param | Type | Description |
-| --- | --- | --- |
-| source | `String` | Contract source code |
-| address | `String` | Contract address |
-| name | `String` | Name of function to call |
-| args | `Array` | Argument's for call function |
-| options | `Object` | Transaction options (fee, ttl, gas, amount, deposit) |
+| Param | Type | Default | Description |
+| --- | --- | --- | --- |
+| source | `String` | | Contract source code |
+| address | `String` | | Contract address |
+| name | `String` | | Name of function to call |
+| args | `Array` | | Argument's for call function |
+| [options] | `Object` | {}
| Transaction options (fee, ttl, gas, amount, deposit) |
+| [options.filesystem] | `Object` | {}
| Contract external namespaces map* @return {Promise