forked from BossaDev/atomic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
137 lines (118 loc) · 4.89 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>Atomic Ninja</title>
<!-- This exposes the library as a global variable: ethers -->
<script src="./js/lib/ethers.min.js" charset="utf-8" type="text/javascript"></script>
<script src="./js/lib/blockly_compressed_vertical.js"></script>
<script src="./blocks/vertical_extensions.js"></script>
<script src="./blocks/math.js"></script>
<script src="./blocks/text.js"></script>
<!-- <script src="./blocks/atomic_transaction.js"></script> -->
<script src="./blocks/atomic_transaction_options.js"></script>
<script src="./blocks/eth_transfer.js"></script>
<script src="./blocks/erc20_transfer.js"></script>
<script src="./blocks/uniswap_v2_swap.js"></script>
<script src="./blocks/uniswap_v2_flashswap.js"></script>
<script src="./blocks/uniswap_v1_swap.js"></script>
<script src="./blocks/aave_flashloan.js"></script>
<script src="./blocks/compound_supply.js"></script>
<script src="./blocks/compound_borrow.js"></script>
<script src="./blocks/compound_repay.js"></script>
<script src="./blocks/poolTogether_ticket.js"></script>
<script src="./blocks/defi_zaps.js"></script>
<script src="./blocks/balance_swap.js"></script>
<script src="./blocks/atomic_brag.js"></script>
<script src="./blocks/atomic_tip.js"></script>
<script src="./blocks/revert.js"></script>
<script src="./blocks/ens_resolver.js"></script>
<script src="./js/toolbox.js"></script>
<script src="./js/launchAtomic.js"></script>
<script src="./js/simulateAtomic.js"></script>
<script type="text/javascript" src="./js/lib/xmlToJSON.min.js"></script>
<script type="text/javascript" src="./js/lib/picoModal-3.0.0.min.js"></script>
<!-- portis -->
<script src="https://cdn.jsdelivr.net/npm/@portis/[email protected]/umd/index.js"
integrity="sha256-pPwrJF/X2v9erIHBoY3ZWb4P/cRx3j3/zyvQvycabs0=" crossorigin="anonymous"></script>
<script>
'use strict';
var loc = window.location.href + '';
if (loc.indexOf('http://') == 0 &&
!(loc.indexOf('http://localhost:8000/') == 0 ||
loc.indexOf('http://0.0.0.0:8000/') == 0 ||
loc.indexOf('file:///') == 0)
) {
console.log("Redirecting to SSL connection.")
window.location.href = loc.replace('http://', 'https://');
}
var workspace = null;
function start() {
// Create main workspace.
workspace = Blockly.inject('blocklyDiv', {
comments: true,
disable: false,
collapse: false,
media: './media/',
readOnly: false,
rtl: null,
scrollbars: true,
toolbox: getToolboxElement(),
toolboxPosition: "start",
horizontalLayout: false,
sounds: true,
zoom: {
controls: true,
wheel: true,
startScale: 0.85,
maxScale: 4,
minScale: 0.25,
scaleSpeed: 1.1
},
colours: {
fieldShadow: 'rgba(255, 255, 255, 0.3)',
dragShadowOpacity: 0.6
}
});
picoModal(
"<h2>Welcome to Atomic Ninja!</h2>" +
"<p>Send complex atomic transactions to Ethereum like never before.</p>" +
"<h3>Quick Start</h3>" +
"<p>On the left of the screen there is a list of sorted, disconnected blocks. This is your <b>toolbox</b>.</p>" +
"<p>Drag the blocks to the <b>workspace</b> at the right, join them and edit their parameters to perform the actions you´d like.</p>" +
"<p>Start with a hat shaped block such as <img src='./media/hatblock.png' style='width: 11%;'>, as they indicate the beginning of your transaction.</p>" +
"<p>Once you are done, press <img src='./media/zoom-simulateAtomic.svg'> to simulate your transaction, and <img src='./media/zoom-launchAtomic.svg'> to send it out!</p>" +
"<p><b>Tip:</b> Hover the blocks for details on how they work.</p>" +
"<p>For more details, head over to the <a href='./docs.html'>Atomic documentation</a>.</p>"
).show();
}
function getToolboxElement() {
var match = location.search.match(/toolbox=([^&]+)/);
return document.getElementById('toolbox-' + (match ? match[1] : 'categories'));
}
</script>
<style>
html,
body {
height: 100%;
background-color: #fff;
font-family: sans-serif;
overflow: hidden;
}
#blocklyDiv {
float: right;
position: relative;
top: -28px;
height: 97%;
width: 100%;
}
</style>
</head>
<body onload="start()">
<div id="portis" style="position: relative; top: 10px; z-index: 11000; float: right;"><img
src="https://www.portis.io/static/logo-small.svg" style="position: relative; top: 5px;" width="25"
height="25"> <span id="walletMsg">Not Connected</span> </div>
<div id="blocklyDiv"></div>
</body>
</html>