From: Daniela Brozzoni Date: Tue, 31 Jan 2023 09:29:17 +0000 (+0100) Subject: Update the playground to bdk-cli 0.26.0 X-Git-Url: http://internal-gitweb-vhost/script/%22https:/database/scripts/static/struct.AddressInfo.html?a=commitdiff_plain;h=f1b3b073b42d5fdf1d970bfdecab1b86f816bd64;p=bitcoindevkit.org Update the playground to bdk-cli 0.26.0 --- diff --git a/docs/.vuepress/public/bdk-cli/playground/0fb1203923750033a273.module.wasm b/docs/.vuepress/public/bdk-cli/playground/0fb1203923750033a273.module.wasm deleted file mode 100644 index 21520b0d59..0000000000 Binary files a/docs/.vuepress/public/bdk-cli/playground/0fb1203923750033a273.module.wasm and /dev/null differ diff --git a/docs/.vuepress/public/bdk-cli/playground/1.playground.js b/docs/.vuepress/public/bdk-cli/playground/1.playground.js index 8dae67da88..6351956794 100644 --- a/docs/.vuepress/public/bdk-cli/playground/1.playground.js +++ b/docs/.vuepress/public/bdk-cli/playground/1.playground.js @@ -1,16 +1,16 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[1],[,,,function(t,e,o){var i,n,s;n=[o(10)],void 0===(s="function"==typeof(i=function(t){ +(window.webpackJsonp=window.webpackJsonp||[]).push([[1],[,,,function(t,e,o){var i,n,s;n=[o(9)],void 0===(s="function"==typeof(i=function(t){ /** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: Apache-2.0 */ -"use strict";return t.setLocale=function(e){t.Msg=t.Msg||{},Object.keys(e).forEach((function(o){t.Msg[o]=e[o]}))},t})?i.apply(e,n):i)||(t.exports=s)},,function(t,e){var o;o=function(){return this}();try{o=o||new Function("return this")()}catch(t){"object"==typeof window&&(o=window)}t.exports=o},function(t,e,o){var i,n,s;n=[o(9)],void 0===(s="function"==typeof(i=function(t){ +"use strict";return t.setLocale=function(e){t.Msg=t.Msg||{},Object.keys(e).forEach((function(o){t.Msg[o]=e[o]}))},t})?i.apply(e,n):i)||(t.exports=s)},,function(t,e){var o;o=function(){return this}();try{o=o||new Function("return this")()}catch(t){"object"==typeof window&&(o=window)}t.exports=o},function(t,e,o){var i,n,s;n=[o(8)],void 0===(s="function"==typeof(i=function(t){ /** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: Apache-2.0 */ -"use strict";return t})?i.apply(e,n):i)||(t.exports=s)},function(t,e){t.exports=function(t){if(!t.webpackPolyfill){var e=Object.create(t);e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),Object.defineProperty(e,"exports",{enumerable:!0}),e.webpackPolyfill=1}return e}},,function(t,e,o){var i,n,s;n=[o(3),o(11),o(12),o(13)],void 0===(s="function"==typeof(i=function(t,e,o,i){ +"use strict";return t})?i.apply(e,n):i)||(t.exports=s)},function(t,e){t.exports=function(t){if(!t.webpackPolyfill){var e=Object.create(t);e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),Object.defineProperty(e,"exports",{enumerable:!0}),e.webpackPolyfill=1}return e}},function(t,e,o){var i,n,s;n=[o(3),o(10),o(11),o(12)],void 0===(s="function"==typeof(i=function(t,e,o,i){ /** * @license * Copyright 2019 Google LLC diff --git a/docs/.vuepress/public/bdk-cli/playground/2.playground.js b/docs/.vuepress/public/bdk-cli/playground/2.playground.js index 5bb0b10515..d8d2483f48 100644 --- a/docs/.vuepress/public/bdk-cli/playground/2.playground.js +++ b/docs/.vuepress/public/bdk-cli/playground/2.playground.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[2],[,function(e,n,t){"use strict";t.r(n);var r=t(4),o=t(2);r.g();var i=t(6),a=t.n(i),l={backupBlocks_:function(e){if("localStorage"in window){var n=a.a.Xml.workspaceToDom(e),t=window.location.href.split("#")[0];window.localStorage.setItem(t,a.a.Xml.domToText(n))}},backupOnUnload:function(e){var n=e||a.a.getMainWorkspace();window.addEventListener("unload",(function(){l.backupBlocks_(n)}),!1)},restoreBlocks:function(e){var n=window.location.href.split("#")[0];if("localStorage"in window&&window.localStorage[n]){var t=e||a.a.getMainWorkspace(),r=a.a.Xml.textToDom(window.localStorage[n]);a.a.Xml.domToWorkspace(r,t)}},link:function(e){var n=e||a.a.getMainWorkspace(),t=a.a.Xml.workspaceToDom(n,!0);if(1==n.getTopBlocks(!1).length&&t.querySelector){var r=t.querySelector("block");r&&(r.removeAttribute("x"),r.removeAttribute("y"))}var o=a.a.Xml.domToText(t);l.makeRequest_("/storage","xml",o,n)},retrieveXml:function(e,n){var t=n||a.a.getMainWorkspace();l.makeRequest_("/storage","key",e,t)},httpRequest_:null,makeRequest_:function(e,n,t,r){l.httpRequest_&&l.httpRequest_.abort(),l.httpRequest_=new XMLHttpRequest,l.httpRequest_.name=n,l.httpRequest_.onreadystatechange=l.handleRequest_,l.httpRequest_.open("POST",e),l.httpRequest_.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),l.httpRequest_.send(n+"="+encodeURIComponent(t)),l.httpRequest_.workspace=r},handleRequest_:function(){if(4==l.httpRequest_.readyState){if(200!=l.httpRequest_.status)l.alert(l.HTTPREQUEST_ERROR+"\nhttpRequest_.status: "+l.httpRequest_.status);else{var e=l.httpRequest_.responseText.trim();"xml"==l.httpRequest_.name?(window.location.hash=e,l.alert(l.LINK_ALERT.replace("%1",window.location.href))):"key"==l.httpRequest_.name&&(e.length?l.loadXml_(e,l.httpRequest_.workspace):l.alert(l.HASH_ERROR.replace("%1",window.location.hash))),l.monitorChanges_(l.httpRequest_.workspace)}l.httpRequest_=null}},monitorChanges_:function(e){var n=a.a.Xml.workspaceToDom(e),t=a.a.Xml.domToText(n);e.addChangeListener((function n(){var r=a.a.Xml.workspaceToDom(e),o=a.a.Xml.domToText(r);t!=o&&(window.location.hash="",e.removeChangeListener(n))}))},loadXml_:function(e,n){try{e=a.a.Xml.textToDom(e)}catch(n){return void l.alert(l.XML_ERROR+"\nXML: "+e)}n.clear(),a.a.Xml.domToWorkspace(e,n)},alert:function(e){window.alert(e)}},u=l;!async function(){Object(o.Ab)(),function(e,n){console.log("Blockly starting");const t=document.getElementById(n);a.a.JavaScript.INDENT="";var r={toolbox:'\n \n \n \n 1\n 1\n \n \n 1\n \n \n 1\n \n \n \n \n 1\n \n \n Alias\n name\n \n \n Existing Key\n tpub, WIF, hex...\n \n \n \n \n \n \n Alias\n Alice\n \n \n \n \n 1\n 1\n \n \n \n \n Alias\n Alice\n \n \n \n \n \n \n \n \n Alias\n Bob\n \n \n \n \n \n \n 99\n 1\n \n \n \n \n Alias\n KeyLikely\n \n \n \n \n \n \n \n \n Alias\n Likely\n \n \n \n \n \n \n \n \n \n \n Alias\n User\n \n \n \n \n \n \n 99\n 1\n \n \n \n \n Alias\n Service\n \n \n \n \n \n \n 12960\n \n \n \n \n \n \n 3\n \n \n \n \n \n \n Alias\n Alice\n \n \n \n \n \n \n \n \n \n \n Alias\n Bob\n \n \n \n \n \n \n \n \n \n \n Alias\n Carol\n \n \n \n \n \n \n \n \n 12960\n \n \n \n \n \n \n \n \n \n \n \n \n',collapse:!0,comments:!0,disable:!0,maxBlocks:1/0,trashcan:!0,horizontalLayout:!0,toolboxPosition:"start",css:!0,media:"https://blockly-demo.appspot.com/static/media/",rtl:!1,scrollbars:!0,sounds:!0,oneBasedIndex:!0,grid:{spacing:20,length:1,colour:"#888",snap:!0}};a.a.Blocks.pk={init:function(){this.appendValueInput("pk").setCheck("key").appendField("Key"),this.setPreviousStatement(!0,"policy"),this.setColour(260),this.setTooltip("Requires a signature with a given public key"),this.setHelpUrl("")}},a.a.Blocks.begin={init:function(){this.appendDummyInput().appendField("Begin"),this.setNextStatement(!0,"policy"),this.setColour(160),this.setTooltip("Sets the beginning of the policy"),this.setHelpUrl("")}},a.a.Blocks.existing_key={init:function(){this.appendDummyInput().appendField(new a.a.FieldLabelSerializable("Existing Key"),"NAME").appendField(new a.a.FieldTextInput("tpub, WIF, hex..."),"key"),this.setOutput(!0,"key"),this.setColour(120),this.setTooltip("Sets the value of a key to an existing WIF key, xpub or hex public key"),this.setHelpUrl("")}},a.a.Blocks.alias_key={init:function(){this.appendDummyInput().appendField(new a.a.FieldLabelSerializable("Alias"),"label").appendField(new a.a.FieldTextInput("name"),"name"),this.setOutput(!0,"key"),this.setColour(120),this.setTooltip("Sets the value of a key to an alias"),this.setHelpUrl("")}},a.a.Blocks.thresh={init:function(){this.appendDummyInput().appendField("Threshold").appendField(new a.a.FieldNumber(1,1,1/0,1),"Threshold"),this.appendStatementInput("A").setCheck("thresh").appendField("Policies"),this.setPreviousStatement(!0,"policy"),this.setColour(230),this.setTooltip("Creates a threshold element (m-of-n), where the 'm' field is manually set and 'n' is implied by the number of sub-policies added. Requies all of its children to be wrapped in the 'Entry' block"),this.setHelpUrl("")}},a.a.Blocks.older={init:function(){this.appendDummyInput().appendField("Older").appendField(new a.a.FieldNumber(1,1,1/0,1),"NAME"),this.setPreviousStatement(!0,"policy"),this.setColour(20),this.setTooltip("Requires waiting a number of blocks from the confirmation height of a UTXO before it becomes spendable"),this.setHelpUrl("")}},a.a.Blocks.after={init:function(){this.appendDummyInput().appendField("After").appendField(new a.a.FieldNumber(1,1,1/0,1),"NAME"),this.setPreviousStatement(!0,"policy"),this.setColour(20),this.setTooltip("Requires the blockchain to reach a specific block height before the UTXO becomes spendable"),this.setHelpUrl("")}},a.a.Blocks.adapter={init:function(){this.appendStatementInput("NAME").setCheck("policy").appendField("Entry"),this.setPreviousStatement(!0,"thresh"),this.setNextStatement(!0,"thresh"),this.setColour(290),this.setTooltip("Adapter used to stack policies into 'Threshold' blocks"),this.setHelpUrl("")}},a.a.Blocks.and={init:function(){this.appendStatementInput("A").setCheck("policy"),this.appendDummyInput().appendField("AND"),this.appendStatementInput("B").setCheck("policy"),this.setPreviousStatement(!0,"policy"),this.setColour(230),this.setTooltip("Requires both sub-policies to be satisfied"),this.setHelpUrl("")}},a.a.Blocks.or={init:function(){this.appendStatementInput("A").setCheck("policy").appendField("Weight").appendField(new a.a.FieldNumber(1,1),"A_weight"),this.appendDummyInput().appendField("OR"),this.appendStatementInput("B").setCheck("policy").appendField("Weight").appendField(new a.a.FieldNumber(1,1),"B_weight"),this.setPreviousStatement(!0,"policy"),this.setColour(230),this.setTooltip("Requires either one of the two sub-policies to be satisfied. Weights can be used to indicate the relative probability of each sub-policy"),this.setHelpUrl("")}},a.a.JavaScript.begin=function(e){return""},a.a.JavaScript.pk=function(e){if(!e.getParent())return"";var n=a.a.JavaScript.valueToCode(e,"pk",a.a.JavaScript.ORDER_ATOMIC);return""==n&&(n="()"),"pk"+n},a.a.JavaScript.existing_key=function(e){return e.getParent()?[e.getFieldValue("key"),a.a.JavaScript.ORDER_NONE]:["",a.a.JavaScript.ORDER_NONE]},a.a.JavaScript.alias_key=function(e){return e.getParent()?[e.getFieldValue("name"),a.a.JavaScript.ORDER_NONE]:["",a.a.JavaScript.ORDER_NONE]},a.a.JavaScript.thresh=function(e){return"thresh("+e.getFieldValue("Threshold")+","+a.a.JavaScript.statementToCode(e,"A")+")"},a.a.JavaScript.older=function(e){return e.getParent()?"older("+e.getFieldValue("NAME")+")":""},a.a.JavaScript.after=function(e){return e.getParent()?"after("+e.getFieldValue("NAME")+")":""},a.a.JavaScript.adapter=function(e){return e.getParent()?a.a.JavaScript.statementToCode(e,"NAME")+(e.getNextBlock()?",":""):""},a.a.JavaScript.and=function(e){return e.getParent()?"and("+a.a.JavaScript.statementToCode(e,"A")+","+a.a.JavaScript.statementToCode(e,"B")+")":""},a.a.JavaScript.or=function(e){if(!e.getParent())return"";var n=e.getFieldValue("A_weight");"1"==n?n="":n+="@";var t=a.a.JavaScript.statementToCode(e,"A"),r=e.getFieldValue("B_weight");return"1"==r?r="":r+="@","or("+n+t+","+r+a.a.JavaScript.statementToCode(e,"B")+")"};var o=a.a.inject(e,r);o.addChangeListener((function(e){t.value=a.a.JavaScript.workspaceToCode(o)})),o.addChangeListener(a.a.Events.disableOrphans),setTimeout(()=>{if(u.restoreBlocks(),0==o.getTopBlocks().length){var e=o.newBlock("begin");e.setDeletable(!1),e.setEditable(!1),e.moveBy(20,20),e.initSvg(),e.render()}const n=document.createElement("span");n.innerHTML='',n.style.float="right",n.style["margin-right"]="10px";let t=!1;n.onclick=function(){t?document.exitFullscreen():document.getElementById("blocklyDiv").requestFullscreen(),t=!t},document.getElementsByClassName("blocklyToolboxDiv")[0].appendChild(n)},0),u.backupOnUnload()}("blocklyDiv","policy");let e=null;document.getElementById("stdin").disabled=!0;const n=document.getElementById("start_button"),t=document.getElementById("stop_button"),r=document.getElementById("start_message");n.disabled=!1,t.disabled=!0;const i=document.getElementById("descriptor"),l=document.getElementById("change_descriptor");n.onclick=a=>{0!=i.value.length&&(a.preventDefault(),async function(e,n){const t=document.getElementById("stdout"),r=document.getElementById("stdin");r.disabled=!1;const i=[];let a=0,l=null,u=["_","-d",e];n&&(u.push("-c"),u.push(n)),l=await new o.a("testnet",u);const c=e=>{if("clear"!=e)return r.disabled=!0,t.innerHTML.length>0&&(t.innerHTML+="\n"),t.innerHTML+=`> ${e}\n`,a=i.push(e),l.run_command(e).then(e=>{e&&(t.innerHTML+=`${JSON.stringify(e)}\n`)}).catch(e=>t.innerHTML+=`${e}\n`).finally(()=>{r.disabled=!1,t.scrollTop=t.scrollHeight-t.clientHeight});t.innerHTML=""};return r.onkeydown=e=>{if("Enter"==e.key){if(0==r.value.length)return;c(r.value),r.value="",e.preventDefault()}else"ArrowUp"==e.key?a>0&&(r.value=i[--a]):"ArrowDown"==e.key&&a0?l.value:null).then(o=>{n.disabled=!0,i.disabled=!0,l.disabled=!0,r.innerHTML="Wallet created, running `sync`...",o.run("wallet sync").then(()=>r.innerHTML="Ready!"),e=o,t.disabled=!1}).catch(e=>r.innerHTML=`${e}`))},t.onclick=o=>{null!=e&&(o.preventDefault(),e=null,r.innerHTML="Wallet instance destroyed",n.disabled=!1,t.disabled=!0,i.disabled=!1,l.disabled=!1)};const c=document.getElementById("policy"),s=document.getElementById("compiler_script_type"),d=document.getElementById("compiler_output");document.getElementById("compile_button").onclick=e=>{if(0==c.value.length)return;e.preventDefault();const n=!e.target.form.elements.namedItem("alias").length;let t=e.target.form.elements.namedItem("alias"),r=e.target.form.elements.namedItem("type"),i=e.target.form.elements.namedItem("extra");n?(t=[t],r=[r],i=[i]):(t=Array.from(t),r=Array.from(r),i=Array.from(i));const a={};t.forEach(e=>{const n=r.filter(n=>n.attributes["data-index"].value==e.attributes["data-index"].value)[0].value,t=i.filter(n=>n.attributes["data-index"].value==e.attributes["data-index"].value)[0].value,o=e.value;a[o]={type:n,extra:t}});try{let e=Object(o.zb)(c.value,JSON.stringify(a),s.value);d.innerHTML=e}catch(e){d.innerHTML=`${e}`}}}()},function(e,n,t){"use strict";(function(e,r){t.d(n,"Ab",(function(){return w})),t.d(n,"zb",(function(){return A})),t.d(n,"a",(function(){return E})),t.d(n,"wb",(function(){return x})),t.d(n,"vb",(function(){return B})),t.d(n,"lb",(function(){return F})),t.d(n,"xb",(function(){return I})),t.d(n,"rb",(function(){return N})),t.d(n,"n",(function(){return q})),t.d(n,"ub",(function(){return C})),t.d(n,"j",(function(){return M})),t.d(n,"m",(function(){return O})),t.d(n,"l",(function(){return D})),t.d(n,"y",(function(){return H})),t.d(n,"C",(function(){return J})),t.d(n,"jb",(function(){return L})),t.d(n,"E",(function(){return U})),t.d(n,"b",(function(){return P})),t.d(n,"o",(function(){return X})),t.d(n,"z",(function(){return W})),t.d(n,"hb",(function(){return j})),t.d(n,"bb",(function(){return V})),t.d(n,"x",(function(){return $})),t.d(n,"c",(function(){return z})),t.d(n,"eb",(function(){return K})),t.d(n,"M",(function(){return Q})),t.d(n,"V",(function(){return G})),t.d(n,"i",(function(){return Y})),t.d(n,"D",(function(){return Z})),t.d(n,"qb",(function(){return ee})),t.d(n,"ab",(function(){return ne})),t.d(n,"T",(function(){return te})),t.d(n,"r",(function(){return re})),t.d(n,"s",(function(){return oe})),t.d(n,"R",(function(){return ie})),t.d(n,"ob",(function(){return ae})),t.d(n,"J",(function(){return le})),t.d(n,"pb",(function(){return ue})),t.d(n,"N",(function(){return ce})),t.d(n,"O",(function(){return se})),t.d(n,"k",(function(){return de})),t.d(n,"ib",(function(){return fe})),t.d(n,"A",(function(){return pe})),t.d(n,"t",(function(){return me})),t.d(n,"e",(function(){return be})),t.d(n,"H",(function(){return he})),t.d(n,"X",(function(){return ke})),t.d(n,"kb",(function(){return ye})),t.d(n,"u",(function(){return ge})),t.d(n,"v",(function(){return ve})),t.d(n,"f",(function(){return we})),t.d(n,"P",(function(){return _e})),t.d(n,"G",(function(){return Te})),t.d(n,"U",(function(){return Ae})),t.d(n,"gb",(function(){return Se})),t.d(n,"fb",(function(){return Re})),t.d(n,"d",(function(){return Ee})),t.d(n,"K",(function(){return xe})),t.d(n,"I",(function(){return Be})),t.d(n,"Y",(function(){return Fe})),t.d(n,"B",(function(){return Ie})),t.d(n,"L",(function(){return Ne})),t.d(n,"db",(function(){return qe})),t.d(n,"w",(function(){return Ce})),t.d(n,"Z",(function(){return Me})),t.d(n,"cb",(function(){return Oe})),t.d(n,"q",(function(){return De})),t.d(n,"Q",(function(){return He})),t.d(n,"F",(function(){return Je})),t.d(n,"g",(function(){return Le})),t.d(n,"sb",(function(){return Ue})),t.d(n,"W",(function(){return Pe})),t.d(n,"h",(function(){return Xe})),t.d(n,"p",(function(){return We})),t.d(n,"S",(function(){return je})),t.d(n,"nb",(function(){return Ve})),t.d(n,"yb",(function(){return $e})),t.d(n,"tb",(function(){return ze})),t.d(n,"mb",(function(){return Ke}));var o=t(4);const i=new Array(32).fill(void 0);function a(e){return i[e]}i.push(void 0,null,!0,!1);let l=0,u=null;function c(){return null!==u&&u.buffer===o.k.buffer||(u=new Uint8Array(o.k.buffer)),u}let s=new("undefined"==typeof TextEncoder?(0,e.require)("util").TextEncoder:TextEncoder)("utf-8");const d="function"==typeof s.encodeInto?function(e,n){return s.encodeInto(e,n)}:function(e,n){const t=s.encode(e);return n.set(t),{read:e.length,written:t.length}};function f(e,n,t){if(void 0===t){const t=s.encode(e),r=n(t.length);return c().subarray(r,r+t.length).set(t),l=t.length,r}let r=e.length,o=n(r);const i=c();let a=0;for(;a127)break;i[o+a]=n}if(a!==r){0!==a&&(e=e.slice(a)),o=t(o,r,r=a+3*e.length);const n=c().subarray(o+a,o+r);a+=d(e,n).written}return l=a,o}let p=null;function m(){return null!==p&&p.buffer===o.k.buffer||(p=new Int32Array(o.k.buffer)),p}let b=i.length;function h(e){const n=a(e);return function(e){e<36||(i[e]=b,b=e)}(e),n}let k=new("undefined"==typeof TextDecoder?(0,e.require)("util").TextDecoder:TextDecoder)("utf-8",{ignoreBOM:!0,fatal:!0});function y(e,n){return k.decode(c().subarray(e,e+n))}function g(e){b===i.length&&i.push(i.length+1);const n=b;return b=i[n],i[n]=e,n}function v(e,n,t){o.h(e,n,g(t))}function w(){o.j()}k.decode();let _=null;function T(e,n){const t=n(4*e.length),r=(null!==_&&_.buffer===o.k.buffer||(_=new Uint32Array(o.k.buffer)),_);for(let n=0;n{const r=t.a;t.a=0;try{return function(e,n,t,r){o.l(e,n,g(t),g(r))}(r,t.b,e,n)}finally{t.a=r}});return g(r)}finally{t.a=t.b=0}}function Ae(e){return g(Promise.resolve(a(e)))}function Se(e,n){return g(a(e).then(a(n)))}function Re(e,n,t){return g(a(e).then(a(n),a(t)))}function Ee(e){return g(a(e).buffer)}function xe(e,n,t){return g(new Uint8Array(a(e),n>>>0,t>>>0))}function Be(e){return g(new Uint8Array(a(e)))}function Fe(e,n,t){a(e).set(a(n),t>>>0)}function Ie(e){return a(e).length}function Ne(e){return g(new Uint8Array(e>>>0))}function qe(e,n,t){return g(a(e).subarray(n>>>0,t>>>0))}function Ce(){return S((function(e,n){return Reflect.has(a(e),a(n))}),arguments)}function Me(){return S((function(e,n,t){return Reflect.set(a(e),a(n),a(t))}),arguments)}function Oe(){return S((function(e){return g(JSON.stringify(a(e)))}),arguments)}function De(e,n,t){a(e).getRandomValues(R(n,t))}function He(e,n,t){a(e).randomFillSync(R(n,t))}function Je(e,n){return g(new Function(y(e,n)))}function Le(e,n){return g(a(e).call(a(n)))}function Ue(e,n){return a(e)===a(n)}function Pe(e){return g(a(e).self)}function Xe(e){return g(a(e).crypto)}function We(e){return g(a(e).getRandomValues)}function je(e,n){return g(t(8)(y(e,n)))}function Ve(e,n){var t=f(function e(n){const t=typeof n;if("number"==t||"boolean"==t||null==n)return""+n;if("string"==t)return`"${n}"`;if("symbol"==t){const e=n.description;return null==e?"Symbol":`Symbol(${e})`}if("function"==t){const e=n.name;return"string"==typeof e&&e.length>0?`Function(${e})`:"Function"}if(Array.isArray(n)){const t=n.length;let r="[";t>0&&(r+=e(n[0]));for(let o=1;o1))return toString.call(n);if(o=r[1],"Object"==o)try{return"Object("+JSON.stringify(n)+")"}catch(e){return"Object"}return n instanceof Error?`${n.name}: ${n.message}\n${n.stack}`:o}(a(n)),o.e,o.f),r=l;m()[e/4+1]=r,m()[e/4+0]=t}function $e(e,n){throw new Error(y(e,n))}function ze(){return g(o.k)}function Ke(e,n,t){return g(function(e,n,t,r){const i={a:e,b:n,cnt:1,dtor:t},a=(...e)=>{i.cnt++;const n=i.a;i.a=0;try{return r(n,i.b,...e)}finally{0==--i.cnt?o.d.get(i.dtor)(n,i.b):i.a=n}};return a.original=i,a}(e,n,923,v))}}).call(this,t(7)(e),t(5))},,function(e,n,t){"use strict";var r=t.w[e.i];e.exports=r;t(2);r.o()},,,,function(e,n){function t(e){var n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}t.keys=function(){return[]},t.resolve=t,e.exports=t,t.id=8}]]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[2],[,function(e,n,t){"use strict";t.r(n);t(4);var r=t(2),i=t(6),o=t.n(i),a={backupBlocks_:function(e){if("localStorage"in window){var n=o.a.Xml.workspaceToDom(e),t=window.location.href.split("#")[0];window.localStorage.setItem(t,o.a.Xml.domToText(n))}},backupOnUnload:function(e){var n=e||o.a.getMainWorkspace();window.addEventListener("unload",(function(){a.backupBlocks_(n)}),!1)},restoreBlocks:function(e){var n=window.location.href.split("#")[0];if("localStorage"in window&&window.localStorage[n]){var t=e||o.a.getMainWorkspace(),r=o.a.Xml.textToDom(window.localStorage[n]);o.a.Xml.domToWorkspace(r,t)}},link:function(e){var n=e||o.a.getMainWorkspace(),t=o.a.Xml.workspaceToDom(n,!0);if(1==n.getTopBlocks(!1).length&&t.querySelector){var r=t.querySelector("block");r&&(r.removeAttribute("x"),r.removeAttribute("y"))}var i=o.a.Xml.domToText(t);a.makeRequest_("/storage","xml",i,n)},retrieveXml:function(e,n){var t=n||o.a.getMainWorkspace();a.makeRequest_("/storage","key",e,t)},httpRequest_:null,makeRequest_:function(e,n,t,r){a.httpRequest_&&a.httpRequest_.abort(),a.httpRequest_=new XMLHttpRequest,a.httpRequest_.name=n,a.httpRequest_.onreadystatechange=a.handleRequest_,a.httpRequest_.open("POST",e),a.httpRequest_.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),a.httpRequest_.send(n+"="+encodeURIComponent(t)),a.httpRequest_.workspace=r},handleRequest_:function(){if(4==a.httpRequest_.readyState){if(200!=a.httpRequest_.status)a.alert(a.HTTPREQUEST_ERROR+"\nhttpRequest_.status: "+a.httpRequest_.status);else{var e=a.httpRequest_.responseText.trim();"xml"==a.httpRequest_.name?(window.location.hash=e,a.alert(a.LINK_ALERT.replace("%1",window.location.href))):"key"==a.httpRequest_.name&&(e.length?a.loadXml_(e,a.httpRequest_.workspace):a.alert(a.HASH_ERROR.replace("%1",window.location.hash))),a.monitorChanges_(a.httpRequest_.workspace)}a.httpRequest_=null}},monitorChanges_:function(e){var n=o.a.Xml.workspaceToDom(e),t=o.a.Xml.domToText(n);e.addChangeListener((function n(){var r=o.a.Xml.workspaceToDom(e),i=o.a.Xml.domToText(r);t!=i&&(window.location.hash="",e.removeChangeListener(n))}))},loadXml_:function(e,n){try{e=o.a.Xml.textToDom(e)}catch(n){return void a.alert(a.XML_ERROR+"\nXML: "+e)}n.clear(),o.a.Xml.domToWorkspace(e,n)},alert:function(e){window.alert(e)}},l=a;!async function(){Object(r.sb)(),function(e,n){console.log("Blockly starting");const t=document.getElementById(n);o.a.JavaScript.INDENT="";var r={toolbox:'\n \n \n \n 1\n 1\n \n \n 1\n \n \n 1\n \n \n \n \n 1\n \n \n Alias\n name\n \n \n Existing Key\n tpub, WIF, hex...\n \n \n \n \n \n \n Alias\n Alice\n \n \n \n \n 1\n 1\n \n \n \n \n Alias\n Alice\n \n \n \n \n \n \n \n \n Alias\n Bob\n \n \n \n \n \n \n 99\n 1\n \n \n \n \n Alias\n KeyLikely\n \n \n \n \n \n \n \n \n Alias\n Likely\n \n \n \n \n \n \n \n \n \n \n Alias\n User\n \n \n \n \n \n \n 99\n 1\n \n \n \n \n Alias\n Service\n \n \n \n \n \n \n 12960\n \n \n \n \n \n \n 3\n \n \n \n \n \n \n Alias\n Alice\n \n \n \n \n \n \n \n \n \n \n Alias\n Bob\n \n \n \n \n \n \n \n \n \n \n Alias\n Carol\n \n \n \n \n \n \n \n \n 12960\n \n \n \n \n \n \n \n \n \n \n \n \n',collapse:!0,comments:!0,disable:!0,maxBlocks:1/0,trashcan:!0,horizontalLayout:!0,toolboxPosition:"start",css:!0,media:"https://blockly-demo.appspot.com/static/media/",rtl:!1,scrollbars:!0,sounds:!0,oneBasedIndex:!0,grid:{spacing:20,length:1,colour:"#888",snap:!0}};o.a.Blocks.pk={init:function(){this.appendValueInput("pk").setCheck("key").appendField("Key"),this.setPreviousStatement(!0,"policy"),this.setColour(260),this.setTooltip("Requires a signature with a given public key"),this.setHelpUrl("")}},o.a.Blocks.begin={init:function(){this.appendDummyInput().appendField("Begin"),this.setNextStatement(!0,"policy"),this.setColour(160),this.setTooltip("Sets the beginning of the policy"),this.setHelpUrl("")}},o.a.Blocks.existing_key={init:function(){this.appendDummyInput().appendField(new o.a.FieldLabelSerializable("Existing Key"),"NAME").appendField(new o.a.FieldTextInput("tpub, WIF, hex..."),"key"),this.setOutput(!0,"key"),this.setColour(120),this.setTooltip("Sets the value of a key to an existing WIF key, xpub or hex public key"),this.setHelpUrl("")}},o.a.Blocks.alias_key={init:function(){this.appendDummyInput().appendField(new o.a.FieldLabelSerializable("Alias"),"label").appendField(new o.a.FieldTextInput("name"),"name"),this.setOutput(!0,"key"),this.setColour(120),this.setTooltip("Sets the value of a key to an alias"),this.setHelpUrl("")}},o.a.Blocks.thresh={init:function(){this.appendDummyInput().appendField("Threshold").appendField(new o.a.FieldNumber(1,1,1/0,1),"Threshold"),this.appendStatementInput("A").setCheck("thresh").appendField("Policies"),this.setPreviousStatement(!0,"policy"),this.setColour(230),this.setTooltip("Creates a threshold element (m-of-n), where the 'm' field is manually set and 'n' is implied by the number of sub-policies added. Requies all of its children to be wrapped in the 'Entry' block"),this.setHelpUrl("")}},o.a.Blocks.older={init:function(){this.appendDummyInput().appendField("Older").appendField(new o.a.FieldNumber(1,1,1/0,1),"NAME"),this.setPreviousStatement(!0,"policy"),this.setColour(20),this.setTooltip("Requires waiting a number of blocks from the confirmation height of a UTXO before it becomes spendable"),this.setHelpUrl("")}},o.a.Blocks.after={init:function(){this.appendDummyInput().appendField("After").appendField(new o.a.FieldNumber(1,1,1/0,1),"NAME"),this.setPreviousStatement(!0,"policy"),this.setColour(20),this.setTooltip("Requires the blockchain to reach a specific block height before the UTXO becomes spendable"),this.setHelpUrl("")}},o.a.Blocks.adapter={init:function(){this.appendStatementInput("NAME").setCheck("policy").appendField("Entry"),this.setPreviousStatement(!0,"thresh"),this.setNextStatement(!0,"thresh"),this.setColour(290),this.setTooltip("Adapter used to stack policies into 'Threshold' blocks"),this.setHelpUrl("")}},o.a.Blocks.and={init:function(){this.appendStatementInput("A").setCheck("policy"),this.appendDummyInput().appendField("AND"),this.appendStatementInput("B").setCheck("policy"),this.setPreviousStatement(!0,"policy"),this.setColour(230),this.setTooltip("Requires both sub-policies to be satisfied"),this.setHelpUrl("")}},o.a.Blocks.or={init:function(){this.appendStatementInput("A").setCheck("policy").appendField("Weight").appendField(new o.a.FieldNumber(1,1),"A_weight"),this.appendDummyInput().appendField("OR"),this.appendStatementInput("B").setCheck("policy").appendField("Weight").appendField(new o.a.FieldNumber(1,1),"B_weight"),this.setPreviousStatement(!0,"policy"),this.setColour(230),this.setTooltip("Requires either one of the two sub-policies to be satisfied. Weights can be used to indicate the relative probability of each sub-policy"),this.setHelpUrl("")}},o.a.JavaScript.begin=function(e){return""},o.a.JavaScript.pk=function(e){if(!e.getParent())return"";var n=o.a.JavaScript.valueToCode(e,"pk",o.a.JavaScript.ORDER_ATOMIC);return""==n&&(n="()"),"pk"+n},o.a.JavaScript.existing_key=function(e){return e.getParent()?[e.getFieldValue("key"),o.a.JavaScript.ORDER_NONE]:["",o.a.JavaScript.ORDER_NONE]},o.a.JavaScript.alias_key=function(e){return e.getParent()?[e.getFieldValue("name"),o.a.JavaScript.ORDER_NONE]:["",o.a.JavaScript.ORDER_NONE]},o.a.JavaScript.thresh=function(e){return"thresh("+e.getFieldValue("Threshold")+","+o.a.JavaScript.statementToCode(e,"A")+")"},o.a.JavaScript.older=function(e){return e.getParent()?"older("+e.getFieldValue("NAME")+")":""},o.a.JavaScript.after=function(e){return e.getParent()?"after("+e.getFieldValue("NAME")+")":""},o.a.JavaScript.adapter=function(e){return e.getParent()?o.a.JavaScript.statementToCode(e,"NAME")+(e.getNextBlock()?",":""):""},o.a.JavaScript.and=function(e){return e.getParent()?"and("+o.a.JavaScript.statementToCode(e,"A")+","+o.a.JavaScript.statementToCode(e,"B")+")":""},o.a.JavaScript.or=function(e){if(!e.getParent())return"";var n=e.getFieldValue("A_weight");"1"==n?n="":n+="@";var t=o.a.JavaScript.statementToCode(e,"A"),r=e.getFieldValue("B_weight");return"1"==r?r="":r+="@","or("+n+t+","+r+o.a.JavaScript.statementToCode(e,"B")+")"};var i=o.a.inject(e,r);i.addChangeListener((function(e){t.value=o.a.JavaScript.workspaceToCode(i)})),i.addChangeListener(o.a.Events.disableOrphans),setTimeout(()=>{if(l.restoreBlocks(),0==i.getTopBlocks().length){var e=i.newBlock("begin");e.setDeletable(!1),e.setEditable(!1),e.moveBy(20,20),e.initSvg(),e.render()}const n=document.createElement("span");n.innerHTML='',n.style.float="right",n.style["margin-right"]="10px";let t=!1;n.onclick=function(){t?document.exitFullscreen():document.getElementById("blocklyDiv").requestFullscreen(),t=!t},document.getElementsByClassName("blocklyToolboxDiv")[0].appendChild(n)},0),l.backupOnUnload()}("blocklyDiv","policy");let e=null;document.getElementById("stdin").disabled=!0;const n=document.getElementById("start_button"),t=document.getElementById("stop_button"),i=document.getElementById("start_message");n.disabled=!1,t.disabled=!0;const a=document.getElementById("descriptor"),u=document.getElementById("change_descriptor");n.onclick=o=>{0!=a.value.length&&(o.preventDefault(),async function(e,n){const t=document.getElementById("stdout"),i=document.getElementById("stdin");i.disabled=!1;const o=[];let a=0,l=null,u=["_","-d",e];n&&(u.push("-c"),u.push(n)),l=await new r.a("testnet",u);const c=e=>{if("clear"!=e)return i.disabled=!0,t.innerHTML.length>0&&(t.innerHTML+="\n"),t.innerHTML+=`> ${e}\n`,a=o.push(e),l.run_command(e).then(e=>{e&&(t.innerHTML+=`${JSON.stringify(e)}\n`)}).catch(e=>t.innerHTML+=`${e}\n`).finally(()=>{i.disabled=!1,t.scrollTop=t.scrollHeight-t.clientHeight});t.innerHTML=""};return i.onkeydown=e=>{if("Enter"==e.key){if(0==i.value.length)return;c(i.value),i.value="",e.preventDefault()}else"ArrowUp"==e.key?a>0&&(i.value=o[--a]):"ArrowDown"==e.key&&a0?u.value:null).then(r=>{n.disabled=!0,a.disabled=!0,u.disabled=!0,i.innerHTML="Wallet created, running `sync`...",r.run("wallet sync").then(()=>i.innerHTML="Ready!"),e=r,t.disabled=!1}).catch(e=>i.innerHTML=`${e}`))},t.onclick=r=>{null!=e&&(r.preventDefault(),e=null,i.innerHTML="Wallet instance destroyed",n.disabled=!1,t.disabled=!0,a.disabled=!1,u.disabled=!1)};const c=document.getElementById("policy"),s=document.getElementById("compiler_script_type"),d=document.getElementById("compiler_output");document.getElementById("compile_button").onclick=e=>{if(0==c.value.length)return;e.preventDefault();const n=!e.target.form.elements.namedItem("alias").length;let t=e.target.form.elements.namedItem("alias"),i=e.target.form.elements.namedItem("type"),o=e.target.form.elements.namedItem("extra");n?(t=[t],i=[i],o=[o]):(t=Array.from(t),i=Array.from(i),o=Array.from(o));const a={};t.forEach(e=>{const n=i.filter(n=>n.attributes["data-index"].value==e.attributes["data-index"].value)[0].value,t=o.filter(n=>n.attributes["data-index"].value==e.attributes["data-index"].value)[0].value,r=e.value;a[r]={type:n,extra:t}});try{let e=Object(r.rb)(c.value,JSON.stringify(a),s.value);d.innerHTML=e}catch(e){d.innerHTML=`${e}`}}}()},function(e,n,t){"use strict";(function(e,r){t.d(n,"sb",(function(){return w})),t.d(n,"rb",(function(){return A})),t.d(n,"a",(function(){return R})),t.d(n,"pb",(function(){return x})),t.d(n,"nb",(function(){return B})),t.d(n,"ob",(function(){return I})),t.d(n,"kb",(function(){return F})),t.d(n,"l",(function(){return N})),t.d(n,"mb",(function(){return q})),t.d(n,"db",(function(){return C})),t.d(n,"h",(function(){return M})),t.d(n,"k",(function(){return O})),t.d(n,"j",(function(){return D})),t.d(n,"t",(function(){return H})),t.d(n,"x",(function(){return J})),t.d(n,"bb",(function(){return L})),t.d(n,"z",(function(){return U})),t.d(n,"b",(function(){return P})),t.d(n,"m",(function(){return X})),t.d(n,"u",(function(){return W})),t.d(n,"Y",(function(){return j})),t.d(n,"S",(function(){return $})),t.d(n,"s",(function(){return V})),t.d(n,"c",(function(){return K})),t.d(n,"V",(function(){return z})),t.d(n,"G",(function(){return Q})),t.d(n,"g",(function(){return G})),t.d(n,"hb",(function(){return Y})),t.d(n,"L",(function(){return Z})),t.d(n,"ab",(function(){return ee})),t.d(n,"J",(function(){return ne})),t.d(n,"ib",(function(){return te})),t.d(n,"N",(function(){return re})),t.d(n,"y",(function(){return ie})),t.d(n,"n",(function(){return oe})),t.d(n,"M",(function(){return ae})),t.d(n,"gb",(function(){return le})),t.d(n,"D",(function(){return ue})),t.d(n,"H",(function(){return ce})),t.d(n,"I",(function(){return se})),t.d(n,"i",(function(){return de})),t.d(n,"Z",(function(){return fe})),t.d(n,"v",(function(){return pe})),t.d(n,"o",(function(){return me})),t.d(n,"e",(function(){return be})),t.d(n,"B",(function(){return he})),t.d(n,"P",(function(){return ke})),t.d(n,"cb",(function(){return ye})),t.d(n,"p",(function(){return ge})),t.d(n,"q",(function(){return ve})),t.d(n,"jb",(function(){return we})),t.d(n,"f",(function(){return _e})),t.d(n,"K",(function(){return Te})),t.d(n,"A",(function(){return Ae})),t.d(n,"O",(function(){return Se})),t.d(n,"X",(function(){return Ee})),t.d(n,"W",(function(){return Re})),t.d(n,"d",(function(){return xe})),t.d(n,"E",(function(){return Be})),t.d(n,"C",(function(){return Ie})),t.d(n,"Q",(function(){return Fe})),t.d(n,"w",(function(){return Ne})),t.d(n,"F",(function(){return qe})),t.d(n,"U",(function(){return Ce})),t.d(n,"r",(function(){return Me})),t.d(n,"R",(function(){return Oe})),t.d(n,"T",(function(){return De})),t.d(n,"fb",(function(){return He})),t.d(n,"qb",(function(){return Je})),t.d(n,"lb",(function(){return Le})),t.d(n,"eb",(function(){return Ue}));var i=t(4);let o=new("undefined"==typeof TextDecoder?(0,e.require)("util").TextDecoder:TextDecoder)("utf-8",{ignoreBOM:!0,fatal:!0});o.decode();let a=null;function l(){return null!==a&&a.buffer===i.k.buffer||(a=new Uint8Array(i.k.buffer)),a}function u(e,n){return o.decode(l().subarray(e,e+n))}const c=new Array(32).fill(void 0);c.push(void 0,null,!0,!1);let s=c.length;function d(e){s===c.length&&c.push(c.length+1);const n=s;return s=c[n],c[n]=e,n}function f(e){return c[e]}function p(e){const n=f(e);return function(e){e<36||(c[e]=s,s=e)}(e),n}let m=0;let b=new("undefined"==typeof TextEncoder?(0,e.require)("util").TextEncoder:TextEncoder)("utf-8");const h="function"==typeof b.encodeInto?function(e,n){return b.encodeInto(e,n)}:function(e,n){const t=b.encode(e);return n.set(t),{read:e.length,written:t.length}};function k(e,n,t){if(void 0===t){const t=b.encode(e),r=n(t.length);return l().subarray(r,r+t.length).set(t),m=t.length,r}let r=e.length,i=n(r);const o=l();let a=0;for(;a127)break;o[i+a]=n}if(a!==r){0!==a&&(e=e.slice(a)),i=t(i,r,r=a+3*e.length);const n=l().subarray(i+a,i+r);a+=h(e,n).written}return m=a,i}let y=null;function g(){return null!==y&&y.buffer===i.k.buffer||(y=new Int32Array(i.k.buffer)),y}function v(e,n,t){i.f(e,n,d(t))}function w(){i.j()}let _=null;function T(e,n){const t=n(4*e.length),r=(null!==_&&_.buffer===i.k.buffer||(_=new Uint32Array(i.k.buffer)),_);for(let n=0;n{const r=t.a;t.a=0;try{return function(e,n,t,r){i.h(e,n,d(t),d(r))}(r,t.b,e,n)}finally{t.a=r}});return d(r)}finally{t.a=t.b=0}}function Se(e){return d(Promise.resolve(f(e)))}function Ee(e,n){return d(f(e).then(f(n)))}function Re(e,n,t){return d(f(e).then(f(n),f(t)))}function xe(e){return d(f(e).buffer)}function Be(e,n,t){return d(new Uint8Array(f(e),n>>>0,t>>>0))}function Ie(e){return d(new Uint8Array(f(e)))}function Fe(e,n,t){f(e).set(f(n),t>>>0)}function Ne(e){return f(e).length}function qe(e){return d(new Uint8Array(e>>>0))}function Ce(e,n,t){return d(f(e).subarray(n>>>0,t>>>0))}function Me(){return S((function(e,n){return Reflect.has(f(e),f(n))}),arguments)}function Oe(){return S((function(e,n,t){return Reflect.set(f(e),f(n),f(t))}),arguments)}function De(){return S((function(e){return d(JSON.stringify(f(e)))}),arguments)}function He(e,n){var t=k(function e(n){const t=typeof n;if("number"==t||"boolean"==t||null==n)return""+n;if("string"==t)return`"${n}"`;if("symbol"==t){const e=n.description;return null==e?"Symbol":`Symbol(${e})`}if("function"==t){const e=n.name;return"string"==typeof e&&e.length>0?`Function(${e})`:"Function"}if(Array.isArray(n)){const t=n.length;let r="[";t>0&&(r+=e(n[0]));for(let i=1;i1))return toString.call(n);if(i=r[1],"Object"==i)try{return"Object("+JSON.stringify(n)+")"}catch(e){return"Object"}return n instanceof Error?`${n.name}: ${n.message}\n${n.stack}`:i}(f(n)),i.c,i.d),r=m;g()[e/4+1]=r,g()[e/4+0]=t}function Je(e,n){throw new Error(u(e,n))}function Le(){return d(i.k)}function Ue(e,n,t){return d(function(e,n,t,r){const o={a:e,b:n,cnt:1,dtor:t},a=(...e)=>{o.cnt++;const n=o.a;o.a=0;try{return r(n,o.b,...e)}finally{0==--o.cnt?i.e.get(o.dtor)(n,o.b):o.a=n}};return a.original=o,a}(e,n,1170,v))}}).call(this,t(7)(e),t(5))},,function(e,n,t){"use strict";var r=t.w[e.i];e.exports=r;t(2);r.n()}]]); \ No newline at end of file diff --git a/docs/.vuepress/public/bdk-cli/playground/9baa0fd5bb3d89b024ee.module.wasm b/docs/.vuepress/public/bdk-cli/playground/9baa0fd5bb3d89b024ee.module.wasm new file mode 100644 index 0000000000..f5d9c121a4 Binary files /dev/null and b/docs/.vuepress/public/bdk-cli/playground/9baa0fd5bb3d89b024ee.module.wasm differ diff --git a/docs/.vuepress/public/bdk-cli/playground/playground.js b/docs/.vuepress/public/bdk-cli/playground/playground.js index 299956ac96..9b12243d25 100644 --- a/docs/.vuepress/public/bdk-cli/playground/playground.js +++ b/docs/.vuepress/public/bdk-cli/playground/playground.js @@ -1 +1 @@ -!function(e){function n(n){for(var t,_,o=n[0],u=n[1],c=0,b=[];cconsole.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 _={4:function(){return{"./bdk-cli_bg.js":{__wbindgen_string_new:function(e,n){return t[2].exports.pb(e,n)},__wbindgen_object_drop_ref:function(e){return t[2].exports.nb(e)},__wbindgen_string_get:function(e,n){return t[2].exports.ob(e,n)},__wbindgen_json_parse:function(e,n){return t[2].exports.kb(e,n)},__wbg_fetch_ec947385518a47ce:function(e){return t[2].exports.l(e)},__wbindgen_object_clone_ref:function(e){return t[2].exports.mb(e)},__wbindgen_cb_drop:function(e){return t[2].exports.db(e)},__wbg_debug_6df4b1a327dd2e94:function(e,n,r,o){return t[2].exports.h(e,n,r,o)},__wbg_error_ca520cb687b085a1:function(e){return t[2].exports.k(e)},__wbg_error_644d3bc8c0537e80:function(e,n,r,o){return t[2].exports.j(e,n,r,o)},__wbg_info_8bed0988e7416289:function(e,n,r,o){return t[2].exports.t(e,n,r,o)},__wbg_log_681299aef22afa27:function(e,n,r,o){return t[2].exports.x(e,n,r,o)},__wbg_warn_ca021eeadd0df9cd:function(e,n,r,o){return t[2].exports.bb(e,n,r,o)},__wbg_new_226d109446575877:function(){return t[2].exports.z()},__wbg_append_4d85f35672cbffa7:function(e,n,r,o,_){return t[2].exports.b(e,n,r,o,_)},__wbg_fetch_fe54824ee845f6b4:function(e,n){return t[2].exports.m(e,n)},__wbg_instanceof_Response_ea36d565358a42f7:function(e){return t[2].exports.u(e)},__wbg_url_6e564c9e212456f8:function(e,n){return t[2].exports.Y(e,n)},__wbg_status_3a55bb50e744b834:function(e){return t[2].exports.S(e)},__wbg_headers_e4204c6775f7b3b4:function(e){return t[2].exports.s(e)},__wbg_arrayBuffer_0e2a43f68a8b3e49:function(e){return t[2].exports.c(e)},__wbg_text_aeba5a5bbfef7f15:function(e){return t[2].exports.V(e)},__wbg_newwithstrandinit_c07f0662ece15bc6:function(e,n,r){return t[2].exports.G(e,n,r)},__wbg_crypto_8fd02d72c4ba6c5c:function(e){return t[2].exports.g(e)},__wbindgen_is_object:function(e){return t[2].exports.hb(e)},__wbg_process_bd02d71a65cf734c:function(e){return t[2].exports.L(e)},__wbg_versions_1d70d407cb23129d:function(e){return t[2].exports.ab(e)},__wbg_node_0091cdf1ffa73e4d:function(e){return t[2].exports.J(e)},__wbindgen_is_string:function(e){return t[2].exports.ib(e)},__wbg_require_b06abd91965488c8:function(){return t[2].exports.N()},__wbg_msCrypto_7e1e6014bddd75de:function(e){return t[2].exports.y(e)},__wbg_getRandomValues_f308e7233e5601b7:function(e,n){return t[2].exports.n(e,n)},__wbg_randomFillSync_f20541303a990429:function(e,n,r){return t[2].exports.M(e,n,r)},__wbindgen_is_function:function(e){return t[2].exports.gb(e)},__wbg_newnoargs_f579424187aa1717:function(e,n){return t[2].exports.D(e,n)},__wbg_next_c7a2a6b012059a5e:function(e){return t[2].exports.H(e)},__wbg_next_dd1a890d37e38d73:function(e){return t[2].exports.I(e)},__wbg_done_982b1c7ac0cbc69d:function(e){return t[2].exports.i(e)},__wbg_value_2def2d1fb38b02cd:function(e){return t[2].exports.Z(e)},__wbg_iterator_4b9cedbeda0c0e30:function(){return t[2].exports.v()},__wbg_get_8bbb82393651dd9c:function(e,n){return t[2].exports.o(e,n)},__wbg_call_89558c3e96703ca1:function(e,n){return t[2].exports.e(e,n)},__wbg_new_d3138911a89329b0:function(){return t[2].exports.B()},__wbg_self_e23d74ae45fb17d1:function(){return t[2].exports.P()},__wbg_window_b4be7f48b24ac56e:function(){return t[2].exports.cb()},__wbg_globalThis_d61b1f48a57191ae:function(){return t[2].exports.p()},__wbg_global_e7669da72fd7f239:function(){return t[2].exports.q()},__wbindgen_is_undefined:function(e){return t[2].exports.jb(e)},__wbg_call_94697a95cb7e239c:function(e,n,r){return t[2].exports.f(e,n,r)},__wbg_now_e6c39c10a5e8aec7:function(){return t[2].exports.K()},__wbg_new_4beacc9c71572250:function(e,n){return t[2].exports.A(e,n)},__wbg_resolve_4f8f547f26b30b27:function(e){return t[2].exports.O(e)},__wbg_then_a6860c82b90816ca:function(e,n){return t[2].exports.X(e,n)},__wbg_then_58a04e42527f52c6:function(e,n,r){return t[2].exports.W(e,n,r)},__wbg_buffer_5e74a88a1424a2e0:function(e){return t[2].exports.d(e)},__wbg_newwithbyteoffsetandlength_278ec7532799393a:function(e,n,r){return t[2].exports.E(e,n,r)},__wbg_new_e3b800e570795b3c:function(e){return t[2].exports.C(e)},__wbg_set_5b8081e9d002f0df:function(e,n,r){return t[2].exports.Q(e,n,r)},__wbg_length_30803400a8f15c59:function(e){return t[2].exports.w(e)},__wbg_newwithlength_5f4ce114a24dfe1e:function(e){return t[2].exports.F(e)},__wbg_subarray_a68f835ca2af506f:function(e,n,r){return t[2].exports.U(e,n,r)},__wbg_has_3850edde6df9191b:function(e,n){return t[2].exports.r(e,n)},__wbg_set_c42875065132a932:function(e,n,r){return t[2].exports.R(e,n,r)},__wbg_stringify_f8bfc9e2d1e8b6a0:function(e){return t[2].exports.T(e)},__wbindgen_debug_string:function(e,n){return t[2].exports.fb(e,n)},__wbindgen_throw:function(e,n){return t[2].exports.qb(e,n)},__wbindgen_memory:function(){return t[2].exports.lb()},__wbindgen_closure_wrapper5531:function(e,n,r){return t[2].exports.eb(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(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;b.message="Loading chunk "+e+" failed.\n("+o+": "+_+")",b.name="ChunkLoadError",b.type=o,b.request=_,t[1](b)}r[e]=void 0}};var s=setTimeout((function(){i({type:"timeout",target:f})}),12e4);f.onerror=f.onload=i,document.head.appendChild(f)}return({2:[4]}[e]||[]).forEach((function(e){var t=o[e];if(t)n.push(t);else{var r,c=_[e](),i=fetch(u.p+""+{4:"9baa0fd5bb3d89b024ee"}[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="/bdk-cli/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;fconsole.error("Error importing `index.js`:",e))}]); \ No newline at end of file diff --git a/playground/README.md b/playground/README.md index fe00547e30..aeef55e0f4 100644 --- a/playground/README.md +++ b/playground/README.md @@ -15,7 +15,13 @@ Compile bdk-cli using the right features and the WASM target: ``` cd bdk-cli -RUSTFLAGS="-C opt-level=s -C strip=symbols" cargo build --release --no-default-features --features esplora-reqwest,async-interface,compiler --target wasm32-unknown-unknown +RUSTFLAGS="-C opt-level=s -C strip=symbols" cargo build --release --target wasm32-unknown-unknown --no-default-features --features esplora-reqwest,async-interface,compiler,dev-getrandom-wasm +``` + +If building on Mac M1, due to https://github.com/rust-bitcoin/rust-secp256k1/issues/283, you must add before the build command: + +``` +AR=/opt/homebrew/opt/llvm/bin/llvm-ar CC=/opt/homebrew/opt/llvm/bin/clang ``` From inside the `bdk-cli` directory, run `wasm-bindgen` diff --git a/playground/bdk-cli b/playground/bdk-cli index e23a892ae3..54dd1b21a5 160000 --- a/playground/bdk-cli +++ b/playground/bdk-cli @@ -1 +1 @@ -Subproject commit e23a892ae32d6c2b4a5efc7200aa272b74e2577c +Subproject commit 54dd1b21a5430d34fd1689725acbf404ca032f2e