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

2.0 Stable release #223

Merged
merged 132 commits into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
132 commits
Select commit Hold shift + click to select a range
d490022
Add regression network
dmytrotkk Jul 27, 2023
896315c
Fix linter
dmytrotkk Jul 27, 2023
e83075e
Merge pull request #182 from skalenetwork/add-regression
dmytrotkk Jul 27, 2023
2a9202b
New metaport architecture
dmytrotkk Aug 7, 2023
4809ea9
Merge develop branch
dmytrotkk Aug 7, 2023
6e646b1
Update skale-network
dmytrotkk Aug 7, 2023
517e451
Fix path to regression icons
dmytrotkk Aug 7, 2023
186ba3b
Comment out metamask wallet
dmytrotkk Aug 7, 2023
e3e0025
Update webpack-cli, move packages to dependencies, add regression
dmytrotkk Aug 8, 2023
c467f56
Update webpack config
dmytrotkk Aug 11, 2023
1a28ee3
Update React imports
dmytrotkk Aug 11, 2023
4fea232
Migrate builder to rollup.js
dmytrotkk Aug 14, 2023
b7b85e7
Split injected metaport and mp component
dmytrotkk Aug 14, 2023
fda6a4b
Add chain icons support for vite
dmytrotkk Aug 14, 2023
476a9d4
Add token icons in vite build
dmytrotkk Aug 14, 2023
dc2dce7
Add prepare_meta script
dmytrotkk Aug 14, 2023
1f201fb
Run prettier
dmytrotkk Aug 14, 2023
1bee1af
Move theming logic to metaport provider
dmytrotkk Aug 14, 2023
4c3f9d1
Make tokenIcon exportable, add external interfaces
dmytrotkk Aug 15, 2023
035c133
Fix storybook build - add react-dom
dmytrotkk Aug 15, 2023
b8d45b4
Update vercel build command
dmytrotkk Aug 15, 2023
2c4c4fe
Remove reduntant scss ts modules, add transfer ETA and ETF modules
dmytrotkk Aug 16, 2023
de8a4c1
New amount input, export amount error module
dmytrotkk Aug 16, 2023
69baad4
Add dest token balance module
dmytrotkk Aug 17, 2023
b3333d6
Fix dest token balance, export proxy endpoints
dmytrotkk Aug 17, 2023
90078c7
Update dest chains filtering logic, update config
dmytrotkk Aug 18, 2023
c2546e4
Update styling system, add community pool management
dmytrotkk Aug 22, 2023
a390b5f
Add recharge community pool function
dmytrotkk Aug 22, 2023
d55550f
Update storybook, update vercel script
dmytrotkk Aug 22, 2023
d7bd049
Use default token icons
dmytrotkk Aug 22, 2023
78234c8
Fix community pool logic for hub chains
dmytrotkk Aug 22, 2023
f4d687c
Add sFUEL station, fix community pool errors
dmytrotkk Aug 23, 2023
a463b13
PoW sFUEL faucet
dmytrotkk Aug 28, 2023
4eb413f
Remove web3-utils
dmytrotkk Aug 28, 2023
480fa55
Optimize miner script, update prettier rules
dmytrotkk Aug 28, 2023
6a9889f
Drop bn.js requirement
dmytrotkk Aug 28, 2023
5219de7
Update miner scirpt
dmytrotkk Aug 28, 2023
69d6ac6
Update sFUEL logic, add vibrant mode
dmytrotkk Aug 29, 2023
b76537a
Add ETH M2S, S2M methods, add ETH balance check
dmytrotkk Aug 30, 2023
7540661
Update eth unlock step, update wallet connector
dmytrotkk Aug 31, 2023
e890973
Run prettier
dmytrotkk Aug 31, 2023
7ea7643
Add wrapped tokens module
dmytrotkk Sep 5, 2023
4fd6009
Run prettier
dmytrotkk Sep 5, 2023
abe40aa
Add an ability to select apps
dmytrotkk Sep 7, 2023
ff97ca4
Update dependencies
dmytrotkk Sep 8, 2023
d4b47d0
Refactor tokens and chains state
dmytrotkk Sep 10, 2023
ef5b195
Fix get ETH token balance
dmytrotkk Sep 10, 2023
e074d18
Update prettier rules, fix routed ETH transfers
dmytrotkk Sep 11, 2023
4dcf13b
Add unwrap for eth token
dmytrotkk Sep 11, 2023
c9c04fe
Restructure CSS imports
dmytrotkk Sep 11, 2023
b3c224d
Update components folder structure
dmytrotkk Sep 11, 2023
f0aba33
Integrate addToken module
dmytrotkk Sep 11, 2023
ae6ec21
Add transfer history, add transaction logs
dmytrotkk Sep 14, 2023
788fefd
Add dynamic skale chains support, move chains metadata
dmytrotkk Sep 15, 2023
08042cb
Restructure imports
dmytrotkk Sep 15, 2023
2c47869
Update submodules
dmytrotkk Sep 20, 2023
e51339a
Minor changes
dmytrotkk Sep 21, 2023
53c91ae
Update WS endpoint func, general cleanup
dmytrotkk Sep 22, 2023
4b601c2
Merge pull request #184 from skalenetwork/new-metaport-architecture-r…
dmytrotkk Sep 25, 2023
3341d62
Update release pipeline, update TS interfaces
dmytrotkk Sep 26, 2023
701a136
Merge pull request #187 from skalenetwork/fix/update-release-pipeline
dmytrotkk Sep 26, 2023
0f3ebd3
Add resizable history module, add sizes helper
dmytrotkk Oct 2, 2023
3186820
Update skale-network, fix sfuel issue, update legacy addresses
dmytrotkk Oct 3, 2023
c8177b0
Use legacy config
dmytrotkk Oct 3, 2023
48f4e0b
Update metadata
dmytrotkk Oct 3, 2023
69a3956
Update ima-js version, update history component
dmytrotkk Oct 5, 2023
fd26126
Update submodules
dmytrotkk Oct 9, 2023
e6aea50
Update metadata, add transformChainName
dmytrotkk Oct 9, 2023
7e2f3fe
Update staging config, fix explorer URL
dmytrotkk Oct 10, 2023
18738c2
Update rainbowkit package
dmytrotkk Oct 10, 2023
698d7a5
Run prettier
dmytrotkk Oct 10, 2023
fd36537
Merge pull request #188 from skalenetwork/update-history-module
dmytrotkk Oct 10, 2023
c6afe0e
Pull changes from develop
dmytrotkk Oct 10, 2023
244bac3
Fix approve wrap step
dmytrotkk Oct 10, 2023
005aaf2
Fix approve wrap method
dmytrotkk Oct 10, 2023
bfb7e43
Add legacy faucets
dmytrotkk Oct 11, 2023
51813bc
Merge pull request #197 from skalenetwork/add-faucets
dmytrotkk Oct 11, 2023
2377df3
Add legacy faucets
dmytrotkk Oct 11, 2023
ba6befc
Minor css fix
dmytrotkk Oct 12, 2023
dd9319e
Add project id for preview
dmytrotkk Oct 12, 2023
759cc20
Merge branch 'hotfix-transfer-bugs' of github.com:skalenetwork/metapo…
dmytrotkk Oct 12, 2023
5f49537
Switch build to bun
dmytrotkk Oct 12, 2023
74bd6cb
Fix vercel build
dmytrotkk Oct 12, 2023
2a9d8c4
Change build to yarn
dmytrotkk Oct 12, 2023
98016b7
Update chains metadata format
dmytrotkk Oct 16, 2023
044bafb
metaport#189 Add checks for sfuel faucet
dmytrotkk Oct 16, 2023
443d357
metaport#190 Update CP logic
dmytrotkk Oct 16, 2023
94a75c7
Add debug component, add rainbowkit tx history
dmytrotkk Oct 18, 2023
8d71640
Update station data after PoW
dmytrotkk Oct 19, 2023
3144bd4
Merge branch 'qa' of github.com:skalenetwork/metaport into hotfix-tra…
dmytrotkk Oct 19, 2023
a4c29d3
Improve error handling
dmytrotkk Oct 20, 2023
eff25be
Fix ts build
dmytrotkk Oct 22, 2023
be3d397
Update build cmd
dmytrotkk Oct 23, 2023
b47649f
Switch back to yarn in install script
dmytrotkk Oct 23, 2023
da194f9
Change ima-js version
dmytrotkk Oct 23, 2023
7a24cfd
Downgrade storybook
dmytrotkk Oct 23, 2023
f0192e2
Update packages
dmytrotkk Oct 23, 2023
1174889
Downgrade pacakges
dmytrotkk Oct 23, 2023
d7e2294
Downgrade pacakges
dmytrotkk Oct 23, 2023
2fe74cf
Downgrade all dependencies
dmytrotkk Oct 23, 2023
9d9837d
Merge pull request #200 from skalenetwork/hotfix-transfer-bugs
dmytrotkk Oct 23, 2023
644fd26
metaport#192 handle small transfer amounts
dmytrotkk Oct 23, 2023
7f7cfbc
metaport#193 Add dynamic font size resizing
dmytrotkk Oct 23, 2023
0ea5d4e
metaport#193 Fix wrapped tokens lookup
dmytrotkk Oct 23, 2023
64b0087
metaport#194 Fix zero tokens input
dmytrotkk Oct 23, 2023
6b02e77
metaport#193 lock amount during the transfer, update error handling
dmytrotkk Oct 24, 2023
7f34a12
Merge pull request #205 from skalenetwork/hotfix-transfers
dmytrotkk Oct 24, 2023
12ec1de
metaport#190 metaport#193 Fix small amounts, hide wrapped tokens
dmytrotkk Oct 24, 2023
479e9e7
metaport#199 Fix token change error, update debug component, fix bloc…
dmytrotkk Oct 26, 2023
d379687
Merge pull request #208 from skalenetwork/transfer-bugs-hotfix
dmytrotkk Oct 26, 2023
81e52f2
Restructure display conditions
dmytrotkk Oct 26, 2023
371ae10
metaport#199 Export display functions
dmytrotkk Oct 26, 2023
bbd6da8
Merge pull request #211 from skalenetwork/transfer-bugs-hotfix
dmytrotkk Oct 26, 2023
03ab3eb
metaport#201 Improve network switching
dmytrotkk Oct 26, 2023
783271b
Minor UI changes
dmytrotkk Oct 30, 2023
9d54534
Fix CODEOWNERS
dmytrotkk Oct 30, 2023
0d36f6d
Merge pull request #212 from skalenetwork/transfer-bugs-hotfix
dmytrotkk Oct 30, 2023
0aa33d8
Update apps metadata
dmytrotkk Oct 31, 2023
4382f31
Merge pull request #213 from skalenetwork/update-meta
dmytrotkk Oct 31, 2023
9a97915
Fix eth token balance & eth as a default token
dmytrotkk Oct 31, 2023
4968d6c
Merge pull request #216 from skalenetwork/fix-eth-token-balance
dmytrotkk Oct 31, 2023
d361a2f
Update chains display conditions, add sorting to tokens, update inter…
dmytrotkk Nov 1, 2023
ccb71e7
Add CP data in debug
dmytrotkk Nov 1, 2023
571ccd8
Merge pull request #217 from skalenetwork/fix-eth-token-balance
dmytrotkk Nov 1, 2023
48cc518
metaport#214 Fix token balances update
dmytrotkk Nov 1, 2023
9918460
Merge pull request #218 from skalenetwork/fix-balances-update
dmytrotkk Nov 1, 2023
4285d47
Update ensure network
dmytrotkk Nov 6, 2023
069e4a5
Merge pull request #220 from skalenetwork/transfer-fixes
dmytrotkk Nov 6, 2023
8e08923
metaport#206 Fix tokens unwrap
dmytrotkk Nov 6, 2023
082770e
metaport#210 Disable broken wallets
dmytrotkk Nov 6, 2023
63acc82
Merge pull request #221 from skalenetwork/unwrap-fix
dmytrotkk Nov 6, 2023
2eab246
Merge pull request #207 from skalenetwork/develop
dmytrotkk Nov 6, 2023
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
16 changes: 0 additions & 16 deletions .babelrc.json

This file was deleted.

25 changes: 25 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module.exports = {
env: {
browser: true,
es2021: true,
},
extends: [
'plugin:react/recommended',
'standard-with-typescript',
'prettier',
'plugin:storybook/recommended'
],
overrides: [],
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
plugins: ['react'],
rules: {
'react/jsx-key': 'off',
'react/react-in-jsx-scope': 'off',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'warn',
'no-console': 'warn',
},
}
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
* @dmitry-tk
* @dmytrotkk
*.md @skalenetwork/docowners
/docs/ @skalenetwork/docowners
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions/setup-node@v1
- uses: actions/setup-node@v3
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
Expand Down Expand Up @@ -46,7 +46,7 @@ jobs:
echo "PRERELEASE=$PRERELEASE" >> $GITHUB_ENV
- name: Yarn build
run: |
yarn run build
yarn build:lib
- name: Publish on npm
run: |
if [[ "$BRANCH" == "stable" ]]; then
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ jobs:
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: Update submodules
run: |
git submodule update --remote
- name: Prepare metadata
run: |
bash prepare_meta.sh
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ test.mjs


src/meta/
src/icons/index.ts

metaportConfig.json
metaportConfigMainnet.json

storybook-static/
.vercel
1 change: 1 addition & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
[submodule "skale-network"]
path = skale-network
url = https://github.com/skalenetwork/skale-network.git
branch = add-additional-metadata
8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"semi": false,
"trailingComma": "none",
"singleQuote": true,
"printWidth": 100,
"endOfLine": "auto",
"bracketSpacing": true
}
96 changes: 15 additions & 81 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,88 +1,22 @@
const path = require("path");
const NodePolyfillPlugin = require("node-polyfill-webpack-plugin");
import type { StorybookConfig } from "@storybook/react-webpack5";
import type { StorybookConfig } from '@storybook/react-vite'
const config: StorybookConfig = {
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
core: {},
addons: ["@storybook/addon-links", "@storybook/addon-essentials", "@storybook/preset-create-react-app", "@storybook/addon-interactions"],
stories: ['../src/**/*.stories.@(js|jsx|ts|tsx)'],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-interactions',
'@storybook/addon-styling',
],
framework: {
name: "@storybook/react-webpack5",
name: '@storybook/react-vite',
options: {
builder: {
lazyCompilation: true
}
}
viteConfigPath: '.storybook/vite.config.ts',
},
},
},
docs: {
autodocs: "tag"
autodocs: 'tag',
},
staticDirs: ["../build"],
webpackFinal: async config => {
if (config.resolve && config.resolve.alias) {
const {
global,
...alias
} = config.resolve.alias;
// config.resolve.alias['global'] = undefined;
// const { ...alias } = config.resolve.alias
config.resolve.alias = alias;
}
if (config.module && config.module.rules) {
config.module.rules.push({
test: /\.scss$/,
use: ["style-loader", {
loader: 'css-loader',
options: {
modules: true,
sourceMap: true,
importLoaders: 2,
esModule: false
}
}, "sass-loader"],
include: path.resolve(__dirname, "../")
});
config.module.rules.push({
test: /\.(ts|tsx)$/,
loader: require.resolve("babel-loader"),
options: {
presets: [["react-app", {
flow: false,
typescript: true,
runtime: 'automatic'
}]]
}
});
config.module.rules.push({
test: /\.svg$/,
use: [{
loader: 'svg-url-loader',
options: {
limit: 10000
}
}]
});
}
if (config.plugins) {
config.plugins.push(new NodePolyfillPlugin());
}
if (config.resolve && config.resolve.extensions) {
config.resolve.extensions.push(".ts", ".tsx");
}
if (config.resolve && config.resolve.fallback) {
config.resolve.fallback = {
path: require.resolve('path-browserify'),
os: "os-browserify/browser",
"fs": false,
"https": require.resolve("https-browserify"),
"http": require.resolve("stream-http"),
"crypto": require.resolve("crypto-browserify"),
"stream": require.resolve("stream-browserify"),
"buffer": require.resolve("buffer")
//...config.resolve.fallback,
};
}

return config;
}
};
export default config;
}
export default config
7 changes: 0 additions & 7 deletions .storybook/manager.js

This file was deleted.

18 changes: 14 additions & 4 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
import type { Preview } from "@storybook/react";
import type { Preview } from '@storybook/react'

const preview: Preview = {
parameters: {
actions: { argTypesRegex: "^on[A-Z].*" },
grid: true,
backgrounds: {
default: 'dark',
values: [
{
name: 'dark',
value: '#222425',
}
]
},
actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
},
};
}

export default preview;
export default preview
16 changes: 16 additions & 0 deletions .storybook/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import react from '@vitejs/plugin-react'
import { defineConfig } from 'vitest/config'
import { UserConfigExport } from 'vite'

const app = async (): Promise<UserConfigExport> => {
return defineConfig({
plugins: [react()],
css: {
postcss: {
plugins: [],
},
},
})
}
// https://vitejs.dev/config/
export default app
26 changes: 8 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ See https://docs.skale.network/metaport/1.1.x/

## Development

### Storybook preview

```
bash prepare_meta.sh && bun install && bun build:lib
bun dev
```

### Debug mode

To enable debug mode, set `debug` environment variable to `true`:
Expand All @@ -29,30 +36,13 @@ const metaport = new Metaport({

Additionally, you can enable debug logs in developer console by enabling `Verbose` level of logs.

### Storybook setup

```
yarn install
npx sb init --builder webpack5
yarn run storybook
```

### Linter

Used linter: https://palantir.github.io/tslint/

Install the global CLI and its peer dependency:

```shell
yarn global add tslint typescript
```

#### Linter git hook

Be sure to add pre-commit git hook:

```shell
echo 'yarn lint' > .git/hooks/pre-commit
echo 'bun lint' > .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
```

Expand Down
Binary file added bun.lockb
Binary file not shown.
44 changes: 44 additions & 0 deletions generate-imports.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
const fs = require('fs');
const path = require('path');

const rootDir = process.argv[2];

if (!rootDir) {
console.error('Please provide a root directory as an argument.');
process.exit(1);
}

const getSvgFilesInDir = (dir) => {
return fs.readdirSync(dir).filter(file => path.extname(file) === '.svg').map(file => path.join(dir, file));
};

const generateNamespaceExportsForDir = (dir) => {
const svgFiles = getSvgFilesInDir(dir);

if (svgFiles.length === 0) return; // Skip folders without SVGs

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

const outputPath = path.join(dir, 'index.ts');
fs.writeFileSync(outputPath, namespaceExports, 'utf-8');
};

const walkDirectories = (dir) => {
const items = fs.readdirSync(dir);

for (const item of items) {
const itemPath = path.join(dir, item);
const stat = fs.statSync(itemPath);

if (stat && stat.isDirectory()) {
generateNamespaceExportsForDir(itemPath);
walkDirectories(itemPath);
}
}
};

generateNamespaceExportsForDir(rootDir); // Generate for rootDir itself
walkDirectories(rootDir); // Then walk its subdirectories
2 changes: 1 addition & 1 deletion helper-scripts
Loading
Loading