Skip to content

Commit 4d3d3ed

Browse files
authored
Merge pull request #2712 from XRPLF/amm-modular-tutorials
AMM modular tutorials.
2 parents e74072b + 8a2e8c8 commit 4d3d3ed

36 files changed

+4253
-51
lines changed
Lines changed: 302 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,302 @@
1+
<html>
2+
<head>
3+
<title>Create AMM Test Harness</title>
4+
<link href='https://fonts.googleapis.com/css?family=Work Sans' rel='stylesheet'>
5+
<style>
6+
body{font-family: "Work Sans", sans-serif;padding: 20px;background: #fafafa;}
7+
h1{font-weight: bold;}
8+
input, button {padding: 6px;margin-bottom: 8px;}
9+
button{font-weight: bold;font-family: "Work Sans", sans-serif;}
10+
td{vertical-align: middle;}
11+
</style>
12+
<script src='https://unpkg.com/xrpl@4.0.0/build/xrpl-latest-min.js'></script>
13+
<script src='ripplex1-send-xrp.js'></script>
14+
<script src='ripplex2-send-currency.js'></script>
15+
<script src='ripplex11-create-amm.js'></script>
16+
<script>
17+
if (typeof module !== "undefined") {
18+
const xrpl = require('xrpl')
19+
}
20+
</script>
21+
</head>
22+
23+
<!-- ************************************************************** -->
24+
<!-- ********************** The Form ****************************** -->
25+
<!-- ************************************************************** -->
26+
27+
<body>
28+
<h1>Create AMM Test Harness</h1>
29+
<form id="theForm">
30+
Choose your ledger instance:
31+
&nbsp;&nbsp;
32+
<input type="radio" id="tn" name="server"
33+
value="wss://s.altnet.rippletest.net:51233" checked>
34+
<label for="testnet">Testnet</label>
35+
&nbsp;&nbsp;
36+
<input type="radio" id="dn" name="server"
37+
value="wss://s.devnet.rippletest.net:51233">
38+
<label for="devnet">Devnet</label>
39+
<br/><br/>
40+
<button type="button" onClick="getAccountsFromSeeds()">Get Accounts From Seeds</button>
41+
<br/>
42+
<textarea id="seeds" cols="40" rows= "2"></textarea>
43+
<br/><br/>
44+
<table>
45+
<tr valign="top">
46+
<td>
47+
<table style="padding-bottom: 400px;">
48+
<tr valign="top">
49+
<td>
50+
<td>
51+
<button type="button" onClick="getAccount('standby')">Get New Standby Account</button>
52+
<table>
53+
<tr valign="top">
54+
<td align="right">
55+
Standby Account
56+
</td>
57+
<td>
58+
<input type="text" id="standbyAccountField" size="40"></input>
59+
<br>
60+
</td>
61+
</tr>
62+
<tr>
63+
<td align="right">
64+
Seed
65+
</td>
66+
<td>
67+
<input type="text" id="standbySeedField" size="40"></input>
68+
<br>
69+
</td>
70+
</tr>
71+
<tr>
72+
<td align="right">
73+
XRP Balance
74+
</td>
75+
<td>
76+
<input type="text" id="standbyBalanceField" size="40"></input>
77+
<br>
78+
</td>
79+
</tr>
80+
<tr>
81+
<td align="right">
82+
Amount
83+
</td>
84+
<td>
85+
<input type="text" id="standbyAmountField" size="40"></input>
86+
<br>
87+
</td>
88+
</tr>
89+
<tr>
90+
<td align="right">
91+
Destination
92+
</td>
93+
<td>
94+
<input type="text" id="standbyDestinationField" size="40"></input>
95+
<br>
96+
</td>
97+
</tr>
98+
<tr valign="top">
99+
<td><button type="button" onClick="configureAccount('standby',document.querySelector('#standbyDefault').checked)">Configure Account</button></td>
100+
<td>
101+
<input type="checkbox" id="standbyDefault" checked="true"/>
102+
<label for="standbyDefault">Allow Rippling</label>
103+
</td>
104+
</tr>
105+
<tr>
106+
<td align="right">
107+
Currency
108+
</td>
109+
<td>
110+
<input type="text" id="standbyCurrencyField" size="40"></input>
111+
<br>
112+
</td>
113+
</tr>
114+
</table>
115+
<p align="left">
116+
<textarea id="standbyResultField" cols="60" rows="20" style="resize: none;"></textarea>
117+
</p>
118+
<table>
119+
<tr valign="top">
120+
<td align="right">
121+
Asset 1 Currency
122+
</td>
123+
<td>
124+
<input type="text" id="asset1CurrencyField" size="40"></input>
125+
<br>
126+
</td>
127+
</tr>
128+
<tr>
129+
<td align="right">
130+
Asset 1 Issuer
131+
</td>
132+
<td>
133+
<input type="text" id="asset1IssuerField" size="40"></input>
134+
<br>
135+
</td>
136+
</tr>
137+
<tr>
138+
<td align="right">
139+
Asset 1 Amount
140+
</td>
141+
<td>
142+
<input type="text" id="asset1AmountField" size="40"></input>
143+
<br>
144+
</td>
145+
</tr>
146+
<tr>
147+
<td align="right">
148+
Asset 2 Currency
149+
</td>
150+
<td>
151+
<input type="text" id="asset2CurrencyField" size="40"></input>
152+
<br>
153+
</td>
154+
</tr>
155+
<tr>
156+
<td align="right">
157+
Asset 2 Issuer
158+
</td>
159+
<td>
160+
<input type="text" id="asset2IssuerField" size="40"></input>
161+
<br>
162+
</td>
163+
</tr>
164+
<tr>
165+
<td align="right">
166+
Asset 2 Amount
167+
</td>
168+
<td>
169+
<input type="text" id="asset2AmountField" size="40"></input>
170+
<br>
171+
</td>
172+
</tr>
173+
</table>
174+
</td>
175+
</td>
176+
<td>
177+
<table>
178+
<tr valign="top">
179+
<td align="center" valign="top" style="padding-top: 165px;">
180+
<br>
181+
<button type="button" onClick="sendXRP()">Send XRP&#62;</button>
182+
<br/><br/>
183+
<button type="button" onClick="createTrustline()">Create TrustLine</button>
184+
<br/>
185+
<button type="button" onClick="sendCurrency()">Send Currency</button>
186+
<br/>
187+
<button type="button" onClick="getBalances()" style="margin-bottom: 160px;">Get Balances</button>
188+
<br/>
189+
<button type="button" onClick="checkAMM()">Check AMM</button>
190+
<br/>
191+
<button type="button" onClick="createAMM()">Create AMM</button>
192+
</td>
193+
</tr>
194+
</td>
195+
</tr>
196+
</table>
197+
</td>
198+
</tr>
199+
</table>
200+
</td>
201+
<td>
202+
<table style="padding-bottom: 350px;">
203+
<tr>
204+
<td>
205+
<td>
206+
<table>
207+
<tr>
208+
<td align="center" valign="top" style="padding-bottom: 100px;">
209+
<button type="button" onClick="oPsendXRP()">&#60; Send XRP</button>
210+
<br/><br/>
211+
<button type="button" onClick="oPcreateTrustline()">Create TrustLine</button>
212+
<br/>
213+
<button type="button" onClick="oPsendCurrency()">Send Currency</button>
214+
<br/>
215+
<button type="button" onClick="getBalances()">Get Balances</button>
216+
</td>
217+
<td valign="top" align="right">
218+
<button type="button" onClick="getAccount('operational')">Get New Operational Account</button>
219+
<table>
220+
<tr valign="top">
221+
<td align="right">
222+
Operational Account
223+
</td>
224+
<td>
225+
<input type="text" id="operationalAccountField" size="40"></input>
226+
<br>
227+
</td>
228+
</tr>
229+
<tr>
230+
<td align="right">
231+
Seed
232+
</td>
233+
<td>
234+
<input type="text" id="operationalSeedField" size="40"></input>
235+
<br>
236+
</td>
237+
</tr>
238+
<tr>
239+
<td align="right">
240+
XRP Balance
241+
</td>
242+
<td>
243+
<input type="text" id="operationalBalanceField" size="40"></input>
244+
<br>
245+
</td>
246+
</tr>
247+
<tr>
248+
<td align="right">
249+
Amount
250+
</td>
251+
<td>
252+
<input type="text" id="operationalAmountField" size="40"></input>
253+
<br>
254+
</td>
255+
</tr>
256+
<tr>
257+
<td align="right">
258+
Destination
259+
</td>
260+
<td>
261+
<input type="text" id="operationalDestinationField" size="40"></input>
262+
<br>
263+
</td>
264+
</tr>
265+
<tr>
266+
<td>
267+
</td>
268+
<td align="right">
269+
<input type="checkbox" id="operationalDefault" checked="true"/>
270+
<label for="operationalDefault">Allow Rippling</label>
271+
<button type="button" onClick="configureAccount('operational',document.querySelector('#operationalDefault').checked)">Configure Account</button>
272+
</td>
273+
</tr>
274+
<tr>
275+
<td align="right">
276+
Currency
277+
</td>
278+
<td>
279+
<input type="text" id="operationalCurrencyField" size="40"></input>
280+
</td>
281+
</tr>
282+
</table>
283+
<p align="right">
284+
<textarea id="operationalResultField" cols="60" rows="20" style="resize: none;"></textarea>
285+
<br><br>
286+
<textarea id="ammInfoField" cols="60" rows="20" style="resize: none;"></textarea>
287+
</p>
288+
</td>
289+
</td>
290+
</tr>
291+
</td>
292+
</tr>
293+
</table>
294+
</td>
295+
</tr>
296+
</table>
297+
</td>
298+
</tr>
299+
</table>
300+
</form>
301+
</body>
302+
</html>

0 commit comments

Comments
 (0)