From e8d477f7f7ceedf807667cb4278b0de8e7bcbbff Mon Sep 17 00:00:00 2001 From: Romeo Rosete <110788242+bombastictranz@users.noreply.github.com> Date: Sat, 13 Apr 2024 08:32:19 -0400 Subject: [PATCH] index.e27c1c3f.js.download Stock control supervisors --- index.e27c1c3f.js.download | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 index.e27c1c3f.js.download diff --git a/index.e27c1c3f.js.download b/index.e27c1c3f.js.download new file mode 100644 index 0000000..a1a7c35 --- /dev/null +++ b/index.e27c1c3f.js.download @@ -0,0 +1,2 @@ +"use strict";(self.webpackChunkdefi_mode=self.webpackChunkdefi_mode||[]).push([[7549],{32516:(e,t,n)=>{n.d(t,{Z:()=>s});var r={"@imtbl/imx-sdk":()=>Promise.all([n.e(5120),n.e(2682),n.e(2857),n.e(5128),n.e(5711),n.e(1286),n.e(5183),n.e(1019)]).then(n.bind(n,5183)),"@scure/btc-signer":()=>Promise.all([n.e(6262),n.e(2464),n.e(1386)]).then(n.bind(n,51386)),"@scure/base":()=>n.e(5117).then(n.bind(n,55117)),"@solana/web3.js":()=>Promise.all([n.e(6262),n.e(2464),n.e(5120),n.e(6503),n.e(1347),n.e(1215),n.e(9182),n.e(6601)]).then(n.bind(n,49182)),"@solana/spl-token":()=>Promise.all([n.e(6262),n.e(2464),n.e(5120),n.e(6503),n.e(1347),n.e(1215),n.e(9182),n.e(5128),n.e(3158),n.e(5373)]).then(n.bind(n,3158)),"@metaplex-foundation/mpl-token-metadata":()=>Promise.all([n.e(6262),n.e(2464),n.e(5120),n.e(6503),n.e(1347),n.e(1215),n.e(9182),n.e(2857),n.e(5275),n.e(3492)]).then(n.t.bind(n,75275,23)),"@mysten/sui.js":()=>Promise.all([n.e(6262),n.e(2464),n.e(5974),n.e(6503),n.e(4967),n.e(5315),n.e(9482),n.e(7451)]).then(n.bind(n,59482)),"@metaplex-foundation/js":()=>Promise.all([n.e(6262),n.e(2464),n.e(5120),n.e(6503),n.e(1347),n.e(1215),n.e(9182),n.e(2857),n.e(5128),n.e(5275),n.e(1286),n.e(2413),n.e(1656)]).then(n.bind(n,92413))};function s(e){var t=r[e];if(!t)throw new Error("moduleName-error");return t()}},27549:(e,t,n)=>{n.r(t),n.d(t,{default:()=>F});var r=n(1413),s=n(37762),a=n(29439),u=n(74165),c=n(15861),i=n(93380),o=n(14300),p=n(35686),l=n(15702),d=(n(8911),n(92643),n(1708)),x=n(64037),f=n(82148),b=n(40910),v=n(97282),g=n(45271),m=n(65326),y=n(32516),h=n(75219),w=n(48779),k="P2PKH",Z="P2SH",_="P2WPKH",P="TR",T="616e27323840ee0c2ae434d998267f81170988ba9477f78dcd00fc247a27db40",O="bc1pcyj5mt2q4t4py8jnur8vpxvxxchke4pzy7tdr9yvj3u3kdfgrj6sw3rzmr",A="0000000000000000000000000000000000000000000000000000000000000000",I=600,B=546,W={isAddress:function(){var e=(0,c.Z)((0,u.Z)().mark((function e(t){var n;return(0,u.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,d.Z.setChainType({chainId:x.Bv.BTC});case 3:return e.next=5,d.Z.isBtcAddress(t);case 5:return n=e.sent,e.abrupt("return",n);case 9:return e.prev=9,e.t0=e.catch(0),console.error(e.t0),e.abrupt("return",!1);case 13:case"end":return e.stop()}}),e,null,[[0,9]])})));return function(t){return e.apply(this,arguments)}}(),checkInitWallet:function(){var e=(0,c.Z)((0,u.Z)().mark((function e(t){var n,r,s,a,c,i,o,p,l;return(0,u.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,W.getWalletType();case 2:return r=e.sent,s=r.isXverse,e.next=6,d.Z.getWalletAccount();case 6:return a=e.sent,e.next=9,d.Z.getWalletAdapter();case 9:if(c=e.sent,!s){e.next=16;break}return e.next=13,c.getPaymentAccount();case 13:e.t0=e.sent,e.next=17;break;case 16:e.t0=a;case 17:return i=e.t0,e.next=20,v.Z.getUtxos({coinId:1,utxoRequests:[{utxoType:13,address:i,batchDummyNum:t}]});case 20:return o=e.sent,p=o.data,l=(null===(n=(void 0===p?[]:p)[0])||void 0===n?void 0:n.utxoList)||[],e.abrupt("return",l.filter((e=>e.dummy)));case 25:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),splitUtxoUnisatOrXverse:function(){var e=(0,c.Z)((0,u.Z)().mark((function e(t){var n,r,s,p,l,x,f,b,g,m,w,k,Z,_,P,T,O,A,B,F,S,U,K,N,H,L,E,X,C,R,j,V,z,q,D;return(0,u.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.from,s=t.needSplitDummyAmount,e.next=3,(0,y.Z)("@scure/btc-signer");case 3:return p=e.sent,e.next=6,(0,y.Z)("@scure/base");case 6:return l=e.sent,x=l.hex,f=l.base64,b=r,e.next=12,W.getWalletType();case 12:return g=e.sent,m=g.isXverse,w=g.isUnisat,e.next=17,d.Z.getWalletAdapter();case 17:return k=e.sent,e.next=20,null===k||void 0===k?void 0:k.getPublicKey();case 20:if(Z=e.sent,!m){e.next=27;break}return e.next=24,k.getPaymentPublicKey();case 24:e.t0=e.sent,e.next=28;break;case 27:e.t0=Z;case 28:return _=e.t0,P={coinId:1,utxoRequests:[{utxoType:6,address:b,coinAmount:s*I,serviceCharge:0}]},e.next=32,v.Z.getUtxos(P);case 32:return T=e.sent,O=T.data,A=((null===(n=(void 0===O?[]:O)[0])||void 0===n?void 0:n.utxoList)||[]).filter((e=>!e.dummy)).map((e=>({txid:e.txHash,vout:e.vout,value:e.coinAmount,rawTransaction:e.rawTransaction}))),B=new p.Transaction,e.next=39,W.getPayment({address:b,publicKey:m?_:Z});case 39:return F=e.sent,S=0,A.forEach(function(){var e=(0,c.Z)((0,u.Z)().mark((function e(t){return(0,u.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=B,e.next=3,W.getInput(F,t);case 3:e.t1=e.sent,e.t0.addInput.call(e.t0,e.t1),S+=null===t||void 0===t?void 0:t.value;case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),e.next=44,(0,h.Z)(v.Z.getBTCNetworkFee({coinId:1,address:b}));case 44:for(U=e.sent,K=(0,a.Z)(U,2),N=K[1],H=N.info,L=H.max,E=0;Et)),sigHash:p.SignatureHash.ALL}]});case 66:for(j=e.sent,z=w?p.Transaction.fromPSBT(x.decode(V)).extract():"",q=[],D=0;D=B&&O.addOutputAddress(w,BigInt(D)),e.next=100,m.sendPsbt({psbtBase64:x.encode(O.toPSBT()),inputsToSign:[{address:g,signingIndexes:[0],sigHash:p.SignatureHash.ALL},{address:w,signingIndexes:null===O||void 0===O?void 0:O.inputs.map(((e,t)=>t)).slice(1),sigHash:p.SignatureHash.ALL}]});case 100:return Y=e.sent,e.abrupt("return",{txhash:Y});case 102:case"end":return e.stop()}}),e,null,[[73,86,89,92]])})));return function(t){return e.apply(this,arguments)}}(),checkDustBatchTrade:function(){var e=(0,c.Z)((0,u.Z)().mark((function e(t){var n,r,s;return(0,u.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v.Z.checkBtcDust(t);case 2:if(n=e.sent,r=n.data,s=(void 0===r?{}:r).dustInscriptionIds,!((void 0===s?[]:s).length>0)){e.next=10;break}return e.next=9,W.dustTradeInfo();case 9:throw new Error((0,o.O4)("btcnft_subtitle_dialog_subtitle_low_utxo"));case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),batchTransfer:function(){var e=(0,c.Z)((0,u.Z)().mark((function e(t){var n,r,c,p,l,x,f,b,g,m,w,k,Z,_,P,T,O,A,I,B,F,S,U,K,N,H,L,E,X,C,R,j,V,z,q,D,Y,G,M,J,Q,$;return(0,u.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.nftList,r=t.toAddress,e.next=3,(0,y.Z)("@scure/btc-signer");case 3:return c=e.sent,e.next=6,(0,y.Z)("@scure/base");case 6:return p=e.sent,l=p.base64,x=p.hex,e.next=11,W.getWalletType();case 11:return f=e.sent,b=f.isXverse,g=f.isUnisat,e.next=16,d.Z.getWalletAccount();case 16:return m=e.sent,e.next=19,d.Z.getWalletAdapter();case 19:if(w=e.sent,!b){e.next=26;break}return e.next=23,w.getPaymentAccount();case 23:e.t0=e.sent,e.next=27;break;case 26:e.t0=m;case 27:return k=e.t0,e.next=30,w.getPublicKey();case 30:if(Z=e.sent,!b){e.next=37;break}return e.next=34,w.getPaymentPublicKey();case 34:e.t1=e.sent,e.next=38;break;case 37:e.t1=Z;case 38:return _=e.t1,e.next=41,W.getPayment({address:m,publicKey:Z});case 41:P=e.sent,T=new c.Transaction,O=[],A=(0,s.Z)(n),e.prev=45,A.s();case 47:if((I=A.n()).done){e.next=62;break}return B=I.value,F=B.tokenId,S=B.ticker,e.next=52,W.getOrdinalsNFTUtxo({tokenId:F,tick:S,ownerAddress:m});case 52:return U=e.sent,O.push(U),e.t2=T,e.next=57,W.getInput(P,U);case 57:e.t3=e.sent,e.t2.addInput.call(e.t2,e.t3),T.addOutputAddress(r,BigInt(null===U||void 0===U?void 0:U.value));case 60:e.next=47;break;case 62:e.next=67;break;case 64:e.prev=64,e.t4=e.catch(45),A.e(e.t4);case 67:return e.prev=67,A.f(),e.finish(67);case 70:return e.next=72,W.getPayment({address:k,publicKey:_});case 72:return K=e.sent,e.next=75,(0,h.Z)(v.Z.getBTCNetworkFee({coinId:1,address:k}));case 75:return N=e.sent,H=(0,a.Z)(N,2),L=H[1],E=L.info,X=E.max,e.next=82,W.getNetworkFee({psbt:T,networkFeeRate:X});case 82:return C=e.sent,R=C.networkFee,e.next=86,W.getPaymentUtxos({walletAddress:k,price:Number(R),needFilteredUtxo:O.map((e=>e.txid))||[]});case 86:if(!((j=e.sent).length<=0)){e.next=89;break}throw new Error((0,o.O4)("btcnft_transact_err_msg_utxo_insuff_balance"));case 89:V=0,z=(0,s.Z)(j),e.prev=91,z.s();case 93:if((q=z.n()).done){e.next=102;break}return D=q.value,V=i.yx.add(V,null===D||void 0===D?void 0:D.value),e.next=98,W.getInput(K,D);case 98:Y=e.sent,T.addInput(Y);case 100:e.next=93;break;case 102:e.next=107;break;case 104:e.prev=104,e.t5=e.catch(91),z.e(e.t5);case 107:return e.prev=107,z.f(),e.finish(107);case 110:return e.next=112,W.getNetworkFee({psbt:T,networkFeeRate:X});case 112:if(G=e.sent,M=G.networkFee,J=i.yx.sub(V,M),T.addOutputAddress(k,BigInt(J)),!g){e.next=120;break}return e.next=119,w.signPsbt({psbtHex:x.encode(T.toPSBT())});case 119:Q=e.sent;case 120:return e.next=122,w.sendPsbt({psbtHex:Q,psbtBase64:l.encode(T.toPSBT()),inputsToSign:[{address:m,signingIndexes:O.map(((e,t)=>t)),sigHash:c.SignatureHash.ALL},{address:k,signingIndexes:null===T||void 0===T?void 0:T.inputs.map(((e,t)=>t)).slice(O.length),sigHash:c.SignatureHash.ALL}]});case 122:return $=e.sent,e.abrupt("return",{txhash:$});case 125:case"end":return e.stop()}}),e,null,[[45,64,67,70],[91,104,107,110]])})));return function(t){return e.apply(this,arguments)}}(),getSellerPsbt:function(){var e=(0,c.Z)((0,u.Z)().mark((function e(t){var n,s,a,c,i,p,l,d,x,f,b,v,g;return(0,u.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.sellerPublicKey,s=t.sellerAddress,a=t.sellerPaymentAddress,c=t.ordinalsNFTUtxo,i=t.nftPrice,e.next=3,(0,y.Z)("@scure/btc-signer");case 3:return p=e.sent,e.next=6,(0,y.Z)("@scure/base");case 6:return l=e.sent,d=l.hex,x=new p.Transaction,e.next=11,W.getWalletType();case 11:return f=e.sent,b=f.isXverse,e.next=15,W.getPayment({address:s,publicKey:n});case 15:return v=e.sent,x.addInput({txid:A,index:0,witnessUtxo:{amount:BigInt(0),script:p.p2tr(d.decode(T)).script},tapInternalKey:d.decode(T)}),x.addInput({txid:A,index:1,witnessUtxo:{amount:BigInt(0),script:p.p2tr(d.decode(T)).script},tapInternalKey:d.decode(T)}),e.next=20,W.getInput(v,c);case 20:if((g=e.sent).txid){e.next=23;break}throw new Error((0,o.O4)("brc20_reminder_dialog_invalid_status"));case 23:if(x.addInput((0,r.Z)((0,r.Z)({},g),{},{sighashType:p.SignatureHash.SINGLE|p.SignatureHash.ANYONECANPAY})),x.addOutputAddress(O,BigInt(0)),x.addOutputAddress(O,BigInt(0)),!isNaN(i)){e.next=28;break}throw new Error("price error");case 28:return x.addOutputAddress(b?a:s,BigInt(i)),e.abrupt("return",x);case 30:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),getBuyerPsbt:function(){var e=(0,c.Z)((0,u.Z)().mark((function e(t){var n,r,s,a,p,l,x,f,b,v,g,m,h,w,k,Z,_,P,T,O,A,F,S,U,K,N,H,L;return(0,u.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=t.sellerPsbtBase64,a=t.fromPublicKey,p=t.buyerPublicKey,l=t.dummyUtxos,x=t.paymentUtxos,f=t.ordinalsNFTUtxo,b=t.nftPrice,v=t.networkFeeRate,e.next=3,(0,y.Z)("@scure/btc-signer");case 3:return g=e.sent,e.next=6,(0,y.Z)("@scure/base");case 6:return m=e.sent,h=m.base64,e.next=10,d.Z.getWalletAdapter();case 10:return w=e.sent,e.next=13,d.Z.getWalletAccount();case 13:return k=e.sent,e.next=16,W.getWalletType();case 16:if(Z=e.sent,!Z.isXverse){e.next=24;break}return e.next=21,w.getPaymentAccount();case 21:e.t0=e.sent,e.next=25;break;case 24:e.t0=k;case 25:return _=e.t0,P=g.Transaction.fromPSBT(h.decode(s)),e.next=29,W.getPayment({address:_,publicKey:p});case 29:return T=e.sent,e.next=32,W.getPayment({address:k,publicKey:a});case 32:return O=e.sent,A=x.reduce(((e,t)=>e+(null===t||void 0===t?void 0:t.value)),0),e.next=36,Promise.all(l.utxos.map(function(){var e=(0,c.Z)((0,u.Z)().mark((function e(t,n){var r;return(0,u.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,W.getInput(T,t);case 2:r=e.sent,P.inputs[n]=P.normalizeInput(r);case 4:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),!0));case 36:return e.next=38,Promise.all(x.map(function(){var e=(0,c.Z)((0,u.Z)().mark((function e(t){var n;return(0,u.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,W.getInput(T,t);case 2:n=e.sent,P.addInput(n,!0);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 38:return F=(null===f||void 0===f?void 0:f.value)=B&&P.addOutput(W.getOutput(T,L),!0),e.abrupt("return",{psbt:P,networkFee:H});case 56:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),buyerSigners:function(){var e=(0,c.Z)((0,u.Z)().mark((function e(t){var n,r,s,a,c,i,o,p,l,x,f,b,v;return(0,u.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,y.Z)("@scure/base");case 2:return n=e.sent,r=n.hex,s=n.base64,e.next=7,W.getBuyerPsbt(t);case 7:return a=e.sent,c=a.psbt,i=a.networkFee,o=c.toPSBT(),e.next=13,W.getWalletType();case 13:return p=e.sent,l=p.isXverse,e.next=17,d.Z.getWalletAccount();case 17:return x=e.sent,e.next=20,d.Z.getWalletAdapter();case 20:return f=e.sent,b={},b=l?{psbtBase64:s.encode(o),inputsToSign:[{address:t.paymentAddress,signingIndexes:null===c||void 0===c?void 0:c.inputs.map(((e,t)=>t)).filter(((e,t)=>2!==t))}]}:{type:"trade",psbtHex:r.encode(o),account:x,options:{autoFinalized:!1}},e.next=25,f.signPsbt(b);case 25:return v=e.sent,e.abrupt("return",{buyerPsbtBase64:l?v:s.encode(r.decode(v)),gas:i});case 27:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),getBatchBuyerPsbt:function(){var e=(0,c.Z)((0,u.Z)().mark((function e(t){var n,r,s,p,l,x,f,b,g,m,w,k,Z,_,P,T,O,A,F,S,U,K,N,H,L,E,X,C,R,j;return(0,u.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.nftUtxos,r=t.fromPublicKey,s=t.buyerPublicKey,p=t.dummyUtxos,l=t.paymentUtxos,x=t.totalPrice,f=t.networkFeeRate,e.next=3,(0,y.Z)("@scure/btc-signer");case 3:return b=e.sent,e.next=6,(0,y.Z)("@scure/base");case 6:return g=e.sent,m=g.base64,e.next=10,d.Z.getWalletAdapter();case 10:return w=e.sent,e.next=13,d.Z.getWalletAccount();case 13:return k=e.sent,e.next=16,W.getWalletType();case 16:if(Z=e.sent,!Z.isXverse){e.next=24;break}return e.next=21,w.getPaymentAccount();case 21:e.t0=e.sent,e.next=25;break;case 24:e.t0=k;case 25:return _=e.t0,P=new b.Transaction,e.next=29,W.getPayment({address:_,publicKey:s});case 29:return T=e.sent,e.next=32,W.getPayment({address:k,publicKey:r});case 32:return O=e.sent,A=l.reduce(((e,t)=>e+t.value),0),e.next=36,Promise.all(p.utxos.map(function(){var e=(0,c.Z)((0,u.Z)().mark((function e(t){var n;return(0,u.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,W.getInput(T,t);case 2:n=e.sent,P.addInput(n,!0);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),!0));case 36:return e.next=38,Promise.all(n.map(function(){var e=(0,c.Z)((0,u.Z)().mark((function e(t){var n;return(0,u.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=b.Transaction.fromPSBT(m.decode(null===t||void 0===t?void 0:t.sellerPsbt)),P.addInput(n.inputs[2],!0);case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),!0));case 38:return e.next=40,Promise.all(l.map(function(){var e=(0,c.Z)((0,u.Z)().mark((function e(t){var n;return(0,u.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,W.getInput(T,t);case 2:n=e.sent,P.addInput(n,!0);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 40:return F=0,p.utxos.forEach((e=>{F+=e.value})),S=W.getOutput(T,F),P.addOutput(S,!0),e.next=46,Promise.all(n.map(function(){var e=(0,c.Z)((0,u.Z)().mark((function e(t){var n,r;return(0,u.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=W.getOutput(O,null===t||void 0===t||null===(n=t.utxo)||void 0===n?void 0:n.value),P.addOutput(r,!0);case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),!0));case 46:return e.next=48,Promise.all(n.map(function(){var e=(0,c.Z)((0,u.Z)().mark((function e(t){var n;return(0,u.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=b.Transaction.fromPSBT(m.decode(null===t||void 0===t?void 0:t.sellerPsbt)),P.addOutput(n.outputs[2],!0);case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),!0));case 48:for(U=0;U=B&&P.addOutput(W.getOutput(T,j),!0),e.abrupt("return",{psbt:P,networkFee:R});case 67:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),batchBuyerSigners:function(){var e=(0,c.Z)((0,u.Z)().mark((function e(t){var n,r,s,a,c,i,o,p,l,x,f,b,v,g;return(0,u.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,y.Z)("@scure/base");case 2:return n=e.sent,r=n.hex,s=n.base64,e.next=7,W.getBatchBuyerPsbt(t);case 7:return a=e.sent,c=a.psbt,i=a.networkFee,o=c.toPSBT(),e.next=13,W.getWalletType();case 13:return p=e.sent,l=p.isXverse,e.next=17,d.Z.getWalletAccount();case 17:return x=e.sent,e.next=20,d.Z.getWalletAdapter();case 20:return f=e.sent,b={},b=l?{psbtBase64:s.encode(o),inputsToSign:[{address:t.paymentAddress,signingIndexes:null===c||void 0===c?void 0:c.inputs.map(((e,t)=>t)).filter(((e,n)=>n<=t.orderList.length||n>=t.dummyUtxos.utxos.length+t.orderList.length))}]}:{amount:null===t||void 0===t||null===(v=t.nftUtxos)||void 0===v?void 0:v.length,type:"trade",psbtHex:r.encode(o),account:x,options:{autoFinalized:!1}},e.next=25,f.signPsbt(b);case 25:return g=e.sent,e.abrupt("return",{buyerPsbtBase64:l?g:s.encode(r.decode(g)),gas:i});case 27:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),getPaymentUtxos:function(){var e=(0,c.Z)((0,u.Z)().mark((function e(t){var n,s,a,c,i,p,l,d,x,f,b,g;return(0,u.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.walletAddress,s=t.price,a=t.serviceFee,c=void 0===a?0:a,i=t.needFilteredUtxo,p={coinId:1,utxoRequests:[{utxoType:6,address:n,coinAmount:s+5e4,serviceCharge:c,needFilteredUtxo:i}]},e.prev=2,e.next=5,v.Z.getUtxos(p);case 5:return d=e.sent,x=d.data,f=(null===(l=(void 0===x?[]:x)[0])||void 0===l?void 0:l.utxoList)||[],b=f.map((e=>{if(!e.dummy)return{txid:e.txHash,vout:e.vout,value:e.coinAmount,rawTransaction:e.rawTransaction}})).filter(Boolean),e.abrupt("return",b);case 13:if(e.prev=13,e.t0=e.catch(2),g=e.t0.code,![10004,100041].includes(g)){e.next=18;break}throw new Error((0,o.O4)("btcnft_transact_err_msg_utxo_insuff_balance"));case 18:throw(0,r.Z)((0,r.Z)({},e.t0),{},{toastType:w.pD.FALLBACK});case 19:case"end":return e.stop()}}),e,null,[[2,13]])})));return function(t){return e.apply(this,arguments)}}(),getOrdinalsNFTUtxo:function(){var e=(0,c.Z)((0,u.Z)().mark((function e(t){var n,r,s,a,c,i,o,p,l;return(0,u.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.tokenId,s=t.tick,a=t.ownerAddress,c={coinId:1,utxoRequests:[{utxoType:2,address:a,nftId:r,tick:s}]},e.next=4,v.Z.getUtxos(c);case 4:return i=e.sent,o=i.data,(p=(null===(n=(void 0===o?[]:o)[0])||void 0===n?void 0:n.utxoList)||[]).length||(0,g.H)(f.I.utxoEmpty,c),l=p.map((e=>({txid:e.txHash,vout:e.vout,value:e.coinAmount,rawTransaction:e.rawTransaction}))),e.abrupt("return",l[0]);case 11:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),getNetworkFee:function(){var e=(0,c.Z)((0,u.Z)().mark((function e(t){var n,r,s;return(0,u.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.psbt,r=t.networkFeeRate,e.next=3,W.getSize();case 3:return s=e.sent,e.abrupt("return",{networkFee:i.yx.mul(s*n.inputs.length+34*n.outputs.length+10,r)});case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),getSize:function(){var e=(0,c.Z)((0,u.Z)().mark((function e(){var t;return(0,u.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,d.Z.getWalletAccount();case 2:if("1"!=(t=e.sent).substring(0,1)){e.next=5;break}return e.abrupt("return",148);case 5:if("3"!=t.substring(0,1)){e.next=7;break}return e.abrupt("return",91);case 7:if("bc1q"!=t.substring(0,4)){e.next=9;break}return e.abrupt("return",68);case 9:if("bc1p"!=t.substring(0,4)){e.next=11;break}return e.abrupt("return",68);case 11:return e.abrupt("return",148);case 12:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),getPayment:function(){var e=(0,c.Z)((0,u.Z)().mark((function e(t){var n,r,s,a,c,i,o,p;return(0,u.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.address,r=t.publicKey,e.next=3,(0,y.Z)("@scure/btc-signer");case 3:return s=e.sent,e.next=6,(0,y.Z)("@scure/base");case 6:return a=e.sent,c=a.hex,e.next=10,W.getWalletType();case 10:if(i=e.sent,o=i.isUnisat,p=o&&"bc1p"==n.substring(0,4)?c.decode(r.slice(2)):c.decode(r),"1"!=n.substring(0,1)){e.next=15;break}return e.abrupt("return",{script:s.p2pkh(p).script,type:k,publicKeyBytes:p});case 15:if("3"!=n.substring(0,1)){e.next=17;break}return e.abrupt("return",{script:s.p2sh(s.p2wpkh(p)).script,redeemScript:s.p2sh(s.p2wpkh(p)).redeemScript,type:Z,publicKeyBytes:p});case 17:if("bc1q"!=n.substring(0,4)){e.next=20;break}return(0,g.PN)("publicKey",{publicKey:r}),e.abrupt("return",{script:s.p2wpkh(p).script,type:_,publicKeyBytes:p});case 20:if("bc1p"!=n.substring(0,4)){e.next=22;break}return e.abrupt("return",{script:s.p2tr(p).script,type:P,publicKeyBytes:p});case 22:return e.abrupt("return",null);case 23:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),getInput:function(){var e=(0,c.Z)((0,u.Z)().mark((function e(t){var n,r,s,a,c,i=arguments;return(0,u.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.length>1&&void 0!==i[1]?i[1]:{},e.next=3,(0,y.Z)("@scure/btc-signer");case 3:return r=e.sent,e.next=6,(0,y.Z)("@scure/base");case 6:return s=e.sent,a=s.hex,c={txid:null===n||void 0===n?void 0:n.txid,index:null===n||void 0===n?void 0:n.vout,sighashType:r.SignatureHash.ALL},t.type===k?Object.assign(c,{nonWitnessUtxo:null===n||void 0===n?void 0:n.rawTransaction,witnessUtxo:void 0}):Object.assign(c,{witnessUtxo:{amount:BigInt((null===n||void 0===n?void 0:n.value)||0),script:t.script}}),t.type===Z&&Object.assign(c,{redeemScript:a.encode(t.redeemScript)}),t.type===P&&Object.assign(c,{tapInternalKey:t.publicKeyBytes}),e.abrupt("return",c);case 13:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),getOutput:(e,t)=>{var n={amount:BigInt(t),script:e.script};return e.type===P&&Object.assign(n,{tapInternalKey:e.publicKeyBytes}),n},sellerSigners:function(){var e=(0,c.Z)((0,u.Z)().mark((function e(t){var n,r,s,a,c,i,o,p,l,x,f,b,v,g,m,h,w,k;return(0,u.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.nftPrice,r=t.utxoInfo,e.next=3,(0,y.Z)("@scure/btc-signer");case 3:return s=e.sent,e.next=6,(0,y.Z)("@scure/base");case 6:return a=e.sent,c=a.hex,i=a.base64,e.next=11,d.Z.getWalletAccount();case 11:return o=e.sent,e.next=14,d.Z.getWalletAdapter();case 14:return p=e.sent,e.next=17,p.getPublicKey();case 17:return l=e.sent,e.next=20,W.getWalletType();case 20:if(x=e.sent,!(f=x.isXverse)){e.next=28;break}return e.next=25,p.getPaymentAccount();case 25:e.t0=e.sent,e.next=29;break;case 28:e.t0=o;case 29:if(b=e.t0,!f){e.next=36;break}return e.next=33,p.getPaymentPublicKey();case 33:e.t1=e.sent,e.next=37;break;case 36:e.t1=l;case 37:return v=e.t1,g={sellerPublicKey:l,sellerAddress:o,sellerPaymentPublicKey:v,sellerPaymentAddress:b,ordinalsNFTUtxo:r,nftPrice:n},e.next=41,W.getSellerPsbt(g);case 41:return m=e.sent,h=m.toPSBT(),e.next=45,p.signPsbt({psbtHex:c.encode(h),type:"list",options:{autoFinalized:!1},psbtBase64:i.encode(h),inputsToSign:[{address:o,signingIndexes:[2],sigHash:s.SignatureHash.SINGLE|s.SignatureHash.ANYONECANPAY}]});case 45:return w=e.sent,k=f?w:i.encode(c.decode(w)),e.abrupt("return",k);case 48:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),sellerSignersForUnisat:function(){var e=(0,c.Z)((0,u.Z)().mark((function e(t){var n,r,s,a,i,o,p,l;return(0,u.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,y.Z)("@scure/base");case 2:return n=e.sent,r=n.hex,s=n.base64,e.next=7,d.Z.getWalletAccount();case 7:return a=e.sent,e.next=10,d.Z.getWalletAdapter();case 10:return i=e.sent,e.next=13,i.getPublicKey();case 13:return o=e.sent,e.next=16,Promise.all(t.map(function(){var e=(0,c.Z)((0,u.Z)().mark((function e(t){var n,s,c,i,p;return(0,u.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.nftPrice,s=t.utxoInfo,c={sellerPublicKey:o,sellerAddress:a,ordinalsNFTUtxo:s,nftPrice:n},e.next=4,W.getSellerPsbt(c);case 4:return i=e.sent,p=i.toPSBT(),e.abrupt("return",r.encode(p));case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 16:return p=e.sent,e.next=19,i.signPsbts({psbtHexs:p,options:t.map((()=>({autoFinalized:!1})))});case 19:return l=e.sent,e.abrupt("return",l.map((e=>s.encode(r.decode(e)))));case 21:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),compareVersions:(e,t)=>{for(var n=e.split(".").map(Number),r=t.split(".").map(Number),s=Math.max(n.length,r.length),a=0;ac)return 1;if(u=0;case 12:return e.abrupt("return",{version:s,supportBrc20:a});case 13:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),checkOkxVersion:function(){var e=(0,c.Z)((0,u.Z)().mark((function e(){var t;return(0,u.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,W.getOkxVersion();case 2:return t=e.sent,t.supportBrc20||p.Z.error({title:(0,o.O4)("btcnft_transact_err_msg_update_wallet")}),e.abrupt("return",t);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),getOkxWalletType:function(){var e=(0,c.Z)((0,u.Z)().mark((function e(){var t,n,r,s,a,c,i;return(0,u.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=!1,e.next=3,W.getWalletType();case 3:if(a=e.sent,!a.isOkxWallet||null===(t=window)||void 0===t||null===(n=t.okxwallet)||void 0===n||!n.requestWallets){e.next=15;break}return e.next=8,window.okxwallet.requestWallets();case 8:if(e.t0=e.sent,e.t0){e.next=11;break}e.t0=[];case 11:c=e.t0,i=c[0]||{},r=i.keyringIdentityType,s=2===r;case 15:return e.abrupt("return",{type:r,isHardware:s});case 16:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),checkOkxWalletType:function(){var e=(0,c.Z)((0,u.Z)().mark((function e(){var t,n;return(0,u.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,W.getOkxWalletType();case 2:return t=e.sent,(n=t.isHardware)&&p.Z.error({title:(0,o.O4)("btcnft_transact_err_msg_na_wallet_type")}),e.abrupt("return",n);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),checkPublicKey:()=>{var e,t,n,r=null===(e=window.okxwallet)||void 0===e||null===(t=e.bitcoin)||void 0===t||null===(n=t.selectedAccount)||void 0===n?void 0:n.publicKey;return r||p.Z.error({title:(0,o.O4)("btcnft_transaction_process_wallet_retry_notification")}),r},checkSupportBrc20:function(){var e=(0,c.Z)((0,u.Z)().mark((function e(){var t,n,r,s,a,c,i;return(0,u.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,W.getWalletType();case 2:if(t=e.sent,n=t.isUnisat,r=t.isXverse,!n&&!r){e.next=7;break}return e.abrupt("return",!0);case 7:return e.next=9,W.checkOkxVersion();case 9:return s=e.sent,a=s.supportBrc20,e.next=13,W.checkOkxWalletType();case 13:return c=e.sent,i=W.checkPublicKey(),e.abrupt("return",i&&a&&!c);case 16:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),getWalletType:function(){var e=(0,c.Z)((0,u.Z)().mark((function e(){var t;return(0,u.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,d.Z.getWalletType();case 2:return t=e.sent,e.abrupt("return",{type:t,isUnisat:t===b.Pi.UNISAT,isOkxWallet:t===b.Pi.OKX_WALLET,isXverse:t===b.Pi.XVERSE});case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),switchOkxWalletInfo:function(){var e=(0,c.Z)((0,u.Z)().mark((function e(){var t,n,r,s;return(0,u.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,W.getWalletType();case 2:if(t=e.sent,n=t.isUnisat,r=t.isXverse,!n&&!r){e.next=8;break}return s=l.Z.info({title:(0,o.O4)("nft_ordinals_inscribe_dialog_title_okx_wallet_update_reminder"),text:(0,o.O4)(n?"nftmarket_ordinalsinfo_notif_web_notsupport":"nft_ordinals_inscribe_dialog_subtitle_okx_wallet_switch_wallet"),confirmText:(0,o.O4)("nft_comm_btn_confirm"),onConfirm:()=>{s.destroy()}}),e.abrupt("return",!1);case 8:return e.abrupt("return",!0);case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),dustTradeInfo:function(){var e=(0,c.Z)((0,u.Z)().mark((function e(){var t;return(0,u.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=l.Z.tip({infoType:l.Z.Tip.INFO_TYPE.warn,title:(0,o.O4)("btcnft_header_dialog_title_change_wallet"),children:(0,o.O4)("btcnft_subtitle_dialog_subtitle_low_utxo"),confirmText:(0,o.O4)("nftcommon_btn_gerenal_confirm"),onConfirm:()=>{t.destroy()}});case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),checkSupportBatchTrade:function(){var e=(0,c.Z)((0,u.Z)().mark((function e(){var t,n,r,s,a,c,i,l,d,x,f,b=arguments;return(0,u.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=!(b.length>0&&void 0!==b[0])||b[0],e.next=3,W.getWalletType();case 3:if(s=e.sent,a=s.isUnisat,c=s.isXverse,!a&&!c){e.next=8;break}return e.abrupt("return",!0);case 8:return i="2.0.0",d=!0,e.next=12,W.getWalletType();case 12:if(x=e.sent,!x.isOkxWallet||null===(t=window)||void 0===t||null===(n=t.okxwallet)||void 0===n||!n.getVersion){e.next=20;break}return e.next=17,window.okxwallet.getVersion();case 17:l=e.sent,f=W.compareVersions(l,i),d=f>=0;case 20:return!d&&r&&p.Z.error({title:(0,o.O4)("nft_ordinals_inscribe_card_text_link_okx_wallet_update_reminder")}),e.abrupt("return",d);case 22:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),showOrdinalsUpgradeDialog:()=>{var e=l.Z.tip({infoType:l.Z.Tip.INFO_TYPE.warn,title:(0,o.O4)("inscription_market_header_dialog_maintaining"),children:(0,o.O4)("inscription_market_subtitle_dialog_reopen_after"),confirmText:(0,o.O4)("nftcommon_btn_gerenal_gotit"),onConfirm:()=>{e.destroy()}})},checkOrdinalsUpgradeCode:e=>e===w.ji&&(W.showOrdinalsUpgradeDialog(),!0),checkPause:()=>(0,m.bh)().commonStore.checkTradingPause()};const F=W}}]); +//# sourceMappingURL=https://static-daily.okg.com/crash/okfe/defi-mode/7549/index.e27c1c3f.js.map \ No newline at end of file