Skip to content

Commit 8cf3b9f

Browse files
authored
Merge pull request #2003 from aeternity/release/13.3.3
Release v13.3.3
2 parents a6f7b75 + c8fe148 commit 8cf3b9f

File tree

17 files changed

+119
-64
lines changed

17 files changed

+119
-64
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ jobs:
3030
BASE: ${{ github.event.pull_request.base.sha }}
3131
run: npx commitlint --from $BASE --to $HEAD --verbose
3232
- run: npm run lint
33+
- run: npm run docs:examples && npm run docs:api && ./docs/build-assets.sh
34+
if: contains(github.event.pull_request.title, 'Release')
3335
- run: docker compose up -d --wait
3436
- run: npx nyc npm test
3537
- run: npx nyc report --reporter=text-lcov > coverage.lcov

.mocharc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module.exports = {
22
require: 'tooling/babel-register.js',
33
recursive: true,
44
extension: '.js,.ts',
5-
timeout: process.env.NETWORK ? '500s' : '40s',
5+
timeout: process.env.NETWORK ? '500s' : '8s',
66
ignore: 'test/environment/**',
77
exit: true // TODO: fix in state channel tests
88
}

docs/CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,21 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5+
### [13.3.3](https://github.com/aeternity/aepp-sdk-js/compare/v13.3.2...v13.3.3) (2024-07-17)
6+
7+
8+
### Bug Fixes
9+
10+
* **account:** improve Account:publicKey type ([0524553](https://github.com/aeternity/aepp-sdk-js/commit/0524553267162be30476b2ccebdd3f2633e9bb73))
11+
* **aens:** validate minus chars in name as node does ([15063c6](https://github.com/aeternity/aepp-sdk-js/commit/15063c68bbd4f6918648d9f23c069861d39dad98))
12+
* **aepp:** don't require subscription to request addresses ([8ce976e](https://github.com/aeternity/aepp-sdk-js/commit/8ce976e470fe67487079534671d854ccd7f0d080))
13+
* **channel:** `channelId` type, more accurate types ([2b064d8](https://github.com/aeternity/aepp-sdk-js/commit/2b064d8a2969f93c33c345e1822aaea5678e5e09))
14+
* **channel:** accept `host` only if initiator ([cfdfd72](https://github.com/aeternity/aepp-sdk-js/commit/cfdfd725f3753b06d3b458d971c980ac9b0f3596))
15+
* **channel:** remove `statePassword` unsupported on node side ([74db9bb](https://github.com/aeternity/aepp-sdk-js/commit/74db9bb68df997a10c1f7e4319616bb9b2a5612d))
16+
* don't allow upgrades `@azure/core-rest-pipeline` ([03058d4](https://github.com/aeternity/aepp-sdk-js/commit/03058d4a26d2573aa5dd33915c86eb6140de42ff))
17+
* don't allow upgrades `@ledgerhq/hw-transport` to 6.31.0 ([1ef43e6](https://github.com/aeternity/aepp-sdk-js/commit/1ef43e63fd2a75b891d3b13de03db67b6e5fac0d))
18+
* **wallet:** origin if opened over file:// (cordova) ([4ee44be](https://github.com/aeternity/aepp-sdk-js/commit/4ee44bef2fab01a97771ed46e40f9fee3b343aad))
19+
520
### [13.3.2](https://github.com/aeternity/aepp-sdk-js/compare/v13.3.1...v13.3.2) (2024-04-22)
621

722

package-lock.json

Lines changed: 17 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@aeternity/aepp-sdk",
3-
"version": "13.3.2",
3+
"version": "13.3.3",
44
"description": "SDK for the æternity blockchain",
55
"main": "dist/aepp-sdk.js",
66
"types": "es/index.d.ts",
@@ -79,9 +79,10 @@
7979
"@aeternity/argon2": "^0.0.1",
8080
"@aeternity/uuid": "^0.0.1",
8181
"@azure/core-client": "^1.8.0",
82-
"@azure/core-rest-pipeline": "^1.14.0",
82+
"@azure/core-rest-pipeline": "~1.14.0",
83+
"@azure/logger": "~1.0.4",
8384
"@babel/runtime-corejs3": "^7.24.0",
84-
"@ledgerhq/hw-transport": "^6.30.4",
85+
"@ledgerhq/hw-transport": "~6.30.6",
8586
"@types/aes-js": "^3.1.4",
8687
"@types/json-bigint": "^1.0.4",
8788
"@types/node": "~18.13",

src/AeSdkAepp.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export default class AeSdkAepp extends AeSdkBase {
146146
* @returns Addresses from wallet
147147
*/
148148
async askAddresses(): Promise<Encoded.AccountAddress[]> {
149-
this._ensureAccountAccess();
149+
this._ensureConnected();
150150
return this.rpcClient.request(METHODS.address, undefined);
151151
}
152152

src/AeSdkWallet.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,11 +358,12 @@ export default class AeSdkWallet extends AeSdk {
358358
* @returns Object with wallet information
359359
*/
360360
async getWalletInfo(): Promise<WalletInfo> {
361+
const { origin } = window.location;
361362
return {
362363
id: this.id,
363364
name: this.name,
364365
networkId: await this.api.getNetworkId(),
365-
origin: window.location.origin,
366+
origin: origin === 'file://' ? '*' : origin,
366367
type: this._type,
367368
};
368369
}

src/channel/Base.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ export default class Channel {
257257
* })
258258
* ```
259259
*/
260-
async leave(): Promise<{ channelId: Encoded.Bytearray; signedTx: Encoded.Transaction }> {
260+
async leave(): Promise<{ channelId: Encoded.Channel; signedTx: Encoded.Transaction }> {
261261
return this.enqueueAction(() => {
262262
notify(this, 'channels.leave');
263263
return { handler: handlers.awaitingLeave };

src/channel/internal.ts

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export type SignTx = (tx: Encoded.Transaction, options?: SignOptions) => (
5252
/**
5353
* @see {@link https://github.com/aeternity/protocol/blob/6734de2e4c7cce7e5e626caa8305fb535785131d/node/api/channels_api_usage.md#channel-establishing-parameters}
5454
*/
55-
export interface ChannelOptions {
55+
interface CommonChannelOptions {
5656
existingFsmId?: Encoded.Bytearray;
5757
/**
5858
* Channel url (for example: "ws://localhost:3001")
@@ -74,7 +74,7 @@ export interface ChannelOptions {
7474
/**
7575
* Initial deposit in favour of the responder by the initiator
7676
*/
77-
pushAmount: number;
77+
pushAmount: BigNumber | number;
7878
/**
7979
* Amount of coins the initiator has committed to the channel
8080
*/
@@ -92,17 +92,9 @@ export interface ChannelOptions {
9292
*/
9393
ttl?: number;
9494
/**
95-
* Host of the responder's node
96-
*/
97-
host: string;
98-
/**
99-
* The port of the responders node
95+
* The port of the responder's node
10096
*/
10197
port: number;
102-
/**
103-
* Participant role
104-
*/
105-
role: 'initiator' | 'responder';
10698
/**
10799
* How to calculate minimum depth (default: txfee)
108100
*/
@@ -120,16 +112,16 @@ export interface ChannelOptions {
120112
*/
121113
gasPrice?: BigNumber | number;
122114

123-
signedTx?: string;
115+
signedTx?: Encoded.Transaction;
124116
/**
125117
* Existing channel id (required if reestablishing a channel)
126118
*/
127-
existingChannelId?: string;
119+
existingChannelId?: Encoded.Channel;
128120
/**
129121
* Offchain transaction (required if reestablishing a channel)
130122
*/
131-
offChainTx?: string;
132-
reconnectTx?: string;
123+
offChainTx?: Encoded.Transaction;
124+
reconnectTx?: Encoded.Transaction;
133125
/**
134126
* The time waiting for a new event to be initiated (default: 600000)
135127
*/
@@ -174,7 +166,6 @@ export interface ChannelOptions {
174166
* Applicable only for responder (default: timeout_idle's value)
175167
*/
176168
timeoutAwaitingOpen?: number;
177-
statePassword?: string;
178169
/**
179170
* Log websocket communication and state changes
180171
*/
@@ -183,9 +174,25 @@ export interface ChannelOptions {
183174
* Function which verifies and signs transactions
184175
*/
185176
sign: SignTxWithTag;
186-
offchainTx?: string;
177+
offchainTx?: Encoded.Transaction;
187178
}
188179

180+
export type ChannelOptions = CommonChannelOptions & ({
181+
/**
182+
* Participant role
183+
*/
184+
role: 'initiator';
185+
/**
186+
* Host of the responder's node
187+
*/
188+
host: string;
189+
} | {
190+
/**
191+
* Participant role
192+
*/
193+
role: 'responder';
194+
});
195+
189196
export interface ChannelHandler extends Function {
190197
enter?: Function;
191198
}

src/tx/builder/helpers.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,15 @@ export function nameToPunycode(maybeName: string): AensName {
7070
if (/\p{Emoji_Presentation}/u.test(name)) {
7171
throw new ArgumentError('aens name', 'not containing emoji', maybeName);
7272
}
73+
if (name[2] === '-' && name[3] === '-') {
74+
throw new ArgumentError('aens name', 'without "-" char in both the third and fourth positions', maybeName);
75+
}
76+
if (name[0] === '-') {
77+
throw new ArgumentError('aens name', 'starting with no "-" char', maybeName);
78+
}
79+
if (name.at(-1) === '-') {
80+
throw new ArgumentError('aens name', 'ending with no "-" char', maybeName);
81+
}
7382
let punycode;
7483
try {
7584
const u = new URL(`http://${name}.${suffix}`);

0 commit comments

Comments
 (0)