Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ldk

Package Overview
Dependencies
Maintainers
1
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ldk - npm Package Compare versions

Comparing version 0.2.12 to 0.2.13

2

dist/explorer/esplora.d.ts

@@ -44,2 +44,2 @@ import { TxInterface } from '../types';

*/
export declare function getUnblindURLFromTx(tx: TxInterface, baseURL: string): Promise<string>;
export declare function getUnblindURLFromTx(tx: TxInterface, baseURL: string): string;

@@ -1,2 +0,2 @@

"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("liquidjs-lib"),r=e(require("axios")),n=e(require("bs58check")),i=require("bip32"),o=require("slip77"),a=require("bip39");function s(e){this.wrapped=e}function u(e){var t,r;function n(t,r){try{var o=e[t](r),a=o.value,u=a instanceof s;Promise.resolve(u?a.wrapped:a).then((function(e){u?n("return"===t?"return":"next",e):i(o.done?"return":"normal",e)}),(function(e){n("throw",e)}))}catch(e){i("throw",e)}}function i(e,i){switch(e){case"return":t.resolve({value:i,done:!0});break;case"throw":t.reject(i);break;default:t.resolve({value:i,done:!1})}(t=t.next)?n(t.key,t.arg):r=null}this._invoke=function(e,i){return new Promise((function(o,a){var s={key:e,arg:i,resolve:o,reject:a,next:null};r?r=r.next=s:(t=r=s,n(e,i))}))},"function"!=typeof e.return&&(this.return=void 0)}function c(e){return function(){return new u(e.apply(this,arguments))}}function p(e){return new s(e)}function f(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function d(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){f(o,n,i,a,s,"next",e)}function s(e){f(o,n,i,a,s,"throw",e)}a(void 0)}))}}function l(){return(l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function h(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,(Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function y(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return v(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?v(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(r=e[Symbol.iterator]()).next.bind(r)}"function"==typeof Symbol&&Symbol.asyncIterator&&(u.prototype[Symbol.asyncIterator]=function(){return this}),u.prototype.next=function(e){return this._invoke("next",e)},u.prototype.throw=function(e){return this._invoke("throw",e)},u.prototype.return=function(e){return this._invoke("return",e)};var x,b=(function(e){var t=function(e){var t=Object.prototype,r=t.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",o=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function s(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,r){return e[t]=r}}function u(e,t,r,n){var i=Object.create((t&&t.prototype instanceof f?t:f).prototype),o=new k(n||[]);return i._invoke=function(e,t,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return{value:void 0,done:!0}}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=m(a,r);if(s){if(s===p)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=c(e,t,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===p)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(e,r,o),i}function c(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var p={};function f(){}function d(){}function l(){}var h={};h[i]=function(){return this};var v=Object.getPrototypeOf,y=v&&v(v(K([])));y&&y!==t&&r.call(y,i)&&(h=y);var x=l.prototype=f.prototype=Object.create(h);function b(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function g(e,t){var n;this._invoke=function(i,o){function a(){return new t((function(n,a){!function n(i,o,a,s){var u=c(e[i],e,o);if("throw"!==u.type){var p=u.arg,f=p.value;return f&&"object"==typeof f&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(f).then((function(e){p.value=e,a(p)}),(function(e){return n("throw",e,a,s)}))}s(u.arg)}(i,o,n,a)}))}return n=n?n.then(a,a):a()}}function m(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,m(e,t),"throw"===t.method))return p;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var n=c(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,p;var i=n.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,p):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function w(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(w,this),this.reset(!0)}function K(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:A}}function A(){return{value:void 0,done:!0}}return d.prototype=x.constructor=l,l.constructor=d,d.displayName=s(l,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,s(e,a,"GeneratorFunction")),e.prototype=Object.create(x),e},e.awrap=function(e){return{__await:e}},b(g.prototype),g.prototype[o]=function(){return this},e.AsyncIterator=g,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var a=new g(u(t,r,n,i),o);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},b(x),s(x,a,"Generator"),x[i]=function(){return this},x.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=K,k.prototype={constructor:k,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(P),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(s&&u){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,p):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),p},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),P(r),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;P(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:K(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}}(x={exports:{}}),x.exports),g=function e(t){var n=this;this.esploraEndpoint=e.DEFAULT_ESPLORA_ENDPOINT,this.addressesHaveBeenUsed=function(){var e=d(b.mark((function e(t){return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",r.all(t.map(n.addressHasBeenUsed)));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.addressHasBeenUsed=function(){var e=d(b.mark((function e(t){return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",r.get(n.esploraEndpoint+"/address/"+t+"/txs").then((function(e){return e.data.length>0}),(function(e){return!1})).catch((function(){return!1})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),t&&(this.esploraEndpoint=t)};function m(e){return e.slice(1).reverse().toString("hex")}function w(e){return t.confidential.confidentialValueToSatoshi(e)}g.DEFAULT_ESPLORA_ENDPOINT="https://blockstream.info/liquid/api";var P=Buffer.from("0x00","hex");function k(e){return null!=e&&e.length>0}function K(e){var t=e.surjectionProof,r=e.nonce;return k(e.rangeProof)&&k(t)&&r!==P}var A,T=function(){function e(){this.map=new Map}var t=e.prototype;return t.bufferToStringPrimitive=function(e){return e.toString("hex").valueOf()},t.get=function(e){return this.map.get(this.bufferToStringPrimitive(e))},t.set=function(e,t){return this.map.set(this.bufferToStringPrimitive(e),t),this},t.values=function(){return Array.from(this.map.values())},e}(),I=new Map([["xpub","0488b21e"],["ypub","049d7cb2"],["Ypub","0295b43f"],["zpub","04b24746"],["Zpub","02aa7ed3"],["tpub","043587cf"],["upub","044a5262"],["Upub","024289ef"],["vpub","045f1cf6"],["Vpub","02575483"]]);function B(e,t){if(!I.has(t))return"Invalid target version";e=e.trim();try{var r=n.decode(e);return r=r.slice(4),r=Buffer.concat([Buffer.from(I.get(t),"hex"),r]),n.encode(r)}catch(e){throw new Error("Invalid extended public key! Please double check that you didn't accidentally paste extra data.")}}function E(e,t){return B(e,"regtest"===t?"vpub":"zpub")}function S(e){return B(e,"xpub")}function O(e,t){try{i.fromBase58(e,t)}catch(e){return!1}return!0}function L(e){try{o.fromMasterBlindingKey(e)}catch(e){return!1}return!0}function U(e){var r;try{r=t.Psbt.fromBase64(e)}catch(e){throw new Error("Invalid pset")}return r.data.globalMap.unsignedTx.toBuffer().toString("hex")}function _(e){return{txid:e.txid,vout:e.vout}}function N(e){return!e.asset||!e.value}function M(e){return e?t.networks[e]:t.networks.liquid}function j(e,t){return F.apply(this,arguments)}function F(){return(F=d(b.mark((function e(r,n){var i,o,a,s;return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i={asset:r.blindedAsset,value:r.blindedValue,rangeProof:r.rangeProof,surjectionProof:r.surjectionProof,nonce:r.nonce,script:Buffer.from(r.script,"hex")},o=Buffer.from(n,"hex"),e.next=4,t.confidential.unblindOutputWithKey(i,o);case 4:return a=e.sent,s={asset:Buffer.from(a.asset.reverse()).toString("hex"),value:parseInt(a.value,10),script:r.script,assetBlinder:a.assetBlindingFactor.toString("hex"),valueBlinder:a.valueBlindingFactor.toString("hex")},e.abrupt("return",s);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function W(e){var r=function(e){if(e.satsPerByte||(e.satsPerByte=.1),e.addFee||(e.addFee=!1),e.addFee&&e.satsPerByte<.1)throw new Error("satsPerByte minimum value is 0.1");if(0===e.recipients.length)throw new Error("need a least one recipient output to build the transaction");if(0===e.unspents.length)throw new Error("need at least one unspent to fund the transaction");return e}(e),n=r.changeAddressByAsset,i=r.coinSelector,o=r.psetBase64,a=r.recipients,s=r.unspents,u=r.addFee,c=r.satsPerByte,p=i(s,a,n),f=p.selectedUtxos,d=p.changeOutputs,l=f;if(!u)return H(o,l,a.concat(d));var h=R(o),v=h.data.inputs.length+l.length,x=h.data.outputs.length+a.length+d.length,b=t.address.getNetwork(a[0].address).assetHash,g=C(v,x,c,b),m=d.findIndex((function(e){return e.asset===b})),w=-1===m?0-g.value:d[m].value-g.value;if(w>0)return d[m].value=w,H(o,l,a.concat(d).concat(g));if(0===w)return H(o,l,a.concat(g));for(var P,k=[],K=y(s);!(P=K()).done;){var A=P.value;f.includes(A)||k.push(A)}var T=C(v+1,x+1,c,b),I=i(k,[T],n);return H(o,l.concat(I.selectedUtxos),a.concat(d).concat(I.changeOutputs).concat(T))}function C(e,t,r,n){var i=D(e,t);return{asset:n,value:Math.ceil(i*r),address:""}}function H(e,r,n){for(var i,o=R(e),a=Buffer.from("00","hex"),s=y(n);!(i=s()).done;){var u=i.value,c=u.asset,p=u.value,f=u.address,d=""===f?"":t.address.toOutputScript(f);o.addOutput({asset:c,value:p,script:d,nonce:a})}for(var l,h=y(r);!(l=h()).done;){var v=l.value;o.addInput({hash:v.txid,index:v.vout,witnessUtxo:v.prevout})}return o.toBase64()}function R(e){var r;try{r=t.Psbt.fromBase64(e)}catch(e){throw new Error("Invalid pset")}return r}function D(e,t){return(3*G(!1,e,t,!1)+G(!0,e,t,!0)+3)/4}function G(e,t,r,n){var i=function(e,t){var r=40*t;return e&&(r+=105*t),r}(e,t),o=function(e,t){var r=67*t;return e&&(r+=4273*t),r+43}(n,r);return 9+q(r)+q(t)+i+o}function q(e){return e<253?1:e<=65535?3:e<=4294967295?5:9}(A=exports.IdentityType||(exports.IdentityType={}))[A.PrivateKey=1]="PrivateKey",A[A.Mnemonic=2]="Mnemonic",A[A.MasterPublicKey=3]="MasterPublicKey",A[A.Inject=4]="Inject",A[A.Ledger=5]="Ledger",A[A.Trezor=6]="Trezor";var X=function(){function e(r){if(!r.chain||!t.networks.hasOwnProperty(r.chain))throw new Error("Network is missing or not valid");if(!r.type||!(r.type in exports.IdentityType))throw new Error("Type is missing or not valid");this.network=t.networks[r.chain],this.type=r.type,this.restorer=r.restorer?r.restorer:e.DEFAULT_RESTORER}return e.prototype.blindPsetWithBlindKeysGetter=function(){var e=d(b.mark((function e(r,n,i,o,a){var s,u,c,p,f,d,l,h,v,x,g,m,w,P,k;return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s=new Map,u=new Map,c=R(n),p=t.Transaction.fromHex(U(n)),f=y(i);case 5:if((d=f()).done){e.next=16;break}if(l=d.value,!o||!o.has(l)){e.next=11;break}return h=Buffer.from(o.get(l),"hex"),u.set(l,h),e.abrupt("continue",14);case 11:v=r(p.outs[l].script).publicKey,u.set(l,v);case 14:e.next=5;break;case 16:x=0;case 17:if(!(x<c.data.inputs.length)){e.next=43;break}if(m=void 0,!(g=c.data.inputs[x]).witnessUtxo){e.next=24;break}if(K(g.witnessUtxo)){e.next=23;break}return e.abrupt("continue",40);case 23:m=g.witnessUtxo.script;case 24:if(!g.nonWitnessUtxo){e.next=30;break}if(w=p.ins[x].index,K(P=t.Transaction.fromBuffer(g.nonWitnessUtxo).outs[w])){e.next=29;break}return e.abrupt("continue",40);case 29:m=P.script;case 30:if(!a||!a.has(x)){e.next=33;break}return s.set(x,a.get(x)),e.abrupt("continue",40);case 33:if(m){e.next=35;break}throw new Error("no witness script for input #"+x);case 35:return k=r(m).privateKey,e.next=38,t.confidential.unblindOutputWithKey(g.witnessUtxo,k);case 38:s.set(x,e.sent);case 40:x++,e.next=17;break;case 43:return e.next=45,c.blindOutputsByIndex(s,u);case 45:return e.abrupt("return",e.sent.toBase64());case 47:case"end":return e.stop()}}),e)})));return function(t,r,n,i,o){return e.apply(this,arguments)}}(),e}();function V(e){var t,r=null==(t=e.address.derivationPath)?void 0:t.split("/");if(!r)throw new Error("addressInterface should contain derivation path.");return parseInt(r[r.length-1])}X.DEFAULT_RESTORER=new g;var z=function(e){function r(t){var n;(n=e.call(this,t)||this).index=r.INITIAL_INDEX,n.changeIndex=r.INITIAL_INDEX,n.scriptToAddressCache=new T,n.baseDerivationPath=r.INITIAL_BASE_PATH;var a,s=S(t.value.masterPublicKey);if(t.type!==exports.IdentityType.MasterPublicKey)throw new Error("The identity arguments have not the MasterPublicKey type.");if(!("masterPublicKey"in(a=t.value))||!("masterBlindingKey"in a))throw new Error("The value of IdentityOpts is not valid for MasterPublicKey Identity.");if(!O(s))throw new Error("Master public key is not valid");if(!L(t.value.masterBlindingKey))throw new Error("Master blinding key is not valid");return n.masterPublicKeyNode=i.fromBase58(s),n.masterBlindingKeyNode=o.fromMasterBlindingKey(t.value.masterBlindingKey),n.isRestored=new Promise((function(){return!0})),t.initializeFromRestorer&&(n.isRestored=n.restore().catch((function(e){throw new Error("Error during restoration step: "+e)}))),n}h(r,e);var n=r.prototype;return n.blindPset=function(){var t=d(b.mark((function t(r,n,i,o){var a=this;return b.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.prototype.blindPsetWithBlindKeysGetter.call(this,(function(e){return a.getBlindingKeyPair(e,!0)}),r,n,i,o));case 1:case"end":return t.stop()}}),t,this)})));return function(e,r,n,i){return t.apply(this,arguments)}}(),n.isAbleToSign=function(){return!1},n.derivePublicKeyWithIndex=function(e,t){return this.masterPublicKeyNode.derive(e?1:0).derive(t).publicKey},n.getBlindingKeyPair=function(e,t){if(void 0===t&&(t=!1),t&&!this.scriptToAddressCache.get(e))throw new Error("unknow blinding key for script "+e.toString("hex"));var r=this.masterBlindingKeyNode.derive(e);return{publicKey:r.publicKey,privateKey:r.privateKey}},n.scriptFromPublicKey=function(e){return t.payments.p2wpkh({pubkey:e,network:this.network}).output},n.createConfidentialAddress=function(e,r){return t.payments.p2wpkh({pubkey:e,blindkey:r,network:this.network}).confidentialAddress},n.persistAddressToCache=function(e){var t=Buffer.from(e.publicKey,"hex"),r=this.scriptFromPublicKey(t);this.scriptToAddressCache.set(r,e)},n.getAddress=function(e,t){var r=this.derivePublicKeyWithIndex(e,t),n=this.scriptFromPublicKey(r),i=this.getBlindingKeyPair(n),o=this.createConfidentialAddress(r,i.publicKey),a=this.baseDerivationPath+"/"+(e?1:0)+"/"+t;return{address:{confidentialAddress:o,blindingPrivateKey:i.privateKey.toString("hex"),derivationPath:a},publicKey:r.toString("hex")}},n.getNextAddress=function(){var e=this.getAddress(!1,this.index);return this.persistAddressToCache(e),this.index+=1,e.address},n.getNextChangeAddress=function(){var e=this.getAddress(!0,this.changeIndex);return this.persistAddressToCache(e),this.changeIndex+=1,e.address},n.getBlindingPrivateKey=function(e){var t=Buffer.from(e,"hex");return this.getBlindingKeyPair(t).privateKey.toString("hex")},n.signPset=function(e){throw new Error("MasterPublicKey is a watch only identity. Use Mnemonic to sign transactions")},n.getAddresses=function(){return this.scriptToAddressCache.values().map((function(e){return e.address}))},n.generateSetOfAddresses=function(){var e=d(b.mark((function e(t,r,n){var i,o,a=this;return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=function(){var e=d(b.mark((function e(t){return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",a.getAddress(n,t));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),o=Array.from({length:r},(function(e,r){return r+t})),e.abrupt("return",Promise.all(o.map(i)));case 3:case"end":return e.stop()}}),e)})));return function(t,r,n){return e.apply(this,arguments)}}(),n.checkAddressesWithRestorer=function(){var e=d(b.mark((function e(t){var r;return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.map((function(e){return e.address.confidentialAddress})),e.next=3,this.restorer.addressesHaveBeenUsed(r);case 3:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),n.restoreAddresses=function(){var e=d(b.mark((function e(){var t,n,i,o=this;return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=[],n=b.mark((function e(n){var i,a,s,u,c,p,f;return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=1===n,a=0,s=0,u=[],c=function(e){return function(t,r){a++,t&&(a=0,u.push(e[r]))}};case 5:if(!(a<20)){e.next=16;break}return e.next=8,o.generateSetOfAddresses(s,20-a,i);case 8:return p=e.sent,e.next=11,o.checkAddressesWithRestorer(p);case 11:e.sent.forEach(c(p)),s+=20,e.next=5;break;case 16:f=u.map(V),i?o.changeIndex=f.length>0?Math.max.apply(Math,f)+1:r.INITIAL_INDEX:o.index=f.length>0?Math.max.apply(Math,f)+1:r.INITIAL_INDEX,t=t.concat(u);case 19:case"end":return e.stop()}}),e)})),i=0;case 4:if(!(i<2)){e.next=9;break}return e.delegateYield(n(i),"t0",6);case 6:i++,e.next=4;break;case 9:return e.abrupt("return",t);case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),n.restore=function(){var e=d(b.mark((function e(){var t=this;return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.restoreAddresses();case 2:return e.sent.forEach((function(e){return t.persistAddressToCache(e)})),e.abrupt("return",!0);case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),r}(X);z.INITIAL_BASE_PATH="m/84'/0'/0'",z.INITIAL_INDEX=0;var Y=function(e){function r(r){var n;if(r.type!==exports.IdentityType.Mnemonic)throw new Error("The identity arguments have not the Mnemonic type.");if(!("mnemonic"in r.value))throw new Error("The value of IdentityOpts is not valid for Mnemonic Identity.");if(a.setDefaultWordlist(r.value.language?r.value.language:"english"),!a.validateMnemonic(r.value.mnemonic))throw new Error("Mnemonic is not valid.");var s=a.mnemonicToSeedSync(r.value.mnemonic),u=i.fromSeed(s,t.networks[r.chain]),c=u.derivePath(z.INITIAL_BASE_PATH),p=E(t.bip32.fromPublicKey(c.publicKey,c.chainCode,c.network).toBase58(),r.chain),f=o.fromSeed(s),d=f.masterKey.toString("hex");return(n=e.call(this,l({},r,{type:exports.IdentityType.MasterPublicKey,value:{masterPublicKey:p,masterBlindingKey:d}}))||this).masterBlindingKey=d,n.masterBlindingKeyNode=f,n.masterPublicKey=p,n.masterPrivateKeyNode=u,n}h(r,e);var n=r.prototype;return n.blindPset=function(){var t=d(b.mark((function t(r,n,i,o){var a=this;return b.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.prototype.blindPsetWithBlindKeysGetter.call(this,(function(t){return e.prototype.getBlindingKeyPair.call(a,t,!0)}),r,n,i,o));case 1:case"end":return t.stop()}}),t,this)})));return function(e,r,n,i){return t.apply(this,arguments)}}(),n.isAbleToSign=function(){return!0},n.derivePath=function(e){var r=this.masterPrivateKeyNode.derivePath(e).toWIF(),n=t.ECPair.fromWIF(r,this.network);return{publicKey:n.publicKey,privateKey:n.privateKey}},n.signPset=function(){var e=d(b.mark((function e(r){var n,i,o,a,s,u,c;return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(n=t.Psbt.fromBase64(r),i=[],o=0;o<n.data.inputs.length;o++)(a=n.data.inputs[o]).witnessUtxo&&(s=this.scriptToAddressCache.get(a.witnessUtxo.script))&&(u=this.derivePath(s.address.derivationPath).privateKey,c=t.ECPair.fromPrivateKey(u),i.push(n.signInputAsync(o,c)));return e.next=5,Promise.all(i);case 5:return e.abrupt("return",n.toBase64());case 6:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),n.getAddresses=function(){return e.prototype.getAddresses.call(this)},r}(z),Z=function(e){function r(r){var n,i;if((n=e.call(this,r)||this).isRestored=new Promise((function(){return!0})),r.type!==exports.IdentityType.PrivateKey)throw new Error("The identity arguments have not the PrivateKey type.");if(!("signingKeyWIF"in(i=r.value))||!("blindingKeyWIF"in i))throw new Error("The value of IdentityOpts is not valid for PrivateKey Identity.");n.signingKeyPair=n.decodeFromWif(r.value.signingKeyWIF),n.blindingKeyPair=n.decodeFromWif(r.value.blindingKeyWIF);var o=t.payments.p2wpkh({pubkey:n.signingKeyPair.publicKey,blindkey:n.blindingKeyPair.publicKey,network:n.network});return n.confidentialAddress=o.confidentialAddress,n.blindingPrivateKey=n.blindingKeyPair.privateKey.toString("hex"),n.scriptPubKey=o.output,n}h(r,e);var n=r.prototype;return n.blindPset=function(){var t=d(b.mark((function t(r,n,i,o){var a=this;return b.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.prototype.blindPsetWithBlindKeysGetter.call(this,(function(e){return a.getBlindingKeyPair(e)}),r,n,i,o));case 1:case"end":return t.stop()}}),t,this)})));return function(e,r,n,i){return t.apply(this,arguments)}}(),n.getBlindingKeyPair=function(e){if(!e.equals(this.scriptPubKey))throw new Error(e+" is unknown by the PrivateKey Identity");return{publicKey:this.blindingKeyPair.publicKey,privateKey:this.blindingKeyPair.privateKey}},n.isAbleToSign=function(){return!0},n.decodeFromWif=function(e){return t.ECPair.fromWIF(e,this.network)},n.getAddress=function(){return{confidentialAddress:this.confidentialAddress,blindingPrivateKey:this.blindingPrivateKey,derivationPath:void 0}},n.getNextAddress=function(){return this.getAddress()},n.getNextChangeAddress=function(){return this.getAddress()},n.getBlindingPrivateKey=function(e){if(!Buffer.from(e,"hex").equals(this.scriptPubKey))throw new Error("The script is not PrivateKey.scriptPubKey.");return this.blindingPrivateKey},n.signPset=function(){var e=d(b.mark((function e(r){var n,i,o,a,s=this;return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(n=t.Psbt.fromBase64(r),i=[],o=0;o<n.data.inputs.length;o++)(a=n.data.inputs[o]).witnessUtxo?a.witnessUtxo.script.equals(this.scriptPubKey)&&i.push(o):i.push(o);return e.next=5,Promise.all(i.map((function(e){return n.signInputAsync(e,s.signingKeyPair)})));case 5:return e.abrupt("return",n.toBase64());case 6:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),n.getAddresses=function(){return[{confidentialAddress:this.confidentialAddress,blindingPrivateKey:this.blindingPrivateKey,derivationPath:void 0}]},r}(X),$=function(e,t){return e.value-t.value};function J(e,t,r){for(var n,i=[],o=0,a=y(e=e.sort(r));!(n=a()).done;){var s=n.value;if(N(s)||(i.push(s),o+=s.value),o>=t)return{selected:i,changeAmount:o-t}}throw new Error("not enough utxos in wallet to found: "+t)}function Q(e,t){return e.reduce((function(e,r){return(e[r[t]]=e[r[t]]||[]).push(r),e}),{})}function ee(e){return"surjectionProof"in e&&"rangeProof"in e}var te=Buffer.alloc(32).toString("hex");function re(e,t){return ne.apply(this,arguments)}function ne(){return(ne=d(b.mark((function e(t,n){return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.get(n+"/tx/"+t+"/hex");case 2:return e.abrupt("return",e.sent.data);case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ie(){return(ie=d(b.mark((function e(t,n){return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=se,e.next=3,r.get(n+"/tx/"+t);case 3:return e.t1=e.sent.data,e.t2=n,e.abrupt("return",(0,e.t0)(e.t1,e.t2));case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function oe(e,t){return ae.apply(this,arguments)}function ae(){return(ae=d(b.mark((function e(t,n){return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.get(n+"/address/"+t+"/utxo");case 2:return e.abrupt("return",e.sent.data);case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function se(e,t){return ue.apply(this,arguments)}function ue(){return(ue=d(b.mark((function e(r,n){var i,o,a,s,u,c,p,f,d;return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(i=[],o=[],a=y(r.vin);!(s=a()).done;)i.push((u=s.value).txid),o.push(u.vout);return e.next=5,Promise.all(i.map((function(e){return re(e,n)})));case 5:return c=e.sent.map((function(e,r){return ce(t.Transaction.fromHex(e).outs[o[r]])})),p=i.map((function(e,t){return{prevout:c[t],txid:e,vout:o[t]}})),e.next=10,re(r.txid,n);case 10:return f=t.Transaction.fromHex(e.sent),d=f.outs.map(ce),e.abrupt("return",{txid:r.txid,vin:p,vout:d,fee:r.fee,status:{confirmed:r.status.confirmed,blockHash:r.status.block_hash,blockHeight:r.status.block_height,blockTime:r.status.block_time}});case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ce(e){return K(e)?{blindedAsset:e.asset,blindedValue:e.value,nonce:e.nonce,rangeProof:e.rangeProof,surjectionProof:e.surjectionProof,script:e.script.toString("hex")}:{asset:m(e.asset),value:w(e.value),script:e.script.toString("hex"),assetBlinder:te,valueBlinder:te}}function pe(e,t,r){return e+"/tx/"+t+"#blinded="+r.map((function(e){return e.value+","+e.asset+","+e.valueBlinder+","+e.assetBlinder})).join(",")}function fe(){return(fe=d(b.mark((function e(t,r){var n,i,o,a;return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(n=[],i=y(t.vout);!(o=i()).done;)ee(a=o.value)||n.push(a);return e.abrupt("return",pe(r,t.txid,n));case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function de(e,t,r,n){return le.apply(this,arguments)}function le(){return(le=c(b.mark((function e(t,r,n,i){var o,a,s,u,c,f,d,l;return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=[],a=[],s=y(t);case 3:if((u=s()).done){e.next=32;break}return c=u.value,e.prev=5,f=ve(c,n,i),e.next=9,p(f.next());case 9:d=e.sent;case 10:if(d.done){e.next=25;break}if(!o.includes((l=d.value).txid)){e.next=17;break}return e.next=15,p(f.next());case 15:return d=e.sent,e.abrupt("continue",10);case 17:return e.next=19,xe(l,r);case 19:return o.push(l.txid),e.next=22,p(f.next());case 22:d=e.sent,e.next=10;break;case 25:e.next=30;break;case 27:e.prev=27,e.t0=e.catch(5),a.push(e.t0);case 30:e.next=3;break;case 32:return e.abrupt("return",{txIDs:o,errors:a});case 33:case"end":return e.stop()}}),e,null,[[5,27]])})))).apply(this,arguments)}function he(){return(he=d(b.mark((function e(t,r,n,i){var o,a,s;return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=de(t,r,n,i),a=[],e.next=4,o.next();case 4:s=e.sent;case 5:if(s.done){e.next=12;break}return a.push(s.value),e.next=9,o.next();case 9:s=e.sent,e.next=5;break;case 12:return e.abrupt("return",a);case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ve(e,t,r){return ye.apply(this,arguments)}function ye(){return(ye=c(b.mark((function e(t,r,n){var i,o,a,s,u,c,f,d;return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=void 0,o=[],a=0;case 3:return e.next=5,p(ge(t,r,i));case 5:if(0!==(o=e.sent).length){e.next=8;break}return e.abrupt("break",24);case 8:i=o[o.length-1].txid,a+=o.length,s=o.map((function(e){return se(e,r)})),u=y(s);case 12:if((c=u()).done){e.next=23;break}return f=c.value,e.next=16,p(f);case 16:if(d=e.sent,!n||!n(d)){e.next=19;break}return e.abrupt("continue",21);case 19:return e.next=21,d;case 21:e.next=12;break;case 23:if(i){e.next=3;break}case 24:return e.abrupt("return",a);case 25:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function xe(e,t){return be.apply(this,arguments)}function be(){return(be=d(b.mark((function e(t,r){var n,i,o,a,s;return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(n=[],i=function(e){var i=t.vin[e].prevout;ee(i)&&n.push(function(){var n=d(b.mark((function n(){var o;return b.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!(o=r(i.script))){n.next=6;break}return n.next=4,j(i,o);case 4:t.vin[e].prevout=n.sent;case 6:case"end":return n.stop()}}),n)})));return function(){return n.apply(this,arguments)}}()())},o=0;o<t.vin.length;o++)i(o);for(a=function(e){var i=t.vout[e];ee(i)&&n.push(function(){var n=d(b.mark((function n(){var o;return b.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!(o=r(i.script))){n.next=6;break}return n.next=4,j(i,o);case 4:t.vout[e]=n.sent;case 6:case"end":return n.stop()}}),n)})));return function(){return n.apply(this,arguments)}}()())},s=0;s<t.vout.length;s++)a(s);return e.next=7,Promise.all(n);case 7:return e.abrupt("return",t);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ge(e,t,r){return me.apply(this,arguments)}function me(){return(me=d(b.mark((function e(t,n,i){var o;return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=n+"/address/"+t+"/txs/chain",i&&(o+="/"+i),e.next=4,r.get(o);case 4:return e.abrupt("return",e.sent.data);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function we(){return(we=d(b.mark((function e(t,r,n){return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ke([{confidentialAddress:t,blindingPrivateKey:r}],n);case 2:return e.abrupt("return",e.sent.reduce((function(e,t){var r=t.asset;return e[r]=e[r]||0,e[r]+=t.value,e}),{}));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Pe(e,t,r){return ke.apply(this,arguments)}function ke(){return(ke=c(b.mark((function e(t,r,n){var i,o,a,s,u;return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=0,o=[],a=b.mark((function e(){var t,a,s,c,f,d,l,h;return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=(t=u.value).confidentialAddress,s=t.blindingPrivateKey,e.prev=1,e.next=4,p(oe(a,r));case 4:c=e.sent.map((function(e){return n&&n(e)?e:Be(e,s,r)})),f=y(c);case 7:if((d=f()).done){e.next=17;break}return l=d.value,e.next=11,p(l);case 11:return h=e.sent,e.next=14,h;case 14:i++;case 15:e.next=7;break;case 17:e.next=22;break;case 19:e.prev=19,e.t0=e.catch(1),o.push(e.t0);case 22:case"end":return e.stop()}}),e,null,[[1,19]])})),s=y(t);case 4:if((u=s()).done){e.next=8;break}return e.delegateYield(a(),"t0",6);case 6:e.next=4;break;case 8:return e.abrupt("return",{numberOfUtxos:i,errors:o});case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ke(e,t,r){return Ae.apply(this,arguments)}function Ae(){return(Ae=d(b.mark((function e(t,r,n){var i,o,a;return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=Pe(t,r,n),o=[],e.next=4,i.next();case 4:a=e.sent;case 5:if(a.done){e.next=12;break}return o.push(a.value),e.next=9,i.next();case 9:a=e.sent,e.next=5;break;case 12:return e.abrupt("return",o);case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Te(e,t){return Ie.apply(this,arguments)}function Ie(){return(Ie=d(b.mark((function e(r,n){var i;return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,re(r.txid,n);case 2:return i=t.Transaction.fromHex(e.sent).outs[r.vout],e.abrupt("return",l({},r,{prevout:i}));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Be(e,t,r){return Ee.apply(this,arguments)}function Ee(){return(Ee=d(b.mark((function e(t,r,n){return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.prevout){e.next=4;break}return e.next=3,Te(t,n);case 3:t=e.sent;case 4:return e.prev=4,e.abrupt("return",Se(t,r));case 8:return e.prev=8,e.t0=e.catch(4),e.abrupt("return",t);case 11:case"end":return e.stop()}}),e,null,[[4,8]])})))).apply(this,arguments)}function Se(e,t){return Oe.apply(this,arguments)}function Oe(){return(Oe=d(b.mark((function e(r,n){var i,o;return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r.prevout){e.next=2;break}throw new Error("utxo need utxo.prevout to be defined. Use utxoWithPrevout.");case 2:if(K(r.prevout)){e.next=4;break}return e.abrupt("return",r);case 4:return e.next=6,t.confidential.unblindOutputWithKey(r.prevout,Buffer.from(n,"hex"));case 6:return i=e.sent,o=Buffer.alloc(32),i.asset.copy(o),e.abrupt("return",l({},r,{asset:o.reverse().toString("hex"),value:parseInt(i.value,10),unblindData:i}));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Le=function(){function e(e,t){this.network=t,this.cache=e}var r=e.prototype;return r.createTx=function(){return new t.Psbt({network:this.network}).toBase64()},r.buildTx=function(e,t,r,n,i,o){return W({psetBase64:e,recipients:t,coinSelector:r,changeAddressByAsset:n,addFee:i,satsPerByte:o,unspents:this.cache.getAll()})},e}();function Ue(){return(Ue=d(b.mark((function e(t,r,n){return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ke(t,r);case 2:return e.abrupt("return",_e(e.sent,n));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _e(e,t){return new Le(new Ne(e),M(t))}var Ne=function(){function e(e){this.utxoMap=new Map,e&&this.push(e)}var t=e.prototype;return t.push=function(e){for(var t,r=y(e);!(t=r()).done;){var n=t.value;this.utxoMap.set(_(n),n)}},t.delete=function(e){return this.utxoMap.delete(e)},t.getAll=function(){return Array.from(this.utxoMap.values())},e}();Object.defineProperty(exports,"ECPair",{enumerable:!0,get:function(){return t.ECPair}}),Object.defineProperty(exports,"address",{enumerable:!0,get:function(){return t.address}}),Object.defineProperty(exports,"networks",{enumerable:!0,get:function(){return t.networks}}),Object.defineProperty(exports,"payments",{enumerable:!0,get:function(){return t.payments}}),exports.BufferMap=T,exports.EsploraIdentityRestorer=g,exports.MasterPublicKey=z,exports.Mnemonic=Y,exports.PrivateKey=Z,exports.UtxoCache=Ne,exports.Wallet=Le,exports.addToTx=H,exports.buildTx=W,exports.createFeeOutput=C,exports.decodePset=R,exports.esploraTxToTxInterface=se,exports.estimateTxSize=D,exports.fetchAndUnblindTxs=function(e,t,r,n){return he.apply(this,arguments)},exports.fetchAndUnblindTxsGenerator=de,exports.fetchAndUnblindUtxos=Ke,exports.fetchAndUnblindUtxosGenerator=Pe,exports.fetchBalances=function(e,t,r){return we.apply(this,arguments)},exports.fetchPrevoutAndTryToUnblindUtxo=Be,exports.fetchTx=function(e,t){return ie.apply(this,arguments)},exports.fetchTxHex=re,exports.fetchUtxos=oe,exports.fromAssetHash=function(e){return Buffer.concat([Buffer.from("01","hex"),Buffer.from(e,"hex").reverse()])},exports.fromXpub=E,exports.getNetwork=M,exports.getUnblindURLFromTx=function(e,t){return fe.apply(this,arguments)},exports.greedyCoinSelector=function(e){return void 0===e&&(e=$),function(t,r,n){return function(e,t,r,n){for(var i={selectedUtxos:[],changeOutputs:[]},o=Q(e=e.filter((function(e){return!N(e)})),"asset"),a=Q(t,"asset"),s=0,u=Object.entries(a);s<u.length;s++){var c,p=u[s],f=p[0],d=p[1],l=o[f];if(!l)throw new Error("need unspents for the asset: "+f);var h=J(l,d.reduce((function(e,t){return e+t.value}),0),n),v=h.changeAmount;if((c=i.selectedUtxos).push.apply(c,h.selected),v>0){var y=r(f);if(!y)throw new Error("need change address for asset: "+f);i.changeOutputs.push({asset:f,value:v,address:y})}}return i}(t,r,n,e)}},exports.isBlindedOutputInterface=ee,exports.isBlindedUtxo=N,exports.isConfidentialOutput=K,exports.isValidAmount=function(e){return!(e<=0||!Number.isSafeInteger(e))},exports.isValidExtendedBlindKey=L,exports.isValidXpub=O,exports.makeUnblindURL=pe,exports.psetToUnsignedHex=U,exports.psetToUnsignedTx=function(e){return t.Transaction.fromHex(U(e))},exports.toAssetHash=m,exports.toNumber=w,exports.toOutpoint=_,exports.toXpub=S,exports.unblindOutput=j,exports.unblindTransaction=xe,exports.unblindUtxo=Se,exports.utxoWithPrevout=Te,exports.walletFromAddresses=function(e,t,r){return Ue.apply(this,arguments)},exports.walletFromCoins=_e;
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("liquidjs-lib"),r=e(require("axios")),n=e(require("bs58check")),i=require("bip32"),o=require("slip77"),a=require("bip39");function s(e){this.wrapped=e}function u(e){var t,r;function n(t,r){try{var o=e[t](r),a=o.value,u=a instanceof s;Promise.resolve(u?a.wrapped:a).then((function(e){u?n("return"===t?"return":"next",e):i(o.done?"return":"normal",e)}),(function(e){n("throw",e)}))}catch(e){i("throw",e)}}function i(e,i){switch(e){case"return":t.resolve({value:i,done:!0});break;case"throw":t.reject(i);break;default:t.resolve({value:i,done:!1})}(t=t.next)?n(t.key,t.arg):r=null}this._invoke=function(e,i){return new Promise((function(o,a){var s={key:e,arg:i,resolve:o,reject:a,next:null};r?r=r.next=s:(t=r=s,n(e,i))}))},"function"!=typeof e.return&&(this.return=void 0)}function c(e){return function(){return new u(e.apply(this,arguments))}}function p(e){return new s(e)}function f(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function d(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){f(o,n,i,a,s,"next",e)}function s(e){f(o,n,i,a,s,"throw",e)}a(void 0)}))}}function l(){return(l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function h(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,(Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function y(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return v(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?v(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(r=e[Symbol.iterator]()).next.bind(r)}"function"==typeof Symbol&&Symbol.asyncIterator&&(u.prototype[Symbol.asyncIterator]=function(){return this}),u.prototype.next=function(e){return this._invoke("next",e)},u.prototype.throw=function(e){return this._invoke("throw",e)},u.prototype.return=function(e){return this._invoke("return",e)};var x,b=(function(e){var t=function(e){var t=Object.prototype,r=t.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",o=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function s(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,r){return e[t]=r}}function u(e,t,r,n){var i=Object.create((t&&t.prototype instanceof f?t:f).prototype),o=new k(n||[]);return i._invoke=function(e,t,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return{value:void 0,done:!0}}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=m(a,r);if(s){if(s===p)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=c(e,t,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===p)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(e,r,o),i}function c(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var p={};function f(){}function d(){}function l(){}var h={};h[i]=function(){return this};var v=Object.getPrototypeOf,y=v&&v(v(K([])));y&&y!==t&&r.call(y,i)&&(h=y);var x=l.prototype=f.prototype=Object.create(h);function b(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function g(e,t){var n;this._invoke=function(i,o){function a(){return new t((function(n,a){!function n(i,o,a,s){var u=c(e[i],e,o);if("throw"!==u.type){var p=u.arg,f=p.value;return f&&"object"==typeof f&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(f).then((function(e){p.value=e,a(p)}),(function(e){return n("throw",e,a,s)}))}s(u.arg)}(i,o,n,a)}))}return n=n?n.then(a,a):a()}}function m(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,m(e,t),"throw"===t.method))return p;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var n=c(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,p;var i=n.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,p):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function w(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(w,this),this.reset(!0)}function K(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:A}}function A(){return{value:void 0,done:!0}}return d.prototype=x.constructor=l,l.constructor=d,d.displayName=s(l,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,s(e,a,"GeneratorFunction")),e.prototype=Object.create(x),e},e.awrap=function(e){return{__await:e}},b(g.prototype),g.prototype[o]=function(){return this},e.AsyncIterator=g,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var a=new g(u(t,r,n,i),o);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},b(x),s(x,a,"Generator"),x[i]=function(){return this},x.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=K,k.prototype={constructor:k,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(P),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(s&&u){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,p):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),p},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),P(r),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;P(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:K(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}}(x={exports:{}}),x.exports),g=function e(t){var n=this;this.esploraEndpoint=e.DEFAULT_ESPLORA_ENDPOINT,this.addressesHaveBeenUsed=function(){var e=d(b.mark((function e(t){return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",r.all(t.map(n.addressHasBeenUsed)));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.addressHasBeenUsed=function(){var e=d(b.mark((function e(t){return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",r.get(n.esploraEndpoint+"/address/"+t+"/txs").then((function(e){return e.data.length>0}),(function(e){return!1})).catch((function(){return!1})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),t&&(this.esploraEndpoint=t)};function m(e){return e.slice(1).reverse().toString("hex")}function w(e){return t.confidential.confidentialValueToSatoshi(e)}g.DEFAULT_ESPLORA_ENDPOINT="https://blockstream.info/liquid/api";var P=Buffer.from("0x00","hex");function k(e){return null!=e&&e.length>0}function K(e){var t=e.surjectionProof,r=e.nonce;return k(e.rangeProof)&&k(t)&&r!==P}var A,B=function(){function e(){this.map=new Map}var t=e.prototype;return t.bufferToStringPrimitive=function(e){return e.toString("hex").valueOf()},t.get=function(e){return this.map.get(this.bufferToStringPrimitive(e))},t.set=function(e,t){return this.map.set(this.bufferToStringPrimitive(e),t),this},t.values=function(){return Array.from(this.map.values())},e}(),T=new Map([["xpub","0488b21e"],["ypub","049d7cb2"],["Ypub","0295b43f"],["zpub","04b24746"],["Zpub","02aa7ed3"],["tpub","043587cf"],["upub","044a5262"],["Upub","024289ef"],["vpub","045f1cf6"],["Vpub","02575483"]]);function I(e,t){if(!T.has(t))return"Invalid target version";e=e.trim();try{var r=n.decode(e);return r=r.slice(4),r=Buffer.concat([Buffer.from(T.get(t),"hex"),r]),n.encode(r)}catch(e){throw new Error("Invalid extended public key! Please double check that you didn't accidentally paste extra data.")}}function E(e,t){return I(e,"regtest"===t?"vpub":"zpub")}function S(e){return I(e,"xpub")}function O(e,t){try{i.fromBase58(e,t)}catch(e){return!1}return!0}function L(e){try{o.fromMasterBlindingKey(e)}catch(e){return!1}return!0}function U(e){var r;try{r=t.Psbt.fromBase64(e)}catch(e){throw new Error("Invalid pset")}return r.data.globalMap.unsignedTx.toBuffer().toString("hex")}function _(e){return{txid:e.txid,vout:e.vout}}function N(e){return!e.asset||!e.value}function M(e){return e?t.networks[e]:t.networks.liquid}function j(e,t){return F.apply(this,arguments)}function F(){return(F=d(b.mark((function e(r,n){var i,o,a,s;return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i={asset:r.blindedAsset,value:r.blindedValue,rangeProof:r.rangeProof,surjectionProof:r.surjectionProof,nonce:r.nonce,script:Buffer.from(r.script,"hex")},o=Buffer.from(n,"hex"),e.next=4,t.confidential.unblindOutputWithKey(i,o);case 4:return a=e.sent,s={asset:Buffer.from(a.asset.reverse()).toString("hex"),value:parseInt(a.value,10),script:r.script,assetBlinder:a.assetBlindingFactor.toString("hex"),valueBlinder:a.valueBlindingFactor.toString("hex")},e.abrupt("return",s);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function W(e){var r=function(e){if(e.satsPerByte||(e.satsPerByte=.1),e.addFee||(e.addFee=!1),e.addFee&&e.satsPerByte<.1)throw new Error("satsPerByte minimum value is 0.1");if(0===e.recipients.length)throw new Error("need a least one recipient output to build the transaction");if(0===e.unspents.length)throw new Error("need at least one unspent to fund the transaction");return e}(e),n=r.changeAddressByAsset,i=r.coinSelector,o=r.psetBase64,a=r.recipients,s=r.unspents,u=r.addFee,c=r.satsPerByte,p=i(s,a,n),f=p.selectedUtxos,d=p.changeOutputs,l=f;if(!u)return H(o,l,a.concat(d));var h=R(o),v=h.data.inputs.length+l.length,x=h.data.outputs.length+a.length+d.length,b=t.address.getNetwork(a[0].address).assetHash,g=C(v,x,c,b),m=d.findIndex((function(e){return e.asset===b})),w=-1===m?0-g.value:d[m].value-g.value;if(w>0)return d[m].value=w,H(o,l,a.concat(d).concat(g));if(0===w)return H(o,l,a.concat(g));for(var P,k=[],K=y(s);!(P=K()).done;){var A=P.value;f.includes(A)||k.push(A)}var B=C(v+1,x+1,c,b),T=i(k,[B],n);return H(o,l.concat(T.selectedUtxos),a.concat(d).concat(T.changeOutputs).concat(B))}function C(e,t,r,n){var i=D(e,t);return{asset:n,value:Math.ceil(i*r),address:""}}function H(e,r,n){for(var i,o=R(e),a=Buffer.from("00","hex"),s=y(n);!(i=s()).done;){var u=i.value,c=u.asset,p=u.value,f=u.address,d=""===f?"":t.address.toOutputScript(f);o.addOutput({asset:c,value:p,script:d,nonce:a})}for(var l,h=y(r);!(l=h()).done;){var v=l.value;o.addInput({hash:v.txid,index:v.vout,witnessUtxo:v.prevout})}return o.toBase64()}function R(e){var r;try{r=t.Psbt.fromBase64(e)}catch(e){throw new Error("Invalid pset")}return r}function D(e,t){return(3*G(!1,e,t,!1)+G(!0,e,t,!0)+3)/4}function G(e,t,r,n){var i=function(e,t){var r=40*t;return e&&(r+=105*t),r}(e,t),o=function(e,t){var r=67*t;return e&&(r+=4273*t),r+43}(n,r);return 9+q(r)+q(t)+i+o}function q(e){return e<253?1:e<=65535?3:e<=4294967295?5:9}(A=exports.IdentityType||(exports.IdentityType={}))[A.PrivateKey=1]="PrivateKey",A[A.Mnemonic=2]="Mnemonic",A[A.MasterPublicKey=3]="MasterPublicKey",A[A.Inject=4]="Inject",A[A.Ledger=5]="Ledger",A[A.Trezor=6]="Trezor";var X=function(){function e(r){if(!r.chain||!t.networks.hasOwnProperty(r.chain))throw new Error("Network is missing or not valid");if(!r.type||!(r.type in exports.IdentityType))throw new Error("Type is missing or not valid");this.network=t.networks[r.chain],this.type=r.type,this.restorer=r.restorer?r.restorer:e.DEFAULT_RESTORER}return e.prototype.blindPsetWithBlindKeysGetter=function(){var e=d(b.mark((function e(r,n,i,o,a){var s,u,c,p,f,d,l,h,v,x,g,m,w,P,k;return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s=new Map,u=new Map,c=R(n),p=t.Transaction.fromHex(U(n)),f=y(i);case 5:if((d=f()).done){e.next=16;break}if(l=d.value,!o||!o.has(l)){e.next=11;break}return h=Buffer.from(o.get(l),"hex"),u.set(l,h),e.abrupt("continue",14);case 11:v=r(p.outs[l].script).publicKey,u.set(l,v);case 14:e.next=5;break;case 16:x=0;case 17:if(!(x<c.data.inputs.length)){e.next=43;break}if(m=void 0,!(g=c.data.inputs[x]).witnessUtxo){e.next=24;break}if(K(g.witnessUtxo)){e.next=23;break}return e.abrupt("continue",40);case 23:m=g.witnessUtxo.script;case 24:if(!g.nonWitnessUtxo){e.next=30;break}if(w=p.ins[x].index,K(P=t.Transaction.fromBuffer(g.nonWitnessUtxo).outs[w])){e.next=29;break}return e.abrupt("continue",40);case 29:m=P.script;case 30:if(!a||!a.has(x)){e.next=33;break}return s.set(x,a.get(x)),e.abrupt("continue",40);case 33:if(m){e.next=35;break}throw new Error("no witness script for input #"+x);case 35:return k=r(m).privateKey,e.next=38,t.confidential.unblindOutputWithKey(g.witnessUtxo,k);case 38:s.set(x,e.sent);case 40:x++,e.next=17;break;case 43:return e.next=45,c.blindOutputsByIndex(s,u);case 45:return e.abrupt("return",e.sent.toBase64());case 47:case"end":return e.stop()}}),e)})));return function(t,r,n,i,o){return e.apply(this,arguments)}}(),e}();function V(e){var t,r=null==(t=e.address.derivationPath)?void 0:t.split("/");if(!r)throw new Error("addressInterface should contain derivation path.");return parseInt(r[r.length-1])}X.DEFAULT_RESTORER=new g;var z=function(e){function r(t){var n;(n=e.call(this,t)||this).index=r.INITIAL_INDEX,n.changeIndex=r.INITIAL_INDEX,n.scriptToAddressCache=new B,n.baseDerivationPath=r.INITIAL_BASE_PATH;var a,s=S(t.value.masterPublicKey);if(t.type!==exports.IdentityType.MasterPublicKey)throw new Error("The identity arguments have not the MasterPublicKey type.");if(!("masterPublicKey"in(a=t.value))||!("masterBlindingKey"in a))throw new Error("The value of IdentityOpts is not valid for MasterPublicKey Identity.");if(!O(s))throw new Error("Master public key is not valid");if(!L(t.value.masterBlindingKey))throw new Error("Master blinding key is not valid");return n.masterPublicKeyNode=i.fromBase58(s),n.masterBlindingKeyNode=o.fromMasterBlindingKey(t.value.masterBlindingKey),n.isRestored=new Promise((function(){return!0})),t.initializeFromRestorer&&(n.isRestored=n.restore().catch((function(e){throw new Error("Error during restoration step: "+e)}))),n}h(r,e);var n=r.prototype;return n.blindPset=function(){var t=d(b.mark((function t(r,n,i,o){var a=this;return b.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.prototype.blindPsetWithBlindKeysGetter.call(this,(function(e){return a.getBlindingKeyPair(e,!0)}),r,n,i,o));case 1:case"end":return t.stop()}}),t,this)})));return function(e,r,n,i){return t.apply(this,arguments)}}(),n.isAbleToSign=function(){return!1},n.derivePublicKeyWithIndex=function(e,t){return this.masterPublicKeyNode.derive(e?1:0).derive(t).publicKey},n.getBlindingKeyPair=function(e,t){if(void 0===t&&(t=!1),t&&!this.scriptToAddressCache.get(e))throw new Error("unknow blinding key for script "+e.toString("hex"));var r=this.masterBlindingKeyNode.derive(e);return{publicKey:r.publicKey,privateKey:r.privateKey}},n.scriptFromPublicKey=function(e){return t.payments.p2wpkh({pubkey:e,network:this.network}).output},n.createConfidentialAddress=function(e,r){return t.payments.p2wpkh({pubkey:e,blindkey:r,network:this.network}).confidentialAddress},n.persistAddressToCache=function(e){var t=Buffer.from(e.publicKey,"hex"),r=this.scriptFromPublicKey(t);this.scriptToAddressCache.set(r,e)},n.getAddress=function(e,t){var r=this.derivePublicKeyWithIndex(e,t),n=this.scriptFromPublicKey(r),i=this.getBlindingKeyPair(n),o=this.createConfidentialAddress(r,i.publicKey),a=this.baseDerivationPath+"/"+(e?1:0)+"/"+t;return{address:{confidentialAddress:o,blindingPrivateKey:i.privateKey.toString("hex"),derivationPath:a},publicKey:r.toString("hex")}},n.getNextAddress=function(){var e=this.getAddress(!1,this.index);return this.persistAddressToCache(e),this.index+=1,e.address},n.getNextChangeAddress=function(){var e=this.getAddress(!0,this.changeIndex);return this.persistAddressToCache(e),this.changeIndex+=1,e.address},n.getBlindingPrivateKey=function(e){var t=Buffer.from(e,"hex");return this.getBlindingKeyPair(t).privateKey.toString("hex")},n.signPset=function(e){throw new Error("MasterPublicKey is a watch only identity. Use Mnemonic to sign transactions")},n.getAddresses=function(){return this.scriptToAddressCache.values().map((function(e){return e.address}))},n.generateSetOfAddresses=function(){var e=d(b.mark((function e(t,r,n){var i,o,a=this;return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=function(){var e=d(b.mark((function e(t){return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",a.getAddress(n,t));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),o=Array.from({length:r},(function(e,r){return r+t})),e.abrupt("return",Promise.all(o.map(i)));case 3:case"end":return e.stop()}}),e)})));return function(t,r,n){return e.apply(this,arguments)}}(),n.checkAddressesWithRestorer=function(){var e=d(b.mark((function e(t){var r;return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.map((function(e){return e.address.confidentialAddress})),e.next=3,this.restorer.addressesHaveBeenUsed(r);case 3:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),n.restoreAddresses=function(){var e=d(b.mark((function e(){var t,n,i,o=this;return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=[],n=b.mark((function e(n){var i,a,s,u,c,p,f;return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=1===n,a=0,s=0,u=[],c=function(e){return function(t,r){a++,t&&(a=0,u.push(e[r]))}};case 5:if(!(a<20)){e.next=16;break}return e.next=8,o.generateSetOfAddresses(s,20-a,i);case 8:return p=e.sent,e.next=11,o.checkAddressesWithRestorer(p);case 11:e.sent.forEach(c(p)),s+=20,e.next=5;break;case 16:f=u.map(V),i?o.changeIndex=f.length>0?Math.max.apply(Math,f)+1:r.INITIAL_INDEX:o.index=f.length>0?Math.max.apply(Math,f)+1:r.INITIAL_INDEX,t=t.concat(u);case 19:case"end":return e.stop()}}),e)})),i=0;case 4:if(!(i<2)){e.next=9;break}return e.delegateYield(n(i),"t0",6);case 6:i++,e.next=4;break;case 9:return e.abrupt("return",t);case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),n.restore=function(){var e=d(b.mark((function e(){var t=this;return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.restoreAddresses();case 2:return e.sent.forEach((function(e){return t.persistAddressToCache(e)})),e.abrupt("return",!0);case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),r}(X);z.INITIAL_BASE_PATH="m/84'/0'/0'",z.INITIAL_INDEX=0;var Y=function(e){function r(r){var n;if(r.type!==exports.IdentityType.Mnemonic)throw new Error("The identity arguments have not the Mnemonic type.");if(!("mnemonic"in r.value))throw new Error("The value of IdentityOpts is not valid for Mnemonic Identity.");if(a.setDefaultWordlist(r.value.language?r.value.language:"english"),!a.validateMnemonic(r.value.mnemonic))throw new Error("Mnemonic is not valid.");var s=a.mnemonicToSeedSync(r.value.mnemonic),u=i.fromSeed(s,t.networks[r.chain]),c=u.derivePath(z.INITIAL_BASE_PATH),p=E(t.bip32.fromPublicKey(c.publicKey,c.chainCode,c.network).toBase58(),r.chain),f=o.fromSeed(s),d=f.masterKey.toString("hex");return(n=e.call(this,l({},r,{type:exports.IdentityType.MasterPublicKey,value:{masterPublicKey:p,masterBlindingKey:d}}))||this).masterBlindingKey=d,n.masterBlindingKeyNode=f,n.masterPublicKey=p,n.masterPrivateKeyNode=u,n}h(r,e);var n=r.prototype;return n.blindPset=function(){var t=d(b.mark((function t(r,n,i,o){var a=this;return b.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.prototype.blindPsetWithBlindKeysGetter.call(this,(function(t){return e.prototype.getBlindingKeyPair.call(a,t,!0)}),r,n,i,o));case 1:case"end":return t.stop()}}),t,this)})));return function(e,r,n,i){return t.apply(this,arguments)}}(),n.isAbleToSign=function(){return!0},n.derivePath=function(e){var r=this.masterPrivateKeyNode.derivePath(e).toWIF(),n=t.ECPair.fromWIF(r,this.network);return{publicKey:n.publicKey,privateKey:n.privateKey}},n.signPset=function(){var e=d(b.mark((function e(r){var n,i,o,a,s,u,c;return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(n=t.Psbt.fromBase64(r),i=[],o=0;o<n.data.inputs.length;o++)(a=n.data.inputs[o]).witnessUtxo&&(s=this.scriptToAddressCache.get(a.witnessUtxo.script))&&(u=this.derivePath(s.address.derivationPath).privateKey,c=t.ECPair.fromPrivateKey(u),i.push(n.signInputAsync(o,c)));return e.next=5,Promise.all(i);case 5:return e.abrupt("return",n.toBase64());case 6:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),n.getAddresses=function(){return e.prototype.getAddresses.call(this)},r}(z),Z=function(e){function r(r){var n,i;if((n=e.call(this,r)||this).isRestored=new Promise((function(){return!0})),r.type!==exports.IdentityType.PrivateKey)throw new Error("The identity arguments have not the PrivateKey type.");if(!("signingKeyWIF"in(i=r.value))||!("blindingKeyWIF"in i))throw new Error("The value of IdentityOpts is not valid for PrivateKey Identity.");n.signingKeyPair=n.decodeFromWif(r.value.signingKeyWIF),n.blindingKeyPair=n.decodeFromWif(r.value.blindingKeyWIF);var o=t.payments.p2wpkh({pubkey:n.signingKeyPair.publicKey,blindkey:n.blindingKeyPair.publicKey,network:n.network});return n.confidentialAddress=o.confidentialAddress,n.blindingPrivateKey=n.blindingKeyPair.privateKey.toString("hex"),n.scriptPubKey=o.output,n}h(r,e);var n=r.prototype;return n.blindPset=function(){var t=d(b.mark((function t(r,n,i,o){var a=this;return b.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.prototype.blindPsetWithBlindKeysGetter.call(this,(function(e){return a.getBlindingKeyPair(e)}),r,n,i,o));case 1:case"end":return t.stop()}}),t,this)})));return function(e,r,n,i){return t.apply(this,arguments)}}(),n.getBlindingKeyPair=function(e){if(!e.equals(this.scriptPubKey))throw new Error(e+" is unknown by the PrivateKey Identity");return{publicKey:this.blindingKeyPair.publicKey,privateKey:this.blindingKeyPair.privateKey}},n.isAbleToSign=function(){return!0},n.decodeFromWif=function(e){return t.ECPair.fromWIF(e,this.network)},n.getAddress=function(){return{confidentialAddress:this.confidentialAddress,blindingPrivateKey:this.blindingPrivateKey,derivationPath:void 0}},n.getNextAddress=function(){return this.getAddress()},n.getNextChangeAddress=function(){return this.getAddress()},n.getBlindingPrivateKey=function(e){if(!Buffer.from(e,"hex").equals(this.scriptPubKey))throw new Error("The script is not PrivateKey.scriptPubKey.");return this.blindingPrivateKey},n.signPset=function(){var e=d(b.mark((function e(r){var n,i,o,a,s=this;return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(n=t.Psbt.fromBase64(r),i=[],o=0;o<n.data.inputs.length;o++)(a=n.data.inputs[o]).witnessUtxo?a.witnessUtxo.script.equals(this.scriptPubKey)&&i.push(o):i.push(o);return e.next=5,Promise.all(i.map((function(e){return n.signInputAsync(e,s.signingKeyPair)})));case 5:return e.abrupt("return",n.toBase64());case 6:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),n.getAddresses=function(){return[{confidentialAddress:this.confidentialAddress,blindingPrivateKey:this.blindingPrivateKey,derivationPath:void 0}]},r}(X),$=function(e,t){return e.value-t.value};function J(e,t,r){for(var n,i=[],o=0,a=y(e=e.sort(r));!(n=a()).done;){var s=n.value;if(N(s)||(i.push(s),o+=s.value),o>=t)return{selected:i,changeAmount:o-t}}throw new Error("not enough utxos in wallet to found: "+t)}function Q(e,t){return e.reduce((function(e,r){return(e[r[t]]=e[r[t]]||[]).push(r),e}),{})}function ee(e){return"surjectionProof"in e&&"rangeProof"in e}var te=Buffer.alloc(32).toString("hex");function re(e,t){return ne.apply(this,arguments)}function ne(){return(ne=d(b.mark((function e(t,n){return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.get(n+"/tx/"+t+"/hex");case 2:return e.abrupt("return",e.sent.data);case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ie(){return(ie=d(b.mark((function e(t,n){return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=se,e.next=3,r.get(n+"/tx/"+t);case 3:return e.t1=e.sent.data,e.t2=n,e.abrupt("return",(0,e.t0)(e.t1,e.t2));case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function oe(e,t){return ae.apply(this,arguments)}function ae(){return(ae=d(b.mark((function e(t,n){return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.get(n+"/address/"+t+"/utxo");case 2:return e.abrupt("return",e.sent.data);case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function se(e,t){return ue.apply(this,arguments)}function ue(){return(ue=d(b.mark((function e(r,n){var i,o,a,s,u,c,p,f,d;return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(i=[],o=[],a=y(r.vin);!(s=a()).done;)i.push((u=s.value).txid),o.push(u.vout);return e.next=5,Promise.all(i.map((function(e){return re(e,n)})));case 5:return c=e.sent.map((function(e,r){return ce(t.Transaction.fromHex(e).outs[o[r]])})),p=i.map((function(e,t){return{prevout:c[t],txid:e,vout:o[t]}})),e.next=10,re(r.txid,n);case 10:return f=t.Transaction.fromHex(e.sent),d=f.outs.map(ce),e.abrupt("return",{txid:r.txid,vin:p,vout:d,fee:r.fee,status:{confirmed:r.status.confirmed,blockHash:r.status.block_hash,blockHeight:r.status.block_height,blockTime:r.status.block_time}});case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ce(e){return K(e)?{blindedAsset:e.asset,blindedValue:e.value,nonce:e.nonce,rangeProof:e.rangeProof,surjectionProof:e.surjectionProof,script:e.script.toString("hex")}:{asset:m(e.asset),value:w(e.value),script:e.script.toString("hex"),assetBlinder:te,valueBlinder:te}}function pe(e,t,r){return e+"/tx/"+t+"#blinded="+r.map((function(e){return e.value+","+e.asset+","+e.valueBlinder+","+e.assetBlinder})).join(",")}function fe(e,t,r,n){return de.apply(this,arguments)}function de(){return(de=c(b.mark((function e(t,r,n,i){var o,a,s,u,c,f,d,l;return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=[],a=[],s=y(t);case 3:if((u=s()).done){e.next=32;break}return c=u.value,e.prev=5,f=he(c,n,i),e.next=9,p(f.next());case 9:d=e.sent;case 10:if(d.done){e.next=25;break}if(!o.includes((l=d.value).txid)){e.next=17;break}return e.next=15,p(f.next());case 15:return d=e.sent,e.abrupt("continue",10);case 17:return e.next=19,ye(l,r);case 19:return o.push(l.txid),e.next=22,p(f.next());case 22:d=e.sent,e.next=10;break;case 25:e.next=30;break;case 27:e.prev=27,e.t0=e.catch(5),a.push(e.t0);case 30:e.next=3;break;case 32:return e.abrupt("return",{txIDs:o,errors:a});case 33:case"end":return e.stop()}}),e,null,[[5,27]])})))).apply(this,arguments)}function le(){return(le=d(b.mark((function e(t,r,n,i){var o,a,s;return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=fe(t,r,n,i),a=[],e.next=4,o.next();case 4:s=e.sent;case 5:if(s.done){e.next=12;break}return a.push(s.value),e.next=9,o.next();case 9:s=e.sent,e.next=5;break;case 12:return e.abrupt("return",a);case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function he(e,t,r){return ve.apply(this,arguments)}function ve(){return(ve=c(b.mark((function e(t,r,n){var i,o,a,s,u,c,f,d;return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=void 0,o=[],a=0;case 3:return e.next=5,p(be(t,r,i));case 5:if(0!==(o=e.sent).length){e.next=8;break}return e.abrupt("break",24);case 8:i=o[o.length-1].txid,a+=o.length,s=o.map((function(e){return se(e,r)})),u=y(s);case 12:if((c=u()).done){e.next=23;break}return f=c.value,e.next=16,p(f);case 16:if(d=e.sent,!n||!n(d)){e.next=19;break}return e.abrupt("continue",21);case 19:return e.next=21,d;case 21:e.next=12;break;case 23:if(i){e.next=3;break}case 24:return e.abrupt("return",a);case 25:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ye(e,t){return xe.apply(this,arguments)}function xe(){return(xe=d(b.mark((function e(t,r){var n,i,o,a,s;return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(n=[],i=function(e){var i=t.vin[e].prevout;ee(i)&&n.push(function(){var n=d(b.mark((function n(){var o;return b.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!(o=r(i.script))){n.next=6;break}return n.next=4,j(i,o);case 4:t.vin[e].prevout=n.sent;case 6:case"end":return n.stop()}}),n)})));return function(){return n.apply(this,arguments)}}()())},o=0;o<t.vin.length;o++)i(o);for(a=function(e){var i=t.vout[e];ee(i)&&n.push(function(){var n=d(b.mark((function n(){var o;return b.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!(o=r(i.script))){n.next=6;break}return n.next=4,j(i,o);case 4:t.vout[e]=n.sent;case 6:case"end":return n.stop()}}),n)})));return function(){return n.apply(this,arguments)}}()())},s=0;s<t.vout.length;s++)a(s);return e.next=7,Promise.all(n);case 7:return e.abrupt("return",t);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function be(e,t,r){return ge.apply(this,arguments)}function ge(){return(ge=d(b.mark((function e(t,n,i){var o;return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=n+"/address/"+t+"/txs/chain",i&&(o+="/"+i),e.next=4,r.get(o);case 4:return e.abrupt("return",e.sent.data);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function me(){return(me=d(b.mark((function e(t,r,n){return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ke([{confidentialAddress:t,blindingPrivateKey:r}],n);case 2:return e.abrupt("return",e.sent.reduce((function(e,t){var r=t.asset;return e[r]=e[r]||0,e[r]+=t.value,e}),{}));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function we(e,t,r){return Pe.apply(this,arguments)}function Pe(){return(Pe=c(b.mark((function e(t,r,n){var i,o,a,s,u;return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=0,o=[],a=b.mark((function e(){var t,a,s,c,f,d,l,h;return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=(t=u.value).confidentialAddress,s=t.blindingPrivateKey,e.prev=1,e.next=4,p(oe(a,r));case 4:c=e.sent.map((function(e){return n&&n(e)?e:Te(e,s,r)})),f=y(c);case 7:if((d=f()).done){e.next=17;break}return l=d.value,e.next=11,p(l);case 11:return h=e.sent,e.next=14,h;case 14:i++;case 15:e.next=7;break;case 17:e.next=22;break;case 19:e.prev=19,e.t0=e.catch(1),o.push(e.t0);case 22:case"end":return e.stop()}}),e,null,[[1,19]])})),s=y(t);case 4:if((u=s()).done){e.next=8;break}return e.delegateYield(a(),"t0",6);case 6:e.next=4;break;case 8:return e.abrupt("return",{numberOfUtxos:i,errors:o});case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ke(e,t,r){return Ke.apply(this,arguments)}function Ke(){return(Ke=d(b.mark((function e(t,r,n){var i,o,a;return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=we(t,r,n),o=[],e.next=4,i.next();case 4:a=e.sent;case 5:if(a.done){e.next=12;break}return o.push(a.value),e.next=9,i.next();case 9:a=e.sent,e.next=5;break;case 12:return e.abrupt("return",o);case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ae(e,t){return Be.apply(this,arguments)}function Be(){return(Be=d(b.mark((function e(r,n){var i;return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,re(r.txid,n);case 2:return i=t.Transaction.fromHex(e.sent).outs[r.vout],e.abrupt("return",l({},r,{prevout:i}));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Te(e,t,r){return Ie.apply(this,arguments)}function Ie(){return(Ie=d(b.mark((function e(t,r,n){return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.prevout){e.next=4;break}return e.next=3,Ae(t,n);case 3:t=e.sent;case 4:return e.prev=4,e.abrupt("return",Ee(t,r));case 8:return e.prev=8,e.t0=e.catch(4),e.abrupt("return",t);case 11:case"end":return e.stop()}}),e,null,[[4,8]])})))).apply(this,arguments)}function Ee(e,t){return Se.apply(this,arguments)}function Se(){return(Se=d(b.mark((function e(r,n){var i,o;return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r.prevout){e.next=2;break}throw new Error("utxo need utxo.prevout to be defined. Use utxoWithPrevout.");case 2:if(K(r.prevout)){e.next=4;break}return e.abrupt("return",r);case 4:return e.next=6,t.confidential.unblindOutputWithKey(r.prevout,Buffer.from(n,"hex"));case 6:return i=e.sent,o=Buffer.alloc(32),i.asset.copy(o),e.abrupt("return",l({},r,{asset:o.reverse().toString("hex"),value:parseInt(i.value,10),unblindData:i}));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Oe=function(){function e(e,t){this.network=t,this.cache=e}var r=e.prototype;return r.createTx=function(){return new t.Psbt({network:this.network}).toBase64()},r.buildTx=function(e,t,r,n,i,o){return W({psetBase64:e,recipients:t,coinSelector:r,changeAddressByAsset:n,addFee:i,satsPerByte:o,unspents:this.cache.getAll()})},e}();function Le(){return(Le=d(b.mark((function e(t,r,n){return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ke(t,r);case 2:return e.abrupt("return",Ue(e.sent,n));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ue(e,t){return new Oe(new _e(e),M(t))}var _e=function(){function e(e){this.utxoMap=new Map,e&&this.push(e)}var t=e.prototype;return t.push=function(e){for(var t,r=y(e);!(t=r()).done;){var n=t.value;this.utxoMap.set(_(n),n)}},t.delete=function(e){return this.utxoMap.delete(e)},t.getAll=function(){return Array.from(this.utxoMap.values())},e}();Object.defineProperty(exports,"ECPair",{enumerable:!0,get:function(){return t.ECPair}}),Object.defineProperty(exports,"address",{enumerable:!0,get:function(){return t.address}}),Object.defineProperty(exports,"networks",{enumerable:!0,get:function(){return t.networks}}),Object.defineProperty(exports,"payments",{enumerable:!0,get:function(){return t.payments}}),exports.BufferMap=B,exports.EsploraIdentityRestorer=g,exports.MasterPublicKey=z,exports.Mnemonic=Y,exports.PrivateKey=Z,exports.UtxoCache=_e,exports.Wallet=Oe,exports.addToTx=H,exports.buildTx=W,exports.createFeeOutput=C,exports.decodePset=R,exports.esploraTxToTxInterface=se,exports.estimateTxSize=D,exports.fetchAndUnblindTxs=function(e,t,r,n){return le.apply(this,arguments)},exports.fetchAndUnblindTxsGenerator=fe,exports.fetchAndUnblindUtxos=ke,exports.fetchAndUnblindUtxosGenerator=we,exports.fetchBalances=function(e,t,r){return me.apply(this,arguments)},exports.fetchPrevoutAndTryToUnblindUtxo=Te,exports.fetchTx=function(e,t){return ie.apply(this,arguments)},exports.fetchTxHex=re,exports.fetchUtxos=oe,exports.fromAssetHash=function(e){return Buffer.concat([Buffer.from("01","hex"),Buffer.from(e,"hex").reverse()])},exports.fromXpub=E,exports.getNetwork=M,exports.getUnblindURLFromTx=function(e,t){for(var r,n=[],i=function(e){return Buffer.from(e,"hex").reverse().toString("hex")},o=y(e.vout);!(r=o()).done;){var a=r.value;!ee(a)&&a.script.length>0&&n.push(l({},a,{assetBlinder:i(a.assetBlinder),valueBlinder:i(a.valueBlinder)}))}return pe(t,e.txid,n)},exports.greedyCoinSelector=function(e){return void 0===e&&(e=$),function(t,r,n){return function(e,t,r,n){for(var i={selectedUtxos:[],changeOutputs:[]},o=Q(e=e.filter((function(e){return!N(e)})),"asset"),a=Q(t,"asset"),s=0,u=Object.entries(a);s<u.length;s++){var c,p=u[s],f=p[0],d=p[1],l=o[f];if(!l)throw new Error("need unspents for the asset: "+f);var h=J(l,d.reduce((function(e,t){return e+t.value}),0),n),v=h.changeAmount;if((c=i.selectedUtxos).push.apply(c,h.selected),v>0){var y=r(f);if(!y)throw new Error("need change address for asset: "+f);i.changeOutputs.push({asset:f,value:v,address:y})}}return i}(t,r,n,e)}},exports.isBlindedOutputInterface=ee,exports.isBlindedUtxo=N,exports.isConfidentialOutput=K,exports.isValidAmount=function(e){return!(e<=0||!Number.isSafeInteger(e))},exports.isValidExtendedBlindKey=L,exports.isValidXpub=O,exports.makeUnblindURL=pe,exports.psetToUnsignedHex=U,exports.psetToUnsignedTx=function(e){return t.Transaction.fromHex(U(e))},exports.toAssetHash=m,exports.toNumber=w,exports.toOutpoint=_,exports.toXpub=S,exports.unblindOutput=j,exports.unblindTransaction=ye,exports.unblindUtxo=Ee,exports.utxoWithPrevout=Ae,exports.walletFromAddresses=function(e,t,r){return Le.apply(this,arguments)},exports.walletFromCoins=Ue;
//# sourceMappingURL=ldk.cjs.production.min.js.map
{
"version": "0.2.12",
"version": "0.2.13",
"license": "MIT",

@@ -4,0 +4,0 @@ "main": "dist/index.js",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc