diff --git a/index.842d0d19.js.download b/index.842d0d19.js.download new file mode 100644 index 0000000..7f15fdc --- /dev/null +++ b/index.842d0d19.js.download @@ -0,0 +1,2 @@ +"use strict";(self.webpackChunkdefi_mode=self.webpackChunkdefi_mode||[]).push([[1401],{21401:(e,n,r)=>{r.d(n,{TRADE_TYPE:()=>h.xy,default:()=>Z,tradeUtil:()=>x.Z});var t=r(1413),a=r(74165),s=r(45987),c=r(15861),o=r(1708),u=r(67303),i=r(45271),f=r(48635),h=r(48779),d=r(36916),l=r(74579),x=r(48903),E=["txnHash","checkType","message","extPayload","extSubscribeParams"],p=["txnHash","checkType"],v=["txnHash","checkType","message"],T=["txnHash","extPayload","extJson","extSubscribeParams"],N=["txnHash","extPayload","extSubscribeParams"],m=["txnHash","checkType","message"];const Z={[h.xy.SELL]:function(){var e=(0,c.Z)((0,a.Z)().mark((function e(n){var r,t,c,l,x,p,v,T,N,m,Z,I,C,y,P;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.nftInfo,t=n.marketInfo,c=n.tradeData,l=n.notShowToast,x=void 0!==l&&l,e.next=3,o.Z.getWalletAccount();case 3:return p=e.sent,e.prev=4,e.next=7,d.Z.beforeTrade({chain:null===r||void 0===r?void 0:r.chain});case 7:return e.next=9,d.Z.getTradeEvent({nftInfo:r,orderInfo:{source:null===t||void 0===t?void 0:t.source},eventName:h.xy.SELL});case 9:return v=e.sent,e.next=12,v(n);case 12:return T=e.sent,N=T.txnHash,m=T.checkType,Z=T.message,I=T.extPayload,C=T.extSubscribeParams,y=(0,s.Z)(T,E),(0,i.KT)({nftInfo:r,scene:f.SCENE_ENUM.MadeListing,txnHash:N,tradeData:c,from:p,to:p}),e.next=22,d.Z.checkTransaction({orderInfo:{source:null===t||void 0===t?void 0:t.source,sourceName:null===t||void 0===t?void 0:t.name},nftInfo:r,txnHash:N,checkType:m,scene:f.SCENE_ENUM.MadeListing,from:p,to:p,notShowToast:x,message:Z,extResult:y,extPayload:I,extSubscribeParams:C});case 22:return P=e.sent,(0,u.kZf)({order_hash:N}),e.abrupt("return",Promise.resolve(P));case 27:return e.prev=27,e.t0=e.catch(4),d.Z.sendErrorMsg({scene:f.SCENE_ENUM.MadeListing,error:e.t0,nftInfo:r,from:p,to:p,notShowToast:x,payload:{chain:null===r||void 0===r?void 0:r.chain,sourceName:null===t||void 0===t?void 0:t.name,tokenStandard:r.tokenStandard}}),e.abrupt("return",Promise.reject(e.t0));case 31:case"end":return e.stop()}}),e,null,[[4,27]])})));return function(n){return e.apply(this,arguments)}}(),[h.xy.UPDATE_PRICE]:function(){var e=(0,c.Z)((0,a.Z)().mark((function e(n){var r,t,c,u,l,x,E,v,T,N,m,Z;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.nftInfo,t=n.orderInfo,c=n.tradeData,u=n.notShowToast,l=void 0!==u&&u,e.next=3,o.Z.getWalletAccount();case 3:return x=e.sent,e.prev=4,e.next=7,d.Z.beforeTrade({chain:null===r||void 0===r?void 0:r.chain});case 7:return e.next=9,d.Z.getTradeEvent({nftInfo:r,orderInfo:t,eventName:h.xy.UPDATE_PRICE});case 9:return E=e.sent,e.next=12,E(n);case 12:return v=e.sent,T=v.txnHash,N=v.checkType,m=(0,s.Z)(v,p),(0,i.KT)({nftInfo:r,orderInfo:t,scene:f.SCENE_ENUM.UpdateListing,txnHash:T,tradeData:c,from:x,to:x}),e.next=19,d.Z.checkTransaction({orderInfo:t,nftInfo:r,txnHash:T,checkType:N,scene:f.SCENE_ENUM.UpdateListing,from:x,to:x,notShowToast:l,extResult:m});case 19:return Z=e.sent,e.abrupt("return",Promise.resolve(Z));case 23:return e.prev=23,e.t0=e.catch(4),d.Z.sendErrorMsg({scene:f.SCENE_ENUM.UpdateListing,error:e.t0,nftInfo:r,from:x,to:x,notShowToast:l,payload:{chain:null===r||void 0===r?void 0:r.chain,sourceName:t.sourceName,tokenStandard:r.tokenStandard}}),e.abrupt("return",Promise.reject(e.t0));case 27:case"end":return e.stop()}}),e,null,[[4,23]])})));return function(n){return e.apply(this,arguments)}}(),[h.xy.MAKE_OFFER]:function(){var e=(0,c.Z)((0,a.Z)().mark((function e(n){var r,t,c,l,x,E,p,T,N,m,Z,I,C,y;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.nftInfo,t=n.collectionInfo,c=n.tradeData,l=n.notShowToast,x=void 0!==l&&l,e.next=3,o.Z.getWalletAccount();case 3:return E=e.sent,p=r?null===r||void 0===r?void 0:r.chain:null===t||void 0===t?void 0:t.chain,e.prev=5,e.next=8,d.Z.beforeTrade({chain:p});case 8:return e.next=10,d.Z.getTradeEvent({nftInfo:r||t,eventName:h.xy.MAKE_OFFER});case 10:return T=e.sent,e.next=13,T(n);case 13:return N=e.sent,m=N.txnHash,Z=N.checkType,I=N.message,C=(0,s.Z)(N,v),(0,i.KT)({nftInfo:r||t,scene:f.SCENE_ENUM.MadeOffer,txnHash:m,tradeData:c,from:E,to:E}),e.next=21,d.Z.checkTransaction({nftInfo:r||t,txnHash:m,checkType:Z,scene:f.SCENE_ENUM.MadeOffer,from:E,to:E,notShowToast:x,message:I,extResult:C});case 21:return y=e.sent,(0,u.TMQ)({order_hash:m}),e.abrupt("return",Promise.resolve(y));case 26:return e.prev=26,e.t0=e.catch(5),d.Z.sendErrorMsg({scene:f.SCENE_ENUM.MadeOffer,error:e.t0,nftInfo:r||t,from:E,to:E,notShowToast:x,payload:{chain:p}}),e.abrupt("return",Promise.reject(e.t0));case 30:case"end":return e.stop()}}),e,null,[[5,26]])})));return function(n){return e.apply(this,arguments)}}(),[h.xy.BUY]:function(){var e=(0,c.Z)((0,a.Z)().mark((function e(n){var r,t,s,c,l,x,E,p,v,T,N,m,Z,I,C;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.orderInfo,t=n.nftInfo,s="",e.prev=2,e.next=5,d.Z.beforeTrade({chain:null===t||void 0===t?void 0:t.chain});case 5:return e.next=7,d.Z.getTradeEvent({orderInfo:r,nftInfo:t,eventName:h.xy.BUY});case 7:return c=e.sent,l=+new Date,e.next=11,c(n);case 11:return x=e.sent,E=x.txnHash,p=x.checkType,v=x.gas,T=x.extJson,N=void 0===T?{}:T,s=E,m=+new Date,d.Z.reportOtherTx({txnHash:E,orderInfo:r}),(0,i.KT)({orderInfo:r,nftInfo:t,scene:f.SCENE_ENUM.Purchase,txnHash:s}),e.next=23,o.Z.getWalletAccount();case 23:return Z=e.sent,I=+new Date,(0,i.PN)("sendTransaction",{txnHash:E,createHashTime:l,endHashTime:m,startCheckTransactionTime:I,scene:f.SCENE_ENUM.Purchase,from:null===r||void 0===r?void 0:r.ownerAddress,to:Z}),e.next=28,d.Z.checkTransaction({orderInfo:r,nftInfo:t,txnHash:E,checkType:p,gas:v,scene:f.SCENE_ENUM.Purchase,from:r.ownerAddress,to:Z,extJson:N});case 28:return C=e.sent,(0,u.fQw)({tx_hash:E}),e.abrupt("return",Promise.resolve(C));case 33:return e.prev=33,e.t0=e.catch(2),d.Z.sendErrorMsg({scene:f.SCENE_ENUM.Purchase,error:e.t0,orderInfo:r,nftInfo:t,txnHash:s}),e.abrupt("return",Promise.reject(e.t0));case 37:case"end":return e.stop()}}),e,null,[[2,33]])})));return function(n){return e.apply(this,arguments)}}(),[h.xy.BATCH_BUY]:function(){var e=(0,c.Z)((0,a.Z)().mark((function e(n){var r,c,u,l,x,E,p,v,N,m,Z,I,C,y,P,S,_;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c=n.orderList,u=(null===(r=c[0])||void 0===r?void 0:r.nftInfo)||{},l=u.chain,e.prev=2,e.next=5,d.Z.beforeTrade({chain:l});case 5:return e.next=7,d.Z.getTradeEvent({nftInfo:{chain:l},eventName:h.xy.BATCH_BUY});case 7:return x=e.sent,E=+new Date,e.next=11,x(n);case 11:return p=e.sent,v=p.txnHash,N=p.extPayload,m=void 0===N?{}:N,Z=p.extJson,I=p.extSubscribeParams,C=(0,s.Z)(p,T),y=+new Date,e.next=21,o.Z.getWalletAccount();case 21:return P=e.sent,d.Z.reportOtherTx({txnHash:v}),S=+new Date,(0,i.PN)("sendTransaction",{txnHash:v,createHashTime:E,endHashTime:y,startCheckTransactionTime:S,scene:f.SCENE_ENUM.BatchPurchase,buyer:P}),e.next=27,d.Z.checkBatchTransaction({txnHash:v,chain:l,scene:f.SCENE_ENUM.BatchPurchase,from:P,to:P,extResult:C,extJson:Z,extPayload:(0,t.Z)((0,t.Z)({},m),{},{orderId:c.map((e=>{var n;return null===e||void 0===e||null===(n=e.orderInfo)||void 0===n?void 0:n.id})).join(",")}),extSubscribeParams:I});case 27:return _=e.sent,e.abrupt("return",Promise.resolve(_));case 31:return e.prev=31,e.t0=e.catch(2),d.Z.sendErrorMsg({scene:f.SCENE_ENUM.BatchPurchase,error:e.t0,orderList:c}),e.abrupt("return",Promise.reject(e.t0));case 35:case"end":return e.stop()}}),e,null,[[2,31]])})));return function(n){return e.apply(this,arguments)}}(),[h.xy.BATCH_ACCEPT_OFFER]:function(){var e=(0,c.Z)((0,a.Z)().mark((function e(n){var r,t,s,c,u,l,x,E,p,v,T,N;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.orderList,s=(null===(r=t[0])||void 0===r?void 0:r.nftInfo)||{},c=s.chain,e.prev=2,e.next=5,d.Z.beforeTrade({chain:c});case 5:return e.next=7,d.Z.getTradeEvent({nftInfo:{chain:c},eventName:h.xy.BATCH_ACCEPT_OFFER});case 7:return u=e.sent,l=+new Date,e.next=11,u(n);case 11:return x=e.sent,E=x.txnHash,(0,i.KT)({scene:f.SCENE_ENUM.AcceptOffer,txnHash:E}),p=+new Date,d.Z.reportOtherTx({txnHash:E}),e.next=18,o.Z.getWalletAccount();case 18:return v=e.sent,T=+new Date,(0,i.PN)("sendTransaction",{txnHash:E,createHashTime:l,endHashTime:p,startCheckTransactionTime:T,scene:f.SCENE_ENUM.AcceptOffer,buyer:v}),e.next=23,d.Z.checkBatchTransaction({txnHash:E,chain:c,scene:f.SCENE_ENUM.AcceptOffer,from:v,to:v});case 23:return N=e.sent,e.abrupt("return",Promise.resolve(N));case 27:return e.prev=27,e.t0=e.catch(2),d.Z.sendErrorMsg({scene:f.SCENE_ENUM.AcceptOffer,error:e.t0,orderList:t}),e.abrupt("return",Promise.reject(e.t0));case 31:case"end":return e.stop()}}),e,null,[[2,27]])})));return function(n){return e.apply(this,arguments)}}(),[h.xy.ACCEPT_OFFER]:function(){var e=(0,c.Z)((0,a.Z)().mark((function e(n){var r,t,s,c,l,x,E,p;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.orderInfo,t=n.nftInfo,e.prev=1,e.next=4,d.Z.beforeTrade({chain:null===t||void 0===t?void 0:t.chain});case 4:return e.next=6,d.Z.getTradeEvent({orderInfo:r,nftInfo:t,eventName:h.xy.ACCEPT_OFFER});case 6:return s=e.sent,e.next=9,s(n);case 9:return c=e.sent,l=c.txnHash,x=c.checkType,d.Z.reportOtherTx({txnHash:l,orderInfo:r}),(0,i.KT)({orderInfo:r,scene:f.SCENE_ENUM.AcceptOffer,txnHash:l}),e.next=16,o.Z.getWalletAccount();case 16:return E=e.sent,e.next=19,d.Z.checkTransaction({orderInfo:r,nftInfo:t,txnHash:l,checkType:x,scene:f.SCENE_ENUM.AcceptOffer,from:E,to:r.ownerAddress});case 19:return p=e.sent,(0,u.suG)({tx_hash:l}),e.abrupt("return",Promise.resolve(p));case 24:return e.prev=24,e.t0=e.catch(1),d.Z.sendErrorMsg({scene:f.SCENE_ENUM.AcceptOffer,error:e.t0,orderInfo:r}),e.abrupt("return",Promise.reject(e.t0));case 28:case"end":return e.stop()}}),e,null,[[1,24]])})));return function(n){return e.apply(this,arguments)}}(),[h.xy.CLAIM_NFT]:function(){var e=(0,c.Z)((0,a.Z)().mark((function e(n){var r,t,s,c,u,l,x;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.nftInfo,e.next=3,o.Z.getWalletAccount();case 3:return t=e.sent,e.prev=4,e.next=7,d.Z.beforeTrade({chain:null===r||void 0===r?void 0:r.chain});case 7:return e.next=9,d.Z.getTradeEvent({nftInfo:r,eventName:h.xy.CLAIM_NFT});case 9:return s=e.sent,e.next=12,s(n);case 12:return c=e.sent,u=c.txnHash,l=c.checkType,(0,i.KT)({nftInfo:r,scene:f.SCENE_ENUM.ClaimNft,txnHash:u,from:t,to:t}),e.next=18,d.Z.checkTransaction({nftInfo:r,txnHash:u,checkType:l,scene:f.SCENE_ENUM.ClaimNft,from:t,to:t});case 18:return x=e.sent,e.abrupt("return",Promise.resolve(x));case 22:return e.prev=22,e.t0=e.catch(4),d.Z.sendErrorMsg({scene:f.SCENE_ENUM.ClaimNft,error:e.t0,nftInfo:r,to:t}),e.abrupt("return",Promise.reject(e.t0));case 26:case"end":return e.stop()}}),e,null,[[4,22]])})));return function(n){return e.apply(this,arguments)}}(),[h.xy.TRANSFER]:function(){var e=(0,c.Z)((0,a.Z)().mark((function e(n){var r,t,s,c,u,l,x,E,p,v,T;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.nftInfo,t=n.tradeData,s=t.target,e.next=4,o.Z.getWalletAccount();case 4:return c=e.sent,e.prev=5,e.next=8,d.Z.beforeTrade({chain:null===r||void 0===r?void 0:r.chain});case 8:return e.next=10,d.Z.getTradeEvent({nftInfo:r,eventName:h.xy.TRANSFER});case 10:return u=e.sent,e.next=13,u(n);case 13:return l=e.sent,x=l.txnHash,E=l.checkType,p=l.extJson,v=void 0===p?{}:p,(0,i.KT)({nftInfo:r,scene:f.SCENE_ENUM.Transfer,txnHash:x,tradeData:t,from:c,to:s}),e.next=21,d.Z.checkTransaction({nftInfo:r,txnHash:x,checkType:E,scene:f.SCENE_ENUM.Transfer,from:c,to:s,extJson:v});case 21:return T=e.sent,e.abrupt("return",Promise.resolve(T));case 25:return e.prev=25,e.t0=e.catch(5),d.Z.sendErrorMsg({scene:f.SCENE_ENUM.Transfer,error:e.t0,nftInfo:r,from:c,to:s}),e.abrupt("return",Promise.reject(e.t0));case 29:case"end":return e.stop()}}),e,null,[[5,25]])})));return function(n){return e.apply(this,arguments)}}(),[h.xy.BATCH_TRANSFER]:function(){var e=(0,c.Z)((0,a.Z)().mark((function e(n){var r,c,u,l,x,E,p,v,T,m,Z,I,C;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.nftList,c=n.transferData,u=c.target,l=c.chain,e.next=4,o.Z.getWalletAccount();case 4:return x=e.sent,e.prev=5,e.next=8,d.Z.beforeTrade({chain:l});case 8:return e.next=10,d.Z.getTradeEvent({nftInfo:{chain:l},eventName:h.xy.BATCH_TRANSFER});case 10:return E=e.sent,e.next=13,E(n);case 13:return p=e.sent,v=p.txnHash,T=p.extPayload,m=void 0===T?{}:T,Z=p.extSubscribeParams,I=(0,s.Z)(p,N),(0,i.KT)({nftList:r,scene:f.SCENE_ENUM.BatchTransfer,txnHash:v,tradeData:c,from:x,to:u}),e.next=22,d.Z.checkBatchTransaction({nftList:r,txnHash:v,chain:l,scene:f.SCENE_ENUM.BatchTransfer,from:x,to:u,extResult:I,extPayload:(0,t.Z)((0,t.Z)({},m),{},{batchTransferDetails:r.map((e=>({nftId:e.id,count:e.readyTransferValue||1})))}),extSubscribeParams:Z});case 22:return C=e.sent,e.abrupt("return",Promise.resolve(C));case 26:return e.prev=26,e.t0=e.catch(5),d.Z.sendErrorMsg({scene:f.SCENE_ENUM.BatchTransfer,error:e.t0,nftList:r,from:x,to:u}),e.abrupt("return",Promise.reject(e.t0));case 30:case"end":return e.stop()}}),e,null,[[5,26]])})));return function(n){return e.apply(this,arguments)}}(),[h.xy.CANCEL]:function(){var e=(0,c.Z)((0,a.Z)().mark((function e(n){var r,t,s,c,u,l,x,E;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.nftInfo,t=n.orderInfo,e.prev=1,e.next=4,d.Z.beforeTrade({chain:null===r||void 0===r?void 0:r.chain});case 4:return e.next=6,d.Z.getTradeEvent({nftInfo:r,orderInfo:t,eventName:h.xy.CANCEL});case 6:return s=e.sent,e.next=9,s(n);case 9:return c=e.sent,u=c.txnHash,l=c.checkType,(0,i.KT)({nftInfo:r,orderInfo:t,scene:f.SCENE_ENUM.CancelSell,txnHash:u}),e.next=15,o.Z.getWalletAccount();case 15:return x=e.sent,e.next=18,d.Z.checkTransaction({nftInfo:r,orderInfo:t,txnHash:u,checkType:l,scene:f.SCENE_ENUM.CancelSell,from:x,to:x});case 18:return E=e.sent,e.abrupt("return",Promise.resolve(E));case 22:return e.prev=22,e.t0=e.catch(1),d.Z.sendErrorMsg({scene:f.SCENE_ENUM.CancelSell,error:e.t0,payload:{chain:null===r||void 0===r?void 0:r.chain,sourceName:t.sourceName,tokenStandard:r.tokenStandard},nftInfo:r,orderInfo:t}),e.abrupt("return",Promise.reject(e.t0));case 26:case"end":return e.stop()}}),e,null,[[1,22]])})));return function(n){return e.apply(this,arguments)}}(),[h.xy.CANCEL_OFFER]:function(){var e=(0,c.Z)((0,a.Z)().mark((function e(n){var r,t,s,c,u,l,x,E;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.nftInfo,t=n.orderInfo,e.next=3,o.Z.getWalletAccount();case 3:return s=e.sent,e.prev=4,e.next=7,d.Z.beforeTrade({chain:null===r||void 0===r?void 0:r.chain});case 7:return e.next=9,d.Z.getTradeEvent({nftInfo:r,orderInfo:t,eventName:h.xy.CANCEL_OFFER});case 9:return c=e.sent,e.next=12,c(n);case 12:return u=e.sent,l=u.txnHash,x=u.checkType,(0,i.KT)({nftInfo:r,orderInfo:t,scene:f.SCENE_ENUM.CancellOffer,txnHash:l}),e.next=18,d.Z.checkTransaction({nftInfo:r,orderInfo:t,txnHash:l,checkType:x,scene:f.SCENE_ENUM.CancellOffer,from:s,to:s});case 18:return E=e.sent,e.abrupt("return",Promise.resolve(E));case 22:return e.prev=22,e.t0=e.catch(4),d.Z.sendErrorMsg({scene:f.SCENE_ENUM.CancellOffer,error:e.t0,nftInfo:r,orderInfo:t}),e.abrupt("return",Promise.reject(e.t0));case 26:case"end":return e.stop()}}),e,null,[[4,22]])})));return function(n){return e.apply(this,arguments)}}(),[h.xy.BTC_INSCRIBE]:function(){var e=(0,c.Z)((0,a.Z)().mark((function e(n){var r,t,s,c,u,l,x;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.to,t=n.type,s=n.inscriptions,c=n.chain,e.next=3,o.Z.getWalletAccount();case 3:return u=e.sent,e.prev=4,e.next=7,d.Z.getTradeEvent({nftInfo:{chain:c},eventName:h.xy.BTC_INSCRIBE});case 7:return l=e.sent,e.next=10,l(n);case 10:return x=e.sent,(0,i.KT)({scene:f.SCENE_ENUM.Inscribing,txnHash:null===x||void 0===x?void 0:x.revealTxs,from:u,to:r,type:t,inscriptions:s}),e.abrupt("return",Promise.resolve(x));case 15:return e.prev=15,e.t0=e.catch(4),d.Z.sendErrorMsg({scene:f.SCENE_ENUM.Inscribing,error:e.t0,from:u,to:r}),e.abrupt("return",Promise.reject(e.t0));case 19:case"end":return e.stop()}}),e,null,[[4,15]])})));return function(n){return e.apply(this,arguments)}}(),[h.xy.P2P_SELL]:function(){var e=(0,c.Z)((0,a.Z)().mark((function e(n){var r,t,c,u,l,x,E,p,v,T,N,Z;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.nftInfo,t=n.tradeData,c=n.notShowToast,u=void 0!==c&&c,e.next=3,o.Z.getWalletAccount();case 3:return l=e.sent,e.prev=4,e.next=7,d.Z.beforeTrade({chain:null===r||void 0===r?void 0:r.chain});case 7:return e.next=9,d.Z.getTradeEvent({nftInfo:r,eventName:h.xy.P2P_SELL});case 9:return x=e.sent,e.next=12,x(n);case 12:return E=e.sent,p=E.txnHash,v=E.checkType,T=E.message,N=(0,s.Z)(E,m),(0,i.KT)({nftInfo:r,scene:f.SCENE_ENUM.P2PSell,txnHash:p,tradeData:t,from:l,to:l}),e.next=20,d.Z.checkTransaction({nftInfo:r,txnHash:p,checkType:v,scene:f.SCENE_ENUM.P2PSell,from:l,to:l,notShowToast:u,message:T,extResult:N,bizType:h.lW.P2P});case 20:return Z=e.sent,e.abrupt("return",Promise.resolve(Z));case 24:return e.prev=24,e.t0=e.catch(4),d.Z.sendErrorMsg({loggerKey:h.I4,scene:f.SCENE_ENUM.P2PSell,error:e.t0,nftInfo:r,from:l,to:l,notShowToast:u,payload:{chain:null===r||void 0===r?void 0:r.chain}}),e.abrupt("return",Promise.reject(e.t0));case 28:case"end":return e.stop()}}),e,null,[[4,24]])})));return function(n){return e.apply(this,arguments)}}(),[h.xy.P2P_BUY]:function(){var e=(0,c.Z)((0,a.Z)().mark((function e(n){var r,t,s,c,u,l,x,E,p,v,T,N,m,Z,I,C,y;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.orderInfo,t=n.nftInfo,s=n.setHash,c=n.renderPending,u="",e.prev=2,e.next=5,d.Z.beforeTrade({chain:null===t||void 0===t?void 0:t.chain});case 5:return e.next=7,d.Z.getTradeEvent({orderInfo:r,nftInfo:t,eventName:h.xy.P2P_BUY});case 7:return l=e.sent,x=+new Date,e.next=11,l(n);case 11:return E=e.sent,p=E.txnHash,v=E.checkType,T=E.gas,N=E.extJson,m=void 0===N?{}:N,null===c||void 0===c||c(),s(u=p),Z=+new Date,d.Z.reportOtherTx({txnHash:p,orderInfo:r}),(0,i.KT)({orderInfo:r,nftInfo:t,scene:f.SCENE_ENUM.P2PBuy,txnHash:u}),e.next=25,o.Z.getWalletAccount();case 25:return I=e.sent,C=+new Date,(0,i.PN)("sendTransaction",{txnHash:p,createHashTime:x,endHashTime:Z,startCheckTransactionTime:C,scene:f.SCENE_ENUM.P2PBuy,from:null===r||void 0===r?void 0:r.makerAddress,to:I}),e.next=30,d.Z.checkTransaction({orderInfo:r,nftInfo:t,txnHash:p,checkType:v,gas:T,scene:f.SCENE_ENUM.P2PBuy,from:null===r||void 0===r?void 0:r.makerAddress,to:I,extJson:m,bizType:h.lW.P2P});case 30:return y=e.sent,e.abrupt("return",Promise.resolve(y));case 34:return e.prev=34,e.t0=e.catch(2),d.Z.sendErrorMsg({loggerKey:h.I4,scene:f.SCENE_ENUM.P2PBuy,error:e.t0,orderInfo:r,nftInfo:t,txnHash:u}),e.abrupt("return",Promise.reject(e.t0));case 38:case"end":return e.stop()}}),e,null,[[2,34]])})));return function(n){return e.apply(this,arguments)}}(),[h.xy.P2P_CANCEL]:function(){var e=(0,c.Z)((0,a.Z)().mark((function e(n){var r,t,s,c,u,l,x,E,p,v;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.nftInfo,t=n.orderInfo,s=n.setHash,c=n.renderPending,e.prev=1,e.next=4,d.Z.beforeTrade({chain:null===r||void 0===r?void 0:r.chain});case 4:return e.next=6,d.Z.getTradeEvent({nftInfo:r,orderInfo:t,eventName:h.xy.P2P_CANCEL});case 6:return u=e.sent,e.next=9,u(n);case 9:return l=e.sent,x=l.txnHash,E=l.checkType,s(x),null===c||void 0===c||c(),(0,i.KT)({nftInfo:r,orderInfo:t,scene:f.SCENE_ENUM.P2PCancelSell,txnHash:x}),e.next=17,o.Z.getWalletAccount();case 17:return p=e.sent,e.next=20,d.Z.checkTransaction({nftInfo:r,orderInfo:t,txnHash:x,checkType:E,scene:f.SCENE_ENUM.P2PCancelSell,from:p,to:p,bizType:h.lW.P2P});case 20:return v=e.sent,e.abrupt("return",Promise.resolve(v));case 24:return e.prev=24,e.t0=e.catch(1),d.Z.sendErrorMsg({loggerKey:h.I4,scene:f.SCENE_ENUM.P2PCancelSell,error:e.t0,payload:{chain:null===r||void 0===r?void 0:r.chain,sourceName:null===t||void 0===t?void 0:t.sourceName,tokenStandard:null===r||void 0===r?void 0:r.tokenStandard},nftInfo:r,orderInfo:t}),e.abrupt("return",Promise.reject(e.t0));case 28:case"end":return e.stop()}}),e,null,[[1,24]])})));return function(n){return e.apply(this,arguments)}}(),[h.xy.INIT_ACCOUNT]:function(){var e=(0,c.Z)((0,a.Z)().mark((function e(n){var r,t,s,c,u,l,x;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.chain,e.next=3,o.Z.getWalletAccount();case 3:return t=e.sent,e.prev=4,e.next=7,d.Z.getTradeEvent({nftInfo:{chain:r},eventName:h.xy.INIT_ACCOUNT});case 7:return s=e.sent,e.next=10,s(n);case 10:return c=e.sent,u=c.txnHash,l=c.checkType,(0,i.KT)({scene:f.SCENE_ENUM.InitAccount,txnHash:u,from:t}),e.next=16,d.Z.checkTransaction({nftInfo:{chain:r},txnHash:u,checkType:l,scene:f.SCENE_ENUM.InitAccount,from:t,to:t});case 16:return x=e.sent,e.abrupt("return",Promise.resolve(x));case 20:return e.prev=20,e.t0=e.catch(4),d.Z.sendErrorMsg({scene:f.SCENE_ENUM.InitAccount,error:e.t0,from:t}),e.abrupt("return",Promise.reject(e.t0));case 24:case"end":return e.stop()}}),e,null,[[4,20]])})));return function(n){return e.apply(this,arguments)}}(),[h.xy.CREATE_COLLECTION]:function(){var e=(0,c.Z)((0,a.Z)().mark((function e(n){var r,t,s,c;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.Z.getWalletAccount();case 2:return r=e.sent,e.prev=3,e.next=6,l.default[h.xy.CREATE_COLLECTION](n);case 6:return t=e.sent,s=t.txnHash,c=t.checkType,(0,i.KT)({scene:f.SCENE_ENUM.CreateCollection,txnHash:s,from:r}),e.abrupt("return",Promise.resolve({txnHash:s,checkType:c}));case 13:return e.prev=13,e.t0=e.catch(3),d.Z.sendErrorMsg({scene:f.SCENE_ENUM.CreateCollection,error:e.t0,from:r}),e.abrupt("return",Promise.reject(e.t0));case 17:case"end":return e.stop()}}),e,null,[[3,13]])})));return function(n){return e.apply(this,arguments)}}(),[h.xy.BATCH_MINT]:function(){var e=(0,c.Z)((0,a.Z)().mark((function e(n){var r,t,s,c;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.Z.getWalletAccount();case 2:return r=e.sent,e.prev=3,e.next=6,l.default[h.xy.BATCH_MINT](n);case 6:return t=e.sent,s=t.txnHash,c=t.checkType,(0,i.KT)({scene:f.SCENE_ENUM.BatchMint,txnHash:s,from:r}),e.next=12,(0,f.subscribeTxResult)({txnHash:s,scene:f.SCENE_ENUM.BatchMint,payload:n.payload});case 12:return e.abrupt("return",Promise.resolve({txnHash:s,checkType:c}));case 15:return e.prev=15,e.t0=e.catch(3),d.Z.sendErrorMsg({scene:f.SCENE_ENUM.BatchMint,error:e.t0,from:r}),e.abrupt("return",Promise.reject(e.t0));case 19:case"end":return e.stop()}}),e,null,[[3,15]])})));return function(n){return e.apply(this,arguments)}}()}}}]); +//# sourceMappingURL=https://static-daily.okg.com/crash/okfe/defi-mode/1401/index.842d0d19.js.map \ No newline at end of file diff --git a/index.93c32953.js.download b/index.93c32953.js.download new file mode 100644 index 0000000..af85cfc --- /dev/null +++ b/index.93c32953.js.download @@ -0,0 +1,2 @@ +"use strict";(self.webpackChunkdefi_mode=self.webpackChunkdefi_mode||[]).push([[1708,8153],{1708:(e,r,t)=>{t.d(r,{Z:()=>E});var n=t(45987),a=t(1413),c=t(37762),s=t(74165),u=t(15861),o=t(51625),i=t.n(o),l=t(60378),p=t(53949),d=t(91719),h=t(64353),v=t(80159),f=t(91680),w=t(93517),Z=t(89477),b=t(99666),k=t(59030),x=["account","signData","nonce"],m=["message","nonce"],g=["message"],C=["chain","chainType","switchFaildCallback"],y=["chain","chainType","connectOptions","succCallback","closeCallback","switchFaildCallback"],A=["chain","switchFaildCallback"],T=["chain","switchFaildCallback"],W=["isNeedAll","chainId"],P=["currency","network","address","prefix","contract","onClose"];function F(e,r){var t=new Promise((r=>{var t=setTimeout((()=>{clearTimeout(t),r("Timeout")}),e)}));return Promise.race([r,t])}var N=new class{constructor(){this.adapter=null,this.adapterFlag=!1,this.okxWalletSupportChain=[],this.initPromise=this.init(),this.walletChangeCallbacks=new Map,this.dashboardChangeCallbacks=new Map,this.nextWalletChangeSubId=1,this.nextDashboardChangeSubId=1,this.adapterReadyPromise=new Promise((e=>{this.resolveAdapterReady=e}))}resetAdapterPromise(){this.adapterReadyPromise=new Promise((e=>{this.resolveAdapterReady=e}))}onWalletChange(e){if(!(0,l.y)()){var r=this.nextWalletChangeSubId++;return(0,v.uw)({subscriptionId:r,callbacks:this.walletChangeCallbacks,callback:e})}}offWalletChange(e){(0,l.y)()||(0,v.Du)({subscriptionId:e,callbacks:this.walletChangeCallbacks})}onDashboardChange(e){if(!(0,l.y)()){var r=this.nextDashboardChangeSubId++;return(0,v.uw)({subscriptionId:r,callbacks:this.dashboardChangeCallbacks,callback:e})}}offDashboardChange(e){(0,l.y)()||(0,v.Du)({subscriptionId:e,callbacks:this.dashboardChangeCallbacks})}onChainChange(e){var r=this;return(0,u.Z)((0,s.Z)().mark((function t(){var n,a,c,u,o;return(0,s.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(0,l.y)()){t.next=2;break}return t.abrupt("return");case 2:null!==(n=r.adapter)&&void 0!==n&&n.onChainChange?null===(a=r.adapter)||void 0===a||a.onChainChange(e):null===(c=window)||void 0===c||null===(u=c.ethereum)||void 0===u||null===(o=u.on)||void 0===o||o.call(u,"chainChanged",e);case 3:case"end":return t.stop()}}),t)})))()}offChainChange(e){return(0,u.Z)((0,s.Z)().mark((function r(){var t,n,a,c,u,o,i,p,d;return(0,s.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!(0,l.y)()){r.next=2;break}return r.abrupt("return");case 2:return null===(t=window)||void 0===t||null===(n=t.okxwallet)||void 0===n||null===(a=n.removeListener)||void 0===a||a.call(n,"chainChanged",e),null===(c=window)||void 0===c||null===(u=c.ethereum)||void 0===u||null===(o=u.removeListener)||void 0===o||o.call(u,"chainChanged",e),r.next=6,(0,w.VH)();case 6:null===(d=r.sent)||void 0===d||null===(i=d.ethereum)||void 0===i||null===(p=i.removeListener)||void 0===p||p.call(i,"chainChanged",e);case 8:case"end":return r.stop()}}),r)})))()}get chainTypeEnum(){return d.CY}get chainTypeKeyEnum(){return d.tV}get chainType(){var e;return null===(e=this.adapter)||void 0===e?void 0:e.chainType}get isConnected(){return!!(0,w.LG)()}get isWalletReady(){return!!this.adapter}get Web3(){return"undefined"===typeof Web3?void 0:Web3}walletDataChangeCallBack(e,r){var t=this;return(0,u.Z)((0,s.Z)().mark((function n(){var a,u,o,i,l,p,d,h;return(0,s.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(a=e.actionType,!["add_connected_wallet","init_wallet"].includes(a)){n.next=14;break}if(t.adapterFlag){n.next=10;break}if(r.adapter){n.next=10;break}return n.next=7,(0,f.S)({okxWalletSupportChain:r.okxWalletSupportChain});case 7:r.adapter=n.sent,r.resolveAdapterReady();case 10:u=(0,c.Z)(t.walletChangeCallbacks.keys());try{for(u.s();!(o=u.n()).done;)(0,o.value)(e)}catch(s){u.e(s)}finally{u.f()}n.next=15;break;case 14:if("log_out_wallet"===a){r.adapter=null,r.resolveAdapterReady(),i=setTimeout((()=>{r.resetAdapterPromise(),clearTimeout(i)}),2005),l=(0,c.Z)(t.walletChangeCallbacks.keys());try{for(l.s();!(p=l.n()).done;)(0,p.value)(e)}catch(s){l.e(s)}finally{l.f()}}case 15:d=(0,c.Z)(t.dashboardChangeCallbacks.keys());try{for(d.s();!(h=d.n()).done;)(0,h.value)(e)}catch(s){d.e(s)}finally{d.f()}case 17:case"end":return n.stop()}}),n)})))()}init(){var e=this;return(0,u.Z)((0,s.Z)().mark((function r(){var t,n,a;return(0,s.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(r.prev=0,!(0,l.y)()){r.next=3;break}return r.abrupt("return");case 3:t=p.Z.onchain,n=(void 0===t?{}:t).onWalletDataChange,a=e,n&&n((r=>{e.walletDataChangeCallBack(r,a)})),r.next=12;break;case 9:r.prev=9,r.t0=r.catch(0),r.t0;case 12:case"end":return r.stop()}}),r,null,[[0,9]])})))()}createAdapter(){var e=this;return(0,u.Z)((0,s.Z)().mark((function r(){return(0,s.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(e.adapter){r.next=7;break}return r.next=3,(0,f.S)({okxWalletSupportChain:e.okxWalletSupportChain});case 3:e.adapter=r.sent,e.resolveAdapterReady(),e.adapterFlag=!1;case 7:case"end":return r.stop()}}),r)})))()}setOkxWalletSupportChain(e){this.okxWalletSupportChain=e}connect(e){var r=this;try{var t;if((0,l.y)())return;var n=(e||{}).successCallback,c=function(){var e=(0,u.Z)((0,s.Z)().mark((function e(t){return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r.adapterFlag=!0,e.next=3,r.createAdapter();case 3:n&&n(t);case 4:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),o=(0,a.Z)((0,a.Z)({},e),{},{successCallback:c});null===p.Z||void 0===p.Z||null===(t=p.Z.onchain)||void 0===t||t.getWalletWidget().then((e=>{e&&e.connect(o)}))}catch(i){throw console.error("Error connecting wallet:",i),i}}disconnect(){var e;(0,l.y)()||null===p.Z||void 0===p.Z||null===(e=p.Z.onchain)||void 0===e||e.setWalletLogout()}getWeb3(e){var r=this;return(0,u.Z)((0,s.Z)().mark((function t(){var n,a;return(0,s.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e){t.next=4;break}return t.abrupt("return",(0,w.Um)(e));case 4:if(!r.adapter){t.next=6;break}return t.abrupt("return",null===(n=(a=r.adapter).getWeb3)||void 0===n?void 0:n.call(a));case 6:case"end":return t.stop()}}),t)})))()}getWalletAdapter(){var e=this;return(0,u.Z)((0,s.Z)().mark((function r(){return(0,s.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(e.adapter){r.next=2;break}throw new Error("No wallet connected");case 2:return r.abrupt("return",e.adapter);case 3:case"end":return r.stop()}}),r)})))()}getAccount(e){var r=this;return(0,u.Z)((0,s.Z)().mark((function t(){var n;return(0,s.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,null===(n=r.adapter)||void 0===n?void 0:n.getAccount(e);case 2:if(t.t0=t.sent,t.t0){t.next=5;break}t.t0="";case 5:return t.abrupt("return",t.t0);case 6:case"end":return t.stop()}}),t)})))()}getChainId(){var e=this;return(0,u.Z)((0,s.Z)().mark((function r(){return(0,s.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(e.adapter){r.next=2;break}throw new Error("No wallet connected");case 2:return r.next=4,e.adapter.getChainId();case 4:return r.abrupt("return",r.sent);case 5:case"end":return r.stop()}}),r)})))()}signData(e){var r=this;return(0,u.Z)((0,s.Z)().mark((function t(){var c,u,o,i;return(0,s.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(c=e.account,u=e.signData,o=e.nonce,i=(0,n.Z)(e,x),r.adapter){t.next=3;break}throw new Error("No wallet connected");case 3:return t.next=5,r.adapter.signMessage((0,a.Z)({message:u,account:c,nonce:o},i));case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t)})))()}signMessage(e){var r=this;return(0,u.Z)((0,s.Z)().mark((function t(){var c,u,o;return(0,s.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(c=e.message,u=e.nonce,o=(0,n.Z)(e,m),r.adapter){t.next=3;break}throw new Error("No wallet connected");case 3:return t.next=5,r.adapter.signMessage((0,a.Z)({message:c,nonce:u},o));case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t)})))()}signTypedData(e){var r=this;return(0,u.Z)((0,s.Z)().mark((function t(){var c,u,o;return(0,s.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(u=e.message,o=(0,n.Z)(e,g),r.adapter){t.next=3;break}throw new Error("No wallet connected");case 3:return t.next=5,null===(c=r.adapter)||void 0===c?void 0:c.signTypedData((0,a.Z)({message:u},o));case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t)})))()}sendTransaction(e,r,t){var n=this;return(0,u.Z)((0,s.Z)().mark((function a(){return(0,s.Z)().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(n.adapter){a.next=2;break}throw new Error("No wallet connected");case 2:return a.next=4,n.adapter.sendTransaction({payload:e,cb:r,extraParams:t});case 4:return a.abrupt("return",a.sent);case 5:case"end":return a.stop()}}),a)})))()}switchNetwork(e){var r=this;return(0,u.Z)((0,s.Z)().mark((function t(){var c,u,o,i,l;return(0,s.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(c=e.chain,u=e.chainType,o=e.switchFaildCallback,i=(0,n.Z)(e,C),l=(0,w.q5)(c),r.adapter){t.next=4;break}throw new Error("No wallet connected");case 4:if(t.prev=4,!r.adapter.setChainType){t.next=8;break}return t.next=8,r.adapter.setChainType({chainId:l,chainType:u});case 8:return t.next=10,r.adapter.switchNetwork((0,a.Z)({chain:l,chainType:u,switchFaildCallback:o},i));case 10:return t.abrupt("return",t.sent);case 13:return t.prev=13,t.t0=t.catch(4),t.t0,o&&o(c),t.abrupt("return",!1);case 18:case"end":return t.stop()}}),t,null,[[4,13]])})))()}commAdapterLinkAndNet(e){var r=this;return(0,u.Z)((0,s.Z)().mark((function t(){var c,o,i,l,p,d,h,v;return(0,s.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return c=e.chain,o=e.chainType,i=e.connectOptions,l=e.succCallback,p=e.closeCallback,d=e.switchFaildCallback,h=(0,n.Z)(e,y),v=(0,w.q5)(c),t.prev=2,t.abrupt("return",new Promise(function(){var e=(0,u.Z)((0,s.Z)().mark((function e(t){var n,f;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=()=>{r.connect((0,a.Z)((0,a.Z)({},i),{},{successCallback:function(){var e=(0,u.Z)((0,s.Z)().mark((function e(){var n;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l&&l(),e.next=3,r.switchNetwork((0,a.Z)((0,a.Z)({},h),{},{chain:v,chainType:o,switchFaildCallback:d}));case 3:n=e.sent,t(n);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),closeCallback:p}))},!r.adapter){e.next=19;break}if(!r.adapter.setChainType){e.next=5;break}return e.next=5,r.adapter.setChainType({chainId:v,chainType:o});case 5:return e.next=7,r.adapter.getAccount({chainId:v,chainType:o});case 7:if(!e.sent){e.next=15;break}return e.next=11,r.switchNetwork((0,a.Z)((0,a.Z)({},h),{},{chain:v,chainType:o,switchFaildCallback:d}));case 11:f=e.sent,t(f),e.next=17;break;case 15:d&&d(c),t(!1);case 17:e.next=20;break;case 19:n();case 20:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()));case 6:return t.prev=6,t.t0=t.catch(2),d&&d(v),t.abrupt("return",Promise.resolve(!1));case 10:case"end":return t.stop()}}),t,null,[[2,6]])})))()}checkLinKAndNet(e,r,t){var n=this;return(0,u.Z)((0,s.Z)().mark((function c(){return(0,s.Z)().wrap((function(c){for(;;)switch(c.prev=c.next){case 0:return c.abrupt("return",n.commAdapterLinkAndNet((0,a.Z)({chain:e,switchFaildCallback:r},t)));case 1:case"end":return c.stop()}}),c)})))()}getConnectedConfig(){return(0,u.Z)((0,s.Z)().mark((function e(){return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,w.Xd)());case 1:case"end":return e.stop()}}),e)})))()}commAdapterChain(e){var r=this;return(0,u.Z)((0,s.Z)().mark((function t(){var c,u,o;return(0,s.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return c=e.chain,u=e.switchFaildCallback,o=(0,n.Z)(e,A),t.abrupt("return",r.switchNetwork((0,a.Z)({chain:c,switchFaildCallback:u},o)));case 2:case"end":return t.stop()}}),t)})))()}commAdaterChain(e){var r=this;return(0,u.Z)((0,s.Z)().mark((function t(){var c,u,o;return(0,s.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return c=e.chain,u=e.switchFaildCallback,o=(0,n.Z)(e,T),t.abrupt("return",r.switchNetwork((0,a.Z)({chain:c,switchFaildCallback:u},o)));case 2:case"end":return t.stop()}}),t)})))()}checkWalletNet(e,r){var t=arguments,n=this;return(0,u.Z)((0,s.Z)().mark((function c(){var u,o,i;return(0,s.Z)().wrap((function(c){for(;;)switch(c.prev=c.next){case 0:for(u=t.length,o=new Array(u>2?u-2:0),i=2;i0&&void 0!==e[0]?e[0]:{}).isNeedAll,o=c.chainId,i=(0,n.Z)(c,W),t.next=3,r.getAccount((0,a.Z)({isNeedAll:u,chainId:o},i));case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t)})))()}getProviderData(){return(0,u.Z)((0,s.Z)().mark((function e(){return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,w.zc)());case 1:case"end":return e.stop()}}),e)})))()}setChainType(e){var r=this;return(0,u.Z)((0,s.Z)().mark((function t(){var n,a,c;return(0,s.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=e.chainType,c=e.chainId,null===(n=r.adapter)||void 0===n||!n.setChainType){t.next=5;break}return t.next=4,r.adapter.setChainType({chainType:a,chainId:c});case 4:return t.abrupt("return",t.sent);case 5:case"end":return t.stop()}}),t)})))()}isSupportChainType(e){var r=this;return(0,u.Z)((0,s.Z)().mark((function t(){var n,a,c,u,o,i;return(0,s.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.chainId,a=(0,w.W3)(n),c=!0,t.next=5,(0,w.zc)();case 5:if(u=t.sent,(o=u.walletType)!==h.TE.OKX_WALLET||!r.adapter){t.next=14;break}return t.next=10,r.adapter.getAccount({chainId:n});case 10:i=t.sent,c=!!i,t.next=15;break;case 14:o===h.TE.LEDGER?c=!0:o!==h.TE.NO_WALLET?(h.kK[o]||[]).includes(a)||(c=!1):o===h.TE.NO_WALLET&&(c=!1);case 15:return t.abrupt("return",c);case 16:case"end":return t.stop()}}),t)})))()}getChainTypeByChainId(e){var r=d.CY.EVM;return Object.keys(d.Ml).forEach((t=>{d.Ml[t].includes(e)&&(r=Number(t))})),r}getAllChainTypeInfoList(){var e=this;return(0,u.Z)((0,s.Z)().mark((function r(){var t,n;return(0,s.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(null===(t=e.adapter)||void 0===t||null===(n=t.getAllChainTypeInfoList)||void 0===n?void 0:n.call(t))||[]);case 1:case"end":return r.stop()}}),r)})))()}getWalletType(){return(0,u.Z)((0,s.Z)().mark((function e(){var r,t;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,w.zc)();case 2:return r=e.sent,t=r.walletType,e.abrupt("return",t);case 5:case"end":return e.stop()}}),e)})))()}commApproved(e,r,t,n,a,c,o){var i=this;return(0,u.Z)((0,s.Z)().mark((function u(){return(0,s.Z)().wrap((function(s){for(;;)switch(s.prev=s.next){case 0:return s.abrupt("return",i.commApproveToken({abi:e,addr:r,operatorAddr:t,amount:n,cb:a,maxFeePerGas:c,maxPriorityFeePerGas:o}));case 1:case"end":return s.stop()}}),u)})))()}commApproveToken(e){var r=this;return(0,u.Z)((0,s.Z)().mark((function t(){var n,a,c,u,o,l,p,d,h,v,f,w;return(0,s.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.abi,a=e.addr,c=e.operatorAddr,u=e.amount,o=e.cb,l=e.maxFeePerGas,p=e.maxPriorityFeePerGas,d=e.extParams,h=n||i(),t.next=4,r.getAccount();case 4:return v=t.sent,t.next=7,r.getWeb3();case 7:return f=t.sent,t.next=10,(0,Z.F)({abi:h,addr:a,ownerAddr:v,operatorAddr:c,amount:u,web3:f});case 10:if(!t.sent){t.next=15;break}return t.abrupt("return",!0);case 15:return t.next=17,r.approvedToken({abi:h,addr:a,operatorAddr:c,cb:o,maxFeePerGas:l,maxPriorityFeePerGas:p,extParams:d});case 17:return w=t.sent,t.abrupt("return",w);case 20:case"end":return t.stop()}}),t)})))()}approvedToken(e){var r=this;return(0,u.Z)((0,s.Z)().mark((function t(){var n,c,u,o,l,p,d,h,v,f,w,Z;return(0,s.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.abi,c=e.addr,u=e.operatorAddr,o=e.cb,l=e.maxFeePerGas,p=e.maxPriorityFeePerGas,d=e.extParams,t.prev=1,h=n||i(),t.next=5,r.getWeb3();case 5:return v=t.sent,f=new v.eth.Contract(h,c),t.next=9,r.getAccount();case 9:return w=t.sent,Z={from:w,to:c,data:f.methods.approve(u,b.E).encodeABI(),extParams:(0,a.Z)((0,a.Z)({},d),{},{canSupplyGas:!0})},l&&p&&(Z.maxFeePerGas=l,Z.maxPriorityFeePerGas=p),t.next=14,r.sendTransaction(Z,o);case 14:return"Approved Token success to ".concat(u),t.abrupt("return",!0);case 18:return t.prev=18,t.t0=t.catch(1),t.t0,t.abrupt("return",!1);case 22:case"end":return t.stop()}}),t,null,[[1,18]])})))()}isApproved(e){var r=this;return(0,u.Z)((0,s.Z)().mark((function t(){var n,a,c,u,o,l,p,d;return(0,s.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.abi,a=e.addr,c=e.ownerAddr,u=e.operatorAddr,o=e.amount,l=n||i(),t.next=4,r.getWeb3();case 4:return p=t.sent,t.next=7,(0,Z.F)({abi:l,addr:a,ownerAddr:c,operatorAddr:u,amount:o,web3:p});case 7:return d=t.sent,t.abrupt("return",!!d);case 9:case"end":return t.stop()}}),t)})))()}getContract(e,r){var t=this;return(0,u.Z)((0,s.Z)().mark((function n(){var a;return(0,s.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,t.getWeb3();case 2:return a=n.sent,n.abrupt("return",new a.eth.Contract(e,r));case 4:case"end":return n.stop()}}),n)})))()}getDecimals(e){var r=this;return(0,u.Z)((0,s.Z)().mark((function t(){var n;return(0,s.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,r.getWeb3();case 2:return n=t.sent,t.abrupt("return",(0,Z.p)({addr:e,web3:n}));case 4:case"end":return t.stop()}}),t)})))()}getEthBalance(e){var r=this;return(0,u.Z)((0,s.Z)().mark((function t(){var n;return(0,s.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,r.getWeb3();case 2:return n=t.sent,t.abrupt("return",new Promise((r=>{n.eth.getBalance(e,((e,t)=>{var a=n.utils.fromWei(t,"ether");r(a)}))})));case 4:case"end":return t.stop()}}),t)})))()}getWalletProvider(){return(0,u.Z)((0,s.Z)().mark((function e(){return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,w.sM)());case 1:case"end":return e.stop()}}),e)})))()}setSupportWalletOptions(e){return(0,u.Z)((0,s.Z)().mark((function r(){var t;return(0,s.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:p.Z.onchain&&(t=p.Z.onchain.supportWalletOptions,p.Z.onchain.supportWalletOptions=(0,a.Z)((0,a.Z)({},t),e));case 1:case"end":return r.stop()}}),r)})))()}getDeposit(e){return(0,u.Z)((0,s.Z)().mark((function r(){var t,c,u,o,i,l,d,h,v,f,w,Z;return(0,s.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return o=e.currency,i=e.network,l=e.address,d=e.prefix,h=e.contract,v=e.onClose,f=(0,n.Z)(e,P),r.next=3,null===p.Z||void 0===p.Z||null===(t=p.Z.onchain)||void 0===t||null===(c=t.getWalletWidget)||void 0===c?void 0:c.call(t);case 3:return w=r.sent,r.next=6,null===w||void 0===w||null===(u=w.getDeposit)||void 0===u?void 0:u.call(w);case 6:null===(Z=r.sent)||void 0===Z||Z.V1((0,a.Z)({currency:o,network:i,address:l,prefix:d,contract:h,onClose:v},f));case 8:case"end":return r.stop()}}),r)})))()}getWalletStorage(){return(0,u.Z)((0,s.Z)().mark((function e(){var r,t,n,a;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,null===p.Z||void 0===p.Z||null===(r=p.Z.onchain)||void 0===r||null===(t=r.getWalletWidget)||void 0===t?void 0:t.call(r);case 2:return n=e.sent,e.next=5,null===n||void 0===n?void 0:n.getWalletStorage();case 5:return a=e.sent,e.abrupt("return",a);case 7:case"end":return e.stop()}}),e)})))()}getWalletWidget(){return(0,u.Z)((0,s.Z)().mark((function e(){var r,t,n;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,null===p.Z||void 0===p.Z||null===(r=p.Z.onchain)||void 0===r||null===(t=r.getWalletWidget)||void 0===t?void 0:t.call(r);case 2:return n=e.sent,e.abrupt("return",n);case 4:case"end":return e.stop()}}),e)})))()}okxAppSendCustomTransaction(e,r){var t=this;return(0,u.Z)((0,s.Z)().mark((function n(){var a,c;return(0,s.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(t.adapter){n.next=2;break}throw new Error("No wallet connected");case 2:return n.next=4,null===(a=(c=t.adapter).sendCustomTransaction)||void 0===a?void 0:a.call(c,e,r);case 4:return n.abrupt("return",n.sent);case 5:case"end":return n.stop()}}),n)})))()}okxAppCancelApprove(e){var r=this;return(0,u.Z)((0,s.Z)().mark((function t(){var n,a,c,u,o,i,l;return(0,s.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(c=e.abi,u=e.addr,o=e.operatorAddr,i=e.cb,l=e.options,r.adapter){t.next=3;break}throw new Error("No wallet connected");case 3:return t.next=5,null===(n=(a=r.adapter).okxAppCancelApprove)||void 0===n?void 0:n.call(a,{abi:c,addr:u,operatorAddr:o,cb:i,options:l});case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t)})))()}isBtcAddress(e){return(0,k.G)(e)}};const E=new Proxy(N,{get(e,r,t){var n=Reflect.get(e,r,t);return["getChainTypeByChainId","Web3","onWalletChange","offWalletChange","onDashboardChange","offDashboardChange","setOkxWalletSupportChain","setSupportWalletOptions","connect","disconnect","getWalletStorage","createAdapter","isBtcAddress"].includes(r)?n:"function"===typeof n?(0,u.Z)((0,s.Z)().mark((function r(){var t,a,c,u=arguments;return(0,s.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,e.initPromise;case 2:if(!(0,w.LG)()){r.next=6;break}return r.next=6,F(2e3,e.adapterReadyPromise);case 6:for(t=u.length,a=new Array(t),c=0;c{n.d(e,{c:()=>T});var r=n(1413),c=(n(87363),n(95640)),o=n.n(c),a=n(28106),i=n(35686),s=(n(21610),n(92643),n(40910)),l=n(14001);const d={container:"index_container__NZv19",link:"index_link__CK-1F",title:"index_title__Yx5LH"};var E=n(45263);function _(t){var e=t.content,n=t.btnContent,r=t.btnLink,c=t.newTab,i=t.hideBtn;return(0,E.jsxs)("div",{className:o()("flex flex-row justify-between items-center",d.container),children:[(0,E.jsx)("div",{className:d.title,children:e}),n&&r&&!i&&(0,E.jsx)("div",{onClick:()=>{c?(0,l.bA)(r):(0,l.Kk)(r)},children:(0,E.jsx)(a.Z,{className:d.link,size:a.Z.SIZE.sm,children:n})})]})}function T(t,e){var n=t.status,c=t.hideBtn;if(n===s.jG.SUCCESS){var o=e[s.jG.SUCCESS];o&&i.Z.success({title:(0,E.jsx)(_,(0,r.Z)({},o)),showClose:!0,duration:5})}else if(n===s.jG.FAIL){var a=e[s.jG.FAIL];a&&i.Z.error({title:(0,E.jsx)(_,(0,r.Z)({hideBtn:c},a)),showClose:!0,duration:5})}else if(n===s.jG.SUBMITED){var l=e[s.jG.SUBMITED];l&&i.Z.info({title:(0,E.jsx)(_,(0,r.Z)({},l)),showClose:!0,duration:5})}else if(n===s.jG.BROADCAST_SUCCESS){var d=e[s.jG.BROADCAST_SUCCESS];d&&i.Z.info({title:(0,E.jsx)(_,(0,r.Z)({},d)),showClose:!0,duration:5})}}},82148:(t,e,n)=>{n.d(e,{I:()=>r});var r={renderError:"render error",jsError:"jsError",apiError:"statusFunc",ssrError:"ssrError",hydrateError:"hydrateError",imgLoadError:"image load fail",tradeError:"nft-transaction-error",apiTime:"apiTime",utxoEmpty:"utxos is empty",jsbError:"jsBridge Error",initwalleFailed:"init wallet failed",checkWalletLinkFailed:"check wallet link"}},97505:(t,e,n)=>{n.d(e,{Z:()=>c});var r="/priapi/v1/nft";const c={GET_SIGN_DATA:"".concat(r,"/user/sign"),LOGIN:"".concat(r,"/user/login"),GET_USER_INFO:"".concat(r,"/user/info"),MOD_USER_INFO:"".concat(r,"/user/info"),GET_MY_CREATD:"".concat(r,"/created"),GET_MY_OWNED:"".concat(r,"/owned"),NFT_METADATA:"".concat(r,"/metadata"),NFT_UPLOADREOURCE:"".concat(r,"/uploadReource"),NFT_FIRSTFRAME:"".concat(r,"/firstFrame"),MARKET:"".concat(r,"/secondary/market"),PROJECT:"".concat(r,"/projects"),NFT_DETAIL:"".concat(r,"/detail-info"),NFT_OWNERS:"".concat(r,"/owners"),NFT_TRADE_HISTORY:"".concat(r,"/trading/v2/history"),REPORT_SELL_TX:"".concat(r,"/sale/tx"),NFT_PRICE_HISTORY:"".concat(r,"/orderGraph"),CURRENCY_RATE:"".concat(r,"/get-currencyRate"),PRIMARY_LIST:"".concat(r,"/primary/activities"),LAUNCHPAD_BANNER:"".concat(r,"/primary/getLaunchpadHeadList"),LAUNCHPAD_LIST:"".concat(r,"/primary/getLaunchpadList"),LAUNCHPAD_CATEGORY_LIST:"".concat(r,"/primary/getLaunchpadSecList"),LAUNCHPAD_APPLY_ISSURE:"".concat(r,"/primary/toBeIssuer"),LUNCHPAD_SUBSCRIBEUSER:"".concat(r,"/primary/subscribed/subscribeUser"),PRIMARY_NFT_DETAIL:"".concat(r,"/primary/activity-detail"),NFT_BID_OFFER:"".concat(r,"/primary/bids-history-archive"),GET_BANNER_SLIDER:"/v2/support/home/standard/infoSearch",GET_COUNT_OVER_ACT:"".concat(r,"/countOverAct"),GET_ACTIVITY_SIGN:"".concat(r,"/primary/activitySign"),USER_SUBSCRIBE:"".concat(r,"/primary/userSubscribe"),HAS_COLLECTION:"".concat(r,"/primary/hasCollect"),COLLECTION_USERINFO:"".concat(r,"/primary/collectUserInfo"),LAUNCHPAD_SUBSCRIBED_TASK:"".concat(r,"/primary/subscribed/getSubscribeTask"),LAUNCHPAD_INFO:"".concat(r,"/primary/subscribed/getInfo"),LAUNCHPAD_DISCONNECT:"".concat(r,"/oauth2/disconnectLink"),LAUNCHPAD_CALLBACK:"".concat(r,"/oauth2/callBack"),LAUNCHPAD_TASK_SUBMIT:"".concat(r,"/primary/subscribed/taskSubmit"),LAUNCHPAD_TASK_VERIFY:"".concat(r,"/primary/subscribed/taskValidate"),HAS_AIRDROP:"".concat(r,"/primary/hasAirdrop"),LAUNCHPAD_APPROVE_URL:"".concat(r,"/oauth2/oauth2Url"),AIRDROP:"".concat(r,"/primary/airdrop"),NFT_ORDER:"".concat(r,"/orders"),MARKET_SEARCH_LIST:"".concat(r,"/secondary/market-predict"),MARKET_COLLECTIONS:"".concat(r,"/market/secondary/market-project-predict"),MARKET_SEARCH_COLLECTIONS:"".concat(r,"/market/secondary/search/collections"),MARKET_HOT_LIST:"".concat(r,"/hotProjects"),MARKET_SEARCH_PROJECT:"".concat(r,"/searchProject"),REFRESH:"".concat(r,"/refresh"),NFT_OFFER:"".concat(r,"/offers"),NFT_OFFER_CANCEL:"".concat(r,"/cancel/offer"),CHECK_BY_TX_HASH:"".concat(r,"/order/checkTxHash"),CHECK_ORDER:"".concat(r,"/order/check"),TRADE_DATA:"".concat(r,"/market/nftTradingData"),PROJECT_ATTRIBUTES:"".concat(r,"/market/projectAttributes"),MINT_GET_TOKEN_ID:"".concat(r,"/primary/get-valid-tokenid"),MINT_JUEDE_TOKEN_ID:"".concat(r,"/primary/judge-tokenid-valid"),MINT_RESULT:"".concat(r,"/primary/mint-result"),UPDATE_MINT_COUNT:"".concat(r,"/primary/updateMintCount"),MINT_PROGRESS:"".concat(r,"/primary/mint-progress"),IMX_RECORD:"".concat(r,"/order/imxListRecord"),MAKE_OKX_SEAPORT_OFFER:"".concat(r,"/order/okx-nft/seaport/makeOffer"),MAKE_OKX_SEAPORT_ORDER:"".concat(r,"/order/okx/seaport/makeOrder"),COLLECTION_OFFER_DIALOG_INFO:"".concat(r,"/order/makeColOrderWindow"),MULTI_LISTING_PLATFORMS:"".concat(r,"/order/multi-listings/platforms"),LIMIT_PRICE_SELL:"".concat(r,"/orderbook/limit-price-sell"),MARKET_PRICE_SELL:"".concat(r,"/orderbook/market-price-sell"),MARKET_PRICE_BUY:"".concat(r,"/orderbook/market-price-buy"),MARKET_FILTER_LIST:"".concat(r,"/market/platforms"),MAERKET_CURRENCIES:"".concat(r,"/market/currencies"),MARKET_COLLECTIONS_FILTER:"".concat(r,"/market/collections"),LIMIT_PRICE_BUY:"".concat(r,"/orderbook/limit-price-buy"),ORDER_BOOK:"".concat(r,"/orderbook"),QUERY_OWNED_NFTS:"".concat(r,"/orderbook/ownedNFTs"),NFT_AUDITMINTIMAGE:"".concat(r,"/machineAuditMintImage"),MINT_TEXT_REVIEW:"".concat(r,"/creation/textReview"),BTC_NFT_TYPES:"".concat(r,"/market/contentTypes"),CREATION_CHAIN:"".concat(r,"/creation-chain"),EXCEED_LIMIT:"".concat(r,"/creation/exceedLimit"),BTC_NFT_PENDING_NUM:"".concat(r,"/secondary/project/btcNftPendingCount"),COLLECTION_CREATED:"".concat(r,"/project/creation-page/add-pc"),COLLECTION_LIST:"".concat(r,"/project/creation-page/list"),COLLECTION_MIGRATION_LIST:"".concat(r,"/project/migration/list"),COLLECTION_CHECK_COLLECT:"".concat(r,"/project/check-collect"),COLLECTION_COLLECT:"".concat(r,"/project/collect"),COLLECTION_CANCEL_COLLECT:"".concat(r,"/project/cancel-collect"),COLLECTION_COLLECT_LIST:"".concat(r,"/project/collect-list"),COLLECTION_CATEGORY_LIST:"".concat(r,"/project/category/list"),TRANSFER_COLLECTION:"".concat(r,"/project/creation-page/transfer-pc"),ORDERS_REQUEST_DATA:"".concat(r,"/order/query/order/data"),PENDING_INFO:"".concat(r,"/getPendingInfo"),LOOT:"".concat(r,"/ownedLoots"),BLOOT:"".concat(r,"/ownedBloots"),K_LOOT:"".concat(r,"/ownedKloots"),REEDEM_LOOT:"".concat(r,"/officialLoots"),BLINDBOX_RESULT:"".concat(r,"/primary/blindBox-result"),BLINDBOX_REQUEST_ID:"".concat(r,"/primary/blindBox/transferReqId"),LOTTERY_COLLECTION:"".concat(r,"/primary/activity-nftList"),OFFERED:"".concat(r,"/offered"),OFFERED_PROJECT:"".concat(r,"/project/offered"),OFFER_STATUS:"".concat(r,"/offerEntrance"),OFFER_READ:"".concat(r,"/readOffer2Flag"),INACTIVE_ORDER:"".concat(r,"/getInactiveOrder"),PUNK_CLAIM:"".concat(r,"/punks/claim/bath"),TOP_PROJECTS:"".concat(r,"/topProjects"),FEATUTRE_CHAINS:"".concat(r,"/getFeatureChains"),HOME_PAGE_MINTING:"".concat(r,"/stats/featured-top-mints"),POPULAR_NFTS:"".concat(r,"/popularNfts"),SWITCH_FAV:"".concat(r,"/collect"),NFT_FAV_LIST:"".concat(r,"/listCollect"),NFT_OFFER_NEW:"".concat(r,"/offerEntrance"),ORDER_LISTINGS:"".concat(r,"/orderCenter/listings"),ORDER_DEALS:"".concat(r,"/myOrder"),PROJECT_RANK:"".concat(r,"/project-rank"),GET_RANK_CHAINS:"".concat(r,"/getRankChains"),GET_FAQS_LIST:"".concat(r,"/feature/faqs"),GET_FEATURE_BANNER:"".concat(r,"/featureBanner"),GET_FEATURE_CREATE:"".concat(r,"/createConfig"),NFT_CURVE:"".concat(r,"/nft-curve"),GET_RECENT_ROCKETS:"".concat(r,"/get-recentRockets"),ASSERT_RISK:"".concat(r,"/detail/assertRisk"),QUERY_COLLECTION_ORDER_DADA:"".concat(r,"/order/query/collection/offer/fulfill/data"),GAS_PRICE:"/priapi/v1/wallet/web/gas/gas_price",GET_BALANCE:"/priapi/v1/wallet/web/asset/single/token",GET_XVERSE_BALANCE:"/priapi/v1/wallet/web/asset/single/tokenByAddress",ORDER_CHECK:"".concat(r,"/cart/orders/check"),BEST_OFFER:"".concat(r,"/cart/v2/best-orders"),ORDERS_CONFIG:"".concat(r,"/cart/orders/config"),NFT_CHECK:"".concat(r,"/checkout/nfts"),TRADE_ENCODE_INFOS_BY_ORDERS:"/priapi/v1/nft/abi/encode/trade",TRADE_BUY_BY_ORDERS:"/priapi/v1/nft/trading/buy",TRADE_ACCEPT_OFFER_BY_ORDERS:"/priapi/v1/nft/trading/sell",RPC_SEND_PATH:"/priapi/v1/wallet/rpc/url",GET_UTXOS:"/priapi/v1/wallet/tx/utxo",PRE_EXECUTE_TRADE:"/priapi/v1/wallet/tx/txToastCheck",TRADE_CANCEL_BY_ORDERS:"/priapi/v1/nft/trading/cancel",TRADE_TRANSFER:"/priapi/v1/nft/trading/transfer",GET_BTC_NETWORK_FEE:"/v1/deposit/plugin/coin/{{coinId}}/address/{{address}}/signInfo",GET_BTC_TX_STATUS:"/priapi/v1/nft/btc/transaction/status",BRC_MAKE_ORDER:"".concat(r,"/brc/okx/makeOrders"),BTC_MAKE_ORDER:"".concat(r,"/btc/okx/makeOrders"),TRADE_SUI_BUY:"/priapi/v1/nft/trading/sui/buy",TRADE_SUI_CREATE_LISTING:"/priapi/v1/nft/trading/sui/createListing",TRADE_SUI_CANCEL:"/priapi/v1/nft/trading/sui/cancel",TRADE_SUI_TRANSFER:"/priapi/v1/nft/trading/sui/transfer",BTC_BROADCAST_TRADE:"/priapi/v1/nft/pcBtcSaveTx",BROADCAST_TRADE:"/priapi/v1/nft/pcOpListSubmit",GET_TX_RESULT:"/priapi/v1/nft/tx/result",TENSOR_BUY_INSTRUCTIONS:"".concat(r,"/tswap/instructions/buySingleListingTx"),TENSOR_CANCEL_INSTRUCTIONS:"".concat(r,"/tswap/instructions/delistTx"),TENSOR_SELL_INSTRUCTIONS:"".concat(r,"/tswap/instructions/listTx"),TENSOR_UPDATE_PRICE_INSTRUCTIONS:"".concat(r,"/tswap/instructions/editSingleListingTx"),MAKE_OFFER:"/priapi/v1/nft/order/makeOffer",OFFER_LIST:"/priapi/v1/nft/order/offers",MAKE_ORDER:"/priapi/v1/nft/order/makeOrder",ORDER_LIST:"/priapi/v1/nft/order/pc/orders",UPDATE_ORDER_PRICE:"/priapi/v1/nft/order/updateOrderPrice",TRADE_FEE:"".concat(r,"/order/tradeFees"),NFT_Trade:"/priapi/v1/nft/order/tradeFees",NFT_Trade_hidden:"/priapi/v1/nft/order/hideOffer",SUBMIT_AUDIT:"/priapi/v1/nft/order/submitAudit",SOURCE_PRICE:"".concat(r,"/order/getEachSourcePrice"),SUPPORT_CURRENCY_LIST:"".concat(r,"/batch/getSupportCurrencyList"),LIST_PROJECT_CATE:"".concat(r,"/listProjectCate"),LIST_PROJECT:"".concat(r,"/listProject"),REPORT_OTHER_TX:"".concat(r,"/order/osPurchase"),HOT_SEARCH_TERM:"".concat(r,"/market/secondary/hot-search-term"),SEARCH_RECORD:"".concat(r,"/market/secondary/search-record"),COLLECTION_INFO:"".concat(r,"/secondary/project/detail"),COLLECTION_INFO_OTHER:"".concat(r,"/project/stats"),COLLECTION_QUESTIONS:"".concat(r,"/secondary/project/projectFAQ"),ACTIVITY_KLINE_DATA:"".concat(r,"/trading/getKlines"),ANALYTICS_TRADES_FLOOR_PRICE:"".concat(r,"/stats/collection/prices"),ANALYTICS_LISTING_OWNERS:"".concat(r,"/analytics/listed-owners"),ANALYTICS_PRICE_DISTRIBUTION:"".concat(r,"/analytics/price-distribution"),ANALYTICS_SOCIAL_MEDIA:"".concat(r,"/analytics/social-media"),ANALYTICS_MARKET:"".concat(r,"/analytics/order_sources"),ANALYTICS_SALES:"".concat(r,"/stats/collection/sale_points"),ANALYTICS_SALES_LIST:"".concat(r,"/stats/collection/sales"),ANALYTICS_OWNER:"".concat(r,"/analytics/owns"),NFT_COLLECTION_HISTORY:"".concat(r,"/trading/collectionHistory"),COLLECTION_ROYALTY_SIGN:"/priapi/v1/nft/project/taxSign",IMX_TRADE_RECORD:"".concat(r,"/order/imxTradeRecord"),GET_PLATEFORM_FEES:"".concat(r,"/order/getPlatformFees"),SOLANA_META_DATA:"".concat(r,"/sol/on-chain/metadata"),NFT_OPERATE_SUBMIT:"".concat(r,"/opSubmit"),NFT_OPERATE_LIST_SUBMIT:"".concat(r,"/opListSubmit"),GET_ME_BUY_INSTRUCTION:"".concat(r,"/me/instructions/buy-now"),GET_ME_CANCEL_SELL_INSTRUCTION:"".concat(r,"/me/instructions/sell-cancel"),GET_ME_UPDATE_PRICE_INSTRUCTION:"".concat(r,"/me/instructions/sell-change-price"),GET_ME_SELL_INSTRUCTION:"".concat(r,"/me/instructions/sell"),CHECK_ME_LISTING:"".concat(r,"/me/listings/check"),MOCK_PUSH:"".concat(r,"/mockPush"),MOCK_PENDING_PUSH:"".concat(r,"/mockPendingPush"),GET_LOOKSRARE_NONCE:"".concat(r,"/order/looksrare/nonce"),LISTING_LOOKRARE:"".concat(r,"/order/looksrare/listings"),MULTI_LISTINGS:"".concat(r,"/order/multi-listings"),BATCH_LISTINGS:"".concat(r,"/batch/multi-listings"),CREATE_LISTING:"".concat(r,"/trading/createListing"),CREATE_COLLECTION_OFFER:"".concat(r,"/trading/createCollectionOffer"),CREATE_OFFER:"".concat(r,"/trading/createOffer"),LISTING_OPENSEA:"".concat(r,"/order/opensea/listings"),LISTING_OPENSEA_ROYALTY:"".concat(r,"/order/query/royalty"),CHECK_IMX_ADDRESS:"".concat(r,"/order/imxUserCheck"),X2Y2_CANCEL_DATA:"".concat(r,"/order/x2y2/cancelData"),X2Y2_SIGN_DATA:"".concat(r,"/order/x2y2/signData"),OWNED_COLLECTED_NFTS:"".concat(r,"/personal/personalCount"),OWNED_EXIST_NFTS:"".concat(r,"/personal/owned/exist"),COLLECTED_NFTS:"".concat(r,"/personal/owned/nft-list"),COLLECTED_CLAIM_NFTS:"".concat(r,"/personal/pendingClaimAssets"),COLLECTED_CLAIM_COLLECTION:"".concat(r,"/personal/pendingClaimNftCollections"),COLLECTIONS_NFTS:"".concat(r,"/personal/queryCollectedCollections"),CREATED_NFTS:"".concat(r,"/personal/queryCreatedNfts"),CREATED_COLLECTIONS:"".concat(r,"/personal/queryCreatedProjects"),PERSON_ACTIVITY:"".concat(r,"/personal/queryPersonalTxLogs"),COLLECTED_COLLECTION_VIEW:"".concat(r,"/personal/owned/collection-list"),COLLECTED_COLLECTION_ALL:"".concat(r,"/personal/owned/stats"),COLLECTION_VIEW:"".concat(r,"/personal/queryCollectionView"),PUNKS_CLAIM:"".concat(r,"/punks/claim/bath"),CLAIM_ORDER_PAGE:"".concat(r,"/punks/claimOrderPage"),HIDE_NFTS:"".concat(r,"/personal/multiAddressHideNfts"),UNHIDE_NFTS:"".concat(r,"/personal/multiAddressUnhideNfts"),WALLET_HAS_JOIN:"".concat(r,"/apt/activity/wallet-has-join"),SIGN_UP:"".concat(r,"/apt/activity/sign-up"),TX_COUNT_PAGE:"".concat(r,"/apt/activity/tx-count-page"),COLLECTION_PAGE:"".concat(r,"/apt/activity/collection-page"),ACTIVITY_HAS_BEGIN:"".concat(r,"/apt/activity/activity-has-begin"),NFT_Total:"".concat(r,"/get-nftTotal"),OVERVIEW_TOP_TITLE:"".concat(r,"/overview/top-title"),OVERVIEW_MARKET_CAP_VOLUME:"".concat(r,"/overview/marketCap-volume"),OVERVIEW_HOLDER_TRADER:"".concat(r,"/overview/holder-trader"),OVERVIEW_TOP_PERCENTAGE:"".concat(r,"/overview/top-percentage"),TOP_MINTS:"".concat(r,"/stats/top-mints"),UPCOMING_RAMKING:"".concat(r,"/upcoming/project"),FAVORITE_LIST:"".concat(r,"/personal/favorite/collection-list"),IMPORT_FAVORITE_FILE:"".concat(r,"/project/importCollection-rankings"),WHALE_LIST:"".concat(r,"/upcoming/whaleInfo-list"),NFT_FEES:"".concat(r,"/order/query/nftFees"),ORDER_FEES:"".concat(r,"/order/query/orderFees"),CHAIN_INFOS:"".concat(r,"/market/chains"),ACTIVITY_CURRENCIES:"".concat(r,"/market/collectionHistory-currencies"),DOMAIN_ADDRESS:"".concat(r,"/domainName/address"),RECENT_ADDRESS:"".concat(r,"/recentTransferAddress"),ENCODE_TRADE:"".concat(r,"/abi/encode/trade"),HIGH_LIGHT_PROJECTS:"".concat(r,"/marketHighlight"),BATCH_TRANSFER_QUERY:"".concat(r,"/query/batch/transfer/result"),CHAIN_PUSH_STATUS:"".concat(r,"/getOffChainPushStatus"),ORDINALS_TOKEN_DETAIL:"".concat(r,"/brc/tokens"),ORDINALS_TOKEN_DETAIL_ITEMS:"".concat(r,"/brc/detail/items"),SEARCH_RESULT_BRC20:"".concat(r,"/brc/tokens"),BRC_OWNER_LIST:"".concat(r,"/brc/owner/nfts"),BRC_20_LIST:"".concat(r,"/brc/tokens"),ORDINALS_ANALYTICS_TRADES:"".concat(r,"/brc/detail/analytics/trades"),ORDINALS_ANALYTICS_OWNERS:"".concat(r,"/brc/detail/analytics/owners"),ORDINALS_MY_ORDER:"".concat(r,"/brc/detail/myItems"),ORDINALS_MY_ORDER_DETAIL:"".concat(r,"/brc/detail/myItem"),DETAIL_ACTIVITY:"".concat(r,"/brc/detail/activity"),ORDINALS_BALANCE:"".concat(r,"/brc/balance"),ORDINALS_LISTING_MAX_VALUE:"".concat(r,"/brc/listing/maximumValue"),BRC20_COLLECT:"".concat(r,"/brc/collect"),BRC_20_COLLECTED_LIST:"".concat(r,"/brc/collect-list"),BRC_20_IS_DEPLOYED:"".concat(r,"/brc/brc20/deployed"),BRC20_TOKENS_DETAIL:"".concat(r,"/brc/detail/coinIdInfo"),BRC20_MIN_UTXO:"".concat(r,"/btc/dust/check/minOutputValue"),UTXO_NFTS:"".concat(r,"/btc/inscriptions/utxo/details"),ORDINALS_BANNER:"".concat(r,"/primary/getOrdinalsHeadList"),TRADE_CONFIG:"".concat(r,"/inscription/okx/trade/config"),INSCRIBE_MY_APPLY:"".concat(r,"/btc/collect/record"),INSCRIBE_TWITTER:"".concat(r,"/btc/collect/getInfo"),INSCRIBE_BIND:"".concat(r,"/oauth2/callBack/btcCollect"),INACTIBE_DELETE:"".concat(r,"/btc/collect/delete"),BRC_20_ORDER:"".concat(r,"/brc/transferables"),BTC_NFT_LIST:"".concat(r,"/btc/collection/items"),CREATED_NFT_LIST:"".concat(r,"/personal/created/nft-list"),FAVORITE_NFT_LIST:"".concat(r,"/personal/favorite/nft-list"),INSCRIBING_LIST:"".concat(r,"/btc/inscribe/order/history"),INSCRIBE:"".concat(r,"/btc/inscribe/tx/pc"),INSCRIBING_DETAIL:"".concat(r,"/btc/inscribe/order/detail"),INSCRIBE_CONFIG:"".concat(r,"/btc/inscribe/config"),CHECK_BTC_DUST:"".concat(r,"/btc/dust/check"),UPDATE_ROYALTY:"".concat(r,"/project/updateRoyalty"),GET_ROYALTY_SIGNATURE:"".concat(r,"/project//getRoyaltySignature"),CHECK_ADDRESS:"".concat(r,"/ownerAddressCheck"),COLLECTION_ADD:"".concat(r,"/btc/collect/add-record"),COLLECTION_UPDATE:"".concat(r,"/btc/collect/update-record"),COLLECTION_DETAIL:"".concat(r,"/btc/collect/detail")}},85658:(t,e,n)=>{n.d(e,{Z:()=>C});var r=n(1413),c=n(60378),o=n(14300),a=n(75833),i=n.n(a),s=n(45271),l=n(28096),d=n(82148),E=n(2126);function _(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,r.Z)((0,r.Z)({nft_token:l.Z.getNftTokenFromStorage()},t),(0,c.y)()?{"App-Type":"web"}:{})}var T=t=>{var e=Date.now();return n=>{var a,i=Date.now()-e;(function(t){if(t<0||t>100)throw new Error("Percentage must be between 0 and 100");return 100*Math.random()<=t})(10)&&(0,s.Pp)({key:d.I.apiTime,extra:{c1:null===n||void 0===n||null===(a=n.config)||void 0===a?void 0:a.url.split("?")[0],c2:i}});return function(t,e){var n=(t||{}).data,a=void 0===n?{}:n;if(a&&0===Number(a.code)){var i=a;return!(0,c.y)()&&e&&(i=(0,E.N2)(i)),Promise.resolve(i)}if(a&&4001===Number(a.code)&&l.Z.removeToken(),!(0,c.y)()){var _,T,u,I,C=null===t||void 0===t||null===(_=t.config)||void 0===_?void 0:_.url,R=(null===t||void 0===t||null===(T=t.config)||void 0===T?void 0:T.data)||(null===t||void 0===t||null===(u=t.config)||void 0===u?void 0:u.params),v=null===(I=t.headers)||void 0===I?void 0:I["x-nft-trace-id"];(0,s.H)(d.I.apiError,(0,r.Z)((0,r.Z)({},a),{},{url:C,queryData:R,nftTraceId:v}))}var p=(0,r.Z)((0,r.Z)({},a),{},{error_message:a.error_message||(0,o.O4)("nftmarket_notif_comm_server_error"),msg:a.msg||(0,o.O4)("nftmarket_notif_comm_server_error")});return Promise.reject(p)}(n,t)}};function u(t){var e=t||{},n=e.status,r=e.data,c={status:n||"",code:n||"",msg:(null===r||void 0===r?void 0:r.msg)||(0,o.O4)("nftmarket_notif_comm_server_error"),message:(null===r||void 0===r?void 0:r.msg)||(0,o.O4)("nftmarket_notif_comm_server_error")};return Promise.reject(c)}var I=t=>{var e,n=t.pendingRequests,r=t.method,o=t.url,a=t.isNeedCancel,i=new AbortController,s=i.signal,l="".concat((e={method:r,url:o}).method,"-").concat(e.url);return!(0,c.y)()&&a&&n.has(l)&&n.get(l).abort(),n.set(l,i),{requestId:l,signal:s,controller:i}};const C=(()=>{var t={},e=new Map,n={get:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},c=(0,r.Z)((0,r.Z)({params:e},n),{},{headers:_(n&&n.headers||{})}),o=T();return i().get(t,(0,r.Z)({},c)).catch(u).then(o)},getXss:function(t,n){var c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=((arguments.length>3?arguments[3]:void 0)||{}).isNeedCancel,a=I({pendingRequests:e,method:"postXss",url:t,isNeedCancel:o}),s=a.requestId,l=a.signal,d=(0,r.Z)((0,r.Z)({params:n},c),{},{headers:_(c&&c.headers||{}),signal:l}),E=T(!0);return i().get(t,(0,r.Z)({},d)).catch(u).then(E).finally((()=>{e.delete(s)}))},getWithCache:(t,e)=>{var n=T();return i().getWithCache(t,{params:e}).catch(u).then(n)},post:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},c=(0,r.Z)((0,r.Z)({},n),{},{headers:(0,r.Z)({},_(n.headers))}),o=T();return i().post(t,e,c).catch(u).then(o)},postXss:function(t,n){var c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=((arguments.length>3?arguments[3]:void 0)||{}).isNeedCancel,a=I({pendingRequests:e,method:"postXss",url:t,isNeedCancel:o}),s=a.requestId,l=a.signal,d=(0,r.Z)((0,r.Z)({},c),{},{headers:(0,r.Z)({},_(c.headers)),signal:l}),E=T(!0);return i().post(t,n,d).catch(u).then(E).finally((()=>{e.delete(s)}))},postForm:function(e,c){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=new FormData;return Object.entries(c||{}).forEach((t=>{a.append(t[0],t[1])})),n.post(e,a,(0,r.Z)({headers:t},o))},delete:(t,e)=>{var n=T();return i().delete(t,e).catch(u).then(n)}};return n})()},91002:(t,e,n)=>{n.d(e,{Z:()=>r});const r={copy:function(t){var e=function(t){var e=document.createElement("textarea");e.style.fontSize="12pt",e.style.border="0",e.style.padding="0",e.style.margin="0",e.style.position="absolute",e.style.left="-9999px";var n=window.pageYOffset||document.documentElement.scrollTop;return e.style.top="".concat(n,"px"),e.setAttribute("readonly",""),e.value=t,e}(t);document.body.appendChild(e),e.select();var n=function(t){try{return document.execCommand(t)}catch(e){return!1}}("copy");return e.remove(),n}}},45271:(t,e,n)=>{n.d(e,{H:()=>f,KT:()=>S,PN:()=>O,Pp:()=>R,no:()=>h});var r=n(45987),c=n(29439),o=n(1413),a=n(60378),i=n(46430),s=n(4422),l=n(1708),d=n(82148),E=["scene","error","orderInfo","orderList","nftInfo","from","to","nftList","platform","collectionInfo","key"],_=["scene","orderInfo","orderList","nftInfo","from","to","nftList","platform","collectionInfo","tradeData"],T={USER_DENIED:4001,INTERNAL_ERROR:-32603},u=t=>JSON.stringify(t).replace(/"/g,""),I=()=>{if((0,a.y)())return"";var t=i.Z.get("connectedAccount")||{};return{walletType:null===t||void 0===t?void 0:t.walletType}},C=()=>{var t,e,n;return(0,a.y)()?"":null===(t=window)||void 0===t||null===(e=t.okxwallet)||void 0===e||null===(n=e.getVersion)||void 0===n?void 0:n.call(e)},R=t=>{var e=t.key,n=t.extra,r=t.reportData,c=e.replace(/ /g,"_"),i={metric_name:"nft_".concat(c),type:"customize",extra:n||{c5:(0,a.y)()?"ssr":"csr"}};r&&(i=(0,o.Z)((0,o.Z)({},r),i)),s.k.info("nft_".concat(c),i)},v=()=>{var t=[I(),(0,a.y)()?"":l.Z.getWalletAccount(),C()];return Promise.all(t)},p=t=>{var e=t.orderInfo,n=t.nftInfo,r=t.orderList,c=t.nftList,o=e.source,a=e.id,i=n.tokenId,s=n.contractAddress,l=n.chain,d=[{orderInfo:{source:o,orderId:a,chain:null===e||void 0===e?void 0:e.chain},nftInfo:{tokenId:i,contractAddress:s,chain:l}}];return r.length&&(d=(t=>t.map((t=>({orderList:{source:null===t||void 0===t?void 0:t.source,orderId:null===t||void 0===t?void 0:t.orderId,chain:null===t||void 0===t?void 0:t.chain},nftInfo:{tokenId:(null===t||void 0===t?void 0:t.nftInfo.tokenId)||(null===t||void 0===t?void 0:t.tokenId),contractAddress:(null===t||void 0===t?void 0:t.nftInfo.contractAddress)||(null===t||void 0===t?void 0:t.contractAddress),chain:(null===t||void 0===t?void 0:t.nftInfo.chain)||(null===t||void 0===t?void 0:t.chain)}}))))(r)),c.length&&(d=(t=>t.map((t=>({orderList:{},nftInfo:{tokenId:null===t||void 0===t?void 0:t.tokenId,contractAddress:null===t||void 0===t?void 0:t.contractAddress,chain:null===t||void 0===t?void 0:t.chain}}))))(c)),d},A=t=>v().then((e=>{var n,r,a,i=(0,c.Z)(e,3),s=i[0].walletType,l=i[1],d=i[2];return{baseInfo:{address:l,scene:null===t||void 0===t?void 0:t.scene,tx:null===t||void 0===t?void 0:t.txnHash,t:+new Date,code:null===t||void 0===t?void 0:t.code,url:null===t||void 0===t?void 0:t.url,e:(null===t||void 0===t?void 0:t.msg)||(null===t||void 0===t?void 0:t.message)||(null===t||void 0===t?void 0:t.error_message),v:null===(n=window)||void 0===n||null===(r=n.__INIT_STATE__)||void 0===r||null===(a=r.appContext)||void 0===a?void 0:a.version},reportData:(0,o.Z)({walletType:s,walletVersion:d},t)}})).catch((()=>{})),h=t=>{var e=t.scene,n=t.error,a=void 0===n?{}:n,i=t.orderInfo,l=void 0===i?{}:i,_=t.orderList,I=void 0===_?[]:_,C=t.nftInfo,A=void 0===C?{}:C,h=t.from,S=t.to,O=t.nftList,f=void 0===O?[]:O,N=t.platform,L=t.collectionInfo,m=void 0===L?{}:L,D=t.key,g=void 0===D?"nft transaction error":D,k=(0,r.Z)(t,E);if(!Object.values(T).includes(null===a||void 0===a?void 0:a.code)){var b=p({orderInfo:l,orderList:I,nftInfo:A,nftList:f});v().then((n=>{var r,i,l,E,_,T,I,C=(0,c.Z)(n,3),v=C[0].walletType,p=C[1],A=C[2],O={address:p,scene:e,t:+new Date,tx:null===t||void 0===t?void 0:t.txnHash,e:(null===a||void 0===a?void 0:a.msg)||(null===a||void 0===a?void 0:a.message)||(null===a||void 0===a?void 0:a.error_message),v:null===(r=window)||void 0===r||null===(i=r.__INIT_STATE__)||void 0===i||null===(l=i.appContext)||void 0===l?void 0:l.version},f=(0,o.Z)({scene:e,error:a,tradeList:b,chain:null===(E=b[0])||void 0===E||null===(_=E.nftInfo)||void 0===_?void 0:_.chain,to:S,from:h,platform:N,collectionInfo:{contractAddress:null===m||void 0===m?void 0:m.contractAddress},walletType:v,walletVersion:A},k);s.k.error("".concat(g," - ").concat(u(O)),f),R({key:d.I.tradeError,extra:{c1:(null===a||void 0===a?void 0:a.msg)||(null===a||void 0===a?void 0:a.message)||(null===a||void 0===a?void 0:a.error_message),c2:null===(T=b[0])||void 0===T||null===(I=T.nftInfo)||void 0===I?void 0:I.chain,c3:e},reportData:f})})).catch((()=>{}))}},S=t=>{var e=t.scene,n=t.orderInfo,a=void 0===n?{}:n,i=t.orderList,l=void 0===i?[]:i,d=t.nftInfo,E=void 0===d?{}:d,T=t.from,I=t.to,C=t.nftList,R=void 0===C?[]:C,A=t.platform,h=t.collectionInfo,S=void 0===h?{}:h,O=t.tradeData,f=(0,r.Z)(t,_),N=p({orderInfo:a,orderList:l,nftInfo:E,nftList:R});v().then((n=>{var r,a,i,l,d,E=(0,c.Z)(n,3),_=E[0].walletType,C=E[1],R=E[2],v={address:(null===t||void 0===t?void 0:t.address)||C,scene:e,t:+new Date,tx:null===t||void 0===t?void 0:t.txnHash,action:null===t||void 0===t?void 0:t.action,v:null===(r=window)||void 0===r||null===(a=r.__INIT_STATE__)||void 0===a||null===(i=a.appContext)||void 0===i?void 0:i.version},p=(0,o.Z)({scene:e,tradeList:N,chain:null===(l=N[0])||void 0===l||null===(d=l.nftInfo)||void 0===d?void 0:d.chain,to:I,from:T,platform:A,collectionInfo:{contractAddress:null===S||void 0===S?void 0:S.contractAddress},walletType:_,walletVersion:R,tradeData:O},f);s.k.info("nft transaction action - ".concat(u(v)),p)})).catch((()=>{}))},O=(t,e)=>{A(e).then((e=>{var n=e.baseInfo,r=e.reportData;s.k.info("nft ".concat(t," - ").concat(u(n)),r)})).catch((()=>{}))},f=(t,e)=>{A(e).then((e=>{var n=e.baseInfo,r=e.reportData;s.k.error("nft ".concat(t," - ").concat(u(n)),r),R({key:t,reportData:r,extra:{c1:r.url.split("?")[0]}})})).catch((()=>{}))}},4241:(t,e,n)=>{n.d(e,{Z:()=>C});var r,c=n(1413),o=n(74165),a=n(15861),i=n(53949),s=n(60378),l=n(1708),d=n(40910),E=n(84711),_=n(16650),T=n(68566);class u extends T.Z{constructor(){if(super(u.connectUrl),this.SUBSCRIPTION_OP={login:"login",subscribe:"subscribe",unsubscribe:"unsubscribe"},this.channel="nft-operate",this.eventHandlers={},this.processedData={},u.instance)return u.instance;u.instance=this,this.setDataResolver(null,this.subscribeDataResolver.bind(this))}handleConnected(){var t=this;return(0,a.Z)((0,o.Z)().mark((function e(){return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.walletSubscription();case 2:case"end":return e.stop()}}),e)})))()}subscribeDataResolver(t){var e=this;return(0,a.Z)((0,o.Z)().mark((function n(){var r,a,i,s,E,_,T,u,I,C,R,v,p,A;return(0,o.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(r=t.arg,a=(void 0===r?{}:r).channel,i=void 0===a?"":a,s=t.data,i!==e.channel||!s){n.next=11;break}return E=s.scene,_=s.txHash,T=s.status,u=s.batchTxState,I=s.userWalletAddress,C=s.payload,R=_,u&&(R=null===u||void 0===u?void 0:u.batchId),n.next=7,l.Z.getWalletAccount({isNeedAll:!0});case 7:v=n.sent,p=v.split(",").map((t=>t.toLocaleLowerCase())),A=Object.keys(d.jG).map((t=>d.jG[t])),E&&A.includes(T)&&p.includes(I.toLocaleLowerCase())&&e.emit(E,(0,c.Z)((0,c.Z)({},s),{},{txnHash:R,txHash:R,payload:C?JSON.parse(C):{}}));case 11:case"end":return n.stop()}}),n)})))()}walletSubscription(){var t=this;return(0,a.Z)((0,o.Z)().mark((function e(){var n;return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,l.Z.getWalletAccount({isNeedAll:!0});case 2:if(!(n=e.sent)){e.next=8;break}return e.next=6,t.login(n);case 6:return e.next=8,t.subscribe();case 8:case"end":return e.stop()}}),e)})))()}watching(){this.connect(),E.Z.onWalletChange(this.walletSubscription.bind(this))}login(t){var e=t.split(",").map((t=>({token:t}))),n={op:this.SUBSCRIPTION_OP.login,args:e};return new Promise(((t,e)=>{this.setDataResolver(this.SUBSCRIPTION_OP.login,(n=>{"0"==n.code?t():e()})),this.sendChannel(n)}))}subscribe(){var t={op:this.SUBSCRIPTION_OP.subscribe,args:[{channel:this.channel}]};return new Promise(((e,n)=>{this.setDataResolver(this.SUBSCRIPTION_OP.subscribe,(t=>{t.arg?e():n()})),this.sendChannel(t)}))}checkProcessedData(t){var e=t.status,n=t.txHash,r=t.scene;return!!this.processedData["".concat(r,"-").concat(n,"-").concat(e)]}setProcessedData(t){var e=t.status,n=t.txHash,r=t.scene;this.processedData["".concat(r,"-").concat(n,"-").concat(e)]=t}emit(t,e){try{var n=this.eventHandlers[t];Array.isArray(n)&&!this.checkProcessedData(e)&&(n.forEach(((t,r)=>{if(t){var c=t.callback,o=t.params,a=o.txnHash,i=o.once,s=o.status;a&&e.txnHash!=a||Array.isArray(s)&&!s.includes(e.status)||(c(e),i&&(n[r]=null))}})),this.setProcessedData(e))}catch(r){}}on(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=(0,c.Z)({once:!1,txnHash:null,priority:1},n);if(Array.isArray(t))t.forEach((t=>{this.on(t,e,r)}));else if("*"!==t){var o=r.priority;Array.isArray(this.eventHandlers[t])?o<0?this.eventHandlers[t].unshift({callback:e,params:r}):this.eventHandlers[t].push({callback:e,params:r}):this.eventHandlers[t]=[{callback:e,params:r}]}else Object.keys(d.TY).forEach((t=>{this.on(d.TY[t],e,r)}))}off(t,e){if(Array.isArray(t))t.forEach((t=>{this.off(t,e)}));else if("*"!==t){if(Array.isArray(this.eventHandlers[t])){var n=this.eventHandlers[t].findIndex((t=>!!t&&t.callback==e));n>=0&&(this.eventHandlers[t][n]=null)}}else Object.keys(d.TY).forEach((t=>{this.off(d.TY[t],e)}))}checkResult(t,e){var n=e.txnHash;return new Promise((e=>{this.on(t,(t=>{e(t)}),{once:!0,txnHash:n,status:[d.jG.SUCCESS,d.jG.FAIL,d.jG.BROADCAST_SUCCESS]})}))}}u.instance=null,u.connectUrl="".concat(null===i.Z||void 0===i.Z||null===(r=i.Z.socketBaseUrls)||void 0===r?void 0:r.dex,"/ws/v5/iprivate");var I={};(0,s.y)()||(I=new u,Object.keys(d.TY).forEach((t=>{(0,_.ZP)(d.TY[t])&&I.on(d.TY[t],(0,_.ZP)(d.TY[t]))})));const C=I},61219:(t,e,n)=>{n.d(e,{S:()=>_,Z:()=>T});var r=n(74165),c=n(1413),o=n(15861),a=n(41283),i=n(23781),s=n(48635),l=n(20776),d=function(){var t=(0,o.Z)((0,r.Z)().mark((function t(e){var n,o,i,s,E,_,T,u;return(0,r.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.chain,o=e.txHash,i=e.batchId,s=e.count,E=e.interval,_=void 0===E?5:E,!(s<=0)){t.next=3;break}return t.abrupt("return",null);case 3:return t.prev=3,t.next=6,(0,a.a)({chain:n,txHash:o,batchId:i});case 6:if(!(T=t.sent)){t.next=9;break}return t.abrupt("return",T);case 9:t.next=14;break;case 11:return t.prev=11,t.t0=t.catch(3),t.abrupt("return",void 0);case 14:return t.next=16,(0,l.Z)(_);case 16:return t.next=18,d((0,c.Z)((0,c.Z)({},e),{},{count:s-1}));case 18:return u=t.sent,t.abrupt("return",u);case 20:case"end":return t.stop()}}),t,null,[[3,11]])})));return function(e){return t.apply(this,arguments)}}(),E=function(){var t=(0,o.Z)((0,r.Z)().mark((function t(e){return(0,r.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",d(e));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),_=function(){var t=(0,o.Z)((0,r.Z)().mark((function t(e){var n,o,a,d,E,T,u,I;return(0,r.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.txHash,o=e.count,a=e.interval,d=void 0===a?5:a,!(o<=0)){t.next=3;break}return t.abrupt("return",null);case 3:return t.prev=3,t.next=6,i.Z.getOffChainPushStatus({txHash:n});case 6:if((null===(u=t.sent)||void 0===u||null===(E=u.data)||void 0===E?void 0:E.status)!=s.SCENE_STATUS_ENUM.SUCCESS&&(null===u||void 0===u||null===(T=u.data)||void 0===T?void 0:T.status)!=s.SCENE_STATUS_ENUM.FAIL){t.next=9;break}return t.abrupt("return",u.data);case 9:t.next=14;break;case 11:return t.prev=11,t.t0=t.catch(3),t.abrupt("return",void 0);case 14:return t.next=16,(0,l.Z)(d);case 16:return t.next=18,_((0,c.Z)((0,c.Z)({},e),{},{count:o-1}));case 18:return I=t.sent,t.abrupt("return",I);case 20:case"end":return t.stop()}}),t,null,[[3,11]])})));return function(e){return t.apply(this,arguments)}}();const T=E},28096:(t,e,n)=>{n.d(e,{Z:()=>a});var r=n(46430),c=n(1708),o={setAddressTokenInfoToStorageAndCookie(t){var e=t.chainType,n=t.walletAddress,o=t.token;r.Z.set("".concat(c.Z.chainTypeKeyEnum[e],"AddressToken"),{chainType:e,token:o,walletAddress:n},2592e3)},getAddressTokenMapFromStorage(){var t=Object.values(c.Z.chainTypeEnum),e={};return t.forEach((t=>{var n=r.Z.get("".concat(c.Z.chainTypeKeyEnum[t],"AddressToken"));n&&(e[n.walletAddress]=n.token)})),e},removeAddressTokenInfoFromStorage(){Object.values(c.Z.chainTypeEnum).forEach((t=>{r.Z.remove("".concat(c.Z.chainTypeKeyEnum[t],"AddressToken"))}))},setNftTokenToStorage(t){var e=t.token;r.Z.set("nft-token",e,86400)},getNftTokenFromStorage:()=>r.Z.get("nft-token"),removeNftTokenFromStorage(){r.Z.remove("nft-token")},removeToken(){o.removeNftTokenFromStorage(),o.removeAddressTokenInfoFromStorage()}};const a=o},68566:(t,e,n)=>{n.d(e,{Z:()=>o});var r=n(90915),c=n.n(r);class o{constructor(t){this.socketInstance=null,this.connectUrl=null,this.dataResolvers={},this.fallbackDataResolver=()=>{},this.handleConnectedQueue=[],this.handleConnectErrorQueue=[],this.connectUrl=t,this.socketInstance=new(c())({connectUrl:this.connectUrl}),this.socketInstance.onPushDiscontinue((()=>{this.socketInstance.sendChannel("ping")})),this.socketInstance.onSocketConnected((()=>{this.socketInstance.sendChannel("ping")})),this.socketInstance.onSocketError(this.handleConnectError.bind(this)),this.socketInstance.setPushDataResolver(this.resolvePushData.bind(this)),this.socketInstance.onSocketConnected(this.handleConnected.bind(this))}connect(){this.socketInstance&&!this.socketInstance.isConnected()&&this.socketInstance.connect()}disconnect(){this.socketInstance&&this.socketInstance.isConnected()&&this.socketInstance.disconnect()}sendChannel(t){this.socketInstance&&(this.connect(),this.socketInstance.sendChannel(JSON.stringify(t)))}resolvePushData(t){if("object"===typeof t){var e=t.event;this.dispatchDataResolver(e,t)}}setDataResolver(t,e){t?this.dataResolvers[t]=e:this.fallbackDataResolver=e}dispatchDataResolver(t,e){this.dataResolvers[t]?this.dataResolvers[t](e):this.fallbackDataResolver(e)}handleConnected(){this.handleConnectedQueue.forEach((t=>{t&&t()}))}handleConnectError(){this.handleConnectErrorQueue.forEach((t=>{t&&t()}))}addErrorQueue(t){return t&&this.handleConnectErrorQueue.push(t),this.removeErrorQueue.bind(this,t)}removeErrorQueue(t){this.handleConnectErrorQueue=this.handleConnectErrorQueue.filter((e=>e!==t))}addConnectedQueue(t){return t&&this.handleConnectedQueue.push(t),this.removeConnectedQueue.bind(this,t)}removeConnectedQueue(t){this.handleConnectedQueue=this.handleConnectedQueue.filter((e=>e!==t))}}},75219:(t,e,n)=>{function r(t){return t.then((t=>[null,t.data])).catch((t=>[t]))}n.d(e,{Z:()=>r})},20776:(t,e,n)=>{n.d(e,{Z:()=>r});const r=t=>new Promise((e=>{setTimeout((()=>{e()}),1e3*t)}))}}]); +//# sourceMappingURL=https://static-daily.okg.com/crash/okfe/defi-mode/7263/index.990fb318.js.map \ No newline at end of file diff --git a/index.c666020e.js.download b/index.c666020e.js.download new file mode 100644 index 0000000..b1dda5a --- /dev/null +++ b/index.c666020e.js.download @@ -0,0 +1,2 @@ +"use strict";(self.webpackChunkdefi_mode=self.webpackChunkdefi_mode||[]).push([[6916],{36916:(e,t,r)=>{r.d(t,{Z:()=>m});var n=r(1413),a=r(74165),s=r(15861),o=r(14300),c=r(35686),u=(r(92643),r(1708)),i=r(64037),f=r(23781),p=r(48635),d=r(45271),l=r(48779),v=r(40910),x=r(72208);const Z={["".concat(l.Wo).concat(v.jR.PUNK)]:function(){var e=(0,s.Z)((0,a.Z)().mark((function e(){var t;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.e(254).then(r.bind(r,60254));case 2:return t=e.sent,e.abrupt("return",(0,n.Z)({},t.default));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),["".concat(l.Hx).concat(x.Qz.MAGICEDEN)]:function(){var e=(0,s.Z)((0,a.Z)().mark((function e(){var t;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.e(4659).then(r.bind(r,54659));case 2:return t=e.sent,e.abrupt("return",(0,n.Z)({},t.default));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),["".concat(l.Hx).concat(x.Qz.TENSOR)]:function(){var e=(0,s.Z)((0,a.Z)().mark((function e(){var t;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.e(7040).then(r.bind(r,57040));case 2:return t=e.sent,e.abrupt("return",(0,n.Z)({},t.default));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),[i.Bv.SOLANA]:(0,s.Z)((0,a.Z)().mark((function e(){var t;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([r.e(5120),r.e(1215),r.e(4659),r.e(6896)]).then(r.bind(r,24973));case 2:return t=e.sent,e.abrupt("return",(0,n.Z)({},t.default));case 4:case"end":return e.stop()}}),e)}))),[i.Bv.IMX]:(0,s.Z)((0,a.Z)().mark((function e(){var t;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.e(7634).then(r.bind(r,47634));case 2:return t=e.sent,e.abrupt("return",(0,n.Z)({},t.default));case 4:case"end":return e.stop()}}),e)}))),[i.Bv.APTOS]:(0,s.Z)((0,a.Z)().mark((function e(){var t;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.e(2782).then(r.bind(r,72782));case 2:return t=e.sent,e.abrupt("return",(0,n.Z)({},t.default));case 4:case"end":return e.stop()}}),e)}))),[i.Bv.BTC]:(0,s.Z)((0,a.Z)().mark((function e(){var t;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.e(4180).then(r.bind(r,74180));case 2:return t=e.sent,e.abrupt("return",(0,n.Z)({},t.default));case 4:case"end":return e.stop()}}),e)}))),[i.Bv.SUI]:(0,s.Z)((0,a.Z)().mark((function e(){var t;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.e(7105).then(r.bind(r,57105));case 2:return t=e.sent,e.abrupt("return",(0,n.Z)({},t.default));case 4:case"end":return e.stop()}}),e)}))),[l.b2]:(0,s.Z)((0,a.Z)().mark((function e(){var t;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.resolve().then(r.bind(r,74579));case 2:return t=e.sent,e.abrupt("return",(0,n.Z)({},t.default));case 4:case"end":return e.stop()}}),e)})))};var h={getTradeEvent:e=>(0,s.Z)((0,a.Z)().mark((function t(){var r,n,s,o,c,u,i,f,p,d,v,x,h,m,I;return(0,a.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.orderInfo,n=void 0===r?{}:r,s=e.nftInfo,o=e.eventName,c=n.source,u=s.chain,i=s.tokenStandard,!(f=Z["".concat(l.Wo).concat(i)])){t.next=10;break}return t.next=7,f();case 7:if(!(p=t.sent)[o]){t.next=10;break}return t.abrupt("return",p[o]);case 10:if(!(d=Z["".concat(l.Hx).concat(c)])){t.next=17;break}return t.next=14,d();case 14:if(!(v=t.sent)[o]){t.next=17;break}return t.abrupt("return",v[o]);case 17:if(!(x=Z[u])){t.next=24;break}return t.next=21,x();case 21:if(!(h=t.sent)[o]){t.next=24;break}return t.abrupt("return",h[o]);case 24:return m=Z[l.b2],t.next=27,m();case 27:return I=t.sent,t.abrupt("return",I[o]);case 29:case"end":return t.stop()}}),t)})))(),checkTransaction:e=>(0,s.Z)((0,a.Z)().mark((function t(){var r,s,o,f,d,v,x,Z,h,m,I,A,T,y,b,k,w,E,g,_,S,N,C,L,U,P,O;return(0,a.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,u.Z.getWalletAccount();case 2:if(r=t.sent,s=e.nftInfo,o=void 0===s?{}:s,f=e.orderInfo,d=void 0===f?{}:f,v=e.txnHash,x=e.checkType,Z=e.scene,h=e.from,m=e.to,I=e.extJson,A=void 0===I?{}:I,T=e.extPayload,y=void 0===T?{}:T,b=e.extSubscribeParams,k=void 0===b?{}:b,w=e.extResult,E=void 0===w?{}:w,g=e.notShowToast,_=e.message,S=e.bizType,N=o.chain,C=o.contractAddress,L=o.tokenId,U=o.tokenStandard,P=(0,n.Z)({txnHash:v,walletAddress:r,chain:N,scene:Z,extJson:A,bizType:S,payload:(0,n.Z)({chain:N,contractAddress:C,tokenId:L,from:h,to:m,orderId:d.id,source:d.source,sourceName:d.sourceName,tokenStandard:U},y)},k),x!==l.U3.DIRECT){t.next=11;break}P=(0,n.Z)((0,n.Z)({},P),{},{status:p.SCENE_STATUS_ENUM.SUCCESS,urlPre:i.c6[N].browser}),g||(_?c.Z.success({title:_,showClose:!0,duration:5}):p.NFTOperateSubcribe.emit(Z,P)),t.next=17;break;case 11:if(x!==l.U3.PUSH){t.next=17;break}return t.next=14,(0,p.subscribeTxResult)(P);case 14:if(P=t.sent,(null===(O=P)||void 0===O?void 0:O.status)!=p.SCENE_STATUS_ENUM.FAIL){t.next=17;break}throw(0,n.Z)((0,n.Z)({},P),{},{toastType:l.pD.NOT_SHOW});case 17:return t.abrupt("return",(0,n.Z)((0,n.Z)({},P),E));case 18:case"end":return t.stop()}}),t)})))(),checkBatchTransaction:e=>(0,s.Z)((0,a.Z)().mark((function t(){var r,s,o,c,d,v,x,Z,h,m,I,A,T,y,b,k;return(0,a.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,u.Z.getWalletAccount();case 2:return r=t.sent,s=e.txnHash,o=e.chain,c=e.scene,d=e.from,v=e.to,x=e.extJson,Z=void 0===x?{}:x,h=e.extPayload,m=void 0===h?{}:h,I=e.extSubscribeParams,A=void 0===I?{}:I,T=e.extResult,y=void 0===T?{}:T,t.next=6,(0,p.subscribeTxResult)((0,n.Z)({txnHash:s,walletAddress:r,extJson:Z,chain:o,scene:c,payload:(0,n.Z)({from:d,to:v},m)},A));case 6:if((b=t.sent).batchTransferInfo||!i.Ay.includes(Number(o))||c!=p.SCENE_ENUM.BatchTransfer){t.next=12;break}return t.next=10,f.Z.getBatchTransferResult({txHash:s,chain:o});case 10:k=t.sent,b.batchTransferInfo=k.data;case 12:if((null===b||void 0===b?void 0:b.status)!=p.SCENE_STATUS_ENUM.FAIL){t.next=14;break}throw(0,n.Z)((0,n.Z)({},b),{},{toastType:l.pD.NOT_SHOW});case 14:return t.abrupt("return",(0,n.Z)((0,n.Z)({},b),y));case 15:case"end":return t.stop()}}),t)})))(),formatError(e){var t,r,n,a=e.error,s=l.pD.NORMAL;try{if(a instanceof Error)try{var o=JSON.parse(null===a||void 0===a?void 0:a.message);r=(null===o||void 0===o?void 0:o.customMessage)||(null===o||void 0===o?void 0:o.msg)||(null===o||void 0===o?void 0:o.message)||(null===o||void 0===o?void 0:o.error_message),t=Number(null===o||void 0===o?void 0:o.code),s=(null===o||void 0===o?void 0:o.toastType)||l.pD.NORMAL,n=null===o||void 0===o?void 0:o.key}catch(c){r=null===a||void 0===a?void 0:a.message}else"string"===typeof a?r=a:"object"===typeof a&&(r=(null===a||void 0===a?void 0:a.customMessage)||(null===a||void 0===a?void 0:a.msg)||(null===a||void 0===a?void 0:a.message)||(null===a||void 0===a?void 0:a.error_message),t=Number(null===a||void 0===a?void 0:a.code),s=(null===a||void 0===a?void 0:a.toastType)||l.pD.NORMAL,n=null===a||void 0===a?void 0:a.key)}catch(u){}return{key:n,code:t,message:r,toastType:s}},sendErrorMsg:e=>(0,s.Z)((0,a.Z)().mark((function t(){var r,s,u,i,f,v,x,Z,m,I,A,T,y;return(0,a.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.scene,s=e.error,u=void 0===s?{}:s,i=e.payload,f=void 0===i?{}:i,v=e.notShowToast,x=void 0!==v&&v,Z=e.loggerKey,m=h.formatError({error:u}),I=m.message,A=m.code,T=m.toastType,y=m.key,(0,d.no)((0,n.Z)((0,n.Z)({},e),{},{key:y||Z})),!x){t.next=6;break}return t.abrupt("return");case 6:if(T!==l.pD.NOT_SHOW){t.next=8;break}return t.abrupt("return");case 8:if(![l.Bq.REJECT_TRADE].includes(A)){t.next=11;break}return c.Z.error({title:(0,o.O4)("nftmarket_bulk_list_error_toast_cancelled")}),t.abrupt("return");case 11:if(!I||T===l.pD.FALLBACK){t.next=14;break}return c.Z.error({title:I}),t.abrupt("return");case 14:(0,p.catchTxError)({scene:r,error:u,payload:f});case 15:case"end":return t.stop()}}),t)})))(),reportOtherTx(e){var t=e.txnHash;t&&f.Z.reportOtherTxId({txHash:t})},beforeTrade:e=>(0,s.Z)((0,a.Z)().mark((function t(){var r,n;return(0,a.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.chain,Number(r)!==i.Bv.IMX){t.next=3;break}return t.abrupt("return");case 3:return t.next=5,u.Z.getChainId();case 5:if(n=t.sent,!r&&0!==r||Number(n)===Number(r)){t.next=8;break}throw new Error((0,o.O4)("nftmarket_buy_error_toast_wrong_network",{network:i.c6[r].name}));case 8:case"end":return t.stop()}}),t)})))()};const m=h},74579:(e,t,r)=>{r.r(t),r.d(t,{default:()=>k});var n=r(74165),a=r(15861),s=r(14300),o=r(1708),c=r(64037),u=r(45862),i=r(40910),f=r(72208),p=r(48635),d=r(64397),l=r(48779),v=r(48903),x=r(29439),Z=r(1413),h=r(79042),m=r(83030),I=r(85658);function A(e){return h.OK.toHex(e)}var T={signTypedData:e=>(0,a.Z)((0,n.Z)().mark((function t(){var r,a,s,u,i,f;return(0,n.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.stepActionInfo,e.chain!=c.Bv.STARKNET){t.next=3;break}return t.abrupt("return",T.signMessage({stepActionInfo:r}));case 3:return a=r.data,s=r.types,u=r.domain,i=r.primaryType,t.next=6,o.Z.signTypedData({message:{domain:u,message:a,primaryType:i,types:s}});case 6:return f=t.sent,t.abrupt("return",f);case 8:case"end":return t.stop()}}),t)})))(),signMessage:e=>(0,a.Z)((0,n.Z)().mark((function t(){var r,a,s,c,u,i;return(0,n.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.stepActionInfo,a=r.data,s=r.types,c=r.domain,u=r.primaryType,t.next=4,o.Z.signMessage({message:(0,m.Z)({domain:c,message:a,primaryType:u,types:s})});case 4:return i=t.sent,t.abrupt("return",i);case 6:case"end":return t.stop()}}),t)})))(),signLazyLoad:e=>(0,a.Z)((0,n.Z)().mark((function t(){var r,a,o,c,u,i,f,p,d,v,x,h,m,A,T,y;return(0,n.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.stepActionInfo,a=e.params,o=void 0===a?{}:a,c=r.post,u=c.body,i=c.endpoint,f=c.method,t.next=4,I.Z[f](i,(0,Z.Z)((0,Z.Z)({},u),o));case 4:if(p=t.sent,d=p.data,v=d.errors,x=void 0===v?[]:v,h=d.item,A=(m=void 0===h?{}:h).orderIds,0!==(T=void 0===A?[]:A).length){t.next=13;break}throw{code:l.XX.LISTING,errors:x,message:x.length>1?(0,s.O4)("nftmarket_bulk_list_error_toast_all_failed"):null===(y=x[0])||void 0===y?void 0:y.message};case 13:return t.abrupt("return",{successOrderIds:T,errors:x,item:m});case 14:case"end":return t.stop()}}),t)})))(),sellLazyLoad:e=>(0,a.Z)((0,n.Z)().mark((function t(){var r,a,o,u,i,f,p,d,v,h,m,T,y,b,k,w,E,g;return(0,n.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.stepActionInfo,a=e.signature,o=e.chain,u=r.post,i=u.body,f=u.endpoint,p=u.method,d={},o==c.Bv.STARKNET&&(v=(0,x.Z)(a,2),h=v[0],m=v[1],d={r:A(h),s:A(m)}),t.next=6,I.Z[p](f,(0,Z.Z)((0,Z.Z)({},i),{},{signature:a},d),{timeout:6e4});case 6:if(T=t.sent,y=T.data,b=y.successOrderIds,k=void 0===b?[]:b,w=y.errors,E=void 0===w?[]:w,0!==k.length){t.next=14;break}throw{code:l.XX.LISTING,errors:E,message:E.length>1?(0,s.O4)("nftmarket_bulk_list_error_toast_all_failed"):null===(g=E[0])||void 0===g?void 0:g.message};case 14:return t.abrupt("return",{successOrderIds:k,errors:E});case 15:case"end":return t.stop()}}),t)})))(),requestLazyLoad:e=>(0,a.Z)((0,n.Z)().mark((function t(){var r,a,s,o,c,u,i;return(0,n.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.stepActionInfo,a=e.params,s=void 0===a?{}:a,o=r.post,c=o.body,u=o.endpoint,i=o.method,t.abrupt("return",I.Z[i](u,(0,Z.Z)((0,Z.Z)({},c),s)));case 3:case"end":return t.stop()}}),t)})))(),getPayload(e){var t=e.stepActionInfo,r=void 0===t?{}:t,n={[i.Is.STARKNET_TRANSACTION]:()=>r.payload,[i.Is.STARKNET_MULTI_TRANSACYION]:()=>{var e=r.transactionItemList;return(void 0===e?[]:e).map((e=>{var t=e.payload;return void 0===t?{}:t}))}}[r.kind];return n&&n()}};const y=T;var b={[l.xy.SELL]:function(){var e=(0,a.Z)((0,n.Z)().mark((function e(t){var r,a,o,c,u,d,v,x,Z,h,m,I,A,T,b,k,w,E,g;return(0,n.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=t.stepActionInfo,c=t.nftInfo,u=o.kind,d=o,v=[],x=[],u!==i.Is.LAZY_LOADING){e.next=15;break}return e.next=8,y.signLazyLoad({stepActionInfo:o});case 8:Z=e.sent,h=Z.successOrderIds,m=Z.errors,I=Z.item,v.push(...m),x.push(...h),d=I;case 15:return e.next=17,y.signTypedData({stepActionInfo:d,chain:null===c||void 0===c?void 0:c.chain});case 17:return A=e.sent,e.next=20,y.sellLazyLoad({stepActionInfo:d,signature:A,chain:null===c||void 0===c?void 0:c.chain});case 20:if(T=e.sent,b=T.successOrderIds,k=T.errors,v.push(...k),x.push(...b),(null===(r=d)||void 0===r||null===(a=r.platform)||void 0===a?void 0:a.source)!==f.Qz.BLUR){e.next=28;break}return e.next=28,(0,p.subscribeBlurOrderResult)({scene:i.Pv.BlurListingRes,count:1,txHash:d.orderIds[0],interval:0});case 28:return E=v.length,g=b.length,E+g>1&&(w=E>0?(0,s.O4)("nftmarket_bulk_list_error_toast_partly_success",{num1:g,num2:E}):(0,s.O4)("nftmarket_bulk_list_error_toast_all_sucess")),e.abrupt("return",{checkType:l.U3.DIRECT,errors:v,successOrderIds:x,message:w});case 32:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[l.xy.UPDATE_PRICE]:function(){var e=(0,a.Z)((0,n.Z)().mark((function e(t){var r;return(0,n.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.stepActionInfo,e.abrupt("return",b[l.xy.SELL]({stepActionInfo:r}));case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[l.xy.MAKE_OFFER]:function(){var e=(0,a.Z)((0,n.Z)().mark((function e(t){var r,a,s;return(0,n.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.stepActionInfo,a=t.nftInfo,e.next=4,y.signTypedData({stepActionInfo:r,chain:null===a||void 0===a?void 0:a.chain});case 4:return s=e.sent,e.next=7,y.sellLazyLoad({stepActionInfo:r,signature:s,chain:null===a||void 0===a?void 0:a.chain});case 7:return e.abrupt("return",{checkType:l.U3.DIRECT});case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[l.xy.INIT_ACCOUNT]:function(){var e=(0,a.Z)((0,n.Z)().mark((function e(t){var r,a,s,c,u,i,f;return(0,n.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.stepActionInfo,e.next=3,v.Z.getTradeStepActionInfo({stepActionInfo:r});case 3:return a=e.sent,s=a.value,c=a.input,u=a.contractAddress,e.next=7,o.Z.getWalletAccount();case 7:return i=e.sent,f={from:i,to:u,data:c,value:s},e.next=11,v.Z.preExecuteTrade({payload:f,chain:null===r||void 0===r?void 0:r.chain,scene:p.SCENE_ENUM.InitAccount,from:i});case 11:return e.abrupt("return",new Promise(((e,t)=>{(0,d.T7)(f,(t=>{e({txnHash:t,checkType:l.U3.PUSH})})).catch(t)})));case 12:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[l.xy.BUY]:function(){var e=(0,a.Z)((0,n.Z)().mark((function e(t){var r,a,s,c,u,i,f,x,Z;return(0,n.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.stepActionInfo,a=t.orderInfo,s=t.nftInfo,e.next=3,v.Z.getTradeStepActionInfo({stepActionInfo:r});case 3:return c=e.sent,u=c.value,i=c.input,f=c.contractAddress,e.next=7,o.Z.getWalletAccount();case 7:return x=e.sent,Z=y.getPayload({stepActionInfo:c})||{from:x,to:f,data:i,value:u},e.next=11,v.Z.preExecuteTrade({payload:Z,scene:p.SCENE_ENUM.Purchase,orderNftInfoList:[{orderInfo:a,nftInfo:s}],from:x});case 11:return e.abrupt("return",new Promise(((e,t)=>{(0,d.T7)(Z,(t=>{e({txnHash:t,checkType:l.U3.PUSH})})).catch(t)})));case 12:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[l.xy.BATCH_BUY]:function(){var e=(0,a.Z)((0,n.Z)().mark((function e(t){var r,a,s,c,u,i,f,l;return(0,n.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.stepActionInfo,a=t.orderList,e.next=3,v.Z.getTradeStepActionInfo({stepActionInfo:r});case 3:return s=e.sent,c=s.value,u=s.input,i=s.contractAddress,e.next=7,o.Z.getWalletAccount();case 7:return f=e.sent,l=y.getPayload({stepActionInfo:s})||{from:f,to:i,data:u,value:c},e.next=11,v.Z.preExecuteTrade({payload:l,orderNftInfoList:a,scene:p.SCENE_ENUM.BatchPurchase,from:f});case 11:return e.abrupt("return",new Promise(((e,t)=>{(0,d.T7)(l,(t=>{e({txnHash:t})})).catch(t)})));case 12:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[l.xy.ACCEPT_OFFER]:function(){var e=(0,a.Z)((0,n.Z)().mark((function e(t){var r,a,c,u,i,x,Z,h,m;return(0,n.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.orderInfo,a=t.nftInfo,c=t.stepActionInfo,e.next=3,v.Z.getTradeStepActionInfo({stepActionInfo:c});case 3:if(u=e.sent,!(r.source===f.Qz.BLUR&&u.totalPrice{(0,d.T7)(m,(t=>{e({txnHash:t,checkType:l.U3.PUSH})})).catch(t)})));case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[l.xy.BATCH_ACCEPT_OFFER]:function(){var e=(0,a.Z)((0,n.Z)().mark((function e(t){var r,a,s,c,u,i,f;return(0,n.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.stepActionInfo,a=t.orderList,e.next=3,v.Z.getTradeStepActionInfo({stepActionInfo:r});case 3:return s=e.sent,c=s.input,u=s.contractAddress,e.next=7,o.Z.getWalletAccount();case 7:return i=e.sent,f={from:i,to:u,data:c},e.next=11,v.Z.preExecuteTrade({payload:f,orderNftInfoList:a,scene:p.SCENE_ENUM.AcceptOffer,from:i});case 11:return e.abrupt("return",new Promise(((e,t)=>{(0,d.T7)(f,(t=>{e({txnHash:t})})).catch(t)})));case 12:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[l.xy.TRANSFER]:function(){var e=(0,a.Z)((0,n.Z)().mark((function e(t){var r,a,s,c,f,x,Z,h;return(0,n.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.nftInfo,a=t.tradeData,s=t.stepActionInfo,e.next=3,o.Z.getWeb3();case 3:return c=e.sent,e.next=6,o.Z.getWalletAccount();case 6:return f=e.sent,x=()=>{var e=r.tokenId,t=r.contractAddress,n=r.tokenStandard,s=a.target,o=a.amount,p=n===i.jR.ERC1155,d=p?u.qV:u.U5,l=new c.eth.Contract(d,t),v=[f,s,e];return p&&v.push(o,[]),{from:f,to:t,data:l.methods.safeTransferFrom(...v).encodeABI()}},Z=y.getPayload({stepActionInfo:s}),h=Z||x(),e.next=12,v.Z.preExecuteTrade({payload:h,orderNftInfoList:[{nftInfo:r}],scene:p.SCENE_ENUM.Transfer,from:f});case 12:return e.abrupt("return",new Promise(((e,t)=>{(0,d.T7)(h,(t=>{e({txnHash:t,checkType:l.U3.PUSH})})).catch(t)})));case 13:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[l.xy.BATCH_TRANSFER]:function(){var e=(0,a.Z)((0,n.Z)().mark((function e(t){var r,a,s,f,l,x,Z,h,m,I,A;return(0,n.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.nftList,a=t.transferData,s=t.stepActionInfo,f=a.target,l=a.chain,x=r.map((e=>{var t=e.tokenStandard===i.jR.ERC1155;return{itemType:t?i.L6.ERC1155:i.L6.ERC721,token:e.contractAddress,id:e.tokenId,amount:t&&e.readyTransferValue||1}})),e.next=5,o.Z.getWeb3();case 5:return Z=e.sent,e.next=8,o.Z.getWalletAccount();case 8:return h=e.sent,m=()=>{var e=c.c6[l].key,t=u.IM[e].batchTransfer,r=t.abi,n=t.addr,a=new Z.eth.Contract(r,n),s=[f,x,!1];return{from:h,to:n,data:a.methods.transferItems(...s).encodeABI()}},I=y.getPayload({stepActionInfo:s}),A=I||m(),e.next=14,v.Z.preExecuteTrade({payload:A,orderNftInfoList:r.map((e=>({nftInfo:e}))),scene:p.SCENE_ENUM.BatchTransfer,from:h});case 14:return e.abrupt("return",new Promise(((e,t)=>{(0,d.T7)(A,(t=>{e({txnHash:t})})).catch(t)})));case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[l.xy.CANCEL]:function(){var e=(0,a.Z)((0,n.Z)().mark((function e(t){var r,a,s,c,u,f,x,Z,h,m,I;return(0,n.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.stepActionInfo,a=t.orderInfo,s=t.nftInfo,c=r.kind,e.next=4,o.Z.getWalletAccount();case 4:if(u=e.sent,c!==i.Is.SIGNATURE){e.next=12;break}return e.next=8,y.signTypedData({stepActionInfo:r,chain:null===s||void 0===s?void 0:s.chain});case 8:return f=e.sent,e.next=11,y.requestLazyLoad({stepActionInfo:r,params:{signature:f}});case 11:return e.abrupt("return",{checkType:l.U3.DIRECT});case 12:return e.next=14,v.Z.getTradeStepActionInfo({stepActionInfo:r});case 14:return x=e.sent,Z=x.input,h=x.contractAddress,m={from:u,to:h,data:Z},I=y.getPayload({stepActionInfo:x})||m,e.next=20,v.Z.preExecuteTrade({payload:I,orderNftInfoList:[{orderInfo:a,nftInfo:s}],scene:p.SCENE_ENUM.CancelSell,from:u});case 20:return e.abrupt("return",new Promise(((e,t)=>{(0,d.T7)(I,(t=>{e({txnHash:t,checkType:l.U3.PUSH})})).catch(t)})));case 21:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[l.xy.CANCEL_OFFER]:function(){var e=(0,a.Z)((0,n.Z)().mark((function e(t){var r,a,s,c,u,i,f,x,Z;return(0,n.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.stepActionInfo,a=t.orderInfo,s=t.nftInfo,e.next=3,v.Z.getTradeStepActionInfo({stepActionInfo:r});case 3:return c=e.sent,e.next=6,o.Z.getWalletAccount();case 6:return u=e.sent,i=c.input,f=c.contractAddress,x=y.getPayload({stepActionInfo:c}),Z=x||{from:u,to:f,data:i},e.next=12,v.Z.preExecuteTrade({payload:Z,orderNftInfoList:[{orderInfo:a,nftInfo:s}],scene:p.SCENE_ENUM.CancellOffer,from:u});case 12:return e.abrupt("return",new Promise(((e,t)=>{(0,d.T7)(Z,(t=>{e({txnHash:t,checkType:l.U3.PUSH})})).catch(t)})));case 13:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[l.xy.BATCH_MINT]:function(){var e=(0,a.Z)((0,n.Z)().mark((function e(t){var r,a,s,c;return(0,n.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.input,a=t.contractAddress,e.next=3,o.Z.getWalletAccount();case 3:return s=e.sent,c={from:s,to:a,data:r},e.abrupt("return",new Promise(((e,t)=>{(0,d.T7)(c,(t=>{e({txnHash:t,checkType:l.U3.PUSH})})).catch(t)})));case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[l.xy.CREATE_COLLECTION]:function(){var e=(0,a.Z)((0,n.Z)().mark((function e(t){var r,a,s,c;return(0,n.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.contractAddress,a=t.callData,e.next=3,o.Z.getWalletAccount();case 3:return s=e.sent,c={from:s,to:r,data:a},e.abrupt("return",new Promise(((e,t)=>{(0,d.T7)(c,(t=>{e({txnHash:t,checkType:l.U3.PUSH})})).catch(t)})));case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[l.xy.P2P_SELL]:function(){var e=(0,a.Z)((0,n.Z)().mark((function e(t){var r,a,s,o,c,u;return(0,n.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.stepActionInfo,a=r,e.next=4,y.signTypedData({stepActionInfo:a});case 4:return s=e.sent,e.next=7,y.sellLazyLoad({stepActionInfo:a,signature:s});case 7:return o=e.sent,c=o.successOrderIds,u=o.errors,e.abrupt("return",{checkType:l.U3.DIRECT,errors:u,successOrderIds:c});case 11:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[l.xy.P2P_BUY]:function(){var e=(0,a.Z)((0,n.Z)().mark((function e(t){var r,a,s,c,u,i,f;return(0,n.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.stepActionInfo,e.next=3,v.Z.getTradeStepActionInfo({stepActionInfo:r});case 3:return a=e.sent,s=a.value,c=a.input,u=a.contractAddress,e.next=7,o.Z.getWalletAccount();case 7:return i=e.sent,f={from:i,to:u,data:c,value:s},e.abrupt("return",new Promise(((e,t)=>{(0,d.T7)(f,(t=>{e({txnHash:t,checkType:l.U3.PUSH})}),{txSource:10}).catch(t)})));case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[l.xy.P2P_CANCEL]:function(){var e=(0,a.Z)((0,n.Z)().mark((function e(t){var r,a,s,c,u,f,p,x,Z;return(0,n.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.stepActionInfo,a=r.kind,s=r.message,e.next=4,o.Z.getWalletAccount();case 4:if(c=e.sent,a!==i.Is.SIGNATURE){e.next=12;break}return e.next=8,o.Z.signData({account:c,signData:s});case 8:return u=e.sent,e.next=11,y.requestLazyLoad({stepActionInfo:r,params:{signature:u}});case 11:return e.abrupt("return",{checkType:l.U3.DIRECT});case 12:return e.next=14,v.Z.getTradeStepActionInfo({stepActionInfo:r});case 14:return f=e.sent,p=f.input,x=f.contractAddress,Z={from:c,to:x,data:p},e.abrupt("return",new Promise(((e,t)=>{(0,d.T7)(Z,(t=>{e({txnHash:t,checkType:l.U3.PUSH})}),{txSource:10}).catch(t)})));case 18:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()};const k=b}}]); +//# sourceMappingURL=https://static-daily.okg.com/crash/okfe/defi-mode/6916/index.c666020e.js.map \ No newline at end of file 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