-
Notifications
You must be signed in to change notification settings - Fork 597
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ignore nextjs output * add basic nextjs app for dev purposes * rename dev to testapp * update tsconfig * add sdk to testapp * add nodemon config * Set build to generate dist dir at pkg root * use the SDK * remove webpack from build * move release script * dev script working * move assets to top level * clean up watch and npm scripts * fix dev script * update release script * remove unused deps * update publish script
- Loading branch information
Showing
21 changed files
with
492 additions
and
977 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 |
---|---|---|
|
@@ -38,3 +38,6 @@ examples/**/yarn.lock | |
!.yarn/plugins | ||
!.yarn/sdks | ||
!.yarn/versions | ||
|
||
# next.js | ||
.next |
Empty file.
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,5 @@ | ||
# testapp | ||
|
||
This is a demo app for development purposes. The `yarn dev` command will start two dev servers in parallel: | ||
wallet-sdk-development | ||
@coinbase/wallet-sdk |
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,5 @@ | ||
/// <reference types="next" /> | ||
/// <reference types="next/image-types/global" /> | ||
|
||
// NOTE: This file should not be edited | ||
// see https://nextjs.org/docs/basic-features/typescript for more information. |
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 @@ | ||
{ | ||
"name": "@coinbase/wallet-sdk-testapp", | ||
"packageManager": "yarn@3.6.1", | ||
"scripts": { | ||
"dev": "next dev", | ||
"build": "next build", | ||
"start": "next start" | ||
}, | ||
"dependencies": { | ||
"@coinbase/wallet-sdk": "workspace:^", | ||
"next": "^13.4.10", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0" | ||
}, | ||
"devDependencies": { | ||
"@types/react": "18.2.15" | ||
} | ||
} |
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,33 @@ | ||
import { CoinbaseWalletProvider, CoinbaseWalletSDK } from '@coinbase/wallet-sdk'; | ||
import React, { useCallback, useEffect } from 'react'; | ||
|
||
export default function Home() { | ||
const [_, setSdk] = React.useState<CoinbaseWalletSDK | null>(null); | ||
const [provider, setProvider] = React.useState<CoinbaseWalletProvider | null>(null); | ||
|
||
useEffect(() => { | ||
const cbwsdk = new CoinbaseWalletSDK({ | ||
appName: 'Test App', | ||
}); | ||
setSdk(cbwsdk); | ||
const cbwprovider = cbwsdk.makeWeb3Provider('http'); | ||
console.info('provider', cbwprovider); | ||
setProvider(cbwprovider); | ||
}, []); | ||
|
||
const connect = useCallback(async () => { | ||
if (!provider) return; | ||
try { | ||
await provider.enable(); | ||
} catch (error) { | ||
console.error(error); | ||
} | ||
}, [provider]); | ||
|
||
return ( | ||
<div> | ||
<h1>Connect</h1> | ||
<button onClick={connect}>Connect</button> | ||
</div> | ||
); | ||
} |
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,32 @@ | ||
{ | ||
"compilerOptions": { | ||
"lib": [ | ||
"dom", | ||
"dom.iterable", | ||
"esnext" | ||
], | ||
"allowJs": true, | ||
"skipLibCheck": true, | ||
"strict": false, | ||
"forceConsistentCasingInFileNames": true, | ||
"noEmit": true, | ||
"incremental": true, | ||
"esModuleInterop": true, | ||
"module": "esnext", | ||
"moduleResolution": "node", | ||
"resolveJsonModule": true, | ||
"isolatedModules": true, | ||
"jsx": "preserve" | ||
}, | ||
"include": [ | ||
"next-env.d.ts", | ||
"**/*.ts", | ||
"**/*.tsx" | ||
], | ||
"exclude": [ | ||
"node_modules" | ||
], | ||
"references": [ | ||
|
||
] | ||
} |
File renamed without changes.
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
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 @@ | ||
# Source | ||
src/** | ||
./node_modules/ | ||
__tests__/** | ||
|
||
# Config | ||
tsconfig.json | ||
tsconfig.build.json | ||
.eslintrc.js | ||
babel.config.js | ||
webpack.config.js | ||
karma.conf.js | ||
|
||
# Jest | ||
jest.setup.ts | ||
jest.config.ts | ||
coverage/** | ||
|
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
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
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
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
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
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
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
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.