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

Portal 3.2 Beta to Mainnet #448

Merged
merged 34 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
7da7107
Add Validator page template
dmytrotkk Oct 31, 2024
748cf6e
Merge branch 'develop' of github.com:skalenetwork/portal into add-val…
dmytrotkk Nov 6, 2024
f005adb
Merge pull request #424 from skalenetwork/add-new-tokens-mainnet
dmytrotkk Nov 11, 2024
3854023
Add basic validator management page - WIP
dmytrotkk Nov 12, 2024
076d4d7
Pull changes from develop
dmytrotkk Nov 12, 2024
58b99c7
Update Validator page
dmytrotkk Nov 12, 2024
bf860ea
Fix custom address logic
dmytrotkk Nov 12, 2024
ddfa32b
Fix custom address logic
dmytrotkk Nov 12, 2024
a53b441
Update logic of delegation card, fix ui issues
dmytrotkk Nov 13, 2024
14379bf
Move staking actions to the separate module, add accept function to a…
dmytrotkk Nov 15, 2024
6dce4da
Add staking flow component, move chain rewards, update paymaster abi
dmytrotkk Nov 19, 2024
fdeac1d
Finish chain rewards module
dmytrotkk Nov 20, 2024
3c68769
Fix minor issues in paymaster module
dmytrotkk Nov 20, 2024
dd91951
Add explorer URL for europa token
dmytrotkk Nov 20, 2024
9e05b7b
Add sFUEL check to rewards claim
dmytrotkk Nov 20, 2024
2495bc1
Add notifications system, restructure components
dmytrotkk Nov 21, 2024
435d99e
Fix custom address handling in chain rewards
dmytrotkk Nov 21, 2024
06c91ba
Add tooltip to notification, update custom address logic
dmytrotkk Nov 22, 2024
d0abddd
Minor hotfix for validator loading state
dmytrotkk Nov 25, 2024
48d984c
Update README - usage, dev setup
dmytrotkk Nov 25, 2024
6d2fa33
Merge pull request #427 from skalenetwork/update-scripts
dmytrotkk Nov 27, 2024
2a6f448
delete-categories
ines-SKALE Nov 27, 2024
a618f3c
Merge pull request #431 from skalenetwork/delete-categories
dmytrotkk Nov 27, 2024
07fd85b
Add fix for images with numbers in name
dmytrotkk Dec 5, 2024
b75f2d7
Change types in chain rewards, remove old css
dmytrotkk Dec 6, 2024
708ee7e
Merge pull request #425 from skalenetwork/add-validator-management-page
dmytrotkk Dec 6, 2024
3df153a
Merge pull request #433 from skalenetwork/fix-number-imports
dmytrotkk Dec 9, 2024
7b2aaa7
Update metaport dependency, add addressChanged handled, update submod…
dmytrotkk Dec 9, 2024
d96492b
Merge pull request #434 from skalenetwork/fix-ui-issues
dmytrotkk Dec 9, 2024
730a5d3
Merge pull request #435 from skalenetwork/develop
dmytrotkk Dec 9, 2024
4362946
Update Validator management page name
dmytrotkk Dec 11, 2024
cbd7f92
Merge branch 'main' of github.com:skalenetwork/portal into update-val…
dmytrotkk Dec 11, 2024
36cd761
Merge pull request #441 from skalenetwork/update-validators-page-name
dmytrotkk Dec 18, 2024
57e80d2
Merge pull request #446 from skalenetwork/develop
dmytrotkk Dec 18, 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
31 changes: 19 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ It's possible to embed Bridge link with fallback into your dApp.
#### Directing users to the particular pair of chains

```
http://[BASE_BRIDGE_URL]/?from=[FROM_CHAIN_NAME]&to=[TO_CHAIN_NAME]&token=[TOKEN_SYMBOL]&type=[TOKEN_TYPE]&from-app=[FROM_APP_NAME]&to-app=[TO_APP_NAME]
http://[BASE_PORTAL_URL]/bridge/?from=[FROM_CHAIN_NAME]&to=[TO_CHAIN_NAME]&token=[TOKEN_SYMBOL]&type=[TOKEN_TYPE]&from-app=[FROM_APP_NAME]&to-app=[TO_APP_NAME]
```

Example:

```
http://[BASE_BRIDGE_URL]/?from=elated-tan-skat&to=green-giddy-denebola&token=skl&type=erc20&from-app=ruby&to-app=nftb
https://[BASE_PORTAL_URL]/bridge/?from=elated-tan-skat&to=green-giddy-denebola&token=usdc&type=erc20&from-app=sushiswap&to-app=bit-hotel
```

#### Customizing transfer parameters
Expand All @@ -42,13 +42,11 @@ Optional params:
- `from-app` - when transfering from a Hub chain, it's possible to specify the name of the app to transfer from
- `to-app` - when transfering to a Hub chain, it's possible to specify the name of the app to transfer to


Will be available in the future:

- `fallback-url` - URL with fallback link to redirect user after the transfer is completed (should be encoded)
- `fallback-text` - Text to display on the fallback button (should be encoded)


In JS you can use the following function to encode the URL:

```js
Expand All @@ -58,31 +56,40 @@ function encodeUrl(url) {
```

## Getting Started

To get started with the SKALE Portal, users can visit the [SKALE Portal](https://portal.skale.space/) website and click on the "Connect wallet" button. Users can then connect their wallets and select the source and destination blockchains for their transfers.

## Development Setup

If you're interested in contributing to the SKALE Portal, follow these steps to set up your development environment:

1. Clone the repository: `git clone --recurse-submodules https://github.com/skalenetwork/portal.git`
2. Install dependencies: `cd portal && yarn install`
3. Prepare metadata: `NETWORK_NAME=[SKALE NETWORK NAME - mainnet or staging] bash build.sh`
4. Export Mainnet Ethereum endpoint to your env: `export VITE_MAINNET_ENDPOINT=XXX` or create `.env` file in the root dir
5. Start the development server: `yarn start`
2. Install dependencies: `cd portal && bun i`
3. Build the project:

- Mainnet env: `bun build:mainnet`
- Testnet env: `bun build:testnet`

4. Start the development server: `VITE_WC_PROJECT_ID=[PUT WALLETCONNECT PROJECT ID HERE] bun dev`

The SKALE Portal is built using the Create React App TypeScript template and uses [Metaport](https://github.com/skalenetwork/metaport) and [ima-js](https://github.com/skalenetwork/ima-js) libraries.

To contribute to the project, create a new branch with a descriptive name for your changes, make your changes, and submit a pull request.

## Environment Variables
### Required Environment Variables

```bash
VITE_MAINNET_ENDPOINT= # mainnet endpoint, required
VITE_WC_PROJECT_ID= # walletconnect project ID, optional
VITE_WC_PROJECT_ID= # walletconnect project ID, REQUIRED
```

### Optional Environment Variables

```bash
VITE_MAINNET_ENDPOINT= # mainnet endpoint, optional
VITE_TRANSAK_STAGING_ENV=true # set test env for transak, optional
VITE_TRANSAK_API_KEY= # onramp API key, optional
```


## Security and Liability

The SKALE Portal and code is WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Expand Down
Binary file modified bun.lockb
Binary file not shown.
1 change: 1 addition & 0 deletions config/testnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { type interfaces } from '@skalenetwork/metaport'

export const METAPORT_CONFIG: interfaces.MetaportConfig = {
skaleNetwork: 'testnet',
mainnetEndpoint: 'https://ethereum-holesky-rpc.publicnode.com',
openOnLoad: true,
openButton: true,
debug: false,
Expand Down
4 changes: 3 additions & 1 deletion generate-imports.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ const generateNamespaceExportsForDir = (dir) => {
if (svgFiles.length === 0) return; // Skip folders without SVGs

const namespaceExports = svgFiles.map(file => {
const variableName = path.basename(file, path.extname(file)).replace(/-([a-z])/g, (_, g) => g.toUpperCase()); // Convert kebab-case to camelCase
const variableName = path.basename(file, path.extname(file))
.replace(/^(_+)/, '$1')
.replace(/-([a-z0-9])/gi, (_, g) => g.toUpperCase());
return `export * as ${variableName} from './${path.basename(file)}';`;
}).join('\n');

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "portal",
"private": true,
"version": "3.1.0",
"version": "3.2.0",
"type": "module",
"scripts": {
"build:testnet": "NETWORK_NAME=testnet bash build.sh",
Expand All @@ -21,7 +21,7 @@
"@mdx-js/rollup": "^2.3.0",
"@mui/icons-material": "^5.15.14",
"@mui/material": "^5.15.14",
"@skalenetwork/metaport": "3.1.0-develop.0",
"@skalenetwork/metaport": "3.2.0-develop.0",
"@skalenetwork/skale-contracts-ethers-v6": "1.0.1",
"@transak/transak-sdk": "^3.1.1",
"@types/react-copy-to-clipboard": "^5.0.4",
Expand Down
Binary file modified packages/core/bun.lockb
Binary file not shown.
1 change: 0 additions & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
},
"author": "SKALE Labs",
"devDependencies": {
"ethers": "*.*.*",
"typescript": "^4.9.5"
}
}
19 changes: 19 additions & 0 deletions packages/core/src/types/staking/Delegation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,22 @@ export interface IDelegationInfo {
delegationId: bigint
delegationType: DelegationType
}

export interface IDelegationTotals {
proposed: {
count: number
amount: bigint
}
accepted: {
count: number
amount: bigint
}
delegated: {
count: number
amount: bigint
}
completed: {
count: number
amount: bigint
}
}
2 changes: 1 addition & 1 deletion skale-network
Submodule skale-network updated 75 files
+452 −152 metadata/mainnet/chains.json
+1 −0 metadata/mainnet/logos/__offchain-01node.svg
+ metadata/mainnet/logos/__offchain-ankr.png
+ metadata/mainnet/logos/__offchain-anonstake.png
+ metadata/mainnet/logos/__offchain-blockware.png
+ metadata/mainnet/logos/__offchain-chainflow.png
+ metadata/mainnet/logos/__offchain-chainode-tech.png
+ metadata/mainnet/logos/__offchain-cypher-core.png
+ metadata/mainnet/logos/__offchain-droplinked.png
+ metadata/mainnet/logos/__offchain-easy-2-stake.png
+ metadata/mainnet/logos/__offchain-freshstaking.png
+ metadata/mainnet/logos/__offchain-hashkey-cloud.png
+ metadata/mainnet/logos/__offchain-infstones.png
+ metadata/mainnet/logos/__offchain-myetherwallet.png
+16 −0 metadata/mainnet/logos/__offchain-nansen.svg
+ metadata/mainnet/logos/__offchain-ngcstakex.png
+ metadata/mainnet/logos/__offchain-signia.png
+ metadata/mainnet/logos/__offchain-staked.png
+ metadata/mainnet/logos/__offchain-stakin.png
+ metadata/mainnet/logos/__offchain-wolfedgecapital.png
+ metadata/mainnet/logos/green-giddy-denebola-chilled-worlds.png
+ metadata/mainnet/logos/green-giddy-denebola-codyfight.png
+ metadata/mainnet/logos/green-giddy-denebola-etherstrike.png
+ metadata/mainnet/logos/green-giddy-denebola-eventy.png
+ metadata/mainnet/logos/green-giddy-denebola-for-loot-and-glory.png
+ metadata/mainnet/logos/green-giddy-denebola-fusyfox.png
+ metadata/mainnet/logos/green-giddy-denebola-hatchyverse.png
+ metadata/mainnet/logos/green-giddy-denebola-playground.png
+ metadata/mainnet/logos/green-giddy-denebola-smartmuv.png
+ metadata/mainnet/logos/green-giddy-denebola-spells-of-genesis.png
+ metadata/mainnet/logos/green-giddy-denebola-streamnft.png
+ metadata/mainnet/logos/green-giddy-denebola-zesh.png
+ metadata/mainnet/logos/honorable-steel-rasalhague-caczero.png
+ metadata/mainnet/screenshots/__offchain-droplinked-1.png
+ metadata/mainnet/screenshots/__offchain-droplinked-2.png
+ metadata/mainnet/screenshots/__offchain-droplinked-3.png
+ metadata/mainnet/screenshots/green-giddy-denebola-chilled-worlds-1.jpg
+ metadata/mainnet/screenshots/green-giddy-denebola-chilled-worlds-2.jpg
+ metadata/mainnet/screenshots/green-giddy-denebola-chilled-worlds-3.png
+ metadata/mainnet/screenshots/green-giddy-denebola-chilled-worlds-4.jpg
+ metadata/mainnet/screenshots/green-giddy-denebola-codyfight-1.png
+ metadata/mainnet/screenshots/green-giddy-denebola-codyfight-2.png
+ metadata/mainnet/screenshots/green-giddy-denebola-codyfight-3.png
+ metadata/mainnet/screenshots/green-giddy-denebola-etherstrike-1.png
+ metadata/mainnet/screenshots/green-giddy-denebola-etherstrike-2.png
+ metadata/mainnet/screenshots/green-giddy-denebola-etherstrike-3.png
+ metadata/mainnet/screenshots/green-giddy-denebola-eventy-1.png
+ metadata/mainnet/screenshots/green-giddy-denebola-eventy-2.png
+ metadata/mainnet/screenshots/green-giddy-denebola-for-loot-and-glory-1.png
+ metadata/mainnet/screenshots/green-giddy-denebola-for-loot-and-glory-2.png
+ metadata/mainnet/screenshots/green-giddy-denebola-fusyfox-1.jpg
+ metadata/mainnet/screenshots/green-giddy-denebola-fusyfox-2.jpg
+ metadata/mainnet/screenshots/green-giddy-denebola-fusyfox-3.jpg
+ metadata/mainnet/screenshots/green-giddy-denebola-hatchyverse-1.jpg
+ metadata/mainnet/screenshots/green-giddy-denebola-hatchyverse-2.jpg
+ metadata/mainnet/screenshots/green-giddy-denebola-hatchyverse-3.jpg
+ metadata/mainnet/screenshots/green-giddy-denebola-playground-1.jpg
+ metadata/mainnet/screenshots/green-giddy-denebola-playground-2.jpg
+ metadata/mainnet/screenshots/green-giddy-denebola-playground-3.jpg
+ metadata/mainnet/screenshots/green-giddy-denebola-smartmuv-1.png
+ metadata/mainnet/screenshots/green-giddy-denebola-smartmuv-2.png
+ metadata/mainnet/screenshots/green-giddy-denebola-smartmuv-3.png
+ metadata/mainnet/screenshots/green-giddy-denebola-spells-of-genesis-1.png
+ metadata/mainnet/screenshots/green-giddy-denebola-spells-of-genesis-2.png
+ metadata/mainnet/screenshots/green-giddy-denebola-spells-of-genesis-3.jpg
+ metadata/mainnet/screenshots/green-giddy-denebola-streamnft-1.png
+ metadata/mainnet/screenshots/green-giddy-denebola-streamnft-2.png
+ metadata/mainnet/screenshots/green-giddy-denebola-zesh-1.png
+ metadata/mainnet/screenshots/green-giddy-denebola-zesh-2.png
+ metadata/mainnet/screenshots/green-giddy-denebola-zeus-1.jpg
+ metadata/mainnet/screenshots/green-giddy-denebola-zeus-2.jpg
+ metadata/mainnet/screenshots/green-giddy-denebola-zeus-3.jpg
+ metadata/mainnet/screenshots/honorable-steel-rasalhague-caczero-1.png
+ metadata/mainnet/screenshots/honorable-steel-rasalhague-caczero-2.png
+ metadata/mainnet/screenshots/honorable-steel-rasalhague-caczero-3.png
81 changes: 53 additions & 28 deletions src/App.scss
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ body {
width: 100%;
}

.fullH {
height: 100%;
}

.mp__btnConnect {
position: relative;

Expand Down Expand Up @@ -449,12 +453,8 @@ body::-webkit-scrollbar {
box-shadow: none !important;
}

.btnerror {
background: #f4433621;
}

.btnwarning {
background: rgb(244 139 54 / 13%);
.btnDisabled {
background: #262626;
}

.btnSmLoading {
Expand Down Expand Up @@ -543,6 +543,12 @@ body::-webkit-scrollbar {
}
}

.MuiToggleButton-root {
border-radius: 25px !important;
padding: 4px 10px;
border: none !important;
}

.copyBoard {
margin: 10px 0 !important;
padding: 13pt 15pt !important;
Expand All @@ -559,8 +565,8 @@ body::-webkit-scrollbar {
}

code {
white-space: pre-wrap;
overflow: hidden;
white-space: nowrap;
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
monospace;
}
Expand Down Expand Up @@ -791,6 +797,22 @@ input[type=number] {
}
}

.chipNotification {
background: #e94e4e;
border-radius: 20px;
width: 20px;
height: 20px;
text-align: center;
display: flex;
align-items: center;
justify-content: center;

p {
color: #000000de !important;
font-weight: 600 !important;
}
}

.chipTrending {
background: linear-gradient(180deg, #e56d36, #D0602D) !important;

Expand Down Expand Up @@ -825,12 +847,13 @@ input[type=number] {
}

.chipXs {
border-radius: 20px;
padding: 3px 6px;
border-radius: 15px;
padding: 6px 8px;
text-align: center;

svg {
width: 14px;
height: 14px;
width: 12px;
height: 12px;
}
}

Expand All @@ -844,16 +867,6 @@ input[type=number] {
}
}

.chipXs {
border-radius: 15px;
padding: 4px 6px;

svg {
width: 12px;
height: 12px;
}
}

.skChip {
background: linear-gradient(180deg, rgb(52 52 52), rgb(31 31 31));
}
Expand Down Expand Up @@ -885,6 +898,11 @@ input[type=number] {
color: #3cda94;
}

.chip_REWARDS {
background: linear-gradient(180deg, #3d390f, #2a230a);
color: #dac83c;
}

.chip_ACCEPTED {
background: linear-gradient(180deg, #233d0f, #0a1b07);
color: #3cda4e;
Expand Down Expand Up @@ -1149,7 +1167,6 @@ input[type=number] {
}
}


.trustedBadge {
color: #0095f6;
}
Expand All @@ -1158,12 +1175,6 @@ input[type=number] {
color: #ffb817;
}

.validatorCard {
height: 100% !important;
cursor: pointer;
}


.pOneLine {
overflow: hidden;
white-space: nowrap;
Expand Down Expand Up @@ -1426,7 +1437,21 @@ input[type=number] {
display: none;
}

.opacity0 {
opacity: 0;
}

.MuiTooltip-tooltip {
font-size: 0.8rem !important;
padding: 8px 12px !important;
}

.delegationFlowText {
border-top: 2px #4a4a4a solid;
margin: 0 10px;
padding: 2px 5px 0 5px;
}

.delegationFlowIcon {
margin-top: -20px;
}
Loading
Loading