diff --git a/.env.local.test b/.env.local.test index 6fb1c22b6..eeb81b5af 100644 --- a/.env.local.test +++ b/.env.local.test @@ -11,7 +11,6 @@ VUE_APP_RSK_EXPLORER=https://explorer.testnet.rsk.co/ # replace VALUE with the clarity id for the environment the app is being deployed to. VUE_APP_PEGOUT_MIN_AMOUNT_ALLOWED_IN_RBTC=0.005 -VUE_APP_PEGOUT_MAX_AMOUNT_ALLOWED_IN_RBTC=10 #VUE_APP_CLARITY_ID=VALUE ## fee boundaries @@ -28,4 +27,6 @@ VUE_APP_LBC_ADDRESS='0xc2A630c053D12D63d32b025082f6Ba268db18300' VUE_APP_DEBUG_MODE='true' NODE_ENV=test - +VUE_APP_FLYOVER_PEGOUT_QUOTE_DIFF_PERCENTAGE=2 +VUE_APP_RECAPTCHA_NEW_TOKEN_TIME=30 +VUE_APP_FLYOVER_PROVIDER_ID=2 diff --git a/.github/workflows/deploy_MainNet_UI.yml b/.github/workflows/deploy_MainNet_UI.yml index a8ed7ff1e..fc62cd981 100644 --- a/.github/workflows/deploy_MainNet_UI.yml +++ b/.github/workflows/deploy_MainNet_UI.yml @@ -48,13 +48,14 @@ jobs: VUE_APP_WALLET_ADDRESSES_HARD_STOP=100 VUE_APP_WALLET_ADDRESS_PER_CALL=20 VUE_APP_PEGOUT_MIN_AMOUNT_ALLOWED_IN_RBTC=0.004 - VUE_APP_PEGOUT_MAX_AMOUNT_ALLOWED_IN_RBTC=10 VUE_APP_PEGIN_MIN_AMOUNT_ALLOWED_IN_BTC=0.005 - VUE_APP_PEGIN_MAX_AMOUNT_ALLOWED_IN_BTC=10 VUE_APP_FAST_MINING_BLOCK=1 VUE_APP_AVERAGE_MINING_BLOCK=3 VUE_APP_SLOW_MINING_BLOCK=5 VUE_APP_LBC_ADDRESS='0xAA9cAf1e3967600578727F975F283446A3Da6612' + VUE_APP_FLYOVER_PEGOUT_QUOTE_DIFF_PERCENTAGE=2 + VUE_APP_RECAPTCHA_NEW_TOKEN_TIME=30 + VUE_APP_FLYOVER_PROVIDER_ID=2 npm run-script build - name: Configure AWS credentials diff --git a/.github/workflows/deploy_TestNet_UI.yml b/.github/workflows/deploy_TestNet_UI.yml index 17cd31905..95804c7eb 100644 --- a/.github/workflows/deploy_TestNet_UI.yml +++ b/.github/workflows/deploy_TestNet_UI.yml @@ -48,13 +48,14 @@ jobs: VUE_APP_WALLET_ADDRESSES_HARD_STOP=100 VUE_APP_WALLET_ADDRESS_PER_CALL=20 VUE_APP_PEGOUT_MIN_AMOUNT_ALLOWED_IN_RBTC=0.004 - VUE_APP_PEGOUT_MAX_AMOUNT_ALLOWED_IN_RBTC=10 VUE_APP_PEGIN_MIN_AMOUNT_ALLOWED_IN_BTC=0.005 - VUE_APP_PEGIN_MAX_AMOUNT_ALLOWED_IN_BTC=10 VUE_APP_FAST_MINING_BLOCK=1 VUE_APP_AVERAGE_MINING_BLOCK=3 VUE_APP_SLOW_MINING_BLOCK=5 VUE_APP_LBC_ADDRESS='0xc2A630c053D12D63d32b025082f6Ba268db18300' + VUE_APP_FLYOVER_PEGOUT_QUOTE_DIFF_PERCENTAGE=2 + VUE_APP_RECAPTCHA_NEW_TOKEN_TIME=30 + VUE_APP_FLYOVER_PROVIDER_ID=2 npm run-script build - name: Configure AWS credentials diff --git a/.github/workflows/deploy_staging_MainNet_UI.yml b/.github/workflows/deploy_staging_MainNet_UI.yml index a56c55bc1..d3327aca6 100644 --- a/.github/workflows/deploy_staging_MainNet_UI.yml +++ b/.github/workflows/deploy_staging_MainNet_UI.yml @@ -48,13 +48,14 @@ jobs: VUE_APP_WALLET_ADDRESSES_HARD_STOP=100 VUE_APP_WALLET_ADDRESS_PER_CALL=20 VUE_APP_PEGOUT_MIN_AMOUNT_ALLOWED_IN_RBTC=0.004 - VUE_APP_PEGOUT_MAX_AMOUNT_ALLOWED_IN_RBTC=10 VUE_APP_PEGIN_MIN_AMOUNT_ALLOWED_IN_BTC=0.005 - VUE_APP_PEGIN_MAX_AMOUNT_ALLOWED_IN_BTC=10 VUE_APP_FAST_MINING_BLOCK=1 VUE_APP_AVERAGE_MINING_BLOCK=3 VUE_APP_SLOW_MINING_BLOCK=5 VUE_APP_LBC_ADDRESS='0xAA9cAf1e3967600578727F975F283446A3Da6612' + VUE_APP_FLYOVER_PEGOUT_QUOTE_DIFF_PERCENTAGE=2 + VUE_APP_RECAPTCHA_NEW_TOKEN_TIME=30 + VUE_APP_FLYOVER_PROVIDER_ID=2 npm run-script build - name: Configure AWS credentials diff --git a/.github/workflows/deploy_staging_TestNet_UI.yml b/.github/workflows/deploy_staging_TestNet_UI.yml index 5d5fdb5e3..b92a88bee 100644 --- a/.github/workflows/deploy_staging_TestNet_UI.yml +++ b/.github/workflows/deploy_staging_TestNet_UI.yml @@ -48,13 +48,14 @@ jobs: VUE_APP_WALLET_ADDRESSES_HARD_STOP=100 VUE_APP_WALLET_ADDRESS_PER_CALL=20 VUE_APP_PEGOUT_MIN_AMOUNT_ALLOWED_IN_RBTC=0.004 - VUE_APP_PEGOUT_MAX_AMOUNT_ALLOWED_IN_RBTC=10 VUE_APP_PEGIN_MIN_AMOUNT_ALLOWED_IN_BTC=0.005 - VUE_APP_PEGIN_MAX_AMOUNT_ALLOWED_IN_BTC=10 VUE_APP_FAST_MINING_BLOCK=1 VUE_APP_AVERAGE_MINING_BLOCK=3 VUE_APP_SLOW_MINING_BLOCK=5 VUE_APP_LBC_ADDRESS='0xc2A630c053D12D63d32b025082f6Ba268db18300' + VUE_APP_FLYOVER_PEGOUT_QUOTE_DIFF_PERCENTAGE=20 + VUE_APP_RECAPTCHA_NEW_TOKEN_TIME=30 + VUE_APP_FLYOVER_PROVIDER_ID=2 npm run-script build - name: Configure AWS credentials diff --git a/ENV_VARIABLES.md b/ENV_VARIABLES.md index ba7e097a8..3f6bf5205 100644 --- a/ENV_VARIABLES.md +++ b/ENV_VARIABLES.md @@ -14,15 +14,16 @@ The value of these variables are used in **environment-variables.ts** file. |VUE_APP_WALLET_ADDRESSES_HARD_STOP | `100` | Maximum number of addresses derived from wallet | |VUE_APP_WALLET_ADDRESS_PER_CALL | `5` | Number of addresses obtained per derivation call | |VUE_APP_PEGOUT_MIN_AMOUNT_ALLOWED_IN_RBTC | `0.004` | 0,004 Minimum allowed value for a PEGOUT transaction | -|VUE_APP_PEGOUT_MAX_AMOUNT_ALLOWED_IN_RBTC | `10` | 10 Maximum allowed value for a PEGOUT transaction | |VUE_APP_PEGIN_MIN_AMOUNT_ALLOWED_IN_BTC | `0.005` | Minimum allowed value for a PEGIN transaction | -|VUE_APP_PEGIN_MAX_AMOUNT_ALLOWED_IN_BTC | `10` | Maximum allowed value for a PEGIN transaction | |VUE_APP_BURN_DUST_VALUE | `30000` | Max value to burn in the tx fee | |VUE_APP_MIN_FEE_SAT_PER_BYTE_FAST | `8` | Min fee rate (sats/byte) required to broadcast the transaction | |VUE_APP_MIN_FEE_SAT_PER_BYTE_AVG | `4` | Min fee rate (sats/byte) required to broadcast the transaction | |VUE_APP_MIN_FEE_SAT_PER_BYTE_SLOW | `1` | Min fee rate (sats/byte) required to broadcast the transaction | |VUE_APP_LBC_ADDRESS | `0xc2A630c053D12D63d32b025082f6Ba268db18300` | Liquidity bridge contract address on the flyover protocol | |VUE_APP_DEBUG_MODE | `false` | enable developer messages for debuging | +|VUE_APP_FLYOVER_PEGOUT_QUOTE_DIFF_PERCENTAGE | `2` | Defines quote difference percentage to 2% so it requieres the user to review condition only for a difference bigger that this percentage | +|VUE_APP_RECAPTCHA_NEW_TOKEN_TIME | `30` | Specifies the time (in seconds) to temporarily disable the flyover between new transactions. This accounts for the time required by Google reCAPTCHA to regenerate a challenge token | +|VUE_APP_FLYOVER_PROVIDER_ID | `1` | Sets up the provider id to be use for flyover status search. | ## Example for .env.local.test file @@ -38,11 +39,11 @@ VUE_APP_RSK_EXPLORER=https://explorer.testnet.rootstock.io/ VUE_APP_WALLET_ADDRESSES_HARD_STOP=100 VUE_APP_WALLET_ADDRESS_PER_CALL=5 VUE_APP_PEGOUT_MIN_AMOUNT_ALLOWED_IN_RBTC=0.005 -VUE_APP_PEGOUT_MAX_AMOUNT_ALLOWED_IN_RBTC=10 VUE_APP_BURN_DUST_VALUE=30000 VUE_APP_MIN_FEE_SAT_PER_BYTE_FAST=8 VUE_APP_MIN_FEE_SAT_PER_BYTE_AVG=4 VUE_APP_MIN_FEE_SAT_PER_BYTE_SLOW=1 VUE_APP_LBC_ADDRESS='0xc2A630c053D12D63d32b025082f6Ba268db18300' VUE_APP_DEBUG_MODE='false' +VUE_APP_FLYOVER_PEGOUT_QUOTE_DIFF_PERCENTAGE=2 ``` diff --git a/README.md b/README.md index 4aef3b2d9..7276fd8dc 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=rsksmart_2wp-app&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=rsksmart_2wp-app) +[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/9697/badge)](https://www.bestpractices.dev/projects/9697) [![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/rsksmart/2wp-app/badge)](https://scorecard.dev/viewer/?uri=github.com/rsksmart/2wp-app) diff --git a/babel.config.js b/babel.config.js index 757ff9b16..bd319281c 100644 --- a/babel.config.js +++ b/babel.config.js @@ -2,4 +2,5 @@ module.exports = { presets: [ '@vue/cli-plugin-babel/preset', ], + plugins: ['@babel/plugin-transform-private-methods'], }; diff --git a/jest.config.js b/jest.config.js index 86f530e0a..10a02b966 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,4 +1,8 @@ module.exports = { + transform: { + '^.+\\.vue$': '@vue/vue3-jest', + '^.+\\.(mts|mjs|jsx|ts|tsx)$': 'ts-jest', + }, preset: '@vue/cli-plugin-unit-jest/presets/typescript-and-babel', collectCoverage: true, collectCoverageFrom: ['src/(common|pegin)/(providers|services|utils)/*.ts'], @@ -13,4 +17,5 @@ module.exports = { coverageProvider: 'v8', transformIgnorePatterns: ['node_modules/(?!axios)/'], setupFilesAfterEnv: ['/setup-jest.js'], + silent: true, }; diff --git a/package-lock.json b/package-lock.json index 4a019e9da..83a9d005b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,6 +8,7 @@ "name": "PowPeg", "version": "2.3.0", "dependencies": { + "@enkryptcom/types": "^0.0.5", "@leather.io/rpc": "^2.0.2", "@ledgerhq/devices": "6.27.1", "@ledgerhq/hw-app-btc": "6.27.1", @@ -15,11 +16,11 @@ "@ledgerhq/hw-transport-webusb": "6.27.1", "@mdi/font": "^7.2.96", "@mdi/js": "^6.9.96", - "@rsksmart/bridges-core-sdk": "^0.3.3", - "@rsksmart/flyover-sdk": "^1.5.2", - "@rsksmart/rlogin": "^1.5.3-beta.1", + "@rsksmart/bridges-core-sdk": "^0.4.1", + "@rsksmart/flyover-sdk": "^1.6.2", + "@rsksmart/rlogin": "^1.6.1", "@rsksmart/rlogin-ledger-provider": "^1.0.4", - "@rsksmart/rlogin-trezor-provider": "^1.0.3", + "@rsksmart/rlogin-trezor-provider": "^1.0.4", "@rsksmart/rsk-precompiled-abis": "^6.0.0-ARROWHEAD", "@rsksmart/rsk-utils": "^1.1.0", "@stacks/connect": "^7.7.1", @@ -31,7 +32,7 @@ "@types/trezor-connect": "^7.0.0", "@walletconnect/web3-provider": "^1.7.1", "assert": "^2.0.0", - "axios": "^1.6.3", + "axios": "^1.7.7", "big.js": "^6.2.1", "bip32": "^4.0.0", "bitcoinjs-lib": "^5.2.0", @@ -47,6 +48,7 @@ "moment": "^2.29.4", "os-browserify": "^0.3.0", "process": "^0.11.10", + "sats-connect": "2.3.x", "stream-browserify": "^3.0.0", "stream-http": "^3.2.0", "text-encoding": "^0.7.0", @@ -61,6 +63,7 @@ "web3-eth-contract": "^1.10.0" }, "devDependencies": { + "@babel/plugin-transform-private-methods": "^7.25.9", "@intlify/vue-i18n-loader": "^4.2.0", "@ledgerhq/hw-transport-mocker": "^6.28.5", "@mdi/font": "^7.2.96", @@ -143,12 +146,13 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.23.4", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.23.4.tgz", - "integrity": "sha512-r1IONyb6Ia+jYR2vvIDhdWdlTGhqbBoFqLTQidzZ4kepUFH15ejXvFHxCVbtl7BOXIudsIubf4E81xeA3h3IXA==", + "version": "7.26.2", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz", + "integrity": "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==", "dependencies": { - "@babel/highlight": "^7.23.4", - "chalk": "^2.4.2" + "@babel/helper-validator-identifier": "^7.25.9", + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" }, "engines": { "node": ">=6.9.0" @@ -190,24 +194,26 @@ } }, "node_modules/@babel/generator": { - "version": "7.23.4", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.4.tgz", - "integrity": "sha512-esuS49Cga3HcThFNebGhlgsrVLkvhqvYDTzgjfFFlHJcIfLe5jFmRRfCQ1KuBfc4Jrtn3ndLgKWAKjBE+IraYQ==", + "version": "7.26.3", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.26.3.tgz", + "integrity": "sha512-6FF/urZvD0sTeO7k6/B15pMLC4CHUv1426lzr3N01aHJTl046uCAh9LXW/fzeXXjPNCJ6iABW5XaWOsIZB93aQ==", "dependencies": { - "@babel/types": "^7.23.4", - "@jridgewell/gen-mapping": "^0.3.2", - "@jridgewell/trace-mapping": "^0.3.17", - "jsesc": "^2.5.1" + "@babel/parser": "^7.26.3", + "@babel/types": "^7.26.3", + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25", + "jsesc": "^3.0.2" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-annotate-as-pure": { - "version": "7.22.5", - "license": "MIT", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.25.9.tgz", + "integrity": "sha512-gv7320KBUFJz1RnylIg5WWYPRXKZ884AGkYpgpWW02TH66Dl+HaC1t1CKd0z3R4b6hdYEcmrNZHUmfCP+1u3/g==", "dependencies": { - "@babel/types": "^7.22.5" + "@babel/types": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -238,18 +244,16 @@ } }, "node_modules/@babel/helper-create-class-features-plugin": { - "version": "7.24.5", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.24.5.tgz", - "integrity": "sha512-uRc4Cv8UQWnE4NXlYTIIdM7wfFkOqlFztcC/gVXDKohKoVB3OyonfelUBaJzSwpBntZ2KYGF/9S7asCHsXwW6g==", - "dependencies": { - "@babel/helper-annotate-as-pure": "^7.22.5", - "@babel/helper-environment-visitor": "^7.22.20", - "@babel/helper-function-name": "^7.23.0", - "@babel/helper-member-expression-to-functions": "^7.24.5", - "@babel/helper-optimise-call-expression": "^7.22.5", - "@babel/helper-replace-supers": "^7.24.1", - "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5", - "@babel/helper-split-export-declaration": "^7.24.5", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.25.9.tgz", + "integrity": "sha512-UTZQMvt0d/rSz6KI+qdu7GQze5TIajwTS++GUozlw8VBJDEOAqSXwm1WvmYEZwqdqSGQshRocPDqrt4HBZB3fQ==", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.25.9", + "@babel/helper-member-expression-to-functions": "^7.25.9", + "@babel/helper-optimise-call-expression": "^7.25.9", + "@babel/helper-replace-supers": "^7.25.9", + "@babel/helper-skip-transparent-expression-wrappers": "^7.25.9", + "@babel/traverse": "^7.25.9", "semver": "^6.3.1" }, "engines": { @@ -319,37 +323,37 @@ } }, "node_modules/@babel/helper-member-expression-to-functions": { - "version": "7.24.5", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.24.5.tgz", - "integrity": "sha512-4owRteeihKWKamtqg4JmWSsEZU445xpFRXPEwp44HbgbxdWlUV1b4Agg4lkA806Lil5XM/e+FJyS0vj5T6vmcA==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.25.9.tgz", + "integrity": "sha512-wbfdZ9w5vk0C0oyHqAJbc62+vet5prjj01jjJ8sKn3j9h3MQQlflEdXYvuqRWjHnM12coDEqiC1IRCi0U/EKwQ==", "dependencies": { - "@babel/types": "^7.24.5" + "@babel/traverse": "^7.25.9", + "@babel/types": "^7.25.9" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-imports": { - "version": "7.24.3", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.24.3.tgz", - "integrity": "sha512-viKb0F9f2s0BCS22QSF308z/+1YWKV/76mwt61NBzS5izMzDPwdq1pTrzf+Li3npBWX9KdQbkeCt1jSAM7lZqg==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.25.9.tgz", + "integrity": "sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw==", "dependencies": { - "@babel/types": "^7.24.0" + "@babel/traverse": "^7.25.9", + "@babel/types": "^7.25.9" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.24.5", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.24.5.tgz", - "integrity": "sha512-9GxeY8c2d2mdQUP1Dye0ks3VDyIMS98kt/llQ2nUId8IsWqTF0l1LkSX0/uP7l7MCDrzXS009Hyhe2gzTiGW8A==", + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.26.0.tgz", + "integrity": "sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw==", "dependencies": { - "@babel/helper-environment-visitor": "^7.22.20", - "@babel/helper-module-imports": "^7.24.3", - "@babel/helper-simple-access": "^7.24.5", - "@babel/helper-split-export-declaration": "^7.24.5", - "@babel/helper-validator-identifier": "^7.24.5" + "@babel/helper-module-imports": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9", + "@babel/traverse": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -359,19 +363,20 @@ } }, "node_modules/@babel/helper-optimise-call-expression": { - "version": "7.22.5", - "license": "MIT", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.25.9.tgz", + "integrity": "sha512-FIpuNaz5ow8VyrYcnXQTDRGvV6tTjkNtCK/RYNDXGSLlUD6cBuQTSw43CShGxjvfBTfcUA/r6UhUCbtYqkhcuQ==", "dependencies": { - "@babel/types": "^7.22.5" + "@babel/types": "^7.25.9" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-plugin-utils": { - "version": "7.24.5", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.5.tgz", - "integrity": "sha512-xjNLDopRzW2o6ba0gKbkZq5YWEBaK3PCyTOY1K2P/O07LGMhMqlMXPxwN4S5/RhWuCobT8z0jrlKGlYmeR1OhQ==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.25.9.tgz", + "integrity": "sha512-kSMlyUVdWe25rEsRGviIgOWnoT/nfABVWlqt9N19/dIPWViAOW2s9wznP5tURbs/IDuNk4gPy3YdYRgH3uxhBw==", "engines": { "node": ">=6.9.0" } @@ -392,13 +397,13 @@ } }, "node_modules/@babel/helper-replace-supers": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.24.1.tgz", - "integrity": "sha512-QCR1UqC9BzG5vZl8BMicmZ28RuUBnHhAMddD8yHFHDRH9lLTZ9uUPehX8ctVPT8l0TKblJidqcgUUKGVrePleQ==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.25.9.tgz", + "integrity": "sha512-IiDqTOTBQy0sWyeXyGSC5TBJpGFXBkRynjBeXsvbhQFKj2viwJC76Epz35YLU1fpe/Am6Vppb7W7zM4fPQzLsQ==", "dependencies": { - "@babel/helper-environment-visitor": "^7.22.20", - "@babel/helper-member-expression-to-functions": "^7.23.0", - "@babel/helper-optimise-call-expression": "^7.22.5" + "@babel/helper-member-expression-to-functions": "^7.25.9", + "@babel/helper-optimise-call-expression": "^7.25.9", + "@babel/traverse": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -407,22 +412,13 @@ "@babel/core": "^7.0.0" } }, - "node_modules/@babel/helper-simple-access": { - "version": "7.24.5", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.24.5.tgz", - "integrity": "sha512-uH3Hmf5q5n7n8mz7arjUlDOCbttY/DW4DYhE6FUsjKJ/oYC1kQQUvwEQWxRwUpX9qQKRXeqLwWxrqilMrf32sQ==", - "dependencies": { - "@babel/types": "^7.24.5" - }, - "engines": { - "node": ">=6.9.0" - } - }, "node_modules/@babel/helper-skip-transparent-expression-wrappers": { - "version": "7.22.5", - "license": "MIT", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.25.9.tgz", + "integrity": "sha512-K4Du3BFa3gvyhzgPcntrkDgZzQaq6uozzcpGbOO1OEJaI+EJdqWIMTLgFgQf6lrfiDFo5FU+BxKepI9RmZqahA==", "dependencies": { - "@babel/types": "^7.22.5" + "@babel/traverse": "^7.25.9", + "@babel/types": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -440,25 +436,25 @@ } }, "node_modules/@babel/helper-string-parser": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.1.tgz", - "integrity": "sha512-2ofRCjnnA9y+wk8b9IAREroeUP02KHp431N2mhKniy2yKIDKpbrHv9eXwm8cBeWQYcJmzv5qKCu65P47eCF7CQ==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz", + "integrity": "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.24.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.5.tgz", - "integrity": "sha512-3q93SSKX2TWCG30M2G2kwaKeTYgEUp5Snjuj8qm729SObL6nbtUldAi37qbxkD5gg3xnBio+f9nqpSepGZMvxA==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", + "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-option": { - "version": "7.23.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.23.5.tgz", - "integrity": "sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.25.9.tgz", + "integrity": "sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw==", "engines": { "node": ">=6.9.0" } @@ -501,9 +497,12 @@ } }, "node_modules/@babel/parser": { - "version": "7.23.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.4.tgz", - "integrity": "sha512-vf3Xna6UEprW+7t6EtOmFpHNAuxw3xqPZghy+brsnusscJRW5BMUzzHZc5ICjULee81WeUV2jjakG09MDglJXQ==", + "version": "7.26.3", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.3.tgz", + "integrity": "sha512-WJ/CvmY8Mea8iDXo6a7RK2wbmJITT5fN3BEkRuFlxVyNx8jOKIIhmC4fSkTcPcf8JyavbBwIe6OpiCOBXt/IcA==", + "dependencies": { + "@babel/types": "^7.26.3" + }, "bin": { "parser": "bin/babel-parser.js" }, @@ -875,11 +874,11 @@ } }, "node_modules/@babel/plugin-syntax-jsx": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.24.1.tgz", - "integrity": "sha512-2eCtxZXf+kbkMIsXS4poTvT4Yu5rXiRa+9xGVT56raghjmBTKMpFNc9R4IDiB4emao9eO22Ox7CxuJG7BgExqA==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.25.9.tgz", + "integrity": "sha512-ld6oezHQMZsZfp6pWtbjaNDF2tiiCYYDqQszHt5VV437lewP9aSi2Of99CK0D0XB21k7FLgnLcmQKyKzynfeAA==", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.0" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -975,11 +974,11 @@ } }, "node_modules/@babel/plugin-syntax-typescript": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.24.1.tgz", - "integrity": "sha512-Yhnmvy5HZEnHUty6i++gcfH1/l68AHnItFHnaCv6hn9dNh0hQvvQJsxpi4BMBFN5DLeHBuucT/0DgzXif/OyRw==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.25.9.tgz", + "integrity": "sha512-hjMgRy5hb8uJJjUcdWunWVcoi9bGpJp8p5Ol1229PoN6aytsLwNMgmdftO23wnCLMfVmTwZDWMPNq/D1SY60JQ==", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.0" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1331,13 +1330,12 @@ } }, "node_modules/@babel/plugin-transform-modules-commonjs": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.24.1.tgz", - "integrity": "sha512-szog8fFTUxBfw0b98gEWPaEqF42ZUD/T3bkynW/wtgx2p/XCP55WEsb+VosKceRSd6njipdZvNogqdtI4Q0chw==", + "version": "7.26.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.26.3.tgz", + "integrity": "sha512-MgR55l4q9KddUDITEzEFYn5ZsGDXMSsU9E+kh7fjRXTIC3RHqfCo8RPRbyReYJh44HQ/yomFkqbOFohXvDCiIQ==", "dependencies": { - "@babel/helper-module-transforms": "^7.23.3", - "@babel/helper-plugin-utils": "^7.24.0", - "@babel/helper-simple-access": "^7.22.5" + "@babel/helper-module-transforms": "^7.26.0", + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1506,11 +1504,12 @@ } }, "node_modules/@babel/plugin-transform-private-methods": { - "version": "7.22.5", - "license": "MIT", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.25.9.tgz", + "integrity": "sha512-D/JUozNpQLAPUVusvqMxyvjzllRaF8/nSrP1s2YGQT/W4LHK4xxsMcHjhOGTS01mp9Hda8nswb+FblLdJornQw==", "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.22.5", - "@babel/helper-plugin-utils": "^7.22.5" + "@babel/helper-create-class-features-plugin": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1755,14 +1754,15 @@ } }, "node_modules/@babel/plugin-transform-typescript": { - "version": "7.24.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.24.5.tgz", - "integrity": "sha512-E0VWu/hk83BIFUWnsKZ4D81KXjN5L3MobvevOHErASk9IPwKHOkTgvqzvNo1yP/ePJWqqK2SpUR5z+KQbl6NVw==", + "version": "7.26.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.26.3.tgz", + "integrity": "sha512-6+5hpdr6mETwSKjmJUdYw0EIkATiQhnELWlE3kJFBwSg/BGIVwVaVbX+gOXBCdc7Ln1RXZxyWGecIXhUfnl7oA==", "dependencies": { - "@babel/helper-annotate-as-pure": "^7.22.5", - "@babel/helper-create-class-features-plugin": "^7.24.5", - "@babel/helper-plugin-utils": "^7.24.5", - "@babel/plugin-syntax-typescript": "^7.24.1" + "@babel/helper-annotate-as-pure": "^7.25.9", + "@babel/helper-create-class-features-plugin": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9", + "@babel/helper-skip-transparent-expression-wrappers": "^7.25.9", + "@babel/plugin-syntax-typescript": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1985,15 +1985,15 @@ } }, "node_modules/@babel/preset-typescript": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.24.1.tgz", - "integrity": "sha512-1DBaMmRDpuYQBPWD8Pf/WEwCrtgRHxsZnP4mIy9G/X+hFfbI47Q2G4t1Paakld84+qsk2fSsUPMKg71jkoOOaQ==", + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.26.0.tgz", + "integrity": "sha512-NMk1IGZ5I/oHhoXEElcm+xUnL/szL6xflkFZmoEU9xj1qSJXpiS7rsspYo92B4DRCDvZn2erT5LdsCeXAKNCkg==", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.0", - "@babel/helper-validator-option": "^7.23.5", - "@babel/plugin-syntax-jsx": "^7.24.1", - "@babel/plugin-transform-modules-commonjs": "^7.24.1", - "@babel/plugin-transform-typescript": "^7.24.1" + "@babel/helper-plugin-utils": "^7.25.9", + "@babel/helper-validator-option": "^7.25.9", + "@babel/plugin-syntax-jsx": "^7.25.9", + "@babel/plugin-transform-modules-commonjs": "^7.25.9", + "@babel/plugin-transform-typescript": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -2140,32 +2140,29 @@ } }, "node_modules/@babel/template": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz", - "integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.9.tgz", + "integrity": "sha512-9DGttpmPvIxBb/2uwpVo3dqJ+O6RooAFOS+lB+xDqoE2PVCE8nfoHMdZLpfCQRLwvohzXISPZcgxt80xLfsuwg==", "dependencies": { - "@babel/code-frame": "^7.22.13", - "@babel/parser": "^7.22.15", - "@babel/types": "^7.22.15" + "@babel/code-frame": "^7.25.9", + "@babel/parser": "^7.25.9", + "@babel/types": "^7.25.9" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.23.4", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.4.tgz", - "integrity": "sha512-IYM8wSUwunWTB6tFC2dkKZhxbIjHoWemdK+3f8/wq8aKhbUscxD5MX72ubd90fxvFknaLPeGw5ycU84V1obHJg==", - "dependencies": { - "@babel/code-frame": "^7.23.4", - "@babel/generator": "^7.23.4", - "@babel/helper-environment-visitor": "^7.22.20", - "@babel/helper-function-name": "^7.23.0", - "@babel/helper-hoist-variables": "^7.22.5", - "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/parser": "^7.23.4", - "@babel/types": "^7.23.4", - "debug": "^4.1.0", + "version": "7.26.4", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.26.4.tgz", + "integrity": "sha512-fH+b7Y4p3yqvApJALCPJcwb0/XaOSgtK4pzV6WVjPR5GLFQBRI7pfoX2V2iM48NXvX07NUxxm1Vw98YjqTcU5w==", + "dependencies": { + "@babel/code-frame": "^7.26.2", + "@babel/generator": "^7.26.3", + "@babel/parser": "^7.26.3", + "@babel/template": "^7.25.9", + "@babel/types": "^7.26.3", + "debug": "^4.3.1", "globals": "^11.1.0" }, "engines": { @@ -2173,13 +2170,12 @@ } }, "node_modules/@babel/types": { - "version": "7.24.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.5.tgz", - "integrity": "sha512-6mQNsaLeXTw0nxYUYu+NSa4Hx4BlF1x1x8/PMFbiR+GBSr+2DkECc69b8hgy2frEodNcvPffeH8YfWd3LI6jhQ==", + "version": "7.26.3", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.3.tgz", + "integrity": "sha512-vN5p+1kl59GVKMvTHt55NzzmYVxprfJD+ql7U9NFIfKCBkYE55LYtS+WtPlaYOyzydrKI8Nezd+aZextrd+FMA==", "dependencies": { - "@babel/helper-string-parser": "^7.24.1", - "@babel/helper-validator-identifier": "^7.24.5", - "to-fast-properties": "^2.0.0" + "@babel/helper-string-parser": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -2271,23 +2267,27 @@ } }, "node_modules/@emotion/is-prop-valid": { - "version": "1.2.1", - "license": "MIT", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-1.3.1.tgz", + "integrity": "sha512-/ACwoqx7XQi9knQs/G0qKvv5teDMhD7bXYns9N/wM8ah8iNb8jZ2uNO0YOgiq2o2poIvVtJS2YALasQuMSQ7Kw==", "dependencies": { - "@emotion/memoize": "^0.8.1" + "@emotion/memoize": "^0.9.0" } }, "node_modules/@emotion/memoize": { - "version": "0.8.1", - "license": "MIT" + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.9.0.tgz", + "integrity": "sha512-30FAj7/EoJ5mwVPOWhAyCX+FPfMDrVecJAM+Iw9NRoSl4BBAQeqj4cApHHUXOVvIPgLVDsCFoz/hGD+5QQD1GQ==" }, "node_modules/@emotion/stylis": { "version": "0.8.5", - "license": "MIT" + "resolved": "https://registry.npmjs.org/@emotion/stylis/-/stylis-0.8.5.tgz", + "integrity": "sha512-h6KtPihKFn3T9fuIrwvXXUOwlx3rfUvfZIcP5a6rh8Y7zjE3O06hT5Ss4S/YI1AYhuZ1kjaE/5EaOOI2NqSylQ==" }, "node_modules/@emotion/unitless": { "version": "0.7.5", - "license": "MIT" + "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.7.5.tgz", + "integrity": "sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg==" }, "node_modules/@emurgo/cardano-serialization-lib-browser": { "version": "11.5.0", @@ -2299,6 +2299,14 @@ "resolved": "https://registry.npmjs.org/@emurgo/cardano-serialization-lib-nodejs/-/cardano-serialization-lib-nodejs-11.5.0.tgz", "integrity": "sha512-IlVABlRgo9XaTR1NunwZpWcxnfEv04ba2l1vkUz4S1W7Jt36F4CtffP+jPeqBZGnAe+fnUwo0XjIJC3ZTNToNQ==" }, + "node_modules/@enkryptcom/types": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/@enkryptcom/types/-/types-0.0.5.tgz", + "integrity": "sha512-GzSq2pu7LO1iuAcKFUORd+SyGm3907/ZHupAn/49sRbLXfJZ3HzTY65jeHG/EWPL4lyv2xyuhy7JEpo+x0tIUQ==", + "engines": { + "node": ">=14.15.0" + } + }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.0", "dev": true, @@ -2374,11 +2382,12 @@ } }, "node_modules/@ethereumjs/common": { - "version": "2.6.5", - "license": "MIT", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-3.2.0.tgz", + "integrity": "sha512-pksvzI0VyLgmuEF2FA/JR/4/y6hcPq8OUail3/AvycBaW1d5VSauOZzqGvJ3RTmR4MU35lWE8KseKOsEhrFRBA==", "dependencies": { - "crc-32": "^1.2.0", - "ethereumjs-util": "^7.1.5" + "@ethereumjs/util": "^8.1.0", + "crc-32": "^1.2.0" } }, "node_modules/@ethereumjs/rlp": { @@ -2392,11 +2401,84 @@ } }, "node_modules/@ethereumjs/tx": { - "version": "3.5.2", - "license": "MPL-2.0", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/@ethereumjs/tx/-/tx-4.1.2.tgz", + "integrity": "sha512-PWWyO9lAFOiLwk7nB9OQisoJUsuvMz2PN2v4/ILbBpzamC5Ug79OddVq9r4rKvIDLPY+bn4NFerxBJg29+sjaA==", + "dependencies": { + "@chainsafe/ssz": "^0.11.1", + "@ethereumjs/common": "^3.1.2", + "@ethereumjs/rlp": "^4.0.1", + "@ethereumjs/util": "^8.0.6", + "ethereum-cryptography": "^2.0.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "c-kzg": "^1.0.8" + }, + "peerDependenciesMeta": { + "c-kzg": { + "optional": true + } + } + }, + "node_modules/@ethereumjs/tx/node_modules/@noble/curves": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.4.2.tgz", + "integrity": "sha512-TavHr8qycMChk8UwMld0ZDRvatedkzWfH8IiaeGCfymOP5i0hSCozz9vHOL0nkwk7HRMlFnAiKpS2jrUmSybcw==", + "dependencies": { + "@noble/hashes": "1.4.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@ethereumjs/tx/node_modules/@noble/hashes": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz", + "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==", + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@ethereumjs/tx/node_modules/@scure/bip32": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.4.0.tgz", + "integrity": "sha512-sVUpc0Vq3tXCkDGYVWGIZTRfnvu8LoTDaev7vbwh0omSvVORONr960MQWdKqJDCReIEmTj3PAr73O3aoxz7OPg==", "dependencies": { - "@ethereumjs/common": "^2.6.4", - "ethereumjs-util": "^7.1.5" + "@noble/curves": "~1.4.0", + "@noble/hashes": "~1.4.0", + "@scure/base": "~1.1.6" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@ethereumjs/tx/node_modules/@scure/bip39": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.3.0.tgz", + "integrity": "sha512-disdg7gHuTDZtY+ZdkmLpPCk7fxZSu3gBiEGuoC1XYxv9cGx3Z6cpTggCgW6odSOOIXCiDjuGejW+aJKCY/pIQ==", + "dependencies": { + "@noble/hashes": "~1.4.0", + "@scure/base": "~1.1.6" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@ethereumjs/tx/node_modules/ethereum-cryptography": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-2.2.1.tgz", + "integrity": "sha512-r/W8lkHSiTLxUxW8Rf3u4HGB0xQweG2RyETjywylKZSzLWoWAijRz8WCuOtJ6wah+avllXBqZuk29HCCvhEIRg==", + "dependencies": { + "@noble/curves": "1.4.2", + "@noble/hashes": "1.4.0", + "@scure/bip32": "1.4.0", + "@scure/bip39": "1.3.0" } }, "node_modules/@ethereumjs/util": { @@ -5891,12 +5973,13 @@ } }, "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.3", - "license": "MIT", + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", + "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", "dependencies": { - "@jridgewell/set-array": "^1.0.1", + "@jridgewell/set-array": "^1.2.1", "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/trace-mapping": "^0.3.24" }, "engines": { "node": ">=6.0.0" @@ -5910,8 +5993,9 @@ } }, "node_modules/@jridgewell/set-array": { - "version": "1.1.2", - "license": "MIT", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", "engines": { "node": ">=6.0.0" } @@ -5930,8 +6014,9 @@ "license": "MIT" }, "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.19", - "license": "MIT", + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" @@ -6783,9 +6868,9 @@ } }, "node_modules/@rsksmart/bridges-core-sdk": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@rsksmart/bridges-core-sdk/-/bridges-core-sdk-0.3.3.tgz", - "integrity": "sha512-cc24DhHGhZYPI7Z0EHTYB5KepFNUVk7dbv+nH0rJtMGLSEfLlLCx2yja9vxc+MsLRXnwruD92cnnxklZbuyXyQ==", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@rsksmart/bridges-core-sdk/-/bridges-core-sdk-0.4.1.tgz", + "integrity": "sha512-bLED4LtICzKcvvYgVOnhjY7ncpyg7PZTWq4E+d5FbV6dc6XB9RWTqCis9kvM2p3m1iyVUZXBV1eDVS9FDNUIhw==", "dependencies": { "bech32": "^2.0.0", "bs58check": "^3.0.1", @@ -6822,11 +6907,12 @@ } }, "node_modules/@rsksmart/flyover-sdk": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/@rsksmart/flyover-sdk/-/flyover-sdk-1.5.2.tgz", - "integrity": "sha512-0tIO8fYFkk8JgO2G6f2JShX0qRJJ2VigvBuZL51VtRvHRmQWScW15y48lZskQ+MGXxGqXvA5mn0RD568yNAK+w==", + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/@rsksmart/flyover-sdk/-/flyover-sdk-1.6.2.tgz", + "integrity": "sha512-d1vo9rU9Mnd526vCXhM8plakmghO/5BgWth3sRZnYC9cyauofFZeSSiRFdm7UvBJU5Xtiv6QZ8o8mzNjQRIkrg==", "dependencies": { - "@rsksmart/bridges-core-sdk": "^0.3.3", + "@rsksmart/bridges-core-sdk": "^0.4.1", + "bitcoinjs-lib": "^6.1.6", "qrcode": "^1.5.1" } }, @@ -6844,6 +6930,49 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/@rsksmart/flyover-sdk/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/@rsksmart/flyover-sdk/node_modules/bech32": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/bech32/-/bech32-2.0.0.tgz", + "integrity": "sha512-LcknSilhIGatDAsY1ak2I8VtGaHNhgMSYVxFrGLXv+xLHytaKZKcaUJJUE7qmBr7h33o5YQwP55pMI0xmkpJwg==" + }, + "node_modules/@rsksmart/flyover-sdk/node_modules/bitcoinjs-lib": { + "version": "6.1.6", + "resolved": "https://registry.npmjs.org/bitcoinjs-lib/-/bitcoinjs-lib-6.1.6.tgz", + "integrity": "sha512-Fk8+Vc+e2rMoDU5gXkW9tD+313rhkm5h6N9HfZxXvYU9LedttVvmXKTgd9k5rsQJjkSfsv6XRM8uhJv94SrvcA==", + "dependencies": { + "@noble/hashes": "^1.2.0", + "bech32": "^2.0.0", + "bip174": "^2.1.1", + "bs58check": "^3.0.1", + "typeforce": "^1.11.3", + "varuint-bitcoin": "^1.1.2" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/@rsksmart/flyover-sdk/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/@rsksmart/flyover-sdk/node_modules/bs58check": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/bs58check/-/bs58check-3.0.1.tgz", + "integrity": "sha512-hjuuJvoWEybo7Hn/0xOrczQKKEKD63WguEjlhLExYs2wUBcebDC1jDNK17eEAD2lYfw82d5ASC1d7K3SWszjaQ==", + "dependencies": { + "@noble/hashes": "^1.2.0", + "bs58": "^5.0.0" + } + }, "node_modules/@rsksmart/flyover-sdk/node_modules/camelcase": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", @@ -6887,12 +7016,11 @@ } }, "node_modules/@rsksmart/flyover-sdk/node_modules/qrcode": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/qrcode/-/qrcode-1.5.3.tgz", - "integrity": "sha512-puyri6ApkEHYiVl4CFzo1tDkAZ+ATcnbJrJ6RiBM1Fhctdn/ix9MTE3hRph33omisEbC/2fcfemsseiKgBPKZg==", + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/qrcode/-/qrcode-1.5.4.tgz", + "integrity": "sha512-1ca71Zgiu6ORjHqFBDpnSMTR2ReToX4l1Au1VFLyVeBTFavzQnv5JxMFr3ukHVKpSrSA2MCk0lNJSykjUfz7Zg==", "dependencies": { "dijkstrajs": "^1.0.1", - "encode-utf8": "^1.0.3", "pngjs": "^5.0.0", "yargs": "^15.3.1" }, @@ -6966,25 +7094,28 @@ } }, "node_modules/@rsksmart/rlogin": { - "version": "1.5.3-beta.2", - "resolved": "https://registry.npmjs.org/@rsksmart/rlogin/-/rlogin-1.5.3-beta.2.tgz", - "integrity": "sha512-s/sRzOCGXujCbCQicq64iocEKTp9P3RrRqhxSQpx8eKIP2tAcqhgdWGsfpTp42iy5xgIZ7H/jma3Q0tz609Dtw==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@rsksmart/rlogin/-/rlogin-1.6.1.tgz", + "integrity": "sha512-jy4HQtEY7FSZ4YqS3oD9O2KyxB5NYzqyylOdiNUoh/KnHaBZB5K4vqG9fuK937moJgnjnpj9u1d6R8IXFy/14Q==", "dependencies": { "@rsksmart/ipfs-cpinner-client-types": "^0.1.3", "@rsksmart/mock-web3-provider": "^1.0.1", - "@rsksmart/rlogin-dpath": "^1.0.1", - "@rsksmart/vc-json-schemas-parser": "^1.0.0", - "@types/styled-components": "^5.1.3", - "assert": "^2.0.0", - "axios": "^0.21.1", + "@rsksmart/rlogin-dpath": "^1.0.3", + "@rsksmart/vc-json-schemas-parser": "^1.0.1", + "@types/styled-components": "5.1.30", + "assert": "^2.1.0", + "axios": "^1.7.7", + "bignumber.js": "^9.1.2", "buffer": "^6.0.3", - "ethr-did-resolver": "^3.0.2", + "did-resolver": "^4.1.0", + "ethr-did-resolver": "^10.1.5", "i18next": "^20.3.5", "i18next-browser-languagedetector": "^6.1.2", "react-i18next": "^11.11.4", "stream-browserify": "^3.0.0", - "web3-eth-personal": "^1.3.0", - "web3modal": "^1.9.1" + "styled-components": "^5.3.11", + "web3-utils": "^1.5.3", + "web3modal": "1.9.5" } }, "node_modules/@rsksmart/rlogin-dpath": { @@ -7023,38 +7154,6 @@ "url": "^0.11.3" } }, - "node_modules/@rsksmart/rlogin-ledger-provider/node_modules/@ethereumjs/common": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-3.2.0.tgz", - "integrity": "sha512-pksvzI0VyLgmuEF2FA/JR/4/y6hcPq8OUail3/AvycBaW1d5VSauOZzqGvJ3RTmR4MU35lWE8KseKOsEhrFRBA==", - "dependencies": { - "@ethereumjs/util": "^8.1.0", - "crc-32": "^1.2.0" - } - }, - "node_modules/@rsksmart/rlogin-ledger-provider/node_modules/@ethereumjs/tx": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/@ethereumjs/tx/-/tx-4.1.2.tgz", - "integrity": "sha512-PWWyO9lAFOiLwk7nB9OQisoJUsuvMz2PN2v4/ILbBpzamC5Ug79OddVq9r4rKvIDLPY+bn4NFerxBJg29+sjaA==", - "dependencies": { - "@chainsafe/ssz": "^0.11.1", - "@ethereumjs/common": "^3.1.2", - "@ethereumjs/rlp": "^4.0.1", - "@ethereumjs/util": "^8.0.6", - "ethereum-cryptography": "^2.0.0" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "c-kzg": "^1.0.8" - }, - "peerDependenciesMeta": { - "c-kzg": { - "optional": true - } - } - }, "node_modules/@rsksmart/rlogin-ledger-provider/node_modules/@ledgerhq/devices": { "version": "8.4.4", "resolved": "https://registry.npmjs.org/@ledgerhq/devices/-/devices-8.4.4.tgz", @@ -7088,64 +7187,6 @@ "@ledgerhq/logs": "^6.12.0" } }, - "node_modules/@rsksmart/rlogin-ledger-provider/node_modules/@noble/curves": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.4.2.tgz", - "integrity": "sha512-TavHr8qycMChk8UwMld0ZDRvatedkzWfH8IiaeGCfymOP5i0hSCozz9vHOL0nkwk7HRMlFnAiKpS2jrUmSybcw==", - "dependencies": { - "@noble/hashes": "1.4.0" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@rsksmart/rlogin-ledger-provider/node_modules/@noble/hashes": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz", - "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==", - "engines": { - "node": ">= 16" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@rsksmart/rlogin-ledger-provider/node_modules/@scure/bip32": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.4.0.tgz", - "integrity": "sha512-sVUpc0Vq3tXCkDGYVWGIZTRfnvu8LoTDaev7vbwh0omSvVORONr960MQWdKqJDCReIEmTj3PAr73O3aoxz7OPg==", - "dependencies": { - "@noble/curves": "~1.4.0", - "@noble/hashes": "~1.4.0", - "@scure/base": "~1.1.6" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@rsksmart/rlogin-ledger-provider/node_modules/@scure/bip39": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.3.0.tgz", - "integrity": "sha512-disdg7gHuTDZtY+ZdkmLpPCk7fxZSu3gBiEGuoC1XYxv9cGx3Z6cpTggCgW6odSOOIXCiDjuGejW+aJKCY/pIQ==", - "dependencies": { - "@noble/hashes": "~1.4.0", - "@scure/base": "~1.1.6" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@rsksmart/rlogin-ledger-provider/node_modules/ethereum-cryptography": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-2.2.1.tgz", - "integrity": "sha512-r/W8lkHSiTLxUxW8Rf3u4HGB0xQweG2RyETjywylKZSzLWoWAijRz8WCuOtJ6wah+avllXBqZuk29HCCvhEIRg==", - "dependencies": { - "@noble/curves": "1.4.2", - "@noble/hashes": "1.4.0", - "@scure/bip32": "1.4.0", - "@scure/bip39": "1.3.0" - } - }, "node_modules/@rsksmart/rlogin-ledger-provider/node_modules/rxjs": { "version": "7.8.1", "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", @@ -7173,26 +7214,18 @@ } }, "node_modules/@rsksmart/rlogin-trezor-provider": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@rsksmart/rlogin-trezor-provider/-/rlogin-trezor-provider-1.0.3.tgz", - "integrity": "sha512-vXU6ebVK2YZzK+s6KxurwEOEr+ypfQ6T+QKFCOXtepuEHd9KsoEh7Aryf8E4IuCNPsU5svikErpki/0lv1dE5A==", - "dependencies": { - "@ethereumjs/tx": "^3.3.0", - "@rsksmart/rlogin-dpath": "^1.0.3", - "@rsksmart/rlogin-eip1193-proxy-subprovider": "^1.0.2", - "@rsksmart/rlogin-transactions": "^1.0.2", - "@trezor/connect-web": "^9.1.3", - "assert": "^2.0.0", - "buffer": "^6.0.3", - "ethjs-provider-http": "^0.1.6", - "stream-browserify": "^3.0.0" - } - }, - "node_modules/@rsksmart/rlogin/node_modules/axios": { - "version": "0.21.4", - "license": "MIT", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@rsksmart/rlogin-trezor-provider/-/rlogin-trezor-provider-1.0.4.tgz", + "integrity": "sha512-O0/lWAXYcYw0DOkVDKPkdIedkldRvzrqEAFOux1YYfybZMjyiqRUIQO5av9K1l7jBspXj6NzAUdm+aT1YNEqOQ==", "dependencies": { - "follow-redirects": "^1.14.0" + "@ethereumjs/tx": "4.1", + "@rsksmart/rlogin-dpath": "^1.0.3", + "@rsksmart/rlogin-eip1193-proxy-subprovider": "^1.0.2", + "@rsksmart/rlogin-transactions": "^1.0.2", + "@trezor/connect-web": "^9.1.9", + "assert": "^2.1.0", + "buffer": "^6.0.3", + "ethjs-provider-http": "^0.1.6" } }, "node_modules/@rsksmart/rsk-precompiled-abis": { @@ -7212,6 +7245,48 @@ "version": "1.0.1", "license": "ISC" }, + "node_modules/@sats-connect/core": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/@sats-connect/core/-/core-0.0.8.tgz", + "integrity": "sha512-vb7drnd8lFfO4ahCzaVAFkX1eHF1J7jheJl2V/JuuJd5f1sy6nHeNzKMp1zmiuql8uNwe0Sx1WrK1I+4tUmDHg==", + "dependencies": { + "axios": "1.7.7", + "bitcoin-address-validation": "2.2.3", + "buffer": "6.0.3", + "jsontokens": "4.0.1", + "lodash.omit": "4.5.0" + } + }, + "node_modules/@sats-connect/core/node_modules/axios": { + "version": "1.7.7", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz", + "integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==", + "dependencies": { + "follow-redirects": "^1.15.6", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, + "node_modules/@sats-connect/core/node_modules/bech32": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/bech32/-/bech32-2.0.0.tgz", + "integrity": "sha512-LcknSilhIGatDAsY1ak2I8VtGaHNhgMSYVxFrGLXv+xLHytaKZKcaUJJUE7qmBr7h33o5YQwP55pMI0xmkpJwg==" + }, + "node_modules/@sats-connect/core/node_modules/bitcoin-address-validation": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/bitcoin-address-validation/-/bitcoin-address-validation-2.2.3.tgz", + "integrity": "sha512-1uGCGl26Ye8JG5qcExtFLQfuib6qEZWNDo1ZlLlwp/z7ygUFby3IxolgEfgMGaC+LG9csbVASLcH8fRLv7DIOg==", + "dependencies": { + "base58-js": "^1.0.0", + "bech32": "^2.0.0", + "sha256-uint8array": "^0.10.3" + } + }, + "node_modules/@sats-connect/ui": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/@sats-connect/ui/-/ui-0.0.6.tgz", + "integrity": "sha512-H3bFFhr9CcY1oNosNi/QJszmMHSht4U19bUWfM3vzayAKgV4ebY6iUnRK5g3p2rVLLWVzlpaw1J9m+7JWwyBfA==" + }, "node_modules/@scure/base": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.6.tgz", @@ -8247,26 +8322,18 @@ }, "node_modules/@types/eslint": { "version": "8.44.2", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "@types/estree": "*", "@types/json-schema": "*" } }, - "node_modules/@types/eslint-scope": { - "version": "3.7.4", - "devOptional": true, - "license": "MIT", - "dependencies": { - "@types/eslint": "*", - "@types/estree": "*" - } - }, "node_modules/@types/estree": { - "version": "1.0.1", - "devOptional": true, - "license": "MIT" + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", + "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", + "devOptional": true }, "node_modules/@types/express": { "version": "4.17.17", @@ -8299,8 +8366,9 @@ } }, "node_modules/@types/hoist-non-react-statics": { - "version": "3.3.1", - "license": "MIT", + "version": "3.3.5", + "resolved": "https://registry.npmjs.org/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.5.tgz", + "integrity": "sha512-SbcrWzkKBw2cdwRTwQAswfpB9g9LJWfjtUeW/jvNwbhC8cpmmNYVePa+ncbUe0rGTQ7G3Ff6mYUN2VMfLVr+Sg==", "dependencies": { "@types/react": "*", "hoist-non-react-statics": "^3.3.0" @@ -8470,8 +8538,9 @@ "license": "MIT" }, "node_modules/@types/prop-types": { - "version": "15.7.5", - "license": "MIT" + "version": "15.7.13", + "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.13.tgz", + "integrity": "sha512-hCZTSvwbzWGvhqxp/RqVqwU999pBf2vp7hzIjiYOsl8wqOmUxkQ6ddw1cV3l8811+kdUFus/q4d1Y3E3SyEifA==" }, "node_modules/@types/qs": { "version": "6.9.7", @@ -8484,11 +8553,11 @@ "license": "MIT" }, "node_modules/@types/react": { - "version": "18.2.21", - "license": "MIT", + "version": "18.3.10", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.10.tgz", + "integrity": "sha512-02sAAlBnP39JgXwkAq3PeU9DVaaGpZyF3MGcC0MKgQVkZor5IiiDAipVaxQHtDJAmO4GIy/rVBy/LzVj76Cyqg==", "dependencies": { "@types/prop-types": "*", - "@types/scheduler": "*", "csstype": "^3.0.2" } }, @@ -8505,10 +8574,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@types/scheduler": { - "version": "0.16.3", - "license": "MIT" - }, "node_modules/@types/secp256k1": { "version": "4.0.3", "license": "MIT", @@ -8584,8 +8649,9 @@ "license": "MIT" }, "node_modules/@types/styled-components": { - "version": "5.1.26", - "license": "MIT", + "version": "5.1.30", + "resolved": "https://registry.npmjs.org/@types/styled-components/-/styled-components-5.1.30.tgz", + "integrity": "sha512-xxJqw0s1myRTgrzHgG5tKHS9hK+KNhjbKMXDWlHRo9eDNVVUqf147QUGYUqwyCDkFyGr2pi1qJKFMEy0ACZb0A==", "dependencies": { "@types/hoist-non-react-statics": "*", "@types/react": "*", @@ -10150,9 +10216,10 @@ } }, "node_modules/@webassemblyjs/ast": { - "version": "1.11.6", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.12.1.tgz", + "integrity": "sha512-EKfMUOPRRUTy5UII4qJDGPpqfwjOmZ5jeGFwid9mnoqIFK+e0vqoi1qH56JpmZSzEL53jKnNzScdmftJyG5xWg==", "devOptional": true, - "license": "MIT", "dependencies": { "@webassemblyjs/helper-numbers": "1.11.6", "@webassemblyjs/helper-wasm-bytecode": "1.11.6" @@ -10160,23 +10227,27 @@ }, "node_modules/@webassemblyjs/floating-point-hex-parser": { "version": "1.11.6", - "devOptional": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.6.tgz", + "integrity": "sha512-ejAj9hfRJ2XMsNHk/v6Fu2dGS+i4UaXBXGemOfQ/JfQ6mdQg/WXtwleQRLLS4OvfDhv8rYnVwH27YJLMyYsxhw==", + "devOptional": true }, "node_modules/@webassemblyjs/helper-api-error": { "version": "1.11.6", - "devOptional": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.6.tgz", + "integrity": "sha512-o0YkoP4pVu4rN8aTJgAyj9hC2Sv5UlkzCHhxqWj8butaLvnpdc2jOwh4ewE6CX0txSfLn/UYaV/pheS2Txg//Q==", + "devOptional": true }, "node_modules/@webassemblyjs/helper-buffer": { - "version": "1.11.6", - "devOptional": true, - "license": "MIT" + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.12.1.tgz", + "integrity": "sha512-nzJwQw99DNDKr9BVCOZcLuJJUlqkJh+kVzVl6Fmq/tI5ZtEyWT1KZMyOXltXLZJmDtvLCDgwsyrkohEtopTXCw==", + "devOptional": true }, "node_modules/@webassemblyjs/helper-numbers": { "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.6.tgz", + "integrity": "sha512-vUIhZ8LZoIWHBohiEObxVm6hwP034jwmc9kuq5GdHZH0wiLVLIPcMCdpJzG4C11cHoQ25TFIQj9kaVADVX7N3g==", "devOptional": true, - "license": "MIT", "dependencies": { "@webassemblyjs/floating-point-hex-parser": "1.11.6", "@webassemblyjs/helper-api-error": "1.11.6", @@ -10185,62 +10256,69 @@ }, "node_modules/@webassemblyjs/helper-wasm-bytecode": { "version": "1.11.6", - "devOptional": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.6.tgz", + "integrity": "sha512-sFFHKwcmBprO9e7Icf0+gddyWYDViL8bpPjJJl0WHxCdETktXdmtWLGVzoHbqUcY4Be1LkNfwTmXOJUFZYSJdA==", + "devOptional": true }, "node_modules/@webassemblyjs/helper-wasm-section": { - "version": "1.11.6", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.12.1.tgz", + "integrity": "sha512-Jif4vfB6FJlUlSbgEMHUyk1j234GTNG9dBJ4XJdOySoj518Xj0oGsNi59cUQF4RRMS9ouBUxDDdyBVfPTypa5g==", "devOptional": true, - "license": "MIT", "dependencies": { - "@webassemblyjs/ast": "1.11.6", - "@webassemblyjs/helper-buffer": "1.11.6", + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-buffer": "1.12.1", "@webassemblyjs/helper-wasm-bytecode": "1.11.6", - "@webassemblyjs/wasm-gen": "1.11.6" + "@webassemblyjs/wasm-gen": "1.12.1" } }, "node_modules/@webassemblyjs/ieee754": { "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.6.tgz", + "integrity": "sha512-LM4p2csPNvbij6U1f19v6WR56QZ8JcHg3QIJTlSwzFcmx6WSORicYj6I63f9yU1kEUtrpG+kjkiIAkevHpDXrg==", "devOptional": true, - "license": "MIT", "dependencies": { "@xtuc/ieee754": "^1.2.0" } }, "node_modules/@webassemblyjs/leb128": { "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.6.tgz", + "integrity": "sha512-m7a0FhE67DQXgouf1tbN5XQcdWoNgaAuoULHIfGFIEVKA6tu/edls6XnIlkmS6FrXAquJRPni3ZZKjw6FSPjPQ==", "devOptional": true, - "license": "Apache-2.0", "dependencies": { "@xtuc/long": "4.2.2" } }, "node_modules/@webassemblyjs/utf8": { "version": "1.11.6", - "devOptional": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.6.tgz", + "integrity": "sha512-vtXf2wTQ3+up9Zsg8sa2yWiQpzSsMyXj0qViVP6xKGCUT8p8YJ6HqI7l5eCnWx1T/FYdsv07HQs2wTFbbof/RA==", + "devOptional": true }, "node_modules/@webassemblyjs/wasm-edit": { - "version": "1.11.6", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.12.1.tgz", + "integrity": "sha512-1DuwbVvADvS5mGnXbE+c9NfA8QRcZ6iKquqjjmR10k6o+zzsRVesil54DKexiowcFCPdr/Q0qaMgB01+SQ1u6g==", "devOptional": true, - "license": "MIT", "dependencies": { - "@webassemblyjs/ast": "1.11.6", - "@webassemblyjs/helper-buffer": "1.11.6", + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-buffer": "1.12.1", "@webassemblyjs/helper-wasm-bytecode": "1.11.6", - "@webassemblyjs/helper-wasm-section": "1.11.6", - "@webassemblyjs/wasm-gen": "1.11.6", - "@webassemblyjs/wasm-opt": "1.11.6", - "@webassemblyjs/wasm-parser": "1.11.6", - "@webassemblyjs/wast-printer": "1.11.6" + "@webassemblyjs/helper-wasm-section": "1.12.1", + "@webassemblyjs/wasm-gen": "1.12.1", + "@webassemblyjs/wasm-opt": "1.12.1", + "@webassemblyjs/wasm-parser": "1.12.1", + "@webassemblyjs/wast-printer": "1.12.1" } }, "node_modules/@webassemblyjs/wasm-gen": { - "version": "1.11.6", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.12.1.tgz", + "integrity": "sha512-TDq4Ojh9fcohAw6OIMXqiIcTq5KUXTGRkVxbSo1hQnSy6lAM5GSdfwWeSxpAo0YzgsgF182E/U0mDNhuA0tW7w==", "devOptional": true, - "license": "MIT", "dependencies": { - "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/ast": "1.12.1", "@webassemblyjs/helper-wasm-bytecode": "1.11.6", "@webassemblyjs/ieee754": "1.11.6", "@webassemblyjs/leb128": "1.11.6", @@ -10248,22 +10326,24 @@ } }, "node_modules/@webassemblyjs/wasm-opt": { - "version": "1.11.6", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.12.1.tgz", + "integrity": "sha512-Jg99j/2gG2iaz3hijw857AVYekZe2SAskcqlWIZXjji5WStnOpVoat3gQfT/Q5tb2djnCjBtMocY/Su1GfxPBg==", "devOptional": true, - "license": "MIT", "dependencies": { - "@webassemblyjs/ast": "1.11.6", - "@webassemblyjs/helper-buffer": "1.11.6", - "@webassemblyjs/wasm-gen": "1.11.6", - "@webassemblyjs/wasm-parser": "1.11.6" + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-buffer": "1.12.1", + "@webassemblyjs/wasm-gen": "1.12.1", + "@webassemblyjs/wasm-parser": "1.12.1" } }, "node_modules/@webassemblyjs/wasm-parser": { - "version": "1.11.6", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.12.1.tgz", + "integrity": "sha512-xikIi7c2FHXysxXe3COrVUPSheuBtpcfhbpFj4gmu7KRLYOzANztwUU0IbsqvMqzuNK2+glRGWCEqZo1WCLyAQ==", "devOptional": true, - "license": "MIT", "dependencies": { - "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/ast": "1.12.1", "@webassemblyjs/helper-api-error": "1.11.6", "@webassemblyjs/helper-wasm-bytecode": "1.11.6", "@webassemblyjs/ieee754": "1.11.6", @@ -10272,11 +10352,12 @@ } }, "node_modules/@webassemblyjs/wast-printer": { - "version": "1.11.6", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.12.1.tgz", + "integrity": "sha512-+X4WAlOisVWQMikjbcvY2e0rwPsKQ9F688lksZhBcPycBBuii3O7m8FACbDMWDojpAqvjIncrG8J0XHKyQfVeA==", "devOptional": true, - "license": "MIT", "dependencies": { - "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/ast": "1.12.1", "@xtuc/long": "4.2.2" } }, @@ -10290,13 +10371,15 @@ }, "node_modules/@xtuc/ieee754": { "version": "1.2.0", - "devOptional": true, - "license": "BSD-3-Clause" + "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", + "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", + "devOptional": true }, "node_modules/@xtuc/long": { "version": "4.2.2", - "devOptional": true, - "license": "Apache-2.0" + "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", + "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", + "devOptional": true }, "node_modules/abab": { "version": "2.0.6", @@ -10379,10 +10462,11 @@ "node": ">=0.4.0" } }, - "node_modules/acorn-import-assertions": { - "version": "1.9.0", + "node_modules/acorn-import-attributes": { + "version": "1.9.5", + "resolved": "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz", + "integrity": "sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==", "devOptional": true, - "license": "MIT", "peerDependencies": { "acorn": "^8" } @@ -11149,7 +11233,8 @@ }, "node_modules/babel-plugin-styled-components": { "version": "2.1.4", - "license": "MIT", + "resolved": "https://registry.npmjs.org/babel-plugin-styled-components/-/babel-plugin-styled-components-2.1.4.tgz", + "integrity": "sha512-Xgp9g+A/cG47sUyRwwYxGM4bR/jDRg5N6it/8+HxCnbT5XNKSKDT9xm4oag/osgqjC2It/vH0yXsomOG6k558g==", "dependencies": { "@babel/helper-annotate-as-pure": "^7.22.5", "@babel/helper-module-imports": "^7.22.5", @@ -11308,6 +11393,14 @@ "safe-buffer": "^5.0.1" } }, + "node_modules/base58-js": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/base58-js/-/base58-js-1.0.5.tgz", + "integrity": "sha512-LkkAPP8Zu+c0SVNRTRVDyMfKVORThX+rCViget00xdgLRrKkClCTz1T7cIrpr69ShwV5XJuuoZvMvJ43yURwkA==", + "engines": { + "node": ">= 8" + } + }, "node_modules/base64-js": { "version": "1.5.1", "funding": [ @@ -11427,8 +11520,9 @@ } }, "node_modules/bip174": { - "version": "2.1.0", - "license": "MIT", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/bip174/-/bip174-2.1.1.tgz", + "integrity": "sha512-mdFV5+/v0XyNYXjBS6CQPLo9ekCx4gtKZFnJm5PMto7Fs9hTTDpkkzOB7/FtluRI6JbUUAu+snTYfJRgHLZbZQ==", "engines": { "node": ">=8.0.0" } @@ -11580,9 +11674,9 @@ "license": "MIT" }, "node_modules/body-parser": { - "version": "1.20.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", - "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", + "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", "dev": true, "dependencies": { "bytes": "3.1.2", @@ -11593,7 +11687,7 @@ "http-errors": "2.0.0", "iconv-lite": "0.4.24", "on-finished": "2.4.1", - "qs": "6.11.0", + "qs": "6.13.0", "raw-body": "2.5.2", "type-is": "~1.6.18", "unpipe": "1.0.0" @@ -11618,21 +11712,6 @@ "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", "dev": true }, - "node_modules/body-parser/node_modules/qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", - "dev": true, - "dependencies": { - "side-channel": "^1.0.4" - }, - "engines": { - "node": ">=0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/bonjour-service": { "version": "1.1.1", "dev": true, @@ -11946,8 +12025,9 @@ }, "node_modules/bytes": { "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.8" } @@ -12124,7 +12204,8 @@ }, "node_modules/camelize": { "version": "1.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/camelize/-/camelize-1.0.1.tgz", + "integrity": "sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==", "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -12332,7 +12413,7 @@ "hasInstallScript": true, "dependencies": { "@testim/chrome-version": "^1.1.4", - "axios": "^1.6.0", + "axios": "^1.7.7", "compare-versions": "^6.1.0", "extract-zip": "^2.0.1", "https-proxy-agent": "^5.0.1", @@ -12829,8 +12910,9 @@ }, "node_modules/content-type": { "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.6" } @@ -12840,9 +12922,9 @@ "license": "MIT" }, "node_modules/cookie": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", - "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", + "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==", "dev": true, "engines": { "node": ">= 0.6" @@ -13053,7 +13135,8 @@ }, "node_modules/css-color-keywords": { "version": "1.0.0", - "license": "ISC", + "resolved": "https://registry.npmjs.org/css-color-keywords/-/css-color-keywords-1.0.0.tgz", + "integrity": "sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==", "engines": { "node": ">=4" } @@ -13227,7 +13310,8 @@ }, "node_modules/css-to-react-native": { "version": "3.2.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/css-to-react-native/-/css-to-react-native-3.2.0.tgz", + "integrity": "sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==", "dependencies": { "camelize": "^1.0.0", "css-color-keywords": "^1.0.0", @@ -13944,8 +14028,9 @@ "license": "MIT" }, "node_modules/did-resolver": { - "version": "2.1.2", - "license": "Apache-2.0" + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/did-resolver/-/did-resolver-4.1.0.tgz", + "integrity": "sha512-S6fWHvCXkZg2IhS4RcVHxwuyVejPR7c+a4Go0xbQ9ps5kILa8viiYQgrM4gfTyeTjJ0ekgJH9gk/BawTpmkbZA==" }, "node_modules/diff": { "version": "7.0.0", @@ -14351,14 +14436,10 @@ "node": ">= 4" } }, - "node_modules/encode-utf8": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/encode-utf8/-/encode-utf8-1.0.3.tgz", - "integrity": "sha512-ucAnuBEhUK4boH2HjVYG5Q2mQyPorvv0u/ocS+zhdw0S8AlHYY+GOFhP1Gio5z4icpP2ivFSvhtFjQi8+T9ppw==" - }, "node_modules/encodeurl": { "version": "1.0.2", "license": "MIT", + "peer": true, "engines": { "node": ">= 0.8" } @@ -15864,20 +15945,6 @@ "safe-buffer": "^5.1.1" } }, - "node_modules/ethereumjs-util": { - "version": "7.1.5", - "license": "MPL-2.0", - "dependencies": { - "@types/bn.js": "^5.1.0", - "bn.js": "^5.1.2", - "create-hash": "^1.1.2", - "ethereum-cryptography": "^0.1.3", - "rlp": "^2.2.4" - }, - "engines": { - "node": ">=10.0.0" - } - }, "node_modules/ethereumjs-vm": { "version": "2.6.0", "license": "MPL-2.0", @@ -16010,71 +16077,6 @@ "@ethersproject/wordlists": "5.7.0" } }, - "node_modules/ethjs-abi": { - "version": "0.2.1", - "license": "MIT", - "dependencies": { - "bn.js": "4.11.6", - "js-sha3": "0.5.5", - "number-to-bn": "1.7.0" - }, - "engines": { - "node": ">=6.5.0", - "npm": ">=3" - } - }, - "node_modules/ethjs-abi/node_modules/bn.js": { - "version": "4.11.6", - "license": "MIT" - }, - "node_modules/ethjs-abi/node_modules/js-sha3": { - "version": "0.5.5", - "license": "MIT" - }, - "node_modules/ethjs-contract": { - "version": "0.2.3", - "license": "MIT", - "dependencies": { - "babel-runtime": "^6.26.0", - "ethjs-abi": "0.2.0", - "ethjs-filter": "0.1.8", - "ethjs-util": "0.1.3", - "js-sha3": "0.5.5" - }, - "engines": { - "node": ">=6.5.0", - "npm": ">=3" - } - }, - "node_modules/ethjs-contract/node_modules/bn.js": { - "version": "4.11.6", - "license": "MIT" - }, - "node_modules/ethjs-contract/node_modules/ethjs-abi": { - "version": "0.2.0", - "license": "MIT", - "dependencies": { - "bn.js": "4.11.6", - "js-sha3": "0.5.5", - "number-to-bn": "1.7.0" - }, - "engines": { - "node": ">=6.5.0", - "npm": ">=3" - } - }, - "node_modules/ethjs-contract/node_modules/js-sha3": { - "version": "0.5.5", - "license": "MIT" - }, - "node_modules/ethjs-filter": { - "version": "0.1.8", - "license": "MIT", - "engines": { - "node": ">=6.5.0", - "npm": ">=3" - } - }, "node_modules/ethjs-format": { "version": "0.2.7", "license": "MIT", @@ -16163,23 +16165,97 @@ "npm": ">=3" } }, - "node_modules/ethr-did-registry": { - "version": "0.0.3", - "license": "Apache-2.0" - }, "node_modules/ethr-did-resolver": { - "version": "3.0.3", - "license": "Apache-2.0", + "version": "10.1.10", + "resolved": "https://registry.npmjs.org/ethr-did-resolver/-/ethr-did-resolver-10.1.10.tgz", + "integrity": "sha512-4o1h2I1zMzLTTAhg03z30ZJzJ33LaXZMel9X5/Avrq1ByAvnXUBShrPXeaHYWBP7qR9SY2QEAdhozXVs0cWUbg==", "dependencies": { - "buffer": "^6.0.0", - "did-resolver": "2.1.2", - "elliptic": "^6.5.3", - "ethjs-abi": "^0.2.1", - "ethjs-contract": "^0.2.0", - "ethjs-provider-http": "^0.1.6", - "ethjs-query": "^0.3.5", - "ethr-did-registry": "^0.0.3", - "js-sha3": "^0.8.0" + "did-resolver": "^4.1.0", + "ethers": "^6.8.1" + } + }, + "node_modules/ethr-did-resolver/node_modules/@noble/curves": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.2.0.tgz", + "integrity": "sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==", + "dependencies": { + "@noble/hashes": "1.3.2" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/ethr-did-resolver/node_modules/@noble/hashes": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.2.tgz", + "integrity": "sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==", + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/ethr-did-resolver/node_modules/@types/node": { + "version": "18.15.13", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.13.tgz", + "integrity": "sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q==" + }, + "node_modules/ethr-did-resolver/node_modules/aes-js": { + "version": "4.0.0-beta.5", + "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-4.0.0-beta.5.tgz", + "integrity": "sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q==" + }, + "node_modules/ethr-did-resolver/node_modules/ethers": { + "version": "6.13.2", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-6.13.2.tgz", + "integrity": "sha512-9VkriTTed+/27BGuY1s0hf441kqwHJ1wtN2edksEtiRvXx+soxRX3iSXTfFqq2+YwrOqbDoTHjIhQnjJRlzKmg==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/ethers-io/" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@adraffy/ens-normalize": "1.10.1", + "@noble/curves": "1.2.0", + "@noble/hashes": "1.3.2", + "@types/node": "18.15.13", + "aes-js": "4.0.0-beta.5", + "tslib": "2.4.0", + "ws": "8.17.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/ethr-did-resolver/node_modules/tslib": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", + "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" + }, + "node_modules/ethr-did-resolver/node_modules/ws": { + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", + "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", + "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/event-emitter": { @@ -16801,37 +16877,37 @@ } }, "node_modules/express": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz", - "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==", + "version": "4.21.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.1.tgz", + "integrity": "sha512-YSFlK1Ee0/GC8QaO91tHcDxJiE/X4FbpAyQWkxAvG6AXCuR65YzK8ua6D9hvi/TzUfZMpc+BwuM1IPw8fmQBiQ==", "dev": true, "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "1.20.2", + "body-parser": "1.20.3", "content-disposition": "0.5.4", "content-type": "~1.0.4", - "cookie": "0.6.0", + "cookie": "0.7.1", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "2.0.0", - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "etag": "~1.8.1", - "finalhandler": "1.2.0", + "finalhandler": "1.3.1", "fresh": "0.5.2", "http-errors": "2.0.0", - "merge-descriptors": "1.0.1", + "merge-descriptors": "1.0.3", "methods": "~1.1.2", "on-finished": "2.4.1", "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", + "path-to-regexp": "0.1.10", "proxy-addr": "~2.0.7", - "qs": "6.11.0", + "qs": "6.13.0", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", - "send": "0.18.0", - "serve-static": "1.15.0", + "send": "0.19.0", + "serve-static": "1.16.2", "setprototypeof": "1.2.0", "statuses": "2.0.1", "type-is": "~1.6.18", @@ -16851,6 +16927,15 @@ "ms": "2.0.0" } }, + "node_modules/express/node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/express/node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -16858,25 +16943,50 @@ "dev": true }, "node_modules/express/node_modules/path-to-regexp": { - "version": "0.1.7", + "version": "0.1.10", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz", + "integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==", + "dev": true + }, + "node_modules/express/node_modules/send": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", + "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", "dev": true, - "license": "MIT" + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "engines": { + "node": ">= 0.8.0" + } }, - "node_modules/express/node_modules/qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "node_modules/express/node_modules/send/node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", "dev": true, - "dependencies": { - "side-channel": "^1.0.4" - }, "engines": { - "node": ">=0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">= 0.8" } }, + "node_modules/express/node_modules/send/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, "node_modules/ext": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/ext/-/ext-1.7.0.tgz", @@ -17224,12 +17334,13 @@ } }, "node_modules/finalhandler": { - "version": "1.2.0", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", + "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", "dev": true, - "license": "MIT", "dependencies": { "debug": "2.6.9", - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "on-finished": "2.4.1", "parseurl": "~1.3.3", @@ -17242,16 +17353,27 @@ }, "node_modules/finalhandler/node_modules/debug": { "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, - "license": "MIT", "dependencies": { "ms": "2.0.0" } }, - "node_modules/finalhandler/node_modules/ms": { + "node_modules/finalhandler/node_modules/encodeurl": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", "dev": true, - "license": "MIT" + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/finalhandler/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true }, "node_modules/find-cache-dir": { "version": "3.3.2", @@ -18278,7 +18400,8 @@ }, "node_modules/hoist-non-react-statics": { "version": "3.3.2", - "license": "BSD-3-Clause", + "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", + "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", "dependencies": { "react-is": "^16.7.0" } @@ -21874,13 +21997,14 @@ "license": "MIT" }, "node_modules/jsesc": { - "version": "2.5.2", - "license": "MIT", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.0.2.tgz", + "integrity": "sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==", "bin": { "jsesc": "bin/jsesc" }, "engines": { - "node": ">=4" + "node": ">=6" } }, "node_modules/json-bigint": { @@ -22651,6 +22775,11 @@ "dev": true, "license": "MIT" }, + "node_modules/lodash.omit": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.omit/-/lodash.omit-4.5.0.tgz", + "integrity": "sha512-XeqSp49hNGmlkj2EJlfrQFIzQ6lXdNro9sddtQzcJY8QaoC2GO0DT7xaIokHeyM+mIT0mPMlPvkYzg2xCuHdZg==" + }, "node_modules/lodash.truncate": { "version": "4.4.2", "dev": true, @@ -23073,8 +23202,9 @@ }, "node_modules/media-typer": { "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.6" } @@ -23125,9 +23255,13 @@ "license": "MIT" }, "node_modules/merge-descriptors": { - "version": "1.0.1", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", "dev": true, - "license": "MIT" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, "node_modules/merge-source-map": { "version": "1.1.0", @@ -23229,10 +23363,11 @@ "license": "MIT" }, "node_modules/micromatch": { - "version": "4.0.5", - "license": "MIT", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dependencies": { - "braces": "^3.0.2", + "braces": "^3.0.3", "picomatch": "^2.3.1" }, "engines": { @@ -25855,28 +25990,28 @@ } }, "node_modules/react": { - "version": "16.14.0", - "license": "MIT", + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", + "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", + "peer": true, "dependencies": { - "loose-envify": "^1.1.0", - "object-assign": "^4.1.1", - "prop-types": "^15.6.2" + "loose-envify": "^1.1.0" }, "engines": { "node": ">=0.10.0" } }, "node_modules/react-dom": { - "version": "16.14.0", - "license": "MIT", + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", + "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", + "peer": true, "dependencies": { "loose-envify": "^1.1.0", - "object-assign": "^4.1.1", - "prop-types": "^15.6.2", - "scheduler": "^0.19.1" + "scheduler": "^0.23.2" }, "peerDependencies": { - "react": "^16.14.0" + "react": "^18.3.1" } }, "node_modules/react-i18next": { @@ -26656,6 +26791,84 @@ } } }, + "node_modules/sats-connect": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/sats-connect/-/sats-connect-2.3.1.tgz", + "integrity": "sha512-3KzqRO5KVBlge7Q4a/L828SfCkFD+M4MVdtgJZS+L+oHiDYoXlLkvnu3almh9Ynhcm0HnsGmVH1pKVL0lonjyQ==", + "dependencies": { + "@sats-connect/core": "0.0.8", + "@sats-connect/make-default-provider-config": "0.0.4", + "@sats-connect/ui": "0.0.6" + } + }, + "node_modules/sats-connect/node_modules/@sats-connect/make-default-provider-config": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/@sats-connect/make-default-provider-config/-/make-default-provider-config-0.0.4.tgz", + "integrity": "sha512-PsLzg1hV3FxMXUp9XrOUmDJgbuyR4VDHq/7mh1O1CtC3dDZQnJFa+Ue43duPMmUaRGinuVKtS2hnMhPLyURdGA==", + "dependencies": { + "@sats-connect/core": "0.0.7", + "@sats-connect/ui": "0.0.5-c661c02", + "bowser": "2.11.0" + }, + "peerDependencies": { + "typescript": "5.4.4" + } + }, + "node_modules/sats-connect/node_modules/@sats-connect/make-default-provider-config/node_modules/@sats-connect/core": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/@sats-connect/core/-/core-0.0.7.tgz", + "integrity": "sha512-4m5amq+orHDbqLqCRWojvDQigKAys33Ntwc7U5xNtFeib4j+DpYz6lVAL/s3cay1kq03WUZ+Gil3l5rv+5bQWQ==", + "dependencies": { + "axios": "1.7.7", + "bitcoin-address-validation": "2.2.3", + "buffer": "6.0.3", + "jsontokens": "4.0.1", + "lodash.omit": "4.5.0" + } + }, + "node_modules/sats-connect/node_modules/@sats-connect/make-default-provider-config/node_modules/@sats-connect/ui": { + "version": "0.0.5-c661c02", + "resolved": "https://registry.npmjs.org/@sats-connect/ui/-/ui-0.0.5-c661c02.tgz", + "integrity": "sha512-6MUXFDGTapBhZAxb6deAdqKuB64GOe6k927gGww5JYwVnOUCaHGDcfaZ/lwexzYL45u8RJof12I4np7MgS+Bwg==" + }, + "node_modules/sats-connect/node_modules/axios": { + "version": "1.7.7", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz", + "integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==", + "dependencies": { + "follow-redirects": "^1.15.6", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, + "node_modules/sats-connect/node_modules/bech32": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/bech32/-/bech32-2.0.0.tgz", + "integrity": "sha512-LcknSilhIGatDAsY1ak2I8VtGaHNhgMSYVxFrGLXv+xLHytaKZKcaUJJUE7qmBr7h33o5YQwP55pMI0xmkpJwg==" + }, + "node_modules/sats-connect/node_modules/bitcoin-address-validation": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/bitcoin-address-validation/-/bitcoin-address-validation-2.2.3.tgz", + "integrity": "sha512-1uGCGl26Ye8JG5qcExtFLQfuib6qEZWNDo1ZlLlwp/z7ygUFby3IxolgEfgMGaC+LG9csbVASLcH8fRLv7DIOg==", + "dependencies": { + "base58-js": "^1.0.0", + "bech32": "^2.0.0", + "sha256-uint8array": "^0.10.3" + } + }, + "node_modules/sats-connect/node_modules/typescript": { + "version": "5.4.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.4.tgz", + "integrity": "sha512-dGE2Vv8cpVvw28v8HCPqyb08EzbBURxDpuhJvTrusShUfGnhHBafDsLdS1EhhxyL6BJQE+2cT3dDPAv+MQ6oLw==", + "peer": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, "node_modules/sax": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/sax/-/sax-1.3.0.tgz", @@ -26672,11 +26885,12 @@ } }, "node_modules/scheduler": { - "version": "0.19.1", - "license": "MIT", + "version": "0.23.2", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz", + "integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==", + "peer": true, "dependencies": { - "loose-envify": "^1.1.0", - "object-assign": "^4.1.1" + "loose-envify": "^1.1.0" } }, "node_modules/schema-inspector": { @@ -26803,6 +27017,7 @@ "node_modules/send": { "version": "0.18.0", "license": "MIT", + "peer": true, "dependencies": { "debug": "2.6.9", "depd": "2.0.0", @@ -26825,17 +27040,20 @@ "node_modules/send/node_modules/debug": { "version": "2.6.9", "license": "MIT", + "peer": true, "dependencies": { "ms": "2.0.0" } }, "node_modules/send/node_modules/debug/node_modules/ms": { "version": "2.0.0", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/send/node_modules/ms": { "version": "2.1.3", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/serialize-error": { "version": "7.0.1", @@ -26943,18 +27161,76 @@ } }, "node_modules/serve-static": { - "version": "1.15.0", - "license": "MIT", + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", + "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", "dependencies": { - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "parseurl": "~1.3.3", - "send": "0.18.0" + "send": "0.19.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/serve-static/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/serve-static/node_modules/debug/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "node_modules/serve-static/node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/serve-static/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/serve-static/node_modules/send": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", + "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" }, "engines": { "node": ">= 0.8.0" } }, + "node_modules/serve-static/node_modules/send/node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "engines": { + "node": ">= 0.8" + } + }, "node_modules/set-blocking": { "version": "2.0.0", "license": "ISC" @@ -27015,6 +27291,11 @@ "sha.js": "bin.js" } }, + "node_modules/sha256-uint8array": { + "version": "0.10.7", + "resolved": "https://registry.npmjs.org/sha256-uint8array/-/sha256-uint8array-0.10.7.tgz", + "integrity": "sha512-1Q6JQU4tX9NqsDGodej6pkrUVQVNapLZnvkwIhddH/JqzBZF1fSaxSWNY6sziXBE8aEa2twtGkXUrwzGeZCMpQ==" + }, "node_modules/shallow-clone": { "version": "3.0.1", "license": "MIT", @@ -27034,7 +27315,8 @@ }, "node_modules/shallowequal": { "version": "1.1.0", - "license": "MIT" + "resolved": "https://registry.npmjs.org/shallowequal/-/shallowequal-1.1.0.tgz", + "integrity": "sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==" }, "node_modules/shebang-command": { "version": "2.0.0", @@ -27719,7 +28001,8 @@ }, "node_modules/styled-components": { "version": "5.3.11", - "license": "MIT", + "resolved": "https://registry.npmjs.org/styled-components/-/styled-components-5.3.11.tgz", + "integrity": "sha512-uuzIIfnVkagcVHv9nE0VPlHPSCmXIUGKfJ42LNjxCCTDTL5sgnJ8Z7GZBq0EnLYGln77tPpEpExt2+qa+cZqSw==", "dependencies": { "@babel/helper-module-imports": "^7.0.0", "@babel/traverse": "^7.4.5", @@ -28217,9 +28500,10 @@ } }, "node_modules/terser": { - "version": "5.19.2", + "version": "5.34.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.34.0.tgz", + "integrity": "sha512-y5NUX+U9HhVsK/zihZwoq4r9dICLyV2jXGOriDAVOeKhq3LKVjgJbGO90FisozXLlJfvjHqgckGmJFBb9KYoWQ==", "devOptional": true, - "license": "BSD-2-Clause", "dependencies": { "@jridgewell/source-map": "^0.3.3", "acorn": "^8.8.2", @@ -28234,15 +28518,16 @@ } }, "node_modules/terser-webpack-plugin": { - "version": "5.3.9", + "version": "5.3.10", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.10.tgz", + "integrity": "sha512-BKFPWlPDndPs+NGGCr1U59t0XScL5317Y0UReNrHaw9/FwhPENlq6bfgs+4yPfyP51vqC1bQ4rp1EfXW5ZSH9w==", "devOptional": true, - "license": "MIT", "dependencies": { - "@jridgewell/trace-mapping": "^0.3.17", + "@jridgewell/trace-mapping": "^0.3.20", "jest-worker": "^27.4.5", "schema-utils": "^3.1.1", "serialize-javascript": "^6.0.1", - "terser": "^5.16.8" + "terser": "^5.26.0" }, "engines": { "node": ">= 10.13.0" @@ -28446,13 +28731,6 @@ "dev": true, "license": "MIT" }, - "node_modules/to-fast-properties": { - "version": "2.0.0", - "license": "MIT", - "engines": { - "node": ">=4" - } - }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -28879,8 +29157,9 @@ }, "node_modules/type-is": { "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", "dev": true, - "license": "MIT", "dependencies": { "media-typer": "0.3.0", "mime-types": "~2.1.24" @@ -29873,9 +30152,10 @@ } }, "node_modules/watchpack": { - "version": "2.4.0", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.2.tgz", + "integrity": "sha512-TnbFSbcOCcDgjZ4piURLCbJ3nJhznVh9kw6F6iokjiFPl8ONxe9A6nMDVXDiNbrSfLILs6vB07F7wLBrwPYzJw==", "devOptional": true, - "license": "MIT", "dependencies": { "glob-to-regexp": "^0.4.1", "graceful-fs": "^4.1.2" @@ -30451,26 +30731,6 @@ "node": ">=8.0.0" } }, - "node_modules/web3-eth-personal": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.10.3.tgz", - "integrity": "sha512-avrQ6yWdADIvuNQcFZXmGLCEzulQa76hUOuVywN7O3cklB4nFc/Gp3yTvD3bOAaE7DhjLQfhUTCzXL7WMxVTsw==", - "dependencies": { - "@types/node": "^12.12.6", - "web3-core": "1.10.3", - "web3-core-helpers": "1.10.3", - "web3-core-method": "1.10.3", - "web3-net": "1.10.3", - "web3-utils": "1.10.3" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/web3-eth-personal/node_modules/@types/node": { - "version": "12.20.55", - "license": "MIT" - }, "node_modules/web3-eth/node_modules/@noble/curves": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.3.0.tgz", @@ -30690,19 +30950,6 @@ } } }, - "node_modules/web3-net": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.10.3.tgz", - "integrity": "sha512-IoSr33235qVoI1vtKssPUigJU9Fc/Ph0T9CgRi15sx+itysmvtlmXMNoyd6Xrgm9LuM4CIhxz7yDzH93B79IFg==", - "dependencies": { - "web3-core": "1.10.3", - "web3-core-method": "1.10.3", - "web3-utils": "1.10.3" - }, - "engines": { - "node": ">=8.0.0" - } - }, "node_modules/web3-provider-engine": { "version": "16.0.1", "license": "MIT", @@ -31431,8 +31678,10 @@ } }, "node_modules/web3modal": { - "version": "1.9.12", - "license": "MIT", + "version": "1.9.5", + "resolved": "https://registry.npmjs.org/web3modal/-/web3modal-1.9.5.tgz", + "integrity": "sha512-L5ME6zgoaCDa+T66skW9WpxGOJX6vU9v+7aLacoQJhU3AMTk784ionpX+Pg4UdhdM+UQW+odge32GkwEX11czQ==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", "dependencies": { "detect-browser": "^5.1.0", "prop-types": "^15.7.2", @@ -31442,6 +31691,42 @@ "tslib": "^1.10.0" } }, + "node_modules/web3modal/node_modules/react": { + "version": "16.14.0", + "resolved": "https://registry.npmjs.org/react/-/react-16.14.0.tgz", + "integrity": "sha512-0X2CImDkJGApiAlcf0ODKIneSwBPhqJawOa5wCtKbu7ZECrmS26NvtSILynQ66cgkT/RJ4LidJOc3bUESwmU8g==", + "dependencies": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1", + "prop-types": "^15.6.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/web3modal/node_modules/react-dom": { + "version": "16.14.0", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-16.14.0.tgz", + "integrity": "sha512-1gCeQXDLoIqMgqD3IO2Ah9bnf0w9kzhwN5q4FGnHZ67hBm9yePzB5JJAIQCc8x3pFnNlwFq4RidZggNAAkzWWw==", + "dependencies": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1", + "prop-types": "^15.6.2", + "scheduler": "^0.19.1" + }, + "peerDependencies": { + "react": "^16.14.0" + } + }, + "node_modules/web3modal/node_modules/scheduler": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.19.1.tgz", + "integrity": "sha512-n/zwRWRYSUj0/3g/otKDRPMh6qv2SYMWNq85IEa8iZyAv8od9zDYpGSnpBEjNgcMNq6Scbu5KfIPxNF72R/2EA==", + "dependencies": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1" + } + }, "node_modules/web3modal/node_modules/tslib": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", @@ -31455,33 +31740,33 @@ } }, "node_modules/webpack": { - "version": "5.88.2", + "version": "5.95.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.95.0.tgz", + "integrity": "sha512-2t3XstrKULz41MNMBF+cJ97TyHdyQ8HCt//pqErqDvNjU9YQBnZxIHa11VXsi7F3mb5/aO2tuDxdeTPdU7xu9Q==", "devOptional": true, - "license": "MIT", "dependencies": { - "@types/eslint-scope": "^3.7.3", - "@types/estree": "^1.0.0", - "@webassemblyjs/ast": "^1.11.5", - "@webassemblyjs/wasm-edit": "^1.11.5", - "@webassemblyjs/wasm-parser": "^1.11.5", + "@types/estree": "^1.0.5", + "@webassemblyjs/ast": "^1.12.1", + "@webassemblyjs/wasm-edit": "^1.12.1", + "@webassemblyjs/wasm-parser": "^1.12.1", "acorn": "^8.7.1", - "acorn-import-assertions": "^1.9.0", - "browserslist": "^4.14.5", + "acorn-import-attributes": "^1.9.5", + "browserslist": "^4.21.10", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.15.0", + "enhanced-resolve": "^5.17.1", "es-module-lexer": "^1.2.1", "eslint-scope": "5.1.1", "events": "^3.2.0", "glob-to-regexp": "^0.4.1", - "graceful-fs": "^4.2.9", + "graceful-fs": "^4.2.11", "json-parse-even-better-errors": "^2.3.1", "loader-runner": "^4.2.0", "mime-types": "^2.1.27", "neo-async": "^2.6.2", "schema-utils": "^3.2.0", "tapable": "^2.1.1", - "terser-webpack-plugin": "^5.3.7", - "watchpack": "^2.4.0", + "terser-webpack-plugin": "^5.3.10", + "watchpack": "^2.4.1", "webpack-sources": "^3.2.3" }, "bin": { @@ -31907,9 +32192,10 @@ "license": "MIT" }, "node_modules/webpack/node_modules/enhanced-resolve": { - "version": "5.15.0", + "version": "5.17.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz", + "integrity": "sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==", "devOptional": true, - "license": "MIT", "dependencies": { "graceful-fs": "^4.2.4", "tapable": "^2.2.0" @@ -31937,8 +32223,9 @@ }, "node_modules/webpack/node_modules/tapable": { "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", + "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", "devOptional": true, - "license": "MIT", "engines": { "node": ">=6" } diff --git a/package.json b/package.json index 7f18acb0d..7a696301f 100644 --- a/package.json +++ b/package.json @@ -8,10 +8,12 @@ "build": "vue-cli-service build", "test": "vue-cli-service test:unit --env=./tests/jsdom-env.js --coverageReporters=lcov --collect-coverage", "test:unit": "vue-cli-service test:unit --env=./tests/jsdom-env.js --coverageReporters=lcov --collect-coverage", + "test:unit-logs": "vue-cli-service test:unit --env=./tests/jsdom-env.js --coverageReporters=lcov --silent=false --collect-coverage", "lint": "vue-cli-service lint", "scanner": "npx sonar-scanner" }, "dependencies": { + "@enkryptcom/types": "^0.0.5", "@leather.io/rpc": "^2.0.2", "@ledgerhq/devices": "6.27.1", "@ledgerhq/hw-app-btc": "6.27.1", @@ -19,11 +21,11 @@ "@ledgerhq/hw-transport-webusb": "6.27.1", "@mdi/font": "^7.2.96", "@mdi/js": "^6.9.96", - "@rsksmart/bridges-core-sdk": "^0.3.3", - "@rsksmart/flyover-sdk": "^1.5.2", - "@rsksmart/rlogin": "^1.5.3-beta.1", + "@rsksmart/bridges-core-sdk": "^0.4.1", + "@rsksmart/flyover-sdk": "^1.6.2", + "@rsksmart/rlogin": "^1.6.1", "@rsksmart/rlogin-ledger-provider": "^1.0.4", - "@rsksmart/rlogin-trezor-provider": "^1.0.3", + "@rsksmart/rlogin-trezor-provider": "^1.0.4", "@rsksmart/rsk-precompiled-abis": "^6.0.0-ARROWHEAD", "@rsksmart/rsk-utils": "^1.1.0", "@stacks/connect": "^7.7.1", @@ -35,7 +37,7 @@ "@types/trezor-connect": "^7.0.0", "@walletconnect/web3-provider": "^1.7.1", "assert": "^2.0.0", - "axios": "^1.6.3", + "axios": "^1.7.7", "big.js": "^6.2.1", "bip32": "^4.0.0", "bitcoinjs-lib": "^5.2.0", @@ -51,6 +53,7 @@ "moment": "^2.29.4", "os-browserify": "^0.3.0", "process": "^0.11.10", + "sats-connect": "2.3.x", "stream-browserify": "^3.0.0", "stream-http": "^3.2.0", "text-encoding": "^0.7.0", @@ -65,6 +68,7 @@ "web3-eth-contract": "^1.10.0" }, "devDependencies": { + "@babel/plugin-transform-private-methods": "^7.25.9", "@intlify/vue-i18n-loader": "^4.2.0", "@ledgerhq/hw-transport-mocker": "^6.28.5", "@mdi/font": "^7.2.96", diff --git a/src/App.vue b/src/App.vue index 2b7baa84e..70fe0f6cd 100644 --- a/src/App.vue +++ b/src/App.vue @@ -13,7 +13,9 @@ - - diff --git a/src/common/components/exchange/ConnectDevice.vue b/src/common/components/exchange/ConnectDevice.vue index 162d018f2..ba5893ca5 100644 --- a/src/common/components/exchange/ConnectDevice.vue +++ b/src/common/components/exchange/ConnectDevice.vue @@ -118,6 +118,10 @@ export default defineComponent({ // eslint-disable-next-line global-require, import/no-dynamic-require return require('@/assets/exchange/leather/connect_leather.png'); } + if (bitcoinWallet.value === constants.WALLET_NAMES.ENKRYPT.long_name) { + // eslint-disable-next-line global-require, import/no-dynamic-require + return require('@/assets/exchange/enkrypt/connect_enkrypt.png'); + } // eslint-disable-next-line global-require, import/no-dynamic-require return require('@/assets/exchange/wallet.png'); }); diff --git a/src/common/components/exchange/SelectBitcoinWallet.vue b/src/common/components/exchange/SelectBitcoinWallet.vue index 4a44919ae..d3578b759 100644 --- a/src/common/components/exchange/SelectBitcoinWallet.vue +++ b/src/common/components/exchange/SelectBitcoinWallet.vue @@ -8,7 +8,7 @@ - + @@ -42,15 +42,19 @@ diff --git a/src/common/components/layouts/Footer.vue b/src/common/components/layouts/Footer.vue index 135f40afa..0778c8703 100644 --- a/src/common/components/layouts/Footer.vue +++ b/src/common/components/layouts/Footer.vue @@ -5,7 +5,9 @@ Built by -

Copyright © 2024 RootstockLabs All rights reserved

+

+ Copyright © {{ currentYear }} RootstockLabs All rights reserved +

-
+ +
@@ -16,7 +17,7 @@ {{ balance.toRBTCTrimmedString() }} {{ environmentContext.getRbtcTicker() }} + >{{ balance.toRBTCString() }} {{ environmentContext.getRbtcTicker() }} ('web3Session', constants.SESSION_GET_CHECKSUMMED_ACCOUNT); const truncatedAccount = computed(() => truncateString(account.value)); @@ -62,12 +62,15 @@ export default { const balance = useStateAttribute('web3Session', 'balance'); const environmentContext = EnvironmentContextProviderService.getEnvironmentContext(); + const walletDataReady = useStateAttribute('pegInTx', 'walletDataReady'); + const accountBalance = computed(() => { - const amount = balance.value.toRBTCTrimmedString().slice(0, 7); + const amount = balance.value.toRBTCString().slice(0, 7); return `${amount} ${environmentContext.getRbtcTicker()}`; }); const clearSession = useAction('web3Session', constants.WEB3_SESSION_CLEAR_ACCOUNT); + function disconnectWallet() { clearSession(); router.push({ name: 'Home' }); @@ -77,6 +80,14 @@ export default { navigator.clipboard.writeText(account.value); } + function goHome() { + if (route.name !== 'Home') router.push({ name: 'Home' }); + } + + function getLogoSrc() { + return vuetifyTheme.global.current.value.dark ? require('@/assets/logo-rootstock-white.svg') : require('@/assets/logo-rootstock-black.svg'); + } + watch(themeLight, (enabledLight) => { vuetifyTheme.global.name.value = enabledLight ? 'light' : 'dark'; }); @@ -93,6 +104,8 @@ export default { accountBalance, balance, environmentContext, + isPeginSelected: computed(() => route.name === 'Create'), + walletDataReady, }; }, }; diff --git a/src/common/components/status/PegoutProgressBar.vue b/src/common/components/status/PegoutProgressBar.vue deleted file mode 100644 index c5f3fc216..000000000 --- a/src/common/components/status/PegoutProgressBar.vue +++ /dev/null @@ -1,166 +0,0 @@ - - - diff --git a/src/common/components/status/StatusProgressBar.vue b/src/common/components/status/StatusProgressBar.vue index 623c2b798..ede4f8dfc 100644 --- a/src/common/components/status/StatusProgressBar.vue +++ b/src/common/components/status/StatusProgressBar.vue @@ -6,10 +6,10 @@
+ :id="`indicator-${timeLineData[0][1]}${txFailed?'-error':txNotFound?'-warning':''}`"> +
- -

{{ timeLineData[0][0] }}

+

{{ timeLineData[0][0] }}

- -

{{ timeLineData[4][0] }}

+

{{ timeLineData[4][0] }}

@@ -73,16 +70,23 @@ import { TxStatusType, } from '@/common/types'; import { PegStatus, FlyoverStatus } from '@/common/store/constants'; +import EnvironmentContextProviderService from '@/common/providers/EnvironmentContextProvider'; +import { useTheme } from 'vuetify'; export default defineComponent({ name: 'StatusProgressBar', props: { isFlyover: Boolean, - txWithErrorType: Boolean, + txNotFound: Boolean, txWithError: Boolean, }, setup(props) { const status = useState('status'); + const environmentContext = EnvironmentContextProviderService.getEnvironmentContext(); + const btcTicker = environmentContext.getBtcTicker(); + const rbtcTicker = environmentContext.getRbtcTicker(); + const txFailed = computed(() => props.txWithError + || status.value.flyoverStatus === FlyoverStatus.FAILED); const txDetails = useStateAttribute('status', 'txDetails'); const isPegOut = computed((): boolean => status.value.type === TxStatusType.PEGOUT || status.value.type === TxStatusType.FLYOVER_PEGOUT); @@ -99,8 +103,7 @@ export default defineComponent({ } return require('@/assets/status/rbtc.svg'); }); - const initialImgSize = computed(() => (props.txWithError ? 32 : 12)); - const barColor = computed(() => (props.txWithError ? 'red' : 'green')); + const initialImgSize = computed(() => (txFailed.value || props.txNotFound ? 32 : 12)); const timeLineData = computed(() => { let labelOne = 'Transaction Broadcasted'; let labelTwo = 'Transaction Confirmed'; @@ -110,13 +113,44 @@ export default defineComponent({ let second = 0; let third = 0; let fourth = 0; - if (props.txWithErrorType) { + if (props.txNotFound) { zero = 100; - labelOne = 'Error occurred'; + labelOne = ''; } else if (isPegOut.value) { labelThree = 'Sent to Bitcoin'; if (props.isFlyover) { - zero = txDetails.value.status === FlyoverStatus.COMPLETED ? 100 : 50; + labelOne = `Send ${rbtcTicker} to Liquidity Provider`; + labelTwo = `Liquidity Provider received ${rbtcTicker}`; + labelThree = `Liquidity Provider send ${btcTicker}`; + switch (status.value.flyoverStatus) { + case FlyoverStatus.PENDING: + zero = 100; + first = 100; + second = 70; + break; + case FlyoverStatus.SUCCESS: + zero = 100; + first = 100; + second = 100; + third = 100; + break; + case FlyoverStatus.FAILED: + zero = 100; + labelOne = 'Error occurred'; + labelTwo = ''; + labelThree = ''; + break; + default: + zero = 0; + first = 0; + second = 0; + third = 0; + fourth = 0; + labelOne = ''; + labelTwo = ''; + labelThree = ''; + break; + } } else { switch (txDetails.value.status as PegoutStatus) { case PegoutStatus.PENDING: @@ -166,7 +200,38 @@ export default defineComponent({ } } } else if (props.isFlyover) { - zero = txDetails.value.status === FlyoverStatus.COMPLETED ? 100 : 50; + labelOne = `Send ${btcTicker} to Liquidity Provider`; + labelTwo = `Liquidity Provider received ${btcTicker}`; + labelThree = `Liquidity Provider send ${rbtcTicker}`; + switch (status.value.flyoverStatus) { + case FlyoverStatus.PENDING: + zero = 100; + first = 100; + second = 70; + break; + case FlyoverStatus.SUCCESS: + zero = 100; + first = 100; + second = 100; + third = 100; + break; + case FlyoverStatus.FAILED: + zero = 100; + labelOne = 'Error occurred'; + labelTwo = ''; + labelThree = ''; + break; + default: + zero = 0; + first = 0; + second = 0; + third = 0; + fourth = 0; + labelOne = ''; + labelTwo = ''; + labelThree = ''; + break; + } } else { const txDetailsPegIn = txDetails.value as PeginStatus; const btc = txDetailsPegIn.btc as BtcPeginStatus; @@ -240,7 +305,8 @@ export default defineComponent({ }; }); const imgStep1 = computed(() => { - if (props.txWithError) return require('@/assets/status/ellipse_error.svg'); + if (txFailed.value) return require('@/assets/status/ellipse_error.svg'); + if (props.txNotFound) return require('@/assets/warning.svg'); if (timeLineData.value[0][1] === 100) return require('@/assets/status/ellipse.svg'); return require('@/assets/status/ellipse_empty.svg'); }); @@ -256,6 +322,10 @@ export default defineComponent({ } return require('@/assets/status/ellipse_empty.svg'); }); + const textClass = computed(() => { + const { global: { current } } = useTheme(); + return current.value.dark ? 'text-bw-400' : ''; + }); return { isPegOut, initialStepImage, @@ -265,7 +335,8 @@ export default defineComponent({ imgStep2, imgStep3, initialImgSize, - barColor, + txFailed, + textClass, }; }, }); @@ -291,6 +362,9 @@ export default defineComponent({ #indicator-100-error { background-color: red !important; } +#indicator-100-warning { + background-color: orange !important; +} #indicator-0 { background-color: rgba(58, 58, 58, 0.5) !important; } diff --git a/src/common/components/status/StatusSummary.vue b/src/common/components/status/StatusSummary.vue index 177ee49df..81f27d987 100644 --- a/src/common/components/status/StatusSummary.vue +++ b/src/common/components/status/StatusSummary.vue @@ -1,8 +1,8 @@ @@ -51,7 +51,7 @@ export default defineComponent({ props: { txId: String, isFlyover: Boolean, - txWithErrorType: Boolean, + txNotFound: Boolean, txWithError: Boolean, }, setup(props, context) { diff --git a/src/common/components/status/TxPegout.vue b/src/common/components/status/TxPegout.vue index 70641a628..948fbca48 100644 --- a/src/common/components/status/TxPegout.vue +++ b/src/common/components/status/TxPegout.vue @@ -1,10 +1,10 @@ @@ -33,7 +33,7 @@ export default defineComponent({ props: { txId: String, isFlyover: Boolean, - txWithErrorType: Boolean, + txNotFound: Boolean, txWithError: Boolean, }, setup(props) { @@ -61,6 +61,7 @@ export default defineComponent({ const status = txDetails.value as PegoutStatusDataModel; const valueRequested = new SatoshiBig(status.valueRequestedInSatoshis, 'satoshi').toBTCTrimmedString(); const amountSent = new WeiBig(valueRequested, 'rbtc').plus(calculatedGasFee.value).toRBTCTrimmedString(); + const btcTxId = status.status === PegoutStatus.RELEASE_BTC ? status.btcTxId : ''; return { amountFromString: amountSent, amountReceivedString: amountToBeReceived.value, @@ -71,6 +72,7 @@ export default defineComponent({ txId: status.rskTxHash ? status.rskTxHash : props.txId, estimatedFee: Number(pegOutEstimatedFee.value.toBTCTrimmedString()), status: status.status, + btcTxId, }; }); diff --git a/src/common/router/index.ts b/src/common/router/index.ts index dee462ce4..1a212b7b6 100644 --- a/src/common/router/index.ts +++ b/src/common/router/index.ts @@ -13,13 +13,7 @@ async function checkAcceptedTerms( next: NavigationGuardNext, ) { const store = useStore(); - if (store.state.web3Session.acceptedTerms === undefined) { - await store.dispatch(`web3Session/${constants.SESSION_ADD_TERMS_AND_CONDITIONS_ENABLED}`); - } - if ( - !store.state.web3Session.termsAndConditionsEnabled - || (store.state.web3Session.termsAndConditionsEnabled && store.state.web3Session.acceptedTerms) - ) { + if (store.state.web3Session.acceptedTerms) { next(); } else { next({ name: 'Home' }); @@ -69,7 +63,7 @@ const routes: Readonly = [ path: '/pegin', name: 'PegIn', component: () => import(/* webpackChunkName: "pegin" */ '../../pegin/views/PegIn.vue'), - beforeEnter: [checkAcceptedTerms, checkRSKConnection], + beforeEnter: [checkAcceptedTerms], }, { path: '/pegout', @@ -90,22 +84,17 @@ const routes: Readonly = [ path: '/pegin/:wallet/create', name: 'Create', component: () => import(/* webpackChunkName: "pegin-create" */ '../../pegin/views/Create.vue'), - beforeEnter: checkAcceptedTerms, + beforeEnter: [checkAcceptedTerms, checkFromRoute], }, { - path: '/pegin/:wallet/success/:txId', - name: 'Success', - component: - () => import(/* webpackChunkName: "pegin-success" */ '../../pegin/views/Success.vue'), - beforeEnter: [checkFromRoute], - }, - { - path: '/:type/success/tx/:txId', + path: '/:type/success/tx/:txId/:amount/:confirmations', name: 'SuccessTx', component: () => import(/* webpackChunkName: "tx-success" */ '../views/SuccessTx.vue'), props: (route) => ({ type: route.params.type, txId: route.params.txId, + amount: route.params.amount, + confirmations: route.params.confirmations, }), beforeEnter: [checkFromRoute], }, @@ -118,12 +107,4 @@ const router = createRouter({ routes, }); -router.beforeResolve((to, from, next) => { - const store = useStore(); - store.dispatch(`view/${constants.VIEW_ADD_CURRENT_VIEW}`, to.name); - const inTxFlow = store.getters[`web3Session/${constants.SESSION_IN_TX_FLOW}`]; - if (to.name === 'Create' && !inTxFlow) next({ name: 'Home' }); - else next(); -}); - export default router; diff --git a/src/common/services/ApiService.ts b/src/common/services/ApiService.ts index 12a34514b..d945ef417 100644 --- a/src/common/services/ApiService.ts +++ b/src/common/services/ApiService.ts @@ -11,6 +11,7 @@ import { TxStatusType, Feature, TxInfo, + FlyoverCall, } from '@/common/types'; import { areValidOutputs, isValidInput } from '@/common/utils'; import { BridgeService } from '@/common/services/BridgeService'; @@ -214,8 +215,8 @@ export default class ApiService { static registerTx(txInfo: TxInfo): Promise { return new Promise((resolve, reject) => { - const { sessionId, txHash, type } = txInfo; - if (sessionId == null || txHash == null || type == null) resolve(); + const { txHash, type } = txInfo; + if (txHash == null || type == null) resolve(); axios.post(`${ApiService.baseURL}/register`, txInfo) .then(() => resolve()) .catch(reject); @@ -229,4 +230,12 @@ export default class ApiService { .catch(() => reject(new Error('Unable to get feature flags'))); }); } + + static registerFlyoverCall(payload: FlyoverCall): Promise { + return new Promise((resolve, reject) => { + axios.post(`${ApiService.baseURL}/register-flyover-call`, payload) + .then((response) => resolve(response.data)) + .catch(() => reject(new Error('Unable to register flyover call'))); + }); + } } diff --git a/src/common/services/BridgeService.ts b/src/common/services/BridgeService.ts index a3bd7e4a3..9417adc92 100644 --- a/src/common/services/BridgeService.ts +++ b/src/common/services/BridgeService.ts @@ -2,15 +2,12 @@ import { bridge } from '@rsksmart/rsk-precompiled-abis'; import Web3 from 'web3'; import { Contract } from 'web3-eth-contract'; import { EnvironmentAccessorService } from '@/common/services/enviroment-accessor.service'; -import * as constants from '@/common/store/constants'; export class BridgeService { private bridgeContract: Contract; private web3: Web3; - private totalRbtcStock = constants.TOTAL_RBTC_STOCK; - constructor() { this.web3 = new Web3(EnvironmentAccessorService.getEnvironmentVariables().vueAppRskNodeHost); this.bridgeContract = bridge.build(this.web3); @@ -36,54 +33,6 @@ export class BridgeService { }); } - public getLockingCapAmount(): Promise { - return new Promise((resolve, reject) => { - this.bridgeContract.methods - .getLockingCap() - .call() - .then((lockingCap: string) => resolve(Number(lockingCap))) - .catch(reject); - }); - } - - public getRbtcInCirculation(): Promise { - return new Promise((resolve, reject) => { - this.web3.eth - .getBalance(bridge.address) - .then((balance: bigint) => { - const amount = Number( - this.web3.utils.toWei( - this.web3.utils.toBigInt(this.totalRbtcStock), - 'wei', - ), - ) - Number(balance); - resolve(amount); - }) - .catch((reason) => { - reject(reason); - }); - }); - } - - public getPeginAvailability(): Promise { - return new Promise((resolve, reject) => { - Promise.all([this.getLockingCapAmount(), this.getRbtcInCirculation()]) - .then(([lockingCap, rbtcInCirculation]) => { - const rbtcInCirculationToSatoshis = Math.round(rbtcInCirculation / 1e10); - let availability = lockingCap - rbtcInCirculationToSatoshis; - availability = availability > 0 ? availability : 0; - const maxAllowed = EnvironmentAccessorService.getEnvironmentVariables() - .maxAmountAllowedInSatoshis ? Number(EnvironmentAccessorService - .getEnvironmentVariables().maxAmountAllowedInSatoshis) - : Infinity; - resolve(Math.min(availability, maxAllowed)); - }) - .catch((reason) => { - reject(reason); - }); - }); - } - public getEstimatedFeesForNextPegOutEvent(): Promise { return new Promise((resolve, reject) => { this.bridgeContract.methods diff --git a/src/common/services/EnkryptService.ts b/src/common/services/EnkryptService.ts new file mode 100644 index 000000000..4cf3eacf0 --- /dev/null +++ b/src/common/services/EnkryptService.ts @@ -0,0 +1,91 @@ +/* eslint-disable class-methods-use-this, @typescript-eslint/no-explicit-any */ +import * as bitcoin from 'bitcoinjs-lib'; +import { + BtcAccount, + WalletAddress, + SignedTx, +} from '@/common/types'; +import { WalletService } from '@/common/services/index'; +import { EnkryptTx } from '@/pegin/middleware/TxBuilder/EnkryptTxBuilder'; +import * as constants from '@/common/store/constants'; +import ProviderError from '@enkryptcom/types'; + +export default class EnkryptService extends WalletService { + private btcProvider; + + constructor() { + super(); + if (this.network === 'test') window.enkrypt.providers.bitcoin.switchNetwork('testnet'); + this.btcProvider = window.enkrypt.providers.bitcoin; + } + + name(): Record<'formal_name' | 'short_name' | 'long_name', string> { + return constants.WALLET_NAMES.ENKRYPT; + } + + getAccountAddresses(): Promise { + return new Promise((resolve, reject) => { + this.btcProvider.getAccounts() + .then((addresses: string[]) => { + const walletAddresses = addresses + .map((address) => ({ address, derivationPath: '', publicKey: '' } as WalletAddress)); + resolve(walletAddresses); + }) + .catch((e: typeof ProviderError) => reject(e)); + }); + } + + availableAccounts(): BtcAccount[] { + return [BtcAccount.BITCOIN_NATIVE_SEGWIT_ADDRESS]; + } + + isConnected(): Promise { + return new Promise((resolve) => { + resolve(this.btcProvider.isConnected()); + }); + } + + // eslint-disable-next-line @typescript-eslint/no-unused-vars + getXpub(accountType: BtcAccount, accountNumber: number): Promise { + return Promise.reject(new Error()); + } + + /** Needed to load account balance */ + executed = false; + + areEnoughUnusedAddresses(): boolean { + if (!this.executed) { + this.executed = true; + return !this.executed; + } + return this.executed; + } + + sign(tx: EnkryptTx): Promise { + return new Promise((resolve, reject) => { + this.btcProvider?.signPsbt(tx.hex, { autoFinalized: false }) + .then((hex: string) => { + const signedPsbt = bitcoin.Psbt.fromHex(hex) + .finalizeAllInputs() + .extractTransaction() + .toHex(); + resolve({ signedTx: signedPsbt }); + }) + .catch((e: typeof ProviderError) => { + reject(e); + }); + }); + } + + async reconnect(): Promise { + return new Promise((resolve, reject) => { + try { + if (this.network === 'test') window.enkrypt.providers.bitcoin.switchNetwork('testnet'); + this.btcProvider = window.enkrypt.providers.bitcoin; + resolve(); + } catch (e: any) { + reject(e); + } + }); + } +} diff --git a/src/common/services/FlyoverService.ts b/src/common/services/FlyoverService.ts index 8f50b206e..97d839eb7 100644 --- a/src/common/services/FlyoverService.ts +++ b/src/common/services/FlyoverService.ts @@ -3,20 +3,21 @@ import { AcceptedPegoutQuote, Flyover, LiquidityProvider, PegoutQuote, Quote, AcceptedQuote, + FlyoverUtils, } from '@rsksmart/flyover-sdk'; import * as constants from '@/common/store/constants'; import { - LiquidityProvider2WP, QuotePegIn2WP, QuotePegOut2WP, + LiquidityProvider2WP, PeginQuote, QuotePegOut2WP, SatoshiBig, WeiBig, } from '@/common/types'; -import { providers } from 'ethers'; +import { Wallet, providers } from 'ethers'; import { EnvironmentAccessorService } from './enviroment-accessor.service'; import { isValidSiteKey, ServiceError } from '../utils'; export default class FlyoverService { flyover?: Flyover; - flyovernetwork: Network; + flyoverNetwork: Network; private lbcAddress = EnvironmentAccessorService.getEnvironmentVariables().lbcAddress; @@ -24,7 +25,7 @@ export default class FlyoverService { private pegoutQuotes: PegoutQuote[] = []; - private providerUrl?: string; + private providerUrl: string; private peginQuotes: Quote[] = []; @@ -32,31 +33,38 @@ export default class FlyoverService { private token = ''; + private liquidityProviderIdUsed = -1; + constructor(providerUrl?: string) { - this.providerUrl = providerUrl; + this.providerUrl = providerUrl + ?? EnvironmentAccessorService.getEnvironmentVariables().vueAppRskNodeHost; const appNetwork = EnvironmentAccessorService.getEnvironmentVariables().vueAppCoin; switch (appNetwork) { case constants.BTC_NETWORK_MAINNET: - this.flyovernetwork = 'Mainnet'; + this.flyoverNetwork = 'Mainnet'; break; case constants.BTC_NETWORK_TESTNET: - this.flyovernetwork = 'Testnet'; + this.flyoverNetwork = 'Testnet'; break; default: - this.flyovernetwork = 'Regtest'; + this.flyoverNetwork = 'Regtest'; break; } } - initialize(): Promise { + initialize(web3Provider?: providers.ExternalProvider): Promise { return new Promise((resolve, reject) => { - const provider = this.providerUrl - ? new providers.JsonRpcProvider(this.providerUrl) : window.ethereum; - BlockchainConnection.createUsingStandard(provider) - .then((connection: BlockchainConnection) => { + const connectionPromise = web3Provider + ? BlockchainConnection.createUsingStandard(web3Provider) + : BlockchainConnection.createUsingPassphrase( + Wallet.createRandom().mnemonic.phrase, + this.providerUrl, + ); + connectionPromise + .then((connection) => { this.flyover = new Flyover({ - network: this.flyovernetwork, - rskConnection: connection, + rskConnection: connection as BlockchainConnection, + network: this.flyoverNetwork, captchaTokenResolver: this.tokenResolver.bind(this), disableChecksum: true, }); @@ -127,6 +135,7 @@ export default class FlyoverService { const provider = this.liquidityProviders.find((p: LiquidityProvider) => p.id === providerId); if (provider) { this.flyover?.useLiquidityProvider(provider); + this.liquidityProviderIdUsed = providerId; } } @@ -138,7 +147,6 @@ export default class FlyoverService { ): Promise { return new Promise((resolve, reject) => { this.flyover?.getPegoutQuotes({ - bitcoinRefundAddress: btcRefundAddress, rskRefundAddress, to: btcRecipientAddress, valueToTransfer: valueToTransfer.toWeiBigInt(), @@ -314,13 +322,11 @@ export default class FlyoverService { public getPeginQuotes( rootstockRecipientAddress: string, - bitcoinRefundAddress: string, valueToTransfer: SatoshiBig, - ):Promise> { - return new Promise>((resolve, reject) => { + ):Promise> { + return new Promise>((resolve, reject) => { this.flyover?.getQuotes({ rskRefundAddress: rootstockRecipientAddress, - bitcoinRefundAddress, // TODO: this should be fixed in the SDK: valueToTransfer is in BTC valueToTransfer: new WeiBig(valueToTransfer.toBTCString(), 'rbtc').toWeiBigInt(), callContractArguments: '', @@ -331,21 +337,9 @@ export default class FlyoverService { const peginQuotes = quotes .filter((quote: Quote) => this.isValidPeginQuote(quote, { rootstockRecipientAddress, - bitcoinRefundAddress, valueToTransfer, })) - .map(({ quote, quoteHash }: Quote) => ({ - quote: { - ...quote, - timeForDepositInSeconds: quote.timeForDeposit, - callFee: SatoshiBig.fromWeiBig(new WeiBig(quote.callFee ?? 0, 'wei')), - gasFee: new WeiBig(quote.gasFee ?? 0, 'wei'), - penaltyFee: new WeiBig(quote.penaltyFee ?? 0, 'wei'), - productFeeAmount: SatoshiBig.fromWeiBig(new WeiBig(quote.productFeeAmount ?? 0, 'wei')), - value: SatoshiBig.fromWeiBig(new WeiBig(quote.value ?? 0, 'wei')), - }, - quoteHash, - })); + .map((quoteFromServer: Quote) => new PeginQuote(quoteFromServer)); resolve(peginQuotes); }) .catch((error: Error) => { @@ -363,7 +357,6 @@ export default class FlyoverService { { quote }: Quote, quoteRequest: { rootstockRecipientAddress: string; - bitcoinRefundAddress: string; valueToTransfer: SatoshiBig; }, ): boolean { @@ -373,10 +366,8 @@ export default class FlyoverService { ) { return false; } - if ( - quoteRequest.bitcoinRefundAddress !== quote.btcRefundAddr - || quoteRequest.rootstockRecipientAddress !== quote.rskRefundAddr + quoteRequest.rootstockRecipientAddress !== quote.rskRefundAddr || new WeiBig(quoteRequest.valueToTransfer.toBTCString(), 'rbtc').toWeiBigInt() !== BigInt(quote.value) ) { return false; @@ -443,4 +434,63 @@ export default class FlyoverService { } }); } + + public getAvailableLiquidity(): Promise<{ + providerId: number, + peginLiquidity: WeiBig, + pegoutLiquidity: SatoshiBig, + }> { + return new Promise((resolve, reject) => { + this.flyover?.getAvailableLiquidity() + .then(({ peginLiquidityAmount, pegoutLiquidityAmount }) => { + const peginLiquidity = new WeiBig(peginLiquidityAmount, 'wei'); + const pegoutLiquidity = new SatoshiBig(pegoutLiquidityAmount, 'satoshi'); + resolve({ providerId: this.liquidityProviderIdUsed, peginLiquidity, pegoutLiquidity }); + }) + .catch((error) => { + reject(new ServiceError( + 'FlyoverService', + 'getAvailableLiquidity', + 'There was an error getting the available liquidity from the Flyover server', + error.message, + )); + }); + }); + } + + public getPeginStatus(quoteHash: string) { + return new Promise((resolve, reject) => { + this.flyover?.getPeginStatus(quoteHash) + .then((detailedStatus) => { + const status = FlyoverUtils.getSimpleQuoteStatus(detailedStatus.status.state); + resolve(status); + }) + .catch((error) => { + reject(new ServiceError( + 'FlyoverService', + 'getPeginStatus', + 'There was an error getting the status of the peg-in transaction from the Flyover server', + error.message, + )); + }); + }); + } + + public getPegoutStatus(quoteHash: string) { + return new Promise((resolve, reject) => { + this.flyover?.getPegoutStatus(quoteHash) + .then((detailedStatus) => { + const status = FlyoverUtils.getSimpleQuoteStatus(detailedStatus.status.state); + resolve(status); + }) + .catch((error) => { + reject(new ServiceError( + 'FlyoverService', + 'getPegoutStatus', + 'There was an error getting the status of the peg-out transaction from the Flyover server', + error.message, + )); + }); + }); + } } diff --git a/src/common/services/LeatherService.ts b/src/common/services/LeatherService.ts index 21979dcb2..c8a2e3683 100644 --- a/src/common/services/LeatherService.ts +++ b/src/common/services/LeatherService.ts @@ -2,7 +2,6 @@ import * as bitcoin from 'bitcoinjs-lib'; import { BtcAccount, WalletAddress, - Step, SignedTx, } from '@/common/types'; import { WalletService } from '@/common/services/index'; @@ -10,7 +9,6 @@ import * as constants from '@/common/store/constants'; import { LeatherTx } from '@/pegin/middleware/TxBuilder/LeatherTxBuilder'; import { AppConfig, UserSession, showConnect } from '@stacks/connect'; import { - RpcErrorResponse, LeatherProvider, RpcResponse, } from '@leather.io/rpc'; @@ -36,33 +34,7 @@ export default class LeatherService extends WalletService { // eslint-disable-next-line class-methods-use-this public availableAccounts(): BtcAccount[] { return [ - constants.BITCOIN_NATIVE_SEGWIT_ADDRESS, - ]; - } - - // eslint-disable-next-line class-methods-use-this - confirmationSteps(): Step[] { - return [ - { - title: 'Transaction information', - subtitle: '', - outputsToshow: { - opReturn: { - value: false, - amount: true, - }, - change: { - address: false, - amount: true, - }, - federation: { - address: true, - amount: true, - }, - }, - fee: true, - fullAmount: false, - }, + BtcAccount.BITCOIN_NATIVE_SEGWIT_ADDRESS, ]; } @@ -127,17 +99,11 @@ export default class LeatherService extends WalletService { const { hex } = response.result; const signedPsbt = bitcoin.Psbt.fromHex(hex) .finalizeAllInputs() - .extractTransaction() + .extractTransaction(true) .toHex(); resolve({ signedTx: signedPsbt }); }) - .catch((e: typeof RpcErrorResponse) => { - if (e.error.code) { - reject(new Error(e.error.message)); - } else { - reject(e); - } - }); + .catch(reject); }); } diff --git a/src/common/services/LedgerService.ts b/src/common/services/LedgerService.ts index 24b0ba8f6..af52c28a3 100644 --- a/src/common/services/LedgerService.ts +++ b/src/common/services/LedgerService.ts @@ -4,7 +4,7 @@ import * as bitcoin from 'bitcoinjs-lib'; import * as constants from '@/common/store/constants'; import { BtcAccount, WalletAddress } from '@/common/types/pegInTx'; import { - LedgerjsTransaction, LedgerSignedTx, LedgerTx, Step, Tx, + LedgerjsTransaction, LedgerSignedTx, LedgerTx, Tx, } from '@/common/types'; import { EnvironmentAccessorService } from '@/common/services/enviroment-accessor.service'; import { WalletService } from '@/common/services/index'; @@ -22,9 +22,9 @@ export default class LedgerService extends WalletService { // eslint-disable-next-line class-methods-use-this public availableAccounts(): BtcAccount[] { return [ - constants.BITCOIN_LEGACY_ADDRESS, - constants.BITCOIN_SEGWIT_ADDRESS, - constants.BITCOIN_NATIVE_SEGWIT_ADDRESS, + BtcAccount.BITCOIN_LEGACY_ADDRESS, + BtcAccount.BITCOIN_SEGWIT_ADDRESS, + BtcAccount.BITCOIN_NATIVE_SEGWIT_ADDRESS, ]; } @@ -33,92 +33,6 @@ export default class LedgerService extends WalletService { return constants.WALLET_NAMES.LEDGER; } - // eslint-disable-next-line class-methods-use-this - confirmationSteps(): Step[] { - return [ - { - title: 'Confirm transaction', - subtitle: 'Please check your Ledger device', - outputsToshow: { - opReturn: { - value: true, - amount: true, - }, - change: { - address: false, - amount: false, - }, - federation: { - address: false, - amount: false, - }, - }, - fee: false, - fullAmount: false, - }, - { - title: 'Confirm funds transfer', - subtitle: 'Confirm sending', - outputsToshow: { - opReturn: { - value: false, - amount: false, - }, - change: { - address: false, - amount: false, - }, - federation: { - address: true, - amount: true, - }, - }, - fee: false, - fullAmount: false, - }, - { - title: 'Confirm change address', - subtitle: 'Confirm sending', - outputsToshow: { - opReturn: { - value: false, - amount: false, - }, - change: { - address: true, - amount: true, - }, - federation: { - address: false, - amount: false, - }, - }, - fee: false, - fullAmount: false, - }, - { - title: 'Confirm transaction fee', - subtitle: 'Confirm transaction', - outputsToshow: { - opReturn: { - value: false, - amount: false, - }, - change: { - address: false, - amount: false, - }, - federation: { - address: false, - amount: false, - }, - }, - fee: true, - fullAmount: false, - }, - ]; - } - // eslint-disable-next-line class-methods-use-this public reconnect(): Promise { return new Promise((resolve, reject) => { @@ -199,14 +113,14 @@ export default class LedgerService extends WalletService { let addressList: Array = []; const { legacy, segwit, nativeSegwit } = this.addressesToFetch; addressList = addressList.concat( - this.getDerivedAddresses(legacy.count, legacy.lastIndex, constants.BITCOIN_LEGACY_ADDRESS), + this.getDerivedAddresses(legacy.count, legacy.lastIndex, BtcAccount.BITCOIN_LEGACY_ADDRESS), ).concat( - this.getDerivedAddresses(segwit.count, segwit.lastIndex, constants.BITCOIN_SEGWIT_ADDRESS), + this.getDerivedAddresses(segwit.count, segwit.lastIndex, BtcAccount.BITCOIN_SEGWIT_ADDRESS), ).concat( this.getDerivedAddresses( nativeSegwit.count, nativeSegwit.lastIndex, - constants.BITCOIN_NATIVE_SEGWIT_ADDRESS, + BtcAccount.BITCOIN_NATIVE_SEGWIT_ADDRESS, ), ); return addressList; diff --git a/src/common/services/TrezorService.ts b/src/common/services/TrezorService.ts index 0f7d6d4f5..1c6f4c2e5 100644 --- a/src/common/services/TrezorService.ts +++ b/src/common/services/TrezorService.ts @@ -6,7 +6,6 @@ import * as constants from '@/common/store/constants'; import { GetAddress, SignedTx, - Step, TrezorTx, Tx, } from '@/common/types'; import { WalletService } from '@/common/services/index'; @@ -58,95 +57,9 @@ export default class TrezorService extends WalletService { // eslint-disable-next-line class-methods-use-this public availableAccounts(): BtcAccount[] { return [ - constants.BITCOIN_LEGACY_ADDRESS, - constants.BITCOIN_SEGWIT_ADDRESS, - constants.BITCOIN_NATIVE_SEGWIT_ADDRESS, - ]; - } - - // eslint-disable-next-line class-methods-use-this - confirmationSteps(): Step[] { - return [ - { - title: 'Confirm transaction', - subtitle: 'Please check your Trezor device', - outputsToshow: { - opReturn: { - value: true, - amount: true, - }, - change: { - address: false, - amount: false, - }, - federation: { - address: false, - amount: false, - }, - }, - fee: false, - fullAmount: false, - }, - { - title: 'Confirm funds transfer', - subtitle: 'Confirm sending', - outputsToshow: { - opReturn: { - value: false, - amount: false, - }, - change: { - address: false, - amount: false, - }, - federation: { - address: true, - amount: true, - }, - }, - fee: false, - fullAmount: false, - }, - { - title: 'Confirm change address', - subtitle: 'Confirm sending', - outputsToshow: { - opReturn: { - value: false, - amount: false, - }, - change: { - address: true, - amount: true, - }, - federation: { - address: false, - amount: false, - }, - }, - fee: false, - fullAmount: false, - }, - { - title: 'Confirm transaction fee', - subtitle: 'Really send', - outputsToshow: { - opReturn: { - value: false, - amount: false, - }, - change: { - address: false, - amount: false, - }, - federation: { - address: false, - amount: false, - }, - }, - fee: true, - fullAmount: true, - }, + BtcAccount.BITCOIN_LEGACY_ADDRESS, + BtcAccount.BITCOIN_SEGWIT_ADDRESS, + BtcAccount.BITCOIN_NATIVE_SEGWIT_ADDRESS, ]; } diff --git a/src/common/services/WalletService.ts b/src/common/services/WalletService.ts index fc0bced3d..3c7363e59 100644 --- a/src/common/services/WalletService.ts +++ b/src/common/services/WalletService.ts @@ -1,7 +1,7 @@ import * as constants from '@/common/store/constants'; import SatoshiBig from '@/common/types/SatoshiBig'; import { - Purpose, SignedTx, WalletCount, Step, + Purpose, SignedTx, WalletCount, } from '@/common/types/Wallets'; import { AccountBalance, AddressStatus, AppNetwork, BtcAccount, Tx, UtxoListPerAccount, WalletAddress, @@ -91,8 +91,6 @@ export default abstract class WalletService { abstract availableAccounts(): Array; - abstract confirmationSteps(): Array; - get isLoadingBalances(): boolean { return this.loadingBalances; } @@ -187,7 +185,7 @@ export default abstract class WalletService { return (this.subscribers.length > 0); } - public async startAskingForBalance(sessionId: string, maxAmountPegin: number): Promise { + public async startAskingForBalance(): Promise { this.balanceAccumulated = { legacy: new SatoshiBig(0, 'satoshi'), segwit: new SatoshiBig(0, 'satoshi'), @@ -210,13 +208,6 @@ export default abstract class WalletService { while (this.hasSubscribers() && !this.areEnoughUnusedAddresses()) { // eslint-disable-next-line no-await-in-loop await this.askForBalance(); - const maxAmountPeginCompare = new SatoshiBig(maxAmountPegin, 'satoshi'); - if (this.balanceAccumulated.legacy.gte(maxAmountPeginCompare) - && this.balanceAccumulated.segwit.gte(maxAmountPeginCompare) - && this.balanceAccumulated.nativeSegwit.gte(maxAmountPeginCompare) - ) { - break; - } this.setAddressesToFetch(); const maxIndexReached = Math.max( this.addressesToFetch.legacy.lastIndex, @@ -303,9 +294,9 @@ export default abstract class WalletService { protected async setAccountsXpub(accountIdx: number): Promise { this.extendedPubKeys = { - p2pkh: await this.getXpub(constants.BITCOIN_LEGACY_ADDRESS, accountIdx), - p2sh: await this.getXpub(constants.BITCOIN_SEGWIT_ADDRESS, accountIdx), - p2wpkh: await this.getXpub(constants.BITCOIN_NATIVE_SEGWIT_ADDRESS, accountIdx), + p2pkh: await this.getXpub(BtcAccount.BITCOIN_LEGACY_ADDRESS, accountIdx), + p2sh: await this.getXpub(BtcAccount.BITCOIN_SEGWIT_ADDRESS, accountIdx), + p2wpkh: await this.getXpub(BtcAccount.BITCOIN_NATIVE_SEGWIT_ADDRESS, accountIdx), }; } diff --git a/src/common/services/XverseService.ts b/src/common/services/XverseService.ts new file mode 100644 index 000000000..f86385485 --- /dev/null +++ b/src/common/services/XverseService.ts @@ -0,0 +1,150 @@ +/* eslint-disable class-methods-use-this */ +import Wallet, { AddressPurpose, BitcoinNetworkType } from 'sats-connect'; +import * as bitcoin from 'bitcoinjs-lib'; +import { WalletService } from '@/common/services/index'; +import * as constants from '@/common/store/constants'; +import { + WalletAddress, Tx, SignedTx, BtcAccount, Step, + XverseTx, +} from '../types'; + +export default class XverseService extends WalletService { + satsBtcNetwork: BitcoinNetworkType; + + constructor() { + super(); + switch (this.network) { + case constants.BTC_NETWORK_MAINNET: + this.satsBtcNetwork = BitcoinNetworkType.Mainnet; + break; + default: + this.satsBtcNetwork = BitcoinNetworkType.Testnet; + break; + } + } + + async getAccountAddresses(): Promise { + // @ts-expect-error method type not provided + const permissions = await Wallet.request('wallet_getCurrentPermissions', undefined); + if (permissions.status !== 'success') { + // @ts-expect-error method type not provided + await Wallet.request('wallet_requestPermissions', undefined); + } + return new Promise((resolve, reject) => { + const walletAddresses: WalletAddress[] = []; + const payload = { + purposes: ['payment'] as AddressPurpose[], + message: 'Welcome to the Powpeg app, please select your Bitcoin account to start.', + network: { + type: this.satsBtcNetwork, + }, + }; + Wallet.request('getAddresses', payload) + .then((response) => { + if (response.status === 'error') { + reject(new Error(response.error.message)); + } else { + response.result.addresses + .forEach((addr: { address: string; publicKey: string; }) => { + walletAddresses.push({ + address: addr.address, + publicKey: addr.publicKey, + derivationPath: '', + }); + }); + } + resolve(walletAddresses); + }) + .catch(reject); + }); + } + + sign(tx: Tx): Promise { + const xverseTx = tx as XverseTx; + return new Promise((resolve, reject) => { + const signInputs: Record = {}; + xverseTx.inputs.forEach((input: { address: string; idx: number; }, inputIdx: number) => { + if (signInputs[input.address]) { + signInputs[input.address].push(inputIdx); + } else { + signInputs[input.address] = [inputIdx]; + } + }); + const signPsbtOptions = { + psbt: xverseTx.base64UnsignedPsbt, + signInputs, + broadcast: false, + }; + Wallet.request('signPsbt', signPsbtOptions) + .then((response) => { + if (response.status === 'error') { + reject(new Error(response.error.message)); + } else { + const signedPsbt = bitcoin.Psbt.fromBase64(response.result.psbt as string); + if (!signedPsbt.validateSignaturesOfAllInputs()) { + reject(new Error('Invalid signature provided')); + } else { + resolve({ + signedTx: signedPsbt.finalizeAllInputs().extractTransaction().toHex(), + }); + } + } + }) + .catch(() => reject(new Error('Invalid psbt provided'))); + }); + } + + isConnected(): Promise { + return Promise.resolve(true); + } + + reconnect(): Promise { + return new Promise((resolve, reject) => { + this.getAccountAddresses() + .then(() => resolve()) + .catch(reject); + }); + } + + // eslint-disable-next-line @typescript-eslint/no-unused-vars + getXpub(accountType: BtcAccount, accountNumber: number): Promise { + throw new Error('Method not supported.'); + } + + areEnoughUnusedAddresses(): boolean { + return this.addressesToFetch.segwit.lastIndex >= 1; + } + + availableAccounts(): BtcAccount[] { + return [BtcAccount.BITCOIN_SEGWIT_ADDRESS]; + } + + name(): Record<'formal_name' | 'short_name' | 'long_name', string> { + return constants.WALLET_NAMES.XVERSE; + } + + confirmationSteps(): Step[] { + return [ + { + title: 'Transaction information', + subtitle: '', + outputsToshow: { + opReturn: { + value: false, + amount: true, + }, + change: { + address: true, + amount: true, + }, + federation: { + address: true, + amount: true, + }, + }, + fullAmount: false, + fee: true, + }, + ]; + } +} diff --git a/src/common/services/index.ts b/src/common/services/index.ts index 17c102547..91e111e62 100644 --- a/src/common/services/index.ts +++ b/src/common/services/index.ts @@ -4,3 +4,5 @@ export { default as TrezorService } from './TrezorService'; export { default as LedgerService } from './LedgerService'; export { default as LeatherService } from './LeatherService'; export { default as FlyoverService } from './FlyoverService'; +export { default as XverseService } from './XverseService'; +export { default as EnkryptService } from './EnkryptService'; diff --git a/src/common/store/constants.ts b/src/common/store/constants.ts index a7796c314..67404a510 100644 --- a/src/common/store/constants.ts +++ b/src/common/store/constants.ts @@ -3,6 +3,8 @@ export const WALLET_NAMES = { TREZOR: { formal_name: 'Trezor', short_name: 'trezor', long_name: 'WALLET_TREZOR' }, METAMASK: { formal_name: 'Metamask', short_name: 'metamask', long_name: 'WALLET_METAMASK' }, LEATHER: { formal_name: 'Leather', short_name: 'leather', long_name: 'WALLET_LEATHER' }, + XVERSE: { formal_name: 'XVerse', short_name: 'xverse', long_name: 'WALLET_XVERSE' }, + ENKRYPT: { formal_name: 'Enkrypt', short_name: 'enkrypt', long_name: 'WALLET_ENKRYPT' }, } as const; export const OPERATION_TYPE = 'OPERATION_TYPE'; @@ -11,8 +13,6 @@ export const OPERATION_AMOUNT = 'OPERATION_AMOUNT'; export const DERIVE_BTC_ADDRESS_DOCUMENTATION_URL = 'https://dev.rootstock.io/guides/two-way-peg-app/pegout/deriving-electrum/'; export const RLOGIN_METAMASK_WALLET = 'MetaMask'; -export const TOTAL_RBTC_STOCK = 21000000; - // devices export const IS_TREZOR_CONNECTED = 'IS_TREZOR_CONNECTED'; @@ -54,6 +54,7 @@ export const PEGIN_TX_ADD_STATUS_SAFE_FEE = 'PEGIN_TX_ADD_STATUS_SAFE_FEE'; export const PEGIN_TX_ADD_STATUS_REFUND_ADDRESS = 'PEGIN_TX_ADD_STATUS_REFUND_ADDRESS'; export const PEGIN_TX_ADD_STATUS_TX_ID = 'PEGIN_TX_ADD_STATUS_TX_ID'; export const PEGIN_TX_ADD_PEGIN_TYPE = 'PEGIN_TX_ADD_PEGIN_TYPE'; +export const PEGIN_TX_SET_CURRENT_VIEW = 'PEGIN_TX_SET_CURRENT_VIEW'; // PegOut actions export const PEGOUT_TX_INIT = 'PEGOUT_TX_INIT'; @@ -79,12 +80,10 @@ export const FLYOVER_PEGOUT_GET_FINAL_QUOTE = 'FLYOVER_PEGOUT_GET_FINAL_QUOTE'; export const FLYOVER_PEGOUT_CLEAR_QUOTES = 'FLYOVER_PEGOUT_CLEAR_QUOTES'; export const FLYOVER_PEGOUT_SET_SELECTED_QUOTE_HASH = 'FLYOVER_PEGOUT_SET_SELECTED_QUOTE_HASH'; export const FLYOVER_PEGOUT_CLEAR_QUOTE_DIFFERENCES = 'FLYOVER_PEGOUT_CLEAR_QUOTE_DIFFERENCES'; - -// View actions -export const VIEW_ADD_CURRENT_VIEW = 'VIEW_ADD_CURRENT_VIEW'; +export const FLYOVER_PEGOUT_GET_AVAILABLE_LIQUIDITY = 'FLYOVER_PEGOUT_GET_AVAILABLE_LIQUIDITY'; +export const FLYOVER_PEGOUT_ACCEPT_AND_SEND_QUOTE_WITH_CHANGED_CONDITIONS = 'FLYOVER_PEGOUT_ACCEPT_AND_SEND_QUOTE_WITH_CHANGED_CONDITIONS'; // Flyover PegIn actions - export const FLYOVER_PEGIN_INIT = 'FLYOVER_PEGIN_INIT'; export const FLYOVER_PEGIN_GET_PROVIDERS = 'FLYOVER_PEGIN_GET_PROVIDERS'; export const FLYOVER_PEGIN_ADD_AMOUNT = 'FLYOVER_PEGIN_ADD_AMOUNT'; @@ -93,6 +92,8 @@ export const FLYOVER_PEGIN_USE_LIQUIDITY_PROVIDER = 'FLYOVER_PEGIN_USE_LIQUIDITY export const FLYOVER_PEGIN_GET_QUOTES = 'FLYOVER_PEGIN_GET_QUOTES'; export const FLYOVER_PEGIN_ADD_SELECTED_QUOTE = 'FLYOVER_PEGIN_ADD_SELECTED_QUOTE'; export const FLYOVER_PEGIN_CLEAR_QUOTES = 'FLYOVER_PEGIN_CLEAR_QUOTES'; +export const FLYOVER_PEGIN_GET_AVAILABLE_LIQUIDITY = 'FLYOVER_PEGIN_GET_AVAILABLE_LIQUIDITY'; +export const FLYOVER_PEGIN_ACCEPT_QUOTE = 'FLYOVER_PEGIN_ACCEPT_QUOTE'; // Hardcoded address for Leather wallet FYI the bridge requires a // BTC address but is not really used during PEGIN-FLYOVER process. export const VALID_ADDRESS_UNUSED_BY_FLYOVER = { @@ -113,6 +114,8 @@ export const SESSION_ADD_TERMS_AND_CONDITIONS_ENABLED = 'SESSION_ADD_TERMS_AND_C export const SESSION_SWITCH_LOCALE = 'SESSION_SWITCH_LOCALE'; export const SESSION_ADD_FEATURES = 'SESSION_ADD_FEATURES'; export const SESSION_ADD_API_VERSION = 'SESSION_ADD_API_VERSION'; +export const SESSION_COUNTDOWN_GRECAPTCHA_TIME = 'SESSION_COUNTDOWN_GRECAPTCHA_TIME'; +export const SESSION_CLEAR_GRECAPTCHA_INTERVAL = 'SESSION_CLEAR_GRECAPTCHA_INTERVAL'; // Pegin tx Mutations export const PEGIN_TX_SET_ADDRESS_LIST = 'PEGIN_TX_SET_ADDRESS_LIST'; @@ -140,6 +143,7 @@ export const PEGIN_TX_SET_STATUS_SAFE_FEE = 'PEGIN_TX_SET_STATUS_SAFE_FEE'; export const PEGIN_TX_SET_STATUS_REFUND_ADDRESS = 'PEGIN_TX_SET_STATUS_REFUND_ADDRESS'; export const PEGIN_TX_SET_STATUS_TX_ID = 'PEGIN_TX_SET_STATUS_TX_ID'; export const PEGIN_TX_SET_PEGIN_TYPE = 'PEGIN_TX_SET_PEGIN_TYPE'; +export const PEGIN_TX_SET_VIEW = 'PEGIN_TX_SET_VIEW'; // PegOut mutations export const PEGOUT_TX_SET_SELECTED_FEE_LEVEL = 'PEGOUT_TX_SET_SELECTED_FEE_LEVEL'; @@ -162,18 +166,17 @@ export const FLYOVER_PEGOUT_SET_CLEAR_STATE = 'FLYOVER_PEGOUT_SET_CLEAR_STATE'; export const FLYOVER_PEGOUT_SET_BTC_ADDRESS = 'FLYOVER_PEGOUT_SET_BTC_ADDRESS'; export const FLYOVER_PEGOUT_SET_TX_HASH = 'FLYOVER_PEGOUT_SET_TX_HASH'; export const FLYOVER_PEGOUT_SET_SELECTED_QUOTE = 'FLYOVER_PEGOUT_SET_SELECTED_QUOTE'; -export const FLYOVER_PEGOUT_SET_QUOTES_DIFFERENCES = 'FLYOVER_PEGOUT_SET_QUOTES_DIFFERENCES'; - -// View mutations -export const VIEW_SET_CURRENT_VIEW = 'VIEW_SET_CURRENT_VIEW'; +export const FLYOVER_PEGOUT_SET_QUOTES_DIFFERENCE = 'FLYOVER_PEGOUT_SET_QUOTES_DIFFERENCE'; +export const FLYOVER_PEGOUT_PROVIDERS_SET_AVAILABLE_LIQUIDITY = 'FLYOVER_PEGOUT_PROVIDERS_SET_AVAILABLE_LIQUIDITY'; // Flyover PegIn mutations - export const FLYOVER_PEGIN_SET_PROVIDERS = 'FLYOVER_PEGIN_SET_PROVIDERS'; export const FLYOVER_PEGIN_SET_AMOUNT = 'FLYOVER_PEGIN_SET_AMOUNT'; export const FLYOVER_PEGIN_SET_ROOTSTOCK_ADDRESS = 'FLYOVER_PEGIN_SET_ROOTSTOCK_ADDRESS'; export const FLYOVER_PEGIN_SET_QUOTES = 'FLYOVER_PEGIN_SET_QUOTES'; export const FLYOVER_PEGIN_SET_SELECTED_QUOTE = 'FLYOVER_PEGIN_SET_SELECTED_QUOTE'; +export const FLYOVER_PEGIN_PROVIDERS_SET_AVAILABLE_LIQUIDITY = 'FLYOVER_PEGIN_PROVIDERS_SET_AVAILABLE_LIQUIDITY'; +export const FLYOVER_PEGIN_SET_ACCEPTED_QUOTE_SIGNATURE = 'FLYOVER_PEGIN_SET_ACCEPTED_QUOTE_SIGNATURE'; // Session mutations export const SESSION_SET_ACCOUNT = 'SESSION_SET_ACCOUNT'; @@ -194,6 +197,9 @@ export const SESSION_SET_FEATURES = 'SESSION_SET_FEATURES'; export const SESSION_GET_RBTC_GAS_FEE = 'SESSION_GET_RBTC_GAS_FEE'; export const SESSION_SET_API_VERSION = 'SESSION_SET_API_VERSION'; export const SESSION_SETUP_EVENTS = 'SESSION_SETUP_EVENTS'; +export const SESSION_SET_DECREMENT_GRECAPTCHA_COUNTDOWN = 'SESSION_SET_GRECAPTCHA_COUNTDOWN'; +export const SESSION_SET_GRECAPTCHA_INTERVAL = 'SESSION_SET_GRECAPTCHA_INTERVAL'; +export const SESSION_RESET_GRECAPTCHA_COUNTDOWN = 'SESSION_RESET_GRECAPTCHA_COUNTDOWN'; // Pegin tx getters export const WALLET_NAME = 'WALLET_NAME'; @@ -210,6 +216,8 @@ export const PEGIN_TX_IS_ENOUGH_BALANCE = 'PEGIN_TX_IS_ENOUGH_BALANCE'; export const PEGIN_TX_GET_SELECTED_ACCOUNT_TYPE = 'PEGIN_TX_GET_SELECTED_ACCOUNT_TYPE'; export const PEGIN_TX_GET_ACCOUNT_UTXO_LIST = 'PEGIN_TX_GET_ACCOUNT_UTXO_LIST'; export const PEGIN_TX_GET_SELECTED_UTXO_LIST = 'PEGIN_TX_GET_SELECTED_UTXO_LIST'; +export const PEGIN_TX_IS_HD_WALLET = 'PEGIN_TX_IS_HD_WALLET'; +export const PEGIN_TX_IS_SF_WALLET = 'PEGIN_TX_IS_SF_WALLET'; // PegOut tx getters export const PEGOUT_TX_GET_SAFE_TX_FEE = 'PEGOUT_TX_GET_SAFE_TX_FEE'; @@ -220,9 +228,6 @@ export const PEGOUT_TX_EVENT_TRANSACTION_HASH = 'transactionHash'; export const PEGIN_TX_GET_ENOUGH_FEE_VALUE = 'PEGIN_TX_GET_ENOUGH_FEE_VALUE'; // View getters -export const VIEW_GET_CURRENT_VIEW = 'VIEW_GET_CURRENT_VIEW'; -export const PEGIN_TX_IS_HD_WALLET = 'PEGIN_TX_IS_HD_WALLET'; -export const PEGIN_TX_IS_SF_WALLET = 'PEGIN_TX_IS_SF_WALLET'; // Session getters export const SESSION_IN_TX_FLOW = 'SESSION_IN_TX_FLOW'; @@ -261,6 +266,7 @@ export const STATUS_CLEAR = 'STATUS_CLEAR'; export const PEGOUT_TX_ADD_BITCOIN_PRICE = 'PEGOUT_TX_ADD_BITCOIN_PRICE'; export const STATUS_GET_ESTIMATED_FEE = 'STATUS_GET_ESTIMATED_FEE'; export const STATUS_GET_ESTIMATED_RELEASE_TIME_IN_MINUTES = 'STATUS_GET_ESTIMATED_RELEASE_TIME_IN_MINUTES'; +export const STATUS_GET_FLYOVER_STATUS = 'STATUS_GET_FLYOVER_STATUS'; // Status mutations export const STATUS_SET_TX_DETAILS = 'STATUS_SET_TX_DETAILS'; @@ -268,6 +274,7 @@ export const STATUS_SET_TX_TYPE = 'STATUS_SET_TX_TYPE'; export const STATUS_SET_CLEAR = 'STATUS_SET_CLEAR'; export const STATUS_SET_BTC_ESTIMATED_FEE = 'STATUS_SET_BTC_ESTIMATED_FEE'; export const STATUS_SET_ESTIMATED_RELEASE_TIME_IN_MINUTES = 'STATUS_SET_ESTIMATED_RELEASE_TIME_IN_MINUTES'; +export const STATUS_SET_FLYOVER_STATUS = 'STATUS_SET_FLYOVER_STATUS'; // Status getters export const STATUS_IS_REJECTED = 'STATUS_IS_REJECTED'; @@ -286,11 +293,13 @@ export enum PegStatus { ERROR_NOT_A_PEGIN = 'ERROR_NOT_A_PEGIN', ERROR_BELOW_MIN = 'ERROR_BELOW_MIN', ERROR_UNEXPECTED = 'ERROR_UNEXPECTED', + BLOCKBOOK_FAILED = 'BLOCKBOOK_FAILED', } export enum FlyoverStatus { PENDING = 'PENDING', - COMPLETED = 'COMPLETED', + SUCCESS = 'SUCCESS', + FAILED = 'FAILED', } export const LEDGER_STATUS_CODES = { @@ -349,10 +358,37 @@ export const POWPEG_RSKT_HEADER = '52534b5401'; export const PEGIN_OUTPUTS = 3; export const COOKIE_EXPIRATION_HOURS = 12; +export const ENABLED = 'enabled'; +export const DISABLED = 'disabled'; + export enum peginType { POWPEG = 'POWPEG', FLYOVER = 'FLYOVER' } +export enum pegoutType { + POWPEG = 'POWPEG', + FLYOVER = 'FLYOVER' +} + export const BTC_AVG_BLOCK_TIME_IN_SECONDS = 600; export const RSK_AVG_BLOCK_TIME_IN_SECONDS = 30; +export const FULFILLED = 'fulfilled'; + +export enum FlyoverCallResult { + SUCCESS = 'success', + ERROR = 'error', +} + +export enum FlyoverCallFunction { + LPS = 'getLps', + QUOTE = 'getQuote', +} + +export enum RejectedPegoutReasons { + LOW_AMOUNT = 'LOW_AMOUNT', + CALLER_CONTRACT = 'CALLER_CONTRACT', + FEE_ABOVE_VALUE = 'FEE_ABOVE_VALUE', +} + +export const RECAPTCHA_NEW_TOKEN_TIME = 30; diff --git a/src/common/store/helper.ts b/src/common/store/helper.ts index e698541f1..72929151c 100644 --- a/src/common/store/helper.ts +++ b/src/common/store/helper.ts @@ -17,10 +17,10 @@ export function useGetters(module: string, getters: string[]) { return Object.fromEntries(keyPair); } -export function useAction(module: string, action: string) { +export function useAction(module: string, action: string) { const store = useStore(); // eslint-disable-next-line - return async (param?: any): Promise => store.dispatch(`${module}/${action}`, param); + return async (param?: any): Promise => store.dispatch(`${module}/${action}`, param); } export function useGetter(module: string, getter: string): ComputedRef { diff --git a/src/common/store/index.ts b/src/common/store/index.ts index 415ae3592..0a2f6501b 100644 --- a/src/common/store/index.ts +++ b/src/common/store/index.ts @@ -6,7 +6,6 @@ import { flyoverPegin } from '@/pegin/store/FlyoverPegin'; import { pegOutTx } from '@/pegout/store/pegoutTx'; import { flyoverPegout } from '@/pegout/store/FlyoverPegout'; import { web3Session } from './session'; -import { view } from './view'; import pkg from '../../../package.json'; const store: StoreOptions = { @@ -19,7 +18,6 @@ const store: StoreOptions = { modules: { pegInTx, web3Session, - view, status, pegOutTx, flyoverPegout, diff --git a/src/common/store/session/actions.ts b/src/common/store/session/actions.ts index cd2cb481e..f16d9f9bd 100644 --- a/src/common/store/session/actions.ts +++ b/src/common/store/session/actions.ts @@ -19,7 +19,8 @@ import { toUtf8Bytes } from 'ethers/lib/utils'; export const actions: ActionTree = { [constants.SESSION_CONNECT_WEB3]: ({ commit, state, dispatch }): Promise => { - const rLogin = state.rLoginInstance === undefined ? getRloginInstance() : state.rLoginInstance; + const rLogin = state.rLoginInstance === undefined + ? getRloginInstance(state.features) : state.rLoginInstance; return new Promise((resolve, reject) => { rLogin.connect() .then((rLoginResponse) => { @@ -28,6 +29,7 @@ export const actions: ActionTree = { commit(constants.SESSION_SET_RLOGIN, rLoginResponse); commit(constants.SESSION_SET_RLOGIN_INSTANCE, rLogin); commit(constants.SESSION_SET_WEB3_INSTANCE, markRaw(provider)); + provider.on('block', () => dispatch(constants.WEB3_SESSION_ADD_BALANCE)); return provider.listAccounts(); }) .then((accounts) => { @@ -139,4 +141,21 @@ export const actions: ActionTree = { dispatch(constants.WEB3_SESSION_GET_ACCOUNT); }); }, + [constants.SESSION_COUNTDOWN_GRECAPTCHA_TIME]: ({ state, commit, dispatch }) => { + const intervalId = setInterval(() => { + if (state.grecaptchaCountdown > 0) { + commit(constants.SESSION_SET_DECREMENT_GRECAPTCHA_COUNTDOWN); + } else { + dispatch(constants.SESSION_CLEAR_GRECAPTCHA_INTERVAL); + } + }, 1000); + commit(constants.SESSION_SET_GRECAPTCHA_INTERVAL, intervalId); + }, + [constants.SESSION_CLEAR_GRECAPTCHA_INTERVAL]: ({ state, commit }) => { + const { grecaptchaIntervalId } = state; + if (grecaptchaIntervalId) { + clearInterval(grecaptchaIntervalId); + commit(constants.SESSION_RESET_GRECAPTCHA_COUNTDOWN); + } + }, }; diff --git a/src/common/store/session/mutations.ts b/src/common/store/session/mutations.ts index b54b3c9a1..d50745fe3 100644 --- a/src/common/store/session/mutations.ts +++ b/src/common/store/session/mutations.ts @@ -5,6 +5,7 @@ import { TransactionType, SessionState } from '@/common/types/session'; import { getClearSessionState } from '@/common/utils'; import { providers } from 'ethers'; import i18n from '@/i18n'; +import { EnvironmentAccessorService } from '@/common/services/enviroment-accessor.service'; export const mutations: MutationTree = { [constants.SESSION_SET_ACCOUNT]: (state, account: string) => { @@ -57,4 +58,16 @@ export const mutations: MutationTree = { [constants.SESSION_SET_API_VERSION]: (state, apiVersion: string) => { state.apiVersion = apiVersion; }, + [constants.SESSION_RESET_GRECAPTCHA_COUNTDOWN]: (state) => { + state.grecaptchaCountdown = EnvironmentAccessorService.getEnvironmentVariables() + .grecaptchaTime; + }, + [constants.SESSION_SET_DECREMENT_GRECAPTCHA_COUNTDOWN]: (state) => { + if (state.grecaptchaCountdown > 0) { + state.grecaptchaCountdown -= 1; + } + }, + [constants.SESSION_SET_GRECAPTCHA_INTERVAL]: (state, intervalId: number) => { + state.grecaptchaIntervalId = intervalId; + }, }; diff --git a/src/common/store/view/actions.ts b/src/common/store/view/actions.ts deleted file mode 100644 index 2d771f155..000000000 --- a/src/common/store/view/actions.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { ActionTree } from 'vuex'; -import { ViewState, RootState } from '@/common/types'; -import * as constants from '@/common/store/constants'; - -export const actions: ActionTree = { - [constants.VIEW_ADD_CURRENT_VIEW]: ({ commit }, view: string): void => { - commit(constants.VIEW_SET_CURRENT_VIEW, view); - }, -}; diff --git a/src/common/store/view/getters.ts b/src/common/store/view/getters.ts deleted file mode 100644 index bd7e4920f..000000000 --- a/src/common/store/view/getters.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { GetterTree } from 'vuex'; -import * as constants from '@/common/store/constants'; -import { ViewState, RootState } from '@/common/types'; - -export const getters: GetterTree = { - [constants.VIEW_GET_CURRENT_VIEW]: (state) => state.currentView, -}; diff --git a/src/common/store/view/index.ts b/src/common/store/view/index.ts deleted file mode 100644 index aa66c649d..000000000 --- a/src/common/store/view/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Module } from 'vuex'; -import { ViewState, RootState } from '@/common/types'; -import { actions } from './actions'; -import { mutations } from './mutations'; -import { getters } from './getters'; - -export const state: ViewState = { - currentView: '', -}; - -const namespaced = true; - -export const view: Module = { - namespaced, - state, - mutations, - actions, - getters, -}; diff --git a/src/common/store/view/mutations.ts b/src/common/store/view/mutations.ts deleted file mode 100644 index 0321180e9..000000000 --- a/src/common/store/view/mutations.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { MutationTree } from 'vuex'; -import * as constants from '@/common/store/constants'; -import { ViewState } from '@/common/types'; - -export const mutations: MutationTree = { - [constants.VIEW_SET_CURRENT_VIEW]: (state, view: string) => { - state.currentView = view; - }, -}; diff --git a/src/common/styles/_buttons.scss b/src/common/styles/_buttons.scss index 55b969e92..4c6363636 100644 --- a/src/common/styles/_buttons.scss +++ b/src/common/styles/_buttons.scss @@ -43,5 +43,6 @@ border-radius: 10px; height: 250px; min-width: 250px; + max-width: 250px; justify-content: flex-start; } diff --git a/src/common/styles/_cards.scss b/src/common/styles/_cards.scss index 0627c834b..a7a5918bc 100644 --- a/src/common/styles/_cards.scss +++ b/src/common/styles/_cards.scss @@ -10,3 +10,15 @@ border-color: rgba(var(--v-border-color), 1); } } + +.not-available { + position: relative; + .not-available-text { + position: absolute; + inset: 0; + background-color: rgba(var(--v-theme-background), 0.5); + backdrop-filter: blur(4px); + opacity: 1; + z-index: 1; + } +} diff --git a/src/common/styles/_home.scss b/src/common/styles/_home.scss index e29a23333..7112b2268 100644 --- a/src/common/styles/_home.scss +++ b/src/common/styles/_home.scss @@ -1,6 +1,6 @@ .home { input[type="checkbox"] { - accent-color: rgb(var(--v-theme-on-background)); + accent-color: rgb(var(--v-theme-green)); } .border-box { color: rgb(var(--v-theme-background)); diff --git a/src/common/styles/_inputs.scss b/src/common/styles/_inputs.scss index 6e3640392..acfcda14e 100644 --- a/src/common/styles/_inputs.scss +++ b/src/common/styles/_inputs.scss @@ -26,6 +26,7 @@ input[type=number].v-field__input, .v-select__selection, .amount-input input[typ font-size: 1.5rem; font-weight: 700; line-height: 1; + padding-block: 0; } .v-field--focused { diff --git a/src/common/styles/_utilities.scss b/src/common/styles/_utilities.scss index e9b818e67..c49032cdb 100644 --- a/src/common/styles/_utilities.scss +++ b/src/common/styles/_utilities.scss @@ -4,4 +4,12 @@ .text-balance { text-wrap: balance; +} + +.grecaptcha-badge { + bottom:70px !important; +} + +.opacity-100 { + opacity: 1; } \ No newline at end of file diff --git a/src/common/styles/main.scss b/src/common/styles/main.scss index 61b53c085..ad39dee14 100644 --- a/src/common/styles/main.scss +++ b/src/common/styles/main.scss @@ -26,3 +26,25 @@ a:hover { --v-avatar-height: 16px; } } + +.v-tooltip > .v-overlay__content { + background-color: rgb(var(--v-theme-bw-700)); + color: white; +} + +.rlogin-button.cancel { + border-radius: 6px; +} + +#rlogin-connect-modal { + .rlogin-modal-close-button::after { + inset: 0; + top: -3px; + display: flex; + align-items: center; + justify-content: center; + } + .rlogin-modal-card { + overflow: hidden; + } +} \ No newline at end of file diff --git a/src/common/types/Common.ts b/src/common/types/Common.ts index fa5c5b291..f6f1f19aa 100644 --- a/src/common/types/Common.ts +++ b/src/common/types/Common.ts @@ -1,7 +1,7 @@ import SatoshiBig from '@/common/types/SatoshiBig'; import { Utxo } from '@/common/types/pegInTx'; -import { PegoutStatus } from '@/common/types/store'; -import { PegStatus } from '@/common/store/constants'; +import { PegoutStatus, TxStatusType } from '@/common/types/store'; +import { FlyoverCallFunction, FlyoverCallResult, PegStatus } from '@/common/store/constants'; import WeiBig from './WeiBig'; export interface Tx { @@ -109,6 +109,7 @@ export interface PsbtExtendedInput { value: number; script: Buffer; }; + redeemScript?: Buffer; } export interface NormalizedSummary { @@ -125,18 +126,24 @@ export interface NormalizedSummary { federationAddress?: string; total?: string; status?: PegStatus | PegoutStatus; + btcTxId?: string; } export type AddressType = 'BITCOIN_LEGACY_ADDRESS' | 'BITCOIN_SEGWIT_ADDRESS' | 'BITCOIN_NATIVE_SEGWIT_ADDRESS' | 'BITCOIN_MULTISIGNATURE_ADDRESS' | 'BITCOIN_UNKNOWN_ADDRESS_TYPE'; -export interface ObjectDifference { - key: string; - oldValue: unknown; - newValue: unknown; -} - export enum AppLocale { LOCALE_EN = 'en', LOCALE_ES = 'es', } + +export interface XverseTx extends Tx { + base64UnsignedPsbt: string; + inputs: Array<{idx: number; address: string}>; +} + +export interface FlyoverCall { + operationType?: TxStatusType.FLYOVER_PEGIN | TxStatusType.FLYOVER_PEGOUT, + functionType: FlyoverCallFunction.LPS | FlyoverCallFunction.QUOTE, + result: FlyoverCallResult.ERROR | FlyoverCallResult.SUCCESS, +} diff --git a/src/common/types/Feature.ts b/src/common/types/Feature.ts index 611426072..0acd687b7 100644 --- a/src/common/types/Feature.ts +++ b/src/common/types/Feature.ts @@ -1,10 +1,36 @@ export enum FeatureNames { TERMS_AND_CONDITIONS = 'terms_and_conditions', FLYOVER_PEG_IN = 'flyover_pegin', - FLYOVER_PEG_OUT = 'flyover_pegout' + FLYOVER_PEG_OUT = 'flyover_pegout', + WALLET_EXODUS = 'wallet_exodus', + WALLET_ENKRYPT = 'wallet_enkrypt', + WALLET_XVERSE = 'wallet_xverse', + WALLET_LEATHER = 'wallet_leather', + WALLET_TREZOR = 'wallet_trezor', + WALLET_LEDGER = 'wallet_ledger', +} + +export enum Browser { + CHROME = 'Chrome', + FIREFOX = 'Firefox', + SAFARI = 'Safari', + EDGE = 'Edge', + BRAVE = 'Brave', + OPERA = 'Opera', +} + +export interface SupportedBrowsers { + chrome: boolean; + firefox: boolean; + safari: boolean; + edge: boolean; + brave: boolean; + chromium: boolean; + opera: boolean; } export interface Feature { name: FeatureNames; value: string; version: number; + supportedBrowsers: SupportedBrowsers; } diff --git a/src/common/types/Flyover.ts b/src/common/types/Flyover/Flyover.ts similarity index 91% rename from src/common/types/Flyover.ts rename to src/common/types/Flyover/Flyover.ts index 4155652a3..c70513cf4 100644 --- a/src/common/types/Flyover.ts +++ b/src/common/types/Flyover/Flyover.ts @@ -1,23 +1,26 @@ import { LiquidityProviderBase } from '@rsksmart/flyover-sdk'; -import WeiBig from './WeiBig'; -import SatoshiBig from './SatoshiBig'; +import WeiBig from '../WeiBig'; +import SatoshiBig from '../SatoshiBig'; interface PeginProviderDetail { fee: SatoshiBig; maxTransactionValue: SatoshiBig; minTransactionValue: SatoshiBig; requiredConfirmations: number; + availableLiquidity?: WeiBig; } interface PegoutProviderDetail { fee: WeiBig; maxTransactionValue: WeiBig; minTransactionValue: WeiBig; requiredConfirmations: number; + availableLiquidity?: SatoshiBig; } interface ProviderDetailResponse2WP { pegin: PeginProviderDetail; pegout: PegoutProviderDetail; siteKey: string; + liquidityCheckEnabled: boolean; } export type LiquidityProvider2WP = LiquidityProviderBase & ProviderDetailResponse2WP; diff --git a/src/common/types/FlyoverPegin.ts b/src/common/types/Flyover/FlyoverPegin.ts similarity index 51% rename from src/common/types/FlyoverPegin.ts rename to src/common/types/Flyover/FlyoverPegin.ts index f28780244..7963791ed 100644 --- a/src/common/types/FlyoverPegin.ts +++ b/src/common/types/Flyover/FlyoverPegin.ts @@ -1,7 +1,8 @@ -import { FlyoverService } from '../services'; -import { LiquidityProvider2WP, QuotePegIn2WP } from './Flyover'; -import SatoshiBig from './SatoshiBig'; -import WeiBig from './WeiBig'; +import { FlyoverService } from '../../services'; +import { LiquidityProvider2WP } from './Flyover'; +import SatoshiBig from '../SatoshiBig'; +import WeiBig from '../WeiBig'; +import PeginQuote from './PeginQuote'; export interface FlyoverPeginState { amountToTransfer: SatoshiBig; @@ -9,8 +10,9 @@ export interface FlyoverPeginState { rootstockRecipientAddress: string; valueToReceive: WeiBig; liquidityProviders: LiquidityProvider2WP[]; - quotes: Record; + quotes: Record; flyoverService: FlyoverService; txHash?: string; selectedQuoteHash: string; + acceptedQuoteSignature: string; } diff --git a/src/common/types/Flyover/FlyoverPegout.ts b/src/common/types/Flyover/FlyoverPegout.ts new file mode 100644 index 000000000..fdf483fec --- /dev/null +++ b/src/common/types/Flyover/FlyoverPegout.ts @@ -0,0 +1,30 @@ +import { LiquidityProvider2WP, QuotePegOut2WP } from '@/common/types'; +import { FlyoverService } from '../../services'; +import SatoshiBig from '../SatoshiBig'; +import WeiBig from '../WeiBig'; + +export interface ReducedQuote { + gasFee: WeiBig; + callFee: WeiBig; + productFeeAmount: WeiBig; + value: WeiBig; + quoteHash: string; +} +export interface ObjectDifference { + percentage: number; + previousQuote: ReducedQuote; + currentQuote: ReducedQuote; +} + +export interface FlyoverPegoutState { + difference: ObjectDifference; + amountToTransfer: WeiBig; + validAmount: boolean; + btcRecipientAddress: string; + btcToReceive: SatoshiBig; + liquidityProviders: LiquidityProvider2WP[]; + quotes: Record; + flyoverService: FlyoverService; + txHash?: string; + selectedQuoteHash: string; +} diff --git a/src/common/types/Flyover/PeginQuote.ts b/src/common/types/Flyover/PeginQuote.ts new file mode 100644 index 000000000..5ef819c7c --- /dev/null +++ b/src/common/types/Flyover/PeginQuote.ts @@ -0,0 +1,44 @@ +import { Quote } from '@rsksmart/flyover-sdk'; +import { PeginQuoteDTO2WP, QuotePegIn2WP } from './Flyover'; +import SatoshiBig from '../SatoshiBig'; +import WeiBig from '../WeiBig'; + +export default class PeginQuote implements QuotePegIn2WP { + quote: PeginQuoteDTO2WP; + + quoteHash: string; + + constructor({ quote, quoteHash }: Quote) { + this.quote = { + ...quote, + timeForDepositInSeconds: quote.timeForDeposit, + callFee: SatoshiBig.fromWeiBig(new WeiBig(quote.callFee ?? 0, 'wei')), + gasFee: new WeiBig(quote.gasFee ?? 0, 'wei'), + penaltyFee: new WeiBig(quote.penaltyFee ?? 0, 'wei'), + productFeeAmount: SatoshiBig.fromWeiBig(new WeiBig(quote.productFeeAmount ?? 0, 'wei')), + value: SatoshiBig.fromWeiBig(new WeiBig(quote.value ?? 0, 'wei')), + }; + this.quoteHash = quoteHash; + } + + get valueToTransfer(): SatoshiBig { + return this.quote.value + .plus(this.providerFee); + } + + get providerFee(): SatoshiBig { + return this.quote.productFeeAmount + .plus(this.quote.callFee) + .plus(SatoshiBig.fromWeiBig(this.quote.gasFee)); + } + + getTotalQuoteFee(btcNetworkFee: SatoshiBig): SatoshiBig { + return this.providerFee + .plus(btcNetworkFee); + } + + getTotalTxAmount(btcNetworkFee: SatoshiBig): SatoshiBig { + return this.valueToTransfer + .plus(btcNetworkFee); + } +} diff --git a/src/common/types/Flyover/index.ts b/src/common/types/Flyover/index.ts new file mode 100644 index 000000000..9abf72f74 --- /dev/null +++ b/src/common/types/Flyover/index.ts @@ -0,0 +1,4 @@ +export * from './Flyover'; +export * from './FlyoverPegout'; +export * from './FlyoverPegin'; +export { default as PeginQuote } from './PeginQuote'; diff --git a/src/common/types/FlyoverPegout.ts b/src/common/types/FlyoverPegout.ts deleted file mode 100644 index 6fc056175..000000000 --- a/src/common/types/FlyoverPegout.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { ObjectDifference } from '@/common/types'; -import { FlyoverService } from '../services'; -import { LiquidityProvider2WP, QuotePegOut2WP } from './Flyover'; -import SatoshiBig from './SatoshiBig'; -import WeiBig from './WeiBig'; - -export interface FlyoverPegoutState { - differences: Array; - amountToTransfer: WeiBig; - validAmount: boolean; - btcRecipientAddress: string; - btcToReceive: SatoshiBig; - liquidityProviders: LiquidityProvider2WP[]; - quotes: Record; - flyoverService: FlyoverService; - txHash?: string; - selectedQuoteHash: string; -} diff --git a/src/common/types/SatoshiBig.ts b/src/common/types/SatoshiBig.ts index ef5ef32a3..f3c39705f 100644 --- a/src/common/types/SatoshiBig.ts +++ b/src/common/types/SatoshiBig.ts @@ -87,4 +87,8 @@ export default class SatoshiBig extends Big { toSatoshiBigInt(): bigint { return BigInt(this.toFixed(0)); } + + toSatoshiNumber(): number { + return Number(this.toFixed(0)); + } } diff --git a/src/common/types/TxInfo.ts b/src/common/types/TxInfo.ts index 18dc876a5..da6430187 100644 --- a/src/common/types/TxInfo.ts +++ b/src/common/types/TxInfo.ts @@ -1,5 +1,43 @@ +export interface BaseQuoteDbModel { + agreementTimestamp: number; + gasFeeOnWei: number; + nonce: number; + penaltyFeeOnWei: number; + btcRefundAddress: string; + lbcAddress: string; + lpBtcAddress: string; + rskRefundAddress: string; + liquidityProviderRskAddress: string; +} + +export interface PeginQuoteDbModel extends BaseQuoteDbModel { + callFeeOnSatoshi: number; + callOnRegister: boolean; + confirmations: number; + contractAddr: string; + data: string; + fedBTCAddr: string; + gasLimit: number; + lpCallTime: number; + productFeeAmountOnSatoshi: number; + timeForDepositInSeconds: number; + valueOnSatoshi: number; +} + +export interface PegoutQuoteDbModel extends BaseQuoteDbModel { + callFeeOnWei: number; + depositAddr: string; + depositConfirmations: number; + depositDateLimit: number; + expireBlocks: number; + expireDate: number; + productFeeAmountOnWei: number; + transferConfirmations: number; + transferTime: number; + valueOnWei: number; +} + export interface TxInfo { - sessionId: string; txHash: string; type: string; value: number; @@ -10,4 +48,7 @@ export interface TxInfo { btcEstimatedFee?: number; provider?: string; details?: Record; + quote?: PeginQuoteDbModel | PegoutQuoteDbModel; + quoteHash?: string; + acceptedQuoteSignature?: string; } diff --git a/src/common/types/WeiBig.ts b/src/common/types/WeiBig.ts index 9d48b7a16..b9b7e20ef 100644 --- a/src/common/types/WeiBig.ts +++ b/src/common/types/WeiBig.ts @@ -79,4 +79,8 @@ export default class WeiBig extends Big { toWeiBigInt(): bigint { return BigInt(this.toFixed(0)); } + + toWeiNumber(): number { + return Number(this.toFixed(0)); + } } diff --git a/src/common/types/environment-variables.ts b/src/common/types/environment-variables.ts index 538c8ce5c..0c191606d 100644 --- a/src/common/types/environment-variables.ts +++ b/src/common/types/environment-variables.ts @@ -1,4 +1,5 @@ import { AppNetwork } from '@/common/types'; +import * as constants from '@/common/store/constants'; export class EnvironmentVariables { public vueAppCoin: AppNetwork; @@ -25,8 +26,6 @@ export class EnvironmentVariables { public pegoutMinValue: number; - public pegoutMaxValue: number; - public debugMode: boolean; public minFeeSatPerByte: { @@ -43,13 +42,17 @@ export class EnvironmentVariables { public burnDustValue: number; - public maxAmountAllowedInSatoshis: number; - public lbcAddress: string; public peginMinAmountAllowedInBtc: number; - public peginMaxAmountAllowedInBtc: number; + public flyoverGetProvidersTimeout: number; + + public flyoverPegoutDiffPercentage: number; + + public grecaptchaTime: number; + + public flyoverProviderId: number; // eslint-disable-next-line @typescript-eslint/no-explicit-any constructor(defaultValues: any = {}) { @@ -72,8 +75,6 @@ export class EnvironmentVariables { this.vueAppClarityId = process.env.VUE_APP_CLARITY_ID || defaultValues.vueAppClarityId; this.pegoutMinValue = process.env.VUE_APP_PEGOUT_MIN_AMOUNT_ALLOWED_IN_RBTC || defaultValues.pegoutMinValue; - this.pegoutMaxValue = process.env.VUE_APP_PEGOUT_MAX_AMOUNT_ALLOWED_IN_RBTC - || defaultValues.pegoutMaxValue; this.minFeeSatPerByte = { fast: process.env.VUE_APP_MIN_FEE_SAT_PER_BYTE_FAST || (defaultValues.minFeeSatPerByte ? defaultValues.minFeeSatPerByte.fast : 0), @@ -91,13 +92,23 @@ export class EnvironmentVariables { || (defaultValues.miningSpeedBlock ? defaultValues.miningSpeedBlock.slow : 0), }; this.burnDustValue = Number(process.env.VUE_APP_BURN_DUST_VALUE) || defaultValues.burnDustValue; - this.maxAmountAllowedInSatoshis = process.env.VUE_APP_MAX_AMOUNT_ALLOWED_IN_SATOSHI - || defaultValues.maxAmountAllowedInSatoshis; this.lbcAddress = process.env.VUE_APP_LBC_ADDRESS || defaultValues.lbcAddress; this.debugMode = process.env.VUE_APP_DEBUG_MODE === 'true' || defaultValues.debugMode; this.peginMinAmountAllowedInBtc = Number(process.env.VUE_APP_PEGIN_MIN_AMOUNT_ALLOWED_IN_BTC) || defaultValues.peginMinValue; - this.peginMaxAmountAllowedInBtc = Number(process.env.VUE_APP_PEGIN_MAX_AMOUNT_ALLOWED_IN_BTC) - || defaultValues.peginMaxValue; + this.flyoverGetProvidersTimeout = Number(process.env.VUE_APP_FLYOVER_GET_PROVIDERS_TIMEOUT) + || defaultValues.flyoverGetProvidersTimeout; + this.flyoverPegoutDiffPercentage = Number(process.env + .VUE_APP_FLYOVER_PEGOUT_QUOTE_DIFF_PERCENTAGE) || defaultValues.flyoverPegoutDiffPercentage; + this.grecaptchaTime = Number(process.env.VUE_APP_RECAPTCHA_NEW_TOKEN_TIME) + || defaultValues.grecaptchaTime; + this.flyoverProviderId = Number(process.env.VUE_APP_FLYOVER_PROVIDER_ID) + || defaultValues.flyoverProviderId; + } + + public get chainId(): number { + return this.vueAppCoin === constants.BTC_NETWORK_MAINNET + ? constants.SUPPORTED_NETWORKS.RSK_MAINNET.chainId + : constants.SUPPORTED_NETWORKS.RSK_TESTNET.chainId; } } diff --git a/src/common/types/index.ts b/src/common/types/index.ts index 7b74d70b2..c61e365e7 100644 --- a/src/common/types/index.ts +++ b/src/common/types/index.ts @@ -13,6 +13,4 @@ export { default as WeiBig } from './WeiBig'; export * from './Feature'; export * from './ethers'; export * from './Flyover'; -export * from './FlyoverPegout'; export * from './TxInfo'; -export * from './FlyoverPegin'; diff --git a/src/common/types/pegInTx.ts b/src/common/types/pegInTx.ts index 601ecc39e..ac85920d0 100644 --- a/src/common/types/pegInTx.ts +++ b/src/common/types/pegInTx.ts @@ -3,11 +3,13 @@ import SatoshiBig from '@/common/types/SatoshiBig'; import { WalletService } from '@/common/services'; import * as constants from '@/common/store/constants'; -export type BtcAccount = 'BITCOIN_LEGACY_ADDRESS' | - 'BITCOIN_SEGWIT_ADDRESS' | - 'BITCOIN_NATIVE_SEGWIT_ADDRESS'; +export enum BtcAccount { + BITCOIN_LEGACY_ADDRESS = 'BITCOIN_LEGACY_ADDRESS', + BITCOIN_SEGWIT_ADDRESS = 'BITCOIN_SEGWIT_ADDRESS', + BITCOIN_NATIVE_SEGWIT_ADDRESS = 'BITCOIN_NATIVE_SEGWIT_ADDRESS' +} -export type BtcWallet = 'WALLET_LEDGER' | 'WALLET_TREZOR' | 'WALLET_LEATHER'; +export type BtcWallet = 'WALLET_LEDGER' | 'WALLET_TREZOR' | 'WALLET_LEATHER' | 'WALLET_XVERSE' | 'WALLET_ENKRYPT'; export type MiningSpeedFee = 'BITCOIN_SLOW_FEE_LEVEL' | 'BITCOIN_AVERAGE_FEE_LEVEL' | @@ -27,7 +29,6 @@ export interface RequestBalance { export interface PeginConfiguration { minValue: number; // SatoshiBN - maxValue: number; // SatoshiBN federationAddress: string; feePerKb?: number; // SatoshiBN sessionId: string; diff --git a/src/common/types/pegOutTx.ts b/src/common/types/pegOutTx.ts index 5de4fa83e..b019ade68 100644 --- a/src/common/types/pegOutTx.ts +++ b/src/common/types/pegOutTx.ts @@ -4,7 +4,6 @@ import SatoshiBig from '@/common/types/SatoshiBig'; export interface PegoutConfiguration { minValue: WeiBig; - maxValue: WeiBig; bridgeContractAddress: string; } diff --git a/src/common/types/session.ts b/src/common/types/session.ts index c6a25c0bf..7f3d89b66 100644 --- a/src/common/types/session.ts +++ b/src/common/types/session.ts @@ -22,4 +22,6 @@ export interface SessionState { acceptedTerms?: boolean; features: Array; apiVersion: string; + grecaptchaCountdown: number; + grecaptchaIntervalId: number | undefined; } diff --git a/src/common/types/store.ts b/src/common/types/store.ts index b67a43e60..3e43a4363 100644 --- a/src/common/types/store.ts +++ b/src/common/types/store.ts @@ -1,15 +1,21 @@ import { Duration } from 'moment/moment'; -import { PegStatus } from '@/common/store/constants'; +import { PegStatus, RejectedPegoutReasons } from '@/common/store/constants'; import SatoshiBig from '@/common/types/SatoshiBig'; import { PegInTxState } from '@/common/types/pegInTx'; import { SessionState } from '@/common/types/session'; -import { PegOutTxState } from './pegOutTx'; +import { PegOutTxState } from '@/common/types/pegOutTx'; +import { FlyoverPeginState } from '@/common/types/Flyover/FlyoverPegin'; +import { FlyoverPegoutState } from '@/common/types/Flyover/FlyoverPegout'; +import { StatusState } from '@/common/types/Status'; export interface RootState { pegInTx?: PegInTxState, web3Session?: SessionState, pegOutTx?: PegOutTxState, version: string; + status?: StatusState; + flyoverPegin?: FlyoverPeginState; + flyoverPegout?: FlyoverPegoutState; } export interface BtcPeginStatus { @@ -66,6 +72,8 @@ export interface PegoutStatusDataModel { btcRawTransaction: string; fees: number; estimatedFee: SatoshiBig; + btcTxId: string; + reason?: RejectedPegoutReasons; } export interface FlyoverStatusModel { @@ -78,6 +86,7 @@ export interface FlyoverStatusModel { status: string; senderAddress: string; recipientAddress: string; + quoteHash: string; } export enum TxStatusType { @@ -88,6 +97,8 @@ export enum TxStatusType { INVALID_DATA = 'INVALID_DATA', UNEXPECTED_ERROR = 'UNEXPECTED_ERROR', UNSET_STATUS = 'UNSET_STATUS', + NOT_FOUND = 'NOT_FOUND', + BLOCKBOOK_FAILED = 'BLOCKBOOK_FAILED', } export interface TxStatus { @@ -95,4 +106,5 @@ export interface TxStatus { type: TxStatusType; pegOutEstimatedFee: SatoshiBig; estimatedReleaseTimeInMinutes: Duration; + flyoverStatus?: string; } diff --git a/src/common/utils/btcAddressUtils.ts b/src/common/utils/btcAddressUtils.ts index 73ea16682..f013f8dce 100644 --- a/src/common/utils/btcAddressUtils.ts +++ b/src/common/utils/btcAddressUtils.ts @@ -52,3 +52,17 @@ export function validateAddress(address: string): {valid: boolean; addressType: } return { valid, addressType }; } + +function compressPublicKey(pubKey: string) { + const { publicKey } = bitcoin.ECPair.fromPublicKey(Buffer.from(pubKey, 'hex')); + return publicKey.toString('hex'); +} + +export function getP2SHRedeemScript(publicKey: string, network: bitcoin.Network) { + const pubkey = compressPublicKey(publicKey); + const pair = bitcoin.ECPair.fromPublicKey(Buffer.from(pubkey, 'hex')); + const p2wpkh = bitcoin.payments.p2wpkh({ pubkey: pair.publicKey, network }); + const p2sh = bitcoin.payments.p2sh({ redeem: p2wpkh, network }); + const redeem = p2sh.redeem?.output; + return redeem; +} diff --git a/src/common/utils/common.ts b/src/common/utils/common.ts index 5065b5876..fc94f3402 100644 --- a/src/common/utils/common.ts +++ b/src/common/utils/common.ts @@ -4,18 +4,19 @@ import { BITCOIN_AVERAGE_FEE_LEVEL } from '@/common/store/constants'; import { FlyoverPeginState, FlyoverPegoutState, ObjectDifference, PegOutTxState, + ReducedQuote, SessionState, WeiBig, } from '@/common/types'; import { FlyoverService } from '@/common/services'; import { markRaw } from 'vue'; import * as constants from '@/common/store/constants'; +import { EnvironmentAccessorService } from '@/common/services/enviroment-accessor.service'; export const getChunkedValue = (value: string, maxLength: number) => (value.length < maxLength ? value : `${value.substr(0, maxLength / 2)}...${value.substr(value.length - maxLength / 2, value.length)}`); export const getClearPeginTxState = (): PegInTxState => ({ peginConfiguration: { minValue: 0, - maxValue: 0, federationAddress: '', sessionId: '', }, @@ -67,13 +68,13 @@ export const getClearPeginTxState = (): PegInTxState => ({ safeFee: new SatoshiBig(0, 'btc'), }, peginType: constants.peginType.POWPEG, + walletService: undefined, }); export const getClearPegoutTxState = (): PegOutTxState => ({ amountToTransfer: new WeiBig(0, 'wei'), pegoutConfiguration: { minValue: new WeiBig(0, 'wei'), - maxValue: new WeiBig(0, 'wei'), bridgeContractAddress: '', }, validAmount: false, @@ -84,7 +85,7 @@ export const getClearPegoutTxState = (): PegOutTxState => ({ selectedFee: BITCOIN_AVERAGE_FEE_LEVEL, }); -export const getClearSessionState = ():SessionState => ( +export const getClearSessionState = (): SessionState => ( { account: undefined, ethersProvider: undefined, @@ -97,9 +98,26 @@ export const getClearSessionState = ():SessionState => ( bitcoinPrice: 0, features: [], apiVersion: '', + grecaptchaCountdown: EnvironmentAccessorService.getEnvironmentVariables().grecaptchaTime + ?? constants.RECAPTCHA_NEW_TOKEN_TIME, + grecaptchaIntervalId: undefined, } ); +export const getClearReducedQuote = (): ReducedQuote => ({ + gasFee: new WeiBig(0, 'wei'), + callFee: new WeiBig(0, 'wei'), + productFeeAmount: new WeiBig(0, 'wei'), + value: new WeiBig(0, 'wei'), + quoteHash: '', +}); + +export const getClearObjectDifference = (): ObjectDifference => ({ + percentage: 0, + previousQuote: getClearReducedQuote(), + currentQuote: getClearReducedQuote(), +}); + export const getClearFlyoverPegoutState = (): FlyoverPegoutState => ({ amountToTransfer: new WeiBig(0, 'wei'), validAmount: false, @@ -109,7 +127,7 @@ export const getClearFlyoverPegoutState = (): FlyoverPegoutState => ({ quotes: {}, flyoverService: markRaw(new FlyoverService()), selectedQuoteHash: '', - differences: [], + difference: getClearObjectDifference(), }); export const getClearFlyoverPeginState = (): FlyoverPeginState => ({ @@ -121,32 +139,5 @@ export const getClearFlyoverPeginState = (): FlyoverPeginState => ({ quotes: {}, flyoverService: markRaw(new FlyoverService()), selectedQuoteHash: '', + acceptedQuoteSignature: '', }); - -export const compareObjects = ( - obj1: { [key: string]: unknown }, - obj2: { [key: string]: unknown }, -): Array => { - if (Object.getPrototypeOf(obj1) !== Object.getPrototypeOf(obj2)) { - throw new Error('Objects has different prototype'); - } - const differences: Array = []; - Object.keys(obj1).forEach((key) => { - if (obj1[key] instanceof WeiBig && obj2[key] instanceof WeiBig) { - if (!(obj1[key] as WeiBig).eq(obj2[key] as WeiBig)) { - differences.push({ - key, - oldValue: (obj1[key] as WeiBig).toRBTCString(), - newValue: (obj2[key] as WeiBig).toRBTCString(), - }); - } - } else if (obj1[key] !== obj2[key]) { - differences.push({ - key, - oldValue: obj1[key], - newValue: obj2[key], - }); - } - }); - return differences; -}; diff --git a/src/common/utils/rlogin.ts b/src/common/utils/rlogin.ts index 5f8f7d691..eab7e9d6f 100644 --- a/src/common/utils/rlogin.ts +++ b/src/common/utils/rlogin.ts @@ -4,8 +4,13 @@ import WalletConnectProvider from '@walletconnect/web3-provider'; import { trezorProviderOptions } from '@rsksmart/rlogin-trezor-provider'; import { ledgerProviderOptions } from '@rsksmart/rlogin-ledger-provider'; import * as constants from '@/common/store/constants'; +import { + Browser, Feature, FeatureNames, SupportedBrowsers, +} from '../types'; +import { getBrowserName } from './utils'; -export function getRloginInstance(): RLogin { +export function getRloginInstance(features: Array): RLogin { + const currentBrowser = getBrowserName() as Browser; const rpcUrls = {}; const customLedgerProviderOptions = ledgerProviderOptions; customLedgerProviderOptions.connector = async (ProviderPackage, options) => { @@ -15,28 +20,28 @@ export function getRloginInstance(): RLogin { await provider.connect(); return provider; }; - const network = EnvironmentAccessorService.getEnvironmentVariables().vueAppCoin; - if (network === constants.BTC_NETWORK_MAINNET) { - Object - .defineProperty(rpcUrls, constants.SUPPORTED_NETWORKS.RSK_MAINNET.chainId, { - value: constants.SUPPORTED_NETWORKS.RSK_MAINNET.rpcUrl, - writable: false, - configurable: true, - enumerable: true, - }); - } else { - Object - .defineProperty(rpcUrls, constants.SUPPORTED_NETWORKS.RSK_TESTNET.chainId, { - value: constants.SUPPORTED_NETWORKS.RSK_TESTNET.rpcUrl, - writable: false, - configurable: true, - enumerable: true, - }); - } + const customTrezorProviderOptions = { + ...trezorProviderOptions, + options: { + dPath: "m/44'/37310'/0'/0/0", + manifestEmail: EnvironmentAccessorService + .getEnvironmentVariables().vueAppManifestEmail, + manifestAppUrl: EnvironmentAccessorService + .getEnvironmentVariables().vueAppManifestAppUrl, + }, + }; + const { vueAppRskNodeHost, chainId } = EnvironmentAccessorService.getEnvironmentVariables(); + Object + .defineProperty(rpcUrls, chainId, { + value: vueAppRskNodeHost, + writable: false, + configurable: true, + enumerable: true, + }); const supportedChains = Object.keys(rpcUrls).map(Number); - const rLoginSetup = new RLogin({ + const rLoginOptions = { cacheProvider: false, - defaultTheme: 'dark', + defaultTheme: 'dark' as 'dark' | 'light', providerOptions: { walletconnect: { package: WalletConnectProvider, @@ -44,20 +49,22 @@ export function getRloginInstance(): RLogin { rpc: rpcUrls, }, }, - 'custom-ledger': customLedgerProviderOptions, - 'custom-trezor': { - ...trezorProviderOptions, - options: { - dPath: "m/44'/37310'/0'/0/0", - manifestEmail: EnvironmentAccessorService - .getEnvironmentVariables().vueAppManifestEmail, - manifestAppUrl: EnvironmentAccessorService - .getEnvironmentVariables().vueAppManifestAppUrl, - }, - }, }, rpcUrls, supportedChains, - }); + }; + // const ledgerFeature = features.find((feature) => feature.name === FeatureNames.WALLET_LEDGER); + // if (ledgerFeature?.value === constants.ENABLED + // && ledgerFeature.supportedBrowsers[currentBrowser.toLowerCase() as keyof SupportedBrowsers]) { + // rLoginOptions.providerOptions['custom-ledger'] = customLedgerProviderOptions; + // } + const trezorFeature = features.find((feature) => feature.name === FeatureNames.WALLET_TREZOR); + if (trezorFeature?.value === constants.ENABLED + && trezorFeature.supportedBrowsers[currentBrowser.toLowerCase() as keyof SupportedBrowsers]) { + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + rLoginOptions.providerOptions['custom-trezor'] = customTrezorProviderOptions; + } + const rLoginSetup = new RLogin(rLoginOptions); return rLoginSetup; } diff --git a/src/common/utils/utils.ts b/src/common/utils/utils.ts index cccd51d6c..c6bc7bc88 100644 --- a/src/common/utils/utils.ts +++ b/src/common/utils/utils.ts @@ -10,6 +10,7 @@ import { RequestBalance, PegoutStatus, SatoshiBig, + Browser, } from '@/common/types'; import { BridgeService } from '@/common/services/BridgeService'; import moment from 'moment'; @@ -73,7 +74,7 @@ export function getRskAddressExplorerUrl(address: string) { return `${getRskBaseExplorerUrl()}/address/${address}`; } -export function getEstimatedFee(): Promise { +export function getEstimatedFee(pegoutAlreadyRequested = false): Promise { return new Promise((resolve, reject) => { const bridgeService = new BridgeService(); Promise.all([ @@ -81,6 +82,11 @@ export function getEstimatedFee(): Promise { bridgeService.getQueuedPegoutsCount(), ]) .then(([nextPegoutCost, pegoutQueueCount]) => { + if (pegoutAlreadyRequested && pegoutQueueCount !== 0n) { + const currentEstimatedFee = nextPegoutCost / pegoutQueueCount; + resolve(new SatoshiBig(currentEstimatedFee, 'satoshi')); + return; + } const estimatedFee = nextPegoutCost / (pegoutQueueCount + 1n); resolve(new SatoshiBig(estimatedFee, 'satoshi')); }) @@ -116,9 +122,12 @@ export function isMobileDevice() { return platform === 'mobile'; } +export function getBrowserName(): Browser { + return Bowser.getParser(window.navigator.userAgent).getBrowserName() as Browser; +} + export function isAllowedCurrentBrowser() { - const browser = Bowser.getParser(window.navigator.userAgent); - return browser.getBrowserName() === 'Chrome' || window.navigator.brave; + return [Browser.CHROME, Browser.FIREFOX].includes(getBrowserName()); } export function isBTCAmountValidRegex(bitcoinAmount: string) { @@ -194,7 +203,7 @@ export function setStatusMessage(txType: string, status: string): TxStatusMessag activeMessageStyle = 'statusProgress'; isRejected = false; break; - case constants.FlyoverStatus.COMPLETED: + case constants.FlyoverStatus.SUCCESS: statusMessage = 'Your transaction was successfully processed!'; activeMessageStyle = 'statusSuccess'; isRejected = false; @@ -209,7 +218,7 @@ export function setStatusMessage(txType: string, status: string): TxStatusMessag activeMessageStyle = 'statusProgress'; isRejected = false; break; - case constants.FlyoverStatus.COMPLETED: + case constants.FlyoverStatus.SUCCESS: statusMessage = 'Your transaction was successfully processed!'; activeMessageStyle = 'statusSuccess'; isRejected = false; @@ -282,6 +291,11 @@ export function setStatusMessage(txType: string, status: string): TxStatusMessag error = true; errorMessage = 'The input transaction is not valid, please check it and try again'; break; + case TxStatusType.BLOCKBOOK_FAILED: + activeMessageStyle = 'statusRejected'; + error = true; + errorMessage = 'Blockbook service is not responding'; + break; default: error = true; errorMessage = 'The input transaction is not valid, please check it and try again'; diff --git a/src/common/views/Home.vue b/src/common/views/Home.vue index 4ce377150..3660d75c9 100644 --- a/src/common/views/Home.vue +++ b/src/common/views/Home.vue @@ -1,7 +1,7 @@ @@ -143,16 +140,14 @@ export default defineComponent({ const boundaries = computed(() => { const minValue: SatoshiBig = new SatoshiBig(peginConfiguration.value.minValue, 'btc'); - const maxValue: SatoshiBig = new SatoshiBig(peginConfiguration.value.maxValue, 'btc'); return { minValue, - maxValue, }; }); const amountErrorMessage = computed(() => { // mayor rework const feePlusAmount: SatoshiBig = safeAmount.value.plus(safeTxFee.value); - const { minValue, maxValue } = boundaries.value; + const { minValue } = boundaries.value; if (selectedAccountBalance.value.eq('0') && !isValidAmountToTransfer.value) { return 'Selected account has no balance'; } @@ -180,19 +175,15 @@ export default defineComponent({ if (!enoughBalanceSelectedFee) { return 'The selected fee does not satisfy the minimum required by the network'; } - if (safeAmount.value.gt(maxValue)) { - return `The maximum accepted value is ${maxValue.toBTCTrimmedString()} ${environmentContext.getBtcTicker()}`; - } return 'Invalid format'; }); const insufficientAmount = computed(() => { const feePlusAmount: SatoshiBig = safeAmount.value.plus(safeTxFee.value); - const { minValue, maxValue } = boundaries.value; + const { minValue } = boundaries.value; if (safeAmount.value.lte('0') || feePlusAmount.gt(selectedAccountBalance.value) - || safeAmount.value.lt(minValue) - || safeAmount.value.gt(maxValue)) { + || safeAmount.value.lt(minValue)) { return true; } if (safeAmount.value.gt('0') && feePlusAmount.lte(selectedAccountBalance.value)) { @@ -239,10 +230,9 @@ export default defineComponent({ } const isValidAmount = (amount: SatoshiBig) => { - const { minValue, maxValue } = boundaries.value; + const { minValue } = boundaries.value; return isBTCAmountValidRegex(amount.toBTCString()) - && amount.gte(minValue) - && amount.lte(maxValue); + && amount.gte(minValue); }; async function getOptionsData() { @@ -269,33 +259,11 @@ export default defineComponent({ }, }); - function fillMaxValueAvailable() { - const maxAvailable = selectedAccountBalance.value - .cmp(boundaries.value.maxValue.plus(safeTxFee.value)) === -1 - ? selectedAccountBalance.value : boundaries.value.maxValue; - const tempValue = maxAvailable.minus(safeTxFee.value); - bitcoinAmount.value = tempValue.toBTCTrimmedString(); - setBtcAmount(tempValue); - setIsValidAmount(selectedAccountBalance.value.gt('0')); - } - function setMin() { const min = new SatoshiBig(peginConfiguration.value.minValue, 'btc'); bitcoinAmountModel.value = min.toBTCTrimmedString(); } - async function setMax() { - fillMaxValueAvailable(); - calculateTxFee() - .then(() => { - fillMaxValueAvailable(); - bitcoinAmountModel.value = bitcoinAmount.value; - }) - .catch((e) => { - context.emit('pegin-error', e); - }); - } - function watchBitcoinAmount() { checkStep(); amountStyle.value = stepState.value === 'done' ? 'black-box' : 'yellow-box'; @@ -337,7 +305,6 @@ export default defineComponent({ rbtcAmount, amountErrorMessage, mdiArrowRight, - setMax, setMin, mdiBitcoin, boundaries, diff --git a/src/pegin/components/create/ConfirmTx.vue b/src/pegin/components/create/ConfirmTx.vue index d01022adb..bc1bc3143 100644 --- a/src/pegin/components/create/ConfirmTx.vue +++ b/src/pegin/components/create/ConfirmTx.vue @@ -1,46 +1,30 @@ diff --git a/src/pegin/components/create/SendBitcoin.vue b/src/pegin/components/create/SendBitcoin.vue index 2a41262fa..fee763470 100644 --- a/src/pegin/components/create/SendBitcoin.vue +++ b/src/pegin/components/create/SendBitcoin.vue @@ -1,5 +1,5 @@