forked from orenyomtov/openordex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
inscription.html
313 lines (288 loc) · 19.8 KB
/
inscription.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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="canonical" href="https://openordex.org/">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>OpenOrdex - Open Ordinals Decentralized Exchange</title>
<meta name="description" content="OpenOrdex is a Trustless Bitcoin NFT Marketplace">
<meta name="keywords"
content="ordinals, bitcoin, nfts, nft, nft, btc, inscriptions, digital artifacts, marketplace" />
<!-- Open Graph / Facebook -->
<meta property="og:type" content="website">
<meta property="og:url" content="https://openordex.org/">
<meta property="og:title" content="OpenOrdex - Open Ordinals Decentralized Exchange">
<meta property="og:description"
content="OpenOrdex is an open source zero-fee trustless Bitcoin NFT marketplace based on partially signed bitcoin transactions">
<meta property="og:image" content="https://openordex.org/img/screenshot.png">
<!-- Twitter -->
<meta property="twitter:card" content="summary_large_image">
<meta property="twitter:url" content="https://openordex.org/">
<meta property="twitter:title" content="OpenOrdex - Open Ordinals Decentralized Exchange">
<meta property="twitter:description"
content="OpenOrdex is an open source zero-fee trustless Bitcoin NFT marketplace based on partially signed bitcoin transactions">
<meta property="twitter:image" content="https://openordex.org/img/screenshot.png">
<link rel="apple-touch-icon" sizes="60x60" href="img/favicon/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="img/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="img/favicon/favicon-16x16.png">
<meta name="msapplication-TileColor" content="#2d89ef">
<meta name="theme-color" content="#ffffff">
<!-- Bootstrap CSS -->
<link type="text/css" rel="stylesheet" href="css/bootstrap.min.css">
<!-- Site CSS -->
<link type="text/css" rel="stylesheet" href="css/w95.css">
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-PGT03XEJ4W"></script>
<script> window.dataLayer = window.dataLayer || []; function gtag() { dataLayer.push(arguments); } gtag('js', new Date()); gtag('config', 'G-PGT03XEJ4W'); </script>
</head>
<body>
<header class="header-global">
<nav id="navbar-main"
class="navbar d-flex flex-row align-items-center navbar-main navbar-expand-lg navbar-dark justify-content-between">
<ul class="navbar-nav navbar-nav-hover flex-row align-items-center">
<li class="nav-item">
<a href="/" class="nav-link" role="button">
<span class="nav-link-inner-text">OpenOrdex <span id="networkName"></span></span>
</a>
</li>
<li class="nav-item">
<a href="https://github.com/orenyomtov/openordex" target="_blank" class="nav-link" role="button">
<span class="nav-link-inner-text">GitHub</span>
</a>
</li>
<li class="nav-item">
<a href="https://twitter.com/openordex" target="_blank" class="nav-link" role="button">
<span class="nav-link-inner-text">Twitter</span>
</a>
</li>
</ul>
<div class="time text-center">
<span id="time" class="text-uppercase"></span>
</div>
</nav>
</header>
<main>
<!-- Section -->
<section class="min-vh-100 d-flex align-items-center bg-secondary">
<div class="container">
<div class="row justify-content-center">
<div class="col-12 d-flex align-items-center justify-content-center">
<div class="card card-tertiary w-100 fmxw-500">
<div class="card-header text-center">
<span>Inscription #<span class="inscriptionNumber"></span></span>
</div>
<div class="card-body">
<form action="#" class="mt-0" onsubmit="listInscriptionForSale(); return false;">
<iframe id="preview" sandbox=allow-scripts scrolling=no loading=lazy></iframe>
<!-- Form -->
<div class="form-group">
<label for="inscriptionId" class="mb-2">ID</label>
<input id="inscriptionId" type="text" class="form-control"
placeholder="Loading..." required />
<label for="owner" class="mb-2">Owner</label>
<input id="owner" type="text" class="form-control" placeholder="Loading..."
required />
<label for="utxo" class="mb-2">UTXO</label>
<input id="utxo" type="text" class="form-control" placeholder="Loading..."
required />
<label for="utxoValue" class="mb-2">UTXO Value</label>
<input id="utxoValue" type="text" class="form-control" placeholder="Loading..."
required />
</div>
<!-- End of Form -->
<button type="submit" id="btnBuyInscriptionNow" class="btn btn-block btn-tertiary"
style="display: none" onclick="buyInscriptionNow(); return false"></button>
<button type="submit" id="btnListInscriptionForSale"
class="btn btn-block btn-primary">List Inscription For Sale</button>
</form>
<div class="justify-content-center align-items-center mt-4 text-center">
<p class="font-weight-normal">
<a href="" class="font-weight-bold" id="explorerLink" target="_blank">View on
ordinals explorer</a>
</p>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- List Dialog -->
<dialog id="listDialog" style="top:0; padding:0; background-color: transparent; border: 0">
<section class="min-vh-100 d-flex align-items-center" style="background-color: transparent;">
<div class="">
<div class="row justify-content-center">
<div class="col-12 d-flex align-items-center justify-content-center">
<div class="card card-tertiary w-100 fmxw-400">
<div class="card-header text-center">
<span>List Inscription For Sale</span>
</div>
<div class="card-body">
<form id="saleStep1" action="#" class="mt-0"
onsubmit="generateSalePsbt(); return false;">
<!-- Form -->
<div class="form-group">
<label for="price" class="mb-2">Price (in BTC)</label>
<input id="price" type="number" step="any" class="form-control"
placeholder="0.1" required />
<label for="paymentAddress" class="mb-2">Address to receive payment to
(default: current owner)</label>
<input id="paymentAddress" type="text" class="form-control" required />
</div>
<!-- End of Form -->
<button type="submit" class="btn btn-block btn-primary">Create a Partially
Signed Bitcoin
Transaction</button>
</form>
<form id="saleStep2" action="#" class="mt-0" onsubmit="return false;"
style="display: none;">
<!-- Form -->
<div class="form-group mb-2">
<label for="price" class="mb-2">Created PSBT for selling inscription
#<span class="inscriptionNumber"></span> for <span class="price"></span>
BTC:</label>
<textarea id="generatedSalePsbt" class="form-control"></textarea>
</div>
<p
class="justify-content-center align-items-center text-center font-weight-normal mb-2">
bitcoin-cli walletprocesspsbt "..." true "SINGLE|ANYONECANPAY"
</p>
<!-- End of Form -->
<button class="btn btn-secondary"
onclick="copyInput(this, 'generatedSalePsbt')">Copy PSBT</button>
<button class="btn btn-secondary mb-2" style="float: right"
onclick="downloadInput('generatedSalePsbt', `listInscription${inscriptionNumber}.psbt`)">Download
PSBT</button>
<button class="btn btn-block btn-secondary mb-2 btnsSignWithWallet" style="clear: both; display: none"
onclick="signPSBTUsingWalletIntoInput('generatedSalePsbt', 'signedSalePsbt')">Sign
PSBT using <span class="walletName"></span> Wallet</button>
<div class="justify-content-center align-items-center text-center mt-4 walletSuggestions" style="clear: both; display: none">
<p class="font-weight-normal">
Need a wallet to sign? Use <span class="walletsList"></span>
</p>
</div>
<hr class="my-2">
<div>
<label for="signedSalePsbt" class="mb-2">Sign the above and paste the signed
PSBT (or signed transaction) here:</label>
<textarea id="signedSalePsbt" class="form-control"></textarea>
</div>
<div class="form-group form-check">
<label class="form-check-label">
<input id="publicPsbt" class="form-check-input" type="checkbox"
checked="">
<span class="form-check-x"></span>
<span class="form-check-sign"></span>
Publish PSBT to public decentralized order book
</label>
</div>
<button id="btnSubmitSignedSalePsbt" class="btn btn-block btn-primary mt-2"
onclick="submitSignedSalePsbt()">List
inscription for sale</button>
</form>
</div>
</div>
</div>
</div>
</div>
</section>
</dialog>
<!-- Buy Dialog -->
<dialog id="buyDialog" style="top:0; padding:0; background-color: transparent; border: 0">
<section class="min-vh-100 d-flex align-items-center" style="background-color: transparent;">
<div class="">
<div class="row justify-content-center">
<div class="col-12 d-flex align-items-center justify-content-center">
<div class="card card-tertiary w-100 fmxw-400">
<div class="card-header text-center">
<span>Buy Inscription #<span class="inscriptionNumber"></span> for <span
class="price"></span></span>
</div>
<div class="card-body">
<div id="buyStep1">
<form action="#" class="mt-0" onsubmit="return false;">
<!-- Form -->
<div class="form-group">
<label for="payerAddress" class="mb-2">Buyer's address:</label>
<input id="payerAddress" type="text" class="form-control" required
oninput="updatePayerAddress()" />
<div class="justify-content-center align-items-center mt-2 text-center dummy"
style="padding:0 0.1em;">
<p class="font-weight-normal">
No dummy UTXOs (i.e. value <= <span
class="dummyUtxoValue"></span>) found for your address, so
you first need to
create one
</p>
</div>
<div class="justify-content-center align-items-center text-center mt-2"
style="padding:0 0.1em; display: none;" id="loadingUTXOs">
<p class="font-weight-normal">
Loading your UTXOs...
</p>
</div>
<label for="receiverAddress" class="mb-2 notDummy">Inscription receiver
address
(default: buyer)</label>
<input id="receiverAddress" type="text" class="form-control notDummy" />
</div>
<!-- End of Form -->
<button type="submit" id="btnGenerateDummyUtxos"
class="btn btn-block btn-primary dummy">Create
a Dummy UTXO</button>
<button type="submit" id="btnBuyInscription"
class="btn btn-block btn-primary notDummy" disabled>Buy
Inscription</button>
</form>
<div class="justify-content-center align-items-center text-center mt-4 dummy">
<p class="font-weight-normal">
Why do I need a dummy UTXO?
<a href="https://github.com/casey/ord/issues/802"
class="font-weight-bold">Learn more</a>
</p>
</div>
</div>
<form id="buyStep2" action="#" class="mt-0" onsubmit="return false;"
style="display: none;">
<!-- Form -->
<div class="form-group">
<label for="generatedBuyPsbt" class="mb-2"
id="generatedBuyPsbtTitle"></label>
<textarea id="generatedBuyPsbt" class="form-control"></textarea>
</div>
<button class="btn btn-secondary"
onclick="copyInput(this, 'generatedBuyPsbt')">Copy PSBT</button>
<button class="btn btn-secondary mb-2" style="float: right"
onclick="downloadInput('generatedBuyPsbt', `buyInscription${inscriptionNumber}.psbt`)">Download
PSBT</button>
<button class="btn btn-block btn-secondary mb-2 btnsSignWithWallet" style="clear: both; display: none"
onclick="signPSBTUsingWalletAndBroadcast('generatedBuyPsbt')">Sign
PSBT using <span class="walletName"></span> Wallet and broadcast</button>
<div class="justify-content-center align-items-center text-center mt-4 walletSuggestions" style="clear: both; display: none">
<p class="font-weight-normal">
Need a wallet to sign? Use <span class="walletsList"></span>
</p>
</div>
<div id="buyPsbtQrCode" class="text-center"></div>
<div class="justify-content-center align-items-center text-center mt-4">
<p class="font-weight-normal" id="buyStatusMessage">
Waiting to see the transaction in the mempool...
</p>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</section>
</dialog>
</main>
<script src="js/secp256k1.js"></script>
<script type="module" src="js/bitcoinjs-lib.js"></script>
<script type="module" src="js/connectjs-lib.js"></script>
<script src="js/nostr.js"></script>
<script src="js/qrcode.js"></script>
<script src="js/app.js"></script>
</body>
</html>