From bcaa5cfe0f8a23a641d9db993b312e2d54cfdd60 Mon Sep 17 00:00:00 2001 From: Denis Davidyuk Date: Mon, 7 Aug 2023 19:33:08 +0400 Subject: [PATCH 01/28] feat: use proper vm version in Ceres --- docker/aeternity_node_mean16.yaml | 2 +- src/tx/builder/constants.ts | 1 + src/tx/builder/field-types/ct-version.ts | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docker/aeternity_node_mean16.yaml b/docker/aeternity_node_mean16.yaml index 49cb447836..c6704d1c5b 100644 --- a/docker/aeternity_node_mean16.yaml +++ b/docker/aeternity_node_mean16.yaml @@ -20,7 +20,7 @@ chain: persist: false hard_forks: "1": 0 - "6": 1 + "5": 1 mining: autostart: true diff --git a/src/tx/builder/constants.ts b/src/tx/builder/constants.ts index 377d313f91..af0a72765c 100644 --- a/src/tx/builder/constants.ts +++ b/src/tx/builder/constants.ts @@ -74,6 +74,7 @@ export enum VmVersion { Fate = 5, SophiaImprovementsLima = 6, Fate2 = 7, + Fate3 = 8, } /** diff --git a/src/tx/builder/field-types/ct-version.ts b/src/tx/builder/field-types/ct-version.ts index dd3963f2c3..c466445038 100644 --- a/src/tx/builder/field-types/ct-version.ts +++ b/src/tx/builder/field-types/ct-version.ts @@ -19,7 +19,7 @@ export const ProtocolToVmAbi = { }, [ConsensusProtocolVersion.Ceres]: { 'contract-create': { - vmVersion: [VmVersion.Fate2], abiVersion: [AbiVersion.Fate], + vmVersion: [VmVersion.Fate3], abiVersion: [AbiVersion.Fate], }, 'contract-call': { vmVersion: [], abiVersion: [AbiVersion.Fate], From 3f130555f3287b17f20d1830dc108bbc8690365a Mon Sep 17 00:00:00 2001 From: Denis Davidyuk Date: Mon, 7 Aug 2023 19:34:08 +0400 Subject: [PATCH 02/28] chore(deps): update node to 6.11.0 --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 3bbbc2739f..8ded0b6374 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ version: '3' services: node: - image: aeternity/aeternity:v6.8.1 + image: aeternity/aeternity:v6.11.0 hostname: node ports: ["3013:3013", "3113:3113", "3014:3014", "3114:3114"] volumes: From eeba56576b97afda6739fa8cd0f9e5c6f039651f Mon Sep 17 00:00:00 2001 From: Denis Davidyuk Date: Thu, 17 Aug 2023 00:51:32 +0400 Subject: [PATCH 03/28] fix(aepp): use complete type of WalletInfo object --- src/aepp-wallet-communication/rpc/types.ts | 2 +- src/aepp-wallet-communication/wallet-detector.ts | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/aepp-wallet-communication/rpc/types.ts b/src/aepp-wallet-communication/rpc/types.ts index 65dfb9efb0..1aa257e703 100644 --- a/src/aepp-wallet-communication/rpc/types.ts +++ b/src/aepp-wallet-communication/rpc/types.ts @@ -9,7 +9,7 @@ export interface WalletInfo { id: string; name: string; networkId: string; - origin: string; + origin: string; // TODO: origin needs to be provided by transport type: WALLET_TYPE; } diff --git a/src/aepp-wallet-communication/wallet-detector.ts b/src/aepp-wallet-communication/wallet-detector.ts index eb557afbbc..41a6a78d7e 100644 --- a/src/aepp-wallet-communication/wallet-detector.ts +++ b/src/aepp-wallet-communication/wallet-detector.ts @@ -1,14 +1,11 @@ import BrowserConnection from './connection/Browser'; import BrowserWindowMessageConnection from './connection/BrowserWindowMessage'; import { MESSAGE_DIRECTION, METHODS } from './schema'; +import { WalletInfo } from './rpc/types'; import { UnsupportedPlatformError } from '../utils/errors'; interface Wallet { - info: { - id: string; - type: string; - origin: string; - }; + info: WalletInfo; getConnection: () => BrowserWindowMessageConnection; } interface Wallets { [key: string]: Wallet } @@ -28,7 +25,7 @@ export default ( const wallets: Wallets = {}; connection.connect(( - { method, params }: { method: string; params: Wallet['info'] }, + { method, params }: { method: string; params: WalletInfo }, origin: string, source: Window, ) => { From 5c846712a32a110e1a5df25d5c4366046d9558f5 Mon Sep 17 00:00:00 2001 From: Denis Davidyuk Date: Wed, 23 Aug 2023 21:37:23 +0400 Subject: [PATCH 04/28] fix: typos in error messages and docs --- docs/CHANGELOG.md | 2 +- src/contract/Contract.ts | 2 +- src/tx/builder/field-types/fee.ts | 2 +- src/tx/builder/field-types/gas-price.ts | 2 +- src/utils/crypto.ts | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 9490c0a772..ce20212423 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -48,7 +48,7 @@ All notable changes to this project will be documented in this file. See [standa * **contract:** use fallback account if `onAccount` not provided ([9033cd7](https://github.com/aeternity/aepp-sdk-js/commit/9033cd799be5974ebf28a49df181eeb63b1fce84)) * converting proxied options to JSON ([efebbd1](https://github.com/aeternity/aepp-sdk-js/commit/efebbd139ea85c35e28bdcfe907670743f9fc1f4)) * provide types in exports field of package.json ([dbd19e7](https://github.com/aeternity/aepp-sdk-js/commit/dbd19e70bca2d6dbc5b2392db478bb98936b63f2)) -* reject prefixes other then provided in isAddressValid ([9462add](https://github.com/aeternity/aepp-sdk-js/commit/9462adde8fab9848fca0a6d9a382dbd34f5e2b8f)) +* reject prefixes other than provided in isAddressValid ([9462add](https://github.com/aeternity/aepp-sdk-js/commit/9462adde8fab9848fca0a6d9a382dbd34f5e2b8f)) * **tx-builder:** `buildTx` produces the same type as `unpackTx` accepts ([d3d6c88](https://github.com/aeternity/aepp-sdk-js/commit/d3d6c88607abbfb74acf016fba886540938b216d)) * **tx-builder:** decode tag in entry error message ([db0d96f](https://github.com/aeternity/aepp-sdk-js/commit/db0d96f156f3e8cfe52c6a7d7411c359f6dae35c)) * **wallet:** emit internal error if something broke while broadcast ([332d1b5](https://github.com/aeternity/aepp-sdk-js/commit/332d1b567f69bf6b7d3567af43fb805556ac015b)) diff --git a/src/contract/Contract.ts b/src/contract/Contract.ts index 373a165090..4519bf2bc3 100644 --- a/src/contract/Contract.ts +++ b/src/contract/Contract.ts @@ -122,7 +122,7 @@ interface GetCallResultByHashReturnType { diff --git a/src/tx/builder/field-types/fee.ts b/src/tx/builder/field-types/fee.ts index 39f73906f9..623c62aef4 100644 --- a/src/tx/builder/field-types/fee.ts +++ b/src/tx/builder/field-types/fee.ts @@ -156,7 +156,7 @@ export default { const value = new BigNumber(_value ?? minFee); if (minFee.gt(value)) { if (_pickBiggerFee === true) return minFee.toFixed(); - throw new IllegalArgumentError(`Fee ${value.toString()} must be bigger then ${minFee}`); + throw new IllegalArgumentError(`Fee ${value.toString()} must be bigger than ${minFee}`); } return value.toFixed(); }, diff --git a/src/tx/builder/field-types/gas-price.ts b/src/tx/builder/field-types/gas-price.ts index 7637e3486d..1152f7461e 100644 --- a/src/tx/builder/field-types/gas-price.ts +++ b/src/tx/builder/field-types/gas-price.ts @@ -7,7 +7,7 @@ export default { serializeAettos(value: string | undefined = MIN_GAS_PRICE.toString()): string { if (+value < MIN_GAS_PRICE) { - throw new IllegalArgumentError(`Gas price ${value.toString()} must be bigger then ${MIN_GAS_PRICE}`); + throw new IllegalArgumentError(`Gas price ${value.toString()} must be bigger than ${MIN_GAS_PRICE}`); } return value; }, diff --git a/src/utils/crypto.ts b/src/utils/crypto.ts index 29af2f3653..4d03cbdc35 100644 --- a/src/utils/crypto.ts +++ b/src/utils/crypto.ts @@ -190,7 +190,7 @@ export function verifyMessage( /** * Check key pair for validity * - * Sign a message, and then verifying that signature + * Signs a message, and then verifies that signature * @param privateKey - Private key to verify * @param publicKey - Public key to verify as hex string * @returns Valid? From c7a0157317f556528a581311b4d943983e3c0c62 Mon Sep 17 00:00:00 2001 From: Denis Davidyuk Date: Sun, 27 Aug 2023 12:57:44 +0400 Subject: [PATCH 05/28] docs(aepp,wallet): update example aepps deps --- examples/browser/aepp/package.json | 14 +++++++------- examples/browser/wallet-iframe/package.json | 12 ++++++------ examples/browser/wallet-web-extension/package.json | 6 +++--- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/examples/browser/aepp/package.json b/examples/browser/aepp/package.json index 13f5bd8856..4b3ac198ec 100644 --- a/examples/browser/aepp/package.json +++ b/examples/browser/aepp/package.json @@ -9,16 +9,16 @@ "dependencies": { "@aeternity/aepp-sdk": "file:../../..", "buffer": "^6.0.3", - "core-js": "^3.22.6", + "core-js": "^3.32.1", "tailwindcss": "^2.2.19", - "vue": "^3.2.36", - "vuex": "^4.0.2" + "vue": "^3.3.4", + "vuex": "^4.1.0" }, "devDependencies": { - "@vue/cli-plugin-babel": "~5.0.4", - "@vue/cli-service": "~5.0.4", - "sass": "^1.52.1", - "sass-loader": "^13.0.0" + "@vue/cli-plugin-babel": "~5.0.8", + "@vue/cli-service": "~5.0.8", + "sass": "^1.66.1", + "sass-loader": "^13.3.2" }, "browserslist": [ "> 1%", diff --git a/examples/browser/wallet-iframe/package.json b/examples/browser/wallet-iframe/package.json index 46aecc37fc..811c825c1d 100644 --- a/examples/browser/wallet-iframe/package.json +++ b/examples/browser/wallet-iframe/package.json @@ -9,15 +9,15 @@ "dependencies": { "@aeternity/aepp-sdk": "file:../../..", "buffer": "^6.0.3", - "core-js": "^3.22.6", + "core-js": "^3.32.1", "tailwindcss": "^2.2.19", - "vue": "^3.2.36" + "vue": "^3.3.4" }, "devDependencies": { - "@vue/cli-plugin-babel": "~5.0.4", - "@vue/cli-service": "~5.0.4", - "sass": "^1.52.1", - "sass-loader": "^13.0.0" + "@vue/cli-plugin-babel": "~5.0.8", + "@vue/cli-service": "~5.0.8", + "sass": "^1.66.1", + "sass-loader": "^13.3.2" }, "browserslist": [ "> 1%", diff --git a/examples/browser/wallet-web-extension/package.json b/examples/browser/wallet-web-extension/package.json index 695051cd47..7a8b549544 100644 --- a/examples/browser/wallet-web-extension/package.json +++ b/examples/browser/wallet-web-extension/package.json @@ -8,7 +8,7 @@ }, "dependencies": { "@aeternity/aepp-sdk": "file:../../..", - "core-js": "^3.22.6", + "core-js": "^3.32.1", "tailwindcss": "^2.2.19", "vue": "^2.6.14", "webextension-polyfill": "^0.9.0" @@ -16,10 +16,10 @@ "devDependencies": { "@vue/cli-plugin-babel": "^4.5.17", "@vue/cli-service": "^4.5.17", - "sass": "^1.52.1", + "sass": "^1.66.1", "sass-loader": "^8.0.2", "vue-cli-plugin-browser-extension": "^0.25.2", - "vue-template-compiler": "^2.6.14" + "vue-template-compiler": "^2.7.14" }, "browserslist": [ "> 1%", From 3847d7e67bccb4331bd7cd7327fd4ab3a2dc89fd Mon Sep 17 00:00:00 2001 From: Denis Davidyuk Date: Sun, 27 Aug 2023 13:05:22 +0400 Subject: [PATCH 06/28] docs(aepp): don't expose promises to avoid unhandled rejection --- examples/browser/aepp/src/Contracts.vue | 8 ++++---- examples/browser/aepp/src/DelegationSignature.vue | 2 +- examples/browser/aepp/src/PayForTx.vue | 4 ++-- examples/browser/aepp/src/TypedData.vue | 4 ++-- examples/browser/aepp/src/components/GenerateSpendTx.vue | 2 +- examples/browser/aepp/src/components/MessageSign.vue | 2 +- examples/browser/aepp/src/components/SpendCoins.vue | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/examples/browser/aepp/src/Contracts.vue b/examples/browser/aepp/src/Contracts.vue index 27823160b2..0fa47fa9ba 100644 --- a/examples/browser/aepp/src/Contracts.vue +++ b/examples/browser/aepp/src/Contracts.vue @@ -10,7 +10,7 @@ /> -
@@ -22,7 +22,7 @@ @@ -81,6 +57,7 @@ import { shallowRef } from 'vue'; import { mapState } from 'vuex'; import Value from './components/Value.vue'; +import FieldAction from './components/FieldAction.vue'; const contractSourceCode = ` contract Multiplier = @@ -90,16 +67,12 @@ contract Multiplier = `.trim(); export default { - components: { Value }, + components: { Value, FieldAction }, data: () => ({ contractSourceCode, - deployArg: 5, - callArg: 7, createPromise: null, contract: null, - compilePromise: null, deployPromise: null, - callPromise: null, }), computed: mapState(['aeSdk']), methods: { @@ -112,11 +85,12 @@ export default { async compile() { return this.contract.$compile(); }, - async deploy() { - return this.contract.$deploy([this.deployArg]); + async deploy(arg) { + this.deployPromise = this.contract.$deploy([arg]); + return this.deployPromise; }, - async call() { - return this.contract.calc(this.callArg); + async call(arg) { + return this.contract.calc(arg); }, }, }; diff --git a/examples/browser/aepp/src/PayForTx.vue b/examples/browser/aepp/src/PayForTx.vue index 69517867e6..d5504f89ca 100644 --- a/examples/browser/aepp/src/PayForTx.vue +++ b/examples/browser/aepp/src/PayForTx.vue @@ -1,71 +1,43 @@ diff --git a/examples/browser/aepp/src/components/MessageSign.vue b/examples/browser/aepp/src/components/MessageSign.vue index 0cfac327e7..2a035c5c34 100644 --- a/examples/browser/aepp/src/components/MessageSign.vue +++ b/examples/browser/aepp/src/components/MessageSign.vue @@ -1,39 +1,24 @@ diff --git a/examples/browser/wallet-iframe/src/styles.scss b/examples/browser/wallet-iframe/src/styles.scss index d95f07e939..240967783b 100644 --- a/examples/browser/wallet-iframe/src/styles.scss +++ b/examples/browser/wallet-iframe/src/styles.scss @@ -6,7 +6,7 @@ body { @extend .bg-gray-300; #app { - @extend .p-4, .flex, .flex-col, .w-full, .h-screen; + @extend .p-4, .flex, .flex-col, .w-full, .min-h-screen; iframe { @extend .flex-grow, .mt-4, .bg-white, .border, .border-black, .border-dashed; From da6a0257e995db38e32888390961eb870a482777 Mon Sep 17 00:00:00 2001 From: Denis Davidyuk Date: Sat, 16 Sep 2023 19:57:07 +0400 Subject: [PATCH 24/28] fix(aepp,wallet): connect to web-extension if opened over file:/// --- .../src/content-script.js | 2 +- .../wallet-web-extension/src/manifest.json | 3 +- .../wallet-detector.ts | 11 ++-- test/environment/browser-aepp.html | 64 +++++++++++++++++++ 4 files changed, 74 insertions(+), 6 deletions(-) create mode 100644 test/environment/browser-aepp.html diff --git a/examples/browser/wallet-web-extension/src/content-script.js b/examples/browser/wallet-web-extension/src/content-script.js index 058763e63d..a098db3ba8 100644 --- a/examples/browser/wallet-web-extension/src/content-script.js +++ b/examples/browser/wallet-web-extension/src/content-script.js @@ -19,7 +19,7 @@ import { const extConnection = new BrowserRuntimeConnection({ port }); const pageConnection = new BrowserWindowMessageConnection({ target: window, - origin: window.origin, + ...window.origin !== 'null' && { origin: window.origin }, sendDirection: MESSAGE_DIRECTION.to_aepp, receiveDirection: MESSAGE_DIRECTION.to_waellet, }); diff --git a/examples/browser/wallet-web-extension/src/manifest.json b/examples/browser/wallet-web-extension/src/manifest.json index 113f476f3e..52d77d634f 100644 --- a/examples/browser/wallet-web-extension/src/manifest.json +++ b/examples/browser/wallet-web-extension/src/manifest.json @@ -27,7 +27,8 @@ "content_scripts": [{ "matches": [ "https://*/*", - "http://*/*" + "http://*/*", + "file:///*" ], "js": [ "js/content-script.js" diff --git a/src/aepp-wallet-communication/wallet-detector.ts b/src/aepp-wallet-communication/wallet-detector.ts index 41a6a78d7e..e8e22407ca 100644 --- a/src/aepp-wallet-communication/wallet-detector.ts +++ b/src/aepp-wallet-communication/wallet-detector.ts @@ -34,12 +34,15 @@ export default ( const wallet = { info: params, getConnection() { - const isExtension = params.type === 'extension'; return new BrowserWindowMessageConnection({ - sendDirection: isExtension ? MESSAGE_DIRECTION.to_waellet : undefined, - receiveDirection: isExtension ? MESSAGE_DIRECTION.to_aepp : undefined, target: source, - origin: isExtension ? window.origin : params.origin, + ...params.type === 'extension' ? { + sendDirection: MESSAGE_DIRECTION.to_waellet, + receiveDirection: MESSAGE_DIRECTION.to_aepp, + ...window.origin !== 'null' && { origin: window.origin }, + } : { + origin: params.origin, + }, }); }, }; diff --git a/test/environment/browser-aepp.html b/test/environment/browser-aepp.html new file mode 100644 index 0000000000..7bfb6f86de --- /dev/null +++ b/test/environment/browser-aepp.html @@ -0,0 +1,64 @@ + + + + + SDK test in browser + + +Open developer console + + + + From 758bdfc75a1dd8e4ff0646ddeaa10e19b1a4d5d1 Mon Sep 17 00:00:00 2001 From: Denis Davidyuk Date: Sun, 17 Sep 2023 10:49:43 +0400 Subject: [PATCH 25/28] fix(contract): use current nonce in static calls --- src/contract/Contract.ts | 12 +++++++++--- test/integration/contract-aci.ts | 16 ++++++++++++++++ test/utils.ts | 2 +- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/src/contract/Contract.ts b/src/contract/Contract.ts index da503dbf9c..3449f7e629 100644 --- a/src/contract/Contract.ts +++ b/src/contract/Contract.ts @@ -44,6 +44,7 @@ import { } from '../chain'; import AccountBase from '../account/Base'; import { TxUnpacked } from '../tx/builder/schema.generated'; +import { isAccountNotFoundError } from '../utils/other'; type ContractAci = NonNullable; type FunctionAci = ContractAci['functions'][0]; @@ -332,10 +333,15 @@ class Contract { const callData = this._calldata.encode(this._name, fn, params); if (callStatic === true) { - if (opt.nonce == null && top != null) { - const topKey = typeof top === 'number' ? 'height' : 'hash'; - opt.nonce = (await getAccount(callerId, { [topKey]: top, onNode })).nonce + 1; + if (opt.nonce == null) { + const topOption = top != null && { [typeof top === 'number' ? 'height' : 'hash']: top }; + const account = await getAccount(callerId, { ...topOption, onNode }).catch((error) => { + if (!isAccountNotFoundError(error)) throw error; + return { kind: 'basic', nonce: 0 }; + }); + opt.nonce = account.kind === 'generalized' ? 0 : account.nonce + 1; } + const txOpt = { ...opt, onNode, callData }; let tx; if (fn === 'init') { diff --git a/test/integration/contract-aci.ts b/test/integration/contract-aci.ts index 75f1805da5..29c82e3d90 100644 --- a/test/integration/contract-aci.ts +++ b/test/integration/contract-aci.ts @@ -279,6 +279,22 @@ describe('Contract instance', () => { expect(decodedResult).to.be.equal('test'); }); + it('calls with correct nonce if transaction stuck in mempool', async () => { + const sdk = await getSdk(); + await sdk.transferFunds(1, aeSdk.address); + + await sdk.spend(1, sdk.address, { waitMined: false, verify: false }); + const [nonce, nextNonce] = await Promise.all([ + sdk.getAccount(sdk.address).then((res) => res.nonce), + sdk.api.getAccountNextNonce(sdk.address).then((res) => res.nextNonce), + ]); + expect(nonce + 2).to.be.equal(nextNonce); + + const contract = await sdk + .initializeContract({ aci: testContractAci, address: testContract.$options.address }); + await contract.intFn(2, { callStatic: true }); + }); + it('gets actual options from AeSdkBase', async () => { const [address1, address2] = aeSdk.addresses(); let { result } = await testContract.intFn(2); diff --git a/test/utils.ts b/test/utils.ts index 181e1387a1..9dcd9c3c28 100644 --- a/test/utils.ts +++ b/test/utils.ts @@ -13,7 +13,7 @@ export function randomString(len: number): string { } // eslint-disable-next-line import/prefer-default-export -export function randomName(length: number): AensName { +export function randomName(length: number = 15): AensName { return `${randomString(length)}.chain`; } From d741e7fe13bd18d36f5f2ce9b4e393b3b514757a Mon Sep 17 00:00:00 2001 From: Denis Davidyuk Date: Mon, 18 Sep 2023 10:01:24 +0400 Subject: [PATCH 26/28] style: remove unused eslint-disable --- src/deprecated.ts | 1 - test/utils.ts | 1 - 2 files changed, 2 deletions(-) diff --git a/src/deprecated.ts b/src/deprecated.ts index 5b5c0a7223..cde63cf1aa 100644 --- a/src/deprecated.ts +++ b/src/deprecated.ts @@ -4,7 +4,6 @@ import { RpcError } from './aepp-wallet-communication/schema'; * @category exception * @deprecated this exception is not thrown anymore */ -// eslint-disable-next-line import/prefer-default-export export class RpcBroadcastError extends RpcError { static override code = 3; diff --git a/test/utils.ts b/test/utils.ts index 9dcd9c3c28..5d2515d559 100644 --- a/test/utils.ts +++ b/test/utils.ts @@ -12,7 +12,6 @@ export function randomString(len: number): string { return string; } -// eslint-disable-next-line import/prefer-default-export export function randomName(length: number = 15): AensName { return `${randomString(length)}.chain`; } From c9eae169289aebade350400be47960c08094763d Mon Sep 17 00:00:00 2001 From: Denis Davidyuk Date: Wed, 20 Sep 2023 11:05:32 +0400 Subject: [PATCH 27/28] chore(release): 13.2.2 --- docs/CHANGELOG.md | 15 +++++++++++++++ docs/guides/address-length.md | 2 +- docs/guides/contracts.md | 12 ++++++------ docs/guides/paying-for-tx.md | 4 ++-- examples/node/transfer-ae.mjs | 2 +- package-lock.json | 2 +- package.json | 2 +- 7 files changed, 27 insertions(+), 12 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index ce20212423..cc70fdd5fb 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -2,6 +2,21 @@ 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. +## [13.2.2](https://github.com/aeternity/aepp-sdk-js/compare/v13.2.1...v13.2.2) (2023-09-20) + + +### Bug Fixes + +* use proper vm version in Ceres ([bcaa5cf](https://github.com/aeternity/aepp-sdk-js/commit/bcaa5cfe0f8a23a641d9db993b312e2d54cfdd60)) +* **aepp,wallet:** connect to web-extension if opened over file:/// ([da6a025](https://github.com/aeternity/aepp-sdk-js/commit/da6a0257e995db38e32888390961eb870a482777)) +* **aepp:** use complete type of WalletInfo object ([eeba565](https://github.com/aeternity/aepp-sdk-js/commit/eeba56576b97afda6739fa8cd0f9e5c6f039651f)) +* **contract:** don't mark contract as deployed if tx failed ([cc4222d](https://github.com/aeternity/aepp-sdk-js/commit/cc4222db8dc979c878e6e51bea9634484b826de7)) +* **contract:** use current nonce in static calls ([758bdfc](https://github.com/aeternity/aepp-sdk-js/commit/758bdfc75a1dd8e4ff0646ddeaa10e19b1a4d5d1)) +* **node:** don't retry 500 code responses ([696e7db](https://github.com/aeternity/aepp-sdk-js/commit/696e7db88605a385789d741f2704aba2c1cee972)) +* **node:** throw clear error message if unsupported protocol ([21dfe34](https://github.com/aeternity/aepp-sdk-js/commit/21dfe34b3645d95b4c54d99e8517a33634b3751f)) +* **node:** uncatchable exception if request failed in queue ([dec62a4](https://github.com/aeternity/aepp-sdk-js/commit/dec62a474cad4639b81cbef46ff606c384f7ab53)) +* typos in error messages and docs ([5c84671](https://github.com/aeternity/aepp-sdk-js/commit/5c846712a32a110e1a5df25d5c4366046d9558f5)) + ### [13.2.1](https://github.com/aeternity/aepp-sdk-js/compare/v13.2.0...v13.2.1) (2023-07-28) diff --git a/docs/guides/address-length.md b/docs/guides/address-length.md index a2c3f53e5c..c0b0e76d1f 100644 --- a/docs/guides/address-length.md +++ b/docs/guides/address-length.md @@ -81,5 +81,5 @@ Running the above code you would get output like Therefore the minimum address length is 41 chars. All these addresses valid, for example `ak_11111111111111111111111111111111273Yts` [used] to collect AENS name fees. -[isAddressValid]: https://docs.aeternity.com/aepp-sdk-js/v13.2.1/api/functions/isAddressValid.html +[isAddressValid]: https://docs.aeternity.com/aepp-sdk-js/v13.2.2/api/functions/isAddressValid.html [used]: https://mainnet.aeternity.io/v3/accounts/ak_11111111111111111111111111111111273Yts diff --git a/docs/guides/contracts.md b/docs/guides/contracts.md index 436a349385..f9e3dd88e3 100644 --- a/docs/guides/contracts.md +++ b/docs/guides/contracts.md @@ -17,7 +17,7 @@ import { AeSdk, MemoryAccount, Node } from '@aeternity/aepp-sdk' ## 2. Setup compiler Compiler primarily used to generate bytecode to deploy a contract. Skip this step if you have a contract bytecode or need to interact with an already deployed contract. -Out-of-the-box SDK supports [aesophia_cli](https://github.com/aeternity/aesophia_cli) and [aesophia_http](https://github.com/aeternity/aesophia_http) implemented in [CompilerCli](https://docs.aeternity.com/aepp-sdk-js/v13.2.1/api/classes/CompilerCli.html) and [CompilerHttp](https://docs.aeternity.com/aepp-sdk-js/v13.2.1/api/classes/CompilerHttp.html) respectively. +Out-of-the-box SDK supports [aesophia_cli](https://github.com/aeternity/aesophia_cli) and [aesophia_http](https://github.com/aeternity/aesophia_http) implemented in [CompilerCli](https://docs.aeternity.com/aepp-sdk-js/v13.2.2/api/classes/CompilerCli.html) and [CompilerHttp](https://docs.aeternity.com/aepp-sdk-js/v13.2.2/api/classes/CompilerHttp.html) respectively. CompilerCli is available only in Node.js and requires Erlang installed (`escript` available in `$PATH`), Windows is supported. ```js @@ -29,7 +29,7 @@ CompilerHttp requires a hosted compiler service. Preferable to host your own com const compiler = new CompilerHttp('https://v7.compiler.aepps.com') // host your own compiler ``` -Both compiler classes implement the [same interface](https://docs.aeternity.com/aepp-sdk-js/v13.2.1/api/classes/CompilerBase.html) that can be used to generate bytecode and ACI without a Contract instance. +Both compiler classes implement the [same interface](https://docs.aeternity.com/aepp-sdk-js/v13.2.2/api/classes/CompilerBase.html) that can be used to generate bytecode and ACI without a Contract instance. ## 3. Create an instance of the SDK When creating an instance of the SDK you need to provide an account which will be used to sign transactions like `ContractCreateTx` and `ContractCallTx` that will be broadcasted to the network. @@ -212,8 +212,8 @@ The conversion between JS and Sophia values is handled by aepp-calldata library. Refer to [its documentation](https://www.npmjs.com/package/@aeternity/aepp-calldata#data-types) to find the right type to use. ## Generate file system object in Node.js -To do so you can use [getFileSystem](https://docs.aeternity.com/aepp-sdk-js/v13.2.1/api/functions/getFileSystem.html) function. +To do so you can use [getFileSystem](https://docs.aeternity.com/aepp-sdk-js/v13.2.2/api/functions/getFileSystem.html) function. In most cases, you don't need to do it explicitly. Prefer to use `sourceCodePath` instead `sourceCode` in -[Contract::initialize](https://docs.aeternity.com/aepp-sdk-js/v13.2.1/api/classes/_internal_.Contract.html#initialize), -and [compile](https://docs.aeternity.com/aepp-sdk-js/v13.2.1/api/classes/CompilerBase.html#compile) -instead [compileBySourceCode](https://docs.aeternity.com/aepp-sdk-js/v13.2.1/api/classes/CompilerBase.html#compileBySourceCode) in CompilerBase. +[Contract::initialize](https://docs.aeternity.com/aepp-sdk-js/v13.2.2/api/classes/_internal_.Contract.html#initialize), +and [compile](https://docs.aeternity.com/aepp-sdk-js/v13.2.2/api/classes/CompilerBase.html#compile) +instead [compileBySourceCode](https://docs.aeternity.com/aepp-sdk-js/v13.2.2/api/classes/CompilerBase.html#compileBySourceCode) in CompilerBase. diff --git a/docs/guides/paying-for-tx.md b/docs/guides/paying-for-tx.md index 3621ea814d..e1c5076b33 100644 --- a/docs/guides/paying-for-tx.md +++ b/docs/guides/paying-for-tx.md @@ -13,8 +13,8 @@ You can then collect the signed inner transaction, wrap it into a `PayingForTx` ## Usage examples We provided following two NodeJS examples which you can take a look at: -- [InnerTx: ContractCallTx](https://docs.aeternity.com/aepp-sdk-js/v13.2.1/examples/node/paying-for-contract-call-tx/) -- [InnerTx: SpendTx](https://docs.aeternity.com/aepp-sdk-js/v13.2.1/examples/node/paying-for-spend-tx/) +- [InnerTx: ContractCallTx](https://docs.aeternity.com/aepp-sdk-js/v13.2.2/examples/node/paying-for-contract-call-tx/) +- [InnerTx: SpendTx](https://docs.aeternity.com/aepp-sdk-js/v13.2.2/examples/node/paying-for-spend-tx/) Note: diff --git a/examples/node/transfer-ae.mjs b/examples/node/transfer-ae.mjs index c4dcb6d230..571796d621 100755 --- a/examples/node/transfer-ae.mjs +++ b/examples/node/transfer-ae.mjs @@ -53,7 +53,7 @@ console.log(`Balance of ${recipient} (before): ${balanceBefore} aettos`); // Calling the `spend` function will create, sign and broadcast a `SpendTx` to the network. const tx = await aeSdk.spend(amount, recipient); console.log('Transaction mined', tx); -// Alternatively, you can use [transferFunds](https://docs.aeternity.com/aepp-sdk-js/v13.2.1/api/functions/transferFunds.html) +// Alternatively, you can use [transferFunds](https://docs.aeternity.com/aepp-sdk-js/v13.2.2/api/functions/transferFunds.html) // method to transfer a fraction of your AE to another account. // ## 6. Get AE balance of recipient (after transfer) diff --git a/package-lock.json b/package-lock.json index cf86ba3ebf..8d2da9c408 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@aeternity/aepp-sdk", - "version": "13.2.1", + "version": "13.2.2", "lockfileVersion": 3, "requires": true, "packages": { diff --git a/package.json b/package.json index 75c968f3aa..bdae5be950 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@aeternity/aepp-sdk", - "version": "13.2.1", + "version": "13.2.2", "description": "SDK for the æternity blockchain", "main": "dist/aepp-sdk.js", "types": "es/index.d.ts", From 86c6f6154bdfb4da6477fcdf23a9c9db9ff2e7e2 Mon Sep 17 00:00:00 2001 From: Denis Davidyuk Date: Thu, 21 Sep 2023 08:46:29 +0400 Subject: [PATCH 28/28] docs(wallet): don't add protocol to relative paths in wallet-iframe --- examples/browser/wallet-iframe/src/App.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/browser/wallet-iframe/src/App.vue b/examples/browser/wallet-iframe/src/App.vue index 71a7fa1115..eac4c67c03 100644 --- a/examples/browser/wallet-iframe/src/App.vue +++ b/examples/browser/wallet-iframe/src/App.vue @@ -84,7 +84,9 @@ export default { }), methods: { navigate() { - if (!/^https?:\/\//.test(this.nextAeppUrl)) this.nextAeppUrl = 'http://' + this.nextAeppUrl; + if (!/^https?:\/\//.test(this.nextAeppUrl) && !this.nextAeppUrl.startsWith('.')) { + this.nextAeppUrl = 'http://' + this.nextAeppUrl; + } this.aeppUrl = ''; this.$nextTick(() => { this.aeppUrl = this.nextAeppUrl;