Skip to content

Commit 26014b7

Browse files
authored
Merge pull request #1800 from aeternity/release/13.0.1
Release 13.0.1
2 parents 79a2c5a + 4a554a2 commit 26014b7

32 files changed

+97
-95
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
sudo apt install --allow-downgrades ./esl-erlang_25.0.4-1~ubuntu~jammy_amd64.deb
1010
- uses: actions/checkout@v2
1111
with:
12-
fetch-depth: 0
12+
fetch-depth: 100
1313
- uses: actions/setup-node@v2
1414
with:
1515
node-version: 18.x
@@ -21,16 +21,11 @@ jobs:
2121
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
2222
- run: npm ci
2323
- name: Run Commitlint
24+
if: github.event_name == 'pull_request'
2425
env:
25-
EVENT_TYPE: ${{ github.event_name }}
2626
HEAD: ${{ github.event.pull_request.head.sha }}
2727
BASE: ${{ github.event.pull_request.base.sha }}
28-
run: |
29-
if [ "$EVENT_TYPE" = "push" ]; then
30-
npx commitlint --from HEAD~${{ github.event.push.commits }} --to HEAD --verbose
31-
else
32-
npx commitlint --from $BASE --to $HEAD --verbose
33-
fi
28+
run: npx commitlint --from $BASE --to $HEAD --verbose
3429
- run: npm run lint
3530
- run: docker-compose up -d
3631
- name: Ensure that node is running

docs/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
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.0.1](https://github.com/aeternity/aepp-sdk-js/compare/v13.0.0...v13.0.1) (2023-04-24)
6+
7+
8+
### Bug Fixes
9+
10+
* **contract:** return type of call/deploy on chain ([c493707](https://github.com/aeternity/aepp-sdk-js/commit/c49370756fa3ed3a6f37bad2cefcbbd858ff94ee))
11+
* export of `prefixedAmount` helper ([9b3f68f](https://github.com/aeternity/aepp-sdk-js/commit/9b3f68f99b3943c42c4639c3a247ee9881229d18))
12+
513
## [13.0.0](https://github.com/aeternity/aepp-sdk-js/compare/v13.0.0-beta.0...v13.0.0) (2023-04-06)
614

715

docs/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ This may be done in `tsconfig.json`:
8282
```
8383
SDK uses modern features available since [email protected]. Though SDK is still compatible with [email protected] and above using types generated separately, but these types are less accurate.
8484

85+
Ensure that you have `strictFunctionTypes` option not enabled (as it is in VS code and `ts-node` by default), otherwise some of SDK types won't work correctly (see [#1793](https://github.com/aeternity/aepp-sdk-js/issues/1793)).
86+
8587
### Vue CLI@4
8688
SDK checks are not working correctly because CLI picks both ESM and CJS versions of `autorest`
8789
dependencies. To fix this, you need to specify aliases in `vue.config.js`.

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@aeternity/aepp-sdk",
3-
"version": "13.0.0",
3+
"version": "13.0.1",
44
"description": "SDK for the æternity blockchain",
55
"main": "dist/aepp-sdk.js",
66
"types": "es/index.d.ts",

src/contract/Contract.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ type TxData = Awaited<ReturnType<typeof sendTransaction>>;
7272
interface SendAndProcessReturnType {
7373
result?: ContractCallObject;
7474
hash: TxData['hash'];
75-
tx: TxUnpacked & { tag: Tag.ContractCallTx | Tag.ContractCreateTx };
75+
tx: TxUnpacked & { tag: Tag.SignedTx | Tag.ContractCallTx | Tag.ContractCreateTx };
7676
txData: TxData;
7777
rawTx: Encoded.Transaction;
7878
}

src/tx/execution-cost.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,23 @@ import getTransactionSignerAddress from './transaction-signer';
1111
* Calculates the cost of transaction execution
1212
* Provides an upper cost of contract-call-related transactions because of `gasLimit`.
1313
* Also assumes that oracle query fee is 0 unless it is provided in options.
14+
*
15+
* The idea is that if you need to show transaction details with some accuracy you can define
16+
* expense fields that you want to show separately. And to show `getExecutionCost` result as a fee,
17+
* subtracting all fields shown separately.
18+
*
19+
* @example
20+
* ```vue
21+
* <template>
22+
* Amount: {{ txUnpacked.amount }}
23+
* Name fee: {{ txUnpacked.nameFee }}
24+
* Other fees: {{ getExecutionCost(txEncoded) - txUnpacked.amount - txUnpacked.nameFee }}
25+
* </template>
26+
* ```
27+
*
28+
* Doing this way you won't worry to show wrong fee for a transaction you may not support. Because
29+
* the SDK calculates the overall price of any transaction on its side.
30+
*
1431
* @param transaction - Transaction to calculate the cost of
1532
* @param innerTx - Should be provided if transaction wrapped with Tag.PayingForTx
1633
* @param gasUsed - Amount of gas actually used to make calculation more accurate

src/typings/@aeternity__aepp-calldata/index.d.ts

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/utils/amount-formatter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ const getNearestPrefix = (exponent: number): Prefix => prefixes.reduce((p, n) =>
8585
const getLowerBoundPrefix = (exponent: number): Prefix => prefixes
8686
.find((p) => p.magnitude <= exponent) ?? prefixes[prefixes.length - 1];
8787

88-
export default (rawValue: string | number | BigNumber): string => {
88+
export const prefixedAmount = (rawValue: string | number | BigNumber): string => {
8989
const value: BigNumber = new BigNumber(rawValue);
9090

9191
const exp = value.e ?? 0;

test/environment/node.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ const aeSdk = new AeSdk({
2020
console.log('Height:', await aeSdk.getHeight());
2121
console.log('Instanceof works correctly for nodes pool', aeSdk.pool instanceof Map);
2222

23-
const contract = await aeSdk.initializeContract({ sourceCode: contractSourceCode });
23+
const contract = await aeSdk.initializeContract<{
24+
getArg: (x: Map<string, number | bigint | string>) => Map<string, bigint>;
25+
}>({ sourceCode: contractSourceCode });
2426
const deployInfo = await contract.$deploy([]);
2527
console.log('Contract deployed at', deployInfo.address);
2628
const map = new Map([['foo', 42], ['bar', 43]]);

0 commit comments

Comments
 (0)