]> Untitled Git - bitcoindevkit.org/commitdiff
Various playground improvements, add the compiler
authorAlekos Filini <alekos.filini@gmail.com>
Fri, 8 May 2020 22:26:05 +0000 (00:26 +0200)
committerAlekos Filini <alekos.filini@gmail.com>
Fri, 8 May 2020 22:26:05 +0000 (00:26 +0200)
layouts/shortcodes/playground.html
playground/Cargo.toml
playground/src/lib.rs
playground/www/index.html [new file with mode: 0644]
playground/www/package-lock.json
playground/www/package.json
playground/www/src/index.js
static/repl/playground/1.playground.js
static/repl/playground/2e3919bf1973cb5d2596.module.wasm [new file with mode: 0644]
static/repl/playground/ceebc76efac5daa13e2d.module.wasm [deleted file]
static/repl/playground/playground.js

index cc4861775568dbcfb3632dd7c6ea5ac03d565381..1ca4ecd4e8a3c90798af653b4899cb8735072db6 100644 (file)
@@ -4,6 +4,32 @@
 }
 </style>
 
+<h3>Policy Compiler</h3>
+<div id="compiler">
+    <form>
+        <div>
+            <label for="policy">Policy</label>
+            <div style="display: flex">
+                <input type="text" id="policy" placeholder="or(10@pk(A),and(pk(B),older(1000)))" required/>
+                <select id="compiler_script_type" style="margin-bottom: 0.85rem; margin-left: 5px;">
+                    <option value="sh">P2SH</option>
+                    <option value="wsh">P2WSH</option>
+                    <option value="sh-wsh">P2SH-P2WSH</option>
+                </select>
+            </div>
+        </div>
+
+        <i>Map every alias to an existing key or generate a new one. You can also specify known keys directly in the policy input field.</i>
+        <div id="compiler_aliases">
+        </div>
+
+        <input type="submit" value="Compile" id="compile_button" style="padding: 10px; width: 100px;"/>
+
+        <pre id="compiler_output" style="word-break: break-all;"></pre>
+    </form>
+</div>
+
+<h3>Wallet</h3>
 <form>
     <div>
         <label for="descriptor">Descriptor</label>
 
     <div style="display: flex; align-items: baseline;">
         <input type="submit" value="Start" id="start_button" style="padding: 10px; width: 100px;" disabled/>
+        <input type="submit" value="Stop" id="stop_button" style="padding: 10px; width: 100px; margin-left: 5px;" disabled/>
         <span id="start_message" style="margin-left: 5px;"></span>
     </div>
 </form>
 
-<pre id="stdout" style="max-height: 50vh; overflow-y: scroll;"></pre>
+<pre id="stdout" style="max-height: 50vh; overflow-y: scroll; word-break: break-all;"></pre>
 
 <div style="display: flex; align-items: baseline;">
     <span>></span>
 
 <noscript>This page contains webassembly and javascript content, please enable javascript in your browser.</noscript>
 <script src="playground.js"></script>
+<script>
+
+    let compilerKeyAliasIndex = 0;
+
+    function htmlToElement(html) {
+        var template = document.createElement('template');
+        html = html.trim(); // Never return a text node of whitespace as the result
+        template.innerHTML = html;
+        return template.content.firstChild;
+    }
+
+    function addCompilerKeyAlias(e) {
+        if (e) {
+            e.preventDefault();
+        }
+
+        const newIndex = ++compilerKeyAliasIndex;
+        const html = `
+            <div style="display: flex;">
+                <input name="alias" data-index="${newIndex}" type="text" placeholder="A" style="width: 4em; margin-right: 5px;" required/>
+                <select style="margin-bottom: 0.85rem; margin-right: 5px;" name="type" onchange="updateCompilerFormAlias(this)" data-index="${newIndex}">
+                    <option value="gen_wif" selected="selected">Generate WIF Key</option>
+                    <option value="gen_ext">Generate Extended Key</option>
+                    <option value="existing">Existing Key</option>
+                </select>
+                <input type="text" name="extra" style="flex-grow: 1; margin-right: 5px; display: none;" data-index="${newIndex}"/>
+                <button style="height: 2.2em;" onclick="addCompilerKeyAlias(event)" id="add_key_alias"><i class="fas fa-plus-circle"></i></button>
+            </div>`;
+
+        const prevAddBtn = document.getElementById('add_key_alias');
+        if (prevAddBtn) {
+            prevAddBtn.remove();
+        }
+
+        document.getElementById('compiler_aliases').appendChild(htmlToElement(html));
+    }
+
+    function updateCompilerFormAlias(e) {
+        const extraInput = Array.from(document.getElementsByName('extra')).filter((x) => x.attributes["data-index"].value == e.attributes["data-index"].value)[0];
+
+        switch (e.value) {
+            case 'gen_wif':
+                extraInput.style.display = 'none';
+                break;
+            case 'gen_ext':
+                extraInput.style.display = 'inherit';
+                extraInput.placeholder = "Derivation Path (optional). Example: /44'/0'/0'/0/*";
+                break;
+            case 'existing':
+                extraInput.style.display = 'inherit';
+                extraInput.placeholder = "WIF, tpub or hex public key. Example: 02e96fe52ef0e22d2f131dd425ce1893073a3c6ad20e8cac36726393dfb4856a4c";
+                break;
+        }
+    }
+
+    (() => {
+        addCompilerKeyAlias();
+    })();
+
+</script>
index e7acd1c22411bd3d798c6ed9bdb4330384ac69b4..6f6e6ac3d68f4548b1e83f3797cf4099727f2f03 100644 (file)
@@ -11,13 +11,17 @@ crate-type = ["cdylib", "rlib"]
 default = ["console_error_panic_hook"]
 
 [dependencies]
+rand = { version = "0.6", features = ["wasm-bindgen"] }
 wasm-bindgen = "0.2"
 wasm-bindgen-futures = "0.4"
 js-sys = "0.3"
 log = "0.4"
 console_log = "0.2"
 clap = "2.33"
-magical-bitcoin-wallet = { path = "/home/user/Developer/magical-bitcoin-wallet", default-features = false, features = ["esplora", "cli-utils"] }
+secp256k1 = { version = "0.17", features = ["rand"] }
+magical-bitcoin-wallet = { git = "https://github.com/MagicalBitcoin/magical-bitcoin-wallet.git", rev = "0e432f3", default-features = false, features = ["esplora", "cli-utils", "compiler"] }
+serde = { version = "^1.0", features = ["derive"] }
+serde_json = { version = "^1.0" }
 
 # The `console_error_panic_hook` crate provides better debugging of panics by
 # logging them with `console.error`. This is great for development, but requires
index ead987f041f01380241e3845bbdce9a2bbb1be82..2009dfa3208c5f7b4a960813620d9837a07cc0ac 100644 (file)
@@ -1,19 +1,29 @@
+use std::collections::HashMap;
 use std::rc::Rc;
+use std::str::FromStr;
 
+use js_sys::Promise;
 use wasm_bindgen::prelude::*;
 use wasm_bindgen_futures::future_to_promise;
-use js_sys::Promise;
 
-use log::{info, debug};
+use rand::Rng;
+
+use log::{debug, info};
+
+use serde::Deserialize;
 
 use clap::AppSettings;
 
-use magical_bitcoin_wallet::*;
+use magical_bitcoin_wallet::bitcoin;
 use magical_bitcoin_wallet::database::memory::MemoryDatabase;
-use magical_bitcoin_wallet::bitcoin as bitcoin;
+use magical_bitcoin_wallet::miniscript;
+use magical_bitcoin_wallet::*;
 
 use bitcoin::*;
 
+use miniscript::policy::Concrete;
+use miniscript::Descriptor;
+
 mod utils;
 
 // When the `wee_alloc` feature is enabled, use `wee_alloc` as the global
@@ -39,7 +49,12 @@ pub struct WalletWrapper {
 #[wasm_bindgen]
 impl WalletWrapper {
     #[wasm_bindgen(constructor)]
-    pub async fn new(network: String, descriptor: String, change_descriptor: Option<String>, esplora: String) -> Result<WalletWrapper, String> {
+    pub async fn new(
+        network: String,
+        descriptor: String,
+        change_descriptor: Option<String>,
+        esplora: String,
+    ) -> Result<WalletWrapper, String> {
         let network = match network.as_str() {
             "regtest" => Network::Regtest,
             "testnet" | _ => Network::Testnet,
@@ -48,9 +63,17 @@ impl WalletWrapper {
         debug!("descriptors: {:?} {:?}", descriptor, change_descriptor);
 
         let blockchain = EsploraBlockchain::new(&esplora);
-        let wallet = Wallet::new(descriptor.as_str(), change_descriptor.as_ref().map(|x| x.as_str()), network, MemoryDatabase::new(), blockchain).await.map_err(|e| format!("{:?}", e))?;
-
-        Ok(WalletWrapper{
+        let wallet = Wallet::new(
+            descriptor.as_str(),
+            change_descriptor.as_ref().map(|x| x.as_str()),
+            network,
+            MemoryDatabase::new(),
+            blockchain,
+        )
+        .await
+        .map_err(|e| format!("{:?}", e))?;
+
+        Ok(WalletWrapper {
             _change_descriptor: change_descriptor,
             wallet: Rc::new(wallet),
         })
@@ -62,11 +85,78 @@ impl WalletWrapper {
         let wallet = Rc::clone(&self.wallet);
 
         future_to_promise(async move {
-            let matches = app.get_matches_from_safe_borrow(line.split(" ")).map_err(|e| e.message)?;
-            let res = cli::handle_matches(&wallet, matches).await.map_err(|e| format!("{:?}", e))?;
+            let matches = app
+                .get_matches_from_safe_borrow(line.split(" "))
+                .map_err(|e| e.message)?;
+            let res = cli::handle_matches(&wallet, matches)
+                .await
+                .map_err(|e| format!("{:?}", e))?;
 
             Ok(res.into())
         })
     }
 }
 
+#[derive(Debug, Deserialize)]
+#[serde(tag = "type", rename_all = "snake_case")]
+enum Alias {
+    GenWif,
+    GenExt { extra: String },
+    Existing { extra: String },
+}
+
+impl Alias {
+    fn into_key(self) -> String {
+        match self {
+            Alias::GenWif => {
+                let key = secp256k1::key::SecretKey::new(&mut rand::thread_rng());
+                let sk = bitcoin::util::key::PrivateKey {
+                    compressed: true,
+                    network: Network::Testnet,
+                    key,
+                };
+
+                sk.to_wif()
+            }
+            Alias::GenExt { extra: path } => {
+                let seed = rand::thread_rng().gen::<[u8; 32]>();
+                let xprv =
+                    bitcoin::util::bip32::ExtendedPrivKey::new_master(Network::Testnet, &seed)
+                        .unwrap();
+
+                format!("{}{}", xprv, path)
+            }
+            Alias::Existing { extra } => extra,
+        }
+    }
+}
+
+#[wasm_bindgen]
+pub fn compile(policy: String, aliases: String, script_type: String) -> Promise {
+    future_to_promise(async move {
+        let aliases: HashMap<String, Alias> =
+            serde_json::from_str(&aliases).map_err(|e| format!("{:?}", e))?;
+        let aliases: HashMap<String, String> = aliases
+            .into_iter()
+            .map(|(k, v)| (k, v.into_key()))
+            .collect();
+
+        let policy = Concrete::<String>::from_str(&policy).map_err(|e| format!("{:?}", e))?;
+        let compiled = policy.compile().map_err(|e| format!("{:?}", e))?;
+
+        let descriptor = match script_type.as_str() {
+            "sh" => Descriptor::Sh(compiled),
+            "wsh" => Descriptor::Wsh(compiled),
+            "sh-wsh" => Descriptor::ShWsh(compiled),
+            _ => return Err("InvalidScriptType".into()),
+        };
+
+        let descriptor: Result<Descriptor<String>, String> = descriptor.translate_pk(
+            |key| Ok(aliases.get(key).unwrap_or(key).into()),
+            |key| Ok(aliases.get(key).unwrap_or(key).into()),
+        );
+        let descriptor = descriptor?;
+
+        Ok(format!("{}", descriptor).into())
+    })
+}
diff --git a/playground/www/index.html b/playground/www/index.html
new file mode 100644 (file)
index 0000000..e3d756d
--- /dev/null
@@ -0,0 +1 @@
+<script src="/repl/playground/playground.js"></script>
index beb7ef59098a8852fdbf0be50b194a6f0404a49f..c377791515d14dacb8cd7d2aecd82408ae63c554 100644 (file)
         "yallist": "^3.0.2"
       }
     },
+    "magical-bitcoin-wallet-playground": {
+      "version": "file:../pkg",
+      "dev": true
+    },
     "make-dir": {
       "version": "2.1.0",
       "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz",
       "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==",
       "dev": true
     },
-    "wasm-esplora": {
-      "version": "file:../pkg",
-      "dev": true
-    },
     "watchpack": {
       "version": "1.6.1",
       "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.6.1.tgz",
index 32969cb2a3bc3479b4c419fddeaaf1d55a5de7bd..7e2771a2f62858f41f0bf77e6d93168846774f11 100644 (file)
@@ -27,7 +27,7 @@
   },
   "homepage": "https://github.com/rustwasm/create-wasm-app#readme",
   "devDependencies": {
-    "wasm-esplora": "file:../pkg",
+    "magical-bitcoin-wallet-playground": "file:../pkg",
     "webpack": "^4.29.3",
     "webpack-cli": "^3.1.0",
     "webpack-dev-server": "^3.1.5"
index 22484d02c6d8bec6caa6219c6b6a5e313889cb1d..0d895788cf853833ee67a01cc7e728cbf56b4d19 100644 (file)
@@ -1,4 +1,4 @@
-import { WalletWrapper, init } from "wasm-esplora";
+import { WalletWrapper, init, compile } from "magical-bitcoin-wallet-playground";
 
 async function startWallet(desc, change_desc) {
     const stdout = document.getElementById("stdout");
@@ -70,12 +70,16 @@ async function startWallet(desc, change_desc) {
 (async function() {
     init();
 
+    let currentWallet = null;
+
     document.getElementById("stdin").disabled = true;
 
     const start_button = document.getElementById("start_button");
+    const stop_button = document.getElementById("stop_button");
     const start_message = document.getElementById("start_message");
 
     start_button.disabled = false;
+    stop_button.disabled = true;
 
     const descriptor = document.getElementById("descriptor"); 
     const change_descriptor = document.getElementById("change_descriptor"); 
@@ -90,13 +94,75 @@ async function startWallet(desc, change_desc) {
         startWallet(descriptor.value, change_descriptor.value.length > 0 ? change_descriptor.value : null)
             .then((w) => {
                 start_button.disabled = true;
+
                 descriptor.disabled = true;
                 change_descriptor.disabled = true;
 
                 start_message.innerHTML = "Wallet created, running `sync`...";
 
                 w.run('sync').then(() => start_message.innerHTML = "Ready!");
+
+                currentWallet = w;
+                stop_button.disabled = false;
             })
             .catch((err) => start_message.innerHTML = `<span class="error">${err}</span>`);
     };
+
+    stop_button.onclick = (e) => {
+        if (currentWallet == null) {
+            return;
+        }
+
+        e.preventDefault();
+
+        currentWallet.free();
+        start_message.innerHTML = "Wallet instance destroyed";
+
+        start_button.disabled = false;
+        stop_button.disabled = true;
+
+        descriptor.disabled = false;
+        change_descriptor.disabled = false;
+    };
+
+    const policy = document.getElementById('policy');
+    const compiler_script_type = document.getElementById('compiler_script_type');
+    const compiler_output = document.getElementById('compiler_output');
+    const compile_button = document.getElementById('compile_button');
+    compile_button.onclick = (e) => {
+        if (policy.value.length == 0) {
+            return;
+        }
+
+        e.preventDefault();
+
+        const single = !e.target.form.elements.namedItem('alias').length;
+
+        let elements_alias = e.target.form.elements.namedItem('alias');
+        let elements_type = e.target.form.elements.namedItem('type');
+        let elements_extra = e.target.form.elements.namedItem('extra');
+
+        if (single) {
+            elements_alias = [elements_alias];
+            elements_type = [elements_type];
+            elements_extra = [elements_extra];
+        } else {
+            elements_alias = Array.from(elements_alias);
+            elements_type = Array.from(elements_type);
+            elements_extra = Array.from(elements_extra);
+        }
+
+        const aliases = {};
+        elements_alias.forEach((alias) => {
+            const type = elements_type.filter((x) => x.attributes["data-index"].value == alias.attributes["data-index"].value)[0].value;
+            const extra = elements_extra.filter((x) => x.attributes["data-index"].value == alias.attributes["data-index"].value)[0].value;
+            const aliasValue = alias.value;
+
+            aliases[aliasValue] = { type, extra };
+        });
+
+        compile(policy.value, JSON.stringify(aliases), compiler_script_type.value)
+            .then(res => compiler_output.innerHTML = res)
+            .catch(err => compiler_output.innerHTML = `<span class="error">${err}</span>`);
+    }
 })();
index 4f248e8ddd551ff4a83e25654e2ee5f47f43a607..16c27aa7cdbdb29315c33fb1f62d3c37d4156c79 100644 (file)
@@ -1 +1 @@
-(window.webpackJsonp=window.webpackJsonp||[]).push([[1],[,function(n,t,e){"use strict";e.r(t);var r=e(2);!async function(){Object(r.gb)(),document.getElementById("stdin").disabled=!0;const n=document.getElementById("start_button"),t=document.getElementById("start_message");n.disabled=!1;const e=document.getElementById("descriptor"),u=document.getElementById("change_descriptor");n.onclick=o=>{0!=e.value.length&&(o.preventDefault(),async function(n,t){const e=document.getElementById("stdout"),u=document.getElementById("stdin");u.disabled=!1;const o=[];let c=0;const i=await new r.a("testnet",n,t,"https://blockstream.info/testnet/"),f=n=>{if("clear"!=n)return u.disabled=!0,e.innerHTML.length>0&&(e.innerHTML+="\n"),e.innerHTML+=`<span class="command">> ${n}</span>\n`,c=o.push(n),i.run(n).then(n=>{n&&(e.innerHTML+=`<span class="success">${n}</span>\n`)}).catch(n=>e.innerHTML+=`<span class="error">${n}</span>\n`).finally(()=>{u.disabled=!1,e.scrollTop=e.scrollHeight-e.clientHeight});e.innerHTML=""};return u.onkeydown=n=>{if("Enter"==n.key){if(0==u.value.length)return;f(u.value),u.value="",n.preventDefault()}else"ArrowUp"==n.key?c>0&&(u.value=o[--c]):"ArrowDown"==n.key&&c<o.length&&(u.value=o[++c]||"")},{run:f}}(e.value,u.value.length>0?u.value:null).then(r=>{n.disabled=!0,e.disabled=!0,u.disabled=!0,t.innerHTML="Wallet created, running `sync`...",r.run("sync").then(()=>t.innerHTML="Ready!")}).catch(n=>t.innerHTML=`<span class="error">${n}</span>`))}}()},function(n,t,e){"use strict";(function(n,r){e.d(t,"gb",(function(){return j})),e.d(t,"a",(function(){return x})),e.d(t,"cb",(function(){return E})),e.d(t,"eb",(function(){return O})),e.d(t,"Q",(function(){return H})),e.d(t,"x",(function(){return A})),e.d(t,"J",(function(){return I})),e.d(t,"j",(function(){return M})),e.d(t,"Z",(function(){return B})),e.d(t,"bb",(function(){return L})),e.d(t,"q",(function(){return $})),e.d(t,"O",(function(){return P})),e.d(t,"K",(function(){return S})),e.d(t,"o",(function(){return D})),e.d(t,"c",(function(){return _})),e.d(t,"L",(function(){return R})),e.d(t,"r",(function(){return F})),e.d(t,"z",(function(){return J})),e.d(t,"b",(function(){return U})),e.d(t,"C",(function(){return q})),e.d(t,"g",(function(){return N})),e.d(t,"i",(function(){return W})),e.d(t,"p",(function(){return C})),e.d(t,"u",(function(){return z})),e.d(t,"R",(function(){return G})),e.d(t,"k",(function(){return K})),e.d(t,"T",(function(){return Q})),e.d(t,"W",(function(){return V})),e.d(t,"X",(function(){return X})),e.d(t,"D",(function(){return Y})),e.d(t,"h",(function(){return Z})),e.d(t,"P",(function(){return nn})),e.d(t,"s",(function(){return tn})),e.d(t,"A",(function(){return en})),e.d(t,"f",(function(){return rn})),e.d(t,"e",(function(){return un})),e.d(t,"E",(function(){return on})),e.d(t,"y",(function(){return cn})),e.d(t,"v",(function(){return fn})),e.d(t,"F",(function(){return ln})),e.d(t,"N",(function(){return dn})),e.d(t,"M",(function(){return sn})),e.d(t,"G",(function(){return an})),e.d(t,"S",(function(){return bn})),e.d(t,"m",(function(){return yn})),e.d(t,"n",(function(){return pn})),e.d(t,"Y",(function(){return gn})),e.d(t,"d",(function(){return hn})),e.d(t,"B",(function(){return wn})),e.d(t,"w",(function(){return mn})),e.d(t,"I",(function(){return vn})),e.d(t,"t",(function(){return Tn})),e.d(t,"l",(function(){return jn})),e.d(t,"H",(function(){return kn})),e.d(t,"db",(function(){return xn})),e.d(t,"V",(function(){return En})),e.d(t,"fb",(function(){return On})),e.d(t,"ab",(function(){return Hn})),e.d(t,"U",(function(){return An}));var u=e(5);const o=new Array(32).fill(void 0);function c(n){return o[n]}o.push(void 0,null,!0,!1);let i=o.length;function f(n){const t=c(n);return function(n){n<36||(o[n]=i,i=n)}(n),t}let l=new("undefined"==typeof TextDecoder?(0,n.require)("util").TextDecoder:TextDecoder)("utf-8",{ignoreBOM:!0,fatal:!0});l.decode();let d=null;function s(){return null!==d&&d.buffer===u.i.buffer||(d=new Uint8Array(u.i.buffer)),d}function a(n,t){return l.decode(s().subarray(n,n+t))}function b(n){i===o.length&&o.push(o.length+1);const t=i;return i=o[t],o[t]=n,t}let y=0;let p=new("undefined"==typeof TextEncoder?(0,n.require)("util").TextEncoder:TextEncoder)("utf-8");const g="function"==typeof p.encodeInto?function(n,t){return p.encodeInto(n,t)}:function(n,t){const e=p.encode(n);return t.set(e),{read:n.length,written:e.length}};function h(n,t,e){if(void 0===e){const e=p.encode(n),r=t(e.length);return s().subarray(r,r+e.length).set(e),y=e.length,r}let r=n.length,u=t(r);const o=s();let c=0;for(;c<r;c++){const t=n.charCodeAt(c);if(t>127)break;o[u+c]=t}if(c!==r){0!==c&&(n=n.slice(c)),u=e(u,r,r=c+3*n.length);const t=s().subarray(u+c,u+r);c+=g(n,t).written}return y=c,u}let w=null;function m(){return null!==w&&w.buffer===u.i.buffer||(w=new Int32Array(u.i.buffer)),w}function v(n){return null==n}function T(n,t,e){u.g(n,t,b(e))}function j(){u.h()}function k(n){return function(){try{return n.apply(this,arguments)}catch(n){u.b(b(n))}}}class x{static __wrap(n){const t=Object.create(x.prototype);return t.ptr=n,t}free(){const n=this.ptr;this.ptr=0,u.a(n)}constructor(n,t,e,r){var o=h(n,u.e,u.f),c=y,i=h(t,u.e,u.f),l=y,d=v(e)?0:h(e,u.e,u.f),s=y,a=h(r,u.e,u.f),b=y;return f(u.j(o,c,i,l,d,s,a,b))}run(n){var t=h(n,u.e,u.f),e=y;return f(u.k(this.ptr,t,e))}}const E=function(n){f(n)},O=function(n,t){return b(a(n,t))},H=function(n){return b(x.__wrap(n))},A=function(){return b(new Error)},I=function(n,t){var e=h(c(t).stack,u.e,u.f),r=y;m()[n/4+1]=r,m()[n/4+0]=e},M=function(n,t){try{console.error(a(n,t))}finally{u.d(n,t)}},B=function(n,t){const e=c(t);var r=h(JSON.stringify(void 0===e?null:e),u.e,u.f),o=y;m()[n/4+1]=o,m()[n/4+0]=r},L=function(n){return b(c(n))},$=function(n){return c(n)instanceof Response},P=function(n,t){var e=h(c(t).url,u.e,u.f),r=y;m()[n/4+1]=r,m()[n/4+0]=e},S=function(n){return c(n).status},D=function(n){return b(c(n).headers)},_=k((function(n){return b(c(n).arrayBuffer())})),R=k((function(n){return b(c(n).text())})),F=function(n){return c(n)instanceof Window},J=k((function(){return b(new Headers)})),U=k((function(n,t,e,r,u){c(n).append(a(t,e),a(r,u))})),q=k((function(n,t,e){return b(new Request(a(n,t),c(e)))})),N=function(n){console.debug(c(n))},W=function(n){console.error(c(n))},C=function(n){console.info(c(n))},z=function(n){console.log(c(n))},G=function(n){console.warn(c(n))},K=function(n,t){return b(c(n).fetch(c(t)))},Q=function(n){const t=f(n).original;if(1==t.cnt--)return t.a=0,!0;return!1},V=function(n){return"function"==typeof c(n)},X=function(n){const t=c(n);return"object"==typeof t&&null!==t},Y=function(n){return b(c(n).next)},Z=function(n){return c(n).done},nn=function(n){return b(c(n).value)},tn=function(){return b(Symbol.iterator)},en=function(n,t){return b(new Function(a(n,t)))},rn=k((function(n,t){return b(c(n).call(c(t)))})),un=k((function(n,t,e){return b(c(n).call(c(t),c(e)))})),on=k((function(n){return b(c(n).next())})),cn=function(){return b(new Object)},fn=function(n,t){try{var e={a:n,b:t},r=new Promise((n,t)=>{const r=e.a;e.a=0;try{return function(n,t,e,r){u.l(n,t,b(e),b(r))}(r,e.b,n,t)}finally{e.a=r}});return b(r)}finally{e.a=e.b=0}},ln=function(n){return b(Promise.resolve(c(n)))},dn=function(n,t){return b(c(n).then(c(t)))},sn=function(n,t,e){return b(c(n).then(c(t),c(e)))},an=k((function(){return b(self.self)})),bn=k((function(){return b(window.window)})),yn=k((function(){return b(globalThis.globalThis)})),pn=k((function(){return b(r.global)})),gn=function(n){return void 0===c(n)},hn=function(n){return b(c(n).buffer)},wn=function(n,t,e){return b(new Uint8Array(c(n),t>>>0,e>>>0))},mn=function(n){return b(new Uint8Array(c(n)))},vn=function(n,t,e){c(n).set(c(t),e>>>0)},Tn=function(n){return c(n).length},jn=k((function(n,t){return b(Reflect.get(c(n),c(t)))})),kn=k((function(n,t,e){return Reflect.set(c(n),c(t),c(e))})),xn=function(n,t){const e=c(t);var r="string"==typeof e?e:void 0,o=v(r)?0:h(r,u.e,u.f),i=y;m()[n/4+1]=i,m()[n/4+0]=o},En=function(n,t){var e=h(function n(t){const e=typeof t;if("number"==e||"boolean"==e||null==t)return""+t;if("string"==e)return`"${t}"`;if("symbol"==e){const n=t.description;return null==n?"Symbol":`Symbol(${n})`}if("function"==e){const n=t.name;return"string"==typeof n&&n.length>0?`Function(${n})`:"Function"}if(Array.isArray(t)){const e=t.length;let r="[";e>0&&(r+=n(t[0]));for(let u=1;u<e;u++)r+=", "+n(t[u]);return r+="]",r}const r=/\[object ([^\]]+)\]/.exec(toString.call(t));let u;if(!(r.length>1))return toString.call(t);if(u=r[1],"Object"==u)try{return"Object("+JSON.stringify(t)+")"}catch(n){return"Object"}return t instanceof Error?`${t.name}: ${t.message}\n${t.stack}`:u}(c(t)),u.e,u.f),r=y;m()[n/4+1]=r,m()[n/4+0]=e},On=function(n,t){throw new Error(a(n,t))},Hn=function(){return b(u.i)},An=function(n,t,e){return b(function(n,t,e,r){const o={a:n,b:t,cnt:1},c=(...n)=>{o.cnt++;const t=o.a;o.a=0;try{return r(t,o.b,...n)}finally{0==--o.cnt?u.c.get(e)(t,o.b):o.a=t}};return c.original=o,c}(n,t,890,T))}}).call(this,e(3)(n),e(4))},function(n,t){n.exports=function(n){if(!n.webpackPolyfill){var t=Object.create(n);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},function(n,t){var e;e=function(){return this}();try{e=e||new Function("return this")()}catch(n){"object"==typeof window&&(e=window)}n.exports=e},function(n,t,e){"use strict";var r=e.w[n.i];n.exports=r;e(2);r.m()}]]);
\ No newline at end of file
+(window.webpackJsonp=window.webpackJsonp||[]).push([[1],[,function(n,t,e){"use strict";e.r(t);var r=e(2);!async function(){Object(r.qb)();let n=null;document.getElementById("stdin").disabled=!0;const t=document.getElementById("start_button"),e=document.getElementById("stop_button"),u=document.getElementById("start_message");t.disabled=!1,e.disabled=!0;const o=document.getElementById("descriptor"),c=document.getElementById("change_descriptor");t.onclick=i=>{0!=o.value.length&&(i.preventDefault(),async function(n,t){const e=document.getElementById("stdout"),u=document.getElementById("stdin");u.disabled=!1;const o=[];let c=0;const i=await new r.a("testnet",n,t,"https://blockstream.info/testnet/"),f=n=>{if("clear"!=n)return u.disabled=!0,e.innerHTML.length>0&&(e.innerHTML+="\n"),e.innerHTML+=`<span class="command">> ${n}</span>\n`,c=o.push(n),i.run(n).then(n=>{n&&(e.innerHTML+=`<span class="success">${n}</span>\n`)}).catch(n=>e.innerHTML+=`<span class="error">${n}</span>\n`).finally(()=>{u.disabled=!1,e.scrollTop=e.scrollHeight-e.clientHeight});e.innerHTML=""};return u.onkeydown=n=>{if("Enter"==n.key){if(0==u.value.length)return;f(u.value),u.value="",n.preventDefault()}else"ArrowUp"==n.key?c>0&&(u.value=o[--c]):"ArrowDown"==n.key&&c<o.length&&(u.value=o[++c]||"")},{run:f}}(o.value,c.value.length>0?c.value:null).then(r=>{t.disabled=!0,o.disabled=!0,c.disabled=!0,u.innerHTML="Wallet created, running `sync`...",r.run("sync").then(()=>u.innerHTML="Ready!"),n=r,e.disabled=!1}).catch(n=>u.innerHTML=`<span class="error">${n}</span>`))},e.onclick=r=>{null!=n&&(r.preventDefault(),n.free(),u.innerHTML="Wallet instance destroyed",t.disabled=!1,e.disabled=!0,o.disabled=!1,c.disabled=!1)};const i=document.getElementById("policy"),f=document.getElementById("compiler_script_type"),l=document.getElementById("compiler_output");document.getElementById("compile_button").onclick=n=>{if(0==i.value.length)return;n.preventDefault();const t=!n.target.form.elements.namedItem("alias").length;let e=n.target.form.elements.namedItem("alias"),u=n.target.form.elements.namedItem("type"),o=n.target.form.elements.namedItem("extra");t?(e=[e],u=[u],o=[o]):(e=Array.from(e),u=Array.from(u),o=Array.from(o));const c={};e.forEach(n=>{const t=u.filter(t=>t.attributes["data-index"].value==n.attributes["data-index"].value)[0].value,e=o.filter(t=>t.attributes["data-index"].value==n.attributes["data-index"].value)[0].value,r=n.value;c[r]={type:t,extra:e}}),Object(r.pb)(i.value,JSON.stringify(c),f.value).then(n=>l.innerHTML=n).catch(n=>l.innerHTML=`<span class="error">${n}</span>`)}}()},function(n,t,e){"use strict";(function(n,r){e.d(t,"qb",(function(){return T})),e.d(t,"pb",(function(){return x})),e.d(t,"a",(function(){return k})),e.d(t,"nb",(function(){return O})),e.d(t,"Y",(function(){return H})),e.d(t,"lb",(function(){return B})),e.d(t,"C",(function(){return M})),e.d(t,"R",(function(){return A})),e.d(t,"l",(function(){return L})),e.d(t,"hb",(function(){return _})),e.d(t,"u",(function(){return D})),e.d(t,"W",(function(){return $})),e.d(t,"S",(function(){return S})),e.d(t,"s",(function(){return F})),e.d(t,"c",(function(){return P})),e.d(t,"T",(function(){return R})),e.d(t,"v",(function(){return U})),e.d(t,"m",(function(){return q})),e.d(t,"H",(function(){return J})),e.d(t,"E",(function(){return N})),e.d(t,"b",(function(){return W})),e.d(t,"kb",(function(){return C})),e.d(t,"i",(function(){return V})),e.d(t,"k",(function(){return z})),e.d(t,"t",(function(){return G})),e.d(t,"y",(function(){return K})),e.d(t,"Z",(function(){return Q})),e.d(t,"A",(function(){return X})),e.d(t,"g",(function(){return Y})),e.d(t,"ib",(function(){return Z})),e.d(t,"N",(function(){return nn})),e.d(t,"h",(function(){return tn})),e.d(t,"gb",(function(){return en})),e.d(t,"n",(function(){return rn})),e.d(t,"L",(function(){return un})),e.d(t,"o",(function(){return on})),e.d(t,"K",(function(){return cn})),e.d(t,"bb",(function(){return fn})),e.d(t,"eb",(function(){return ln})),e.d(t,"fb",(function(){return an})),e.d(t,"I",(function(){return dn})),e.d(t,"j",(function(){return sn})),e.d(t,"X",(function(){return bn})),e.d(t,"w",(function(){return yn})),e.d(t,"F",(function(){return pn})),e.d(t,"f",(function(){return mn})),e.d(t,"e",(function(){return gn})),e.d(t,"J",(function(){return hn})),e.d(t,"D",(function(){return wn})),e.d(t,"z",(function(){return vn})),e.d(t,"M",(function(){return En})),e.d(t,"V",(function(){return Tn})),e.d(t,"U",(function(){return xn})),e.d(t,"O",(function(){return jn})),e.d(t,"ab",(function(){return In})),e.d(t,"q",(function(){return kn})),e.d(t,"r",(function(){return On})),e.d(t,"d",(function(){return Hn})),e.d(t,"G",(function(){return Bn})),e.d(t,"B",(function(){return Mn})),e.d(t,"Q",(function(){return An})),e.d(t,"x",(function(){return Ln})),e.d(t,"p",(function(){return _n})),e.d(t,"P",(function(){return Dn})),e.d(t,"mb",(function(){return $n})),e.d(t,"db",(function(){return Sn})),e.d(t,"ob",(function(){return Fn})),e.d(t,"jb",(function(){return Pn})),e.d(t,"cb",(function(){return Rn}));var u=e(5);let o=new("undefined"==typeof TextDecoder?(0,n.require)("util").TextDecoder:TextDecoder)("utf-8",{ignoreBOM:!0,fatal:!0});o.decode();let c=null;function i(){return null!==c&&c.buffer===u.j.buffer||(c=new Uint8Array(u.j.buffer)),c}function f(n,t){return o.decode(i().subarray(n,n+t))}const l=new Array(32).fill(void 0);l.push(void 0,null,!0,!1);let a=l.length;function d(n){a===l.length&&l.push(l.length+1);const t=a;return a=l[t],l[t]=n,t}function s(n){return l[n]}function b(n){const t=s(n);return function(n){n<36||(l[n]=a,a=n)}(n),t}let y=0;let p=new("undefined"==typeof TextEncoder?(0,n.require)("util").TextEncoder:TextEncoder)("utf-8");const m="function"==typeof p.encodeInto?function(n,t){return p.encodeInto(n,t)}:function(n,t){const e=p.encode(n);return t.set(e),{read:n.length,written:e.length}};function g(n,t,e){if(void 0===e){const e=p.encode(n),r=t(e.length);return i().subarray(r,r+e.length).set(e),y=e.length,r}let r=n.length,u=t(r);const o=i();let c=0;for(;c<r;c++){const t=n.charCodeAt(c);if(t>127)break;o[u+c]=t}if(c!==r){0!==c&&(n=n.slice(c)),u=e(u,r,r=c+3*n.length);const t=i().subarray(u+c,u+r);c+=m(n,t).written}return y=c,u}let h=null;function w(){return null!==h&&h.buffer===u.j.buffer||(h=new Int32Array(u.j.buffer)),h}function v(n){return null==n}function E(n,t,e){u.g(n,t,d(e))}function T(){u.i()}function x(n,t,e){var r=g(n,u.e,u.f),o=y,c=g(t,u.e,u.f),i=y,f=g(e,u.e,u.f),l=y;return b(u.h(r,o,c,i,f,l))}function j(n){return function(){try{return n.apply(this,arguments)}catch(n){u.b(d(n))}}}function I(n,t){return i().subarray(n/1,n/1+t)}class k{static __wrap(n){const t=Object.create(k.prototype);return t.ptr=n,t}free(){const n=this.ptr;this.ptr=0,u.a(n)}constructor(n,t,e,r){var o=g(n,u.e,u.f),c=y,i=g(t,u.e,u.f),f=y,l=v(e)?0:g(e,u.e,u.f),a=y,d=g(r,u.e,u.f),s=y;return b(u.k(o,c,i,f,l,a,d,s))}run(n){var t=g(n,u.e,u.f),e=y;return b(u.l(this.ptr,t,e))}}const O=function(n,t){return d(f(n,t))},H=function(n){return d(k.__wrap(n))},B=function(n){b(n)},M=function(){return d(new Error)},A=function(n,t){var e=g(s(t).stack,u.e,u.f),r=y;w()[n/4+1]=r,w()[n/4+0]=e},L=function(n,t){try{console.error(f(n,t))}finally{u.d(n,t)}},_=function(n,t){const e=s(t);var r=g(JSON.stringify(void 0===e?null:e),u.e,u.f),o=y;w()[n/4+1]=o,w()[n/4+0]=r},D=function(n){return s(n)instanceof Response},$=function(n,t){var e=g(s(t).url,u.e,u.f),r=y;w()[n/4+1]=r,w()[n/4+0]=e},S=function(n){return s(n).status},F=function(n){return d(s(n).headers)},P=j((function(n){return d(s(n).arrayBuffer())})),R=j((function(n){return d(s(n).text())})),U=function(n){return s(n)instanceof Window},q=function(n,t){return d(s(n).fetch(s(t)))},J=j((function(n,t,e){return d(new Request(f(n,t),s(e)))})),N=j((function(){return d(new Headers)})),W=j((function(n,t,e,r,u){s(n).append(f(t,e),f(r,u))})),C=function(n){return d(s(n))},V=function(n){console.debug(s(n))},z=function(n){console.error(s(n))},G=function(n){console.info(s(n))},K=function(n){console.log(s(n))},Q=function(n){console.warn(s(n))},X=function(n,t){return d(new Function(f(n,t)))},Y=function(n,t){return d(s(n).call(s(t)))},Z=function(n,t){return s(n)===s(t)},nn=function(n){return d(s(n).self)},tn=function(n){return d(s(n).crypto)},en=function(n){return void 0===s(n)},rn=function(n){return d(s(n).getRandomValues)},un=function(n,t){return d(e(6)(f(n,t)))},on=function(n,t,e){s(n).getRandomValues(I(t,e))},cn=function(n,t,e){s(n).randomFillSync(I(t,e))},fn=function(n){const t=b(n).original;if(1==t.cnt--)return t.a=0,!0;return!1},ln=function(n){return"function"==typeof s(n)},an=function(n){const t=s(n);return"object"==typeof t&&null!==t},dn=function(n){return d(s(n).next)},sn=function(n){return s(n).done},bn=function(n){return d(s(n).value)},yn=function(){return d(Symbol.iterator)},pn=function(n,t){return d(new Function(f(n,t)))},mn=j((function(n,t){return d(s(n).call(s(t)))})),gn=j((function(n,t,e){return d(s(n).call(s(t),s(e)))})),hn=j((function(n){return d(s(n).next())})),wn=function(){return d(new Object)},vn=function(n,t){try{var e={a:n,b:t},r=new Promise((n,t)=>{const r=e.a;e.a=0;try{return function(n,t,e,r){u.m(n,t,d(e),d(r))}(r,e.b,n,t)}finally{e.a=r}});return d(r)}finally{e.a=e.b=0}},En=function(n){return d(Promise.resolve(s(n)))},Tn=function(n,t){return d(s(n).then(s(t)))},xn=function(n,t,e){return d(s(n).then(s(t),s(e)))},jn=j((function(){return d(self.self)})),In=j((function(){return d(window.window)})),kn=j((function(){return d(globalThis.globalThis)})),On=j((function(){return d(r.global)})),Hn=function(n){return d(s(n).buffer)},Bn=function(n,t,e){return d(new Uint8Array(s(n),t>>>0,e>>>0))},Mn=function(n){return d(new Uint8Array(s(n)))},An=function(n,t,e){s(n).set(s(t),e>>>0)},Ln=function(n){return s(n).length},_n=j((function(n,t){return d(Reflect.get(s(n),s(t)))})),Dn=j((function(n,t,e){return Reflect.set(s(n),s(t),s(e))})),$n=function(n,t){const e=s(t);var r="string"==typeof e?e:void 0,o=v(r)?0:g(r,u.e,u.f),c=y;w()[n/4+1]=c,w()[n/4+0]=o},Sn=function(n,t){var e=g(function n(t){const e=typeof t;if("number"==e||"boolean"==e||null==t)return""+t;if("string"==e)return`"${t}"`;if("symbol"==e){const n=t.description;return null==n?"Symbol":`Symbol(${n})`}if("function"==e){const n=t.name;return"string"==typeof n&&n.length>0?`Function(${n})`:"Function"}if(Array.isArray(t)){const e=t.length;let r="[";e>0&&(r+=n(t[0]));for(let u=1;u<e;u++)r+=", "+n(t[u]);return r+="]",r}const r=/\[object ([^\]]+)\]/.exec(toString.call(t));let u;if(!(r.length>1))return toString.call(t);if(u=r[1],"Object"==u)try{return"Object("+JSON.stringify(t)+")"}catch(n){return"Object"}return t instanceof Error?`${t.name}: ${t.message}\n${t.stack}`:u}(s(t)),u.e,u.f),r=y;w()[n/4+1]=r,w()[n/4+0]=e},Fn=function(n,t){throw new Error(f(n,t))},Pn=function(){return d(u.j)},Rn=function(n,t,e){return d(function(n,t,e,r){const o={a:n,b:t,cnt:1},c=(...n)=>{o.cnt++;const t=o.a;o.a=0;try{return r(t,o.b,...n)}finally{0==--o.cnt?u.c.get(e)(t,o.b):o.a=t}};return c.original=o,c}(n,t,1024,E))}}).call(this,e(3)(n),e(4))},function(n,t){n.exports=function(n){if(!n.webpackPolyfill){var t=Object.create(n);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},function(n,t){var e;e=function(){return this}();try{e=e||new Function("return this")()}catch(n){"object"==typeof window&&(e=window)}n.exports=e},function(n,t,e){"use strict";var r=e.w[n.i];n.exports=r;e(2);r.n()},function(n,t){function e(n){var t=new Error("Cannot find module '"+n+"'");throw t.code="MODULE_NOT_FOUND",t}e.keys=function(){return[]},e.resolve=e,n.exports=e,e.id=6}]]);
\ No newline at end of file
diff --git a/static/repl/playground/2e3919bf1973cb5d2596.module.wasm b/static/repl/playground/2e3919bf1973cb5d2596.module.wasm
new file mode 100644 (file)
index 0000000..baffefe
Binary files /dev/null and b/static/repl/playground/2e3919bf1973cb5d2596.module.wasm differ
diff --git a/static/repl/playground/ceebc76efac5daa13e2d.module.wasm b/static/repl/playground/ceebc76efac5daa13e2d.module.wasm
deleted file mode 100644 (file)
index 6812fe3..0000000
Binary files a/static/repl/playground/ceebc76efac5daa13e2d.module.wasm and /dev/null differ
index f926328dab6b214ca9a15903c3b9840a557d87fa..3d04d75f17f8226021c4b5c35220524a0d7de38d 100644 (file)
@@ -1 +1 @@
-!function(e){function n(n){for(var t,o,_=n[0],u=n[1],c=0,i=[];c<_.length;c++)o=_[c],Object.prototype.hasOwnProperty.call(r,o)&&r[o]&&i.push(r[o][0]),r[o]=0;for(t in u)Object.prototype.hasOwnProperty.call(u,t)&&(e[t]=u[t]);for(a&&a(n);i.length;)i.shift()()}var t={},r={0:0};var o={};var _={5:function(){return{"./wasm_esplora_bg.js":{__wbindgen_object_drop_ref:function(e){return t[2].exports.cb(e)},__wbindgen_string_new:function(e,n){return t[2].exports.eb(e,n)},__wbg_walletwrapper_new:function(e){return t[2].exports.Q(e)},__wbg_new_59cb74e423758ede:function(){return t[2].exports.x()},__wbg_stack_558ba5917b466edd:function(e,n){return t[2].exports.J(e,n)},__wbg_error_4bb6c2a97407129a:function(e,n){return t[2].exports.j(e,n)},__wbindgen_json_serialize:function(e,n){return t[2].exports.Z(e,n)},__wbindgen_object_clone_ref:function(e){return t[2].exports.bb(e)},__wbg_instanceof_Response_64fe4248a574e920:function(e){return t[2].exports.q(e)},__wbg_url_f587fb788a95e5f4:function(e,n){return t[2].exports.O(e,n)},__wbg_status_5aa511c8aa1732bf:function(e){return t[2].exports.K(e)},__wbg_headers_9753444e56c26bcd:function(e){return t[2].exports.o(e)},__wbg_arrayBuffer_74898c32f31aed64:function(e){return t[2].exports.c(e)},__wbg_text_39a4ddf8fca1ea2a:function(e){return t[2].exports.L(e)},__wbg_instanceof_Window_17fdb5cd280d476d:function(e){return t[2].exports.r(e)},__wbg_new_d880804c2a502f2b:function(){return t[2].exports.z()},__wbg_append_40ec8ce4c7236944:function(e,n,r,o,_){return t[2].exports.b(e,n,r,o,_)},__wbg_newwithstrandinit_48a2ea56c3a4ef8e:function(e,n,r){return t[2].exports.C(e,n,r)},__wbg_debug_71c3576093c70eeb:function(e){return t[2].exports.g(e)},__wbg_error_20ef23c2407793d3:function(e){return t[2].exports.i(e)},__wbg_info_117ff5fa76cbb0fa:function(e){return t[2].exports.p(e)},__wbg_log_eb1108411ecc4a7f:function(e){return t[2].exports.u(e)},__wbg_warn_0361b900e14db42e:function(e){return t[2].exports.R(e)},__wbg_fetch_8047bcf6e8caf7db:function(e,n){return t[2].exports.k(e,n)},__wbindgen_cb_drop:function(e){return t[2].exports.T(e)},__wbindgen_is_function:function(e){return t[2].exports.W(e)},__wbindgen_is_object:function(e){return t[2].exports.X(e)},__wbg_next_3d6c9b2822b18fae:function(e){return t[2].exports.D(e)},__wbg_done_a16709ea72553788:function(e){return t[2].exports.h(e)},__wbg_value_3093fb48085878da:function(e){return t[2].exports.P(e)},__wbg_iterator_f89e8caf932523b1:function(){return t[2].exports.s()},__wbg_newnoargs_8aad4a6554f38345:function(e,n){return t[2].exports.A(e,n)},__wbg_call_1f85aaa5836dfb23:function(e,n){return t[2].exports.f(e,n)},__wbg_call_0246f1c8ff252fb6:function(e,n,r){return t[2].exports.e(e,n,r)},__wbg_next_d2c829783697bd8e:function(e){return t[2].exports.E(e)},__wbg_new_d6227c3c833572bb:function(){return t[2].exports.y()},__wbg_new_09f2ad087112acf0:function(e,n){return t[2].exports.v(e,n)},__wbg_resolve_708df7651c8929b8:function(e){return t[2].exports.F(e)},__wbg_then_8c23dce80c84c8fb:function(e,n){return t[2].exports.N(e,n)},__wbg_then_300153bb889a5b4b:function(e,n,r){return t[2].exports.M(e,n,r)},__wbg_self_c0d3a5923e013647:function(){return t[2].exports.G()},__wbg_window_7ee6c8be3432927d:function(){return t[2].exports.S()},__wbg_globalThis_c6de1d938e089cf0:function(){return t[2].exports.m()},__wbg_global_c9a01ce4680907f8:function(){return t[2].exports.n()},__wbindgen_is_undefined:function(e){return t[2].exports.Y(e)},__wbg_buffer_eb5185aa4a8e9c62:function(e){return t[2].exports.d(e)},__wbg_newwithbyteoffsetandlength_772fe1865bed3e65:function(e,n,r){return t[2].exports.B(e,n,r)},__wbg_new_3d94e83f0a6bf252:function(e){return t[2].exports.w(e)},__wbg_set_d4d7629a896d4b3e:function(e,n,r){return t[2].exports.I(e,n,r)},__wbg_length_2e324c9c0e74a81d:function(e){return t[2].exports.t(e)},__wbg_get_f2faf882de3801f1:function(e,n){return t[2].exports.l(e,n)},__wbg_set_6a666216929b0387:function(e,n,r){return t[2].exports.H(e,n,r)},__wbindgen_string_get:function(e,n){return t[2].exports.db(e,n)},__wbindgen_debug_string:function(e,n){return t[2].exports.V(e,n)},__wbindgen_throw:function(e,n){return t[2].exports.fb(e,n)},__wbindgen_memory:function(){return t[2].exports.ab()},__wbindgen_closure_wrapper5122:function(e,n,r){return t[2].exports.U(e,n,r)}}}}};function u(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,u),r.l=!0,r.exports}u.e=function(e){var n=[],t=r[e];if(0!==t)if(t)n.push(t[2]);else{var c=new Promise((function(n,o){t=r[e]=[n,o]}));n.push(t[2]=c);var i,f=document.createElement("script");f.charset="utf-8",f.timeout=120,u.nc&&f.setAttribute("nonce",u.nc),f.src=function(e){return u.p+""+e+".playground.js"}(e);var a=new Error;i=function(n){f.onerror=f.onload=null,clearTimeout(s);var t=r[e];if(0!==t){if(t){var o=n&&("load"===n.type?"missing":n.type),_=n&&n.target&&n.target.src;a.message="Loading chunk "+e+" failed.\n("+o+": "+_+")",a.name="ChunkLoadError",a.type=o,a.request=_,t[1](a)}r[e]=void 0}};var s=setTimeout((function(){i({type:"timeout",target:f})}),12e4);f.onerror=f.onload=i,document.head.appendChild(f)}return({1:[5]}[e]||[]).forEach((function(e){var t=o[e];if(t)n.push(t);else{var r,c=_[e](),i=fetch(u.p+""+{5:"ceebc76efac5daa13e2d"}[e]+".module.wasm");if(c instanceof Promise&&"function"==typeof WebAssembly.compileStreaming)r=Promise.all([WebAssembly.compileStreaming(i),c]).then((function(e){return WebAssembly.instantiate(e[0],e[1])}));else if("function"==typeof WebAssembly.instantiateStreaming)r=WebAssembly.instantiateStreaming(i,c);else{r=i.then((function(e){return e.arrayBuffer()})).then((function(e){return WebAssembly.instantiate(e,c)}))}n.push(o[e]=r.then((function(n){return u.w[e]=(n.instance||n).exports})))}})),Promise.all(n)},u.m=e,u.c=t,u.d=function(e,n,t){u.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:t})},u.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},u.t=function(e,n){if(1&n&&(e=u(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(u.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var r in e)u.d(t,r,function(n){return e[n]}.bind(null,r));return t},u.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(n,"a",n),n},u.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},u.p="/repl/playground/",u.oe=function(e){throw console.error(e),e},u.w={};var c=window.webpackJsonp=window.webpackJsonp||[],i=c.push.bind(c);c.push=n,c=c.slice();for(var f=0;f<c.length;f++)n(c[f]);var a=i;u(u.s=0)}([function(e,n,t){t.e(1).then(t.bind(null,1)).catch(e=>console.error("Error importing `index.js`:",e))}]);
\ No newline at end of file
+!function(e){function n(n){for(var t,o,_=n[0],u=n[1],c=0,i=[];c<_.length;c++)o=_[c],Object.prototype.hasOwnProperty.call(r,o)&&r[o]&&i.push(r[o][0]),r[o]=0;for(t in u)Object.prototype.hasOwnProperty.call(u,t)&&(e[t]=u[t]);for(b&&b(n);i.length;)i.shift()()}var t={},r={0:0};var o={};var _={5:function(){return{"./magical_bitcoin_wallet_playground_bg.js":{__wbindgen_string_new:function(e,n){return t[2].exports.nb(e,n)},__wbg_walletwrapper_new:function(e){return t[2].exports.Y(e)},__wbindgen_object_drop_ref:function(e){return t[2].exports.lb(e)},__wbg_new_59cb74e423758ede:function(){return t[2].exports.C()},__wbg_stack_558ba5917b466edd:function(e,n){return t[2].exports.R(e,n)},__wbg_error_4bb6c2a97407129a:function(e,n){return t[2].exports.l(e,n)},__wbindgen_json_serialize:function(e,n){return t[2].exports.hb(e,n)},__wbg_instanceof_Response_64fe4248a574e920:function(e){return t[2].exports.u(e)},__wbg_url_f587fb788a95e5f4:function(e,n){return t[2].exports.W(e,n)},__wbg_status_5aa511c8aa1732bf:function(e){return t[2].exports.S(e)},__wbg_headers_9753444e56c26bcd:function(e){return t[2].exports.s(e)},__wbg_arrayBuffer_74898c32f31aed64:function(e){return t[2].exports.c(e)},__wbg_text_39a4ddf8fca1ea2a:function(e){return t[2].exports.T(e)},__wbg_instanceof_Window_17fdb5cd280d476d:function(e){return t[2].exports.v(e)},__wbg_fetch_8047bcf6e8caf7db:function(e,n){return t[2].exports.m(e,n)},__wbg_newwithstrandinit_48a2ea56c3a4ef8e:function(e,n,r){return t[2].exports.H(e,n,r)},__wbg_new_d880804c2a502f2b:function(){return t[2].exports.E()},__wbg_append_40ec8ce4c7236944:function(e,n,r,o,_){return t[2].exports.b(e,n,r,o,_)},__wbindgen_object_clone_ref:function(e){return t[2].exports.kb(e)},__wbg_debug_71c3576093c70eeb:function(e){return t[2].exports.i(e)},__wbg_error_20ef23c2407793d3:function(e){return t[2].exports.k(e)},__wbg_info_117ff5fa76cbb0fa:function(e){return t[2].exports.t(e)},__wbg_log_eb1108411ecc4a7f:function(e){return t[2].exports.y(e)},__wbg_warn_0361b900e14db42e:function(e){return t[2].exports.Z(e)},__wbg_new_3a746f2619705add:function(e,n){return t[2].exports.A(e,n)},__wbg_call_f54d3a6dadb199ca:function(e,n){return t[2].exports.g(e,n)},__wbindgen_jsval_eq:function(e,n){return t[2].exports.ib(e,n)},__wbg_self_ac379e780a0d8b94:function(e){return t[2].exports.N(e)},__wbg_crypto_1e4302b85d4f64a2:function(e){return t[2].exports.h(e)},__wbindgen_is_undefined:function(e){return t[2].exports.gb(e)},__wbg_getRandomValues_1b4ba144162a5c9e:function(e){return t[2].exports.n(e)},__wbg_require_6461b1e9a0d7c34a:function(e,n){return t[2].exports.L(e,n)},__wbg_getRandomValues_1ef11e888e5228e9:function(e,n,r){return t[2].exports.o(e,n,r)},__wbg_randomFillSync_1b52c8482374c55b:function(e,n,r){return t[2].exports.K(e,n,r)},__wbindgen_cb_drop:function(e){return t[2].exports.bb(e)},__wbindgen_is_function:function(e){return t[2].exports.eb(e)},__wbindgen_is_object:function(e){return t[2].exports.fb(e)},__wbg_next_3d6c9b2822b18fae:function(e){return t[2].exports.I(e)},__wbg_done_a16709ea72553788:function(e){return t[2].exports.j(e)},__wbg_value_3093fb48085878da:function(e){return t[2].exports.X(e)},__wbg_iterator_f89e8caf932523b1:function(){return t[2].exports.w()},__wbg_newnoargs_8aad4a6554f38345:function(e,n){return t[2].exports.F(e,n)},__wbg_call_1f85aaa5836dfb23:function(e,n){return t[2].exports.f(e,n)},__wbg_call_0246f1c8ff252fb6:function(e,n,r){return t[2].exports.e(e,n,r)},__wbg_next_d2c829783697bd8e:function(e){return t[2].exports.J(e)},__wbg_new_d6227c3c833572bb:function(){return t[2].exports.D()},__wbg_new_09f2ad087112acf0:function(e,n){return t[2].exports.z(e,n)},__wbg_resolve_708df7651c8929b8:function(e){return t[2].exports.M(e)},__wbg_then_8c23dce80c84c8fb:function(e,n){return t[2].exports.V(e,n)},__wbg_then_300153bb889a5b4b:function(e,n,r){return t[2].exports.U(e,n,r)},__wbg_self_c0d3a5923e013647:function(){return t[2].exports.O()},__wbg_window_7ee6c8be3432927d:function(){return t[2].exports.ab()},__wbg_globalThis_c6de1d938e089cf0:function(){return t[2].exports.q()},__wbg_global_c9a01ce4680907f8:function(){return t[2].exports.r()},__wbg_buffer_eb5185aa4a8e9c62:function(e){return t[2].exports.d(e)},__wbg_newwithbyteoffsetandlength_772fe1865bed3e65:function(e,n,r){return t[2].exports.G(e,n,r)},__wbg_new_3d94e83f0a6bf252:function(e){return t[2].exports.B(e)},__wbg_set_d4d7629a896d4b3e:function(e,n,r){return t[2].exports.Q(e,n,r)},__wbg_length_2e324c9c0e74a81d:function(e){return t[2].exports.x(e)},__wbg_get_f2faf882de3801f1:function(e,n){return t[2].exports.p(e,n)},__wbg_set_6a666216929b0387:function(e,n,r){return t[2].exports.P(e,n,r)},__wbindgen_string_get:function(e,n){return t[2].exports.mb(e,n)},__wbindgen_debug_string:function(e,n){return t[2].exports.db(e,n)},__wbindgen_throw:function(e,n){return t[2].exports.ob(e,n)},__wbindgen_memory:function(){return t[2].exports.jb()},__wbindgen_closure_wrapper5758:function(e,n,r){return t[2].exports.cb(e,n,r)}}}}};function u(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,u),r.l=!0,r.exports}u.e=function(e){var n=[],t=r[e];if(0!==t)if(t)n.push(t[2]);else{var c=new Promise((function(n,o){t=r[e]=[n,o]}));n.push(t[2]=c);var i,f=document.createElement("script");f.charset="utf-8",f.timeout=120,u.nc&&f.setAttribute("nonce",u.nc),f.src=function(e){return u.p+""+e+".playground.js"}(e);var b=new Error;i=function(n){f.onerror=f.onload=null,clearTimeout(a);var t=r[e];if(0!==t){if(t){var o=n&&("load"===n.type?"missing":n.type),_=n&&n.target&&n.target.src;b.message="Loading chunk "+e+" failed.\n("+o+": "+_+")",b.name="ChunkLoadError",b.type=o,b.request=_,t[1](b)}r[e]=void 0}};var a=setTimeout((function(){i({type:"timeout",target:f})}),12e4);f.onerror=f.onload=i,document.head.appendChild(f)}return({1:[5]}[e]||[]).forEach((function(e){var t=o[e];if(t)n.push(t);else{var r,c=_[e](),i=fetch(u.p+""+{5:"2e3919bf1973cb5d2596"}[e]+".module.wasm");if(c instanceof Promise&&"function"==typeof WebAssembly.compileStreaming)r=Promise.all([WebAssembly.compileStreaming(i),c]).then((function(e){return WebAssembly.instantiate(e[0],e[1])}));else if("function"==typeof WebAssembly.instantiateStreaming)r=WebAssembly.instantiateStreaming(i,c);else{r=i.then((function(e){return e.arrayBuffer()})).then((function(e){return WebAssembly.instantiate(e,c)}))}n.push(o[e]=r.then((function(n){return u.w[e]=(n.instance||n).exports})))}})),Promise.all(n)},u.m=e,u.c=t,u.d=function(e,n,t){u.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:t})},u.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},u.t=function(e,n){if(1&n&&(e=u(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(u.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var r in e)u.d(t,r,function(n){return e[n]}.bind(null,r));return t},u.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(n,"a",n),n},u.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},u.p="/repl/playground/",u.oe=function(e){throw console.error(e),e},u.w={};var c=window.webpackJsonp=window.webpackJsonp||[],i=c.push.bind(c);c.push=n,c=c.slice();for(var f=0;f<c.length;f++)n(c[f]);var b=i;u(u.s=0)}([function(e,n,t){t.e(1).then(t.bind(null,1)).catch(e=>console.error("Error importing `index.js`:",e))}]);
\ No newline at end of file