Skip to content

Commit

Permalink
Feat/allNetWork (#371)
Browse files Browse the repository at this point in the history
* feat:  add allNetwork three chain

* feat: lint while pre-commit

* fix: lint & use yarn

* fix: use fixed version & use coderabbital's suggesstion

* fix: revert yarn.lock in connect-examples

* fix: revert yarn.lock
  • Loading branch information
wabicai authored Oct 8, 2024
1 parent 90781b7 commit 906f360
Show file tree
Hide file tree
Showing 9 changed files with 11,263 additions and 3,522 deletions.
6 changes: 6 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

# Run lint:fix
yarn lint:staged

# Add files modified by lint:fix
git diff --name-only -z | xargs git add
8 changes: 8 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"clean": "lerna clean --yes",
"clean-workspace": "yarn clean && lerna run clean",
"lint": "eslint .",
"lint:staged": "lint-staged",
"test": "lerna run test",
"setup": "yarn && yarn bootstrap && yarn build",
"publish-packages": "lerna publish from-package",
Expand Down Expand Up @@ -63,8 +64,10 @@
"eslint": "^8.4.1",
"eslint-config-wesbos": "3.2.3",
"eslint-plugin-jest": "^26.6.0",
"husky": "9.1.6",
"jest": "^28.1.0",
"lerna": "^4.0.0",
"lint-staged": "15.2.10",
"prettier": "^2.7.1",
"prettier-eslint": "^14.0.2",
"rimraf": "^3.0.2",
Expand All @@ -74,5 +77,10 @@
"tsconfig-paths": "^4.0.0",
"typescript": "5.1.6"
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": [
"eslint --fix"
]
},
"version": "0.0.0"
}
2 changes: 1 addition & 1 deletion packages/connect-examples/expo-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "expo-example",
"version": "1.0.12-alpha.0",
"scripts": {
"start": "yarn expo start --dev-client",
"start": "CONNECT_SRC=https://localhost:8087/ yarn expo start --dev-client",
"android": "yarn expo run:android",
"ios": "yarn expo run:ios",
"web": "yarn expo start --web",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export const CONNECT_SRC = 'https://jssdk.onekey.so/1.0.12-alpha.0';
// export const CONNECT_SRC = 'https://localhost:8087/';
import { version } from '../../package.json';

export const CONNECT_SRC = process.env.CONNECT_SRC || `https://jssdk.onekey.so/${version}`;
17 changes: 17 additions & 0 deletions packages/connect-examples/expo-example/src/data/allnetwork.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,23 @@ const api: PlaygroundProps[] = [
path: "m/44'/195'/0'/0/0",
showOnOneKey: false,
},
{
network: 'scdo',
path: "m/44'/541'/0'/0/0",
showOnOneKey: false,
},
{
network: 'ton',
path: "m/44'/607'/0'",
showOnOneKey: false,
// https://github.com/trustwallet/wallet-core/issues/3387
// ton chain has a different derivation path
},
{
network: 'alephium',
path: "m/44'/1234'/0'/0/0",
showOnOneKey: false,
},
],
},
},
Expand Down
14,458 changes: 10,945 additions & 3,513 deletions packages/connect-examples/expo-example/yarn.lock

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions packages/core/src/api/allnetwork/AllNetworkGetAddress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,15 @@ const networkConfigMap: NetworkConfigMap = {
};
},
},
scdo: {
methodName: 'scdoGetAddress',
},
ton: {
methodName: 'tonGetAddress',
},
alph: {
methodName: 'alephiumGetAddress',
},
};

export default class AllNetworkGetAddress extends BaseMethod<
Expand Down
5 changes: 4 additions & 1 deletion packages/core/src/types/api/allNetworkGetAddress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ export type INetwork =
| 'kaspa'
| 'nexa'
| 'dynex'
| 'nervos';
| 'nervos'
| 'scdo'
| 'ton'
| 'alph';

type CommonResponseParams = {
path: string;
Expand Down
Loading

0 comments on commit 906f360

Please sign in to comment.