Skip to content

Commit

Permalink
feat: swap feature added
Browse files Browse the repository at this point in the history
  • Loading branch information
ahsanahmed456 committed Apr 30, 2022
2 parents 8b0eccd + 5f369ae commit 19556f4
Show file tree
Hide file tree
Showing 88 changed files with 2,621 additions and 2,359 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

# production
/build
metadot-extension-base.tgz

# misc
.DS_Store
Expand Down
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,3 @@ There is a separate component for it named **api-manager** which is responsible

### Maintaining Transaction Records :
We are using **[subquery](https://subquery.network/)** for getting overall history of transaction records(both send and receive) for every integrated network. This means the wallet keeps transaction records of not just the transactions from Metadot but all other channels as well.

### Note :
Our current codebase is under refactoring phase in which we are migrating the whole application into Typescript and optimizing code.
13 changes: 6 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
"private": true,
"dependencies": {
"@acala-network/api": "^4.0.1",
"@acala-network/sdk": "^4.1.1",
"@acala-network/sdk-core": "^4.1.1",
"@acala-network/sdk-swap": "^4.1.1",
"@acala-network/sdk-wallet": "^4.1.1",
"@bifrost-finance/api": "^1.5.0",
"@craco/craco": "^6.4.3",
"@emotion/react": "^11.7.1",
"@emotion/styled": "^11.6.0",
Expand Down Expand Up @@ -38,7 +37,7 @@
"@testing-library/react": "^12.1.2",
"@testing-library/user-event": "^13.5.0",
"auto-create-reducer-script": "^3.3.0",
"metadot-extension-base": "^0.0.4",
"metadot-extension-base": "^0.0.5",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-query": "^3.34.12",
Expand Down Expand Up @@ -82,8 +81,8 @@
"@types/chrome": "^0.0.176",
"@types/jest": "^27.4.0",
"@types/node": "^17.0.13",
"@types/react": "^17.0.38",
"@types/react-dom": "^17.0.11",
"@types/react": "17.0.2",
"@types/react-dom": "17.0.2",
"@types/redux-logger": "^3.0.9",
"@types/sinon-chrome": "^2.2.11",
"@types/styled-components": "^5.1.21",
Expand All @@ -105,8 +104,8 @@
},
"resolutions": {
"mini-css-extract-plugin": "2.4.5",
"@types/react": "^17.0.38",
"@types/react-dom": "^17.0.11"
"@types/react": "17.0.2",
"@types/react-dom": "17.0.2"
},
"lint-staged": {
"**/*.{js,jsx,ts,tsx}": "npm run lint"
Expand Down
6 changes: 3 additions & 3 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ function App(): JSX.Element {
}, [RdxAccounts]);

let content;
if (authRequests && authRequests.length > 0) {
if (!activeAccount.isLoggedIn && activeAccount.publicKey) {
content = <Route path="/" element={<WelcomeBack />} />;
} else if (authRequests && authRequests.length > 0) {
content = (
<Route path="/" element={<PopupAuth requests={authRequests} />} />
);
Expand All @@ -113,8 +115,6 @@ function App(): JSX.Element {
content = (
<Route path="/" element={<PopupMeta requests={metaRequests} />} />
);
} else if (!activeAccount.isLoggedIn && activeAccount.publicKey) {
content = <Route path="/" element={<WelcomeBack />} />;
} else if (activeAccount.isLoggedIn && activeAccount.publicKey) {
content = (
<>
Expand Down
2 changes: 1 addition & 1 deletion src/assets/images/icons/aboutIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/assets/images/icons/export.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/assets/images/icons/lock.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
63 changes: 63 additions & 0 deletions src/assets/images/tokenImg/testnet.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions src/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@ import { chrome } from '@polkadot/extension-inject/chrome';
import keyring from '@polkadot/ui-keyring';
import { assert } from '@polkadot/util';

// eslint-disable-next-line no-void
void chrome.browserAction.setBadgeBackgroundColor({ color: '#d90000' });

// listen to all messages and handle appropriately
chrome.runtime.onConnect.addListener((port): void => {
localStorage.setItem('setIsWalletConncted', 'true');
chrome.storage.local.set({ setIsWalletConncted: 'true' }, function () {
console.log(`setIsWalletConncted is set to true`);
});
assert(
[PORT_CONTENT, PORT_EXTENSION].includes(port.name),
`Unknown connection from ${port.name}`
Expand All @@ -31,8 +30,9 @@ chrome.runtime.onConnect.addListener((port): void => {
);
port.onDisconnect.addListener(() => {
console.log(`Disconnected from ${port.name}`);
localStorage.setItem('timestamp', Date.now().toString());
localStorage.setItem('setIsWalletConncted', 'false');
chrome.storage.local.set({ setIsWalletConncted: 'false' }, function () {
console.log(`setIsWalletConncted is set to false`);
});
});
});

Expand Down
Loading

0 comments on commit 19556f4

Please sign in to comment.