Skip to content

Commit

Permalink
feat: allnetwork method (#344)
Browse files Browse the repository at this point in the history
* feat: support all network

* feat: print EmmcFileWrite error

* chore: release version 1.0.10-alpha.2
  • Loading branch information
ByteZhang1024 authored Aug 26, 2024
1 parent 3cad9ec commit 9753199
Show file tree
Hide file tree
Showing 24 changed files with 805 additions and 43 deletions.
2 changes: 1 addition & 1 deletion packages/connect-examples/electron-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "hardware-example",
"productName": "HardwareExample",
"executableName": "onekey-hardware-example",
"version": "1.0.10-alpha.1",
"version": "1.0.10-alpha.2",
"author": "OneKey",
"description": "End-to-end encrypted workspaces for teams",
"main": "dist/index.js",
Expand Down
10 changes: 5 additions & 5 deletions packages/connect-examples/expo-example/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "expo-example",
"version": "1.0.10-alpha.1",
"version": "1.0.10-alpha.2",
"scripts": {
"start": "yarn expo start --dev-client",
"android": "yarn expo run:android",
Expand All @@ -15,10 +15,10 @@
"@noble/ed25519": "^2.1.0",
"@noble/hashes": "^1.3.3",
"@noble/secp256k1": "^1.7.1",
"@onekeyfe/hd-ble-sdk": "^1.0.10-alpha.1",
"@onekeyfe/hd-common-connect-sdk": "^1.0.10-alpha.1",
"@onekeyfe/hd-core": "^1.0.10-alpha.1",
"@onekeyfe/hd-web-sdk": "^1.0.10-alpha.1",
"@onekeyfe/hd-ble-sdk": "^1.0.10-alpha.2",
"@onekeyfe/hd-common-connect-sdk": "^1.0.10-alpha.2",
"@onekeyfe/hd-core": "^1.0.10-alpha.2",
"@onekeyfe/hd-web-sdk": "^1.0.10-alpha.2",
"@onekeyfe/react-native-ble-plx": "3.0.0",
"@react-native-async-storage/async-storage": "1.21.0",
"@react-native-picker/picker": "2.6.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export const CONNECT_SRC = 'https://jssdk.onekey.so/1.0.10-alpha.1/';
export const CONNECT_SRC = 'https://jssdk.onekey.so/1.0.10-alpha.2/';
// export const CONNECT_SRC = 'https://localhost:8087/';
294 changes: 294 additions & 0 deletions packages/connect-examples/expo-example/src/data/allnetwork.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,294 @@
import { type PlaygroundProps } from '../components/Playground';

const api: PlaygroundProps[] = [
{
method: 'allNetworkGetAddress',
description: 'Get address',
presupposes: [
{
title: 'Batch Get Address',
value: {
bundle: [
{
network: 'btc',
path: "m/44'/0'/0'/0/0",
showOnOneKey: false,
},
{
network: 'tbtc',
path: "m/44'/1'/0'/0/0",
showOnOneKey: false,
},
{
network: 'ltc',
path: "m/44'/2'/0'/0/0",
showOnOneKey: false,
},
{
network: 'bch',
path: "m/44'/145'/0'/0/0",
showOnOneKey: false,
},
{
network: 'neurai',
path: "m/44'/1900'/0'/0/0",
showOnOneKey: false,
},
{
network: 'doge',
path: "m/44'/3'/0'/0/0",
showOnOneKey: false,
},

{
network: 'btc',
chainName: 'bitcoin',
path: "m/44'/0'/0'/0/0",
showOnOneKey: false,
},
{
network: 'btc',
chainName: 'testnet',
path: "m/44'/1'/0'/0/0",
showOnOneKey: false,
},
{
network: 'btc',
chainName: 'litecoin',
path: "m/44'/2'/0'/0/0",
showOnOneKey: false,
},
{
network: 'btc',
chainName: 'bcash',
path: "m/44'/145'/0'/0/0",
showOnOneKey: false,
},
{
network: 'btc',
chainName: 'neurai',
path: "m/44'/1900'/0'/0/0",
showOnOneKey: false,
},
{
network: 'btc',
chainName: 'dogecoin',
path: "m/44'/3'/0'/0/0",
showOnOneKey: false,
},

{
network: 'evm',
path: "m/44'/60'/0'/0/0",
showOnOneKey: false,
},
{
network: 'evm',
path: "m/44'/60'/0'/0/0",
chainName: '20',
showOnOneKey: false,
},

{
network: 'algo',
path: "m/44'/283'/0'/0'/0'",
showOnOneKey: false,
},
{
network: 'aptos',
path: "m/44'/637'/0'/0'/0'",
showOnOneKey: false,
},
{
network: 'ada',
path: "m/1852'/1815'/0'",
showOnOneKey: false,
},
{
network: 'cfx',
path: "m/44'/503'/0'/0/0",
chainName: '1029',
showOnOneKey: false,
},
{
network: 'cfx',
path: "m/44'/503'/0'/0/0",
chainName: '1',
showOnOneKey: false,
},
{
network: 'cosmos',
path: "m/44'/118'/0'/0/0",
prefix: 'cosmos',
showOnOneKey: false,
},
{
network: 'cosmos',
path: "m/44'/118'/0'/0/0",
prefix: 'osmosis',
showOnOneKey: false,
},
{
network: 'dynex',
path: "m/44'/29538'/0'/0'/0'",
showOnOneKey: false,
},
{
network: 'fil',
path: "m/44'/461'/0'/0/0",
showOnOneKey: false,
},
{
network: 'kaspa',
path: "m/44'/111111'/0'/0/0",
prefix: 'kaspa',
showOnOneKey: false,
},
{
network: 'near',
path: "m/44'/397'/0'",
showOnOneKey: false,
},
{
network: 'nexa',
path: "m/44'/29223'/0'/0/0",
prefix: 'nexa',
showOnOneKey: false,
},
{
network: 'nervos',
path: "m/44'/309'/0'/0/0",
chainName: 'ckb',
showOnOneKey: false,
},
{
network: 'dot',
path: "m/44'/354'/0'/0'/0'",
prefix: '0',
chainName: 'polkadot',
showOnOneKey: false,
},
{
network: 'xrp',
path: "m/44'/144'/0'/0/0",
showOnOneKey: false,
},
{
network: 'sol',
path: "m/44'/501'/0'/0'",
showOnOneKey: false,
},
{
network: 'stc',
path: "m/44'/101010'/0'/0'/0'",
showOnOneKey: false,
},
{
network: 'sui',
path: "m/44'/784'/0'/0'/0'",
showOnOneKey: false,
},
{
network: 'tron',
path: "m/44'/195'/0'/0/0",
showOnOneKey: false,
},
],
},
},
{
title: 'Batch ADA Get Address',
value: {
bundle: [
{
network: 'ada',
path: "m/1852'/1815'/0'",
showOnOneKey: false,
},
{
network: 'dynex',
path: "m/44'/29538'/0'/0'/0'",
showOnOneKey: false,
},
],
},
},
{
title: 'Batch Bitcoin Get Address',
value: {
bundle: [
{
network: 'btc',
path: "m/44'/0'/0'/0/0",
showOnOneKey: false,
},
{
network: 'tbtc',
path: "m/44'/1'/0'/0/0",
showOnOneKey: false,
},
{
network: 'ltc',
path: "m/44'/2'/0'/0/0",
showOnOneKey: false,
},
{
network: 'bch',
path: "m/44'/145'/0'/0/0",
showOnOneKey: false,
},
{
network: 'neurai',
path: "m/44'/1900'/0'/0/0",
showOnOneKey: false,
},
{
network: 'doge',
path: "m/44'/3'/0'/0/0",
showOnOneKey: false,
},

{
network: 'btc',
chainName: 'bitcoin',
path: "m/44'/0'/0'/0/0",
showOnOneKey: false,
},
{
network: 'btc',
chainName: 'testnet',
path: "m/44'/1'/0'/0/0",
showOnOneKey: false,
},
{
network: 'btc',
chainName: 'litecoin',
path: "m/44'/2'/0'/0/0",
showOnOneKey: false,
},
{
network: 'btc',
chainName: 'bcash',
path: "m/44'/145'/0'/0/0",
showOnOneKey: false,
},
{
network: 'btc',
chainName: 'neurai',
path: "m/44'/1900'/0'/0/0",
showOnOneKey: false,
},
{
network: 'btc',
chainName: 'dogecoin',
path: "m/44'/3'/0'/0/0",
showOnOneKey: false,
},
],
},
},
],
},
];

export default api;
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ const playgroundConfig = [
title: 'Device API',
data: require('../data/device').default,
},
{
title: 'AllNetwork API',
data: require('../data/allnetwork').default,
},
{
title: 'Bitcoin API',
data: require('../data/bitcoin').default,
Expand Down
6 changes: 3 additions & 3 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@onekeyfe/hd-core",
"version": "1.0.10-alpha.1",
"version": "1.0.10-alpha.2",
"description": "> TODO: description",
"author": "OneKey",
"homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",
Expand All @@ -25,8 +25,8 @@
"url": "https://github.com/OneKeyHQ/hardware-js-sdk/issues"
},
"dependencies": {
"@onekeyfe/hd-shared": "^1.0.10-alpha.1",
"@onekeyfe/hd-transport": "^1.0.10-alpha.1",
"@onekeyfe/hd-shared": "^1.0.10-alpha.2",
"@onekeyfe/hd-transport": "^1.0.10-alpha.2",
"axios": "^0.27.2",
"bignumber.js": "^9.0.2",
"bytebuffer": "^5.0.1",
Expand Down
Loading

0 comments on commit 9753199

Please sign in to comment.