Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(release): 2.3.2 #3401

Merged
merged 25 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
e90d260
fix: show assets for sell transactions correctly
CedrikNikita Nov 5, 2024
eda49a9
Merge pull request #3386 from superhero-com/feature/show-assets-for-s…
CedrikNikita Nov 5, 2024
b5ff9d5
fix(aeternity): show correct allowance transaction info
CedrikNikita Nov 6, 2024
79dcf90
feat: show decoded call data on eth tx details
martinkaintas Aug 26, 2024
8ea7faf
fix: raw callData should not be deprecated
martinkaintas Sep 11, 2024
3714847
Merge pull request #3245 from superhero-com/feat/show-decoded-call-da…
CedrikNikita Nov 11, 2024
9667530
refactor: token allowance modification are not only for dex
CedrikNikita Nov 6, 2024
df51f99
Merge pull request #3392 from superhero-com/feature/show-correct-allo…
CedrikNikita Nov 11, 2024
5ace2c4
Merge pull request #3381 from superhero-com/master
CedrikNikita Nov 12, 2024
3ab5296
perf(asset-selector): do not render all assets at once
CedrikNikita Nov 4, 2024
1d5958e
Merge pull request #3383 from superhero-com/feature/do-not-render-all…
CedrikNikita Nov 12, 2024
7a02d70
feat: connect modal layout update
peronczyk Nov 4, 2024
8f7578f
fix: missing warning message when focusing/unfocusing autocomplete input
akalogerakisunicorn Nov 15, 2024
05b4f7d
feat: account selector improvements
akalogerakisunicorn Oct 25, 2024
e20264f
fix: change svg name
akalogerakisunicorn Nov 18, 2024
b51b1d5
feat: permission manager form as modal
peronczyk Nov 5, 2024
a9106bc
fix: show correct market cap coin info
CedrikNikita Nov 18, 2024
2fee398
Merge pull request #3402 from superhero-com/feature/fix-market-cap-co…
CedrikNikita Nov 18, 2024
7832b3a
fix: be able to receive ethereum related info
CedrikNikita Nov 20, 2024
94351ac
Merge pull request #3409 from superhero-com/feature/fix-etherscan-key…
CedrikNikita Nov 21, 2024
80dd57f
fix: be able to import private key account on mobile app
CedrikNikita Nov 21, 2024
20d4f02
Merge pull request #3422 from superhero-com/feature/fix-private-key-a…
CedrikNikita Nov 22, 2024
e619c24
fix: get correct token address for token sale transaction
CedrikNikita Nov 22, 2024
69412c4
Merge pull request #3423 from superhero-com/feature/get-correct-token…
CedrikNikita Nov 22, 2024
fb530b9
chore(release): 2.3.2
CedrikNikita Nov 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ jobs:
runs-on: ubuntu-latest
env:
APP_NAME: wallet
ETHERSCAN_API_KEY: "${{ github.ref == 'refs/heads/master' && secrets.ETHERSCAN_API_KEY_PROD || secrets.ETHERSCAN_API_KEY_DEV }}"
WALLET_CONNECT_PROJECT_ID: ${{ secrets.WALLET_CONNECT_PROJECT_ID }}
TOKEN_SALES_URL_MAINNET: ${{ secrets.TOKEN_SALES_URL_MAINNET }}
TOKEN_SALES_URL_TESTNET: ${{ secrets.TOKEN_SALES_URL_TESTNET }}
Expand Down
33 changes: 33 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,39 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [2.3.2](https://github.com/Superhero-com/superhero-wallet/compare/v2.3.1...v2.3.2) (2024-11-22)


### Features

* account selector improvements ([05b4f7d](https://github.com/Superhero-com/superhero-wallet/commit/05b4f7df03c8df0127bb6de54e14629e6bd5d03d))
* connect modal layout update ([7a02d70](https://github.com/Superhero-com/superhero-wallet/commit/7a02d70feabbcb51f105d59d1b74c9b994d18a39))
* permission manager form as modal ([b51b1d5](https://github.com/Superhero-com/superhero-wallet/commit/b51b1d54fdb7ebae1129c08f2d0c8cc2f22b162e))
* show decoded call data on eth tx details ([79dcf90](https://github.com/Superhero-com/superhero-wallet/commit/79dcf90e6099c2a602f1017bfcb758a5f1a745b1))


### Bug Fixes

* **aeternity:** show correct allowance transaction info ([b5ff9d5](https://github.com/Superhero-com/superhero-wallet/commit/b5ff9d5e4c252422c94a159397a3bb3f5a430384))
* be able to import private key account on mobile app ([80dd57f](https://github.com/Superhero-com/superhero-wallet/commit/80dd57f2eb816d524af8c8f6f4174ca2b9f30d8d))
* be able to receive ethereum related info ([7832b3a](https://github.com/Superhero-com/superhero-wallet/commit/7832b3a6ff2eebc34193b020f60faf0348b7ca3d))
* change svg name ([e20264f](https://github.com/Superhero-com/superhero-wallet/commit/e20264f87ad39ffb691ab85b9aa5ac07c861471b))
* get correct token address for token sale transaction ([e619c24](https://github.com/Superhero-com/superhero-wallet/commit/e619c246e1f9cb8e1a6752929814b02235c8191c))
* missing warning message when focusing/unfocusing autocomplete input ([8f7578f](https://github.com/Superhero-com/superhero-wallet/commit/8f7578f24027df23096e15580258bd629ef0db43))
* raw callData should not be deprecated ([8ea7faf](https://github.com/Superhero-com/superhero-wallet/commit/8ea7fafcd809b256052c59e5a33488d526c07914))
* show assets for sell transactions correctly ([e90d260](https://github.com/Superhero-com/superhero-wallet/commit/e90d260b8e3562b40caf57159a4feb594b4bbc57))
* show correct market cap coin info ([a9106bc](https://github.com/Superhero-com/superhero-wallet/commit/a9106bc4ee855bc6f176db88d1a09ed295748578))


### Maintenance

* token allowance modification are not only for dex ([9667530](https://github.com/Superhero-com/superhero-wallet/commit/96675308834d7fb3191816f42607b010ce26ee54))


### Performance

* **asset-selector:** do not render all assets at once ([3ab5296](https://github.com/Superhero-com/superhero-wallet/commit/3ab52962d5d2fbc2794826142b0f1e01f4c5b071))

### [2.3.1](https://github.com/Superhero-com/superhero-wallet/compare/v2.3.0...v2.3.1) (2024-11-01)


Expand Down
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
applicationId "com.superhero.cordova"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 20301
versionName "2.3.1"
versionCode 20302
versionName "2.3.2"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
aaptOptions {
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
Expand Down
4 changes: 2 additions & 2 deletions ios/App/App.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.3.1;
MARKETING_VERSION = 2.3.2;
OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\"";
PRODUCT_BUNDLE_IDENTIFIER = com.superhero.cordova;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -390,7 +390,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.3.1;
MARKETING_VERSION = 2.3.2;
PRODUCT_BUNDLE_IDENTIFIER = com.superhero.cordova;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "";
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "superhero-wallet",
"version": "2.3.1",
"version": "2.3.2",
"description": "Superhero wallet",
"author": "Superhero",
"license": "MIT",
Expand Down
11 changes: 6 additions & 5 deletions src/background/bgPopupHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,17 @@ const popups: Dictionary<IPopupConfigNoActions> = {};

const storageSession = (browser.storage as any)?.session;

export const getAeppUrl = (v: any) => new URL(v.connection.port.sender.url);

export const openPopup = async (
popupType: PopupType,
aepp: string | object,
aepp: string | Record<string, any>, // TODO establish correct type for the object
popupProps: Partial<IPopupProps> = {},
) => {
const id = uuid();
const { href, protocol, host } = (typeof aepp === 'object') ? getAeppUrl(aepp) : new URL(aepp);
const { name = host } = (typeof aepp === 'object') ? aepp : {} as any;
const url = (typeof aepp === 'object') ? aepp.connection.port.sender.url : aepp;
const { href, protocol, host } = new URL(url);

// TODO fix the name resolving issue happening in `onSubscription` of aeSdk
const name = (typeof aepp === 'object') ? aepp.name : undefined;

const tabs = await browser.tabs.query({ active: true });

Expand Down
8 changes: 6 additions & 2 deletions src/background/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ import { updateDynamicRules } from './redirectRule';
/**
* @see https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/onMessage#sending_an_asynchronous_response_using_sendresponse
*/
function handleMessage(msg: IBackgroundMessageData, _: any, sendResponse: Function) {
const handleMessage: browser.runtime.onMessageBool = (
msg: IBackgroundMessageData,
sender: browser.runtime.MessageSender,
sendResponse: Function,
) => {
if (msg.target === 'background') {
const {
aepp,
Expand Down Expand Up @@ -73,7 +77,7 @@ function handleMessage(msg: IBackgroundMessageData, _: any, sendResponse: Functi
target: 'offscreen',
});
return true;
}
};

browser.runtime.onMessage.addListener(handleMessage);
browser.runtime.onInstalled.addListener(updateDynamicRules);
214 changes: 214 additions & 0 deletions src/composables/accountSelector.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
import {
computed,
ref,
watch,
} from 'vue';

import type {
IAccountSelectorEntry,
ITransaction,
} from '@/types';
import {
ACCOUNT_SELECT_TYPE_FILTER,
AccountSelectTypeFilter,
PROTOCOLS,
TX_DIRECTION,
} from '@/constants';
import {
createCustomScopedComposable,
excludeFalsy,
getDefaultAccountLabel,
} from '@/utils';
import {
useAccounts,
useAddressBook,
useLatestTransactionList,
} from '@/composables';

import { useAeNames } from '@/protocols/aeternity/composables/aeNames';
import {
getInnerTransaction,
getOwnershipStatus,
getTxDirection,
getTxOwnerAddress,
} from '@/protocols/aeternity/helpers';

import { tg } from '@/popup/plugins/i18n';
import { AE_TRANSACTION_OWNERSHIP_STATUS } from '@/protocols/aeternity/config';
import { Encoding, isAddressValid } from '@aeternity/aepp-sdk';

export const useAccountSelector = createCustomScopedComposable(() => {
const { getName, ownedNames } = useAeNames();

const searchQuery = ref('');
const {
addressBookFiltered,
addressBookFilteredByProtocol,
protocolFilter,
showBookmarked,
getAddressBookEntryByAddress,
setProtocolFilter,
setShowBookmarked,
clearFilters: addressBookClearFilters,
} = useAddressBook();
const {
activeAccount,
accounts,
accountsGroupedByProtocol,
getAccountByAddress,
} = useAccounts();
const { accountsTransactionsLatest } = useLatestTransactionList();
const accountSelectType = ref<AccountSelectTypeFilter>(ACCOUNT_SELECT_TYPE_FILTER.addressBook);

const latestTransactions = computed(
() => (accountsTransactionsLatest.value[activeAccount.value.address] || [])
.map((transaction: ITransaction): IAccountSelectorEntry | null => {
const outerTx = transaction.tx!;
const innerTx = transaction.tx ? getInnerTransaction(transaction.tx) : null;
const { recipientId } = outerTx?.payerId ? outerTx : innerTx;
const direction = getTxDirection(
outerTx?.payerId ? outerTx : innerTx,
(
getOwnershipStatus(activeAccount.value, accounts.value, innerTx)
!== AE_TRANSACTION_OWNERSHIP_STATUS.current
&& getTxOwnerAddress(innerTx)
) || activeAccount.value.address,
);
if (direction !== TX_DIRECTION.sent || !recipientId) {
return null;
}

const addressBookRecord = getAddressBookEntryByAddress(recipientId);
if (addressBookRecord) {
return addressBookRecord;
}

let name = tg('modals.send.recipientLabel');
let localChainNameAddress: string | undefined;
const isSentToChainName = isAddressValid(recipientId, Encoding.Name);

if (isSentToChainName) {
const ownedName = ownedNames.value.find((entry) => entry.hash === recipientId);
if (ownedName) {
name = ownedName.name;
localChainNameAddress = ownedName.pointers.accountPubkey;
}
} else {
const account = getAccountByAddress(recipientId!);
if (account) {
name = getName(account.address).value || getDefaultAccountLabel(account);
} else {
name = getName(recipientId).value || name;
}
}

return {
name,
address: isSentToChainName ? localChainNameAddress : recipientId,
nameAddress: (localChainNameAddress || !isSentToChainName) ? undefined : recipientId,
isBookmarked: false,
protocol: protocolFilter.value ?? PROTOCOLS.aeternity,
};
})
.filter(excludeFalsy),
);
const ownAddresses = computed(
() => (protocolFilter.value)
? (accountsGroupedByProtocol.value[protocolFilter.value] ?? []).map((account) => (
{
name: getName(account.address).value || getDefaultAccountLabel(account),
address: account.address,
isBookmarked: false,
protocol: protocolFilter.value ?? PROTOCOLS.aeternity,
type: account.type,
}
))
: [],
);
const accountsFilteredByType = computed(() => {
switch (accountSelectType.value) {
case ACCOUNT_SELECT_TYPE_FILTER.bookmarked:
case ACCOUNT_SELECT_TYPE_FILTER.addressBook:
return addressBookFiltered.value;
case ACCOUNT_SELECT_TYPE_FILTER.recent:
return latestTransactions.value;
case ACCOUNT_SELECT_TYPE_FILTER.owned:
return ownAddresses.value;
case ACCOUNT_SELECT_TYPE_FILTER.all:
return [...addressBookFiltered.value, ...ownAddresses.value];
default:
return [];
}
});
const accountsFiltered = computed(() => {
const entries: IAccountSelectorEntry[] = accountsFilteredByType.value ?? [];
const searchQueryLower = searchQuery.value.toLowerCase();

return entries
.filter( // Filter by searchQuery
({ name, address }) => [name, address].some(
(val) => val.toLowerCase().includes(searchQueryLower),
),
).filter( // Remove duplicates
(entry, index, self) => self.findIndex(
(e) => (
(e.address !== undefined && e.address === entry.address)
|| (e.address === undefined && e.nameAddress === entry.nameAddress)
),
) === index,
).map( // Add flag for own addresses
(entry) => ({
...entry,
isOwnAddress: ownAddresses.value.some(
(account) => account.address === entry.address,
),
}),
);
});

function setAccountSelectType(type: AccountSelectTypeFilter, resetProtocolFilter = false) {
accountSelectType.value = type;
setShowBookmarked(type === ACCOUNT_SELECT_TYPE_FILTER.bookmarked, resetProtocolFilter);
}
function clearFilters(resetProtocolFilter = false) {
accountSelectType.value = ACCOUNT_SELECT_TYPE_FILTER.addressBook;
addressBookClearFilters(resetProtocolFilter);
}

watch(
protocolFilter,
() => {
if (protocolFilter.value) {
setAccountSelectType(ACCOUNT_SELECT_TYPE_FILTER.addressBook);
}
},
);

// Storing the previous type in order to revert to it when the input is cleared
let savedPrevAccountSelectType = false;
let prevAccountSelectType = accountSelectType.value;
watch(searchQuery, (newSearch) => {
if (newSearch !== '' && !savedPrevAccountSelectType) {
savedPrevAccountSelectType = true;
prevAccountSelectType = accountSelectType.value;
accountSelectType.value = ACCOUNT_SELECT_TYPE_FILTER.all;
} else if (newSearch === '') {
savedPrevAccountSelectType = false;
accountSelectType.value = prevAccountSelectType;
}
});

return {
accountSelectType,
accountsFiltered,
addressBookFilteredByProtocol,
protocolFilter,
showBookmarked,
searchQuery,

setAccountSelectType,
setProtocolFilter,
setShowBookmarked,
clearFilters,
};
});
2 changes: 1 addition & 1 deletion src/composables/addressBook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const useAddressBook = createCustomScopedComposable(() => {
const { openModal, openDefaultModal } = useModals();

const protocolFilter = ref<Protocol | null>(null);
const searchQuery = ref<string>('');
const searchQuery = ref('');
const showBookmarked = ref(false);

function filterAddressBookByBookmarked(entries: IAddressBookEntry[]) {
Expand Down
Loading
Loading