-
-
Notifications
You must be signed in to change notification settings - Fork 136
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
1 parent
892e363
commit b5265d5
Showing
14,515 changed files
with
990,462 additions
and
0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
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
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,27 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>MetaMask SDK Deployment</title> | ||
<style> | ||
body { font-family: Arial, sans-serif; max-width: 800px; margin: 0 auto; padding: 20px; } | ||
h1 { color: #f45c00; } | ||
ul { list-style-type: none; padding: 0; } | ||
li { margin-bottom: 10px; } | ||
a { color: #333333; text-decoration: none; } | ||
a:hover { text-decoration: underline; } | ||
</style> | ||
</head> | ||
<body> | ||
<h1>MetaMask SDK Dapps</h1> | ||
<h3>release-107.0.0</h3> | ||
<ul> | ||
<li><a href="pure-javascript/index.html">pure-javascript</a></li> | ||
<li><a href="react-demo/build/index.html">react-demo</a></li> | ||
<li><a href="vuejs/build/index.html">vuejs</a></li> | ||
<li><a href="wagmi-demo-react/build/index.html">wagmi-demo-react</a></li> | ||
<li><a href="with-web3onboard/build/index.html">with-web3onboard</a></li> | ||
</ul> | ||
</body> | ||
</html> |
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 @@ | ||
# Pure JavaScript SDK example |
43 changes: 43 additions & 0 deletions
43
release-107.0.0/packages/examples/pure-javascript/index.html
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,43 @@ | ||
<script src="node_modules/@metamask/sdk/dist/browser/iife/metamask-sdk.js"></script> | ||
<script> | ||
const sdk = new MetaMaskSDK.MetaMaskSDK({ | ||
logging: { | ||
developerMode: true, | ||
}, | ||
dappMetadata: { | ||
name: 'Pure JS example', | ||
}, | ||
}); | ||
</script> | ||
<script> | ||
let provider; | ||
|
||
function connect() { | ||
sdk.connect() | ||
.then((res) => { | ||
provider = sdk.getProvider(); | ||
}) | ||
.catch((e) => console.log('request accounts ERR', e)); | ||
} | ||
|
||
function addEthereumChain() { | ||
provider | ||
.request({ | ||
method: 'wallet_addEthereumChain', | ||
params: [ | ||
{ | ||
chainId: '0x89', | ||
chainName: 'Polygon', | ||
blockExplorerUrls: ['https://polygonscan.com'], | ||
nativeCurrency: { symbol: 'POL', decimals: 18 }, | ||
rpcUrls: ['https://polygon-rpc.com/'], | ||
}, | ||
], | ||
}) | ||
.then((res) => console.log('add', res)) | ||
.catch((e) => console.log('ADD ERR', e)); | ||
} | ||
</script> | ||
<button onclick="connect()">Connect</button> | ||
|
||
<button onclick="addEthereumChain()">ADD ETHEREUM CHAIN</button> |
3 changes: 3 additions & 0 deletions
3
release-107.0.0/packages/examples/pure-javascript/node_modules/.bin/color-support
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
105 changes: 105 additions & 0 deletions
105
release-107.0.0/packages/examples/pure-javascript/node_modules/.bin/crc32
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
release-107.0.0/packages/examples/pure-javascript/node_modules/.bin/is-docker
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
release-107.0.0/packages/examples/pure-javascript/node_modules/.bin/loose-envify
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
68 changes: 68 additions & 0 deletions
68
release-107.0.0/packages/examples/pure-javascript/node_modules/.bin/mkdirp
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.