From 0d98a0b538329d33a6311bcedc7488e0ce099fbb Mon Sep 17 00:00:00 2001 From: peak3d Date: Mon, 21 Mar 2022 10:26:28 +0100 Subject: [PATCH 001/334] Camino --- README.md | 41 +- package.json | 2 +- public/index.html | 8 +- src/App.vue | 9 +- src/ERC20Tokenlist.json | 162 +- src/ERC721Tokenlist.json | 48 +- src/_main.scss | 36 +- src/components/Access/menu.scss | 33 +- .../History/ViewTypes/ImportExport.vue | 8 +- .../History/ViewTypes/StakingTx.vue | 12 +- src/components/misc/AvaxInput.vue | 7 +- src/components/misc/CurrencyInputDropdown.vue | 2 +- .../misc/CurrencySelect/CurrencySelect.vue | 9 +- src/components/misc/CurrencySelect/types.ts | 2 +- .../EVMInputDropdown/EVMAssetDropdown.vue | 4 +- src/components/misc/UrlBanner.vue | 2 +- .../misc/ValidatorList/FilterSettings.vue | 6 +- .../modals/AccountSettings/style.scss | 16 +- .../EvmTokenSelect/EVMTokenSelectModal.vue | 16 +- src/components/modals/ExportAvaxCsvModal.vue | 20 +- src/components/modals/ExportCsvModal.vue | 8 +- .../modals/UtxoSelect/UtxoSelect.vue | 6 +- .../TopCards/BalanceCard/BalanceCard.vue | 31 +- .../earn/ChainTransfer/ChainTransfer.vue | 16 +- .../wallet/earn/ChainTransfer/Form.vue | 6 +- .../wallet/earn/Delegate/AddDelegator.vue | 16 +- .../wallet/earn/Delegate/ConfirmPage.vue | 6 +- .../wallet/earn/Delegate/NodeCard.vue | 8 +- src/components/wallet/earn/UserRewardRow.vue | 8 +- src/components/wallet/earn/UserRewards.vue | 6 +- src/components/wallet/earn/UtxoSelectForm.vue | 7 +- .../wallet/earn/Validate/AddValidator.vue | 16 +- .../wallet/earn/Validate/ConfirmPage.vue | 6 +- .../wallet/portfolio/FungibleRow.vue | 11 +- src/components/wallet/portfolio/nft_card.scss | 112 +- .../wallet/portfolio/portfolio.scss | 40 +- src/components/wallet/portfolio/tokens.scss | 50 +- .../wallet/studio/NewCollectibleFamily.vue | 9 +- .../wallet/studio/mint/MintForm.vue | 8 +- src/components/wallet/transfer/FormC.vue | 15 +- src/helpers/price_helper.ts | 14 +- src/js/AvaAsset.ts | 2 +- src/js/wallets/LedgerWallet.ts | 12 +- src/js/wallets/MnemonicWallet.ts | 2 +- src/js/wallets/WalletCore.ts | 8 +- src/locales/aafrikans.json | 47 +- src/locales/arabic.json | 49 +- src/locales/ca.json | 49 +- src/locales/cs.json | 49 +- src/locales/danish.json | 49 +- src/locales/de.json | 49 +- src/locales/en.json | 61 +- src/locales/es.json | 51 +- src/locales/finnish.json | 49 +- src/locales/fr.json | 51 +- src/locales/greek.json | 49 +- src/locales/hebrew.json | 49 +- src/locales/hungarian.json | 49 +- src/locales/it.json | 51 +- src/locales/japanese.json | 49 +- src/locales/kr.json | 29 +- src/locales/nl.json | 45 +- src/locales/norwegian.json | 49 +- src/locales/polish.json | 45 +- src/locales/pt.json | 49 +- src/locales/romanian.json | 49 +- src/locales/ru.json | 47 +- src/locales/serbian.json | 49 +- src/locales/swedish.json | 49 +- src/locales/thai.json | 49 +- src/locales/tr.json | 51 +- src/locales/uk.json | 47 +- src/locales/vn.json | 51 +- src/locales/zh_hans.json | 51 +- src/locales/zh_hant.json | 49 +- src/main.ts | 12 +- src/plugins/{i18n.js => i18n.ts} | 9 + src/store/modules/assets/assets.ts | 10 +- src/store/modules/history/types.ts | 2 +- src/store/modules/network/network.ts | 27 +- src/views/wallet/Activity.vue | 2 +- src/views/wallet/Earn.vue | 19 +- src/views/wallet/Transfer.vue | 6 +- vue.config.js | 2 +- yarn.lock | 29612 ++++++++-------- 85 files changed, 16134 insertions(+), 15893 deletions(-) rename src/plugins/{i18n.js => i18n.ts} (89%) diff --git a/README.md b/README.md index 0ceaeb777..788bd0827 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,25 @@ -# Avalanche (AVAX) Wallet +# Camino (CAM) Wallet -This is the frontend Vue.js application for the Avalanche (AVAX) Wallet. +This is the frontend Vue.js application for the Camino (CAM) Wallet. ## Prerequisites - Yarn (https://classic.yarnpkg.com/en/docs/install/) - Recent version of npm (7.4.0) - Node v15.6.0 -- Gecko, Avalanche client in Golang (https://github.com/ava-labs/avalanchego) +- Gecko, Camino client in Golang (https://github.com/chain4travel/caminogo) ## Installation -1. Clone the repo `git clone https://github.com/ava-labs/avalanche-wallet.git` -2. Go to root of the project `cd avalanche-wallet` +1. Clone the repo `git clone https://github.com/chain4travel/camino-wallet.git` +2. Go to root of the project `cd camino-wallet` 3. Install javascript dependencies with `yarn install`. ## Running The Project -In order for the wallet to work, it needs the Avalanche network to operate on. By default the wallet will connect to the Avalanche mainnet. +In order for the wallet to work, it needs the Camino network to operate on. By default the wallet will connect to the Camino testnet. -1. If you want to connect to a local network, make sure you have installed and able to run a AvlaancheGo node properly. +1. If you want to connect to a local network, make sure you have installed and able to run a CaminoGo node properly. 2. Run the project with hot reloading `yarn serve` When you go to the website on your browser, you might get a warning saying @@ -38,22 +38,22 @@ When you go to the website on your browser, you might get a warning saying ## Changing the Network -By default the wallet will connect to the Avalanche tmainnet. You can change to another network by clicking the button labeled `TestNet` on the navigation bar and selecting another network, or add a custom network. +By default the wallet will connect to the Camino testnet. You can change to another network by clicking the button labeled `TestNet` on the navigation bar and selecting another network, or add a custom network. ## Explorer API A valid explorer API is required to correctly display balances for Mnemonic and Ledger type wallets. -The wallet uses the Avalanche Explorer API to display wallet transaction history. +The wallet uses the Camino Explorer API to display wallet transaction history. WARNING: This history might be out of order and incomplete. ## Browser Support -We suggest using Google Chrome to view the Avalanche Wallet website. +We suggest using Google Chrome to view the Camino Wallet website. ### Firefox and https -Firefox does not allow https requests to localhost. But the Avalanche Wallet uses https by default, so we will need to change this to http. Make this switch by editing the `vue.config.js` file in the root directory and change +Firefox does not allow https requests to localhost. But the Camino Wallet uses https by default, so we will need to change this to http. Make this switch by editing the `vue.config.js` file in the root directory and change ``` devServer: { @@ -91,27 +91,22 @@ Saved into local storage as a 2 letter code. # Dependencies -##### Avalanche Node (https://github.com/ava-labs/avalanchego) +##### Camino Node (https://github.com/chain4travel/caminogo) To get utxos and to send transactions. -#### Explorer API Node (https://github.com/ava-labs/ortelius) +#### Explorer API Node (*TBC*) To check if an address was used before, and to get activity history. # Default Connections -The wallet needs to connect to an Avalanche node, and an explorer node to operate properly. +The wallet needs to connect to a Camino node, and an explorer node to operate properly. -By default, there are two network options to connect to: `Mainnet` and `Fuji`. +By default, there is one network option to connect to: `Columbus`. -##### Mainnet +##### Columbus (Testnet) -- Avalanche API: `https://api.avax.network:443` -- Explorer API: `https://explorerapi.avax.network` - -##### Fuji (Testnet) - -- Avalanche API: `https://api.avax-test.network:443` -- Explorer API: `https://explorerapi.avax-test.network` +- Camino API: `https://columbus.camino.foundation:9650` +- Explorer API: `tbd` diff --git a/package.json b/package.json index 7f98f2da3..37d732119 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "@types/vue-datetime": "1.0.0", "@zxing/library": "0.15.2", "abi-decoder": "2.4.0", - "avalanche": "3.10.1", + "avalanche": "file:../avalanchejs", "axios": "0.21.2", "big.js": "5.2.2", "bip32": "2.0.5", diff --git a/public/index.html b/public/index.html index 74e106419..7d55cb078 100644 --- a/public/index.html +++ b/public/index.html @@ -5,11 +5,11 @@ - Fastest Performing and Secure DeFi Wallet | Avalanche Wallet - + Secure Camino Wallet + - - + + diff --git a/src/App.vue b/src/App.vue index e0eb39178..9f5e2a861 100644 --- a/src/App.vue +++ b/src/App.vue @@ -76,22 +76,21 @@ export default { vmid: 'description', name: 'description', content: - 'Avalanche wallet is a simple, highly secure, non-custodial crypto wallet for storing AVAX.', + 'Camino wallet is a simple, highly secure, non-custodial crypto wallet for storing CAM.', }, { vmid: 'og:description', name: 'description', content: - 'Avalanche wallet is a simple, highly secure, non-custodial crypto wallet for storing AVAX.', + 'Camino wallet is a simple, highly secure, non-custodial crypto wallet for storing CAM.', }, { vmid: 'og:title', name: 'og:title', - content: 'Fastest Performing and Secure DeFi Wallet | Avalanche Wallet', + content: 'Secure Camino Wallet', }, ], - title: 'Fastest Performing and Secure DeFi Wallet', - titleTemplate: '%s | Avalanche Wallet', + title: 'Secure Camino Wallet', }, } diff --git a/src/ERC20Tokenlist.json b/src/ERC20Tokenlist.json index c68ae0626..913055f6a 100644 --- a/src/ERC20Tokenlist.json +++ b/src/ERC20Tokenlist.json @@ -1,145 +1,21 @@ { - "name": "Avalanche Wallet ERC20 Tokens", - "logoURI": "https://raw.githubusercontent.com/ava-labs/bridge-tokens/main/avalanche-tokens/0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7/logo.png", - "keywords": [ - "avalanche", - "defi", - "ethereum" - ], - "version": { - "major": 1, - "minor": 0, - "patch": 0 - }, - "tokens": [ - { - "chainId": 43114, - "address": "0x60781C2586D68229fde47564546784ab3fACA982", - "decimals": 18, - "name": "Pangolin", - "symbol": "PNG", - "logoURI": "https://raw.githubusercontent.com/ava-labs/bridge-tokens/main/avalanche-tokens/0x60781C2586D68229fde47564546784ab3fACA982/logo.png" - }, - { - "chainId": 43114, - "address": "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7", - "decimals": 18, - "name": "Wrapped AVAX", - "symbol": "WAVAX", - "logoURI": "https://raw.githubusercontent.com/ava-labs/bridge-tokens/main/avalanche-tokens/0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7/logo.png" - }, - { - "chainId": 43114, - "address": "0xf20d962a6c8f70c731bd838a3a388D7d48fA6e15", - "decimals": 18, - "name": "Ether", - "symbol": "ETH", - "logoURI": "https://raw.githubusercontent.com/ava-labs/bridge-tokens/main/avalanche-tokens/0xf20d962a6c8f70c731bd838a3a388D7d48fA6e15/logo.png" - }, - { - "chainId": 43114, - "address": "0xde3A24028580884448a5397872046a019649b084", - "decimals": 6, - "name": "Tether USD", - "symbol": "USDT", - "logoURI": "https://raw.githubusercontent.com/ava-labs/bridge-tokens/main/avalanche-tokens/0xde3A24028580884448a5397872046a019649b084/logo.png" - }, - { - "chainId": 43114, - "address": "0xB3fe5374F67D7a22886A0eE082b2E2f9d2651651", - "decimals": 18, - "name": "ChainLink Token", - "symbol": "LINK", - "logoURI": "https://raw.githubusercontent.com/ava-labs/bridge-tokens/main/avalanche-tokens/0xB3fe5374F67D7a22886A0eE082b2E2f9d2651651/logo.png" - }, - { - "chainId": 43114, - "address": "0x8cE2Dee54bB9921a2AE0A63dBb2DF8eD88B91dD9", - "decimals": 18, - "name": "Aave Token", - "symbol": "AAVE", - "logoURI": "https://raw.githubusercontent.com/ava-labs/bridge-tokens/main/avalanche-tokens/0x8cE2Dee54bB9921a2AE0A63dBb2DF8eD88B91dD9/logo.png" - }, - { - "chainId": 43114, - "address": "0xf39f9671906d8630812f9d9863bBEf5D523c84Ab", - "decimals": 18, - "name": "Uniswap", - "symbol": "UNI", - "logoURI": "https://raw.githubusercontent.com/ava-labs/bridge-tokens/main/avalanche-tokens/0xf39f9671906d8630812f9d9863bBEf5D523c84Ab/logo.png" - }, - { - "chainId": 43114, - "address": "0x408D4cD0ADb7ceBd1F1A1C33A0Ba2098E1295bAB", - "decimals": 8, - "name": "Wrapped BTC", - "symbol": "WBTC", - "logoURI": "https://raw.githubusercontent.com/ava-labs/bridge-tokens/main/avalanche-tokens/0x408D4cD0ADb7ceBd1F1A1C33A0Ba2098E1295bAB/logo.png" - }, - { - "chainId": 43114, - "address": "0x8DF92E9C0508aB0030d432DA9F2C65EB1Ee97620", - "decimals": 18, - "name": "Maker", - "symbol": "MKR", - "logoURI": "https://raw.githubusercontent.com/ava-labs/bridge-tokens/main/avalanche-tokens/0x8DF92E9C0508aB0030d432DA9F2C65EB1Ee97620/logo.png" - }, - { - "chainId": 43114, - "address": "0x68e44C4619db40ae1a0725e77C02587bC8fBD1c9", - "decimals": 18, - "name": "Synthetix Network Token", - "symbol": "SNX", - "logoURI": "https://raw.githubusercontent.com/ava-labs/bridge-tokens/main/avalanche-tokens/0x68e44C4619db40ae1a0725e77C02587bC8fBD1c9/logo.png" - }, - { - "chainId": 43114, - "address": "0x53CEedB4f6f277edfDDEdB91373B044FE6AB5958", - "decimals": 18, - "name": "Compound", - "symbol": "COMP", - "logoURI": "https://raw.githubusercontent.com/ava-labs/bridge-tokens/main/avalanche-tokens/0x53CEedB4f6f277edfDDEdB91373B044FE6AB5958/logo.png" - }, - { - "chainId": 43114, - "address": "0x421b2a69b886BA17a61C7dAd140B9070d5Ef300B", - "decimals": 18, - "name": "HuobiToken", - "symbol": "HT", - "logoURI": "https://raw.githubusercontent.com/ava-labs/bridge-tokens/main/avalanche-tokens/0x421b2a69b886BA17a61C7dAd140B9070d5Ef300B/logo.png" - }, - { - "chainId": 43114, - "address": "0x39cf1BD5f15fb22eC3D9Ff86b0727aFc203427cc", - "decimals": 18, - "name": "SushiToken", - "symbol": "SUSHI", - "logoURI": "https://raw.githubusercontent.com/ava-labs/bridge-tokens/main/avalanche-tokens/0x39cf1BD5f15fb22eC3D9Ff86b0727aFc203427cc/logo.png" - }, - { - "chainId": 43114, - "address": "0xC84d7bfF2555955b44BDF6A307180810412D751B", - "decimals": 18, - "name": "UMA Voting Token v1", - "symbol": "UMA", - "logoURI": "https://raw.githubusercontent.com/ava-labs/bridge-tokens/main/avalanche-tokens/0xC84d7bfF2555955b44BDF6A307180810412D751B/logo.png" - }, - { - "chainId": 43114, - "address": "0xaEb044650278731Ef3DC244692AB9F64C78FfaEA", - "decimals": 18, - "name": "Binance USD", - "symbol": "BUSD", - "logoURI": "https://raw.githubusercontent.com/ava-labs/bridge-tokens/main/avalanche-tokens/0xaEb044650278731Ef3DC244692AB9F64C78FfaEA/logo.png" - }, - { - "chainId": 43114, - "address": "0xbA7dEebBFC5fA1100Fb055a87773e1E99Cd3507a", - "decimals": 18, - "name": "Dai Stablecoin", - "symbol": "DAI", - "logoURI": "https://raw.githubusercontent.com/ava-labs/bridge-tokens/main/avalanche-tokens/0xbA7dEebBFC5fA1100Fb055a87773e1E99Cd3507a/logo.png" - } - ], - "timestamp": "2021-04-15T00:21:05+00:00" + "name": "Camino Wallet ERC20 Tokens", + "logoURI": "", + "keywords": ["camino", "defi", "ethereum"], + "version": { + "major": 0, + "minor": 0, + "patch": 0 + }, + "tokens": [ + { + "chainId": 0, + "address": "", + "decimals": 18, + "name": "", + "symbol": "", + "logoURI": "" + } + ], + "timestamp": "2022-03-20T00:00:00+00:00" } diff --git a/src/ERC721Tokenlist.json b/src/ERC721Tokenlist.json index a454ba4e3..21d4a3b1b 100644 --- a/src/ERC721Tokenlist.json +++ b/src/ERC721Tokenlist.json @@ -1,33 +1,21 @@ { - "name": "Avalanche Wallet ERC721 Tokens", - "logoURI": "https://raw.githubusercontent.com/ava-labs/bridge-tokens/main/avalanche-tokens/0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7/logo.png", - "keywords": [ - "avalanche", - "defi", - "ethereum" - ], - "version": { - "major": 1, - "minor": 0, - "patch": 0 - }, - "tokens": [ - { - "chainId": 43114, - "address": "0x53d2230eac25643cd0772b310eebb569a100ea73", - "decimals": 0, - "name": "Avaxtars", - "symbol": "AVXT", - "logoURI": "" + "name": "Camino Wallet ERC721 Tokens", + "logoURI": "", + "keywords": ["camino", "defi", "ethereum"], + "version": { + "major": 0, + "minor": 0, + "patch": 0 }, - { - "chainId": 43114, - "address": "0x0540E4EE0C5CdBA347C2f0E011ACF8651bB70Eb9", - "decimals": 0, - "name": "CryptoSeals", - "symbol": "SEAL", - "logoURI": "" - } - ], - "timestamp": "2021-04-15T00:21:05+00:00" + "tokens": [ + { + "chainId": 0, + "address": "", + "decimals": 0, + "name": "", + "symbol": "", + "logoURI": "" + } + ], + "timestamp": "2022-03-20T00:00:00+00:00" } diff --git a/src/_main.scss b/src/_main.scss index a9490f119..db6150703 100644 --- a/src/_main.scss +++ b/src/_main.scss @@ -94,13 +94,10 @@ $s-size-mobile: 14px; } } - -video{ +video { outline: none; } - - *[tooltip]:hover:before { border-radius: 4px; /*left: 0;*/ @@ -124,7 +121,7 @@ textarea, input { @include highlight-border; - &[disabled]{ + &[disabled] { border-color: transparent !important; } } @@ -132,13 +129,14 @@ input { .hover_border { @include highlight-border; - &[disabled]{ + &[disabled] { border-color: transparent !important; } } -input[type='number']{ - &::-webkit-outer-spin-button, &::-webkit-inner-spin-button { +input[type='number'] { + &::-webkit-outer-spin-button, + &::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; } @@ -261,7 +259,7 @@ label { } } -.single_line_input{ +.single_line_input { display: block; width: 100%; padding: 5px 12px; @@ -389,7 +387,7 @@ textarea { color: var(--primary-color-light) !important; } - &[disabled]{ + &[disabled] { border-color: transparent !important; } } @@ -413,8 +411,8 @@ textarea { } } -.v-input--checkbox{ - label{ +.v-input--checkbox { + label { color: var(--primary-color) !important; } } @@ -434,7 +432,7 @@ textarea { @include highlight-border; - &[disabled]{ + &[disabled] { border-color: transparent !important; } } @@ -489,25 +487,25 @@ p.err { white-space: normal; } -.no_scroll_bar{ +.no_scroll_bar { &::-webkit-scrollbar { display: none; } - -ms-overflow-style: none; /* IE and Edge */ - scrollbar-width: none; /* Firefox */ + -ms-overflow-style: none; /* IE and Edge */ + scrollbar-width: none; /* Firefox */ } -.flex-row{ +.flex-row { display: flex; flex-direction: row; } -.flex-column{ +.flex-column { display: flex; flex-direction: column; } -.subtext{ +.subtext { color: var(--primary-color-light); font-size: 0.8em; } diff --git a/src/components/Access/menu.scss b/src/components/Access/menu.scss index 076ab491e..e20c3ed29 100644 --- a/src/components/Access/menu.scss +++ b/src/components/Access/menu.scss @@ -1,21 +1,20 @@ - .menu_option { - background-color: var(--bg-light) !important; - color: var(--primary) !important; - padding: 12px; - margin: 2px 0; - width: 100%; - cursor: pointer; - display: flex; - align-items: center; + background-color: var(--bg-light) !important; + color: var(--primary) !important; + padding: 12px; + margin: 2px 0; + width: 100%; + cursor: pointer; + display: flex; + align-items: center; - p { - flex-grow: 1; - text-align: left; - padding: 0 1em; - } + p { + flex-grow: 1; + text-align: left; + padding: 0 1em; + } - &:hover { - opacity: 0.6; - } + &:hover { + opacity: 0.6; + } } diff --git a/src/components/SidePanels/History/ViewTypes/ImportExport.vue b/src/components/SidePanels/History/ViewTypes/ImportExport.vue index c49e17036..7f59891a0 100644 --- a/src/components/SidePanels/History/ViewTypes/ImportExport.vue +++ b/src/components/SidePanels/History/ViewTypes/ImportExport.vue @@ -2,11 +2,11 @@
@@ -112,6 +112,10 @@ export default class ImportExport extends Vue { let big = bnToBig(total, 9) return big.toLocaleString() } + + get nativeAssetSymbol(): string { + return this.$store.getters['Assets/AssetAVA']?.symbol ?? '' + } } diff --git a/src/components/wallet/TopCards/BalanceCard/BalanceCard.vue b/src/components/wallet/TopCards/BalanceCard/BalanceCard.vue index df45a705e..a5e6e7029 100644 --- a/src/components/wallet/TopCards/BalanceCard/BalanceCard.vue +++ b/src/components/wallet/TopCards/BalanceCard/BalanceCard.vue @@ -331,13 +331,9 @@ export default class BalanceCard extends Vue { @use '../../../../main'; .balance_card { display: grid; - grid-template-columns: 1fr 230px; column-gap: 20px; } -.nft_card { - border-left: 2px solid var(--bg-light); -} .fungible_card { height: 100%; display: grid !important; @@ -466,10 +462,6 @@ h4 { } } -.nft_card { - padding-left: 20px; -} - .breakdown_toggle { color: var(--primary-color-light); font-size: 13px; @@ -480,77 +472,4 @@ h4 { color: var(--secondary-color); } } - -@include main.medium-device { - .balance_card { - display: block; - //grid-template-columns: 1fr 120px; - } - - .balance { - font-size: 1.8rem !important; - } - - .balance_usd { - font-size: 11px; - } - .nft_col { - display: none; - } - - .alt_info { - font-size: 12px; - } -} - -@include main.mobile-device { - .balance_card { - grid-template-columns: none; - display: block !important; - } - - .nft_col { - display: none; - } - - .nft_card { - padding: 0; - margin-top: 15px; - padding-top: 15px; - border-top: 1px solid var(--primary-color-light); - border-left: none; - } - - .balance { - font-size: 2em !important; - } - - .where_info { - } - - .alt_info { - > div { - text-align: left; - grid-template-columns: none; - column-gap: 0; - } - - .alt_non_breakdown, - .alt_breakdown { - > div { - padding: 8px 0; - border-right: none; - border-bottom: 1px solid var(--bg-light); - - &:last-of-type { - border: none; - } - } - } - } - - .alt_non_breakdown { - display: none !important; - } -} diff --git a/src/components/wallet/TopCards/BalanceCard/NftCol.vue b/src/components/wallet/TopCards/BalanceCard/NftCol.vue index a47a95211..8c1116a0a 100644 --- a/src/components/wallet/TopCards/BalanceCard/NftCol.vue +++ b/src/components/wallet/TopCards/BalanceCard/NftCol.vue @@ -30,7 +30,7 @@ import NftFamilyCardsPreview from '@/components/misc/NftFamilyCardsPreview.vue' import { ERC721WalletBalance } from '@/store/modules/assets/modules/types' import ERC721View from '@/components/misc/ERC721View.vue' -const NFT_COUNT = 15 +const NFT_COUNT = 10 let payloadtypes = PayloadTypes.getInstance() @@ -135,6 +135,7 @@ export default class NftCol extends Vue { @use '../../../../main'; .nft_col { + margin-top: 10px; p { font-size: 12px; color: var(--primary-color-light); @@ -147,7 +148,7 @@ $nft_w: 35px; margin-top: 8px; grid-gap: 8px; display: grid; - grid-template-columns: repeat(5, $nft_w); + grid-template-columns: repeat(auto-fill, $nft_w); } .nft_item { diff --git a/src/components/wallet/portfolio/Fungibles.vue b/src/components/wallet/portfolio/Fungibles.vue index f52ce88ef..81ed6ffc1 100644 --- a/src/components/wallet/portfolio/Fungibles.vue +++ b/src/components/wallet/portfolio/Fungibles.vue @@ -11,29 +11,27 @@

{{ $t('portfolio.error_network') }}

-
+

{{ $t('portfolio.nobalance') }}

-
-
- - -
- - or - -
+
+ + +
+ + or +
@@ -50,7 +48,6 @@ import Erc20Token from '@/js/Erc20Token' import ERC20Row from '@/components/wallet/portfolio/ERC20Row.vue' import AddERC20TokenModal from '@/components/modals/AddERC20TokenModal.vue' import TokenListModal from '@/components/modals/TokenList/TokenListModal.vue' -import { WalletType } from '@/js/wallets/types' @Component({ components: { @@ -192,13 +189,9 @@ export default class Fungibles extends Vue { .scrollable { overflow-y: scroll; - height: 100%; flex-grow: 1; } -.scrollabe_cont { - height: 50px; -} .asset { border-bottom: 1px solid var(--bg-light); } @@ -248,10 +241,6 @@ export default class Fungibles extends Vue { display: none; } } - - .scrollable { - height: 90vh; - } } @include main.medium-device { diff --git a/src/components/wallet/portfolio/portfolio.scss b/src/components/wallet/portfolio/portfolio.scss index 9894bdc09..95e6cd2f5 100644 --- a/src/components/wallet/portfolio/portfolio.scss +++ b/src/components/wallet/portfolio/portfolio.scss @@ -1,7 +1,7 @@ .add_token_row { display: flex !important; justify-content: center; - padding: 24px; + margin-top: 24px; border: none !important; span { diff --git a/src/locales/de.json b/src/locales/de.json index e532775b4..bd8c49aef 100644 --- a/src/locales/de.json +++ b/src/locales/de.json @@ -140,7 +140,7 @@ "gasPrice": "Gas Preis (GWEI)", "gasLimit": "Gas Grenze", "confirm": "Bestätigen", - "cancel": "Abbruch", + "cancel": "Abbrechen", "success": { "desc": "Transaktion Gesendet", "label1": "Transaktions Hash" @@ -474,6 +474,7 @@ "create": "Eine neue Wallet erstellen" }, "misc": { - "balance": "Guthaben" + "balance": "Guthaben", + "cancel": "Abbrechen" } } diff --git a/src/locales/en.json b/src/locales/en.json index f5e3d0332..c303519f4 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -730,6 +730,7 @@ "create": "Create New Wallet" }, "misc": { - "balance": "Balance" + "balance": "Balance", + "cancel": "Cancel" } } diff --git a/src/views/Wallet.vue b/src/views/Wallet.vue index 02acc70a5..fd7b8ff36 100644 --- a/src/views/Wallet.vue +++ b/src/views/Wallet.vue @@ -15,7 +15,7 @@
- +
@@ -118,21 +118,20 @@ export default class Wallet extends Vue { display: grid; grid-template-columns: 200px 1fr 300px; column-gap: 15px; - height: 100%; + min-height: 100%; background-color: var(--bg-wallet); } .sidenav { background-color: var(--bg-wallet-light); + margin-top: 8px; } .panel { - overflow: auto; - height: 100%; + overflow: hidden; } .wallet_main { - height: 100%; display: grid; grid-template-rows: max-content 1fr; grid-gap: 15px; diff --git a/src/views/access/Account.vue b/src/views/access/Account.vue index d736529ac..6850d610f 100644 --- a/src/views/access/Account.vue +++ b/src/views/access/Account.vue @@ -24,7 +24,7 @@

- Cancel + {{ $t('access.cancel') }}
diff --git a/src/views/access/Mnemonic.vue b/src/views/access/Mnemonic.vue index 17ffccba1..874cdc275 100644 --- a/src/views/access/Mnemonic.vue +++ b/src/views/access/Mnemonic.vue @@ -18,7 +18,7 @@ {{ $t('access.submit') }} - {{ $t('access.mnemonic.cancel') }} + {{ $t('access.cancel') }} diff --git a/src/views/wallet/Studio.vue b/src/views/wallet/Studio.vue index bb185cab4..c6cdbae05 100644 --- a/src/views/wallet/Studio.vue +++ b/src/views/wallet/Studio.vue @@ -151,8 +151,9 @@ export default class Studio extends Vue { .options { display: grid; - grid-template-columns: repeat(3, 1fr); + grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); column-gap: 14px; + row-gap: 14px; > div { border-radius: 4px; border: 1px solid var(--bg-light); diff --git a/src/views/wallet/Transfer.vue b/src/views/wallet/Transfer.vue index 2a4fc7a6c..8e27b5ec9 100644 --- a/src/views/wallet/Transfer.vue +++ b/src/views/wallet/Transfer.vue @@ -100,7 +100,7 @@ style="margin-top: 20px !important; color: var(--primary-color)" @click="cancelConfirm" > - Cancel + {{ $t('misc.cancel') }} diff --git a/src/components/wallet/earn/Delegate/AddDelegator.vue b/src/components/wallet/earn/Delegate/AddDelegator.vue index 4700cf396..04e050849 100644 --- a/src/components/wallet/earn/Delegate/AddDelegator.vue +++ b/src/components/wallet/earn/Delegate/AddDelegator.vue @@ -196,7 +196,7 @@ From a7a3663cdf312bf4c9e863708c707835e204d5ec Mon Sep 17 00:00:00 2001 From: peak3d Date: Sun, 17 Apr 2022 22:54:34 +0200 Subject: [PATCH 028/334] Fix NFT in Send / Remove some CSS:scoll --- src/App.vue | 2 +- .../misc/EVMInputDropdown/EVMAssetDropdown.vue | 1 - src/components/modals/AvmTokenSelect.vue | 1 - src/components/modals/EvmTokenSelect/ERCNftRow.vue | 2 +- .../modals/EvmTokenSelect/EVMTokenSelectModal.vue | 13 +++---------- 5 files changed, 5 insertions(+), 14 deletions(-) diff --git a/src/App.vue b/src/App.vue index 15fcea4d7..b7cc1fbd1 100644 --- a/src/App.vue +++ b/src/App.vue @@ -2,7 +2,7 @@ diff --git a/src/views/access/Access.vue b/src/views/access/Access.vue index 97ccc702a..4527eba16 100644 --- a/src/views/access/Access.vue +++ b/src/views/access/Access.vue @@ -53,4 +53,9 @@ export default class Access extends Vue {} .access_card { text-align: center; } +@media only screen and (max-width: main.$mobile_width) { + .access_card { + padding: main.$container-padding-mobile; + } +} diff --git a/src/views/access/Account.vue b/src/views/access/Account.vue index a67884679..d69f52381 100644 --- a/src/views/access/Account.vue +++ b/src/views/access/Account.vue @@ -24,28 +24,29 @@

- {{ $t('access.cancel') }} + diff --git a/src/views/access/Mnemonic.vue b/src/views/access/Mnemonic.vue index 7bd7e9289..ea16823c7 100644 --- a/src/views/access/Mnemonic.vue +++ b/src/views/access/Mnemonic.vue @@ -1,31 +1,29 @@ diff --git a/src/helpers/wallet_helper.ts b/src/helpers/wallet_helper.ts index 3c80c01fb..9098ce5e2 100644 --- a/src/helpers/wallet_helper.ts +++ b/src/helpers/wallet_helper.ts @@ -1,7 +1,7 @@ import { ava } from '@/AVA' import { - UTXOSet as PlatformUTXOSet, UTXO as PlatformUTXO, + UTXOSet as PlatformUTXOSet, } from '@c4tplatform/caminojs/dist/apis/platformvm/utxos' import { UTXO as AVMUTXO } from '@c4tplatform/caminojs/dist/apis/avm/utxos' import { WalletType } from '@/js/wallets/types' @@ -14,13 +14,15 @@ import { buildEvmTransferNativeTx, buildMintNftTx, } from '@/js/TxHelper' -import { PayloadBase } from '@c4tplatform/caminojs/dist/utils' +import { PayloadBase, UnixNow } from '@c4tplatform/caminojs/dist/utils' import { ITransaction } from '@/components/wallet/transfer/types' import { web3 } from '@/evm' import Erc20Token from '@/js/Erc20Token' import { getStakeForAddresses } from '@/helpers/utxo_helper' import ERCNftToken from '@/js/ERCNftToken' +import { UnsignedTx, UTXOSet } from '@c4tplatform/caminojs/dist/apis/platformvm' +import axios from 'axios' class WalletHelper { static async getStake(wallet: WalletType): Promise { @@ -196,6 +198,10 @@ class WalletHelper { return await ava.PChain().issueTx(tx) } + static async getAddressState(address: string): Promise { + return await ava.PChain().getAddressStates(address) + } + // Single sig in this first implementation // For MultiSig extend consortiumMemberAuthCredentials static async registerNodeTx( @@ -239,6 +245,34 @@ class WalletHelper { return await ava.PChain().issueTx(tx) } + static async addValidatorTx( + wallet: WalletType, + nodeID: string, + startTime: BN, + endTime: BN, + stakeAmount: BN + ): Promise { + let pAddressStrings = wallet.getAllAddressesP() + const pchain = ava.PChain() + const utxoSet: UTXOSet = (await pchain.getUTXOs(pAddressStrings)).utxos + + const unsignedTx: UnsignedTx = await pchain.buildAddValidatorTx( + utxoSet, + pAddressStrings, + pAddressStrings, + pAddressStrings, + nodeID, + startTime, + endTime, + stakeAmount, + pAddressStrings, + 10 + ) + + let tx = await wallet.signP(unsignedTx) + return await pchain.issueTx(tx) + } + static async getEthBalance(wallet: WalletType) { let bal = await web3.eth.getBalance(wallet.ethAddress) return new BN(bal) diff --git a/src/locales/en.json b/src/locales/en.json index cb1a0d34d..8147b670c 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -73,6 +73,7 @@ "send": "Send", "export": "Cross Chain", "earn": "Earn", + "validator": "Validator", "studio": "Studio", "advanced": "Advanced", "activity": "Activity", @@ -378,12 +379,13 @@ "earn": { "title": "Earn", "desc": "You can earn more @.native:(0) by staking your existing tokens.", - "subtitle1": "Validate", + "subtitle1": "Setting up a Validator Node", "subtitle2": "Delegate", "subtitle3": "Cross Chain Transfer", "subtitle4": "Estimated Rewards", "warning_1": "You must have at least {0} @.native:(0) on the P chain to become a validator.", "warning_2": "You must have at least {0} @.native:(0) on the P chain to become a delegator.", + "warning_3": "Setting up a validator node is not possible for your selected network. Please change your network to start running a validator node.", "validate_card": { "title": "Validate", "desc": "You have an @.project:(0) node that you want to stake with.", @@ -454,16 +456,20 @@ } }, "validate": { - "label_1": "Node ID", + "requirements_introduction": "In order to set up your validator node you have to:", + "nodeId": "Node ID", + "label_1": "Validator Node's Private Key", + "description_1": "Please enter the Node's Static Private Key (you can receive one by calling admin.getNodeSigner on your node)", + "label_3": "P-chain address your validator node will be registered with", "duration": { - "label": "Staking End Date", + "label": "Validation End Date", "desc": "Your @.native:(0) tokens will be locked until this date.", "start": "Start Date & Time", "end": "End Date & Time" }, "amount": { - "label": "Deposit Amount", - "desc": "Deposited amount is always 100.000 @.native:(0)." + "label": "Bonded Amount", + "desc": "Bonded amount is always {0} @.native:(0)." }, "fee": { "label": "Delegation Fee", @@ -493,6 +499,7 @@ "type_local": "This wallet", "type_custom": "Custom" }, + "register_validator_node": "Register Validator Node", "confirm": "Confirm", "submit": "Submit", "cancel": "Cancel", @@ -502,6 +509,12 @@ "status": "Status", "reason": "Reason" }, + "warns": { + "camino_available": "100k CAM are available on your P-chain address", + "kyc_verified": "KYC or KYB verified", + "consortium_member_verified": "Accepted to be a member of the consortium", + "consortium_member_address_linked_to_node": "Your consortium member address is linked to your Node ID" + }, "errs": { "duration_warn": "WARNING: You must have at least 14 days remaining on your validation period to accept delegations.", "date": "Start date must be in the future and end date must be after start date.", diff --git a/src/plugins/vuetify.ts b/src/plugins/vuetify.ts index f1c417167..a28359db4 100644 --- a/src/plugins/vuetify.ts +++ b/src/plugins/vuetify.ts @@ -61,6 +61,8 @@ import { faVideo, faUnlink, faFileCsv, + faExternalLinkAlt, + faExternalLinkSquareAlt, } from '@fortawesome/free-solid-svg-icons' import { faBtc, faGoogle } from '@fortawesome/free-brands-svg-icons' @@ -124,7 +126,9 @@ library.add( faShare, faVideo, faUnlink, - faFileCsv + faFileCsv, + faExternalLinkAlt, + faExternalLinkSquareAlt ) Vue.component('fa', FontAwesomeIcon) diff --git a/src/views/wallet/Validator.vue b/src/views/wallet/Validator.vue index c359d3f2b..32f57cff7 100644 --- a/src/views/wallet/Validator.vue +++ b/src/views/wallet/Validator.vue @@ -1,21 +1,25 @@ diff --git a/src/components/wallet/earn/Validate/ValidatorPending.vue b/src/components/wallet/earn/Validate/ValidatorPending.vue new file mode 100644 index 000000000..2e094fb07 --- /dev/null +++ b/src/components/wallet/earn/Validate/ValidatorPending.vue @@ -0,0 +1,46 @@ + + + diff --git a/src/components/wallet/earn/Validate/ValidatorSuspended.vue b/src/components/wallet/earn/Validate/ValidatorSuspended.vue new file mode 100644 index 000000000..65661edc2 --- /dev/null +++ b/src/components/wallet/earn/Validate/ValidatorSuspended.vue @@ -0,0 +1,88 @@ + + + diff --git a/src/helpers/wallet_helper.ts b/src/helpers/wallet_helper.ts index 4a85df194..91f7aa7c2 100644 --- a/src/helpers/wallet_helper.ts +++ b/src/helpers/wallet_helper.ts @@ -22,6 +22,9 @@ import Erc20Token from '@/js/Erc20Token' import { getStakeForAddresses } from '@/helpers/utxo_helper' import ERCNftToken from '@/js/ERCNftToken' import { UnsignedTx, UTXOSet } from '@c4tplatform/caminojs/dist/apis/platformvm' + +import { GetValidatorsResponse } from '@/store/modules/platform/types' + import axios from 'axios' class WalletHelper { @@ -348,6 +351,16 @@ class WalletHelper { // Return 10% more return Math.round(estGas * 1.1) } + + static async findNodeIDInCurrentValidators(nodeID: string): Promise { + let res = (await ava + .PChain() + .getCurrentValidators('11111111111111111111111111111111LpoYY', [ + nodeID, + ])) as GetValidatorsResponse + let validator = res.validators[0] + return validator + } } export { WalletHelper } diff --git a/src/views/wallet/Validator.vue b/src/views/wallet/Validator.vue index eaf60b4f2..59c9685ef 100644 --- a/src/views/wallet/Validator.vue +++ b/src/views/wallet/Validator.vue @@ -1,7 +1,15 @@