Skip to content

Commit 2edf518

Browse files
authored
Merge pull request #779 from aeternity/release/6.1.0
Release 6.1.0
2 parents 081bc4e + 65b3111 commit 2edf518

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+2195
-943
lines changed

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
TAG=v5.0.0-rc.5
1+
TAG=v5.1.0-rc.1
22
COMPILER_TAG=v4.0.0

CHANGELOG.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
1+
# [6.1.0](https://github.com/aeternity/aepp-sdk-js/compare/6.0.2...6.1.0) (2019-11-11)
2+
3+
4+
### Bug Fixes
5+
6+
* **AENS:** auction end block calculation ([#746](https://github.com/aeternity/aepp-sdk-js/issues/746)) ([4c1f5e4](https://github.com/aeternity/aepp-sdk-js/commit/4c1f5e4))
7+
* **AENS:** Fix `produceNameId` function(Make name lowercase). Enable … ([#750](https://github.com/aeternity/aepp-sdk-js/issues/750)) ([fd14225](https://github.com/aeternity/aepp-sdk-js/commit/fd14225))
8+
* **state channels:** wait for connection to be established before sending generic message ([#723](https://github.com/aeternity/aepp-sdk-js/issues/723)) ([c5f35d1](https://github.com/aeternity/aepp-sdk-js/commit/c5f35d1))
9+
* **TxHelpers:** Use BigNumber in auction end block calculation ([777c012](https://github.com/aeternity/aepp-sdk-js/commit/777c012))
10+
11+
12+
### Features
13+
14+
* **ACI:** Add validation for contractAddress ([#764](https://github.com/aeternity/aepp-sdk-js/issues/764)) ([07cb0e7](https://github.com/aeternity/aepp-sdk-js/commit/07cb0e7))
15+
* **AENS:** Add nameFee validation to TxValidator ([#765](https://github.com/aeternity/aepp-sdk-js/issues/765)) ([5250e75](https://github.com/aeternity/aepp-sdk-js/commit/5250e75))
16+
* **AENS:** Increase default nameTtl ([#775](https://github.com/aeternity/aepp-sdk-js/issues/775)) ([c5f2582](https://github.com/aeternity/aepp-sdk-js/commit/c5f2582))
17+
* **Contract:** Add ability to pass arguments or callData for contract `deploy/call/callStatic` API ([#768](https://github.com/aeternity/aepp-sdk-js/issues/768)) ([12aaca3](https://github.com/aeternity/aepp-sdk-js/commit/12aaca3))
18+
* **Http:** Assign error object to http error ([#770](https://github.com/aeternity/aepp-sdk-js/issues/770)) ([87062ea](https://github.com/aeternity/aepp-sdk-js/commit/87062ea))
19+
* **state channels:** add round method ([#763](https://github.com/aeternity/aepp-sdk-js/issues/763)) ([c950937](https://github.com/aeternity/aepp-sdk-js/commit/c950937))
20+
* **state channels:** allow off chain updates to be cancelled with custom error code ([#753](https://github.com/aeternity/aepp-sdk-js/issues/753)) ([ae4426e](https://github.com/aeternity/aepp-sdk-js/commit/ae4426e))
21+
* **state channels:** allow to pass metadata to transfer update ([#755](https://github.com/aeternity/aepp-sdk-js/issues/755)) ([ddc6611](https://github.com/aeternity/aepp-sdk-js/commit/ddc6611))
22+
* **state channels:** make state channels compatible with node v5.0.0… ([#688](https://github.com/aeternity/aepp-sdk-js/issues/688)) ([deed7fc](https://github.com/aeternity/aepp-sdk-js/commit/deed7fc)), 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)
23+
* **state channels:** make state channels compatible with node v5.1.0… ([#776](https://github.com/aeternity/aepp-sdk-js/issues/776)) ([74952aa](https://github.com/aeternity/aepp-sdk-js/commit/74952aa))
24+
25+
26+
127
## [6.0.2](https://github.com/aeternity/aepp-sdk-js/compare/6.0.1...6.0.2) (2019-10-31)
228

329

@@ -20,6 +46,8 @@
2046

2147

2248

49+
50+
2351
# [6.0.0](https://github.com/aeternity/aepp-sdk-js/compare/4.7.0...6.0.0) (2019-10-16)
2452

2553

docs/api/ae/contract.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { Contract } from '@aeternity/aepp-sdk' (Using bundle)
2121
* [handleCallError(result)](#exp_module_@aeternity/aepp-sdk/es/ae/contract--handleCallError)`Promise.<void>`
2222
* [contractEncodeCall(source, name, args, [options])](#exp_module_@aeternity/aepp-sdk/es/ae/contract--contractEncodeCall)`Promise.<String>`
2323
* [contractDecodeData(source, fn, callValue, callResult, [options])](#exp_module_@aeternity/aepp-sdk/es/ae/contract--contractDecodeData)`Promise.<String>`
24-
* [contractCallStatic(source, address, name, args, [options], bytecode, options, filesystem)](#exp_module_@aeternity/aepp-sdk/es/ae/contract--contractCallStatic)`Promise.<Object>`
24+
* [contractCallStatic(source, address, name, args, [options])](#exp_module_@aeternity/aepp-sdk/es/ae/contract--contractCallStatic)`Promise.<Object>`
2525
* [contractCall(source, address, name, args, [options])](#exp_module_@aeternity/aepp-sdk/es/ae/contract--contractCall)
2626
* [contractDeploy(code, source, initState, [options])](#exp_module_@aeternity/aepp-sdk/es/ae/contract--contractDeploy)`Promise.<Object>`
2727
* [contractCompile(source, [options])](#exp_module_@aeternity/aepp-sdk/es/ae/contract--contractCompile)`Promise.<Object>`
@@ -118,7 +118,7 @@ const decodedData = await client.contractDecodeData(SourceCode ,'functionName',
118118
```
119119
<a id="exp_module_@aeternity/aepp-sdk/es/ae/contract--contractCallStatic"></a>
120120

121-
### contractCallStatic(source, address, name, args, [options], bytecode, options, filesystem) ⇒ `Promise.&lt;Object&gt;` ⏏
121+
### contractCallStatic(source, address, name, args, [options]) ⇒ `Promise.&lt;Object&gt;` ⏏
122122
Static contract call(using dry-run)
123123

124124
**Kind**: Exported function
@@ -130,12 +130,12 @@ Static contract call(using dry-run)
130130
| source | `String` | | Contract source code |
131131
| address | `String` | | Contract address |
132132
| name | `String` | | Name of function to call |
133-
| args | `Array` | | Argument's for call function |
133+
| args | `Array` \| `String` | | Argument's or callData for call/deploy transaction |
134134
| [options] | `Object` | <code>{}</code> | Options |
135135
| [options.top] | `String` | | Block hash on which you want to call contract |
136-
| bytecode | | | |
137-
| options | `String` | | [options.options] Transaction options (fee, ttl, gas, amount, deposit) |
138-
| filesystem | `Object` | | [options.options.filesystem] Contract external namespaces map |
136+
| [options.bytecode] | `String` | | Block hash on which you want to call contract |
137+
| [options.options] | `Object` | | Transaction options (fee, ttl, gas, amount, deposit) |
138+
| [options.options.filesystem] | `Object` | | Contract external namespaces map |
139139

140140
**Example**
141141
```js
@@ -158,7 +158,7 @@ Call contract function
158158
| source | `String` | | Contract source code |
159159
| address | `String` | | Contract address |
160160
| name | `String` | | Name of function to call |
161-
| args | `Array` | | Argument's for call function |
161+
| args | `Array` \| `String` | | Argument's or callData for call function |
162162
| [options] | `Object` | <code>{}</code> | Transaction options (fee, ttl, gas, amount, deposit) |
163163
| [options.filesystem] | `Object` | <code>{}</code> | Contract external namespaces map* @return {Promise<Object>} Result object |
164164

@@ -184,7 +184,7 @@ Deploy contract to the node
184184
| --- | --- | --- | --- |
185185
| code | `String` | | Compiled contract |
186186
| source | `String` | | Contract source code |
187-
| initState | `Array` | | Arguments of contract constructor(init) function |
187+
| initState | `Array` \| `String` | | Arguments of contract constructor(init) function. Can be array of arguments or callData string |
188188
| [options] | `Object` | <code>{}</code> | Transaction options (fee, ttl, gas, amount, deposit) |
189189
| [options.filesystem] | `Object` | <code>{}</code> | Contract external namespaces map* @return {Promise<Object>} Result object |
190190

docs/api/ae/oracle.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Poll for oracle queries
5454
| oracleId | `String` | Oracle public key |
5555
| onQuery | `function` | OnQuery callback |
5656
| [options] | `Object` | Options object |
57-
| [options.interval] | `Object` | Poll interval(default: 5000) |
57+
| [options.interval] | `Number` | Poll interval(default: 5000) |
5858

5959
<a id="exp_module_@aeternity/aepp-sdk/es/ae/oracle--getQueryObject"></a>
6060

docs/api/channel/index.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ import Channel from '@aeternity/aepp-sdk/es/channel/index'
1111
* [@aeternity/aepp-sdk/es/channel/index](#module_@aeternity/aepp-sdk/es/channel/index)
1212
* [Channel(options)](#exp_module_@aeternity/aepp-sdk/es/channel/index--Channel)`Promise.&lt;Object&gt;`
1313
* [~on(event, callback)](#module_@aeternity/aepp-sdk/es/channel/index--Channel..on)
14+
* [~off(event, callback)](#module_@aeternity/aepp-sdk/es/channel/index--Channel..off)
1415
* [~disconnect()](#module_@aeternity/aepp-sdk/es/channel/index--Channel..disconnect)
1516
* [~status()](#module_@aeternity/aepp-sdk/es/channel/index--Channel..status)`String`
1617
* [~state()](#module_@aeternity/aepp-sdk/es/channel/index--Channel..state)`Promise.&lt;Object&gt;`
18+
* [~round()](#module_@aeternity/aepp-sdk/es/channel/index--Channel..round)`Number`
1719
* [~id()](#module_@aeternity/aepp-sdk/es/channel/index--Channel..id)`String`
18-
* [~update(from, to, amount, sign)](#module_@aeternity/aepp-sdk/es/channel/index--Channel..update)`Promise.&lt;Object&gt;`
20+
* [~update(from, to, amount, sign, metadata)](#module_@aeternity/aepp-sdk/es/channel/index--Channel..update)`Promise.&lt;Object&gt;`
1921
* [~poi(addresses)](#module_@aeternity/aepp-sdk/es/channel/index--Channel..poi)`Promise.&lt;String&gt;`
2022
* [~balances(accounts)](#module_@aeternity/aepp-sdk/es/channel/index--Channel..balances)`Promise.&lt;Object&gt;`
2123
* [~leave()](#module_@aeternity/aepp-sdk/es/channel/index--Channel..leave)`Promise.&lt;Object&gt;`
@@ -105,6 +107,18 @@ Possible events:
105107
| event | `String` | Event name |
106108
| callback | `function` | Callback function |
107109

110+
<a id="module_@aeternity/aepp-sdk/es/channel/index--Channel..off"></a>
111+
112+
#### Channel~off(event, callback)
113+
Remove event listener function
114+
115+
**Kind**: inner method of [`Channel`](#exp_module_@aeternity/aepp-sdk/es/channel/index--Channel)
116+
117+
| Param | Type | Description |
118+
| --- | --- | --- |
119+
| event | `String` | Event name |
120+
| callback | `function` | Callback function |
121+
108122
<a id="module_@aeternity/aepp-sdk/es/channel/index--Channel..disconnect"></a>
109123

110124
#### Channel~disconnect()
@@ -122,6 +136,15 @@ Get current status
122136
#### Channel~state() ⇒ `Promise.&lt;Object&gt;`
123137
Get current state
124138

139+
**Kind**: inner method of [`Channel`](#exp_module_@aeternity/aepp-sdk/es/channel/index--Channel)
140+
<a id="module_@aeternity/aepp-sdk/es/channel/index--Channel..round"></a>
141+
142+
#### Channel~round() ⇒ `Number`
143+
Get current round
144+
145+
If round cannot be determined (for example when channel has not been opened)
146+
it will return `null`.
147+
125148
**Kind**: inner method of [`Channel`](#exp_module_@aeternity/aepp-sdk/es/channel/index--Channel)
126149
<a id="module_@aeternity/aepp-sdk/es/channel/index--Channel..id"></a>
127150

@@ -131,7 +154,7 @@ Get channel id
131154
**Kind**: inner method of [`Channel`](#exp_module_@aeternity/aepp-sdk/es/channel/index--Channel)
132155
<a id="module_@aeternity/aepp-sdk/es/channel/index--Channel..update"></a>
133156

134-
#### Channel~update(from, to, amount, sign) ⇒ `Promise.&lt;Object&gt;`
157+
#### Channel~update(from, to, amount, sign, metadata) ⇒ `Promise.&lt;Object&gt;`
135158
Trigger a transfer update
136159

137160
The transfer update is moving tokens from one channel account to another.
@@ -148,6 +171,7 @@ can take those roles. Any public key outside of the channel is considered invali
148171
| to | `String` | Receiver's public address |
149172
| amount | `Number` | Transaction amount |
150173
| sign | `function` | Function which verifies and signs offchain transaction |
174+
| metadata | `Array.&lt;String&gt;` | |
151175

152176
**Example**
153177
```js

docs/api/contract/aci.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,10 @@ Generate contract ACI object with predefined js methods for contract usage - can
6868
| --- | --- | --- | --- |
6969
| source | `String` | | Contract source code |
7070
| [options] | `Object` | <code>{}</code> | Options object |
71-
| [options.aci] | `Object` | | Contract ACI |
72-
| [options.contractAddress] | `Object` | | Contract address |
71+
| [options.aci] | `String` | | Contract ACI |
72+
| [options.contractAddress] | `String` | | Contract address |
7373
| [options.filesystem] | `Object` | | Contact source external namespaces map |
74+
| [options.forceCodeCheck] | `Boolean` | <code>false</code> | Flag to force validation of corresponding on chain bytecode |
7475
| [options.opt] | `Object` | | Contract options |
7576

7677
**Example**

docs/api/utils/crypto.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ import * as Crypto from '@aeternity/aepp-sdk/es/utils/crypto'
4646
* [.isValidKeypair(privateKey, publicKey)](#module_@aeternity/aepp-sdk/es/utils/crypto.isValidKeypair)`Boolean`
4747
* [.envKeypair(env)](#module_@aeternity/aepp-sdk/es/utils/crypto.envKeypair)`Object`
4848
* [.deserialize(binary, opts)](#module_@aeternity/aepp-sdk/es/utils/crypto.deserialize)`Object`
49+
* [.encryptData(msg, publicKey)](#module_@aeternity/aepp-sdk/es/utils/crypto.encryptData)`Object`
50+
* [.decryptData(secretKey, encryptedData)](#module_@aeternity/aepp-sdk/es/utils/crypto.decryptData)`Buffer` \| `null`
4951
* _inner_
5052
* [~Transaction](#module_@aeternity/aepp-sdk/es/utils/crypto..Transaction) : `Array`
5153

@@ -213,7 +215,7 @@ Base58 encode given `input`
213215

214216
| Param | Type | Description |
215217
| --- | --- | --- |
216-
| input | `String` | Data to encode |
218+
| input | `String` \| `Buffer` | Data to encode |
217219

218220
<a id="module_@aeternity/aepp-sdk/es/utils/crypto.decodeBase58Check"></a>
219221

@@ -534,6 +536,34 @@ Deserialize `binary` state channel transaction
534536
| binary | `String` | Data to deserialize |
535537
| opts | `Object` | Options |
536538

539+
<a id="module_@aeternity/aepp-sdk/es/utils/crypto.encryptData"></a>
540+
541+
### @aeternity/aepp-sdk/es/utils/crypto.encryptData(msg, publicKey) ⇒ `Object`
542+
This function encrypts a message using base58check encoded and 'ak' prefixed
543+
publicKey such that only the corresponding secretKey will
544+
be able to decrypt
545+
546+
**Kind**: static method of [`@aeternity/aepp-sdk/es/utils/crypto`](#module_@aeternity/aepp-sdk/es/utils/crypto)
547+
**rtype**: `(msg: String, publicKey: String) => Object`
548+
549+
| Param | Type | Description |
550+
| --- | --- | --- |
551+
| msg | `Buffer` | Data to encode |
552+
| publicKey | `String` | Public key |
553+
554+
<a id="module_@aeternity/aepp-sdk/es/utils/crypto.decryptData"></a>
555+
556+
### @aeternity/aepp-sdk/es/utils/crypto.decryptData(secretKey, encryptedData) ⇒ `Buffer` \| `null`
557+
This function decrypt a message using secret key
558+
559+
**Kind**: static method of [`@aeternity/aepp-sdk/es/utils/crypto`](#module_@aeternity/aepp-sdk/es/utils/crypto)
560+
**rtype**: `(secretKey: String, encryptedData: Object) => Buffer|null`
561+
562+
| Param | Type | Description |
563+
| --- | --- | --- |
564+
| secretKey | `String` | Secret key |
565+
| encryptedData | `Object` | Encrypted data |
566+
537567
<a id="module_@aeternity/aepp-sdk/es/utils/crypto..Transaction"></a>
538568

539569
### @aeternity/aepp-sdk/es/utils/crypto~Transaction : `Array`

docs/examples/node/aecrypto.md

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -178,22 +178,7 @@ transaction and turn it into an RLP-encoded tuple ready for mining
178178

179179
```js
180180
function signTx (tx, privKey) {
181-
182-
```
183-
184-
185-
186-
187-
188-
189-
190-
eslint-disable-next-line no-useless-escape
191-
192-
193-
194-
195-
```js
196-
if (!tx.match(/^tx\_.+/)) {
181+
if (!tx.match(/^tx_.+/)) {
197182
throw Error('Not a valid transaction')
198183
}
199184

es/ae/aens.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ async function query (name, opt = {}) {
114114
const nameId = o.id
115115

116116
return Object.freeze(Object.assign(o, {
117-
pointers: o.pointers || {},
117+
pointers: o.pointers || [],
118118
update: async (target, options) => {
119119
return {
120120
...(await this.aensUpdate(nameId, target, R.merge(opt, options))),

0 commit comments

Comments
 (0)