-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 168c32a
Showing
78 changed files
with
6,793 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
module.exports = { | ||
root: true, | ||
env: { browser: true, es2020: true }, | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:react-hooks/recommended', | ||
], | ||
ignorePatterns: ['dist', '.eslintrc.cjs'], | ||
parser: '@typescript-eslint/parser', | ||
plugins: ['react-refresh'], | ||
rules: { | ||
'react-refresh/only-export-components': [ | ||
'warn', | ||
{ allowConstantExport: true }, | ||
], | ||
'@typescript-eslint/no-explicit-any': [ | ||
'off' | ||
] | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
dist | ||
dist-ssr | ||
*.local | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea | ||
.DS_Store | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
module.exports = { | ||
root: true, | ||
env: { browser: true, es2020: true }, | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:react-hooks/recommended', | ||
], | ||
ignorePatterns: ['dist', '.eslintrc.cjs'], | ||
parser: '@typescript-eslint/parser', | ||
plugins: ['react-refresh'], | ||
rules: { | ||
'react-refresh/only-export-components': [ | ||
'warn', | ||
{ allowConstantExport: true }, | ||
], | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
module.exports = { | ||
root: true, | ||
env: { browser: true, es2020: true }, | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:react-hooks/recommended', | ||
], | ||
ignorePatterns: ['dist', '.eslintrc.cjs'], | ||
parser: '@typescript-eslint/parser', | ||
plugins: ['react-refresh'], | ||
rules: { | ||
'react-refresh/only-export-components': [ | ||
'warn', | ||
{ allowConstantExport: true }, | ||
], | ||
'@typescript-eslint/no-explicit-any': [ | ||
'off' | ||
] | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { useState } from 'react' | ||
import reactLogo from './assets/react.svg' | ||
import viteLogo from '/vite.svg' | ||
import './App.css' | ||
|
||
function App() { | ||
const [count, setCount] = useState(0) | ||
|
||
return ( | ||
<> | ||
<div> | ||
<a href="https://vitejs.dev" target="_blank"> | ||
<img src={viteLogo} className="logo" alt="Vite logo" /> | ||
</a> | ||
<a href="https://react.dev" target="_blank"> | ||
<img src={reactLogo} className="logo react" alt="React logo" /> | ||
</a> | ||
</div> | ||
<h1>Vite + React</h1> | ||
<div className="card"> | ||
<button onClick={() => setCount((count) => count + 1)}> | ||
count is {count} | ||
</button> | ||
<p> | ||
Edit <code>src/App.tsx</code> and save to test HMR | ||
</p> | ||
</div> | ||
<p className="read-the-docs"> | ||
Click on the Vite and React logos to learn more | ||
</p> | ||
</> | ||
) | ||
} | ||
|
||
export default App |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { useState } from 'react' | ||
|
||
export default function App() { | ||
|
||
const onConnect = () => { | ||
window | ||
} | ||
|
||
return <> | ||
|
||
<button onClick={onConnect}>connect</button> | ||
</> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { useState } from 'react' | ||
|
||
export default function App() { | ||
|
||
const onConnect = () => { | ||
window | ||
} | ||
|
||
return <> | ||
|
||
<button onClick={onConnect}>connect</button> | ||
</> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
|
||
export default function App() { | ||
|
||
const onConnect = () => { | ||
window | ||
} | ||
|
||
return <> | ||
|
||
<button onClick={onConnect}>connect</button> | ||
</> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
|
||
export default function App() { | ||
|
||
const onConnect = () => { | ||
window | ||
} | ||
|
||
return <> | ||
|
||
<button onClick={onConnect}>connect</button> | ||
</> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
export default function App() { | ||
|
||
const onConnect = () => { | ||
window | ||
} | ||
|
||
return <> | ||
|
||
<button onClick={onConnect}>connect</button> | ||
</> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
export default function App() { | ||
|
||
const onConnect = () => { | ||
window./ | ||
} | ||
|
||
return <> | ||
|
||
<button onClick={onConnect}>connect</button> | ||
</> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
export default function App() { | ||
|
||
const onConnect = () => { | ||
window | ||
} | ||
|
||
return <> | ||
|
||
<button onClick={onConnect}>connect</button> | ||
</> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { useEffect, useState } from "react" | ||
|
||
|
||
const provider = (window as any).trustWallet | ||
|
||
export default function App() { | ||
|
||
const [info, setInfo] = useState<any>({}) | ||
|
||
useEffect(() => { | ||
const onUpdateInfo = (...params: any) => { | ||
setInfo({ | ||
...params | ||
}) | ||
} | ||
|
||
provider.on('accountsChanged', onUpdateInfo) | ||
provider.on('chainChanged', onUpdateInfo) | ||
provider.on('disconnect', onUpdateInfo) | ||
|
||
return () => { | ||
provider.off('accountsChanged', onUpdateInfo) | ||
provider.off('chainChanged', onUpdateInfo) | ||
provider.off('disconnect', onUpdateInfo) | ||
} | ||
}, []) | ||
|
||
const onConnect = () => { | ||
trustWallet.request({ | ||
|
||
}) | ||
} | ||
|
||
return <> | ||
|
||
<button onClick={onConnect}>connect</button> | ||
</> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { useEffect, useState } from "react" | ||
|
||
|
||
const provider = (window as any).trustWallet | ||
|
||
export default function App() { | ||
|
||
const [info, setInfo] = useState<any>({}) | ||
|
||
useEffect(() => { | ||
const onUpdateInfo = (...params: any) => { | ||
setInfo({ | ||
...params | ||
}) | ||
} | ||
|
||
provider.on('accountsChanged', onUpdateInfo) | ||
provider.on('chainChanged', onUpdateInfo) | ||
provider.on('disconnect', onUpdateInfo) | ||
|
||
return () => { | ||
provider.off('accountsChanged', onUpdateInfo) | ||
provider.off('chainChanged', onUpdateInfo) | ||
provider.off('disconnect', onUpdateInfo) | ||
} | ||
}, []) | ||
|
||
const onConnect = () => { | ||
trustWallet.request({ | ||
|
||
}) | ||
} | ||
|
||
return <> | ||
<div>info: {info}</div> | ||
<button onClick={onConnect}>connect</button> | ||
</> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { useEffect, useState } from "react" | ||
|
||
|
||
const provider = (window as any).trustWallet | ||
|
||
export default function App() { | ||
|
||
const [info, setInfo] = useState<any>({}) | ||
|
||
useEffect(() => { | ||
const onUpdateInfo = (...params: any) => { | ||
setInfo({ | ||
...params | ||
}) | ||
} | ||
|
||
provider.on('accountsChanged', onUpdateInfo) | ||
provider.on('chainChanged', onUpdateInfo) | ||
provider.on('disconnect', onUpdateInfo) | ||
|
||
return () => { | ||
provider.off('accountsChanged', onUpdateInfo) | ||
provider.off('chainChanged', onUpdateInfo) | ||
provider.off('disconnect', onUpdateInfo) | ||
} | ||
}, []) | ||
|
||
const onConnect = () => { | ||
provider.request({ | ||
|
||
}) | ||
} | ||
|
||
return <> | ||
<div>info: {info}</div> | ||
<button onClick={onConnect}>connect</button> | ||
</> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { useEffect, useState } from "react" | ||
|
||
|
||
const provider = (window as any).trustWallet | ||
|
||
export default function App() { | ||
|
||
const [info, setInfo] = useState<any>({}) | ||
|
||
useEffect(() => { | ||
const onUpdateInfo = (...params: any) => { | ||
setInfo({ | ||
...params | ||
}) | ||
} | ||
|
||
provider.on('accountsChanged', onUpdateInfo) | ||
provider.on('chainChanged', onUpdateInfo) | ||
provider.on('disconnect', onUpdateInfo) | ||
|
||
return () => { | ||
provider.off('accountsChanged', onUpdateInfo) | ||
provider.off('chainChanged', onUpdateInfo) | ||
provider.off('disconnect', onUpdateInfo) | ||
} | ||
}, []) | ||
|
||
const onConnect = async () => { | ||
const accounts = await provider.request({ | ||
method: 'eth_requestAccounts', | ||
}) | ||
|
||
console.log(accounts, '===') | ||
} | ||
|
||
return <> | ||
<div>info: {info}</div> | ||
<button onClick={onConnect}>connect</button> | ||
</> | ||
} |
Oops, something went wrong.