Skip to content

Commit

Permalink
Merge branch 'development' of github.com:madfish-solutions/templewall…
Browse files Browse the repository at this point in the history
…et-extension into TW-716-baner-subscrition
  • Loading branch information
herkoss committed Jul 4, 2023
2 parents 756098d + a2bd55a commit ce8ca9c
Show file tree
Hide file tree
Showing 115 changed files with 2,147 additions and 787 deletions.
1 change: 1 addition & 0 deletions .env.dist
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ TEMPLE_WALLET_EVERSTAKE_LINK_ID=
TEMPLE_WALLET_UTORG_SID=

TEMPLE_WALLET_API_URL=https://temple-api-mainnet.prod.templewallet.com
TEMPLE_WALLET_STATIC_API_URL=
TEMPLE_WALLET_DEXES_API_URL=wss://dexes-api-mainnet.prod.templewallet.com

TEMPLE_WALLET_ROUTE3_AUTH_TOKEN=
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,16 @@ jobs:
TEMPLE_WALLET_EVERSTAKE_LINK_ID: ${{ secrets.TEMPLE_WALLET_EVERSTAKE_LINK_ID }}
TEMPLE_WALLET_UTORG_SID: ${{ secrets.TEMPLE_WALLET_UTORG_SID }}
TEMPLE_WALLET_API_URL: ${{ vars.TEMPLE_WALLET_API_URL }}
TEMPLE_WALLET_STATIC_API_URL: ${{ vars.TEMPLE_WALLET_STATIC_API_URL }}
TEMPLE_WALLET_DEXES_API_URL: ${{ vars.TEMPLE_WALLET_DEXES_API_URL }}
DEFAULT_HD_ACCOUNT_SEED_PHRASE: ${{ secrets.DEFAULT_HD_ACCOUNT_SEED_PHRASE }}
DEFAULT_HD_ACCOUNT_FIRST_PRIVATE_KEY: ${{ secrets.DEFAULT_HD_ACCOUNT_FIRST_PRIVATE_KEY }}
DEFAULT_HD_ACCOUNT_FIRST_HASH_SHORT_FORM: ${{ secrets.DEFAULT_HD_ACCOUNT_FIRST_HASH_SHORT_FORM }}
DEFAULT_HD_ACCOUNT_SECOND_PRIVATE_KEY: ${{ secrets.DEFAULT_HD_ACCOUNT_SECOND_PRIVATE_KEY }}
DEFAULT_PASSWORD: ${{ secrets.DEFAULT_PASSWORD }}
IMPORTED_HD_ACCOUNT_SEED_PHRASE: ${{ secrets.IMPORTED_HD_ACCOUNT_SEED_PHRASE }}
IMPORTED_HD_ACCOUNT_FIRST_PRIVATE_KEY: ${{ secrets.IMPORTED_HD_ACCOUNT_FIRST_PRIVATE_KEY }}
IMPORTED_HD_ACCOUNT_FIRST_HASH_SHORT_FORM: ${{ secrets.IMPORTED_HD_ACCOUNT_FIRST_HASH_SHORT_FORM }}
TEMPLE_WALLET_ROUTE3_AUTH_TOKEN: ${{ vars.TEMPLE_WALLET_ROUTE3_AUTH_TOKEN }}
TEMPLE_WALLET_MOONPAY_API_KEY: ${{ secrets.TEMPLE_WALLET_MOONPAY_API_KEY }}
WATCH_ONLY_PUBLIC_KEY_HASH: ${{ secrets.WATCH_ONLY_PUBLIC_KEY_HASH }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/manual-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ jobs:
TEMPLE_WALLET_EVERSTAKE_LINK_ID: ${{ secrets.TEMPLE_WALLET_EVERSTAKE_LINK_ID }}
TEMPLE_WALLET_UTORG_SID: ${{ secrets.TEMPLE_WALLET_UTORG_SID }}
TEMPLE_WALLET_API_URL: ${{ vars.TEMPLE_WALLET_API_URL }}
TEMPLE_WALLET_STATIC_API_URL: ${{ vars.TEMPLE_WALLET_STATIC_API_URL }}
TEMPLE_WALLET_DEXES_API_URL: ${{ vars.TEMPLE_WALLET_DEXES_API_URL }}
TEMPLE_WALLET_ROUTE3_AUTH_TOKEN: ${{ vars.TEMPLE_WALLET_ROUTE3_AUTH_TOKEN }}
TEMPLE_WALLET_MOONPAY_API_KEY: ${{ secrets.TEMPLE_WALLET_MOONPAY_API_KEY }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ jobs:
TEMPLE_WALLET_EVERSTAKE_LINK_ID: ${{ secrets.TEMPLE_WALLET_EVERSTAKE_LINK_ID }}
TEMPLE_WALLET_UTORG_SID: ${{ secrets.TEMPLE_WALLET_UTORG_SID }}
TEMPLE_WALLET_API_URL: ${{ vars.TEMPLE_WALLET_API_URL }}
TEMPLE_WALLET_STATIC_API_URL: ${{ vars.TEMPLE_WALLET_STATIC_API_URL }}
TEMPLE_WALLET_DEXES_API_URL: ${{ vars.TEMPLE_WALLET_DEXES_API_URL }}
TEMPLE_WALLET_ROUTE3_AUTH_TOKEN: ${{ vars.TEMPLE_WALLET_ROUTE3_AUTH_TOKEN }}
TEMPLE_WALLET_MOONPAY_API_KEY: ${{ secrets.TEMPLE_WALLET_MOONPAY_API_KEY }}
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/secrets-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,26 @@ inputs:
required: false
TEMPLE_WALLET_API_URL:
required: true
TEMPLE_WALLET_STATIC_API_URL:
required: true
TEMPLE_WALLET_DEXES_API_URL:
required: true
DEFAULT_HD_ACCOUNT_SEED_PHRASE:
required: false
DEFAULT_HD_ACCOUNT_FIRST_PRIVATE_KEY:
required: false
DEFAULT_HD_ACCOUNT_FIRST_HASH_SHORT_FORM:
required: false
DEFAULT_HD_ACCOUNT_SECOND_PRIVATE_KEY:
required: false
DEFAULT_PASSWORD:
required: false
required: false
IMPORTED_HD_ACCOUNT_SEED_PHRASE:
required: false
IMPORTED_HD_ACCOUNT_FIRST_PRIVATE_KEY:
required: false
IMPORTED_HD_ACCOUNT_FIRST_HASH_SHORT_FORM:
required: false
TEMPLE_WALLET_ROUTE3_AUTH_TOKEN:
required: true
TEMPLE_WALLET_MOONPAY_API_KEY:
Expand All @@ -59,6 +65,7 @@ runs:
TEMPLE_WALLET_UTORG_SID=${{ inputs.TEMPLE_WALLET_UTORG_SID }}
TEMPLE_WALLET_API_URL=${{ inputs.TEMPLE_WALLET_API_URL }}
TEMPLE_WALLET_STATIC_API_URL=${{ inputs.TEMPLE_WALLET_STATIC_API_URL }}
TEMPLE_WALLET_DEXES_API_URL=${{ inputs.TEMPLE_WALLET_DEXES_API_URL }}
TEMPLE_WALLET_ROUTE3_AUTH_TOKEN=${{ inputs.TEMPLE_WALLET_ROUTE3_AUTH_TOKEN }}
TEMPLE_WALLET_MOONPAY_API_KEY=${{ inputs.TEMPLE_WALLET_MOONPAY_API_KEY }}
Expand All @@ -70,10 +77,12 @@ runs:
cat << EOF > e2e/.env
DEFAULT_HD_ACCOUNT_SEED_PHRASE=${{ inputs.DEFAULT_HD_ACCOUNT_SEED_PHRASE }}
DEFAULT_HD_ACCOUNT_FIRST_PRIVATE_KEY=${{ inputs.DEFAULT_HD_ACCOUNT_FIRST_PRIVATE_KEY }}
DEFAULT_HD_ACCOUNT_FIRST_HASH_SHORT_FORM=${{ inputs.DEFAULT_HD_ACCOUNT_FIRST_HASH_SHORT_FORM }}
DEFAULT_HD_ACCOUNT_SECOND_PRIVATE_KEY=${{ inputs.DEFAULT_HD_ACCOUNT_SECOND_PRIVATE_KEY }}
DEFAULT_PASSWORD=${{ inputs.DEFAULT_PASSWORD }}
IMPORTED_HD_ACCOUNT_SEED_PHRASE=${{ inputs.IMPORTED_HD_ACCOUNT_SEED_PHRASE }}
IMPORTED_HD_ACCOUNT_FIRST_PRIVATE_KEY=${{ inputs.IMPORTED_HD_ACCOUNT_FIRST_PRIVATE_KEY }}
IMPORTED_HD_ACCOUNT_FIRST_HASH_SHORT_FORM=${{ inputs.IMPORTED_HD_ACCOUNT_FIRST_HASH_SHORT_FORM }}
WATCH_ONLY_PUBLIC_KEY_HASH=${{ inputs.WATCH_ONLY_PUBLIC_KEY_HASH }}
WATCH_ONLY_PUBLIC_KEY_HASH_SHORT_FORM=${{ inputs.WATCH_ONLY_PUBLIC_KEY_HASH_SHORT_FORM }}
EOF
2 changes: 2 additions & 0 deletions e2e/.env.dist
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
DEFAULT_HD_ACCOUNT_SEED_PHRASE=
DEFAULT_HD_ACCOUNT_FIRST_PRIVATE_KEY=
DEFAULT_HD_ACCOUNT_FIRST_HASH_SHORT_FORM=
DEFAULT_HD_ACCOUNT_SECOND_PRIVATE_KEY=

DEFAULT_PASSWORD=

IMPORTED_HD_ACCOUNT_SEED_PHRASE=
IMPORTED_HD_ACCOUNT_FIRST_PRIVATE_KEY=
IMPORTED_HD_ACCOUNT_FIRST_HASH_SHORT_FORM=

WATCH_ONLY_PUBLIC_KEY_HASH=
WATCH_ONLY_PUBLIC_KEY_HASH_SHORT_FORM=
1 change: 1 addition & 0 deletions e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"scripts": {
"start": "./node_modules/.bin/cucumber-js --fail-fast",
"start:dev": "yarn start --tags @dev",
"start:remove_account": "yarn start --tags @remove_account",
"test": "yarn start --exit --tags 'not @dev'",
"ts": "tsc --pretty"
},
Expand Down
2 changes: 1 addition & 1 deletion e2e/src/features/import-account-by-public-key.feature
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ Feature: Import an account by public key (Watch-only)
And I enter watchOnlyPublicKey into Watch Only Input on the Import Account(Watch-Only) page
And I press Watch Only Import Button on the Import Account(Watch-Only) page

Then I compare my Watch-only Public hash with imported account
Then I check if watchOnlyAccountShortHash is corresponded to the selected account
97 changes: 97 additions & 0 deletions e2e/src/features/remove-account.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
Feature: Remove an account
@remove_account
Scenario: As a user, I'd like to remove an imported account by mnemonic, private key and public key
Given I have imported an existing account
# Remove an imported account by mnemonic

And I press Account Icon on the Header page
And I am on the AccountsDropdown page

And I press Import Account Button on the Account Drop-down page
And I am on the ImportAccountTab page

And I select Mnemonic tab
And I am on the ImportAccountMnemonic page

And I enter second mnemonic
And I press Mnemonic Import Button on the Import Account(Mnemonic) page

And I am on the Home page
And I check if importedAccountShortHash is corresponded to the selected account
And I press Account Icon on the Header page

And I am on the AccountsDropdown page
And I press Settings Button on the Account Drop-down page

And I am on the Settings page
And I press Remove Account Button on the Settings page

And I am on the RemoveAccount page
And I enter defaultPassword into Password Input on the Remove Account page
And I press Remove Button on the Remove Account page

And I am on the Home page
And I check if defaultAccountShortHash is corresponded to the selected account

# Remove an imported account private key

And I press Account Icon on the Header page
And I am on the AccountsDropdown page

And I press Import Account Button on the Account Drop-down page
And I am on the ImportAccountTab page

And I select Private Key tab
And I am on the ImportAccountPrivateKey page

And I enter importedFirstPrivateKey into Private Key Input on the Import Account(Private Key) page
And I press Private Key Import Button on the Import Account(Private Key) page

And I am on the Home page
And I check if importedAccountShortHash is corresponded to the selected account
And I press Account Icon on the Header page

And I am on the AccountsDropdown page
And I press Settings Button on the Account Drop-down page

And I am on the Settings page
And I press Remove Account Button on the Settings page

And I am on the RemoveAccount page
And I enter defaultPassword into Password Input on the Remove Account page
And I press Remove Button on the Remove Account page

And I am on the Home page
And I check if defaultAccountShortHash is corresponded to the selected account

# Remove an imported account public key

And I press Account Icon on the Header page
And I am on the AccountsDropdown page

And I press Import Account Button on the Account Drop-down page
And I am on the ImportAccountTab page

And I select Watch-only tab
And I am on the ImportAccountWatchOnly page

And I enter watchOnlyPublicKey into Watch Only Input on the Import Account(Watch-Only) page
And I press Watch Only Import Button on the Import Account(Watch-Only) page

And I check if watchOnlyAccountShortHash is corresponded to the selected account

And I press Account Icon on the Header page

And I am on the AccountsDropdown page
And I press Settings Button on the Account Drop-down page

And I am on the Settings page
And I press Remove Account Button on the Settings page

And I am on the RemoveAccount page
And I enter defaultPassword into Password Input on the Remove Account page
And I press Remove Button on the Remove Account page

And I am on the Home page

Then I check if defaultAccountShortHash is corresponded to the selected account
7 changes: 4 additions & 3 deletions e2e/src/page-objects/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { SwapPage } from 'e2e/src/page-objects/pages/swap.page';

import { NetworksDropDown } from 'e2e/src/page-objects/pages/drop-down-lists/networks.drop-down';
import { NewsletterModalPage } from 'e2e/src/page-objects/pages/newsletter-modal.page';
import { OnRumModalPage } from 'e2e/src/page-objects/pages/on-rum-modal.page';
import { RemoveAccountPage } from 'e2e/src/page-objects/pages/remove-account.page';
import { SwapPage } from 'e2e/src/page-objects/pages/swap.page';

import { OperationStatusAlert } from './pages/alerts/operation-status.alert';
import { CreateOrRestoreAnAccountPage } from './pages/create-or-restore-an-account.page';
Expand Down Expand Up @@ -52,5 +52,6 @@ export const Pages = {
NetworksDropDown: new NetworksDropDown(),
OnRumpModal: new OnRumModalPage(),
NewsletterModal: new NewsletterModalPage(),
Swap: new SwapPage()
Swap: new SwapPage(),
RemoveAccount: new RemoveAccountPage()
};
14 changes: 14 additions & 0 deletions e2e/src/page-objects/pages/remove-account.page.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { RemoveAccountSelectors } from 'src/app/templates/RemoveAccount/RemoveAccount.selectors';

import { Page } from '../../classes/page.class';
import { createPageElement } from '../../utils/search.utils';

export class RemoveAccountPage extends Page {
passwordInput = createPageElement(RemoveAccountSelectors.passwordInput);
removeButton = createPageElement(RemoveAccountSelectors.removeButton);

async isVisible() {
await this.passwordInput.waitForDisplayed();
await this.removeButton.waitForDisplayed();
}
}
18 changes: 18 additions & 0 deletions e2e/src/step-definitions/shared.steps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { OperationStatusSelectors } from 'src/app/templates/OperationStatus.sele

import { BrowserContext } from '../classes/browser-context.class';
import { Pages } from '../page-objects';
import { envVars } from '../utils/env.utils';
import { iComparePrivateKeys } from '../utils/input-data.utils';
import { LONG_TIMEOUT, MEDIUM_TIMEOUT } from '../utils/timing.utils';

Expand Down Expand Up @@ -33,3 +34,20 @@ Given(/I'm waiting for 'success ✓' operation status/, { timeout: LONG_TIMEOUT
timeout: LONG_TIMEOUT
});
});

const hashObject = {
defaultAccountShortHash: envVars.DEFAULT_HD_ACCOUNT_FIRST_HASH_SHORT_FORM,
importedAccountShortHash: envVars.IMPORTED_HD_ACCOUNT_FIRST_HASH_SHORT_FORM,
watchOnlyAccountShortHash: envVars.WATCH_ONLY_PUBLIC_KEY_HASH_SHORT_FORM
};

Given(
/I check if (.*) is corresponded to the selected account/,
{ timeout: MEDIUM_TIMEOUT },
async (hashType: keyof typeof hashObject) => {
const pkhFromUI = await Pages.Home.PublicAddressButton.getText();
const targetPkh = hashObject[hashType];

expect(pkhFromUI).eql(targetPkh);
}
);
2 changes: 2 additions & 0 deletions e2e/src/utils/env.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ export const getEnv = (key: string) => process.env[key] ?? '';
export const envVars = {
DEFAULT_HD_ACCOUNT_SEED_PHRASE: getEnv('DEFAULT_HD_ACCOUNT_SEED_PHRASE'),
DEFAULT_HD_ACCOUNT_FIRST_PRIVATE_KEY: getEnv('DEFAULT_HD_ACCOUNT_FIRST_PRIVATE_KEY'),
DEFAULT_HD_ACCOUNT_FIRST_HASH_SHORT_FORM: getEnv('DEFAULT_HD_ACCOUNT_FIRST_HASH_SHORT_FORM'),
DEFAULT_HD_ACCOUNT_SECOND_PRIVATE_KEY: getEnv('DEFAULT_HD_ACCOUNT_SECOND_PRIVATE_KEY'),
DEFAULT_PASSWORD: getEnv('DEFAULT_PASSWORD'),
IMPORTED_HD_ACCOUNT_SEED_PHRASE: getEnv('IMPORTED_HD_ACCOUNT_SEED_PHRASE'),
IMPORTED_HD_ACCOUNT_FIRST_PRIVATE_KEY: getEnv('IMPORTED_HD_ACCOUNT_FIRST_PRIVATE_KEY'),
IMPORTED_HD_ACCOUNT_FIRST_HASH_SHORT_FORM: getEnv('IMPORTED_HD_ACCOUNT_FIRST_HASH_SHORT_FORM'),
WATCH_ONLY_PUBLIC_KEY_HASH: getEnv('WATCH_ONLY_PUBLIC_KEY_HASH'),
WATCH_ONLY_PUBLIC_KEY_HASH_SHORT_FORM: getEnv('WATCH_ONLY_PUBLIC_KEY_HASH_SHORT_FORM')
};
Expand Down
14 changes: 13 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"@taquito/tzip16": "15.0.1",
"@taquito/utils": "15.0.1",
"@temple-wallet/dapp": "5.0.2",
"@temple-wallet/wallet-address-validator": "^0.4.2",
"@tezos-domains/core": "1.21.0",
"@tezos-domains/taquito-client": "1.21.0",
"@types/async-retry": "1.4.3",
Expand Down Expand Up @@ -94,6 +95,7 @@
"axios": "0.26.1",
"babel-loader": "8.2.5",
"bignumber.js": "9.1.0",
"binance-icons": "^0.5.1",
"bip39": "3.0.4",
"bs58check": "2.1.2",
"buffer": "5.6.0",
Expand All @@ -106,6 +108,7 @@
"crypto-browserify": "3.12.0",
"css-loader": "6.7.1",
"css-minimizer-webpack-plugin": "^4.2.1",
"currency-codes": "^2.1.0",
"date-fns": "2.15.0",
"debounce-promise": "3.1.2",
"dexie": "3.1.0-alpha.9",
Expand All @@ -123,6 +126,7 @@
"fontfaceobserver": "2.1.0",
"fuse.js": "6.4.6",
"graphql": "^16.6.0",
"graphql-request": "^6.1.0",
"html-webpack-plugin": "^5.5.0",
"inter-ui": "3.13.1",
"jest": "27.4.5",
Expand Down Expand Up @@ -189,6 +193,7 @@
"webpack-ext-reloader-mv3": "^2.1.1",
"webpack-target-webextension": "^1.0.4",
"webpackbar": "^5",
"youves-sdk": "^0.0.6",
"yup": "^1.1.1",
"zip-a-folder": "^1.1.5"
},
Expand All @@ -214,6 +219,13 @@
"follow-redirects": "1.14.8",
"nanoid": "3.1.31",
"tslib": "2.4.0",
"@types/react": "18.0.15"
"@types/react": "18.0.15",
"@taquito/taquito": "15.0.1",
"@taquito/utils": "15.0.1",
"@taquito/beacon-wallet": "15.0.1",
"@taquito/contracts-library": "15.0.1",
"@taquito/tzip16": "15.0.1",
"bignumber.js": "9.1.0",
"graphql-request": "^6.1.0"
}
}
9 changes: 9 additions & 0 deletions public/_locales/de/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -829,6 +829,15 @@
"enable": {
"message": "aktivieren"
},
"enableAds": {
"message": "Enable Ads"
},
"enablePartnersPromotionConfirm": {
"message": "Support the development team and earn tokens by viewing ads inside the wallet."
},
"enablePartnersPromotionDescriptionConfirm": {
"message": "To enable this feature, we request your permission to trace your Wallet Address and IP address. You can always disable ads in the settings."
},
"dAppsCheckmarkPrompt": {
"message": "Klicken Sie auf das Häkchen für die $action$ DApps-Interaktionsfunktion",
"description": "DApps = Decentralized Applications",
Expand Down
Loading

0 comments on commit ce8ca9c

Please sign in to comment.