diff --git a/packages/example/components/LogsContainer.tsx b/packages/example/components/LogsContainer.tsx
index 869321fc..1d9af991 100644
--- a/packages/example/components/LogsContainer.tsx
+++ b/packages/example/components/LogsContainer.tsx
@@ -65,7 +65,7 @@ export const LogsContainer = ({ bridge }: { bridge?: JsBridgeBase } = {}) => {
background: 'black',
position: 'relative',
color: 'white',
- height: 300,
+ height: 340,
overflow: 'auto',
}}
>
diff --git a/packages/example/components/PageLayout.tsx b/packages/example/components/PageLayout.tsx
new file mode 100644
index 00000000..650e76d6
--- /dev/null
+++ b/packages/example/components/PageLayout.tsx
@@ -0,0 +1,27 @@
+import Link from 'next/link';
+import styles from '../styles/PageLayout.module.css';
+import { LogsContainer } from './LogsContainer';
+
+export type PageLayoutProps = {
+ children?: React.ReactNode;
+ title: string;
+};
+
+function PageLayout({ children, title }: PageLayoutProps) {
+ return (
+
+
+
+ ← Back
+
+
{title}
+
+
{children}
+
+
+
+
+ );
+}
+
+export default PageLayout;
diff --git a/packages/example/components/aptosMartian/AptosExample.tsx b/packages/example/components/aptosMartian/AptosExample.tsx
index 634e7416..2272cc81 100644
--- a/packages/example/components/aptosMartian/AptosExample.tsx
+++ b/packages/example/components/aptosMartian/AptosExample.tsx
@@ -204,7 +204,7 @@ export default function App() {
const getTransaction = async () => {
const res = await provider.getTransaction(
- '0xbeb1f8c4e66bf0f58afca8c83338fd9a54490d46ce25fe9c8674b67f1e7bbd3a',
+ '0x407c189992aa2b5a25b3645a3dc6a8b5c9ec2792d214ab9a04b7acc6b7465a00',
);
console.log('[getTransaction]', res);
};
diff --git a/packages/example/components/sui/SuiExample.tsx b/packages/example/components/sui/SuiExample.tsx
deleted file mode 100644
index 4dbd147d..00000000
--- a/packages/example/components/sui/SuiExample.tsx
+++ /dev/null
@@ -1,267 +0,0 @@
-import React from 'react';
-import { useState, useEffect, useMemo } from 'react';
-import { ProviderSui } from '@onekeyfe/onekey-sui-provider';
-
-import { DAppList } from '../dappList/DAppList';
-import { dapps } from './dapps.config';
-import { JsonRpcProvider, MoveCallTransaction, Connection } from '@mysten/sui.js';
-import { buildTransfer } from './utils';
-
-declare global {
- interface Window {
- // @ts-expect-error
- suiWallet: ProviderSui;
- }
-}
-
-const useProvider = () => {
- const [provider, setProvider] = useState();
-
- useEffect(() => {
- const injectedProvider = window.suiWallet as ProviderSui;
- const suiProvider =
- injectedProvider ||
- new ProviderSui({
- // use mock api provider bridge for development
- // bridge: new CustomBridge(),
- });
- setProvider(suiProvider);
- }, []);
-
- return provider;
-};
-
-const INIT_MOVE_CALL: MoveCallTransaction = {
- kind: 'MoveCall',
- target: `0x0000000000000000000000000000000000000002::devnet_nft::mint`,
- typeArguments: [],
- arguments: [],
-};
-
-export default function App() {
- const provider = useProvider();
-
- const [network, setNetwork] = useState('TestNet');
- const [connected, setConnected] = useState(false);
- const [address, setAddress] = useState(null);
-
- const [moveCall, setMoveCall] = useState(INIT_MOVE_CALL);
-
- const rpcProvider = useMemo(() => {
- if (network.toLowerCase() === 'testnet') {
- return new JsonRpcProvider(
- new Connection({
- fullnode: 'https://fullnode.testnet.sui.io',
- faucet: 'https://faucet.testnet.sui.io/gas',
- }),
- );
- } else {
- return new JsonRpcProvider(
- new Connection({
- fullnode: 'https://fullnode.devnet.sui.io',
- faucet: 'https://faucet.devnet.sui.io/gas',
- }),
- );
- }
- }, [network]);
-
- useEffect(() => {
- if (!provider) return;
- // try to eagerly connect
- // provider.connect().catch((err) => {
- // err;
- // // fail silently
- // });
-
- try {
- provider.on('connect', (address: string) => {
- setConnected(true);
- setAddress(address);
- console.log(`suiWallet.on [connect] ${address}`);
- });
- } catch (e) {
- // ignore
- }
- try {
- provider.on('disconnect', () => {
- setAddress(null);
- setConnected(false);
- console.log('suiWallet.on [disconnect] 👋');
- });
- } catch (e) {
- // ignore
- }
- try {
- provider.on('networkChange', (network: string) => {
- setNetwork(network);
- console.log(`suiWallet.on [networkChange] ${network}`);
- });
- } catch (e) {
- // ignore
- }
- try {
- provider.on('accountChanged', (address: string) => {
- setAddress(address);
- setConnected(!!address);
- console.log(`suiWallet.on [accountChange] ${address}`);
- });
- } catch (e) {
- // ignore
- }
- return () => {
- void provider.disconnect();
- };
- }, [provider]);
-
- if (!provider) {
- return Could not find a provider
;
- }
-
- const hasPermissions = async () => {
- try {
- const has = await provider.hasPermissions();
- console.log('[hasPermissions]', has);
- } catch (err) {
- console.warn(err);
- console.log(`[error] hasPermissions: ${JSON.stringify(err)}`);
- }
- };
-
- const requestPermissions = async () => {
- try {
- const has = await provider.requestPermissions();
- console.log('[requestPermissions]', has);
- return has;
- } catch (err) {
- console.warn(err);
- console.log(`[error] requestPermissions: ${JSON.stringify(err)}`);
- }
- };
-
- const getAccounts = async () => {
- try {
- const accounts = await provider.getAccounts();
- console.log('[getAccounts]', accounts);
- return accounts;
- } catch (err) {
- console.warn(err);
- console.log(`[error] getAccounts: ${JSON.stringify(err)}`);
- }
- };
-
- const connectWallet = async () => {
- try {
- const has = await requestPermissions();
- if (has) {
- const accounts = await getAccounts();
- setAddress(accounts[0]?.address ?? null);
- setNetwork(network);
- setConnected(true);
-
- console.log('[connectWallet] account', accounts, network);
- } else {
- console.log('[error] connectWallet', has, network);
- }
- } catch (err) {
- console.warn(err);
- console.log(`[error] connectWallet: ${JSON.stringify(err)}`);
- }
- };
-
- const requestSuiFromFaucet = async () => {
- try {
- const faucet = await rpcProvider.requestSuiFromFaucet(address);
- console.log('[requestSuiFromFaucet] faucet success:', faucet);
- } catch (err) {
- console.warn(err);
- console.log(`[error] requestSuiFromFaucet: ${JSON.stringify(err)}`);
- }
- };
-
- const disconnectWallet = async () => {
- try {
- await provider.disconnect();
- } catch (err) {
- console.warn(err);
- console.log(`[error] disconnect: ${JSON.stringify(err)}`);
- }
- };
-
- const signAndExecuteTransaction = async () => {
- try {
- const transfer = await buildTransfer(rpcProvider, address, "0xe40a5a0133cac4e9059f58f9d2074a3386d631390e40eadb43d2606e8975f3eb", '100000');
- // const res: unknown = await provider.signAndExecuteTransactionBlock({
- // transactionBlock: transfer,
- // });
-
- // console.log('[signAndExecuteTransaction]', res);
- } catch (err) {
- console.warn(err);
- console.log(`[error] signAndExecuteTransaction: ${JSON.stringify(err)}`);
- }
- };
-
- return (
-
-
- {!provider && (
-
- Install OneKey Extension →
-
- )}
-
- {provider && connected ? (
- <>
-
-
- Network:{' '}
-
-
-
Connected as: {address}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {/**/}
- {/**/}
-
-
- >
- ) : (
- <>
-
- >
- )}
-
-
- );
-}
diff --git a/packages/example/components/sui/dapps.config.ts b/packages/example/components/sui/dapps.config.ts
deleted file mode 100644
index 90335b82..00000000
--- a/packages/example/components/sui/dapps.config.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-export const dapps = [
- {
- name: 'Cetus',
- url: 'https://app.cetus.zone/',
- },
- {
- name: 'SuiSwap',
- url: 'https://suiswap.app/',
- },
- {
- name: 'Sui Names',
- url: 'https://sui-names.com/',
- },
-];
diff --git a/packages/example/components/sui/utils.ts b/packages/example/components/sui/utils.ts
deleted file mode 100644
index a9550954..00000000
--- a/packages/example/components/sui/utils.ts
+++ /dev/null
@@ -1,79 +0,0 @@
-import { dapps } from './dapps.config';
-import {
- JsonRpcProvider,
- SUI_TYPE_ARG,
- TransactionBlock,
- SuiAddress,
- CoinStruct,
- PaginatedCoins,
-} from '@mysten/sui.js';
-
-const MAX_COINS_PER_REQUEST = 50;
-
-export const getAllCoins = async(
- provider: JsonRpcProvider,
- address: SuiAddress,
- coinType: string | null,
-): Promise => {
- let cursor: string | null = null;
- const allData: CoinStruct[] = [];
- do {
-
- const { data, nextCursor }: PaginatedCoins = await provider.getCoins({
- owner: address,
- coinType,
- cursor,
- limit: MAX_COINS_PER_REQUEST,
- });
-
- if (!data || !data.length) {
- break;
- }
-
-
- allData.push(...data);
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
- cursor = nextCursor;
- } while (cursor);
-
- return allData;
-}
-
-export const buildTransfer = async (
- provider: JsonRpcProvider,
- sender: string,
- to: string,
- amount: string,
- argType?: string,
-): Promise => {
- const recipient = to;
- const isSuiTransfer = argType == null || argType === '';
-
- const typeArg = isSuiTransfer ? SUI_TYPE_ARG : argType;
-
- const coinsData = await getAllCoins(provider, sender, typeArg);
-
- const coins = coinsData?.filter(({ lockedUntilEpoch: lock }) => !lock);
-
- const tx = new TransactionBlock();
-
- const [primaryCoin, ...mergeCoins] = coins.filter(
- (coin) => coin.coinType === typeArg,
- );
-
- if (typeArg === SUI_TYPE_ARG) {
- const coin = tx.splitCoins(tx.gas, [tx.pure(amount)]);
- tx.transferObjects([coin], tx.pure(recipient));
- } else {
- const primaryCoinInput = tx.object(primaryCoin.coinObjectId);
- if (mergeCoins.length) {
- tx.mergeCoins(
- primaryCoinInput,
- mergeCoins.map((coin) => tx.object(coin.coinObjectId)),
- );
- }
- const coin = tx.splitCoins(primaryCoinInput, [tx.pure(amount)]);
- tx.transferObjects([coin], tx.pure(recipient));
- }
- return tx;
-};
diff --git a/packages/example/components/suiStandard/SuiExample.tsx b/packages/example/components/suiStandard/SuiExample.tsx
index 7209924e..7e67cf6d 100644
--- a/packages/example/components/suiStandard/SuiExample.tsx
+++ b/packages/example/components/suiStandard/SuiExample.tsx
@@ -1,14 +1,13 @@
import React, { useCallback } from 'react';
-import { useState, useEffect, useMemo } from 'react';
-import { bytesToHex, hexToBytes } from '@noble/hashes/utils';
+import { useState, useEffect } from 'react';
+import { hexToBytes } from '@noble/hashes/utils';
import { DAppList } from '../dappList/DAppList';
import { dapps } from './dapps.config';
-import { JsonRpcProvider, Connection } from '@mysten/sui.js';
-import { buildTransfer } from '../sui/utils';
+import { TransactionBlock } from '@mysten/sui.js/transactions';
import { WalletKitProvider, ConnectButton, useWalletKit } from '@mysten/wallet-kit';
function DappTest() {
- const [network, setNetwork] = useState('TestNet');
+ const [network, setNetwork] = useState('MainNet');
const [address, setAddress] = useState();
// eslint-disable-next-line @typescript-eslint/unbound-method
@@ -20,6 +19,7 @@ function DappTest() {
signTransactionBlock,
signAndExecuteTransactionBlock,
signMessage,
+ signPersonalMessage,
} = useWalletKit();
useEffect(() => {
@@ -27,35 +27,6 @@ function DappTest() {
if (address) setAddress(address.address);
}, [accounts]);
- const rpcProvider = useMemo(() => {
- if (network.toLowerCase() === 'testnet') {
- return new JsonRpcProvider(
- new Connection({
- fullnode: 'https://fullnode.testnet.sui.io',
- faucet: 'https://faucet.testnet.sui.io/gas',
- }),
- );
- } else {
- return new JsonRpcProvider(
- new Connection({
- fullnode: 'https://fullnode.mainnet.sui.io',
- faucet: 'https://faucet.testnet.sui.io/gas',
- }),
- );
- }
- }, [network]);
-
- const requestSuiFromFaucet = async () => {
- try {
- const [address] = accounts;
- const faucet = await rpcProvider.requestSuiFromFaucet(address.address);
- console.log('[requestSuiFromFaucet] faucet success:', faucet);
- } catch (err) {
- console.warn(err);
- console.log(`[error] requestSuiFromFaucet: ${JSON.stringify(err)}`);
- }
- };
-
const _getAccounts = useCallback(() => {
try {
console.log('[getAccounts] accounts:', accounts);
@@ -77,11 +48,13 @@ function DappTest() {
const signAndExecuteTransaction = async () => {
try {
const address = accounts[0].address;
- const transfer = await buildTransfer(
- rpcProvider,
- address,
- '0xe40a5a0133cac4e9059f58f9d2074a3386d631390e40eadb43d2606e8975f3eb',
- '100000',
+
+ const transfer = new TransactionBlock();
+ transfer.setSender(address);
+ const [coin] = transfer.splitCoins(transfer.gas, [transfer.pure(100000)]);
+ transfer.transferObjects(
+ [coin],
+ transfer.pure('0xe40a5a0133cac4e9059f58f9d2074a3386d631390e40eadb43d2606e8975f3eb'),
);
const res: unknown = await signAndExecuteTransactionBlock({
transactionBlock: transfer,
@@ -99,12 +72,15 @@ function DappTest() {
const signTransaction = async () => {
try {
const address = accounts[0].address;
- const transfer = await buildTransfer(
- rpcProvider,
- address,
- '0xe40a5a0133cac4e9059f58f9d2074a3386d631390e40eadb43d2606e8975f3eb',
- '100000',
+
+ const transfer = new TransactionBlock();
+ transfer.setSender(address);
+ const [coin] = transfer.splitCoins(transfer.gas, [transfer.pure(100000)]);
+ transfer.transferObjects(
+ [coin],
+ transfer.pure('0xe40a5a0133cac4e9059f58f9d2074a3386d631390e40eadb43d2606e8975f3eb'),
);
+
const res: unknown = await signTransactionBlock({
transactionBlock: transfer,
chain: network.toLowerCase() === 'sui:testnet' ? 'sui:testnet' : 'sui:mainnet',
@@ -125,10 +101,24 @@ function DappTest() {
account: currentAccount,
});
- console.log('[signAndExecuteTransaction]', res);
+ console.log('[signMessage]', res);
} catch (err) {
console.warn(err);
- console.log(`[error] signAndExecuteTransaction: ${JSON.stringify(err)}`);
+ console.log(`[error] signMessage: ${JSON.stringify(err)}`);
+ }
+ };
+
+ const signPersonalMessageAction = async () => {
+ try {
+ const res: unknown = await signPersonalMessage({
+ message: hexToBytes('010203'),
+ account: currentAccount,
+ });
+
+ console.log('[signPersonalMessage]', res);
+ } catch (err) {
+ console.warn(err);
+ console.log(`[error] signPersonalMessage: ${JSON.stringify(err)}`);
}
};
@@ -147,7 +137,6 @@ function DappTest() {
Connected as: {address}
-
@@ -157,6 +146,9 @@ function DappTest() {
+
>
)}
diff --git a/packages/example/package.json b/packages/example/package.json
index a0e20380..5e2760e0 100644
--- a/packages/example/package.json
+++ b/packages/example/package.json
@@ -15,7 +15,7 @@
"dependencies": {
"@ethersproject/bytes": "^5.0.6",
"@metamask/onboarding": "^1.0.1",
- "@mysten/wallet-kit": "^0.4.5",
+ "@mysten/wallet-kit": "^0.7.2",
"@onekeyfe/cross-inpage-provider-core": "1.1.44",
"@onekeyfe/cross-inpage-provider-types": "1.1.44",
"@onekeyfe/onekey-aptos-provider": "1.1.44",
@@ -42,14 +42,14 @@
"bignumber.js": "^9.0.1",
"bs58": "^5.0.0",
"compare-versions": "^4.1.2",
- "console-feed": "^3.3.0",
+ "console-feed": "^3.5.0",
"eth-sig-util": "^3.0.1",
"ethereumjs-util": "^7.1.4",
"ethers": "^5.6.5",
"js-conflux-sdk": "^2.1.8",
"native-base": "^3.4.28",
"near-api-js": "^0.44.2",
- "next": "^13.4.1",
+ "next": "^13.5.6",
"react": "^18.2.0",
"react-arborist": "^3.0.2",
"react-dom": "^18.2.0",
@@ -60,19 +60,19 @@
"tweetnacl": "^1.0.3"
},
"devDependencies": {
- "@expo/config": "^7.0.1",
- "@expo/next-adapter": "^4.0.12",
- "@types/lodash": "^4.14.194",
+ "@expo/config": "^7.0.3",
+ "@expo/next-adapter": "^4.0.13",
+ "@types/lodash": "^4.14.201",
"@types/node": "17.0.18",
- "@types/react": "18.2.6",
+ "@types/react": "18.2.37",
"@types/uuid": "^8.3.4",
- "eslint": "8.40.0",
- "eslint-config-next": "13.4.1",
+ "eslint": "8.53.0",
+ "eslint-config-next": "13.5.6",
"next-compose-plugins": "^2.2.1",
"next-fonts": "^1.5.1",
- "next-transpile-modules": "^10.0.0",
+ "next-transpile-modules": "^10.0.1",
"patch-package": "^6.4.7",
"sass": "^1.51.0",
- "typescript": "4.5.5"
+ "typescript": "5.1.6"
}
}
diff --git a/packages/example/pages/algoWalletConnect/index.tsx b/packages/example/pages/algoWalletConnect/index.tsx
index 2338091c..6bfd78d3 100644
--- a/packages/example/pages/algoWalletConnect/index.tsx
+++ b/packages/example/pages/algoWalletConnect/index.tsx
@@ -1,8 +1,6 @@
import React from 'react';
import dynamic from 'next/dynamic';
-import styles from '../../styles/Home.module.css';
-import Link from 'next/link';
-import { LogsContainer } from '../../components/LogsContainer';
+import PageLayout from '../../components/PageLayout';
// injected provider works only if nextjs ssr disabled
const AlgoExample = dynamic(() => import('../../components/algoWalletConnect/AlgoExample'), {
@@ -10,16 +8,9 @@ const AlgoExample = dynamic(() => import('../../components/algoWalletConnect/Alg
});
export default function () {
- // TODO
- // TODO eslint fix: deps order, react close tag
return (
-
-
-
← Back
-
Algo Wallet Connect Dapp Example
-
-
-
-
+
+
+
);
}
diff --git a/packages/example/pages/aptos/index.tsx b/packages/example/pages/aptos/index.tsx
index 50c0a06c..98a4a5eb 100644
--- a/packages/example/pages/aptos/index.tsx
+++ b/packages/example/pages/aptos/index.tsx
@@ -1,23 +1,14 @@
import React from 'react';
import dynamic from 'next/dynamic';
-import styles from '../../styles/Home.module.css';
-import Link from 'next/link';
-import { LogsContainer } from '../../components/LogsContainer';
+import PageLayout from '../../components/PageLayout';
// injected provider works only if nextjs ssr disabled
const AptosExample = dynamic(() => import('../../components/aptos/AptosExample'), { ssr: false });
export default function () {
- // TODO
- // TODO eslint fix: deps order, react close tag
return (
-
-
-
← Back
-
Aptos Dapp Example
-
-
-
-
+
+
+
);
}
diff --git a/packages/example/pages/aptosMartian/index.tsx b/packages/example/pages/aptosMartian/index.tsx
index a2880227..25220a9f 100644
--- a/packages/example/pages/aptosMartian/index.tsx
+++ b/packages/example/pages/aptosMartian/index.tsx
@@ -1,8 +1,6 @@
import React from 'react';
import dynamic from 'next/dynamic';
-import styles from '../../styles/Home.module.css';
-import Link from 'next/link';
-import { LogsContainer } from '../../components/LogsContainer';
+import PageLayout from '../../components/PageLayout';
// injected provider works only if nextjs ssr disabled
const AptosExample = dynamic(() => import('../../components/aptosMartian/AptosExample'), {
@@ -10,16 +8,9 @@ const AptosExample = dynamic(() => import('../../components/aptosMartian/AptosEx
});
export default function () {
- // TODO
- // TODO eslint fix: deps order, react close tag
return (
-
-
-
← Back
-
Aptos Martian Dapp Example
-
-
-
-
+
+
+
);
}
diff --git a/packages/example/pages/aptosWalletconnect/index.tsx b/packages/example/pages/aptosWalletconnect/index.tsx
index 85de6426..9cdd4a1d 100644
--- a/packages/example/pages/aptosWalletconnect/index.tsx
+++ b/packages/example/pages/aptosWalletconnect/index.tsx
@@ -1,8 +1,6 @@
import React from 'react';
import dynamic from 'next/dynamic';
-import styles from '../../styles/Home.module.css';
-import Link from 'next/link';
-import { LogsContainer } from '../../components/LogsContainer';
+import PageLayout from '../../components/PageLayout';
// injected provider works only if nextjs ssr disabled
const AptosExample = dynamic(() => import('../../components/aptosWalletConnect/AptosExample'), {
@@ -10,16 +8,9 @@ const AptosExample = dynamic(() => import('../../components/aptosWalletConnect/A
});
export default function () {
- // TODO
- // TODO eslint fix: deps order, react close tag
return (
-
-
-
← Back
-
Aptos Wallet Connect Dapp Example
-
-
-
-
+
+
+
);
}
diff --git a/packages/example/pages/cardano/index.tsx b/packages/example/pages/cardano/index.tsx
index 6f051281..9da44d70 100644
--- a/packages/example/pages/cardano/index.tsx
+++ b/packages/example/pages/cardano/index.tsx
@@ -1,21 +1,16 @@
import React from 'react';
import dynamic from 'next/dynamic';
-import styles from '../../styles/Home.module.css';
-import Link from 'next/link';
-import { LogsContainer } from '../../components/LogsContainer';
+import PageLayout from '../../components/PageLayout';
// injected provider works only if nextjs ssr disabled
-const CardanoExample = dynamic(() => import('../../components/cardano/CardanoExample'), { ssr: false });
+const CardanoExample = dynamic(() => import('../../components/cardano/CardanoExample'), {
+ ssr: false,
+});
export default function () {
return (
-
-
- ← Back
-
Cardano Dapp Example
-
-
-
-
+
+
+
);
}
diff --git a/packages/example/pages/conflux/index.tsx b/packages/example/pages/conflux/index.tsx
index fd9cfa1a..d477c749 100644
--- a/packages/example/pages/conflux/index.tsx
+++ b/packages/example/pages/conflux/index.tsx
@@ -1,8 +1,6 @@
import React from 'react';
import dynamic from 'next/dynamic';
-import styles from '../../styles/Home.module.css';
-import Link from 'next/link';
-import { LogsContainer } from '../../components/LogsContainer';
+import PageLayout from '../../components/PageLayout';
const ConfluxExample = dynamic(() => import('../../components/conflux/ConfluxExample'), {
ssr: false,
@@ -10,13 +8,8 @@ const ConfluxExample = dynamic(() => import('../../components/conflux/ConfluxExa
export default function () {
return (
-
-
- ← Back
-
Conflux Dapp Example
-
-
-
-
+
+
+
);
}
diff --git a/packages/example/pages/cosmos/index.tsx b/packages/example/pages/cosmos/index.tsx
index eb24c257..6e2b0b93 100644
--- a/packages/example/pages/cosmos/index.tsx
+++ b/packages/example/pages/cosmos/index.tsx
@@ -1,23 +1,14 @@
import React from 'react';
import dynamic from 'next/dynamic';
-import styles from '../../styles/Home.module.css';
-import Link from 'next/link';
-import { LogsContainer } from '../../components/LogsContainer';
+import PageLayout from '../../components/PageLayout';
// injected provider works only if nextjs ssr disabled
const CosmosExample = dynamic(() => import('../../components/cosmos/CosmosExample'), { ssr: false });
export default function () {
- // TODO
- // TODO eslint fix: deps order, react close tag
return (
-
-
- ← Back
-
Cosmos Dapp Example
-
-
-
-
+
+
+
);
}
diff --git a/packages/example/pages/ethereum/index.tsx b/packages/example/pages/ethereum/index.tsx
index c62eb98b..fd1348b8 100644
--- a/packages/example/pages/ethereum/index.tsx
+++ b/packages/example/pages/ethereum/index.tsx
@@ -1,18 +1,14 @@
import React from 'react';
import dynamic from 'next/dynamic';
-import styles from '../../styles/Home.module.css';
-import Link from 'next/link';
+import PageLayout from '../../components/PageLayout';
// injected provider works only if nextjs ssr disabled
const EVMExample = dynamic(() => import('../../components/ethereum/EVMExample'), { ssr: false });
export default function () {
return (
-
+
+
+
);
}
diff --git a/packages/example/pages/iframe/index.tsx b/packages/example/pages/iframe/index.tsx
index aba48cf8..786b6774 100644
--- a/packages/example/pages/iframe/index.tsx
+++ b/packages/example/pages/iframe/index.tsx
@@ -1,8 +1,6 @@
import React from 'react';
import dynamic from 'next/dynamic';
-import styles from '../../styles/Home.module.css';
-import { LogsContainer } from '../../components/LogsContainer';
-import Link from 'next/link';
+import PageLayout from '../../components/PageLayout';
const IFrameHostExample = dynamic(() => import('../../components/iframe/IFrameHostExample'), {
ssr: false,
@@ -10,13 +8,8 @@ const IFrameHostExample = dynamic(() => import('../../components/iframe/IFrameHo
export default function () {
return (
-
-
- ← Back
-
HOST
-
-
-
-
+
+
+
);
}
diff --git a/packages/example/pages/index.tsx b/packages/example/pages/index.tsx
index 8eeeb064..9366d5a3 100644
--- a/packages/example/pages/index.tsx
+++ b/packages/example/pages/index.tsx
@@ -7,7 +7,7 @@ import styles from '../styles/Home.module.css';
import packageJson from '../package.json';
import { useEffect } from 'react';
import { Button } from 'native-base';
-import { Tree, NodeApi } from 'react-arborist';
+import { Tree } from 'react-arborist';
import * as uuid from 'uuid';
// const myImageLoader = ({ src, width, quality }: any) => {
@@ -101,9 +101,8 @@ const data: ITreeNodeData[] = [
{ id: uuid.v4(), name: 'DappList', href: '/dappList' },
{
id: uuid.v4(),
- name: 'Hardware SDK (coming soon)',
- href: '',
- icon: 'https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/microsoft/319/mobile-phone_1f4f1.png',
+ name: 'Hardware SDK',
+ href: 'https://hardware-example.onekeytest.com/',
},
],
},
@@ -201,16 +200,10 @@ const data: ITreeNodeData[] = [
},
{
id: uuid.v4(),
- name: 'Sui Standard (Recommend)',
+ name: 'Sui Standard',
href: '/suiStandard',
icon: 'https://onekey-asset.com/assets/sui/sui.png',
},
- {
- id: uuid.v4(),
- name: 'Sui (Deprecated)',
- href: '/sui',
- icon: 'https://onekey-asset.com/assets/sui/sui.png',
- },
{
id: uuid.v4(),
name: 'Cardano',
@@ -222,7 +215,8 @@ const data: ITreeNodeData[] = [
name: 'Cosmos',
href: '/cosmos',
icon: 'https://onekey-asset.com/assets/cosmos/cosmos.png',
- },{
+ },
+ {
id: uuid.v4(),
name: 'Polkadot',
href: '/polkadot',
@@ -254,9 +248,11 @@ const Home: NextPage = () => {
- {TreeNode as any}
EVM-chainId={chainId}
+
+ {TreeNode as any}
+