Skip to content

Commit

Permalink
merge send-to-anyone-page
Browse files Browse the repository at this point in the history
  • Loading branch information
lennardevertz committed Feb 15, 2024
2 parents b365922 + b288477 commit 38a0e3d
Show file tree
Hide file tree
Showing 16 changed files with 6,235 additions and 1,198 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules/
.idea/
buildResults/
dist/
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
This webpage is meant to handle tipping by web3
This webpage is meant to handle sendToAnyone by web3
## build
To compile plugin install [yarn](https://yarnpkg.com/) and then from CLI

Expand All @@ -8,3 +8,7 @@ yarn buildOnce
```

Results will appear in buildResults directory.

## License

This project is licensed under [GPLv3](https://github.com/idrisssystem/send-to-anyone-page/blob/master/LICENSE).
17 changes: 12 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,27 @@
{
"scripts": {
"build": "webpack --watch",
"buildOnce": "webpack",
"dev": "webpack-dev-server"
"build": "webpack --watch --mode none",
"build-local": "webpack --mode none",
"build-dev": "webpack --mode development",
"build-prod": "webpack --mode production --watch",
"buildOnce": "webpack --mode production",
"dev": "webpack-dev-server --mode none"
},
"dependencies": {
"@idriss-crypto/tipping-core": "^2.2.4",
"@walletconnect/web3-provider": "^1.7.8",
"@idriss-crypto/send-to-anyone-core": "^0.4.12",
"@web3-name-sdk/core": "^0.1.13",
"fast-creator": "^1.6.0",
"viem": "^1.21.4",
"web3": "^1.7.0",
"web3modal": "^1.9.7"
},
"devDependencies": {
"copy-webpack-plugin": "^9.0.1",
"css-loader": "^6.4.0",
"ethers": "^5.6.9",
"html-webpack-plugin": "^5.5.0",
"mpts-loader": "^1.0.0",
"node-polyfill-webpack-plugin": "^3.0.0",
"sass": "^1.43.2",
"sass-loader": "^12.2.0",
"style-loader": "^3.3.1",
Expand Down
30 changes: 30 additions & 0 deletions src/generateSendToAnyoneCode.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Generate IDriss Send Icon - IDriss.xyz</title>
</head>
<body>
<h2>Generate button for IDriss Send</h2>
<label>
<span>Name to be shown</span>
<input name="identifier" type="text">
</label>
<label>
<span>Wallet address</span>
<input name="recipient" type="text">
</label>

<div class="result link">
<h3>Link</h3>
<div>https://www.idriss.xyz/send</div>
</div>
<div class="result html">
<h3>Html</h3>
<div>&lt;script src="https://www.idriss.xyz/static/js/send/idrissSendToAnyoneSDK.js">&lt;/script>&lt;a href=&quot;https://www.idriss.xyz/send&quot; onclick=&quot;idrissShowSendToAnyonePopup({},event)&quot;&gt;Send me crypto&lt;/a&gt;</div>
</div>
<p>For more advanced users see <a href="https://github.com/idriss-crypto/send-to-anyone-core">our SDK</a></p>

<script src="../static/js/send/generateSendToAnyoneCode.js"></script>
</body>
</html>
6 changes: 3 additions & 3 deletions src/generateTipCode.js → src/generateSendToAnyoneCode.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import css from "!!style-loader!css-loader!sass-loader!./generateTipCode.scss";
import css from "!!style-loader!css-loader!sass-loader!./generateSendToAnyoneCode.scss";

addEventListener('input', e => {
let link = 'https://idriss.xyz/tip';
let link = 'https://idriss.xyz/send';
let params = {};
if (document.querySelector('input[name="identifier"]').value) {
params.identifier = document.querySelector('input[name="identifier"]').value;
Expand All @@ -15,7 +15,7 @@ addEventListener('input', e => {
if (Object.values(params).length) {
link += '?' + Object.entries(params).map(([k, v]) => encodeURIComponent(k) + '=' + encodeURIComponent(v)).join('&');
}
let html = `<script src="https://idriss.xyz/static/js/idrissTippingSDK.js"></script><a href="${link}" onclick='idrissShowTippingPopup(${JSON.stringify(params)},event)'>Send me crypto</a>`;
let html = `<script src="https://idriss.xyz/static/js/send/idrissSendToAnyoneSDK.js"></script><a href="${link}" onclick='idrissShowSendToAnyonePopup(${JSON.stringify(params)},event)'>Send me crypto</a>`;
document.querySelector('.result.link>div').textContent = link
document.querySelector('.result.html>div').textContent = html
})
File renamed without changes.
30 changes: 0 additions & 30 deletions src/generateTipCode.html

This file was deleted.

14 changes: 14 additions & 0 deletions src/idrissSendToAnyoneSDK/idrissSendToAnyoneSDK.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
console.log('Idriss sendToAnyone script')

export async function idrissShowSendToAnyonePopup(config, e) {
e.preventDefault();
const {idrissShowSendToAnyonePopup} = await import(/* webpackPrefetch: true */"@idriss-crypto/send-to-anyone-core");
return idrissShowSendToAnyonePopup(config, e);
}

export async function idrissLoadSendToAnyoneWidget() {
return (await import(/* webpackPrefetch: true */"@idriss-crypto/send-to-anyone-core")).IdrissSendToAnyoneWidget;
}

window.idrissShowSendToAnyonePopup = idrissShowSendToAnyonePopup;
window.idrissLoadSendToAnyoneWidget = idrissLoadSendToAnyoneWidget;
14 changes: 0 additions & 14 deletions src/idrissTippingSDK/idrissTippingSDK.js

This file was deleted.

Loading

0 comments on commit 38a0e3d

Please sign in to comment.