Skip to content

Commit

Permalink
Merge pull request #13 from vechainfoundation/refactor-packages
Browse files Browse the repository at this point in the history
Refactor packages
  • Loading branch information
darrenvechain authored Oct 25, 2023
2 parents 159d0de + 5fb4669 commit d390007
Show file tree
Hide file tree
Showing 71 changed files with 2,161 additions and 1,814 deletions.
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"singleQuote": true,
"trailingComma": "none",
"tabWidth": 4
}
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,29 @@ VeWorld WalletKit is a typescript library that facilitates seamless interaction

## Why ?

- Allow easy interaction with all wallets.
- Currently, connex only plays nice with Sync / Sync2
- Enable a better UX for users
- Allow easy interaction with all wallets.
- Currently, connex only plays nice with Sync / Sync2
- Enable a better UX for users

## Key features

Key Features a.k.a scope

1. wallet connectivity

key components that handle interaction with veworld and sync 2
key components that handle interaction with veworld and sync 2

2. customizable UI

ability to totally customize the UI of components
ability to totally customize the UI of components

3. User Experience

Consistent experience with Ethereum and other chains
Consistent experience with Ethereum and other chains

4. Developer friendly

Easy to adopt with proper documentation.
Easy to adopt with proper documentation.

## Setting up the project (Common flow)

Expand Down Expand Up @@ -70,4 +70,4 @@ yarn build

### Future Work

- Create a Modal/ Library in React / Vue / Angular
- Create a Modal/ Library in React / Vue / Angular
12 changes: 6 additions & 6 deletions apps/sample-react-app/hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { HardhatUserConfig } from "hardhat/config";
import "@nomicfoundation/hardhat-toolbox";
import { HardhatUserConfig } from 'hardhat/config';
import '@nomicfoundation/hardhat-toolbox';

const config: HardhatUserConfig = {
solidity: "0.8.19",
typechain: {
outDir: "src/hardhat",
},
solidity: '0.8.19',
typechain: {
outDir: 'src/hardhat'
}
};

export default config;
186 changes: 100 additions & 86 deletions apps/sample-react-app/package.json
Original file line number Diff line number Diff line change
@@ -1,88 +1,102 @@
{
"name": "sample-app-react",
"version": "0.0.0",
"private": true,
"homepage": ".",
"main": "src/index.js",
"scripts": {
"build": "yarn compile && react-app-rewired build",
"clean": "rm -rf build node_modules .turbo cache artifacts src/hardhat",
"compile": "yarn hardhat compile",
"dev": "react-app-rewired start",
"eject": "react-app-rewired eject",
"postinstall": "yarn compile",
"lint": "eslint src --ext .js,.jsx,.ts,.tsx",
"start": "HTTPS=true react-app-rewired start",
"test": "echo 'Not yet testing'"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"dependencies": {
"@chakra-ui/react": "^2.8.1",
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@heroicons/react": "^2.0.18",
"@vechain/connex": "2.1.0",
"@vechain/hardhat-vechain": "^0.1.4",
"@vechain/hardhat-web3": "^0.1.4",
"@vechain/picasso": "^2.1.1",
"@vechain/web3-providers-connex": "^1.1.2",
"buffer": "^6.0.3",
"crypto-browserify": "^3.12.0",
"ethers": "^6.8.0",
"framer-motion": "3.10.6",
"https-browserify": "^1.0.0",
"os-browserify": "^0.3.0",
"process": "^0.11.10",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.4.2",
"react-scripts": "5.0.1",
"react-vendor": "*",
"stream-browserify": "^3.0.0",
"stream-http": "^3.2.0",
"thor-devkit": "^2.0.9",
"wallet-connect": "*",
"web-vitals": "^2.1.2"
},
"devDependencies": {
"@nomicfoundation/hardhat-toolbox": "^3.0.0",
"@testing-library/jest-dom": "^5.16.1",
"@testing-library/react": "^12.1.2",
"@testing-library/user-event": "^13.5.0",
"@types/jest": "^27.0.3",
"@types/node": "^18.17.2",
"@types/react": "^18.2.28",
"@types/react-dom": "^18.2.13",
"@types/testing-library__jest-dom": "^5.14.5",
"copy-webpack-plugin": "^11.0.0",
"customize-cra": "^1.0.0",
"eslint-config-custom": "*",
"filemanager-webpack-plugin": "^8.0.0",
"hardhat": "^2.18.2",
"mini-css-extract-plugin": "^2.7.6",
"react-app-rewired": "^2.2.1",
"ts-import-plugin": "^3.0.0",
"ts-loader": "^9.5.0",
"ts-node": "^10.9.1",
"tsconfig": "*",
"typescript": "4.9.5",
"webpack": "^5.88.2"
}
"name": "sample-app-react",
"version": "0.0.0",
"private": true,
"homepage": ".",
"main": "src/index.js",
"scripts": {
"build": "yarn compile && react-app-rewired build",
"clean": "rm -rf build node_modules .turbo cache artifacts src/hardhat",
"compile": "yarn hardhat compile",
"dev": "react-app-rewired start",
"eject": "react-app-rewired eject",
"postinstall": "yarn compile",
"lint": "eslint src --ext .js,.jsx,.ts,.tsx",
"start": "HTTPS=true react-app-rewired start",
"test": "echo 'Not yet testing'"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"dependencies": {
"@chakra-ui/react": "^2.8.1",
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@heroicons/react": "^2.0.18",
"@vechain/connex": "2.1.0",
"@vechain/hardhat-vechain": "^0.1.4",
"@vechain/hardhat-web3": "^0.1.4",
"@vechain/picasso": "^2.1.1",
"@vechain/react-wallet-kit": "*",
"@vechain/wallet-connect": "*",
"@vechain/wallet-kit": "*",
"@vechain/web3-providers-connex": "^1.1.2",
"buffer": "^6.0.3",
"crypto-browserify": "^3.12.0",
"framer-motion": "3.10.6",
"https-browserify": "^1.0.0",
"os-browserify": "^0.3.0",
"process": "^0.11.10",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.4.2",
"react-scripts": "5.0.1",
"stream-browserify": "^3.0.0",
"stream-http": "^3.2.0",
"thor-devkit": "^2.0.9",
"url": "^0.11.3",
"web-vitals": "^2.1.2"
},
"devDependencies": {
"@nomicfoundation/hardhat-chai-matchers": "^2.0.0",
"@nomicfoundation/hardhat-ethers": "^3.0.0",
"@nomicfoundation/hardhat-network-helpers": "^1.0.0",
"@nomicfoundation/hardhat-toolbox": "^3.0.0",
"@nomicfoundation/hardhat-verify": "^1.0.0",
"@testing-library/jest-dom": "^5.16.1",
"@testing-library/react": "^12.1.2",
"@testing-library/user-event": "^13.5.0",
"@typechain/ethers-v6": "^0.4.0",
"@typechain/hardhat": "^8.0.0",
"@types/chai": "^4.2.0",
"@types/jest": "^27.0.3",
"@types/mocha": ">=9.1.0",
"@types/node": "^18.17.2",
"@types/react": "^18.2.28",
"@types/react-dom": "^18.2.13",
"@types/testing-library__jest-dom": "^5.14.5",
"chai": "^4.2.0",
"copy-webpack-plugin": "^11.0.0",
"customize-cra": "^1.0.0",
"eslint-config-custom": "*",
"ethers": "^6.4.0",
"filemanager-webpack-plugin": "^8.0.0",
"hardhat": "^2.18.2",
"hardhat-gas-reporter": "^1.0.8",
"mini-css-extract-plugin": "^2.7.6",
"react-app-rewired": "^2.2.1",
"solidity-coverage": "^0.8.1",
"ts-import-plugin": "^3.0.0",
"ts-loader": "^9.5.0",
"ts-node": "^10.9.1",
"tsconfig": "*",
"typechain": "^8.2.0",
"typescript": "4.9.5",
"webpack": "^5.88.2"
}
}
84 changes: 42 additions & 42 deletions apps/sample-react-app/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,50 +1,50 @@
import type { JSX } from "react";
import React from "react";
import type { Options } from "@vechain/connex";
import type { WalletConnectOptions } from "wallet-connect";
import { ConnexProvider } from "react-vendor";
import { BrowserRouter, Route, Routes } from "react-router-dom";
import { ChakraProvider } from "@chakra-ui/react";
import { NavBar, StyledContainer } from "./Components/layout";
import { Homepage } from "./Screens/Homepage";
import { Fonts, theme } from "./Styles";
import type { JSX } from 'react';
import React from 'react';
import type { Options } from '@vechain/connex';
import type { WalletConnectOptions } from '@vechain/wallet-connect';
import { ConnexProvider } from '@vechain/react-wallet-kit';
import { BrowserRouter, Route, Routes } from 'react-router-dom';
import { ChakraProvider } from '@chakra-ui/react';
import { NavBar, StyledContainer } from './Components/layout';
import { Homepage } from './Screens/Homepage';
import { Fonts, theme } from './Styles';

const nodeOptions: Omit<Options, "signer"> = {
node: "https://testnet.vechain.org/",
network: "test",
const nodeOptions: Omit<Options, 'signer'> = {
node: 'https://testnet.vechain.org/',
network: 'test'
};

const walletConnectOptions: WalletConnectOptions = {
projectId: "8dfc5cac972ee656e6edeb8309ab30ec",
metadata: {
name: "Sample VeChain dApp",
description: "A sample VeChain dApp",
url: window.location.origin,
icons: [`${window.location.origin}/images/logo/my-dapp.png`],
},
projectId: '8dfc5cac972ee656e6edeb8309ab30ec',
metadata: {
name: 'Sample VeChain dApp',
description: 'A sample VeChain dApp',
url: window.location.origin,
icons: [`${window.location.origin}/images/logo/my-dapp.png`]
}
};

export const App = (): JSX.Element => {
return (
<>
<Fonts />
<ChakraProvider theme={theme}>
<ConnexProvider
key="connex"
nodeOptions={nodeOptions}
persistState
walletConnectOptions={walletConnectOptions}
>
<NavBar />
<StyledContainer>
<BrowserRouter>
<Routes>
<Route element={<Homepage />} path="/" />
</Routes>
</BrowserRouter>
</StyledContainer>
</ConnexProvider>
</ChakraProvider>
</>
);
return (
<>
<Fonts />
<ChakraProvider theme={theme}>
<ConnexProvider
key="connex"
nodeOptions={nodeOptions}
persistState
walletConnectOptions={walletConnectOptions}
>
<NavBar />
<StyledContainer>
<BrowserRouter>
<Routes>
<Route element={<Homepage />} path="/" />
</Routes>
</BrowserRouter>
</StyledContainer>
</ConnexProvider>
</ChakraProvider>
</>
);
};
Loading

0 comments on commit d390007

Please sign in to comment.