diff --git a/package-lock.json b/package-lock.json index c8673039d..0fbd59ae0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5332,6 +5332,60 @@ "node": ">=10" } }, + "node_modules/@protobufjs/aspromise": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==" + }, + "node_modules/@protobufjs/base64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" + }, + "node_modules/@protobufjs/codegen": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" + }, + "node_modules/@protobufjs/eventemitter": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", + "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==" + }, + "node_modules/@protobufjs/fetch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", + "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", + "dependencies": { + "@protobufjs/aspromise": "^1.1.1", + "@protobufjs/inquire": "^1.1.0" + } + }, + "node_modules/@protobufjs/float": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==" + }, + "node_modules/@protobufjs/inquire": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", + "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==" + }, + "node_modules/@protobufjs/path": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==" + }, + "node_modules/@protobufjs/pool": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==" + }, + "node_modules/@protobufjs/utf8": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", + "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==" + }, "node_modules/@samverschueren/stream-to-observable": { "version": "0.3.1", "dev": true, @@ -45610,6 +45664,60 @@ "resolved": "https://registry.npmjs.org/@phc/format/-/format-1.0.0.tgz", "integrity": "sha512-m7X9U6BG2+J+R1lSOdCiITLLrxm+cWlNI3HUFA92oLO77ObGNzaKdh8pMLqdZcshtkKuV84olNNXDfMc4FezBQ==" }, + "@protobufjs/aspromise": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==" + }, + "@protobufjs/base64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" + }, + "@protobufjs/codegen": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" + }, + "@protobufjs/eventemitter": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", + "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==" + }, + "@protobufjs/fetch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", + "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", + "requires": { + "@protobufjs/aspromise": "^1.1.1", + "@protobufjs/inquire": "^1.1.0" + } + }, + "@protobufjs/float": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==" + }, + "@protobufjs/inquire": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", + "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==" + }, + "@protobufjs/path": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==" + }, + "@protobufjs/pool": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==" + }, + "@protobufjs/utf8": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", + "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==" + }, "@samverschueren/stream-to-observable": { "version": "0.3.1", "dev": true, diff --git a/src/composables/accounts.ts b/src/composables/accounts.ts index a5ed38dbb..7cc422b30 100644 --- a/src/composables/accounts.ts +++ b/src/composables/accounts.ts @@ -44,7 +44,7 @@ export function useAccounts({ store }: IDefaultComposableOptions) { function setActiveAccountByIdx(idx: number = 0) { // TODO replace with updating local state after removing the Vuex - store.commit('accounts/setActiveIdx', +(accounts.value[idx].idx || 0)); + store.commit('accounts/setActiveIdx', idx); } function setActiveAccountByAddress(address?: string) { diff --git a/src/composables/airGap.ts b/src/composables/airGap.ts index 1ae316440..cab3b0c6c 100644 --- a/src/composables/airGap.ts +++ b/src/composables/airGap.ts @@ -11,7 +11,7 @@ import type { import { AeternityAddress } from '@airgap/aeternity'; import { MainProtocolSymbols } from '@airgap/coinlib-core'; import type { IAccount } from '../types'; -import { ACCOUNT_AIR_GAP_WALLET, handleUnknownError } from '../popup/utils'; +import { ACCOUNT_AIR_GAP_WALLET, MOBILE_SCHEMA, handleUnknownError } from '../popup/utils'; export function useAirGap() { /** @@ -45,8 +45,11 @@ export function useAirGap() { ); const fragments = []; - // eslint-disable-next-line no-restricted-syntax, guard-for-in, no-unused-vars - for (const _index in [...Array(multiEncoder.fragmentsLength)]) { + // eslint-disable-next-line no-restricted-syntax, guard-for-in + for ( + // eslint-disable-next-line @typescript-eslint/no-unused-vars + const _index in [...Array(multiEncoder.fragmentsLength)] + ) { // eslint-disable-next-line no-await-in-loop fragments.push(await multiEncoder.nextPart()); } @@ -110,7 +113,7 @@ export function useAirGap() { networkId: string, ): Promise { const id = Math.floor(Math.random() * 90000000 + 10000000); - const callbackURL = 'superhero://?d='; + const callbackURL = `${MOBILE_SCHEMA}?d=`; const payload: TransactionSignRequest = { callbackURL, publicKey, diff --git a/src/lib/accounts/superhero.ts b/src/lib/accounts/superhero.ts index 544f95add..93f923532 100644 --- a/src/lib/accounts/superhero.ts +++ b/src/lib/accounts/superhero.ts @@ -58,7 +58,7 @@ export class AccountSuperhero extends AccountBase { sign(data: string | Uint8Array, opt: any): Promise { const { activeAccount } = useAccounts({ store: this.store }); return IS_EXTENSION_BACKGROUND - ? sign(data, activeAccount.value.secretKey) as any + ? sign(data, activeAccount.value.secretKey as any) as any : this.store.dispatch('accounts/sign', data, opt); } diff --git a/src/popup/components/AccountImportRow.vue b/src/popup/components/AccountImportRow.vue index 907dedcf0..e84feff5f 100644 --- a/src/popup/components/AccountImportRow.vue +++ b/src/popup/components/AccountImportRow.vue @@ -10,6 +10,7 @@ @@ -48,7 +49,7 @@ export default defineComponent({ const isAirGapAccount = computed((): boolean => props.account.type === ACCOUNT_AIR_GAP_WALLET); onMounted(async () => { const sdk = await getSdk(); - const fetchedBalance = await (sdk as any).balance(props.account.address); + const fetchedBalance = await sdk.balance(props.account.address); balance.value = new BigNumber(aettosToAe(fetchedBalance)); }); diff --git a/src/popup/components/Modals/AccountCreate.vue b/src/popup/components/Modals/AccountCreate.vue index 15731466a..d662b718a 100644 --- a/src/popup/components/Modals/AccountCreate.vue +++ b/src/popup/components/Modals/AccountCreate.vue @@ -96,8 +96,7 @@ export default defineComponent({ } async function connectHardwareWallet() { - const scanResult = await root.$store.dispatch('modals/open', { - name: MODAL_READ_QR_CODE, + const scanResult = await openModal(MODAL_READ_QR_CODE, { heading: root.$t('modals.importAirGapAccount.scanTitle'), title: root.$t('modals.importAirGapAccount.scanDescription'), icon: 'critical', @@ -109,8 +108,7 @@ export default defineComponent({ // Show Account import. try { - const selectedAccounts = await root.$store.dispatch('modals/open', { - name: MODAL_AIR_GAP_CONFIRM_IMPORT, + const selectedAccounts = await openModal(MODAL_AIR_GAP_CONFIRM_IMPORT, { accounts, }); selectedAccounts.forEach((account: IAccount) => { diff --git a/src/popup/components/Modals/AirGapConfirmImport.vue b/src/popup/components/Modals/AirGapConfirmImport.vue index 71f8e96d9..cc93e355a 100644 --- a/src/popup/components/Modals/AirGapConfirmImport.vue +++ b/src/popup/components/Modals/AirGapConfirmImport.vue @@ -6,18 +6,15 @@ class="air-gap-confirm-import" @close="cancel()" > - -
- - {{ $t('modals.importAirGapAccount.importConfirmDialog.selectAll') }} + {{ $t('modals.importAirGapAccount.importConfirmDialog.description') }}
@@ -55,18 +48,11 @@