Giter Club home page Giter Club logo

onekeyhq / app-monorepo Goto Github PK

View Code? Open in Web Editor NEW
1.8K 119.0 325.0 260.38 MB

Secure, open source and community driven crypto wallet runs on all platforms and trusted by millions.

Home Page: https://onekey.so

Shell 0.06% JavaScript 6.96% TypeScript 91.95% Java 0.35% C 0.01% Objective-C 0.07% Objective-C++ 0.04% Swift 0.01% Ruby 0.06% HTML 0.06% CSS 0.05% EJS 0.39%
blockchain electron expo react react-native redux wallet android ios mobile universal web native defi crypto bitcoin ethereum near solana

app-monorepo's Introduction

OneKey - Open Source Crypto Wallet

Github Stars Version Last commit Issues Pull Requests Discord Twitter Follow

Appstore Playstore

Community & Enterprise Edition

  • 🏡 🧔🏻‍♂️ For Community Edition. It will always remain FREE FOREVER for open-source projects by individuals and communities.
  • 🏦 💼 For Enterprise Edition. We've got this plan on the radar, but we're not quite ready yet. Just star our repo, and you'll be pinged as soon as we're all set.

Support

  • Community Forum. Best for: help with building, discussion about best practices.
  • GitHub Issues. Best for: bugs and errors you encounter using OneKey.
  • Discord. Best for: sharing your ideas and hanging out with the community.

Repo Status

  • ✅ Public: Production-ready

We really need your support, star or watch this repo for latest updates.

Star this repo

🚀 Getting Onboard

  1. Install node.js LTS version
  2. Install yarn package management tool
  3. Install git lfs (some binaries are required for pulling and updating)
  4. To start the iOS project, make sure that the local XCode version is greater than or equal to 13.3
  5. To start the Android project, make sure that the local JDK version is greater than or equal to 11

After pulling the latest code via the git command line tool, install the project dependencies in the root directory via the yarn command

yarn

🧑‍💻 Develop

Execute the following commands in the root directory to develop different business code

  • yarn app:web: Develop web mode, which starts a static server on port 3000 locally
  • yarn app:ios: connect to iphone device via USB for development debugging
  • yarn app:android: develop android
  • yarn app:desktop: development in desktop mode
  • yarn app:web: development in extension mode

💬 Docs in your languages

Available Languages
Simplified Chinese / 简体中文
German / Deutsch
Japanese / 日本語
French / Français
Italian / Italiano

🪄 Repo Activity

Repo Activity

🔰 Security

  • Please read Bug Bunty Rules, we have detailed the exact plan in this article.
  • Please report suspected security vulnerabilities in private to [email protected]
  • Please do NOT create publicly viewable issues for suspected security vulnerabilities.
  • As an open source project, although we are not yet profitable, we try to give some rewards to white hat hackers who disclose vulnerabilities to us in a timely manner.

🙋‍♂️We're Hiring!

We are hiring many roles (Remote) 👉 Click here to check all open positions
  • Remote (Live anywhere)
  • Global Pay (Literally)
  • ESOP (For everybody)
  • Open Source (As you see)
  • Awesome Colleagues (Hell Yeah!)
  • 远程 (生活在哪个城市都可以)
  • 全球一致的薪酬 (真的)
  • 全员持股计划 (每个人都有)
  • 开源 (如你所见)
  • 超级棒的同事 (爽呆!)
  • ✨ Salute!

    ⚖️ License

    OneKey is available under the Apache-2.0 license license. Free for commercial and non-commercial use.

    app-monorepo's People

    Contributors

    bytezhang1024 avatar dependabot[bot] avatar ezailwang avatar franco-chan avatar hellohublot avatar huhuanming avatar kwoktung avatar loatheb avatar originalix avatar rayston92 avatar sidmorizon avatar weatherstar avatar web3rd2 avatar xiaoshude avatar

    Stargazers

     avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

    Watchers

     avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

    app-monorepo's Issues

    [BUG]: APK in github releases is not universal (only for arm64-v8a arch)

    Describe the bug

    The apk downloaded from github releases such as in : https://github.com/OneKeyHQ/app-monorepo/releases
    the file https://github.com/OneKeyHQ/app-monorepo/releases/download/v4.3.0/OneKey-Wallet-4.3.0-android.apk

    will have only ./lib/arm64-v8a directory in it, therefore it wont be installed on devices of different arch (such as x86/x86_64/armeabi/armeabi-v7a/mips/mips64)

    related is errors in https://twitter.com/BitcoinWalletz/status/1648259324228288513/photo/2

    Fix:

    publish universal apk in github release or website downloads so the apk will be installed on all supported devices.

    for details about universal apk:
    universal apk generation https://developer.android.com/build/configure-apk-splits#configure-abi-split
    universal apk generation from app bundle: --mode=universal https://developer.android.com/tools/bundletool#generate_apks

    [BUG]:

    Describe the bug
    I built both the debug and release apk files using ./gradlew assembleRelease command. But anytime i launch the app it crashes on launch, How can you help? @sunnylqm @loatheb

    iOS 连接 OneKey 之后不能获取账户

    Prerequisites

    Please answer the following questions for yourself before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.

    • I checked to make sure that this issue has not already been filed
    • I've asked for help in the OneKey Discord before filing this issue.

    Summary

    iOS 连接 OneKey 之后不能获取账户

    Steps to Reproduce (for bugs)

    iOS 连接到 OneKey 之后,使用 BTC 恢复账户,进入恢复账户页面之后报错 Excepted Point, got a 后面的信息看不到了,然后回到恢复账户的页面。

    直接 USB 连接到 Windows 上之后可以获取到账户。

    iOS 的 APP 是用**账号下载的,开发者是 ONEKEY LIMITED,版本是 1.2.0-20220530063

    OneKey 的固件版本是和蓝牙固件版本都已经更新了,固件版本 2.2.0,蓝牙版本 1.2.1

    Expected Behavior

    正确恢复账户

    Current Behaviour

    如上所述

    Possible Solution

    Context

    Environment

    • Operating System: iOS 15.2.1
    • App Version: 1.2.0-20220530063 OneKey 固件版本 2.2.0 蓝牙版本 1.2.1

    [BUG]: android build on expo failed

    I try building android using this command after changing these 2 files

    expo command build

    eas build --platform android

    files I changed inorder for the build to work

    1- packages/app/app.json >> I remove (extra.eas.projectId) to generate new one
    2- packages/app/scripts/eas-build-pre-install.sh >> I specify expo-cli version instead of lates (npm i -g [email protected])

    I get this error in expo build, however building with react-native works.

    
    C/C++: ninja: Entering directory `/home/expo/workingdir/build/packages/app/android/lib-keys-secret/.cxx/RelWithDebInfo/133g4p6s/arm64-v8a'
    C/C++: /home/expo/workingdir/build/packages/app/android/lib-keys-secret/src/main/cpp/keys.c:18:57: error: use of undeclared identifier 'authorizedAppSha1'
    C/C++: /home/expo/workingdir/build/packages/app/android/lib-keys-secret/src/main/cpp/keys.c:19:16: warning: implicit declaration of function 'getDecryptedKey' is invalid in C99 [-Wimplicit-function-declaration]
    C/C++: /home/expo/workingdir/build/packages/app/android/lib-keys-secret/src/main/cpp/keys.c:19:63: error: use of undeclared identifier 'liteInitGPCParams'
    C/C++: /home/expo/workingdir/build/packages/app/android/lib-keys-secret/src/main/cpp/keys.c:19:37: error: use of undeclared identifier 'liteInitGPCParams'
    > Task :lib-keys-secret:buildCMakeRelWithDebInfo[arm64-v8a] FAILED
    > Task :react-native-v8:copyReleaseJniLibsProjectOnly
    > Task :app:bundleReleaseJsAndAssets
    warning: the transform cache was reset.
    > Task :react-native-v8:stripReleaseDebugSymbols
    > Task :app:bundleReleaseJsAndAssets FAILED
    Error: The resource `/home/expo/workingdir/build/packages/app/index.js` was not found.
        at /home/expo/workingdir/build/node_modules/metro/src/IncrementalBundler.js:297:24
        at gotStat (node:fs:2684:21)
        at FSReqCallback.oncomplete (node:fs:202:21)
    info Run CLI with --verbose flag for more details.
    Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
    You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
    See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings
    1456 actionable tasks: 1456 executed
    [stderr] error The resource `/home/expo/workingdir/build/packages/app/index.js` was not found.
    [stderr] FAILURE: Build completed with 3 failures.
    [stderr] 1: Task failed with an exception.
    [stderr] -----------
    [stderr] * What went wrong:
    [stderr] Execution failed for task ':lib-keys-secret:buildCMakeRelWithDebInfo[arm64-v8a]'.
    [stderr] > com.android.ide.common.process.ProcessException: ninja: Entering directory `/home/expo/workingdir/build/packages/app/android/lib-keys-secret/.cxx/RelWithDebInfo/133g4p6s/arm64-v8a'
    [stderr]   [1/3] Building C object CMakeFiles/keys.dir/keys.c.o
    [stderr]   FAILED: CMakeFiles/keys.dir/keys.c.o 
    [stderr]   /home/expo/Android/Sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/linux-x86_64/bin/clang --target=aarch64-none-linux-android23 --gcc-toolchain=/home/expo/Android/Sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/linux-x86_64 --sysroot=/home/expo/Android/Sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/linux-x86_64/sysroot -Dkeys_EXPORTS  -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security  -O2 -g -DNDEBUG -fPIC -fvisibility=hidden -MD -MT CMakeFiles/keys.dir/keys.c.o -MF CMakeFiles/keys.dir/keys.c.o.d -o CMakeFiles/keys.dir/keys.c.o -c /home/expo/workingdir/build/packages/app/android/lib-keys-secret/src/main/cpp/keys.c
    [stderr]   /home/expo/workingdir/build/packages/app/android/lib-keys-secret/src/main/cpp/keys.c:18:57: error: use of undeclared identifier 'authorizedAppSha1'
    [stderr]       if (checkSecurityPermission(env, context, (char **) authorizedAppSha1, 3)) {
    [stderr]                                                           ^
    [stderr]   /home/expo/workingdir/build/packages/app/android/lib-keys-secret/src/main/cpp/keys.c:19:16: warning: implicit declaration of function 'getDecryptedKey' is invalid in C99 [-Wimplicit-function-declaration]
    [stderr]           return getDecryptedKey(env, liteInitGPCParams, sizeof(liteInitGPCParams));
    [stderr]                  ^
    [stderr]   /home/expo/workingdir/build/packages/app/android/lib-keys-secret/src/main/cpp/keys.c:19:63: error: use of undeclared identifier 'liteInitGPCParams'
    [stderr]           return getDecryptedKey(env, liteInitGPCParams, sizeof(liteInitGPCParams));
    [stderr]                                                                 ^
    [stderr]   /home/expo/workingdir/build/packages/app/android/lib-keys-secret/src/main/cpp/keys.c:19:37: error: use of undeclared identifier 'liteInitGPCParams'
    [stderr]           return getDecryptedKey(env, liteInitGPCParams, sizeof(liteInitGPCParams));
    [stderr]                                       ^
    [stderr]   1 warning and 3 errors generated.
    [stderr]   [2/3] Building C object CMakeFiles/keys.dir/validation.c.o
    [stderr]   ninja: build stopped: subcommand failed.
    [stderr]   
    [stderr]   C++ build system [build] failed while executing:
    [stderr]       /home/expo/Android/Sdk/cmake/3.18.1/bin/ninja \
    [stderr]         -C \
    [stderr]         /home/expo/workingdir/build/packages/app/android/lib-keys-secret/.cxx/RelWithDebInfo/133g4p6s/arm64-v8a \
    [stderr]         keys
    [stderr]     from /home/expo/workingdir/build/packages/app/android/lib-keys-secret
    [stderr] * Try:
    [stderr] > Run with --stacktrace option to get the stack trace.
    [stderr] > Run with --info or --debug option to get more log output.
    [stderr] > Run with --scan to get full insights.
    [stderr] ==============================================================================
    [stderr] 2: Task failed with an exception.
    [stderr] -----------
    [stderr] * What went wrong:
    [stderr] java.lang.StackOverflowError (no error message)
    [stderr] * Try:
    [stderr] > Run with --stacktrace option to get the stack trace.
    [stderr] > Run with --info or --debug option to get more log output.
    [stderr] > Run with --scan to get full insights.
    [stderr] ==============================================================================
    [stderr] 3: Task failed with an exception.
    [stderr] -----------
    [stderr] * What went wrong:
    [stderr] Execution failed for task ':app:bundleReleaseJsAndAssets'.
    [stderr] > Process 'command 'node'' finished with non-zero exit value 1
    [stderr] * Try:
    [stderr] > Run with --stacktrace option to get the stack trace.
    [stderr] > Run with --info or --debug option to get more log output.
    [stderr] > Run with --scan to get full insights.
    [stderr] ==============================================================================
    [stderr] * Get more help at https://help.gradle.org
    [stderr] BUILD FAILED in 5m 45s
    Error: Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.
    
    

    [Feature] Trying to install expo-dev-client for testing?

    When I try to install expo-dev-client, and run yarn android I get errors.

    To reproduce the problem, run yarn workspace @onekeyhq/app add expo-dev-client

    And then try running for android or ios the build will not work.

    I need expo-dev-client to test the app with better testing environement, specially if you're trying to test ios on non macOS system.

    Is it possible to add this package and make the build work at the same time ?

    ok

    看起来是一个很不错的项目,请问是否有移动开发岗位?

    [Need help] yarn ios fail on Apple M1 macOS

    It's probably M1/arm related base on the error message, tried Google around but no progress.
    Thanks.


    full output of yarn ios:

    yarn run v1.22.17
    $ expo run:ios
    › Planning build
    › Executing react-native-config Pods/react-native-config » [CP-User] Config codegen
    › Executing expo-constants Pods/EXConstants » [CP-User] Generate app.config for prebuilt Constants.manifest
    › Compiling react-native-config Pods/react-native-config » ReactNativeConfig.m
    › Packaging react-native-config Pods/react-native-config » libreact-native-config.a
    › Executing OneKeyWallet » Start Packager on http://localhost:8081
    › Linking   OneKeyWallet » OneKeyWallet
    
    ❌  ld: building for iOS Simulator, but linking in dylib built for iOS, file '/Users/naeemo/Workspace/github/app-monorepo/packages/app/ios/OneKeyWallet/Frameworks/GPChannelSDKCore.framework/GPChannelSDKCore' for architecture arm64
    
    
    
    ❌  clang: error: linker command failed with exit code 1 (use -v to see invocation)
    
    
    
    › 2 error(s), and 0 warning(s)
    
    Failed to build iOS project. "xcodebuild" exited with error code 65.
    error Command failed with exit code 1.
    info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
    
    

    [Feature] On what bases you set verified and security properties ?

    In the below example :-

    {
      "_id": "62e8a3d28edb7c3c91a5584a",
      "name": "Tether",
      "symbol": "USDT",
      "address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
      "decimals": 6,
      "logoURI": "https://common.onekey-asset.com/token/evm-1/0xdAC17F958D2ee523a2206206994597C13D831ec7.jpg",
      "impl": "evm",
      "status": "LISTED",
      "verified": true,
      "security": false,
      "addToIndex": true,
      "chainId": "1",
      "source": [
        "sushi",
        "Uniswap Labs Default",
        "Coingecko"
      ],
      "checked": true,
      "coingeckoId": "tether",
      "swftId": "USDT(ERC20)",
      "createdAt": "2022-08-02T04:10:58.205Z",
      "updatedAt": "2022-11-28T15:13:18.247Z",
      "__v": 0,
      "marketCap": 67600751622.405464
    }
    

    You can see 2 properties which is verified and security. How and on what base, do you set them ?

    I want to clone the project but getting issue while installing

    Prerequisites

    • I checked to make sure that this issue has not already been filed
    • I've asked for help in the OneKey Discord before filing this issue.

    Describe the bug
    I downloaded the code and tried to follow the first step to install yarn dependencies in windows 11.

    It throws the error as attached in the screenshot.

    image

    Log:

    This file contains the result of Yarn building a package (@onekeyhq/app-monorepo@workspace:.)

    Script name: postinstall

    'bash' is not recognized as an internal or external command,
    operable program or batch file.
    command not found: bash

    To Reproduce
    Steps to reproduce the behavior:

    1. run command "yarn"

    [BUG]:error While trying to resolve module `superstruct` from file `appmonorepo/node_modules/@solana/web3.js/lib/index.browser.cjs.js`

    Prerequisites
    Please answer the following questions for yourself before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.

    • I checked to make sure that this issue has not already been filed
    • I've asked for help in the OneKey Discord before filing this issue.

    Describe the bug
    Screen Shot 2022-12-24 at 1 29 32 PM, the package appmonorepo/node_modules/@solana/web3.js/node_modules/superstruct/package.json was successfully found. However, this package itself specifies a main module field that could not be resolved (/Users/user/Downloads/working/app-monorepo/node_modules/@solana/web3.js/node_modules/superstruct/lib/index.cjs. Indeed, none of these files exist:

    monorepo/node_modules/@solana/web3.js/node_modules/superstruct/lib/index.cjs(.native|.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)
    monorepo/node_modules/@solana/web3.js/node_modules/superstruct/lib/index.cjs/index(.native|.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx).

    build release android

    Hi, i managed to build the source locally but i got this error

    image

    Steps to Reproduce

    gradlew aR

    Environment

    • Operating System: Windows 10
    • App Version: 4.0.0

    Please can you help! Thanks in advance

    [BUG]:

    when i run yarn or yarn install i get ther error on the screnshot below. don't know why exactly. followed the installation steps on the docs. thanks
    win

    【Question】:QuoteResponse中data字段内的数据含义是什么?What is the meaning of the data inside the 'data' field in QuoteResponse?

    • 需求:在处理询价请求时,我得到了询价的返回数据,准备对他进行解析,来满足自己的计算需要和展示需要。同时想换成自己的询价服务以提高访问效率,我应该如何返回data中的数据?

    • 代码出处:0x.ts中的 const data = res.data.data as QuoteResponse

    • 在查询1个eth兑换相应的USDT时得到了一大段返回数据,部分截图如下:
      image

    • 我想了解一下QuoteResponse中的'data'中返回的数据代表什么含义。(0x415565b0000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000004518a36b00000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000.........................)

    APP版本:3.16.0

    万分感谢~~~~~~Thanks~~~~~~

    [NEED HELP] TypeError: null is not an object (evaluating 'RNRandomBytes.seed')

    i'm trying to use expo go on my iphone but everytime i get 2 errors:
    1- TypeError: null is not an object (evaluating 'RNRandomBytes.seed')
    2-

    Invariant Violation: "main" has not been registered. This can happen if:
    * Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.
    * A module failed to load due to an error and AppRegistry.registerComponent wasn't called.
    

    someone know why and how to resolve it?

    full output

    iOS Bundling complete 299ms
    iOS Running app on iPhone di jacopo
    
    TypeError: null is not an object (evaluating 'RNRandomBytes.seed')
    at /Users/jacopomosconi/Downloads/app-monorepo-1.0.3 2/node_modules/react-native/Libraries/Core/ExceptionsManager.js:104:6 in reportException
    at /Users/jacopomosconi/Downloads/app-monorepo-1.0.3 2/node_modules/react-native/Libraries/Core/ExceptionsManager.js:172:19 in handleException
    at /Users/jacopomosconi/Downloads/app-monorepo-1.0.3 2/node_modules/react-native/Libraries/Core/setUpErrorHandling.js:24:6 in handleError
    at /Users/jacopomosconi/Downloads/app-monorepo-1.0.3 2/node_modules/@react-native/polyfills/error-guard.js:49:36 in ErrorUtils.reportFatalError
    at /Users/jacopomosconi/Downloads/app-monorepo-1.0.3 2/node_modules/metro-runtime/src/polyfills/require.js:204:6 in guardedLoadModule
    at http://172.20.10.2:8081/__generated__/AppEntry.bundle?platform=ios&dev=true&hot=false&strict=false&minify=false:1102510:3 in global code
    
    Invariant Violation: "main" has not been registered. This can happen if:
    * Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.
    * A module failed to load due to an error and `AppRegistry.registerComponent` wasn't called.
    at /Users/jacopomosconi/Downloads/app-monorepo-1.0.3 2/node_modules/react-native/Libraries/Core/ExceptionsManager.js:104:6 in reportException
    at /Users/jacopomosconi/Downloads/app-monorepo-1.0.3 2/node_modules/react-native/Libraries/Core/ExceptionsManager.js:172:19 in handleException
    at /Users/jacopomosconi/Downloads/app-monorepo-1.0.3 2/node_modules/react-native/Libraries/Core/setUpErrorHandling.js:24:6 in handleError
    at /Users/jacopomosconi/Downloads/app-monorepo-1.0.3 2/node_modules/@react-native/polyfills/error-guard.js:49:36 in ErrorUtils.reportFatalError
    

    [Feature] Add Lightning Network to Bitcoin

    not sure if this has been requested ( couldn't find ) or even if it can be requested here...
    but, the title.
    lightning network allow extremely low-fee transactions for Bitcoin and its very useful for small amount purchases and many website/stores already support Lightning.

    [BUG]: `src/hardware/OnekeyLite/types` could not be found within the package

    Describe the bug
    While resolving module @onekeyhq/app/src/hardware/OnekeyLite/types, the Haste package @onekeyhq/app was found. However the moduleScreen Shot 2022-12-23 at 7 16 19 PM. Indeed, none of these files exist:

    • /Users/user/Downloads/working/app-monorepo/packages/app/src/hardware/OnekeyLite/types(.native|.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)

    [BUG]: Xcode packaging error

    Xcode14.0.1 Packaging error
    The certificate is configured

    The error is as follows: What else do you need to configure when packing?
    error build: Command PhaseScriptExecution failed with a nonzero exit code

    [BUG]: 我该如何配置秘钥??Execution failed for task ':lib-keys-secret:buildCMakeRelWithDebInfo'. [stderr] > Build command failed. [stderr] Error while executing process /home/expo/Android/Sdk/cmake/3.10.2.4988404/bin/ninja with arguments {-C /home/expo/workingdir/build/packages/app/android/lib-keys-secret/.cxx/RelWithDebInfo/483b1t4v/armeabi-v7a keys}

    Prerequisites
    EXPO打包安卓时候,提示和秘钥相关的问题,无法执行
    但是根据文档说,社区开发者需要前往android/script执行对应脚本获取秘钥进行配置。然而不管用:

    image

    image

    这是Expo的报错信息:
    [stderr] FAILURE: Build failed with an exception.
    [stderr] * What went wrong:
    [stderr] Execution failed for task ':lib-keys-secret:buildCMakeRelWithDebInfo'.
    [stderr] > Build command failed.
    [stderr] Error while executing process /home/expo/Android/Sdk/cmake/3.10.2.4988404/bin/ninja with arguments {-C /home/expo/workingdir/build/packages/app/android/lib-keys-secret/.cxx/RelWithDebInfo/483b1t4v/armeabi-v7a keys}
    [stderr] ninja: Entering directory `/home/expo/workingdir/build/packages/app/android/lib-keys-secret/.cxx/RelWithDebInfo/483b1t4v/armeabi-v7a'
    [stderr] [1/3] Building C object CMakeFiles/keys.dir/keys.c.o
    [stderr] FAILED: CMakeFiles/keys.dir/keys.c.o
    [stderr] /home/expo/Android/Sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/linux-x86_64/bin/clang --target=armv7-none-linux-androideabi23 --gcc-toolchain=/home/expo/Android/Sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/linux-x86_64 --sysroot=/home/expo/Android/Sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/linux-x86_64/sysroot -Dkeys_EXPORTS -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -mthumb -Wformat -Werror=format-security -O2 -g -DNDEBUG -fPIC -fvisibility=hidden -MD -MT CMakeFiles/keys.dir/keys.c.o -MF CMakeFiles/keys.dir/keys.c.o.d -o CMakeFiles/keys.dir/keys.c.o -c /home/expo/workingdir/build/packages/app/android/lib-keys-secret/src/main/cpp/keys.c
    [stderr] /home/expo/workingdir/build/packages/app/android/lib-keys-secret/src/main/cpp/keys.c:18:57: error: use of undeclared identifier 'authorizedAppSha1'
    [stderr] if (checkSecurityPermission(env, context, (char **) authorizedAppSha1, 3)) {
    [stderr] ^
    [stderr] /home/expo/workingdir/build/packages/app/android/lib-keys-secret/src/main/cpp/keys.c:19:16: warning: implicit declaration of function 'getDecryptedKey' is invalid in C99 [-Wimplicit-function-declaration]
    [stderr] return getDecryptedKey(env, liteInitGPCParams, sizeof(liteInitGPCParams));
    [stderr] ^
    [stderr] /home/expo/workingdir/build/packages/app/android/lib-keys-secret/src/main/cpp/keys.c:19:63: error: use of undeclared identifier 'liteInitGPCParams'
    [stderr] return getDecryptedKey(env, liteInitGPCParams, sizeof(liteInitGPCParams));
    [stderr] ^
    [stderr] /home/expo/workingdir/build/packages/app/android/lib-keys-secret/src/main/cpp/keys.c:19:37: error: use of undeclared identifier 'liteInitGPCParams'
    [stderr] return getDecryptedKey(env, liteInitGPCParams, sizeof(liteInitGPCParams));
    [stderr] ^
    [stderr] 1 warning and 3 errors generated.
    [stderr] [2/3] Building C object CMakeFiles/keys.dir/validation.c.o
    [stderr] ninja: build stopped: subcommand failed.

    [Feature] What is swftId retrieved from token/list endpiont ?

    The result from this endpoint token/list

    Is the following :-

    {
      "_id": "62e8a3d48edb7c3c91a56327",
      "name": "USD Coin",
      "symbol": "USDC",
      "address": "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d",
      "decimals": 18,
      "logoURI": "https://common.onekey-asset.com/token/evm-56/0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d.jpg",
      "impl": "evm",
      "status": "LISTED",
      "verified": true,
      "security": false,
      "addToIndex": true,
      "chainId": "56",
      "source": [
        "sushi",
        "pancakeswap-extended",
        "Coingecko"
      ],
      "checked": true,
      "coingeckoId": "usd-coin",
      "swftId": "USDC(BSC)",
      "createdAt": "2022-08-02T04:11:00.341Z",
      "updatedAt": "2022-09-16T16:46:52.184Z",
      "__v": 0,
      "marketCap": 52152103479.05381
    }
    

    But some tokens doesn't have the swftId property, why is that?
    And what is swftId ?

    APK is not generateing [BUG]:

    I was trying to generate the APK for testing but not able to generate it. I have a review the guideline but not able to find the steps.

    yarn ios error

    when i run yarn ios i get
    error: unable to attach DB: error: accessing build database "/Users/jacopomosconi/Library/Developer/Xcode/DerivedData/OneKeyWallet-clovgltvlcltewaayddbggaboclu/Build/Intermediates.noindex/XCBuildData/build.db": database is locked Possibly there are two concurrent builds running in the same filesystem location.

    [BUG]:Cannot find module: '@onekeyhq/blockchain-libs/src/provider'. Make sure this package is installed

    An error occurs when yarn is run in the project root directory

    Warning: patch-package detected a patch file version mismatch
    
      Don't worry! This is probably fine. The patch was still applied
      successfully. Here's the deets:
    
      Patch file created for
    
        [email protected]
    
      applied to
    
        [email protected]
      
      At path
      
        node_modules/react-native-screens
    
      This warning is just to give you a heads-up. There is a small chance of
      breakage even though the patch was applied successfully. Make sure the package
      still behaves like you expect (you wrote tests, right?) and then run
    
        patch-package react-native-screens
    
      to update the version in the patch file name and make this warning go away.
    
    
    Warning: patch-package detected a patch file version mismatch
    
      Don't worry! This is probably fine. The patch was still applied
      successfully. Here's the deets:
    
      Patch file created for
    
        [email protected]
    
      applied to
    
        [email protected]
      
      At path
      
        node_modules/react-native-tab-view
    
      This warning is just to give you a heads-up. There is a small chance of
      breakage even though the patch was applied successfully. Make sure the package
      still behaves like you expect (you wrote tests, right?) and then run
    
        patch-package react-native-tab-view
    
      to update the version in the patch file name and make this warning go away.
    
    
    **ERROR** Failed to apply patch for package expo-camera at path
      
        node_modules/expo-camera
    
      This error was caused because expo-camera has changed since you
      made the patch file for it. This introduced conflicts with your patch,
      just like a merge conflict in Git when separate incompatible changes are
      made to the same piece of code.
    
      Maybe this means your patch file is no longer necessary, in which case
      hooray! Just delete it!
    
      Otherwise, you need to generate a new patch file.
    
      To generate a new one, just repeat the steps you made to generate the first
      one.
    
      i.e. manually make the appropriate file changes, then run 
    
        patch-package expo-camera
    
      Info:
        Patch file: patches/expo-camera+12.2.0.patch
        Patch was made for version: 12.2.0
        Installed version: 12.5.0
    
    
    **ERROR** Failed to apply patch for package expo-localization at path
      
        node_modules/expo-localization
    
      This error was caused because expo-localization has changed since you
      made the patch file for it. This introduced conflicts with your patch,
      just like a merge conflict in Git when separate incompatible changes are
      made to the same piece of code.
    
      Maybe this means your patch file is no longer necessary, in which case
      hooray! Just delete it!
    
      Otherwise, you need to generate a new patch file.
    
      To generate a new one, just repeat the steps you made to generate the first
      one.
    
      i.e. manually make the appropriate file changes, then run 
    
        patch-package expo-localization
    
      Info:
        Patch file: patches/expo-localization+13.0.0.patch
        Patch was made for version: 13.0.0
        Installed version: 13.1.0
    
    ---
    patch-package finished with 5 warning(s), 2 error(s).
    yarn run v1.18.0
    $ node development/build-networklist.js
    ✨  Done in 0.57s.
    yarn run v1.18.0
    $ bash development/copy-injected.sh
    + cp ./node_modules/@onekeyfe/cross-inpage-provider-injected/dist/injected/injectedDesktop.js ./packages/desktop/public/static/preload.js
    + cp ./node_modules/@onekeyfe/cross-inpage-provider-injected/dist/injected/injectedExtension.js ./packages/ext/src/entry/injected.js
    + cp ./packages/ext/src/entry/injected.js ./packages/ext/src/entry/injected.text-js
    + cp ./node_modules/@onekeyfe/cross-inpage-provider-injected/dist/injected/injectedNative.js ./packages/kit/src/components/WebView/injectedNative.text-js
    + cp ./packages/shared/src/web/index.html.ejs ./packages/shared/src/web/index.html
    + mkdir -p ./packages/desktop/public/static/js-sdk/
    + rsync ./node_modules/@onekeyfe/hd-web-sdk/build/ ./packages/desktop/public/static/js-sdk/ --checksum --recursive --verbose
    building file list ... done
    iframe.html
    onekey-js-sdk.js
    onekey-js-sdk.js.map
    onekey-js-sdk.min.js
    onekey-js-sdk.min.js.map
    js/iframe.c4b673c0c6040a27dbc2.js
    js/iframe.c4b673c0c6040a27dbc2.js.LICENSE.txt
    js/iframe.c4b673c0c6040a27dbc2.js.map
    
    sent 15518935 bytes  received 196 bytes  31038262.00 bytes/sec
    total size is 15736633  speedup is 1.01
    + '[' '' == true ']'
    + '[' '!' -d packages/web-embed/web-build ']'
    + yarn workspace @onekeyhq/web-embed build
    warning Missing version in workspace at "/Users/jinyu/eth/app-monorepo/packages/blockchain-libs", ignoring.
    $ rm -rf ./web-build && GENERATE_SOURCEMAP=false npx expo build:web && cp ./web-build/index.html ./web-build/404.html && sh ./postbuild.sh
    ┌─────────────────────────────────────────────────────────────────────────┐
    │                                                                         │
    │   There is a new version of expo-cli available (6.3.2).                 │
    │   You are currently using expo-cli 6.0.8                                │
    │   Install expo-cli globally using the package manager of your choice;   │
    │   for example: `npm install -g expo-cli` to get the latest version      │
    │                                                                         │
    └─────────────────────────────────────────────────────────────────────────┘
    ============ webpack.version  4.46.0 webEmbed
    Failed to compile.
    
    /Users/jinyu/eth/app-monorepo/packages/engine/src/proxy.ts
    Cannot find module: '@onekeyhq/blockchain-libs/src/provider'. Make sure this package is installed.
    
    You can install this package by running: yarn add @onekeyhq/blockchain-libs/src/provider.
    error Command failed with exit code 1.
    info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
    error Command failed.
    Exit code: 1
    Command: /usr/local/bin/node
    Arguments: /Users/jinyu/.yarn/releases/yarn-1.18.0.cjs build
    Directory: /Users/jinyu/eth/app-monorepo/packages/web-embed
    Output:
    
    info Visit https://yarnpkg.com/en/docs/cli/workspace for documentation about this command.
    error Command failed with exit code 1.
    info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
    error Command failed with exit code 1.
    info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
    
    

    image

    Private key doesn't give the correct address stored in onekey ?

    I'm trying to get the private of the address and create a WIF, this is what I tried to do ?

    import * as bitcoin from 'bitcoinjs-lib';
    import BIP32Factory from 'bip32';
    import bs58check from 'bs58check';
    import * as ecc from 'tiny-secp256k1';
    import * as bip39 from 'bip39';
    
    const bip32 = BIP32Factory(ecc);
    
    function getAddress(node: any, network?: any): string {
      return bitcoin.payments.p2pkh({ pubkey: node.publicKey, network }).address!;
    }
    
    const mnemonic = 'spare motion marriage tongue receive pole seat leader view unable human air';
    
    const seed = bip39.mnemonicToSeedSync(mnemonic);
    const node = bip32.fromSeed(seed);
    const root = node.derivePath("m/44'/0'/0'");
    const xpub = root.neutered().toBase58();
    
    // console.log('xpub', xpub);
    console.log(root.privateKey.toString('hex'));
    console.log(xpub);
    console.log(root.toWIF());
    // receive addresses
    console.log(getAddress(node.derivePath("m/44'/0'/0'")));
    
    const decodedXpub = bs58check.decode(xpub);
    
    // console.log(decodedXpub.slice(45, 78).toString('hex'));
    // console.log(bitcoin.payments.p2pkh({ pubkey: decodedXpub.slice(45, 78) }).address!);
    console.log(bitcoin.payments.p2pkh({ pubkey: Buffer.from('02c47e6c0a0991b7078f7828d0bc73ed2ad3efa365e14a6d109a090b1126fd3b14', 'hex') }).address!);
    

    The output is the following ; -

    // private key
    3cb16d9f8e6dc5458400ff225218c66500ceedf71a459b869839b4d9061ccaec
    // xprv
    xprv9xt5FvzdwnBmrVk12CxSnFwAdcvNkSmpQVK6X6YVd68AoZBDAt7ABmApaUpLXB5PL2QVJM7XLjAkH6Qb9bXxoKbiXwrCTnEpDqcHQpY64z7
    // xpub
    xpub6BsRfSXXn9k54ypU8EVT9PsuBeks9uVfmiEhKUx7BRf9gMWMiRRQjZVJRkyRJbuTK4FBKyjxCPUvxmCCDu9Ht4jxo2GCi526ZQ4RfQ6aSZC
    // WIF compressed
    KyFgzQeHsH8ThchMsiAG6adjEPcyP4vJXE4jeGLevf8Eo6soXzFr
    // WIF to address
    13ySVizcv1F7z6GKE4kJJLkZSqvCBJzPn3
    // the correct address from onekey website
    1eXYoK88bdHBm5YayZQ6Vi2CRpbjEsidS
    

    As you can see above the private key didn't give the correct address in website.

    How to get private and public keys for an address from xprv and xpub ?

    Consider using react-native-quick-crypto

    Hey!

    I noticed this repo uses react-native-crypto, which itself uses crypto-browserify under the hood. crypto-browserify is a JS-based implementation for crypto, which is slower than Margelo's react-native-quick-crypto, since that uses C++ (OpenSSL) with JSI under the hood.

    If you want to replace react-native-crypto with the faster react-native-quick-crypto, I'm happy to help out or answer questions! 😄

    [Question] walletconnect version

    i used onekey to connect a dapp website, but after scanning the qr code, the website prompted "invalid address".
    the website uses walletconnect of version 2.
    i guess it's caused by the mismatch of walletconnect version.

    [Feature] Request for submitting it to Flathub

    Is your feature request related to a problem? Please describe.
    Flathub is a centralized repo like Google Play for desktop apps on Linux. Publishing it will expose OneKey Wallet to a wider community of Linux users.

    Describe the solution you'd like
    It would be nice if you agree that I submit it to Flathub: flathub/flathub#3692. It's simply files extracted from your AppImage + metadata files. All are open source and auditable. The packaging happens in Flathub.org's server.

    Cosmos HD Paths

    There seems to be an issue with certain Cosmos tokens that are not using the right HD Path for generation. Currently the ones I have listed below are using 44'/118'/0'/0/{index}.

    The Crypto.org chain should be using 44'/394'/0'/0/{index}
    The Secret Network should be using 44'/529'/0'/0/{index}

    Maybe for future reference use the Registered coin types for BIP-0044 to make sure the BIP HD paths will be correct.

    Will this be changed to make sure addresses generate correctly since addresses generated in OneKey differ from other wallets?
    Thanks.

    Adding Custom tokens

    Summary

    您好,我作为开发人员遇到了问题,我想将我的自定义令牌添加到 onekey,但我找不到带有预设令牌列表的文件 (Hello i have an issue as a developer, I want to add my custom token to onekey but i cant find the file with the preset token list)

    Steps to Reproduce (for bugs)

    Context

    I can’t add custom tokens to the token list of the source code of onekey

    Environment

    • Operating System: MacOs
    • App Version: 3

    yarn ios error

    <--- Last few GCs --->

    [18314:0x7fce52100000] 452694 ms: Mark-sweep (reduce) 1976.8 (2083.1) -> 1976.8 (2083.1) MB, 3478.8 / 0.0 ms (average mu = 0.232, current mu = 0.148) allocation failure GC in old space requested
    [18314:0x7fce52100000] 457620 ms: Mark-sweep (reduce) 1976.8 (2083.1) -> 1976.8 (2083.1) MB, 4129.6 / 0.0 ms (average mu = 0.197, current mu = 0.162) allocation failure GC in old space requested

    <--- JS stacktrace --->

    FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

    1: 0x1045e6285 node::Abort() (.cold.1) [/usr/local/bin/node]

    2: 0x1032e7509 node::Abort() [/usr/local/bin/node]

    [BUG]: Display rate error on Swap & Bridge page.

    Prerequisites
    Please answer the following questions for yourself before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.

    • I checked to make sure that this issue has not already been filed
    • I've asked for help in the OneKey Discord before filing this issue.

    Describe the bug
    On the Swap & Bridge page, select the USDC - ETH trading pair, enter 1 ETH in the ETH box, and Rate field display 1 USDC ≈ 1176 ETH on the details page.

    To Reproduce
    Steps to reproduce the behavior:

    1. Go to Swap & Bridge page
    2. Input 1 on ETH box
    3. See error on Rate field

    Expected behavior
    Rate: 1 ETH ≈ 1176 UDDC

    Screenshots
    image

    Desktop (please complete the following information):

    • OS: iOS & macOS
    • Version: 3.22.0 (2022121467)

    proposal: 当 `segmented-control` 只有两个元素的时候,拥有与 switch toggle 一样的功能

    原因:

    在小屏幕中,segmentedControl 的点击区域非常的小,用户难以触碰到另一个按钮

    可参考的解决方案:

    使用 pressable 包一层

    <Pressable
      // no delay acts like debounce
      delayLongPress={0}
      onPress={onToggleView}
    >
      <SegmentedControl
        containerProps={{
          width: 70,
          height: 35,
        }}
        options={[
          {
            iconName: 'ViewListSolid',
            value: CollectibleView.Flat,
          },
          {
            iconName: 'ViewGridSolid',
            value: CollectibleView.Grid,
          },
        ]}
        defaultValue={view}
      />
    </Pressable>

    [BUG]:when press yarn to install dependencies

    Prerequisites
    Press "yarn" to install dependencies

    Describe the bug
    ➤ YN0007: │ core-js-pure@npm:3.26.1 must be built because it never has been before or the last one failed
    ➤ YN0007: │ realm@npm:11.0.0-rc.0 [861fd] must be built because it never has been before or the last one failed
    ➤ YN0007: │ electron@npm:21.1.1 must be built because it never has been before or the last one failed
    ➤ YN0007: │ electron@npm:19.1.3 must be built because it never has been before or the last one failed
    ➤ YN0007: │ esbuild@npm:0.15.11 must be built because it never has been before or the last one failed
    ➤ YN0007: │ keytar@npm:7.9.0 must be built because it never has been before or the last one failed
    ➤ YN0007: │ secp256k1@npm:4.0.3 must be built because it never has been before or the last one failed
    ➤ YN0007: │ web3-bzz@npm:1.7.3 must be built because it never has been before or the last one failed
    ➤ YN0007: │ web3-shh@npm:1.7.3 must be built because it never has been before or the last one failed
    ➤ YN0007: │ protobufjs@npm:6.11.3 must be built because it never has been before or the last one failed
    ➤ YN0007: │ keccak@npm:3.0.2 must be built because it never has been before or the last one failed
    ➤ YN0007: │ bigint-buffer@npm:1.1.5 must be built because it never has been before or the last one failed
    ➤ YN0007: │ tiny-secp256k1@npm:1.1.6 must be built because it never has been before or the last one failed
    ➤ YN0007: │ secp256k1@npm:3.8.0 must be built because it never has been before or the last one failed
    ➤ YN0007: │ core-js@npm:3.6.5 must be built because it never has been before or the last one failed
    ➤ YN0007: │ better-sqlite3@npm:7.6.2 must be built because it never has been before or the last one failed
    ➤ YN0007: │ bufferutil@npm:4.0.6 must be built because it never has been before or the last one failed
    ➤ YN0007: │ utf-8-validate@npm:5.0.8 must be built because it never has been before or the last one failed
    ➤ YN0007: │ core-js@npm:2.6.12 must be built because it never has been before or the last one failed
    ➤ YN0009: │ @onekeyhq/app-monorepo@workspace:. couldn't be built successfully (exit code 2, logs can be found here: C:\Users\HP\AppData\Local\Temp\xfs-816180f3\build.log)
    ➤ YN0007: │ @onekeyhq/app@workspace:packages/app must be built because it never has been before or the last one failed
    ➤ YN0007: │ @onekeyhq/desktop@workspace:packages/desktop must be built because it never has been before or the last one failed
    ➤ YN0007: │ web3@npm:1.7.3 must be built because it never has been before or the last one failed
    ➤ YN0000: └ Completed in 3m 26s
    ➤ YN0000: Failed with errors in 3m 35s

    [BUG]:

    Describe the bug
    Error: Generating a new Keystore is not supported in --non-interactive
    mode

    Screen Shot 2022-12-25 at 2 27 39 AM

    I've been trying to solve this for hours now but i have not found a solution.kindly help out

    Recommend Projects

    • React photo React

      A declarative, efficient, and flexible JavaScript library for building user interfaces.

    • Vue.js photo Vue.js

      🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

    • Typescript photo Typescript

      TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

    • TensorFlow photo TensorFlow

      An Open Source Machine Learning Framework for Everyone

    • Django photo Django

      The Web framework for perfectionists with deadlines.

    • D3 photo D3

      Bring data to life with SVG, Canvas and HTML. 📊📈🎉

    Recommend Topics

    • javascript

      JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

    • web

      Some thing interesting about web. New door for the world.

    • server

      A server is a program made to process requests and deliver data to clients.

    • Machine learning

      Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

    • Game

      Some thing interesting about game, make everyone happy.

    Recommend Org

    • Facebook photo Facebook

      We are working to build community through open source technology. NB: members must have two-factor auth.

    • Microsoft photo Microsoft

      Open source projects and samples from Microsoft.

    • Google photo Google

      Google ❤️ Open Source for everyone.

    • D3 photo D3

      Data-Driven Documents codes.