diff --git a/packages/connect-examples/expo-example/App.tsx b/packages/connect-examples/expo-example/App.tsx
index 367f0354a..b4047d40e 100644
--- a/packages/connect-examples/expo-example/App.tsx
+++ b/packages/connect-examples/expo-example/App.tsx
@@ -1,13 +1,12 @@
import React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
-import { enableFreeze, enableScreens } from 'react-native-screens';
-import { View } from 'react-native';
import HomeScreen from './src/views/HomeScreen';
import MockScreen from './src/views/MockConnect';
import { getHardwareSDKInstance } from './src/utils/hardwareInstance';
import PassphraseTestScreen from './src/views/PassphraseTestScreen';
import SDKProvider from './src/provider/SDKProvider';
+import AddressTestScreen from './src/views/AddressTestScreen';
getHardwareSDKInstance();
@@ -19,6 +18,7 @@ export default function App() {
+
diff --git a/packages/connect-examples/expo-example/package.json b/packages/connect-examples/expo-example/package.json
index a5fadb5b2..7a81d3192 100644
--- a/packages/connect-examples/expo-example/package.json
+++ b/packages/connect-examples/expo-example/package.json
@@ -45,7 +45,8 @@
"react-native-screens": "~3.22.0",
"react-native-web": "~0.19.6",
"ripple-keypairs": "^1.1.4",
- "stream-browserify": "^3.0.0"
+ "stream-browserify": "^3.0.0",
+ "use-context-selector": "^1.4.1"
},
"devDependencies": {
"@babel/core": "^7.20.0",
diff --git a/packages/connect-examples/expo-example/src/components/AddressTest/TestAddress.tsx b/packages/connect-examples/expo-example/src/components/AddressTest/TestAddress.tsx
new file mode 100644
index 000000000..77b8bd2db
--- /dev/null
+++ b/packages/connect-examples/expo-example/src/components/AddressTest/TestAddress.tsx
@@ -0,0 +1,394 @@
+import { Text, View, Button, StyleSheet } from 'react-native';
+import { memo, useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';
+import { CoreMessage, UI_EVENT, UI_REQUEST, UI_RESPONSE } from '@onekeyfe/hd-core';
+import { Picker } from '@react-native-picker/picker';
+import { isEmpty, isNil } from 'lodash';
+import { createContext, useContextSelector } from 'use-context-selector';
+import HardwareSDKContext from '../../provider/HardwareSDKContext';
+import { useDevice } from '../../provider/DeviceProvider';
+import { baseChainParams, testCases } from './data';
+import { TestCaseData } from './data/types';
+
+type VerifyState = 'none' | 'pending' | 'skip' | 'success' | 'fail';
+type TestCaseDataWithKey = TestCaseData & { $key: string };
+
+const TestAddressContext = createContext<{
+ itemValues: TestCaseDataWithKey[];
+ setItemValues?: React.Dispatch>;
+}>({
+ itemValues: [],
+});
+
+function TestAddressProvider({ children }: { children: React.ReactNode }) {
+ const [itemValues, setItemValues] = useState([]);
+
+ const value = useMemo(
+ () => ({
+ itemValues,
+ setItemValues,
+ }),
+ [itemValues]
+ );
+
+ return {children};
+}
+
+const TestAddressVerifyContext = createContext<{
+ setItemVerifyState: (key: string, newState: { verify: VerifyState; error?: string }) => void;
+ itemVerifyState: { [key: string]: { verify: VerifyState; error?: string } };
+ clearItemVerifyState: () => void;
+}>({
+ setItemVerifyState: () => {},
+ itemVerifyState: {},
+ clearItemVerifyState: () => {},
+});
+
+function TestAddressVerifyProvider({ children }: { children: React.ReactNode }) {
+ const [itemVerifyState, setItemVerifyStateInternal] = useState<{
+ [key: string]: { verify: VerifyState; error?: string };
+ }>({});
+
+ const setItemVerifyState = useCallback(
+ (key: string, newState: { verify: VerifyState; error?: string }) => {
+ setItemVerifyStateInternal(prevState => ({
+ ...prevState,
+ [key]: newState,
+ }));
+ },
+ []
+ );
+
+ const clearItemVerifyState = useCallback(() => {
+ setItemVerifyStateInternal({});
+ }, []);
+
+ const value = useMemo(
+ () => ({
+ setItemVerifyState,
+ clearItemVerifyState,
+ itemVerifyState,
+ }),
+ [clearItemVerifyState, itemVerifyState, setItemVerifyState]
+ );
+
+ return (
+ {children}
+ );
+}
+
+const TestItemView = ({ item }: { item: TestCaseDataWithKey }) => {
+ const itemVerifyState = useContextSelector(
+ TestAddressVerifyContext,
+ v => v.itemVerifyState?.[item.$key]
+ );
+
+ const verifyState = useMemo(() => itemVerifyState?.verify ?? 'none', [itemVerifyState]);
+ const errorState = useMemo(() => itemVerifyState?.error ?? '', [itemVerifyState]);
+
+ const errorStateViewMemo = useMemo(() => {
+ if (!errorState) return null;
+ return error: {errorState};
+ }, [errorState]);
+
+ const verifyStateViewMemo = useMemo(() => {
+ let color = 'gray';
+ if (verifyState === 'pending') {
+ color = 'blue';
+ } else if (verifyState === 'skip') {
+ color = 'gray';
+ } else if (verifyState === 'success') {
+ color = 'green';
+ } else if (verifyState === 'fail') {
+ color = 'red';
+ }
+
+ return (
+
+ {verifyState}
+
+ );
+ }, [verifyState]);
+
+ return (
+
+ {verifyStateViewMemo}
+
+ {item.method}
+ Expected:{item.expectedAddress}
+ {errorStateViewMemo}
+
+
+ );
+};
+
+const TestItemViewMemo = memo(TestItemView);
+
+function OptionsView() {
+ const { sdk: SDK } = useContext(HardwareSDKContext);
+ const { selectedDevice } = useDevice();
+
+ const [testCaseList, setTestCaseList] = useState([]);
+ const [currentTestCase, setCurrentTestCase] = useState();
+ const [testDescription, setTestDescription] = useState();
+ const [passphrase, setPassphrase] = useState();
+
+ const setItemValues = useContextSelector(TestAddressContext, v => v.setItemValues);
+ const setItemVerifyState = useContextSelector(
+ TestAddressVerifyContext,
+ v => v.setItemVerifyState
+ );
+ const clearItemVerifyState = useContextSelector(
+ TestAddressVerifyContext,
+ v => v.clearItemVerifyState
+ );
+
+ const running = useRef(false);
+
+ const currentPassphrase = useRef('');
+
+ useEffect(() => {
+ const testCaseList: string[] = [];
+ testCases.forEach(testCase => {
+ testCaseList.push(testCase.name);
+ });
+ setTestCaseList(testCaseList);
+ setCurrentTestCase(testCaseList[0]);
+ }, []);
+
+ useEffect(() => {
+ const testCase = testCases.find(testCase => testCase.name === currentTestCase);
+ if (!testCase) return;
+ setTestDescription(testCase.description);
+ setPassphrase(testCase.passphrase);
+ }, [currentTestCase]);
+
+ const stopTest = useCallback(() => {
+ running.current = false;
+ setItemValues?.([]);
+ clearItemVerifyState?.();
+ if (SDK) {
+ SDK.cancel();
+ SDK.removeAllListeners(UI_EVENT);
+ }
+ }, [SDK, setItemValues, clearItemVerifyState]);
+
+ const beginTest = useCallback(async () => {
+ if (!SDK) return;
+ SDK.removeAllListeners(UI_EVENT);
+
+ const testCase = testCases.find(testCase => testCase.name === currentTestCase);
+ if (!testCase) return;
+
+ const currentTestCases = testCase?.data?.map((item, index) => {
+ const key = `${item.method}-${index}`;
+
+ return {
+ ...item,
+ $key: key,
+ } as unknown as TestCaseDataWithKey;
+ });
+
+ setItemValues?.(currentTestCases);
+ clearItemVerifyState?.();
+ running.current = true;
+
+ SDK.on(UI_EVENT, (message: CoreMessage) => {
+ console.log('TopLEVEL EVENT ===>>>>: ', message);
+ if (message.type === UI_REQUEST.REQUEST_PIN) {
+ SDK.uiResponse({
+ type: UI_RESPONSE.RECEIVE_PIN,
+ payload: '@@ONEKEY_INPUT_PIN_IN_DEVICE',
+ });
+ }
+ if (message.type === UI_REQUEST.REQUEST_PASSPHRASE) {
+ setTimeout(() => {
+ SDK.uiResponse({
+ type: UI_RESPONSE.RECEIVE_PASSPHRASE,
+ payload: {
+ value: currentPassphrase.current ?? '',
+ },
+ });
+ }, 200);
+ }
+ });
+
+ const connectId = selectedDevice?.connectId ?? '';
+ const featuresRes = await SDK.getFeatures(connectId);
+ const deviceId = featuresRes.payload?.device_id ?? '';
+
+ if (featuresRes.payload?.passphrase_protection === true && testCase.passphrase == null) {
+ await SDK.deviceSettings(connectId, {
+ usePassphrase: false,
+ });
+ }
+ if (!featuresRes.payload?.passphrase_protection && testCase.passphrase != null) {
+ await SDK.deviceSettings(connectId, {
+ usePassphrase: true,
+ });
+ }
+
+ currentPassphrase.current = testCase.passphrase;
+ const { passphraseState } = testCase;
+
+ for (const item of currentTestCases) {
+ try {
+ if (isNil(item.expectedAddress) || isEmpty(item.expectedAddress)) {
+ setItemVerifyState?.(item.$key, {
+ verify: 'skip',
+ });
+ } else {
+ const { method, params } = item;
+ // @ts-expect-error
+ const commonParams = baseChainParams[method];
+ const requestParams = {
+ ...commonParams,
+ ...params,
+ passphraseState,
+ useEmptyPassphrase: !passphraseState,
+ };
+ setItemVerifyState?.(item.$key, {
+ verify: 'pending',
+ });
+
+ // @ts-expect-error
+ const res = await SDK[`${method}` as keyof typeof sdk](
+ connectId,
+ deviceId,
+ requestParams
+ );
+
+ if (!running.current) return;
+ let verifyState: VerifyState = 'none';
+ let error: string | undefined;
+
+ if (!res.success) {
+ if (res.payload?.code === 802 || res.payload?.code === 803) {
+ verifyState = 'skip';
+ } else {
+ verifyState = 'fail';
+ error = res.payload?.error;
+ }
+ } else if (res.payload?.address === item.expectedAddress) {
+ verifyState = 'success';
+ } else {
+ verifyState = 'fail';
+ error = `actual: ${res.payload?.address}, expected: ${item.expectedAddress}`;
+ }
+
+ setItemVerifyState?.(item.$key, {
+ verify: verifyState,
+ error,
+ });
+ }
+ } catch (e) {
+ setItemVerifyState?.(item.$key, {
+ verify: 'fail',
+ // @ts-expect-error
+ error: e?.message ?? '',
+ });
+ }
+ }
+
+ SDK.removeAllListeners(UI_EVENT);
+ }, [
+ SDK,
+ setItemValues,
+ clearItemVerifyState,
+ selectedDevice?.connectId,
+ currentTestCase,
+ setItemVerifyState,
+ ]);
+
+ const contentMemo = useMemo(
+ () => (
+ <>
+ {testDescription}
+ {!!passphrase && (
+
+ Passphrase:「{passphrase}」
+
+ )}
+
+ setCurrentTestCase(itemValue)}
+ >
+ {testCaseList.map(testCase => (
+
+ ))}
+
+
+
+
+ >
+ ),
+ [beginTest, currentTestCase, passphrase, stopTest, testCaseList, testDescription]
+ );
+
+ return contentMemo;
+}
+
+function ResultView() {
+ const itemValues = useContextSelector(TestAddressContext, v => v.itemValues);
+
+ const resultViewMemo = useMemo(
+ () => (
+
+ {itemValues.map(item => (
+
+ ))}
+
+ ),
+ [itemValues]
+ );
+
+ return resultViewMemo;
+}
+
+export default function TestAddressView() {
+ return (
+
+
+
+ Passphrase Session Test
+
+
+
+
+
+ );
+}
+
+const styles = StyleSheet.create({
+ container: {
+ width: '100%',
+ },
+ subContainer: {
+ width: '100%',
+ marginTop: 16,
+ padding: 10,
+ backgroundColor: '#FFF',
+ borderColor: '#E0E0E0',
+ borderWidth: 1,
+ borderRadius: 8,
+ },
+ fullItem: {
+ width: '100%',
+ },
+});
diff --git a/packages/connect-examples/expo-example/src/components/AddressTest/data/index.ts b/packages/connect-examples/expo-example/src/components/AddressTest/data/index.ts
new file mode 100644
index 000000000..62041a2c8
--- /dev/null
+++ b/packages/connect-examples/expo-example/src/components/AddressTest/data/index.ts
@@ -0,0 +1,134 @@
+import normal12 from './normal12';
+import normal18 from './normal18';
+import normal24 from './normal24';
+import passphrase121 from './passphrase12_1';
+import passphrase122 from './passphrase12_2';
+import passphrase123 from './passphrase12_3';
+import passphrase12Empty from './passphrase12_empty';
+import passphrase181 from './passphrase18_1';
+import passphrase182 from './passphrase18_2';
+import passphrase183 from './passphrase18_3';
+import passphrase184 from './passphrase18_4';
+import passphrase241 from './passphrase24_1';
+import passphrase242 from './passphrase24_2';
+import passphrase243 from './passphrase24_3';
+import passphrase244 from './passphrase24_4';
+import type { TestCase } from './types';
+
+export const baseChainParams = {
+ algoGetAddress: {
+ path: "m/44'/283'/0'/0'/0'",
+ showOnOneKey: false,
+ },
+ aptosGetAddress: {
+ path: "m/44'/637'/0'/0'/0'",
+ showOnOneKey: false,
+ },
+ btcGetAddress: {
+ path: "m/44'/0'/0'/0/0",
+ coin: 'btc',
+ showOnOneKey: false,
+ },
+ cardanoGetAddress: {
+ addressParameters: {
+ addressType: 0,
+ path: "m/1852'/1815'/0'/0/0",
+ stakingPath: "m/1852'/1815'/0'/2/0",
+ stakingKeyHash: undefined,
+ paymentScriptHash: undefined,
+ stakingScriptHash: undefined,
+ },
+ protocolMagic: 764824073,
+ networkId: 1,
+ derivationType: 1,
+ address: '',
+ showOnOneKey: false,
+ isCheck: false,
+ },
+ confluxGetAddress: {
+ path: "m/44'/503'/0'/0/0",
+ chainId: 1029,
+ showOnOneKey: false,
+ },
+ cosmosGetAddress: {
+ path: "m/44'/118'/0'/0/0",
+ showOnOneKey: false,
+ hrp: 'cosmos',
+ },
+ evmGetAddress: {
+ path: "m/44'/60'/0'/0/0",
+ showOnOneKey: false,
+ },
+ filecoinGetAddress: {
+ path: "m/44'/461'/0'/0/0",
+ showOnOneKey: false,
+ },
+ kaspaGetAddress: {
+ path: "m/44'/111111'/0'/0/0",
+ showOnOneKey: false,
+ prefix: 'kaspa',
+ scheme: 'schnorr',
+ },
+ nearGetAddress: {
+ path: "m/44'/397'/0'",
+ showOnOneKey: false,
+ },
+ nemGetAddress: {
+ path: "m/44'/43'/0'",
+ showOnOneKey: false,
+ },
+ nexaGetAddress: {
+ path: "m/44'/29223'/0'/0/0",
+ showOnOneKey: false,
+ prefix: 'nexa',
+ scheme: 'schnorr',
+ },
+ polkadotGetAddress: {
+ path: "m/44'/354'/0'/0'/0'",
+ prefix: '0',
+ network: 'polkadot',
+ showOnOneKey: false,
+ },
+ xrpGetAddress: {
+ path: "m/44'/144'/0'/0/0",
+ showOnOneKey: false,
+ },
+ solGetAddress: {
+ path: "m/44'/501'/0'/0'",
+ showOnOneKey: false,
+ },
+ starcoinGetAddress: {
+ path: "m/44'/101010'/0'/0'/0'",
+ showOnOneKey: false,
+ },
+ stellarGetAddress: {
+ path: "m/44'/148'/0'",
+ showOnOneKey: false,
+ },
+ suiGetAddress: {
+ path: "m/44'/784'/0'/0'/0'",
+ showOnOneKey: false,
+ },
+ tronGetAddress: {
+ path: "m/44'/195'/0'/0/0",
+ showOnOneKey: false,
+ },
+};
+
+export const testCases: TestCase[] = [
+ normal12,
+ normal18,
+ normal24,
+ passphrase12Empty,
+ passphrase121,
+ passphrase122,
+ passphrase123,
+ passphrase181,
+ passphrase182,
+ passphrase183,
+ passphrase184,
+ passphrase241,
+ passphrase242,
+ passphrase243,
+ passphrase244,
+];
diff --git a/packages/connect-examples/expo-example/src/components/AddressTest/data/normal12.ts b/packages/connect-examples/expo-example/src/components/AddressTest/data/normal12.ts
new file mode 100644
index 000000000..e7387db3a
--- /dev/null
+++ b/packages/connect-examples/expo-example/src/components/AddressTest/data/normal12.ts
@@ -0,0 +1,196 @@
+import type { TestCase } from './types';
+
+export default {
+ name: 'normal-12',
+ description: '详见 https://onekeyhq.atlassian.net/wiki/spaces/ONEKEY/pages/218726488',
+ data: [
+ {
+ method: 'algoGetAddress',
+ expectedAddress: '74MX3E7TJRON3LTP3DCRR3AJYAVNRMYZSYZPK3XTJ3UOTHZFJ65SSJKHWI',
+ },
+ {
+ method: 'btcGetAddress',
+ params: {
+ path: "m/44'/0'/0'/0/0",
+ },
+ expectedAddress: '12FYqAVUYjrPtGCYk3hfW3NYrmqYayF8nD',
+ },
+ {
+ method: 'btcGetAddress',
+ params: {
+ path: "m/49'/0'/0'/0/0",
+ },
+ expectedAddress: '37gkBRwk2wso7NJhhuMaaYYxwKa1ooBzbu',
+ },
+ {
+ method: 'btcGetAddress',
+ params: {
+ path: "m/84'/0'/0'/0/0",
+ },
+ expectedAddress: 'bc1qztfq5mg7nmn82pa6hawgv0fazuqnqpf8np26t3',
+ },
+ {
+ method: 'btcGetAddress',
+ params: {
+ path: "m/86'/0'/0'/0/0",
+ },
+ expectedAddress: 'bc1psd4y7u8vmxj60s5xhm6lythnvrs0zlrc9ffzpv0jqcfnnf8te0cs9q5f4d',
+ },
+ {
+ method: 'btcGetAddress',
+ params: {
+ path: "m/44'/3'/0'/0/0",
+ coin: 'doge',
+ },
+ expectedAddress: 'DDTHwiFPjKu6YkmiNu4QqUPsgmu2qcYqNH',
+ },
+ {
+ method: 'btcGetAddress',
+ params: {
+ path: "m/44'/145'/0'/0/0",
+ coin: 'bch',
+ },
+ expectedAddress: 'bitcoincash:qrgec83eff6t6rclcg7scmhgjaer7p8fe50wlf6q59',
+ },
+ {
+ method: 'btcGetAddress',
+ params: {
+ path: "m/44'/2'/0'/0/0",
+ coin: 'ltc',
+ },
+ expectedAddress: 'Ld1mDZbEDPSkGwgmGSGJqNSBWzitYJbhUF',
+ },
+ {
+ method: 'btcGetAddress',
+ params: {
+ path: "m/49'/2'/0'/0/0",
+ coin: 'ltc',
+ },
+ expectedAddress: 'MCDdhA1sF19ndyYEthHmK2NDaoM3GZSTHg',
+ },
+ {
+ method: 'btcGetAddress',
+ params: {
+ path: "m/84'/2'/0'/0/0",
+ coin: 'ltc',
+ },
+ expectedAddress: 'ltc1qezxh89ghhu6qlse5mu0vrpue9d6xr3pkqzs2ke',
+ },
+ {
+ method: 'cardanoGetAddress',
+ expectedAddress:
+ 'addr1qy8y29tt9vr229fycfeqdthquuxk4da05xtakec2c49aq5y6p5s2zkcuzskt6wfyrp26r9m7h64hmdul5dtymgmz6has9eqnsn',
+ },
+ {
+ method: 'confluxGetAddress',
+ expectedAddress: 'cfx:aajftxw8pcaxxwy0mv3uprfp93pstm6h5uzu44a4gd',
+ },
+ {
+ method: 'cosmosGetAddress',
+ expectedAddress: 'cosmos148ea3zrv3r8ke9mt34xygl89k3gn03q69y66zf',
+ },
+ {
+ method: 'cosmosGetAddress',
+ params: {
+ hrp: 'akash',
+ },
+ expectedAddress: 'akash148ea3zrv3r8ke9mt34xygl89k3gn03q6glhamn',
+ },
+ {
+ method: 'cosmosGetAddress',
+ params: {
+ hrp: 'cro',
+ },
+ expectedAddress: 'cro148ea3zrv3r8ke9mt34xygl89k3gn03q6aljr7c',
+ },
+ {
+ method: 'cosmosGetAddress',
+ params: {
+ hrp: 'fetch',
+ },
+ expectedAddress: 'fetch148ea3zrv3r8ke9mt34xygl89k3gn03q6ken7q7',
+ },
+ {
+ method: 'cosmosGetAddress',
+ params: {
+ hrp: 'osmo',
+ },
+ expectedAddress: 'osmo148ea3zrv3r8ke9mt34xygl89k3gn03q6dlf25m',
+ },
+ {
+ method: 'cosmosGetAddress',
+ params: {
+ hrp: 'juno',
+ },
+ expectedAddress: 'juno148ea3zrv3r8ke9mt34xygl89k3gn03q6nkep94',
+ },
+ {
+ method: 'evmGetAddress',
+ expectedAddress: '0xc8E5E76BE7B3a6ef776fbC0AB3df51FA0F8639e7',
+ },
+ {
+ method: 'filecoinGetAddress',
+ expectedAddress: 'f1qi7xcylshtjazoatg4izkcidyi4dx4apyl4aizq',
+ },
+ {
+ method: 'kaspaGetAddress',
+ expectedAddress: '',
+ },
+ {
+ method: 'nearGetAddress',
+ expectedAddress: '4866891b00cadfe81eb6ea932c9d43fc76a6e29d63f1060ddab755a021b13e17',
+ },
+ {
+ method: 'nemGetAddress',
+ expectedAddress: '',
+ },
+ {
+ method: 'nexaGetAddress',
+ expectedAddress: '',
+ },
+ {
+ method: 'polkadotGetAddress',
+ expectedAddress: '16fP6kx3FxmYAE562zZSEtxqcF3pRDorizjb6mDY5RBmnohB',
+ },
+ {
+ method: 'polkadotGetAddress',
+ params: {
+ prefix: '2',
+ network: 'kusama',
+ },
+ expectedAddress: 'JEhck2r2YWzULt1r4KUzhVguDLQXb4u6sqrL8W918NkMXHZ',
+ },
+ {
+ method: 'polkadotGetAddress',
+ params: {
+ prefix: '5',
+ network: 'astar',
+ },
+ expectedAddress: 'bbgPif4BR9AwX6QZexZ8QHxqfmHh8xTfhWFBBS3PhADCMZf',
+ },
+ {
+ method: 'xrpGetAddress',
+ expectedAddress: 'rf5VU3nANb4DVaPgEkw2uzd33TtxPDUwTL',
+ },
+ {
+ method: 'solGetAddress',
+ expectedAddress: '2LsEofA6PH9mTbkynyjpLooAPCC7Cd69kuZqPmbHAMmF',
+ },
+ {
+ method: 'starcoinGetAddress',
+ expectedAddress: '',
+ },
+ {
+ method: 'stellarGetAddress',
+ expectedAddress: '',
+ },
+ {
+ method: 'suiGetAddress',
+ expectedAddress: '0x3bb9c05ec50fef0dca816c5fef791bcfe96db95bee30a226ec6c41e08f491e5a',
+ },
+ {
+ method: 'tronGetAddress',
+ expectedAddress: '',
+ },
+ ],
+} as TestCase;
diff --git a/packages/connect-examples/expo-example/src/components/AddressTest/data/normal18.ts b/packages/connect-examples/expo-example/src/components/AddressTest/data/normal18.ts
new file mode 100644
index 000000000..7ebfab3fc
--- /dev/null
+++ b/packages/connect-examples/expo-example/src/components/AddressTest/data/normal18.ts
@@ -0,0 +1,196 @@
+import type { TestCase } from './types';
+
+export default {
+ name: 'normal-18',
+ description: '详见 https://onekeyhq.atlassian.net/wiki/spaces/ONEKEY/pages/218726488',
+ data: [
+ {
+ method: 'algoGetAddress',
+ expectedAddress: 'V57S5YT77SNH7SPWLWY27PPHGXEYWA7TMH2PHVMT2HF3P7HWAIJHNWJ7E4',
+ },
+ {
+ method: 'btcGetAddress',
+ params: {
+ path: "m/44'/0'/0'/0/0",
+ },
+ expectedAddress: '1HtFoKQaC6hacPBKVQDUo2uDVUuSXu8X5F',
+ },
+ {
+ method: 'btcGetAddress',
+ params: {
+ path: "m/49'/0'/0'/0/0",
+ },
+ expectedAddress: '37dwAaNLRr96aJFb2mQv37YUtT9uWvXZi1',
+ },
+ {
+ method: 'btcGetAddress',
+ params: {
+ path: "m/84'/0'/0'/0/0",
+ },
+ expectedAddress: 'bc1q8ytzt4elp44kynjh6pddlehzmeqgkx5xtph6qu',
+ },
+ {
+ method: 'btcGetAddress',
+ params: {
+ path: "m/86'/0'/0'/0/0",
+ },
+ expectedAddress: 'bc1p0zzclc79segnke36tss0hxkka9sm0g9en84gztdjz870qv6xcvzqlugmwd',
+ },
+ {
+ method: 'btcGetAddress',
+ params: {
+ path: "m/44'/3'/0'/0/0",
+ coin: 'doge',
+ },
+ expectedAddress: 'D59stDbvDkPRM3FCdQGGUgCsN5tx188EUN',
+ },
+ {
+ method: 'btcGetAddress',
+ params: {
+ path: "m/44'/145'/0'/0/0",
+ coin: 'bch',
+ },
+ expectedAddress: 'bitcoincash:qp0udaacx9avsvttcp83v7u2x7fnmc57j5pl9v8mur',
+ },
+ {
+ method: 'btcGetAddress',
+ params: {
+ path: "m/44'/2'/0'/0/0",
+ coin: 'ltc',
+ },
+ expectedAddress: 'La7iCj4NN8jDUVL82b382d5djViFLDppwe',
+ },
+ {
+ method: 'btcGetAddress',
+ params: {
+ path: "m/49'/2'/0'/0/0",
+ coin: 'ltc',
+ },
+ expectedAddress: 'MFeuCy48YYZ1rKE4x3hxiS6orK7bBdWRQE',
+ },
+ {
+ method: 'btcGetAddress',
+ params: {
+ path: "m/84'/2'/0'/0/0",
+ coin: 'ltc',
+ },
+ expectedAddress: 'ltc1qy0k92a55g9zyycrcvdhs0su3gdklza3vk2cr8g',
+ },
+ {
+ method: 'cardanoGetAddress',
+ expectedAddress:
+ 'addr1q94v75d9jm5tlqxmhaf9xjfrpejuhvqjsx7l58tq2gdta7mkwquh9d8rnhmpenppuyghfzy396gmr73ymygr46d3e0gs5wqhqm',
+ },
+ {
+ method: 'confluxGetAddress',
+ expectedAddress: 'cfx:aap2ahh8346btnwk8mektt9hpe6f44rc3p8g0xwdhp',
+ },
+ {
+ method: 'cosmosGetAddress',
+ expectedAddress: 'cosmos1u78ua8tpf2xy3lsvt9l9ev779n9e4fpnc6cfz3',
+ },
+ {
+ method: 'cosmosGetAddress',
+ params: {
+ hrp: 'akash',
+ },
+ expectedAddress: 'akash1u78ua8tpf2xy3lsvt9l9ev779n9e4fpn4p4wmt',
+ },
+ {
+ method: 'cosmosGetAddress',
+ params: {
+ hrp: 'cro',
+ },
+ expectedAddress: 'cro1u78ua8tpf2xy3lsvt9l9ev779n9e4fpnqpss7q',
+ },
+ {
+ method: 'cosmosGetAddress',
+ params: {
+ hrp: 'fetch',
+ },
+ expectedAddress: 'fetch1u78ua8tpf2xy3lsvt9l9ev779n9e4fpnt83dqx',
+ },
+ {
+ method: 'cosmosGetAddress',
+ params: {
+ hrp: 'osmo',
+ },
+ expectedAddress: 'osmo1u78ua8tpf2xy3lsvt9l9ev779n9e4fpnspte5r',
+ },
+ {
+ method: 'cosmosGetAddress',
+ params: {
+ hrp: 'juno',
+ },
+ expectedAddress: 'juno1u78ua8tpf2xy3lsvt9l9ev779n9e4fpnwgmj9d',
+ },
+ {
+ method: 'evmGetAddress',
+ expectedAddress: '0x5C8DD86c9d7DF51550F860Ec0567124e86DE91Fa',
+ },
+ {
+ method: 'filecoinGetAddress',
+ expectedAddress: 'f1bp6hi3vawa4qdkiccxysjwt6s5xsdllxhsv44oy',
+ },
+ {
+ method: 'kaspaGetAddress',
+ expectedAddress: '',
+ },
+ {
+ method: 'nearGetAddress',
+ expectedAddress: '06aa2d05de7bcd297ca12621923fb4c9dfa031adeb820d3b20e93e68fa3dc7c5',
+ },
+ {
+ method: 'nemGetAddress',
+ expectedAddress: '',
+ },
+ {
+ method: 'nexaGetAddress',
+ expectedAddress: '',
+ },
+ {
+ method: 'polkadotGetAddress',
+ expectedAddress: '13K48SsFCLkh3FWxgJRpXDAJ2wio6wm6DPK3cEpb1TMik9yh',
+ },
+ {
+ method: 'polkadotGetAddress',
+ params: {
+ prefix: '2',
+ network: 'kusama',
+ },
+ expectedAddress: 'EtNeRx3xvW9MNKtVNBsH1h9Kv1PDK28bGRJqc7BwAYhJtD9',
+ },
+ {
+ method: 'polkadotGetAddress',
+ params: {
+ prefix: '5',
+ network: 'astar',
+ },
+ expectedAddress: 'YFMRQaG7o8KpYYHCxpwQiVRGNSGNruhA65hgf36KjLA9bGa',
+ },
+ {
+ method: 'xrpGetAddress',
+ expectedAddress: 'rfERf1MKC6JkBEHWuBm2iBQo5xY1aBSJNF',
+ },
+ {
+ method: 'solGetAddress',
+ expectedAddress: '7saU8kc3DCXA7WWDbXwGe8X8febDxCGqAWeS3p7GqiMR',
+ },
+ {
+ method: 'starcoinGetAddress',
+ expectedAddress: '',
+ },
+ {
+ method: 'stellarGetAddress',
+ expectedAddress: '',
+ },
+ {
+ method: 'suiGetAddress',
+ expectedAddress: '0x81f7d475a77b0af6c4941714ddf304f4441b70935ef0939116f8eaa009e1d04c',
+ },
+ {
+ method: 'tronGetAddress',
+ expectedAddress: '',
+ },
+ ],
+} as TestCase;
diff --git a/packages/connect-examples/expo-example/src/components/AddressTest/data/normal24.ts b/packages/connect-examples/expo-example/src/components/AddressTest/data/normal24.ts
new file mode 100644
index 000000000..49edbce41
--- /dev/null
+++ b/packages/connect-examples/expo-example/src/components/AddressTest/data/normal24.ts
@@ -0,0 +1,196 @@
+import type { TestCase } from './types';
+
+export default {
+ name: 'normal-24',
+ description: '详见 https://onekeyhq.atlassian.net/wiki/spaces/ONEKEY/pages/218726488',
+ data: [
+ {
+ method: 'algoGetAddress',
+ expectedAddress: 'VRMB4WUEC3DN7UBHYE3EY7ZT3OKUWERNQQJ4CBOJTOPXXAWX5Z4JAMS6JE',
+ },
+ {
+ method: 'btcGetAddress',
+ params: {
+ path: "m/44'/0'/0'/0/0",
+ },
+ expectedAddress: '1HBYRoZx6b5MVkSWksCRWCFtesHHne1gHw',
+ },
+ {
+ method: 'btcGetAddress',
+ params: {
+ path: "m/49'/0'/0'/0/0",
+ },
+ expectedAddress: '39JT4Yrt4SjXGr6PpmJ1jfGEWyFZHj5oRV',
+ },
+ {
+ method: 'btcGetAddress',
+ params: {
+ path: "m/84'/0'/0'/0/0",
+ },
+ expectedAddress: 'bc1qx74p4wvqfm9r8r6p7luwlmkajxx3mjxle2c5u4',
+ },
+ {
+ method: 'btcGetAddress',
+ params: {
+ path: "m/86'/0'/0'/0/0",
+ },
+ expectedAddress: 'bc1ps4fk5rx26xx9990qs88q3je5dypwqguhz2s87l4dczfgan3cvass3jvuvm',
+ },
+ {
+ method: 'btcGetAddress',
+ params: {
+ path: "m/44'/3'/0'/0/0",
+ coin: 'doge',
+ },
+ expectedAddress: 'D5Cvu2NfFg9v4hEV2Rsh5be6j4JRFjyk3H',
+ },
+ {
+ method: 'btcGetAddress',
+ params: {
+ path: "m/44'/145'/0'/0/0",
+ coin: 'bch',
+ },
+ expectedAddress: 'bitcoincash:qpr0x2gewm6tm20h8f33hmw075pxzqvn8ukqe6g3yj',
+ },
+ {
+ method: 'btcGetAddress',
+ params: {
+ path: "m/44'/2'/0'/0/0",
+ coin: 'ltc',
+ },
+ expectedAddress: 'LSmKDhScBC7taRgxHfw91Vaz2z4YUDVb9e',
+ },
+ {
+ method: 'btcGetAddress',
+ params: {
+ path: "m/49'/2'/0'/0/0",
+ coin: 'ltc',
+ },
+ expectedAddress: 'MPuBPxv8RNofxph4bRonoPQhVWEi3TMTHC',
+ },
+ {
+ method: 'btcGetAddress',
+ params: {
+ path: "m/84'/2'/0'/0/0",
+ coin: 'ltc',
+ },
+ expectedAddress: 'ltc1qjklsl739wedrxqdpg0x4uta6hq3n7y5w7zwz4j',
+ },
+ {
+ method: 'cardanoGetAddress',
+ expectedAddress:
+ 'addr1qy5ms8ls63ku9zp8qpuysvp4j3f7ddenfkeg0rdxgxraracjeesya9qwyfpjsthls3nq3696l4s8m4vp83urz4tdjsjqdpum9g',
+ },
+ {
+ method: 'confluxGetAddress',
+ expectedAddress: 'cfx:aamx2u6f3g2dr5gef108wkkeew72n0dzjuxc7t5vkw',
+ },
+ {
+ method: 'cosmosGetAddress',
+ expectedAddress: 'cosmos1aj3yvyzgv3shp5fq4rzyrhn0dte7uz6zwyul4l',
+ },
+ {
+ method: 'cosmosGetAddress',
+ params: {
+ hrp: 'akash',
+ },
+ expectedAddress: 'akash1aj3yvyzgv3shp5fq4rzyrhn0dte7uz6zrl3cv9',
+ },
+ {
+ method: 'cosmosGetAddress',
+ params: {
+ hrp: 'cro',
+ },
+ expectedAddress: 'cro1aj3yvyzgv3shp5fq4rzyrhn0dte7uz6zkl5xfw',
+ },
+ {
+ method: 'cosmosGetAddress',
+ params: {
+ hrp: 'fetch',
+ },
+ expectedAddress: 'fetch1aj3yvyzgv3shp5fq4rzyrhn0dte7uz6zae4mhg',
+ },
+ {
+ method: 'cosmosGetAddress',
+ params: {
+ hrp: 'osmo',
+ },
+ expectedAddress: 'osmo1aj3yvyzgv3shp5fq4rzyrhn0dte7uz6zxl00rd',
+ },
+ {
+ method: 'cosmosGetAddress',
+ params: {
+ hrp: 'juno',
+ },
+ expectedAddress: 'juno1aj3yvyzgv3shp5fq4rzyrhn0dte7uz6zcklyjr',
+ },
+ {
+ method: 'evmGetAddress',
+ expectedAddress: '0xcfD7A4B84cFf0b9717Dbd8930720492bFC4484Ce',
+ },
+ {
+ method: 'filecoinGetAddress',
+ expectedAddress: 'f1nql7bfoqm4jcamyacxeyyd6qtgrprvsq2mhjezy',
+ },
+ {
+ method: 'kaspaGetAddress',
+ expectedAddress: '',
+ },
+ {
+ method: 'nearGetAddress',
+ expectedAddress: '98f7b5e1ef7a89703ba463195c3ebee3e455bbbaf98b87e7996067c71d668e58',
+ },
+ {
+ method: 'nemGetAddress',
+ expectedAddress: '',
+ },
+ {
+ method: 'nexaGetAddress',
+ expectedAddress: 'nexa:nqtsq5g5jnvz8kws04uhrdhvy64fksj3ef0njqggxc5n2ggu',
+ },
+ {
+ method: 'polkadotGetAddress',
+ expectedAddress: '16fP6kx3FxmYAE562zZSEtxqcF3pRDorizjb6mDY5RBmnohB',
+ },
+ {
+ method: 'polkadotGetAddress',
+ params: {
+ prefix: '2',
+ network: 'kusama',
+ },
+ expectedAddress: 'JEhck2r2YWzULt1r4KUzhVguDLQXb4u6sqrL8W918NkMXHZ',
+ },
+ {
+ method: 'polkadotGetAddress',
+ params: {
+ prefix: '5',
+ network: 'astar',
+ },
+ expectedAddress: 'bbgPif4BR9AwX6QZexZ8QHxqfmHh8xTfhWFBBS3PhADCMZf',
+ },
+ {
+ method: 'xrpGetAddress',
+ expectedAddress: 'rpUi73yswog42p7bR71vRp4G74nzZMvaqA',
+ },
+ {
+ method: 'solGetAddress',
+ expectedAddress: '5MvgnYA7dmXaqdte918SL31asso7zCDx4XuvSDLdkYAH',
+ },
+ {
+ method: 'starcoinGetAddress',
+ expectedAddress: '',
+ },
+ {
+ method: 'stellarGetAddress',
+ expectedAddress: '',
+ },
+ {
+ method: 'suiGetAddress',
+ expectedAddress: '0xa5fce96feea80e90276f5e59669cf4c91d22d90d04d303abc6d0285675ebee65',
+ },
+ {
+ method: 'tronGetAddress',
+ expectedAddress: '',
+ },
+ ],
+} as TestCase;
diff --git a/packages/connect-examples/expo-example/src/components/AddressTest/data/passphrase12_1.ts b/packages/connect-examples/expo-example/src/components/AddressTest/data/passphrase12_1.ts
new file mode 100644
index 000000000..b3c929291
--- /dev/null
+++ b/packages/connect-examples/expo-example/src/components/AddressTest/data/passphrase12_1.ts
@@ -0,0 +1,79 @@
+import type { TestCase } from './types';
+
+export default {
+ name: 'passphrase12-1',
+ passphrase: "qwertyuiopasdfghjklzxcvbnm1234567890-=[];',./12345",
+ passphraseState: 'n3igG2n49CvSEt12j1jr4SKkp45oUWWmAT',
+ description:
+ '详见 https://onekeyhq.atlassian.net/wiki/spaces/ONEKEY/pages/259227649/passphrase-12',
+ data: [
+ {
+ method: 'algoGetAddress',
+ expectedAddress: 'YAUBFJZBSZETOWS44R43BYRYYAKG5VBZH3SYJZLYMYD5XCWIR4OIXWBSHY',
+ },
+ {
+ method: 'aptosGetAddress',
+ expectedAddress: '0xffc3f778efb1e40ddd84738d05a4f0f3c7c3dd4d5214a7936abb067c6913883d',
+ },
+ {
+ method: 'btcGetAddress',
+ params: {
+ path: "m/49'/0'/0'/0/0",
+ },
+ expectedAddress: '38Zv9tLDteBymR2qc7ZN4kUBgrt7e7fiFS',
+ },
+ {
+ method: 'cardanoGetAddress',
+ expectedAddress:
+ 'addr1qym5md6lthdrwteeu333sy4ct3h44wyy0vqsp9eurlcs0rjcl09h7muqdppvwz5j6cemcc3nut0r8k5fkane56u6622sgy87gj',
+ },
+ {
+ method: 'confluxGetAddress',
+ expectedAddress: 'cfx:aapvwdf3krdxrkv44884hy88h8naux8gzjhfb0781j',
+ },
+ {
+ method: 'cosmosGetAddress',
+ expectedAddress: 'cosmos1ct0hzch5vsux7gu687c82t4054p5j5wpaqd9tl',
+ },
+ {
+ method: 'evmGetAddress',
+ expectedAddress: '0x365Cd81f2978E7Be232ddB24d0516EeE5bDF3741',
+ },
+ {
+ method: 'kaspaGetAddress',
+ expectedAddress: 'kaspa:qrcju2u4f87z3jrafz6f9vvnz5t498kccrgasljrfvnq97epfw4473fth0wze',
+ },
+ {
+ method: 'nearGetAddress',
+ expectedAddress: 'f7995136d777b3e95932219a514193e9bbda55442bad497dd6735c409c2b30db',
+ },
+ {
+ method: 'nexaGetAddress',
+ expectedAddress: 'nexa:nqtsq5g55ru4vh3c8kdcaqs4caeed7s9k6p8x3w33rqy4njs',
+ },
+ {
+ method: 'polkadotGetAddress',
+ expectedAddress: '16gznoANGUmZhv5ttKUUhTrAzG464iGjBSLAv79JymCAe5Q',
+ },
+ {
+ method: 'xrpGetAddress',
+ expectedAddress: 'rE4B9T8GkzFiqDupHFHH5MGKmXoaWBnHkD',
+ },
+ {
+ method: 'solGetAddress',
+ expectedAddress: '9FbUeT7UPTEkY5bdB4hS1kQCbcSnJBePWZsD2SHaFhMR',
+ },
+ {
+ method: 'starcoinGetAddress',
+ expectedAddress: '0x02c90653da07a060658f2cc1e2635d2e',
+ },
+ {
+ method: 'suiGetAddress',
+ expectedAddress: '0xd73af1f9c55b88994a0c633e8bb3129ef447fc5e17a29b6fd1338da740365c36',
+ },
+ {
+ method: 'tronGetAddress',
+ expectedAddress: 'TNHAHGEw3xSemY6ZcnzY6rvYek5unzpYot',
+ },
+ ],
+} as TestCase;
diff --git a/packages/connect-examples/expo-example/src/components/AddressTest/data/passphrase12_2.ts b/packages/connect-examples/expo-example/src/components/AddressTest/data/passphrase12_2.ts
new file mode 100644
index 000000000..ae119c065
--- /dev/null
+++ b/packages/connect-examples/expo-example/src/components/AddressTest/data/passphrase12_2.ts
@@ -0,0 +1,79 @@
+import type { TestCase } from './types';
+
+export default {
+ name: 'passphrase12-2',
+ passphrase: '12345y67890ABc4',
+ passphraseState: 'mkeNhHFDxRQue8scCqLUgwwomia6FgnR3C',
+ description:
+ '详见 https://onekeyhq.atlassian.net/wiki/spaces/ONEKEY/pages/259227649/passphrase-12',
+ data: [
+ {
+ method: 'algoGetAddress',
+ expectedAddress: '4OBITAH4EW26X35F5QD5MMFEKPL27JQIMT6BNVN6TA5N5W5PWFSKXRVKYY',
+ },
+ {
+ method: 'aptosGetAddress',
+ expectedAddress: '0x0cdf7825c41c2792b2fe632eb7aeec8d575a6f5950607bb9bb4174d7d4e587ac',
+ },
+ {
+ method: 'btcGetAddress',
+ params: {
+ path: "m/49'/0'/0'/0/0",
+ },
+ expectedAddress: '3PH6hhUyptejXTSXHGcc16dmUX9S18gSXZ',
+ },
+ {
+ method: 'cardanoGetAddress',
+ expectedAddress:
+ 'addr1qyacuhaf8gj3r8k9q40lpssu68x5fah2vy736c3tcp8xpmsxtzz4nxy07xwejhu5mxtt2h4kctaqy84v2jd3r3eurq0q0euvrg',
+ },
+ {
+ method: 'confluxGetAddress',
+ expectedAddress: 'cfx:aan7tg66xvuwmsx4ku5vzcr0eymmzgrrhem8yckya3',
+ },
+ {
+ method: 'cosmosGetAddress',
+ expectedAddress: 'cosmos1ntfu3mx70pjgldq82g3zn2l4g2anltm8ugge9m',
+ },
+ {
+ method: 'evmGetAddress',
+ expectedAddress: '0x4A6529459C5DbFA005B8FdADC42827F1e720289B',
+ },
+ {
+ method: 'kaspaGetAddress',
+ expectedAddress: 'kaspa:qz6z9s2myh9c2tcwdyhe5vdkadd8pfp6n8vgxngtv48ql5atle8r632z624e4',
+ },
+ {
+ method: 'nearGetAddress',
+ expectedAddress: '077c5138cd63408a5b531f9253b4a855f6482c752cd46ce0300355a57bc4c3f1',
+ },
+ {
+ method: 'nexaGetAddress',
+ expectedAddress: 'nexa:nqtsq5g5l60edcd5glhcw3kr7wpxvrd02xkgn5m49rg7shck',
+ },
+ {
+ method: 'polkadotGetAddress',
+ expectedAddress: '16QYFBLmZrgNfPsXNd3KCbtsSeiqsRDvY8Zbue1VUZokXq8W',
+ },
+ {
+ method: 'xrpGetAddress',
+ expectedAddress: 'rBCWoFT67Qaia7ghMgBWj89TAP2BbbkMWC',
+ },
+ {
+ method: 'solGetAddress',
+ expectedAddress: 'GLym9ZWPiP4a2pZorViKMJNfTMxixUNHSXLtZKxwpbGb',
+ },
+ {
+ method: 'starcoinGetAddress',
+ expectedAddress: '0xda390604d544250b32ded8b153d7a776',
+ },
+ {
+ method: 'suiGetAddress',
+ expectedAddress: '0x6a22fbea097253a6b97457a459b8c4613983d3626f4b1d691d9fcbb591198c19',
+ },
+ {
+ method: 'tronGetAddress',
+ expectedAddress: 'TVEUgsmqyU4fBriHe9KSr9Dj6M9eMSTDRm',
+ },
+ ],
+} as TestCase;
diff --git a/packages/connect-examples/expo-example/src/components/AddressTest/data/passphrase12_3.ts b/packages/connect-examples/expo-example/src/components/AddressTest/data/passphrase12_3.ts
new file mode 100644
index 000000000..57cd78ad9
--- /dev/null
+++ b/packages/connect-examples/expo-example/src/components/AddressTest/data/passphrase12_3.ts
@@ -0,0 +1,79 @@
+import type { TestCase } from './types';
+
+export default {
+ name: 'passphrase12-3',
+ passphrase: '11111111',
+ passphraseState: 'ms8QNM6uuo3zbo4SM9YqrsxPRGv3b3HmuQ',
+ description:
+ '详见 https://onekeyhq.atlassian.net/wiki/spaces/ONEKEY/pages/259227649/passphrase-12',
+ data: [
+ {
+ method: 'algoGetAddress',
+ expectedAddress: '3IAK33SJQ4FZNXICBKP2I4IBC5DWJH2ZZS36WCKROVCRIWWIHEN2JBBTEU',
+ },
+ {
+ method: 'aptosGetAddress',
+ expectedAddress: '0x090657a5f714e2a6984a11fe87a85725ee27eca330ad61395aee2092a7f45d25',
+ },
+ {
+ method: 'btcGetAddress',
+ params: {
+ path: "m/49'/0'/0'/0/0",
+ },
+ expectedAddress: '3HgHMHhh871x6hxcuSGtfmLfyJRxbyyhTr',
+ },
+ {
+ method: 'cardanoGetAddress',
+ expectedAddress:
+ 'addr1qxrwuuccm88c8rlntmfd4f42860a0vvp7m3k3e6e56u75u5ta3csahrwxumct6fupq6z4v3cg6ky477p8gphye3w0k0qns4zgy',
+ },
+ {
+ method: 'confluxGetAddress',
+ expectedAddress: 'cfx:aarjde7bmcehj036bj9h0j005ewcrvymty1d46aym2',
+ },
+ {
+ method: 'cosmosGetAddress',
+ expectedAddress: 'cosmos1gcstv0akxdxuajmycg8az3tautn05y296p4n4z',
+ },
+ {
+ method: 'evmGetAddress',
+ expectedAddress: '0xb2e8841e85c5704A809FE7Bf9B7A03CC03c8c08C',
+ },
+ {
+ method: 'kaspaGetAddress',
+ expectedAddress: 'kaspa:qq9mcg8rhx3gn5e2kfsdjccfjeuhajlypapart7zfsypg74vahnnk7sl3c4r7',
+ },
+ {
+ method: 'nearGetAddress',
+ expectedAddress: '86d85cf0c5c9304993f5a5138eff05b4483dae69c1be2ca2e426d44cd80ef3f2',
+ },
+ {
+ method: 'nexaGetAddress',
+ expectedAddress: 'nexa:nqtsq5g5u7z4appsd3n97nc5kut29yh52a04mdvf4xn0m7w8',
+ },
+ {
+ method: 'polkadotGetAddress',
+ expectedAddress: '1iqYnHQPWvcC2fetJivvurquj5FRZSGGqkKc9cPVqJgtfXH',
+ },
+ {
+ method: 'xrpGetAddress',
+ expectedAddress: 'raTsST5mBfx4FZ3xVWcb8bbVp2FjB2EYsq',
+ },
+ {
+ method: 'solGetAddress',
+ expectedAddress: '5zghGgs1YfLtWAUNtanLe1evHp5FEgAfYmFNMT8vADAf',
+ },
+ {
+ method: 'starcoinGetAddress',
+ expectedAddress: '0xbd4bc3d248e7952af7ca651766293d52',
+ },
+ {
+ method: 'suiGetAddress',
+ expectedAddress: '0x46b7cc10929fb4f63cdfdb00bdb4fc9628f8a0cbbc08f4201adfc076c706b958',
+ },
+ {
+ method: 'tronGetAddress',
+ expectedAddress: 'TF2hetHtsw8FgsSEbDdW46VuGvPuVtGTEj',
+ },
+ ],
+} as TestCase;
diff --git a/packages/connect-examples/expo-example/src/components/AddressTest/data/passphrase12_empty.ts b/packages/connect-examples/expo-example/src/components/AddressTest/data/passphrase12_empty.ts
new file mode 100644
index 000000000..3d4965221
--- /dev/null
+++ b/packages/connect-examples/expo-example/src/components/AddressTest/data/passphrase12_empty.ts
@@ -0,0 +1,90 @@
+import type { TestCase } from './types';
+
+export default {
+ name: 'passphrase12-empty',
+ passphrase: '',
+ passphraseState: 'mpERhxif9Eaovvh3PfStVMDKrwCc8ELwS9',
+ description:
+ '详见 https://onekeyhq.atlassian.net/wiki/spaces/ONEKEY/pages/259227649/passphrase-12',
+ data: [
+ {
+ method: 'algoGetAddress',
+ expectedAddress: 'H2YV7OSMNOGAE4ZZDE27SIPAV27AH6TMCTMEPKEOP23ACJHCXHFFFSQDKQ',
+ },
+ {
+ method: 'aptosGetAddress',
+ expectedAddress: '0xd5fe41294bfcc0a75d4ccfff0e9f0edfeb55655f55ab63709b2d574d685df896',
+ },
+ {
+ method: 'btcGetAddress',
+ params: {
+ path: "m/44'/0'/0'/0/0",
+ },
+ expectedAddress: '1BwB5Ccg2bpiaeDZVGe4C9ZfEaKsAdo5QP',
+ },
+ {
+ method: 'btcGetAddress',
+ params: {
+ path: "m/49'/0'/0'/0/0",
+ },
+ expectedAddress: '3ABPiv2fTPqfxZ8FFGc9RwKVAqRHrLdGtq',
+ },
+ {
+ method: 'cardanoGetAddress',
+ expectedAddress:
+ 'addr1qxcmtg5ynpglewg99tazga5ldg8meev65udzq8ytkknsp2ehs88lvux5enct3grg69z74jw626apjnscc8gqpxr7f2xqh4q87w',
+ },
+ {
+ method: 'confluxGetAddress',
+ expectedAddress: 'cfx:aat74vz8k8f6m9mues4cfgd3785hmswjvu6jgbnh47',
+ },
+ {
+ method: 'cosmosGetAddress',
+ expectedAddress: 'cosmos1k786mn207hngdhena6zzcz9uvastmzu6dv4xfa',
+ },
+ {
+ method: 'evmGetAddress',
+ expectedAddress: '0x6b0d57bF95EaBC628c4F75787F6C34E1557636A0',
+ },
+ {
+ method: 'kaspaGetAddress',
+ expectedAddress: 'kaspa:qza30x4puc9cdcrraeysextzjqdsfymvnw7cqq6gr6qps67yasg5ypgu85evv',
+ },
+ {
+ method: 'nearGetAddress',
+ expectedAddress: '6ec13fd902ec7a5889306f11f9271016944f6fade5ee5c4f82a7b183e1d2afb3',
+ },
+ {
+ method: 'nemGetAddress',
+ expectedAddress: '',
+ },
+ {
+ method: 'nexaGetAddress',
+ expectedAddress: 'nexa:nqtsq5g5efrq0d0gp9s3zatjcrpcesvawxm588arnywwkley',
+ },
+ {
+ method: 'polkadotGetAddress',
+ expectedAddress: '15UazL3RuRbu9CQX55hZ74K2kQtKZwBoi1YPQTWPv5n7QxLE',
+ },
+ {
+ method: 'xrpGetAddress',
+ expectedAddress: 'rGnrDDju6H3JGP8PAcnMs1JKioEba8iWs1',
+ },
+ {
+ method: 'solGetAddress',
+ expectedAddress: 'B5tqDNGk8kfdVwv3BMui6bSKnGwAe4hUchc86fjkfNTX',
+ },
+ {
+ method: 'starcoinGetAddress',
+ expectedAddress: '0x98c4cb28bb180d213799f01dc6568113',
+ },
+ {
+ method: 'suiGetAddress',
+ expectedAddress: '0x16edeeb71fc7dfb39a83c36df4db6972112ebdd9d09a6e082938d01d9bb65e90',
+ },
+ {
+ method: 'tronGetAddress',
+ expectedAddress: 'TVaY1kz1gqbyGETTaLTnrdhusVuiFCUNfR',
+ },
+ ],
+} as TestCase;
diff --git a/packages/connect-examples/expo-example/src/components/AddressTest/data/passphrase18_1.ts b/packages/connect-examples/expo-example/src/components/AddressTest/data/passphrase18_1.ts
new file mode 100644
index 000000000..895b1760f
--- /dev/null
+++ b/packages/connect-examples/expo-example/src/components/AddressTest/data/passphrase18_1.ts
@@ -0,0 +1,79 @@
+import type { TestCase } from './types';
+
+export default {
+ name: 'passphrase18-1',
+ passphrase: 'fhsdkhf^&%#4366ghhj<<>>$$$',
+ passphraseState: 'mkXCUesRyVY1hZCemmXxGqEne6Jc7u9LbY',
+ description:
+ '详见 https://onekeyhq.atlassian.net/wiki/spaces/ONEKEY/pages/394297345/passphrase-18',
+ data: [
+ {
+ method: 'algoGetAddress',
+ expectedAddress: 'BCYQOVCEJX3DIYHVLNKGQ7Y6PFTAEOGJCSA3GHGV4NKI7OSUOKLO2EEQCA',
+ },
+ {
+ method: 'aptosGetAddress',
+ expectedAddress: '0xa15f15b47dbb2dd0f1f2ef66fdc4ee3b7ba49724124a24462101c83ebbc9bcdd',
+ },
+ {
+ method: 'btcGetAddress',
+ params: {
+ path: "m/49'/0'/0'/0/0",
+ },
+ expectedAddress: '3JpbbRQJUnJX3rUxurNo7U87kdZkCKXNQ2',
+ },
+ {
+ method: 'cardanoGetAddress',
+ expectedAddress:
+ 'addr1qyd2h62unwxgq7mdymq0xhh527yh4vpen59lanwy9l606zenfp5atx578pc4hufgmstq4p922mckv777nu8lwnkkcjmqltjjxy',
+ },
+ {
+ method: 'confluxGetAddress',
+ expectedAddress: 'cfx:aaseu43u6fxtj0ut37evrysyfbaa172tz60dzx9d9w',
+ },
+ {
+ method: 'cosmosGetAddress',
+ expectedAddress: 'cosmos1sy7tcq4nnnf9naxzg8fysg2cyumlxwwgr82vkj',
+ },
+ {
+ method: 'evmGetAddress',
+ expectedAddress: '0x570959B3553927DCd0Ce93D5b0D9b99Cd1542EF0',
+ },
+ {
+ method: 'kaspaGetAddress',
+ expectedAddress: 'kaspa:qpd5hrfac9v37xxsg37g3kcdddaangaf4hesanvv9f2hnuftemw9vx04dc52c',
+ },
+ {
+ method: 'nearGetAddress',
+ expectedAddress: 'e0d6b78740262aa704f507cfc33dc1131256cd5355460ff52a6a2fe9a949ea55',
+ },
+ {
+ method: 'nexaGetAddress',
+ expectedAddress: 'nexa:nqtsq5g5cet2qn2x40gu552rra356qgt2duzmqpxv57kd9we',
+ },
+ {
+ method: 'polkadotGetAddress',
+ expectedAddress: '15qYhNQ88zziabtRG1P9G8ctX7N5o7ZPYdTsaLsPVpkHnQDK',
+ },
+ {
+ method: 'xrpGetAddress',
+ expectedAddress: 'rLuE79ZERXu5eQNSgRm7KkQ1gTdFV5YCcs',
+ },
+ {
+ method: 'solGetAddress',
+ expectedAddress: '5iinGEhrwhw3o4Hi7BdLzrKMsMhuxfi6WQcDLk2BEJTx',
+ },
+ {
+ method: 'starcoinGetAddress',
+ expectedAddress: '0x8096a9555942b6525c2abe9d4cec7105',
+ },
+ {
+ method: 'suiGetAddress',
+ expectedAddress: '0x6fbe51414abaeeabdf227a2f93c9db89605aa1a6585268fd06f164859172d4fa',
+ },
+ {
+ method: 'tronGetAddress',
+ expectedAddress: 'TN5feHMrq2RbdpGoSL4Tc5VYnGxwBdpJSv',
+ },
+ ],
+} as TestCase;
diff --git a/packages/connect-examples/expo-example/src/components/AddressTest/data/passphrase18_2.ts b/packages/connect-examples/expo-example/src/components/AddressTest/data/passphrase18_2.ts
new file mode 100644
index 000000000..573291423
--- /dev/null
+++ b/packages/connect-examples/expo-example/src/components/AddressTest/data/passphrase18_2.ts
@@ -0,0 +1,79 @@
+import type { TestCase } from './types';
+
+export default {
+ name: 'passphrase18-2',
+ passphrase: '7789$$$add@@R@H',
+ passphraseState: 'mp5EXTXF5h4QB2APmiRSEBi1xAX3H5ga3B',
+ description:
+ '详见 https://onekeyhq.atlassian.net/wiki/spaces/ONEKEY/pages/394297345/passphrase-18',
+ data: [
+ {
+ method: 'algoGetAddress',
+ expectedAddress: 'TQ636VDRJBVGZ2II62TKZ3SBWX2UNRXUWQSPUTQHS6NSOTMTMDLQQV5QCQ',
+ },
+ {
+ method: 'aptosGetAddress',
+ expectedAddress: '0x0c620f4ed3ac048c24f2c6295d3923645ec169659e7cdccc2b1b63fc8be22ea1',
+ },
+ {
+ method: 'btcGetAddress',
+ params: {
+ path: "m/49'/0'/0'/0/0",
+ },
+ expectedAddress: '3EsxQmYmQ33cE22KvJUyr8xv58D99rPfYz',
+ },
+ {
+ method: 'cardanoGetAddress',
+ expectedAddress:
+ 'addr1qy0g467up0f909g2pq0uftmfclc59u7u6lmajr0sxytynxkjsd4wtyvthcl7z4ftj6c90evyrqsk2rvvnqd0etzda3jqz6rd54',
+ },
+ {
+ method: 'confluxGetAddress',
+ expectedAddress: 'cfx:aam6hz637w2xws8f9vfgjv3ycd2w8gt8pe3p01abcm',
+ },
+ {
+ method: 'cosmosGetAddress',
+ expectedAddress: 'cosmos1crcprdmm5jy0uka5wrufd4pgtqgegqwggftyd6',
+ },
+ {
+ method: 'evmGetAddress',
+ expectedAddress: '0x6d64B86b387fBfE817C120F77D613ed0c2e7444D',
+ },
+ {
+ method: 'kaspaGetAddress',
+ expectedAddress: 'kaspa:qpzg4ch0ytz053n89e3pyun52qgje2mwpy3exevg48ryts2d6wscu3x9a227j',
+ },
+ {
+ method: 'nearGetAddress',
+ expectedAddress: '15d40738920caf7666f624983d35b760be1196f8689d037e706d8512b00cef13',
+ },
+ {
+ method: 'nexaGetAddress',
+ expectedAddress: 'nexa:nqtsq5g547w6dfzh9rqpgcfthmurxd9kn4543x6aw84j4sga',
+ },
+ {
+ method: 'polkadotGetAddress',
+ expectedAddress: '12E5Nw4J8oitXCHkBoT5qu8doCK7b9tdTgBtFiQkPcNZXjEy',
+ },
+ {
+ method: 'xrpGetAddress',
+ expectedAddress: 'rLWgabVpnrdXVb8sVc5E7Td85rSQs3vcNv',
+ },
+ {
+ method: 'solGetAddress',
+ expectedAddress: '8rf3KDom9vnYiXZz7maZKkXUB5j5nj3tC7araPpTtamK',
+ },
+ {
+ method: 'starcoinGetAddress',
+ expectedAddress: '0x59ab9db9ac50ac983b88fef8166df41d',
+ },
+ {
+ method: 'suiGetAddress',
+ expectedAddress: '0x67ab654ad5c71d55152771c3f8ff3d3a9bf6500dbc11889ad35ed247fbc8c03b',
+ },
+ {
+ method: 'tronGetAddress',
+ expectedAddress: 'TPFaTZwCwSxtXf8CCezdo3Wt9LKt1zbzSx',
+ },
+ ],
+} as TestCase;
diff --git a/packages/connect-examples/expo-example/src/components/AddressTest/data/passphrase18_3.ts b/packages/connect-examples/expo-example/src/components/AddressTest/data/passphrase18_3.ts
new file mode 100644
index 000000000..cea331a00
--- /dev/null
+++ b/packages/connect-examples/expo-example/src/components/AddressTest/data/passphrase18_3.ts
@@ -0,0 +1,79 @@
+import type { TestCase } from './types';
+
+export default {
+ name: 'passphrase18-3',
+ passphrase: '1111111111',
+ passphraseState: 'mvQfzqgVRFLTvbuDxqLy9dmErXtfsCba95',
+ description:
+ '详见 https://onekeyhq.atlassian.net/wiki/spaces/ONEKEY/pages/394297345/passphrase-18',
+ data: [
+ {
+ method: 'algoGetAddress',
+ expectedAddress: 'MNSTMOZZGY4WVQABO47VAQU5CPGB34GCK3UAKVFMD5B7LKJKROWWHTBEXI',
+ },
+ {
+ method: 'aptosGetAddress',
+ expectedAddress: '0x907fbff9a2d48f42cfa9d53c2e72b11c9bec59ab673909c0afacce6e4570c974',
+ },
+ {
+ method: 'btcGetAddress',
+ params: {
+ path: "m/49'/0'/0'/0/0",
+ },
+ expectedAddress: '3J15EHPWxzUhioHKyPbyDFoocFVkuwnJ68',
+ },
+ {
+ method: 'cardanoGetAddress',
+ expectedAddress:
+ 'addr1qx74tnagtlldcpckk29ddtfqhnh5zm6ytwxrjd4a6yjwse5zdhhngplqg7s6a6ke8a69mgt7jamjucrdnqfrk0gtf5js7wu3qu',
+ },
+ {
+ method: 'confluxGetAddress',
+ expectedAddress: 'cfx:aapkpzdhp8ejmtf32rpfxgkvbajtch2csya14d3gvw',
+ },
+ {
+ method: 'cosmosGetAddress',
+ expectedAddress: 'cosmos1z40d57a535mjaxq03gq0xrht6vuufz2sadcq0e',
+ },
+ {
+ method: 'evmGetAddress',
+ expectedAddress: '0x9C6A828fDcdF3CE9E2A73Cd08E75aFAdFd192455',
+ },
+ {
+ method: 'kaspaGetAddress',
+ expectedAddress: 'kaspa:qqqw2ppwncl3xj92zwlfz5kv7ntlhxszzkc6rq9uj6gavzwch5an2jzks79dl',
+ },
+ {
+ method: 'nearGetAddress',
+ expectedAddress: '7577574876da6869e1650e797d53b35ab5cad403be31ca7a4afad489d0a0f5dd',
+ },
+ {
+ method: 'nexaGetAddress',
+ expectedAddress: 'nexa:nqtsq5g5v8cc85aqll60udr6rjay84jwt5zx7gd7znwne9x3',
+ },
+ {
+ method: 'polkadotGetAddress',
+ expectedAddress: '12ECLjH1WKhn7m1AVJ3fR4oyBYjMniJsQrkYzHDUPhLbEJEj',
+ },
+ {
+ method: 'xrpGetAddress',
+ expectedAddress: 'rEU6xNwgF9ZjRrQsTTDkrYcM9wbfBojUzS',
+ },
+ {
+ method: 'solGetAddress',
+ expectedAddress: 'C3qeETiK6PfaZGsb9wBnmLFKjwkan3haViDModwCoBDr',
+ },
+ {
+ method: 'starcoinGetAddress',
+ expectedAddress: '0x3ecce386f3008b00ea447641010cca3b',
+ },
+ {
+ method: 'suiGetAddress',
+ expectedAddress: '0x8f18b7f1a1e169b6fbb8d14997d7640f5150e23eb97c4355fca9a6dfc9b5b39a',
+ },
+ {
+ method: 'tronGetAddress',
+ expectedAddress: 'TGc9gZz1pirj4Mkvdc6VUn5t3oqPkwbYRB',
+ },
+ ],
+} as TestCase;
diff --git a/packages/connect-examples/expo-example/src/components/AddressTest/data/passphrase18_4.ts b/packages/connect-examples/expo-example/src/components/AddressTest/data/passphrase18_4.ts
new file mode 100644
index 000000000..aa58d85f8
--- /dev/null
+++ b/packages/connect-examples/expo-example/src/components/AddressTest/data/passphrase18_4.ts
@@ -0,0 +1,79 @@
+import type { TestCase } from './types';
+
+export default {
+ name: 'passphrase18-4',
+ passphrase: 'hhhopopuuuKKllY',
+ passphraseState: 'mfnExSMFHZnn29pgLrakRimPJU5MgpjMS7',
+ description:
+ '详见 https://onekeyhq.atlassian.net/wiki/spaces/ONEKEY/pages/394297345/passphrase-18',
+ data: [
+ {
+ method: 'algoGetAddress',
+ expectedAddress: 'XF5PYJONYTZ6O3J6PGRBWFJ5333JEVN7K7P474R7T7OGIBG5LUNIDNO5KM',
+ },
+ {
+ method: 'aptosGetAddress',
+ expectedAddress: '0xdad119026e421d1a9f0b25c6e6f59d4167aa9bac38dae99d95d368c636027876',
+ },
+ {
+ method: 'btcGetAddress',
+ params: {
+ path: "m/49'/0'/0'/0/0",
+ },
+ expectedAddress: '37uN5tEmB6P8bSZJzskksmNGsPeqFQE9qG',
+ },
+ {
+ method: 'cardanoGetAddress',
+ expectedAddress:
+ 'addr1qx3ulfr42chfa2er55u7z6q9r33mk27hpwv8vxmve9tc9zpxj39q5zqclahavudsq40zl8qa4kfs3egjvkfgzjgfw7csxmaadd',
+ },
+ {
+ method: 'confluxGetAddress',
+ expectedAddress: 'cfx:aannunsr0pzjp5e539pa78exu9kt6jm5z6sdgpv7dz',
+ },
+ {
+ method: 'cosmosGetAddress',
+ expectedAddress: 'cosmos1nz6ueq9tj2cgj2ppz5hvy23j8qg0hf2g5yvq2y',
+ },
+ {
+ method: 'evmGetAddress',
+ expectedAddress: '0xd7DF1eD6c4A3944746976CB3ff6AdcF7968c8883',
+ },
+ {
+ method: 'kaspaGetAddress',
+ expectedAddress: 'kaspa:qqg7rd4sdawcsczy6xez20dgml0dgq0qpexqneeu8d4pzpfw5l3t6eh8l5n4j',
+ },
+ {
+ method: 'nearGetAddress',
+ expectedAddress: 'bad8749880d12bfd64b23a77b6dc9092ff861a0cf9e0d8171d7be9377bea6b2d',
+ },
+ {
+ method: 'nexaGetAddress',
+ expectedAddress: 'nexa:nqtsq5g50d574l8gannkyj8za0cr0pklsye7c2yg3pr5cxg0',
+ },
+ {
+ method: 'polkadotGetAddress',
+ expectedAddress: '12BhN7ErWi1kH4maGh9putnRpESWT9ojp6yMtoaQiC8F4G5z',
+ },
+ {
+ method: 'xrpGetAddress',
+ expectedAddress: 'r91m4v3kd9wkyxq5nSKjqSDLxGpybu3BGh',
+ },
+ {
+ method: 'solGetAddress',
+ expectedAddress: '5X2fQYa7s5DSKqxBEMiD2dVUMk3dMaU83sfUzR1DmoqY',
+ },
+ {
+ method: 'starcoinGetAddress',
+ expectedAddress: '0x124f6dd879d4ea171766bf8be8a3463c',
+ },
+ {
+ method: 'suiGetAddress',
+ expectedAddress: '0xf9ea13c6cb9c5f7c1b56e858e95275dcee4a23ede83bd2f827754dd33b17884a',
+ },
+ {
+ method: 'tronGetAddress',
+ expectedAddress: 'TXdSxWpnaX2qWQzhmqNxDjZrZH6TAkFBry',
+ },
+ ],
+} as TestCase;
diff --git a/packages/connect-examples/expo-example/src/components/AddressTest/data/passphrase24_1.ts b/packages/connect-examples/expo-example/src/components/AddressTest/data/passphrase24_1.ts
new file mode 100644
index 000000000..5bcaac2e5
--- /dev/null
+++ b/packages/connect-examples/expo-example/src/components/AddressTest/data/passphrase24_1.ts
@@ -0,0 +1,79 @@
+import type { TestCase } from './types';
+
+export default {
+ name: 'passphrase24-1',
+ passphrase: '0987654321QWERtyuioplkjhgfdsamnbvcxz@!###$$$%%%^&*',
+ passphraseState: 'msnViVktp8SWFH4hjf5EYmXzTAiD6J89AB',
+ description:
+ '详见 https://onekeyhq.atlassian.net/wiki/spaces/ONEKEY/pages/394297355/passphrase-24',
+ data: [
+ {
+ method: 'algoGetAddress',
+ expectedAddress: '6CUPQI562HW2QJZKL3J4CGDWGGUXP63GXLEK3WDW6OZR6LXCLK45XBC3AQ',
+ },
+ {
+ method: 'aptosGetAddress',
+ expectedAddress: '0xf78d0fd8cf979446c9b4f7764b47dcc7bea189ea61dae6a4ec1e314702d4e8fc',
+ },
+ {
+ method: 'btcGetAddress',
+ params: {
+ path: "m/49'/0'/0'/0/0",
+ },
+ expectedAddress: '3FmHVmJUngzT6da4dnXfLPdV9JZxLqrVPa',
+ },
+ {
+ method: 'cardanoGetAddress',
+ expectedAddress:
+ 'addr1q9zd2w0crrz3lh2p86l8eddu78fk5qfjpkxl4pv29nxsltwdsjkkjvvvyl5du32egvxh3734r224ldkz5eak50q6jecsjd2rea',
+ },
+ {
+ method: 'confluxGetAddress',
+ expectedAddress: 'cfx:aam84jxcugujedp4v3h3xzk9g7n5bzfdhpe89yw543',
+ },
+ {
+ method: 'cosmosGetAddress',
+ expectedAddress: 'cosmos18q7nk2h07meddk9pxxdyye00rjru0xngs5yw2z',
+ },
+ {
+ method: 'evmGetAddress',
+ expectedAddress: '0xC97cc00B8c7D082792c61Da5865fe61e67A92b53',
+ },
+ {
+ method: 'kaspaGetAddress',
+ expectedAddress: 'kaspa:qq97t8trju0a6s35rnzg2e35t5ar4gv08la9ktkqzxpsmanfrhz72ajf6s8q0',
+ },
+ {
+ method: 'nearGetAddress',
+ expectedAddress: '741dddd0ca63cf16b31a9d4177d960d871080689bf16820cfba57e543c404129',
+ },
+ {
+ method: 'nexaGetAddress',
+ expectedAddress: 'nexa:nqtsq5g59tfd29uyzsj7r032cyew7yep6x7rdjhs2w96re2s',
+ },
+ {
+ method: 'polkadotGetAddress',
+ expectedAddress: '15oAdv2h7nKXgsJe38S6aVYmVy7i6g52Szg4CnxNUJhabWh8',
+ },
+ {
+ method: 'xrpGetAddress',
+ expectedAddress: 'rP52k9jtCWmzifPe7x7o7L4EtNWSgEAVED',
+ },
+ {
+ method: 'solGetAddress',
+ expectedAddress: 'skkrKcA2nRX3Dv7sqjpFNqkmU4E9rAEJ8KrcUa8Pxgj',
+ },
+ {
+ method: 'starcoinGetAddress',
+ expectedAddress: '0x43ce36cb291a46e885a8b1508b6f7604',
+ },
+ {
+ method: 'suiGetAddress',
+ expectedAddress: '0x43aac93a4c8c7396cd948c3b4e0cbe65bce0d0c2c1b7e8bf0bc468f18c240a6f',
+ },
+ {
+ method: 'tronGetAddress',
+ expectedAddress: 'TPYoBKf3TKfjKLWy3zKhZtcYRc827HHpVW',
+ },
+ ],
+} as TestCase;
diff --git a/packages/connect-examples/expo-example/src/components/AddressTest/data/passphrase24_2.ts b/packages/connect-examples/expo-example/src/components/AddressTest/data/passphrase24_2.ts
new file mode 100644
index 000000000..624edf865
--- /dev/null
+++ b/packages/connect-examples/expo-example/src/components/AddressTest/data/passphrase24_2.ts
@@ -0,0 +1,79 @@
+import type { TestCase } from './types';
+
+export default {
+ name: 'passphrase24-2',
+ passphrase: '7789$$$add@@R@H',
+ passphraseState: 'mrtG2eMw47hUawxDbL2Y1uYedXsGUnKuPb',
+ description:
+ '详见 https://onekeyhq.atlassian.net/wiki/spaces/ONEKEY/pages/394297355/passphrase-24',
+ data: [
+ {
+ method: 'algoGetAddress',
+ expectedAddress: 'SYL3HUBX7XTCEJVPQY4PFPH46YQJKTQZT74EFSSJ7OZMQ7H2NMG6ZO3A3Y',
+ },
+ {
+ method: 'aptosGetAddress',
+ expectedAddress: '0xa993303e9cd00348e84bc055ddeca98af1755b318356293ffa53abee724fdd75',
+ },
+ {
+ method: 'btcGetAddress',
+ params: {
+ path: "m/49'/0'/0'/0/0",
+ },
+ expectedAddress: '39NidWdTWiGJnaMpw1TJzqNitgMnJtGSaq',
+ },
+ {
+ method: 'cardanoGetAddress',
+ expectedAddress:
+ 'addr1qyes4qc4ezs0wgv5jukl8nhercxjkr5upn4lpc7rshpy8umqlfhdp9j944ur5f8dpe9rk6w43azsezwf0qdy7xk2f2ksjqjtys',
+ },
+ {
+ method: 'confluxGetAddress',
+ expectedAddress: 'cfx:aas6d9dbnf4186tggkkv1xrh0jhdm1tr9e5bjhds8g',
+ },
+ {
+ method: 'cosmosGetAddress',
+ expectedAddress: 'cosmos1j3y3l89s39q0tp2asv28vz78mu3ul007dnesug',
+ },
+ {
+ method: 'evmGetAddress',
+ expectedAddress: '0x78AD0C8eA9B2675412d3cb6Df7118361F99AbEE7',
+ },
+ {
+ method: 'kaspaGetAddress',
+ expectedAddress: 'kaspa:qp4wjaa7x3umuj6kzmq9y4y74qcc0yer7vmnt4k97hg8sfwjl8tzg4spl4nnc',
+ },
+ {
+ method: 'nearGetAddress',
+ expectedAddress: 'ae114c21379f997c1e3ea18cfdaa4161f064a35e3ee26998f46b62679cf18848',
+ },
+ {
+ method: 'nexaGetAddress',
+ expectedAddress: 'nexa:nqtsq5g567xpgu5jsy4xx9xs0n22rscv4qa6c2e9s356q798',
+ },
+ {
+ method: 'polkadotGetAddress',
+ expectedAddress: '152S5JD5Y19TJs3RNJSk9NjwJzEPb8kPp9ya2Eu2y9kfxFyY',
+ },
+ {
+ method: 'xrpGetAddress',
+ expectedAddress: 'rNLUUCJV2wSLfZ8oAuSzyGsTW9oWkVd4mL',
+ },
+ {
+ method: 'solGetAddress',
+ expectedAddress: '7kfn2Vg5B65eGUxM6SnZ9w6BVkpRnhtaywn8qYocn1Zb',
+ },
+ {
+ method: 'starcoinGetAddress',
+ expectedAddress: '0x727192262d38faba3541431206dc74f9',
+ },
+ {
+ method: 'suiGetAddress',
+ expectedAddress: '0x9e801e1ae80b80523867bf565125231b609fe94d2bd57bc2a566a86a62832213',
+ },
+ {
+ method: 'tronGetAddress',
+ expectedAddress: 'TESZBiP55xKz6DcQYXwi8PVFjueAwNj5AF',
+ },
+ ],
+} as TestCase;
diff --git a/packages/connect-examples/expo-example/src/components/AddressTest/data/passphrase24_3.ts b/packages/connect-examples/expo-example/src/components/AddressTest/data/passphrase24_3.ts
new file mode 100644
index 000000000..d09032998
--- /dev/null
+++ b/packages/connect-examples/expo-example/src/components/AddressTest/data/passphrase24_3.ts
@@ -0,0 +1,79 @@
+import type { TestCase } from './types';
+
+export default {
+ name: 'passphrase24-3',
+ passphrase: "ADxvB0383*3*%^%~./,';L",
+ passphraseState: 'n1Kg8udanaFFE48Y8im6GmgCSzSUmGHxV4',
+ description:
+ '详见 https://onekeyhq.atlassian.net/wiki/spaces/ONEKEY/pages/394297355/passphrase-24',
+ data: [
+ {
+ method: 'algoGetAddress',
+ expectedAddress: 'DW6ZSEO3BYTPGFGWLAWIWK5CHHS74XMDIDK4C4WC6NZ7EHPN5HBMU2ILGA',
+ },
+ {
+ method: 'aptosGetAddress',
+ expectedAddress: '0x2381cf671ac742b5459abf1b4d5b54e09bfd3b050b99a3a379de3479c2a5733a',
+ },
+ {
+ method: 'btcGetAddress',
+ params: {
+ path: "m/49'/0'/0'/0/0",
+ },
+ expectedAddress: '3EXCE7hMQTxS67QXhukEcruGBWStrga89L',
+ },
+ {
+ method: 'cardanoGetAddress',
+ expectedAddress:
+ 'addr1q840pns0w6rmpe2h4lh8tltx7tt7cayzk9ymnm8w4v6gqk7r5pepx5ryse9gs42hytmschdjmv0qsrv4rs8lllysqccqxfx2zk',
+ },
+ {
+ method: 'confluxGetAddress',
+ expectedAddress: 'cfx:aam9b3vpzvj0v6hhrfnd214gfesvk8dbv2d8jnj2xx',
+ },
+ {
+ method: 'cosmosGetAddress',
+ expectedAddress: 'cosmos1frk93uca7jadua23au8mfqfhhez2nt565mg75k',
+ },
+ {
+ method: 'evmGetAddress',
+ expectedAddress: '0xf80A597559eE9c6b03aED9c3774554f10E468898',
+ },
+ {
+ method: 'kaspaGetAddress',
+ expectedAddress: 'kaspa:qqz98vv7rkl00vmss76mcn45t62zjnd2xpr67xf9xnhtr0dez3qs5t0tk8mkr',
+ },
+ {
+ method: 'nearGetAddress',
+ expectedAddress: 'efcdf7b580f627e1215e08855855f092f835c5ce83098fefa12ee8f0b6406044',
+ },
+ {
+ method: 'nexaGetAddress',
+ expectedAddress: 'nexa:nqtsq5g58dlygh5excmtxp2w6q33xlfpdkg6muthulw2w94f',
+ },
+ {
+ method: 'polkadotGetAddress',
+ expectedAddress: '1CvTcEz5oaUTQqC2S57LvsBegkEjh2BqoRqWjixyZhxq2bS',
+ },
+ {
+ method: 'xrpGetAddress',
+ expectedAddress: 'rNohzjkx1ZuMoV9J9DSUWSvskp8rKG5cUF',
+ },
+ {
+ method: 'solGetAddress',
+ expectedAddress: 'Fhh3QwnzYg3npyBkpD1Li1GYKJH9yRj9Lp5MsX8emfEH',
+ },
+ {
+ method: 'starcoinGetAddress',
+ expectedAddress: '0xb76507bcb761ea6946e71b7fc229d94e',
+ },
+ {
+ method: 'suiGetAddress',
+ expectedAddress: '0x110760c5e1b016330ee3bd809fe07e7ade05a6f6b0c0aca8e89779d5e52ef6b0',
+ },
+ {
+ method: 'tronGetAddress',
+ expectedAddress: 'TWVsCKw4fB59qdf1pUUKU3gCrkf6nNy5xr',
+ },
+ ],
+} as TestCase;
diff --git a/packages/connect-examples/expo-example/src/components/AddressTest/data/passphrase24_4.ts b/packages/connect-examples/expo-example/src/components/AddressTest/data/passphrase24_4.ts
new file mode 100644
index 000000000..a6dc2ad3a
--- /dev/null
+++ b/packages/connect-examples/expo-example/src/components/AddressTest/data/passphrase24_4.ts
@@ -0,0 +1,79 @@
+import type { TestCase } from './types';
+
+export default {
+ name: 'passphrase24-4',
+ passphrase: '110*4fHKZnm7@^',
+ passphraseState: 'n2NMoDFVJGpXjTDVXCy7Qu7e6YszjuGacu',
+ description:
+ '详见 https://onekeyhq.atlassian.net/wiki/spaces/ONEKEY/pages/394297355/passphrase-24',
+ data: [
+ {
+ method: 'algoGetAddress',
+ expectedAddress: 'GOTZYJYBSFWKL3BDRBLHDFKQXRULYGFBSPLEODPPOYGQIUKHYIWBTFQ5XU',
+ },
+ {
+ method: 'aptosGetAddress',
+ expectedAddress: '0x6a955493013fe2bf3900260f24477cc66f2304fac0394f8d568cae6afd33d114',
+ },
+ {
+ method: 'btcGetAddress',
+ params: {
+ path: "m/49'/0'/0'/0/0",
+ },
+ expectedAddress: '3Nwf7B1bSjcKz7soGDPW6STQmnebyPPKwR',
+ },
+ {
+ method: 'cardanoGetAddress',
+ expectedAddress:
+ 'addr1qymyswnkd8m305yd6xtp3w6fmxrxu09yynz0u800tn46j6v5cdne5dscqpy2ely6j0twfmvxjp86t6jprpp2e0q6cwssl3v63e',
+ },
+ {
+ method: 'confluxGetAddress',
+ expectedAddress: 'cfx:aanwkzb0rhs7s667g41zyfrpdecea6c6pef8rr1d23',
+ },
+ {
+ method: 'cosmosGetAddress',
+ expectedAddress: 'cosmos1fd3zpq3dwqyh43c2mj2kzmv75cr7ltk79v5sqe',
+ },
+ {
+ method: 'evmGetAddress',
+ expectedAddress: '0xd17CBA319F704054e10640f0aCab35D8b4eA5f53',
+ },
+ {
+ method: 'kaspaGetAddress',
+ expectedAddress: 'kaspa:qzyg3wjzggvd6m4vvw9g3y287ydezxmfslnkrtec9hmfcpaffpvvgsmacqzx0',
+ },
+ {
+ method: 'nearGetAddress',
+ expectedAddress: '009cb01757ea75e4e721799e52e6ae274dd70d4687e77492840c49ec030e1fa9',
+ },
+ {
+ method: 'nexaGetAddress',
+ expectedAddress: 'nexa:nqtsq5g57t02n54p942ze3whn842vfw6tzznn8aeqv70t4r3',
+ },
+ {
+ method: 'polkadotGetAddress',
+ expectedAddress: '135gMxX3ixZy7e8TRgXfuDFSaUZxR1jt1GGiALcwFiNwpL6N',
+ },
+ {
+ method: 'xrpGetAddress',
+ expectedAddress: 'r9hBimJmyijpJokPo5Xz6QKrax5vrNb2uq',
+ },
+ {
+ method: 'solGetAddress',
+ expectedAddress: 'CWJuh4diwhohFArpUSPzY9vbCWfo2vqfgUPv7LbS2gqY',
+ },
+ {
+ method: 'starcoinGetAddress',
+ expectedAddress: '0xa2452b7b5c2613b47ec45a2dd86d17a9',
+ },
+ {
+ method: 'suiGetAddress',
+ expectedAddress: '0x0a21b0b41d5bd6525c15ddec0d317bef9f113fba4f8d17c86ae00517ee9e153a',
+ },
+ {
+ method: 'tronGetAddress',
+ expectedAddress: 'TNSjas4AGT7GEdbUmSDy9akoRzVuGbr4G9',
+ },
+ ],
+} as TestCase;
diff --git a/packages/connect-examples/expo-example/src/components/AddressTest/data/types.ts b/packages/connect-examples/expo-example/src/components/AddressTest/data/types.ts
new file mode 100644
index 000000000..6f5496f5d
--- /dev/null
+++ b/packages/connect-examples/expo-example/src/components/AddressTest/data/types.ts
@@ -0,0 +1,13 @@
+export type TestCaseData = {
+ method: string;
+ params?: any;
+ expectedAddress: string;
+};
+
+export type TestCase = {
+ name: string;
+ description: string;
+ passphraseState?: string;
+ passphrase?: string;
+ data: TestCaseData[];
+};
diff --git a/packages/connect-examples/expo-example/src/components/AddressTest/index.tsx b/packages/connect-examples/expo-example/src/components/AddressTest/index.tsx
new file mode 100644
index 000000000..4957c650d
--- /dev/null
+++ b/packages/connect-examples/expo-example/src/components/AddressTest/index.tsx
@@ -0,0 +1,16 @@
+import { View } from 'react-native';
+import { DeviceProvider } from '../../provider/DeviceProvider';
+import TestAddressView from './TestAddress';
+import { styles } from '../PassphraseTest/utils';
+
+export default function AddressTestView() {
+ return (
+
+
+
+
+
+
+
+ );
+}
diff --git a/packages/connect-examples/expo-example/src/components/PassphraseTest/TestMultiWalletChangeView.tsx b/packages/connect-examples/expo-example/src/components/PassphraseTest/TestMultiWalletChangeView.tsx
index fb3fae278..20b021b1e 100644
--- a/packages/connect-examples/expo-example/src/components/PassphraseTest/TestMultiWalletChangeView.tsx
+++ b/packages/connect-examples/expo-example/src/components/PassphraseTest/TestMultiWalletChangeView.tsx
@@ -201,7 +201,9 @@ export default function TestMultiWalletChangeView() {
});
const connectId = selectedDevice?.connectId ?? '';
- const deviceId = selectedDevice?.features?.device_id ?? '';
+ // refresh device
+ const featuresRes = await SDK.getFeatures(connectId);
+ const deviceId = featuresRes.payload?.device_id ?? '';
SDK.on(UI_EVENT, (message: CoreMessage) => {
console.log('TopLEVEL EVENT ===>>>>: ', message);
@@ -364,13 +366,7 @@ export default function TestMultiWalletChangeView() {
done: true,
payload: '测试结果正确',
});
- }, [
- SDK,
- changeWalletCount,
- selectedDevice?.connectId,
- selectedDevice?.features?.device_id,
- walletParams,
- ]);
+ }, [SDK, changeWalletCount, selectedDevice?.connectId, walletParams]);
const ContentView = useMemo(() => {
console.log();
diff --git a/packages/connect-examples/expo-example/src/components/PassphraseTest/TestSessionView.tsx b/packages/connect-examples/expo-example/src/components/PassphraseTest/TestSessionView.tsx
index 52bfd994b..30a11db5c 100644
--- a/packages/connect-examples/expo-example/src/components/PassphraseTest/TestSessionView.tsx
+++ b/packages/connect-examples/expo-example/src/components/PassphraseTest/TestSessionView.tsx
@@ -34,11 +34,15 @@ export default function TestSessionView() {
const testSessionCount = useCallback(async () => {
const connectId = selectedDevice?.connectId ?? '';
- const deviceId = selectedDevice?.features?.device_id ?? '';
if (!SDK) return;
SDK.removeAllListeners(UI_EVENT);
+
+ // refresh device
+ const featuresRes = await SDK.getFeatures(connectId);
+ const deviceId = featuresRes.payload?.device_id ?? '';
+
passphraseStateList.current = [];
setTestSessionCountResult({
done: false,
@@ -78,7 +82,9 @@ export default function TestSessionView() {
hasContinue.current = true;
while (hasContinue.current) {
allowInputPassphrase.current = true;
- const passphraseStateRes = await SDK.getPassphraseState(connectId);
+ const passphraseStateRes = await SDK.getPassphraseState(connectId, {
+ initSession: true,
+ });
if (!passphraseStateRes.success) {
hasContinue.current = false;
setTestSessionCountResult({
@@ -152,7 +158,7 @@ export default function TestSessionView() {
address: addressRes.payload.address ?? '',
});
}
- }, [SDK, selectedDevice?.connectId, selectedDevice?.features?.device_id, testChain]);
+ }, [SDK, selectedDevice?.connectId, testChain]);
const ContentView = useMemo(() => {
let result;
diff --git a/packages/connect-examples/expo-example/src/components/PassphraseTest/TestWalletChangeView.tsx b/packages/connect-examples/expo-example/src/components/PassphraseTest/TestWalletChangeView.tsx
index 6ce234c3e..3cc4bae60 100644
--- a/packages/connect-examples/expo-example/src/components/PassphraseTest/TestWalletChangeView.tsx
+++ b/packages/connect-examples/expo-example/src/components/PassphraseTest/TestWalletChangeView.tsx
@@ -68,7 +68,11 @@ export default function TestWalletChangeView() {
});
const connectId = selectedDevice?.connectId ?? '';
- const deviceId = selectedDevice?.features?.device_id ?? '';
+
+ // refresh device
+ const featuresRes = await SDK.getFeatures(connectId);
+ // @ts-expect-error
+ const deviceId = featuresRes.payload?.device_id ?? '';
SDK.on(UI_EVENT, (message: CoreMessage) => {
console.log('TopLEVEL EVENT ===>>>>: ', message);
@@ -98,27 +102,30 @@ export default function TestWalletChangeView() {
}
>();
for (const item of passphraseStateList.current ?? []) {
- let passphraseState: string | undefined;
+ // let passphraseState: string | undefined;
currentPassphrase.current = item.passphrase;
- if (!item.emptyPassphraseState) {
- const passphraseStateRes = await SDK.getPassphraseState(connectId, {});
- if (!passphraseStateRes.success) {
- setTestResult({
- done: true,
- payload: `getPassphraseState failed ${passphraseStateRes?.payload?.error}`,
- });
- return;
- }
- if (!passphraseStateRes.payload) {
- setTestResult({
- done: true,
- payload: 'passphrase is not enabled on the device.',
- });
- return;
- }
-
- passphraseState = passphraseStateRes.payload;
+ // if (!item.emptyPassphraseState) {
+ const passphraseStateRes = await SDK.getPassphraseState(connectId, {
+ initSession: true,
+ useEmptyPassphrase: item.emptyPassphraseState,
+ });
+ if (!passphraseStateRes.success) {
+ setTestResult({
+ done: true,
+ payload: `getPassphraseState failed ${passphraseStateRes?.payload?.error}`,
+ });
+ return;
}
+ if (!item.emptyPassphraseState && !passphraseStateRes.payload) {
+ setTestResult({
+ done: true,
+ payload: 'passphrase is not enabled on the device.',
+ });
+ return;
+ }
+
+ const passphraseState = passphraseStateRes.payload;
+ // }
const addressRes = await requestAddress({
sdk: SDK,
@@ -198,14 +205,7 @@ export default function TestWalletChangeView() {
done: true,
payload: '测试结果正确',
});
- }, [
- SDK,
- changeWalletCount,
- selectedDevice?.connectId,
- selectedDevice?.features?.device_id,
- testChain,
- testWalletCount,
- ]);
+ }, [SDK, changeWalletCount, selectedDevice?.connectId, testChain, testWalletCount]);
const ContentView = useMemo(() => {
console.log();
diff --git a/packages/connect-examples/expo-example/src/components/PassphraseTest/index.tsx b/packages/connect-examples/expo-example/src/components/PassphraseTest/index.tsx
index 32d9ec4d7..660ccf064 100644
--- a/packages/connect-examples/expo-example/src/components/PassphraseTest/index.tsx
+++ b/packages/connect-examples/expo-example/src/components/PassphraseTest/index.tsx
@@ -1,8 +1,6 @@
import { View } from 'react-native';
-import { useContext } from 'react';
-import { DeviceProvider, useDevice } from '../../provider/DeviceProvider';
+import { DeviceProvider } from '../../provider/DeviceProvider';
import { styles } from './utils';
-import HardwareSDKContext from '../../provider/HardwareSDKContext';
import TestSessionView from './TestSessionView';
import TestWalletChangeView from './TestWalletChangeView';
import TestMultiWalletChangeView from './TestMultiWalletChangeView';
@@ -11,21 +9,12 @@ export default function PassphraseTestScreen() {
return (
-
+
+
+
+
+
);
}
-
-function PassphraseTestView() {
- const { sdk: SDK, type } = useContext(HardwareSDKContext);
- const { selectedDevice } = useDevice();
-
- return (
-
-
-
-
-
- );
-}
diff --git a/packages/connect-examples/expo-example/src/data/conflux.ts b/packages/connect-examples/expo-example/src/data/conflux.ts
index de36a72e7..e9810702e 100644
--- a/packages/connect-examples/expo-example/src/data/conflux.ts
+++ b/packages/connect-examples/expo-example/src/data/conflux.ts
@@ -9,6 +9,7 @@ const api: PlaygroundProps[] = [
title: 'Get address',
value: {
path: "m/44'/503'/0'/0/0",
+ chainId: 1029,
showOnOneKey: false,
},
},
@@ -18,14 +19,17 @@ const api: PlaygroundProps[] = [
bundle: [
{
path: "m/44'/503'/0'/0/0",
+ chainId: 1029,
showOnOneKey: false,
},
{
path: "m/44'/503'/0'/0/1",
+ chainId: 1029,
showOnOneKey: false,
},
{
path: "m/44'/503'/0'/0/2",
+ chainId: 1029,
showOnOneKey: false,
},
],
diff --git a/packages/connect-examples/expo-example/src/views/AddressTestScreen.tsx b/packages/connect-examples/expo-example/src/views/AddressTestScreen.tsx
new file mode 100644
index 000000000..45d6aef42
--- /dev/null
+++ b/packages/connect-examples/expo-example/src/views/AddressTestScreen.tsx
@@ -0,0 +1,28 @@
+import React from 'react';
+import { Button, ScrollView, StyleSheet, View } from 'react-native';
+import { useNavigation } from '@react-navigation/native';
+import AddressTestView from '../components/AddressTest';
+
+export default function AddressTestScreen() {
+ const navigation = useNavigation();
+ return (
+
+
+ {/* @ts-expect-error */}
+
+
+ );
+}
+
+const styles = StyleSheet.create({
+ container: {
+ width: '100%',
+ display: 'flex',
+ backgroundColor: '#fff',
+ alignItems: 'center',
+ justifyContent: 'center',
+ padding: 32,
+ },
+});
diff --git a/packages/connect-examples/expo-example/src/views/HomeScreen.tsx b/packages/connect-examples/expo-example/src/views/HomeScreen.tsx
index 97aab80f6..1b569da33 100644
--- a/packages/connect-examples/expo-example/src/views/HomeScreen.tsx
+++ b/packages/connect-examples/expo-example/src/views/HomeScreen.tsx
@@ -15,6 +15,11 @@ export default function HomeScreen() {
// @ts-expect-error
onPress={() => navigation.navigate('PassphraseTest')}
/>
+