diff --git a/package-lock.json b/package-lock.json index 457fe9184..3a6489df9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -44,6 +44,7 @@ "workbox-precaching": "^7.0.0" }, "devDependencies": { + "@aeternity/aepp-sdk-next": "npm:@aeternity/aepp-sdk@^13.2.2", "@babel/eslint-parser": "^7.23.3", "@frsource/cypress-plugin-visual-regression-diff": "^3.3.10", "@intlify/eslint-plugin-vue-i18n": "^2.0.0", @@ -102,16 +103,30 @@ } }, "node_modules/@aeternity/aepp-calldata": { - "version": "1.1.1", - "license": "ISC", + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/@aeternity/aepp-calldata/-/aepp-calldata-1.5.1.tgz", + "integrity": "sha512-D477egpY0ErwquDOhLfCozCRaEDwRE8Vtrc2DR92dU7dkGHGp5zSikZU+cy060UaDmV4eXbU9oV8ch4ryFDqBw==", "dependencies": { - "@aeternity/blakejs": "^1.1.2", - "bs58": "^4.0.1", + "blakejs": "^1.2.1", + "bs58": "^5.0.0", "rlp": "^3.0.0", "safe-buffer": "^5.2.1", "sha.js": "^2.4.11" } }, + "node_modules/@aeternity/aepp-calldata/node_modules/base-x": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-4.0.0.tgz", + "integrity": "sha512-FuwxlW4H5kh37X/oW59pwTzzTKRzfrrQwhmyspRM7swOEZcHtDZSCt45U6oKgtuFE+WYPblePMVIPR4RZrh/hw==" + }, + "node_modules/@aeternity/aepp-calldata/node_modules/bs58": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-5.0.0.tgz", + "integrity": "sha512-r+ihvQJvahgYT50JD05dyJNKlmmSlMoOGwn1lCcEzanPglg7TxYjioQUYehQ9mAR/+hOSd2jRc/Z2y5UxBymvQ==", + "dependencies": { + "base-x": "^4.0.0" + } + }, "node_modules/@aeternity/aepp-sdk": { "version": "11.0.1", "license": "ISC", @@ -140,6 +155,172 @@ "websocket": "^1.0.34" } }, + "node_modules/@aeternity/aepp-sdk-next": { + "name": "@aeternity/aepp-sdk", + "version": "13.2.2", + "resolved": "https://registry.npmjs.org/@aeternity/aepp-sdk/-/aepp-sdk-13.2.2.tgz", + "integrity": "sha512-hTpAV4E8I0Y/IfjizsHlpzPN3gW4Bkr08GVqmRcGUh5yi7MQA9N54kbTfl+kQlcp6AYC9WVk3fhNuoTUOzISig==", + "dev": true, + "dependencies": { + "@aeternity/aepp-calldata": "^1.5.1", + "@aeternity/argon2": "^0.0.1", + "@aeternity/uuid": "^0.0.1", + "@azure/core-client": "1.6.0", + "@azure/core-rest-pipeline": "^1.11.0", + "@babel/runtime-corejs3": "^7.22.6", + "@ledgerhq/hw-transport": "^6.28.6", + "@types/aes-js": "^3.1.1", + "@types/json-bigint": "^1.0.1", + "@types/node": "~18.11.9", + "@types/sha.js": "^2.4.1", + "@types/uuid": "^9.0.2", + "@types/webextension-polyfill": "^0.10.1", + "@types/websocket": "^1.0.5", + "@types/ws": "^8.5.5", + "aes-js": "^3.1.2", + "bignumber.js": "^9.1.1", + "bip32-path": "^0.4.2", + "blakejs": "^1.2.1", + "bs58": "^5.0.0", + "buffer": "^6.0.3", + "canonicalize": "^2.0.0", + "events": "^3.3.0", + "isomorphic-ws": "^5.0.0", + "json-bigint": "^1.0.0", + "process": "^0.11.10", + "rlp": "^3.0.0", + "sha.js": "^2.4.11", + "tweetnacl": "^1.0.3", + "tweetnacl-auth": "^1.0.1", + "varuint-bitcoin": "^1.1.2", + "websocket": "^1.0.34", + "ws": "^8.13.0" + }, + "engines": { + "node": ">=14.19.0" + } + }, + "node_modules/@aeternity/aepp-sdk-next/node_modules/@ledgerhq/devices": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/@ledgerhq/devices/-/devices-8.2.0.tgz", + "integrity": "sha512-XROTW2gTmmuy+YPPDjdtKKTQ3mfxrPtKtV+a9QFbj8f5MnjVMV0Zpy1BIB4CyIMsVVi4z6+nI67auT7IlsM3SQ==", + "dev": true, + "dependencies": { + "@ledgerhq/errors": "^6.16.1", + "@ledgerhq/logs": "^6.12.0", + "rxjs": "^7.8.1", + "semver": "^7.3.5" + } + }, + "node_modules/@aeternity/aepp-sdk-next/node_modules/@ledgerhq/errors": { + "version": "6.16.1", + "resolved": "https://registry.npmjs.org/@ledgerhq/errors/-/errors-6.16.1.tgz", + "integrity": "sha512-4D4wKecGzQpIu7sx03Sg4uE1e8g1oZUndWgw9gw776H8h9ov9c5TxPaldTn2j6orPECAERViLf7LTO4L5pE2Cw==", + "dev": true + }, + "node_modules/@aeternity/aepp-sdk-next/node_modules/@ledgerhq/hw-transport": { + "version": "6.30.1", + "resolved": "https://registry.npmjs.org/@ledgerhq/hw-transport/-/hw-transport-6.30.1.tgz", + "integrity": "sha512-Xeeo4nt33g5Fsp3CdsPvcc2Uk7dwYeKRSlSFLWcYAAKprf/PmxgNekhke1eaNU/wLoeLOWhY2Cki8F8w9nLMdQ==", + "dev": true, + "dependencies": { + "@ledgerhq/devices": "^8.2.0", + "@ledgerhq/errors": "^6.16.1", + "@ledgerhq/logs": "^6.12.0", + "events": "^3.3.0" + } + }, + "node_modules/@aeternity/aepp-sdk-next/node_modules/@ledgerhq/logs": { + "version": "6.12.0", + "resolved": "https://registry.npmjs.org/@ledgerhq/logs/-/logs-6.12.0.tgz", + "integrity": "sha512-ExDoj1QV5eC6TEbMdLUMMk9cfvNKhhv5gXol4SmULRVCx/3iyCPhJ74nsb3S0Vb+/f+XujBEj3vQn5+cwS0fNA==", + "dev": true + }, + "node_modules/@aeternity/aepp-sdk-next/node_modules/@types/node": { + "version": "18.11.19", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.19.tgz", + "integrity": "sha512-YUgMWAQBWLObABqrvx8qKO1enAvBUdjZOAWQ5grBAkp5LQv45jBvYKZ3oFS9iKRCQyFjqw6iuEa1vmFqtxYLZw==", + "dev": true + }, + "node_modules/@aeternity/aepp-sdk-next/node_modules/base-x": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-4.0.0.tgz", + "integrity": "sha512-FuwxlW4H5kh37X/oW59pwTzzTKRzfrrQwhmyspRM7swOEZcHtDZSCt45U6oKgtuFE+WYPblePMVIPR4RZrh/hw==", + "dev": true + }, + "node_modules/@aeternity/aepp-sdk-next/node_modules/bs58": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-5.0.0.tgz", + "integrity": "sha512-r+ihvQJvahgYT50JD05dyJNKlmmSlMoOGwn1lCcEzanPglg7TxYjioQUYehQ9mAR/+hOSd2jRc/Z2y5UxBymvQ==", + "dev": true, + "dependencies": { + "base-x": "^4.0.0" + } + }, + "node_modules/@aeternity/aepp-sdk-next/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@aeternity/aepp-sdk-next/node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@aeternity/aepp-sdk-next/node_modules/ws": { + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.16.0.tgz", + "integrity": "sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ==", + "dev": true, + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/@aeternity/aepp-sdk-next/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/@aeternity/argon2": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/@aeternity/argon2/-/argon2-0.0.1.tgz", + "integrity": "sha512-xC+znnq5sL3FiQcGWapFqKAZpJJBXnFhW8+pP7OE2xL7zH15X66jzdgqi1LHRKJM6UHxknqKQX/pqgUrpLruxw==", + "dev": true, + "dependencies": { + "@aeternity/argon2-browser": "^0.1.2", + "argon2": "^0.28.7" + } + }, "node_modules/@aeternity/argon2-browser": { "version": "0.1.2", "license": "MIT" @@ -208,6 +389,129 @@ "ajv": ">=8" } }, + "node_modules/@azure/abort-controller": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-1.1.0.tgz", + "integrity": "sha512-TrRLIoSQVzfAJX9H1JeFjzAoDGcoK1IYX1UImfceTZpsyYfWr09Ss1aHW1y5TrrR3iq6RZLBwJ3E24uwPhwahw==", + "dev": true, + "dependencies": { + "tslib": "^2.2.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/@azure/core-auth": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@azure/core-auth/-/core-auth-1.5.0.tgz", + "integrity": "sha512-udzoBuYG1VBoHVohDTrvKjyzel34zt77Bhp7dQntVGGD0ehVq48owENbBG8fIgkHRNUBQH5k1r0hpoMu5L8+kw==", + "dev": true, + "dependencies": { + "@azure/abort-controller": "^1.0.0", + "@azure/core-util": "^1.1.0", + "tslib": "^2.2.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@azure/core-client": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@azure/core-client/-/core-client-1.6.0.tgz", + "integrity": "sha512-YhSf4cb61ApSjItscp9XoaLq8KRnacPDAhmjAZSMnn/gs6FhFbZNfOBOErG2dDj7JRknVtCmJ5mLmfR2sLa11A==", + "dev": true, + "dependencies": { + "@azure/abort-controller": "^1.0.0", + "@azure/core-auth": "^1.3.0", + "@azure/core-rest-pipeline": "^1.5.0", + "@azure/core-tracing": "^1.0.0", + "@azure/core-util": "^1.0.0", + "@azure/logger": "^1.0.0", + "tslib": "^2.2.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/@azure/core-rest-pipeline": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.13.0.tgz", + "integrity": "sha512-a62aP/wppgmnfIkJLfcB4ssPBcH94WzrzPVJ3tlJt050zX4lfmtnvy95D3igDo3f31StO+9BgPrzvkj4aOxnoA==", + "dev": true, + "dependencies": { + "@azure/abort-controller": "^1.1.0", + "@azure/core-auth": "^1.4.0", + "@azure/core-tracing": "^1.0.1", + "@azure/core-util": "^1.3.0", + "@azure/logger": "^1.0.0", + "http-proxy-agent": "^5.0.0", + "https-proxy-agent": "^5.0.0", + "tslib": "^2.2.0" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@azure/core-rest-pipeline/node_modules/@tootallnate/once": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", + "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", + "dev": true, + "engines": { + "node": ">= 10" + } + }, + "node_modules/@azure/core-rest-pipeline/node_modules/http-proxy-agent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", + "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", + "dev": true, + "dependencies": { + "@tootallnate/once": "2", + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/@azure/core-tracing": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.0.1.tgz", + "integrity": "sha512-I5CGMoLtX+pI17ZdiFJZgxMJApsK6jjfm85hpgp3oazCdq5Wxgh4wMr7ge/TTWW1B5WBuvIOI1fMU/FrOAMKrw==", + "dev": true, + "dependencies": { + "tslib": "^2.2.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/@azure/core-util": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@azure/core-util/-/core-util-1.6.1.tgz", + "integrity": "sha512-h5taHeySlsV9qxuK64KZxy4iln1BtMYlNt5jbuEFN3UFSAd1EwKg/Gjl5a6tZ/W8t6li3xPnutOx7zbDyXnPmQ==", + "dev": true, + "dependencies": { + "@azure/abort-controller": "^1.0.0", + "tslib": "^2.2.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@azure/logger": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@azure/logger/-/logger-1.0.4.tgz", + "integrity": "sha512-ustrPY8MryhloQj7OWGe+HrYx+aoiOxzbXTtgblbV3xwCqpzUK36phH3XNHQKj3EPonyFUuDTfR3qFhTEAuZEg==", + "dev": true, + "dependencies": { + "tslib": "^2.2.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/@babel/code-frame": { "version": "7.22.13", "dev": true, @@ -3504,6 +3808,113 @@ "dev": true, "license": "MIT" }, + "node_modules/@mapbox/node-pre-gyp": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz", + "integrity": "sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==", + "dev": true, + "dependencies": { + "detect-libc": "^2.0.0", + "https-proxy-agent": "^5.0.0", + "make-dir": "^3.1.0", + "node-fetch": "^2.6.7", + "nopt": "^5.0.0", + "npmlog": "^5.0.1", + "rimraf": "^3.0.2", + "semver": "^7.3.5", + "tar": "^6.1.11" + }, + "bin": { + "node-pre-gyp": "bin/node-pre-gyp" + } + }, + "node_modules/@mapbox/node-pre-gyp/node_modules/are-we-there-yet": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", + "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==", + "dev": true, + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@mapbox/node-pre-gyp/node_modules/detect-libc": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.2.tgz", + "integrity": "sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@mapbox/node-pre-gyp/node_modules/gauge": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", + "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==", + "dev": true, + "dependencies": { + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.2", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.1", + "object-assign": "^4.1.1", + "signal-exit": "^3.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@mapbox/node-pre-gyp/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@mapbox/node-pre-gyp/node_modules/npmlog": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz", + "integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==", + "dev": true, + "dependencies": { + "are-we-there-yet": "^2.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^3.0.0", + "set-blocking": "^2.0.0" + } + }, + "node_modules/@mapbox/node-pre-gyp/node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@mapbox/node-pre-gyp/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, "node_modules/@netflix/nerror": { "version": "1.1.3", "dev": true, @@ -3725,6 +4136,15 @@ "read-package-json-fast": "^2.0.1" } }, + "node_modules/@phc/format": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@phc/format/-/format-1.0.0.tgz", + "integrity": "sha512-m7X9U6BG2+J+R1lSOdCiITLLrxm+cWlNI3HUFA92oLO77ObGNzaKdh8pMLqdZcshtkKuV84olNNXDfMc4FezBQ==", + "dev": true, + "engines": { + "node": ">=10" + } + }, "node_modules/@polka/url": { "version": "1.0.0-next.21", "dev": true, @@ -5863,6 +6283,12 @@ "node": ">=10.13.0" } }, + "node_modules/@types/aes-js": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/@types/aes-js/-/aes-js-3.1.4.tgz", + "integrity": "sha512-v3D66IptpUqh+pHKVNRxY8yvp2ESSZXe0rTzsGdzUhEwag7ljVfgCllkWv2YgiYXDhWFBrEywll4A5JToyTNFA==", + "dev": true + }, "node_modules/@types/babel__core": { "version": "7.20.5", "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", @@ -6034,6 +6460,12 @@ "pretty-format": "^27.0.0" } }, + "node_modules/@types/json-bigint": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@types/json-bigint/-/json-bigint-1.0.4.tgz", + "integrity": "sha512-ydHooXLbOmxBbubnA7Eh+RpBzuaIiQjh8WGJYQB50JFGFrdxW7JzVlyEV7fAXw0T2sqJ1ysTneJbiyNLqZRAag==", + "dev": true + }, "node_modules/@types/json-schema": { "version": "7.0.9", "dev": true, @@ -6127,6 +6559,15 @@ "@types/node": "*" } }, + "node_modules/@types/sha.js": { + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/@types/sha.js/-/sha.js-2.4.4.tgz", + "integrity": "sha512-Qukd+D6S2Hm0wLVt2Vh+/eWBIoUt+wF8jWjBsG4F8EFQRwKtYvtXCPcNl2OEUQ1R+eTr3xuSaBYUyM3WD1x/Qw==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/sinonjs__fake-timers": { "version": "8.1.1", "dev": true, @@ -6167,10 +6608,32 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/uuid": { + "version": "9.0.7", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.7.tgz", + "integrity": "sha512-WUtIVRUZ9i5dYXefDEAI7sh9/O7jGvHg7Df/5O/gtH3Yabe5odI3UWopVR1qbPXQtvOxWu3mM4XxlYeZtMWF4g==", + "dev": true + }, + "node_modules/@types/webextension-polyfill": { + "version": "0.10.7", + "resolved": "https://registry.npmjs.org/@types/webextension-polyfill/-/webextension-polyfill-0.10.7.tgz", + "integrity": "sha512-10ql7A0qzBmFB+F+qAke/nP1PIonS0TXZAOMVOxEUsm+lGSW6uwVcISFNa0I4Oyj0884TZVWGGMIWeXOVSNFHw==", + "dev": true + }, + "node_modules/@types/websocket": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/@types/websocket/-/websocket-1.0.10.tgz", + "integrity": "sha512-svjGZvPB7EzuYS94cI7a+qhwgGU1y89wUgjT6E2wVUfmAGIvRfT7obBvRtnhXCSsoMdlG4gBFGE7MfkIXZLoww==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/ws": { - "version": "8.5.4", + "version": "8.5.10", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.10.tgz", + "integrity": "sha512-vmQSUcfalpIq0R9q7uTo2lXs6eGIpt9wtnLdMv9LVpIjCA/+ufZRozlVoVelIYixx1ugCBKDhn89vnsEGOCx9A==", "dev": true, - "license": "MIT", "dependencies": { "@types/node": "*" } @@ -8539,6 +9002,21 @@ "dev": true, "license": "MIT" }, + "node_modules/argon2": { + "version": "0.28.7", + "resolved": "https://registry.npmjs.org/argon2/-/argon2-0.28.7.tgz", + "integrity": "sha512-pvsScM3Fq7b+jolXkZHh8nRQx0uD/WeelnwYPMRpn4pAydoa1gqeL/KRdWAag4Hnu1TJNBTAfqyTjV+ZHwNnYA==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "@mapbox/node-pre-gyp": "^1.0.9", + "@phc/format": "^1.0.0", + "node-addon-api": "^5.0.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/argparse": { "version": "2.0.1", "license": "Python-2.0" @@ -9151,6 +9629,11 @@ "ieee754": "^1.1.13" } }, + "node_modules/blakejs": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.2.1.tgz", + "integrity": "sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ==" + }, "node_modules/blob-util": { "version": "2.0.2", "dev": true, @@ -9620,6 +10103,12 @@ } ] }, + "node_modules/canonicalize": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/canonicalize/-/canonicalize-2.0.0.tgz", + "integrity": "sha512-ulDEYPv7asdKvqahuAY35c1selLdzDwHqugK92hfkzvlDCwXRRelDkR+Er33md/PtnpqHemgkuDPanZ4fiYZ8w==", + "dev": true + }, "node_modules/case-sensitive-paths-webpack-plugin": { "version": "2.4.0", "dev": true, @@ -10122,6 +10611,15 @@ "simple-swizzle": "^0.2.2" } }, + "node_modules/color-support": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", + "dev": true, + "bin": { + "color-support": "bin.js" + } + }, "node_modules/color/node_modules/color-convert": { "version": "2.0.1", "dev": true, @@ -16659,6 +17157,15 @@ "node": ">=0.10.0" } }, + "node_modules/isomorphic-ws": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-5.0.0.tgz", + "integrity": "sha512-muId7Zzn9ywDsyXgTIafTry2sV3nySZeUDe6YedVd1Hvuuep5AsIlqK+XefWpYTyJG5e503F2xIuT2lcU6rCSw==", + "dev": true, + "peerDependencies": { + "ws": "*" + } + }, "node_modules/isstream": { "version": "0.1.2", "dev": true, @@ -20537,6 +21044,15 @@ "node": ">=4" } }, + "node_modules/json-bigint": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz", + "integrity": "sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==", + "dev": true, + "dependencies": { + "bignumber.js": "^9.0.0" + } + }, "node_modules/json-buffer": { "version": "3.0.0", "dev": true, @@ -21807,6 +22323,12 @@ "dev": true, "license": "ISC" }, + "node_modules/node-addon-api": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-5.1.0.tgz", + "integrity": "sha512-eh0GgfEkpnoWDq+VY8OyvYhFEzBk6jIYbRKdIlyTiAXIVJ8PyBaKb0rp7oDtoddbdoHWhq8wwr+XZ81F1rpNdA==", + "dev": true + }, "node_modules/node-domexception": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", @@ -27807,6 +28329,15 @@ "builtins": "^1.0.3" } }, + "node_modules/varuint-bitcoin": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/varuint-bitcoin/-/varuint-bitcoin-1.1.2.tgz", + "integrity": "sha512-4EVb+w4rx+YfVM32HQX42AbbT7/1f5zwAYhIujKXKk8NQK+JfRVl3pqT3hjNn/L+RstigmGGKVwHA/P0wgITZw==", + "dev": true, + "dependencies": { + "safe-buffer": "^5.1.1" + } + }, "node_modules/vary": { "version": "1.1.2", "dev": true, diff --git a/package.json b/package.json index 8acb37a8f..d2315e7c0 100644 --- a/package.json +++ b/package.json @@ -54,6 +54,7 @@ "workbox-precaching": "^7.0.0" }, "devDependencies": { + "@aeternity/aepp-sdk-next": "npm:@aeternity/aepp-sdk@^13.2.2", "@babel/eslint-parser": "^7.23.3", "@frsource/cypress-plugin-visual-regression-diff": "^3.3.10", "@intlify/eslint-plugin-vue-i18n": "^2.0.0", diff --git a/src/store/plugins/ui/urlRequestHandler.js b/src/store/plugins/ui/urlRequestHandler.js index c23a1643b..3b96c0d14 100644 --- a/src/store/plugins/ui/urlRequestHandler.js +++ b/src/store/plugins/ui/urlRequestHandler.js @@ -29,7 +29,10 @@ export default (store) => { } }; - if (!['http:', 'https:'].includes(callbackUrl.protocol)) { + if ( + !['http:', 'https:'].includes(callbackUrl.protocol) + && !callbackUrl.href.startsWith('about:blank') + ) { reply({ error: new Error(`Unknown protocol: ${callbackUrl.protocol}`) }); return; } diff --git a/tests/e2e/specs/transfer/__image_snapshots__/Sign transaction shows ContractCallTx details #0.png b/tests/e2e/specs/transfer/__image_snapshots__/Sign transaction shows ContractCallTx details #0.png new file mode 100644 index 000000000..72305b2d0 Binary files /dev/null and b/tests/e2e/specs/transfer/__image_snapshots__/Sign transaction shows ContractCallTx details #0.png differ diff --git a/tests/e2e/specs/transfer/__image_snapshots__/Sign transaction shows ContractCreateTx details #0.png b/tests/e2e/specs/transfer/__image_snapshots__/Sign transaction shows ContractCreateTx details #0.png new file mode 100644 index 000000000..1ee68c982 Binary files /dev/null and b/tests/e2e/specs/transfer/__image_snapshots__/Sign transaction shows ContractCreateTx details #0.png differ diff --git a/tests/e2e/specs/transfer/__image_snapshots__/Sign transaction shows NameClaimTx details #0.png b/tests/e2e/specs/transfer/__image_snapshots__/Sign transaction shows NameClaimTx details #0.png new file mode 100644 index 000000000..0036b91da Binary files /dev/null and b/tests/e2e/specs/transfer/__image_snapshots__/Sign transaction shows NameClaimTx details #0.png differ diff --git a/tests/e2e/specs/transfer/__image_snapshots__/Sign transaction shows NamePreclaimTx details #0.png b/tests/e2e/specs/transfer/__image_snapshots__/Sign transaction shows NamePreclaimTx details #0.png new file mode 100644 index 000000000..b8bfb21f9 Binary files /dev/null and b/tests/e2e/specs/transfer/__image_snapshots__/Sign transaction shows NamePreclaimTx details #0.png differ diff --git a/tests/e2e/specs/transfer/__image_snapshots__/Sign transaction shows NameRevokeTx details #0.png b/tests/e2e/specs/transfer/__image_snapshots__/Sign transaction shows NameRevokeTx details #0.png new file mode 100644 index 000000000..fddbbafd8 Binary files /dev/null and b/tests/e2e/specs/transfer/__image_snapshots__/Sign transaction shows NameRevokeTx details #0.png differ diff --git a/tests/e2e/specs/transfer/__image_snapshots__/Sign transaction shows NameTransferTx details #0.png b/tests/e2e/specs/transfer/__image_snapshots__/Sign transaction shows NameTransferTx details #0.png new file mode 100644 index 000000000..b7978f55d Binary files /dev/null and b/tests/e2e/specs/transfer/__image_snapshots__/Sign transaction shows NameTransferTx details #0.png differ diff --git a/tests/e2e/specs/transfer/__image_snapshots__/Sign transaction shows NameUpdateTx details #0.png b/tests/e2e/specs/transfer/__image_snapshots__/Sign transaction shows NameUpdateTx details #0.png new file mode 100644 index 000000000..cb2e80ddb Binary files /dev/null and b/tests/e2e/specs/transfer/__image_snapshots__/Sign transaction shows NameUpdateTx details #0.png differ diff --git a/tests/e2e/specs/transfer/__image_snapshots__/Sign transaction shows OracleExtendTx details #0.png b/tests/e2e/specs/transfer/__image_snapshots__/Sign transaction shows OracleExtendTx details #0.png new file mode 100644 index 000000000..76f53a570 Binary files /dev/null and b/tests/e2e/specs/transfer/__image_snapshots__/Sign transaction shows OracleExtendTx details #0.png differ diff --git a/tests/e2e/specs/transfer/__image_snapshots__/Sign transaction shows OracleQueryTx details #0.png b/tests/e2e/specs/transfer/__image_snapshots__/Sign transaction shows OracleQueryTx details #0.png new file mode 100644 index 000000000..b22319ddd Binary files /dev/null and b/tests/e2e/specs/transfer/__image_snapshots__/Sign transaction shows OracleQueryTx details #0.png differ diff --git a/tests/e2e/specs/transfer/__image_snapshots__/Sign transaction shows OracleRegisterTx details #0.png b/tests/e2e/specs/transfer/__image_snapshots__/Sign transaction shows OracleRegisterTx details #0.png new file mode 100644 index 000000000..1dd014698 Binary files /dev/null and b/tests/e2e/specs/transfer/__image_snapshots__/Sign transaction shows OracleRegisterTx details #0.png differ diff --git a/tests/e2e/specs/transfer/__image_snapshots__/Sign transaction shows OracleResponseTx details #0.png b/tests/e2e/specs/transfer/__image_snapshots__/Sign transaction shows OracleResponseTx details #0.png new file mode 100644 index 000000000..7928bacdc Binary files /dev/null and b/tests/e2e/specs/transfer/__image_snapshots__/Sign transaction shows OracleResponseTx details #0.png differ diff --git a/tests/e2e/specs/transfer/__image_snapshots__/Sign transaction shows SpendTx details #0.png b/tests/e2e/specs/transfer/__image_snapshots__/Sign transaction shows SpendTx details #0.png new file mode 100644 index 000000000..e5d4496fc Binary files /dev/null and b/tests/e2e/specs/transfer/__image_snapshots__/Sign transaction shows SpendTx details #0.png differ diff --git a/tests/e2e/specs/transfer/__image_snapshots__/Sign transaction signs transaction #0.png b/tests/e2e/specs/transfer/__image_snapshots__/Sign transaction signs transaction #0.png new file mode 100644 index 000000000..5e69c1f99 Binary files /dev/null and b/tests/e2e/specs/transfer/__image_snapshots__/Sign transaction signs transaction #0.png differ diff --git a/tests/e2e/specs/transfer/sign-transaction.cy.js b/tests/e2e/specs/transfer/sign-transaction.cy.js new file mode 100644 index 000000000..be12a4635 --- /dev/null +++ b/tests/e2e/specs/transfer/sign-transaction.cy.js @@ -0,0 +1,138 @@ +import { + buildTx, unpackTx, Tag, encode, decode, commitmentHash, Encoding, ORACLE_TTL_TYPES, oracleQueryId, +} from '@aeternity/aepp-sdk-next'; + +describe('Sign transaction', () => { + const nonce = 1; + const nameTtl = 1; + const clientTtl = 1; + const amount = 12.34e18; + const accountId = 'ak_2iBPH7HUz3cSDVEUWiHg76MZJ6tZooVNBmmxcgVK6VV8KAE688'; + const recipientId = 'ak_2iBPH7HUz3cSDVEUWiHg76MZJ6tZooVNBmmxcgVK6VV8KAE688'; + const name = 'test123test.chain'; + const nameId = 'nm_2sFnPHi5ziAqhdApSpRBsYdomCahtmk3YGNZKYUTtUNpVSMccC'; + const nameFee = '1000000000000000000000'; + const contractId = 'ct_TCQVoset7Y4qEyV5tgEAJAqa2Foz8J1EXqoGpq3fB6dWH5roe'; + const pointers = [ + { key: 'account_pubkey', id: accountId }, + { key: 'test key', id: accountId }, + { key: 'contract_pubkey', id: contractId }, + ]; + const payload = encode(Buffer.from('test'), Encoding.Bytearray); + const queryFormat = '{\'city\': str}'; + const responseFormat = '{\'tmp\': num}'; + const queryFee = 30000; + const oracleTtl = { oracleTtlType: ORACLE_TTL_TYPES.delta, oracleTtlValue: 500 }; + const responseTtl = { responseTtlType: ORACLE_TTL_TYPES.delta, responseTtlValue: 100 }; + const queryTtl = { queryTtlType: ORACLE_TTL_TYPES.delta, queryTtlValue: 100 }; + const query = '{\'city\': \'Berlin\'}'; + const queryResponse = '{\'tmp\': 101}'; + const callData = 'cb_KxFs8lcLG2+HEPb2FOjjZ2DqRd4='; + const gasLimit = 5e6; + const nameSalt = 4204563566073083; + const commitmentId = commitmentHash(name, nameSalt); + const oracleId = encode(decode(accountId), Encoding.OracleAddress); + + const transactions = [{ + tag: Tag.SpendTx, senderId: accountId, recipientId: accountId, nonce, amount, payload, + }, { + tag: Tag.NamePreclaimTx, accountId, nonce, commitmentId, + }, { + tag: Tag.NameClaimTx, accountId, nonce, name, nameSalt, nameFee, + }, { + tag: Tag.NameUpdateTx, accountId, nonce, nameId, nameTtl, pointers, clientTtl, + }, { + tag: Tag.NameRevokeTx, accountId, nonce, nameId, + }, { + tag: Tag.NameTransferTx, accountId, nonce, nameId, recipientId, + }, { + tag: Tag.ContractCreateTx, + nonce, + ownerId: accountId, + code: 'cb_+ExGA6Dh3797nquCHCSm088avgOiqgjjarRQviEYAXq+YlegWcCgjf6AeCCSADcBBwcBAQCOLwERgHggkhlnZXRBcmeCLwCFNy4wLjEALb9eTg==', + amount, + gasLimit, + callData, + }, { + tag: Tag.ContractCallTx, + nonce, + callerId: accountId, + contractId, + amount, + gasLimit, + callData, + }, { + tag: Tag.OracleRegisterTx, + nonce, + accountId, + queryFormat, + responseFormat, + queryFee, + ...oracleTtl, + }, { + tag: Tag.OracleExtendTx, nonce, oracleId, ...oracleTtl, + }, { + tag: Tag.OracleQueryTx, + nonce, + oracleId, + ...responseTtl, + query, + ...queryTtl, + queryFee, + senderId: accountId, + }, { + tag: Tag.OracleResponseTx, + nonce, + oracleId, + ...responseTtl, + queryId: oracleQueryId(accountId, nonce, oracleId), + response: queryResponse, + }]; + + transactions.forEach((txParams) => { + it(`shows ${Tag[txParams.tag]} details`, () => { + const url = new URL('http://localhost/signTransaction'); + url.searchParams.append('param0', `"${buildTx(txParams)}"`); + url.searchParams.append('callback', 'about:blank'); + cy + .viewport('iphone-se2') + .visit(url.href.replace('http://localhost', ''), { login: true }); + cy.get('.page.primary').should('be.visible').then(($el) => { + if ($el.text().includes('Sign raw transaction')) return; + cy.get('.details-fee-input .turtle-rabbit').should('be.visible'); + }); + cy.matchImage(); + }); + }); + + it('signs transaction', () => { + const url = new URL('http://localhost/signTransaction'); + url.searchParams.append('param0', `"${buildTx(transactions[0])}"`); + url.searchParams.append('callback', 'about:blank'); + cy + .viewport('iphone-se2') + .visit(url.href.replace('http://localhost', ''), { login: true }); + cy.get('button').contains('Confirm').click(); + const skipButton = cy.get('.modal-plain .ae-button.primary'); + cy.matchImage(); + skipButton.click(); + + cy.url().should('contain', 'about:blank').then((u) => { + const resultUrl = new URL(u); + const signedTx = resultUrl.searchParams.get('result'); + const txParams = unpackTx(JSON.parse(decodeURIComponent(signedTx)), Tag.SignedTx); + expect(txParams.signatures).to.have.length(1); + }); + }); + + it('cancel transaction signing', () => { + const url = new URL('http://localhost/signTransaction'); + url.searchParams.append('param0', `"${buildTx(transactions[0])}"`); + url.searchParams.append('callback', 'about:blank'); + cy + .viewport('iphone-se2') + .visit(url.href.replace('http://localhost', ''), { login: true }); + cy.get('button').contains('Cancel').click(); + cy.url().should('equal', 'about:blank?error=Rejected+by+user'); + }); +});