@acedatacloud/nexior 3.32.3 → 3.32.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{Auth-C6nWplzs.js → Auth-DYFA1Zzt.js} +1 -1
- package/dist/assets/{BotPlaceholder-C24Ek219.js → BotPlaceholder-BJhJ0msN.js} +1 -1
- package/dist/assets/{Callback-BesKae8F.js → Callback-BNPpP1tB.js} +1 -1
- package/dist/assets/{Console-Cswdf__L.js → Console-DT0S3aVY.js} +1 -1
- package/dist/assets/{Conversation-DZ0gjygM.js → Conversation-D5pRsQC3.js} +1 -1
- package/dist/assets/{CopyToClipboard-DufDnfYB.js → CopyToClipboard-BLbqw9nl.js} +1 -1
- package/dist/assets/{Detail-BqAt1S-n.js → Detail-DseOq2S9.js} +2 -2
- package/dist/assets/{EditArray-C8hm_SxB.js → EditArray-qHlQF7rP.js} +1 -1
- package/dist/assets/{Extra-C2LXle5q.js → Extra-Dw2CrEZu.js} +1 -1
- package/dist/assets/{FilePreview-KFehNiBJ.js → FilePreview-BjsX8WfW.js} +1 -1
- package/dist/assets/{History-CoDNI89I.js → History-Bnd72qti.js} +1 -1
- package/dist/assets/{ImagePreview-Ccc9Mil8.js → ImagePreview-D-H4d4jU.js} +1 -1
- package/dist/assets/{ImageWrapper-CTXSpe8B.js → ImageWrapper-BRaL0q-A.js} +1 -1
- package/dist/assets/{Index-BsE2Io8Y.js → Index-7kHRJX1f.js} +1 -1
- package/dist/assets/{Index-vrkMbdX_.js → Index-B5Cj9iRW.js} +1 -1
- package/dist/assets/{Index-Drtj0GA6.js → Index-BzyzGFCk.js} +1 -1
- package/dist/assets/{Index-P-ctz3sM.js → Index-C3AYvYo0.js} +1 -1
- package/dist/assets/{Index-oebgxe7m.js → Index-CKL7pA88.js} +1 -1
- package/dist/assets/{Index-BlTXL49B.js → Index-CM2P7KVf.js} +1 -1
- package/dist/assets/{Index-Czt71a3Q.js → Index-COqvi-TP.js} +1 -1
- package/dist/assets/{Index-DQ21Gq83.js → Index-CVrpBoqE.js} +1 -1
- package/dist/assets/{Index-FcGwbCpU.js → Index-CfxkOk_2.js} +1 -1
- package/dist/assets/{Index-B5-72-5C.js → Index-CtGQ26YS.js} +1 -1
- package/dist/assets/{Index-CmBhhmB-.js → Index-DLeWH4dR.js} +1 -1
- package/dist/assets/{Index-0zfbSPiP.js → Index-DbrCdp2X.js} +1 -1
- package/dist/assets/{Index-DOHlxm5E.js → Index-DicdfjBU.js} +1 -1
- package/dist/assets/{Index-CRwbUe_G.js → Index-DjrwHYI0.js} +1 -1
- package/dist/assets/{Index-CQmCwljK.js → Index-DzvDLu21.js} +1 -1
- package/dist/assets/{Index-CABKKWV0.js → Index-NGjnc38V.js} +1 -1
- package/dist/assets/{Index-oPvwlVR0.js → Index-XGOkY1zY.js} +1 -1
- package/dist/assets/{Index-BHfOuN_v.js → Index-Yb45BxJz.js} +1 -1
- package/dist/assets/{Index-BAz-Nvvw.js → Index-l7Xs56vt.js} +1 -1
- package/dist/assets/{Index-mUUKBXix.js → Index-wP_Lyyil.js} +1 -1
- package/dist/assets/{Invitees-Dvs2sTKc.js → Invitees-Dn0E8qJC.js} +1 -1
- package/dist/assets/{List-5xOc4YCH.js → List-BV_IzyX2.js} +1 -1
- package/dist/assets/{List-RA6ZhCoT.js → List-DzBdFw8I.js} +1 -1
- package/dist/assets/{List-kkoWU_tk.js → List-NozEP18m.js} +1 -1
- package/dist/assets/{Main-B4mGHiHa.js → Main-CD9T2N3l.js} +1 -1
- package/dist/assets/{Navigator-CwNZQUMg.css → Navigator-BFuQQRKd.css} +1 -1
- package/dist/assets/{Navigator-DPeE1Aqj.js → Navigator-BNJXI3hc.js} +1 -1
- package/dist/assets/{NoTasks-BcLRHfFy.js → NoTasks-Cm0AqqsF.js} +1 -1
- package/dist/assets/{Pagination-BFovzqlH.js → Pagination-C47FX5oY.js} +1 -1
- package/dist/assets/{ScrollList-DhBD69sP.js → ScrollList-DRWz9jW6.js} +1 -1
- package/dist/assets/{Status-Dz2uYx_Z.js → Status-FhPzRnWL.js} +1 -1
- package/dist/assets/{Subscribe-CqH-AUiU.js → Subscribe-21L-6Z4O.js} +1 -1
- package/dist/assets/{TransportWebHID-BhLtzZU3.js → TransportWebHID-B_3EAMYS.js} +1 -1
- package/dist/assets/{VideoPlayer-CUptdbWS.js → VideoPlayer-C8wcdJbG.js} +1 -1
- package/dist/assets/avatar-BpcmM_BW.js +1 -0
- package/dist/assets/{avatar-CfYRMFXV.css → avatar-DIo0dZw4.css} +1 -1
- package/dist/assets/{bignumber-BBExem2E.js → bignumber-ILNjViFu.js} +1 -1
- package/dist/assets/{distribution-BJ8p_o-0.js → distribution-DmCB36oc.js} +1 -1
- package/dist/assets/{index-yBGpiWD1.js → index-8EKPvmnj.js} +1 -1
- package/dist/assets/{index-DrVYe6xF.js → index-BRGDNp-C.js} +1 -1
- package/dist/assets/{index-8PO5vcp7.js → index-BoGx3CmB.js} +1 -1
- package/dist/assets/{index-ByyN-gbk.js → index-CKKGs5h1.js} +1 -1
- package/dist/assets/{index-Bkear63z.css → index-Cbt_RUrY.css} +1 -1
- package/dist/assets/{index-Biw05q2b.js → index-CyO8tXO2.js} +1 -1
- package/dist/assets/{index-CCKNv2fP.js → index-D2TydFHF.js} +1 -1
- package/dist/assets/{index-CeyMzwyI.js → index-D9sJC6gW.js} +1 -1
- package/dist/assets/{index-BVFe6aDK.js → index-Eolh8-ZS.js} +4 -4
- package/dist/assets/{index.es-Cy89kVNv.js → index.es-ByZsSMmo.js} +1 -1
- package/dist/assets/{order-_HkS8nbL.js → order-BCSpOmEp.js} +1 -1
- package/dist/assets/{price-C9j4ecXg.js → price-B3IiQ6GV.js} +1 -1
- package/dist/assets/{solana-wallets-BhwbE8Fg.js → solana-wallets-BlAPmkC0.js} +2 -2
- package/dist/assets/{solanaEmbed.esm-DBo0oaRx.js → solanaEmbed.esm-DMhNKlrp.js} +1 -1
- package/dist/assets/{string_decoder-CAMpLf3P.js → string_decoder-D3sR9f7y.js} +1 -1
- package/dist/assets/{vendor-web3-Bvupvt61.js → vendor-web3-DH4JU5BG.js} +4 -4
- package/dist/assets/{web-m2SBy7Vp.js → web-Bq9K0ccN.js} +1 -1
- package/dist/assets/{web-a6K9JR8X.js → web-DPMzAm_p.js} +1 -1
- package/dist/index.html +3 -3
- package/package.json +1 -1
- package/dist/assets/avatar-CQrEVxe9.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as W}from"./vendor-dayjs-CzbnksQQ.js";import{P as T,B as A}from"./vendor-web3-Bvupvt61.js";import"./vendor-vue-1w_NBnjl.js";var L={exports:{}},S;function M(){return S||(S=1,function(f){var s=Object.prototype.hasOwnProperty,e="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(e=!1));function i(a,t,o){this.fn=a,this.context=t,this.once=o||!1}function r(a,t,o,c,_){if(typeof o!="function")throw new TypeError("The listener must be a function");var v=new i(o,c||a,_),h=e?e+t:t;return a._events[h]?a._events[h].fn?a._events[h]=[a._events[h],v]:a._events[h].push(v):(a._events[h]=v,a._eventsCount++),a}function d(a,t){--a._eventsCount===0?a._events=new n:delete a._events[t]}function l(){this._events=new n,this._eventsCount=0}l.prototype.eventNames=function(){var t=[],o,c;if(this._eventsCount===0)return t;for(c in o=this._events)s.call(o,c)&&t.push(e?c.slice(1):c);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(o)):t},l.prototype.listeners=function(t){var o=e?e+t:t,c=this._events[o];if(!c)return[];if(c.fn)return[c.fn];for(var _=0,v=c.length,h=new Array(v);_<v;_++)h[_]=c[_].fn;return h},l.prototype.listenerCount=function(t){var o=e?e+t:t,c=this._events[o];return c?c.fn?1:c.length:0},l.prototype.emit=function(t,o,c,_,v,h){var y=e?e+t:t;if(!this._events[y])return!1;var u=this._events[y],w=arguments.length,b,p;if(u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),w){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,o),!0;case 3:return u.fn.call(u.context,o,c),!0;case 4:return u.fn.call(u.context,o,c,_),!0;case 5:return u.fn.call(u.context,o,c,_,v),!0;case 6:return u.fn.call(u.context,o,c,_,v,h),!0}for(p=1,b=new Array(w-1);p<w;p++)b[p-1]=arguments[p];u.fn.apply(u.context,b)}else{var K=u.length,g;for(p=0;p<K;p++)switch(u[p].once&&this.removeListener(t,u[p].fn,void 0,!0),w){case 1:u[p].fn.call(u[p].context);break;case 2:u[p].fn.call(u[p].context,o);break;case 3:u[p].fn.call(u[p].context,o,c);break;case 4:u[p].fn.call(u[p].context,o,c,_);break;default:if(!b)for(g=1,b=new Array(w-1);g<w;g++)b[g-1]=arguments[g];u[p].fn.apply(u[p].context,b)}}return!0},l.prototype.on=function(t,o,c){return r(this,t,o,c,!1)},l.prototype.once=function(t,o,c){return r(this,t,o,c,!0)},l.prototype.removeListener=function(t,o,c,_){var v=e?e+t:t;if(!this._events[v])return this;if(!o)return d(this,v),this;var h=this._events[v];if(h.fn)h.fn===o&&(!_||h.once)&&(!c||h.context===c)&&d(this,v);else{for(var y=0,u=[],w=h.length;y<w;y++)(h[y].fn!==o||_&&!h[y].once||c&&h[y].context!==c)&&u.push(h[y]);u.length?this._events[v]=u.length===1?u[0]:u:d(this,v)}return this},l.prototype.removeAllListeners=function(t){var o;return t?(o=e?e+t:t,this._events[o]&&d(this,o)):(this._events=new n,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=e,l.EventEmitter=l,f.exports=l}(L)),L.exports}var R=M();const U=W(R);var $=function(){var f=function(s,e){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[r]=i[r])},f(s,e)};return function(s,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");f(s,e);function n(){this.constructor=s}s.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),q=function(f){$(s,f);function s(){return f!==null&&f.apply(this,arguments)||this}return s}(U),C={exports:{}},I;function D(){return I||(I=1,function(f){var s=Object.prototype.hasOwnProperty,e="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(e=!1));function i(a,t,o){this.fn=a,this.context=t,this.once=o||!1}function r(a,t,o,c,_){if(typeof o!="function")throw new TypeError("The listener must be a function");var v=new i(o,c||a,_),h=e?e+t:t;return a._events[h]?a._events[h].fn?a._events[h]=[a._events[h],v]:a._events[h].push(v):(a._events[h]=v,a._eventsCount++),a}function d(a,t){--a._eventsCount===0?a._events=new n:delete a._events[t]}function l(){this._events=new n,this._eventsCount=0}l.prototype.eventNames=function(){var t=[],o,c;if(this._eventsCount===0)return t;for(c in o=this._events)s.call(o,c)&&t.push(e?c.slice(1):c);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(o)):t},l.prototype.listeners=function(t){var o=e?e+t:t,c=this._events[o];if(!c)return[];if(c.fn)return[c.fn];for(var _=0,v=c.length,h=new Array(v);_<v;_++)h[_]=c[_].fn;return h},l.prototype.listenerCount=function(t){var o=e?e+t:t,c=this._events[o];return c?c.fn?1:c.length:0},l.prototype.emit=function(t,o,c,_,v,h){var y=e?e+t:t;if(!this._events[y])return!1;var u=this._events[y],w=arguments.length,b,p;if(u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),w){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,o),!0;case 3:return u.fn.call(u.context,o,c),!0;case 4:return u.fn.call(u.context,o,c,_),!0;case 5:return u.fn.call(u.context,o,c,_,v),!0;case 6:return u.fn.call(u.context,o,c,_,v,h),!0}for(p=1,b=new Array(w-1);p<w;p++)b[p-1]=arguments[p];u.fn.apply(u.context,b)}else{var K=u.length,g;for(p=0;p<K;p++)switch(u[p].once&&this.removeListener(t,u[p].fn,void 0,!0),w){case 1:u[p].fn.call(u[p].context);break;case 2:u[p].fn.call(u[p].context,o);break;case 3:u[p].fn.call(u[p].context,o,c);break;case 4:u[p].fn.call(u[p].context,o,c,_);break;default:if(!b)for(g=1,b=new Array(w-1);g<w;g++)b[g-1]=arguments[g];u[p].fn.apply(u[p].context,b)}}return!0},l.prototype.on=function(t,o,c){return r(this,t,o,c,!1)},l.prototype.once=function(t,o,c){return r(this,t,o,c,!0)},l.prototype.removeListener=function(t,o,c,_){var v=e?e+t:t;if(!this._events[v])return this;if(!o)return d(this,v),this;var h=this._events[v];if(h.fn)h.fn===o&&(!_||h.once)&&(!c||h.context===c)&&d(this,v);else{for(var y=0,u=[],w=h.length;y<w;y++)(h[y].fn!==o||_&&!h[y].once||c&&h[y].context!==c)&&u.push(h[y]);u.length?this._events[v]=u.length===1?u[0]:u:d(this,v)}return this},l.prototype.removeAllListeners=function(t){var o;return t?(o=e?e+t:t,this._events[o]&&d(this,o)):(this._events=new n,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=e,l.EventEmitter=l,f.exports=l}(C)),C.exports}var H=D();const N=W(H);var m=function(f,s,e,n){function i(r){return r instanceof e?r:new e(function(d){d(r)})}return new(e||(e=Promise))(function(r,d){function l(o){try{t(n.next(o))}catch(c){d(c)}}function a(o){try{t(n.throw(o))}catch(c){d(c)}}function t(o){o.done?r(o.value):i(o.value).then(l,a)}t((n=n.apply(f,s||[])).next())})};class z extends N{constructor(s,e){if(super(),this._network=e,this._publicKey=null,this._popup=null,this._handlerAdded=!1,this._nextRequestId=1,this._autoApprove=!1,this._responsePromises=new Map,this.handleMessage=n=>{var i;if(this._injectedProvider&&n.source===window||n.origin===((i=this._providerUrl)===null||i===void 0?void 0:i.origin)&&n.source===this._popup){if(n.data.method==="connected"){const r=new T(n.data.params.publicKey);(!this._publicKey||!this._publicKey.equals(r))&&(this._publicKey&&!this._publicKey.equals(r)&&this.handleDisconnect(),this._publicKey=r,this._autoApprove=!!n.data.params.autoApprove,this.emit("connect",this._publicKey))}else if(n.data.method==="disconnected")this.handleDisconnect();else if(n.data.result||n.data.error){const r=this._responsePromises.get(n.data.id);if(r){const[d,l]=r;n.data.result?d(n.data.result):l(new Error(n.data.error))}}}},this._beforeUnload=()=>{this.disconnect()},B(s))this._injectedProvider=s;else if(G(s))this._providerUrl=new URL(s),this._providerUrl.hash=new URLSearchParams({origin:window.location.origin,network:this._network}).toString();else throw new Error("provider parameter must be an injected provider or a URL string.")}handleConnect(){var s;return this._handlerAdded||(this._handlerAdded=!0,window.addEventListener("message",this.handleMessage),window.addEventListener("beforeunload",this._beforeUnload)),this._injectedProvider?new Promise(e=>{this.sendRequest("connect",{}),e()}):(window.name="parent",this._popup=window.open((s=this._providerUrl)===null||s===void 0?void 0:s.toString(),"_blank","location,resizable,width=460,height=675"),new Promise(e=>{this.once("connect",e)}))}handleDisconnect(){this._handlerAdded&&(this._handlerAdded=!1,window.removeEventListener("message",this.handleMessage),window.removeEventListener("beforeunload",this._beforeUnload)),this._publicKey&&(this._publicKey=null,this.emit("disconnect")),this._responsePromises.forEach(([,s],e)=>{this._responsePromises.delete(e),s(new Error("Wallet disconnected"))})}sendRequest(s,e){return m(this,void 0,void 0,function*(){if(s!=="connect"&&!this.connected)throw new Error("Wallet not connected");const n=this._nextRequestId;return++this._nextRequestId,new Promise((i,r)=>{var d,l,a,t;this._responsePromises.set(n,[i,r]),this._injectedProvider?this._injectedProvider.postMessage({jsonrpc:"2.0",id:n,method:s,params:Object.assign({network:this._network},e)}):((d=this._popup)===null||d===void 0||d.postMessage({jsonrpc:"2.0",id:n,method:s,params:e},(a=(l=this._providerUrl)===null||l===void 0?void 0:l.origin)!==null&&a!==void 0?a:""),this.autoApprove||(t=this._popup)===null||t===void 0||t.focus())})})}get publicKey(){return this._publicKey}get connected(){return this._publicKey!==null}get autoApprove(){return this._autoApprove}connect(){return m(this,void 0,void 0,function*(){this._popup&&this._popup.close(),yield this.handleConnect()})}disconnect(){return m(this,void 0,void 0,function*(){this._injectedProvider&&(yield this.sendRequest("disconnect",{})),this._popup&&this._popup.close(),this.handleDisconnect()})}sign(s,e){return m(this,void 0,void 0,function*(){if(!(s instanceof Uint8Array))throw new Error("Data must be an instance of Uint8Array");const n=yield this.sendRequest("sign",{data:s,display:e}),i=A.decode(n.signature),r=new T(n.publicKey);return{signature:i,publicKey:r}})}signTransaction(s){return m(this,void 0,void 0,function*(){const e=yield this.sendRequest("signTransaction",{message:A.encode(s.serializeMessage())}),n=A.decode(e.signature),i=new T(e.publicKey);return s.addSignature(i,n),s})}signAllTransactions(s){return m(this,void 0,void 0,function*(){const e=yield this.sendRequest("signAllTransactions",{messages:s.map(r=>A.encode(r.serializeMessage()))}),n=e.signatures.map(r=>A.decode(r)),i=new T(e.publicKey);return s=s.map((r,d)=>(r.addSignature(i,n[d]),r)),s})}diffieHellman(s){return m(this,void 0,void 0,function*(){if(!(s instanceof Uint8Array))throw new Error("Data must be an instance of Uint8Array");return yield this.sendRequest("diffieHellman",{publicKey:s})})}}function G(f){return typeof f=="string"}function B(f){return F(f)&&"postMessage"in f&&typeof f.postMessage=="function"}function F(f){return typeof f=="object"&&f!==null}var J=function(){var f=function(s,e){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[r]=i[r])},f(s,e)};return function(s,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");f(s,e);function n(){this.constructor=s}s.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),O=function(f,s,e,n){function i(r){return r instanceof e?r:new e(function(d){d(r)})}return new(e||(e=Promise))(function(r,d){function l(o){try{t(n.next(o))}catch(c){d(c)}}function a(o){try{t(n.throw(o))}catch(c){d(c)}}function t(o){o.done?r(o.value):i(o.value).then(l,a)}t((n=n.apply(f,s||[])).next())})},j=function(f,s){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,i,r,d;return d={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function l(t){return function(o){return a([t,o])}}function a(t){if(n)throw new TypeError("Generator is already executing.");for(;e;)try{if(n=1,i&&(r=t[0]&2?i.return:t[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,t[1])).done)return r;switch(i=0,r&&(t=[t[0]&2,r.value]),t[0]){case 0:case 1:r=t;break;case 4:return e.label++,{value:t[1],done:!1};case 5:e.label++,i=t[1],t=[0];continue;case 7:t=e.ops.pop(),e.trys.pop();continue;default:if(r=e.trys,!(r=r.length>0&&r[r.length-1])&&(t[0]===6||t[0]===2)){e=0;continue}if(t[0]===3&&(!r||t[1]>r[0]&&t[1]<r[3])){e.label=t[1];break}if(t[0]===6&&e.label<r[1]){e.label=r[1],r=t;break}if(r&&e.label<r[2]){e.label=r[2],e.ops.push(t);break}r[2]&&e.ops.pop(),e.trys.pop();continue}t=s.call(f,e)}catch(o){t=[6,o],i=0}finally{n=r=0}if(t[0]&5)throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}},Q=function(f){J(s,f);function s(e,n){var i=f.call(this)||this;return i._instance=null,i._handleConnect=function(){i.emit("connect")},i._handleDisconnect=function(){window.clearInterval(i._pollTimer),i.emit("disconnect")},i._provider=e,i._network=n,i}return Object.defineProperty(s.prototype,"publicKey",{get:function(){return this._instance.publicKey||null},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"connected",{get:function(){return this._instance.connected||!1},enumerable:!1,configurable:!0}),s.prototype.connect=function(){return O(this,void 0,void 0,function(){var e=this;return j(this,function(n){switch(n.label){case 0:return this._instance=new z(this._provider,this._network),this._instance.on("connect",this._handleConnect),this._instance.on("disconnect",this._handleDisconnect),this._pollTimer=window.setInterval(function(){var i,r;((r=(i=e._instance)===null||i===void 0?void 0:i._popup)===null||r===void 0?void 0:r.closed)!==!1&&e._handleDisconnect()},200),[4,this._instance.connect()];case 1:return n.sent(),[2]}})})},s.prototype.disconnect=function(){return O(this,void 0,void 0,function(){return j(this,function(e){switch(e.label){case 0:if(!this.connected)throw new Error("Wallet not connected");return this._instance.removeAllListeners("connect"),this._instance.removeAllListeners("disconnect"),[4,this._instance.disconnect()];case 1:return e.sent(),[2]}})})},s.prototype.signTransaction=function(e){return O(this,void 0,void 0,function(){return j(this,function(n){switch(n.label){case 0:if(!this.connected)throw new Error("Wallet not connected");return[4,this._instance.signTransaction(e)];case 1:return[2,n.sent()]}})})},s.prototype.signAllTransactions=function(e){return O(this,void 0,void 0,function(){return j(this,function(n){switch(n.label){case 0:if(!this.connected)throw new Error("Wallet not connected");return[4,this._instance.signAllTransactions(e)];case 1:return[2,n.sent()]}})})},s.prototype.signMessage=function(e,n){return n===void 0&&(n="hex"),O(this,void 0,void 0,function(){var i;return j(this,function(r){switch(r.label){case 0:if(!this.connected)throw new Error("Wallet not connected");return[4,this._instance.sign(e,n)];case 1:return i=r.sent().signature,[2,Uint8Array.from(i)]}})})},s}(q),V=function(){var f=function(s,e){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[r]=i[r])},f(s,e)};return function(s,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");f(s,e);function n(){this.constructor=s}s.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),k=function(f,s,e,n){function i(r){return r instanceof e?r:new e(function(d){d(r)})}return new(e||(e=Promise))(function(r,d){function l(o){try{t(n.next(o))}catch(c){d(c)}}function a(o){try{t(n.throw(o))}catch(c){d(c)}}function t(o){o.done?r(o.value):i(o.value).then(l,a)}t((n=n.apply(f,s||[])).next())})},P=function(f,s){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,i,r,d;return d={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function l(t){return function(o){return a([t,o])}}function a(t){if(n)throw new TypeError("Generator is already executing.");for(;e;)try{if(n=1,i&&(r=t[0]&2?i.return:t[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,t[1])).done)return r;switch(i=0,r&&(t=[t[0]&2,r.value]),t[0]){case 0:case 1:r=t;break;case 4:return e.label++,{value:t[1],done:!1};case 5:e.label++,i=t[1],t=[0];continue;case 7:t=e.ops.pop(),e.trys.pop();continue;default:if(r=e.trys,!(r=r.length>0&&r[r.length-1])&&(t[0]===6||t[0]===2)){e=0;continue}if(t[0]===3&&(!r||t[1]>r[0]&&t[1]<r[3])){e.label=t[1];break}if(t[0]===6&&e.label<r[1]){e.label=r[1],r=t;break}if(r&&e.label<r[2]){e.label=r[2],e.ops.push(t);break}r[2]&&e.ops.pop(),e.trys.pop();continue}t=s.call(f,e)}catch(o){t=[6,o],i=0}finally{n=r=0}if(t[0]&5)throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}},X=function(f){V(s,f);function s(e,n){var i=f.call(this)||this;return i._provider=e,i._network=n,i}return Object.defineProperty(s.prototype,"publicKey",{get:function(){return this._provider.publicKey},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"connected",{get:function(){return this._provider.isConnected},enumerable:!1,configurable:!0}),s.prototype.connect=function(){return k(this,void 0,void 0,function(){var e;return P(this,function(n){switch(n.label){case 0:if(n.trys.push([0,2,,3]),this.connected)throw new Error("Wallet already connected");return[4,this._provider.connect()];case 1:return n.sent(),this.emit("connect"),[3,3];case 2:throw e=n.sent(),this.emit("disconnect"),e;case 3:return[2]}})})},s.prototype.disconnect=function(){return k(this,void 0,void 0,function(){return P(this,function(e){switch(e.label){case 0:if(!this.connected)throw new Error("Wallet not connected");return[4,this._provider.disconnect()];case 1:return e.sent(),this.emit("disconnect"),[2]}})})},s.prototype.signTransaction=function(e){return k(this,void 0,void 0,function(){return P(this,function(n){switch(n.label){case 0:if(!this.connected)throw new Error("Wallet not connected");return[4,this._provider.signTransaction(e,this._network)];case 1:return[2,n.sent()]}})})},s.prototype.signAllTransactions=function(e){return k(this,void 0,void 0,function(){return P(this,function(n){switch(n.label){case 0:if(!this.connected)throw new Error("Wallet not connected");return[4,this._provider.signAllTransactions(e,this._network)];case 1:return[2,n.sent()]}})})},s.prototype.signMessage=function(e){return k(this,void 0,void 0,function(){var n;return P(this,function(i){switch(i.label){case 0:if(!this.connected)throw new Error("Wallet not connected");if(!(e instanceof Uint8Array))throw new Error("Data must be an instance of Uint8Array");return[4,this._provider.signMessage(e)];case 1:return n=i.sent().signature,[2,n]}})})},s}(q),Y=function(){var f=function(s,e){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[r]=i[r])},f(s,e)};return function(s,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");f(s,e);function n(){this.constructor=s}s.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),x=function(f,s,e,n){function i(r){return r instanceof e?r:new e(function(d){d(r)})}return new(e||(e=Promise))(function(r,d){function l(o){try{t(n.next(o))}catch(c){d(c)}}function a(o){try{t(n.throw(o))}catch(c){d(c)}}function t(o){o.done?r(o.value):i(o.value).then(l,a)}t((n=n.apply(f,s||[])).next())})},E=function(f,s){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,i,r,d;return d={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function l(t){return function(o){return a([t,o])}}function a(t){if(n)throw new TypeError("Generator is already executing.");for(;e;)try{if(n=1,i&&(r=t[0]&2?i.return:t[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,t[1])).done)return r;switch(i=0,r&&(t=[t[0]&2,r.value]),t[0]){case 0:case 1:r=t;break;case 4:return e.label++,{value:t[1],done:!1};case 5:e.label++,i=t[1],t=[0];continue;case 7:t=e.ops.pop(),e.trys.pop();continue;default:if(r=e.trys,!(r=r.length>0&&r[r.length-1])&&(t[0]===6||t[0]===2)){e=0;continue}if(t[0]===3&&(!r||t[1]>r[0]&&t[1]<r[3])){e.label=t[1];break}if(t[0]===6&&e.label<r[1]){e.label=r[1],r=t;break}if(r&&e.label<r[2]){e.label=r[2],e.ops.push(t);break}r[2]&&e.ops.pop(),e.trys.pop();continue}t=s.call(f,e)}catch(o){t=[6,o],i=0}finally{n=r=0}if(t[0]&5)throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}},ne=function(f){Y(s,f);function s(e){var n=f.call(this)||this;return n._network="mainnet-beta",n._adapterInstance=null,n._connectHandler=null,n._connected=function(){n._connectHandler&&(n._connectHandler.resolve(),n._connectHandler=null),n.emit("connect",n.publicKey)},n._disconnected=function(){n._connectHandler&&(n._connectHandler.reject(),n._connectHandler=null),n._adapterInstance=null,n.emit("disconnect")},e?.network&&(n._network=e?.network),e?.provider?n._provider=e?.provider:window.salmon?n._provider=window.salmon:n._provider="https://app.salmonwallet.io",n}return Object.defineProperty(s.prototype,"publicKey",{get:function(){var e;return((e=this._adapterInstance)===null||e===void 0?void 0:e.publicKey)||null},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"isConnected",{get:function(){var e;return!!(!((e=this._adapterInstance)===null||e===void 0)&&e.connected)},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"connected",{get:function(){return this.isConnected},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"autoApprove",{get:function(){return!1},enumerable:!1,configurable:!0}),s.prototype.connect=function(){return x(this,void 0,void 0,function(){var e=this;return E(this,function(n){switch(n.label){case 0:return this.connected?[2]:(typeof this._provider=="string"?this._adapterInstance=new Q(this._provider,this._network):this._adapterInstance=new X(this._provider,this._network),this._adapterInstance.on("connect",this._connected),this._adapterInstance.on("disconnect",this._disconnected),this._adapterInstance.connect(),[4,new Promise(function(i,r){e._connectHandler={resolve:i,reject:r}})]);case 1:return n.sent(),[2]}})})},s.prototype.disconnect=function(){return x(this,void 0,void 0,function(){return E(this,function(e){switch(e.label){case 0:return this._adapterInstance?[4,this._adapterInstance.disconnect()]:[2];case 1:return e.sent(),[2]}})})},s.prototype.signTransaction=function(e){return x(this,void 0,void 0,function(){return E(this,function(n){switch(n.label){case 0:if(!this.connected)throw new Error("Wallet not connected");return[4,this._adapterInstance.signTransaction(e)];case 1:return[2,n.sent()]}})})},s.prototype.signAllTransactions=function(e){return x(this,void 0,void 0,function(){return E(this,function(n){switch(n.label){case 0:if(!this.connected)throw new Error("Wallet not connected");return[4,this._adapterInstance.signAllTransactions(e)];case 1:return[2,n.sent()]}})})},s.prototype.signMessage=function(e,n){return n===void 0&&(n="utf8"),x(this,void 0,void 0,function(){return E(this,function(i){switch(i.label){case 0:if(!this.connected)throw new Error("Wallet not connected");return[4,this._adapterInstance.signMessage(e,n)];case 1:return[2,i.sent()]}})})},s.prototype.sign=function(e,n){return n===void 0&&(n="utf8"),x(this,void 0,void 0,function(){return E(this,function(i){switch(i.label){case 0:return[4,this.signMessage(e,n)];case 1:return[2,i.sent()]}})})},s}(U);export{ne as default};
|
|
1
|
+
import{g as W}from"./vendor-dayjs-CzbnksQQ.js";import{P as T,B as A}from"./vendor-web3-DH4JU5BG.js";import"./vendor-vue-1w_NBnjl.js";var L={exports:{}},S;function M(){return S||(S=1,function(f){var s=Object.prototype.hasOwnProperty,e="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(e=!1));function i(a,t,o){this.fn=a,this.context=t,this.once=o||!1}function r(a,t,o,c,_){if(typeof o!="function")throw new TypeError("The listener must be a function");var v=new i(o,c||a,_),h=e?e+t:t;return a._events[h]?a._events[h].fn?a._events[h]=[a._events[h],v]:a._events[h].push(v):(a._events[h]=v,a._eventsCount++),a}function d(a,t){--a._eventsCount===0?a._events=new n:delete a._events[t]}function l(){this._events=new n,this._eventsCount=0}l.prototype.eventNames=function(){var t=[],o,c;if(this._eventsCount===0)return t;for(c in o=this._events)s.call(o,c)&&t.push(e?c.slice(1):c);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(o)):t},l.prototype.listeners=function(t){var o=e?e+t:t,c=this._events[o];if(!c)return[];if(c.fn)return[c.fn];for(var _=0,v=c.length,h=new Array(v);_<v;_++)h[_]=c[_].fn;return h},l.prototype.listenerCount=function(t){var o=e?e+t:t,c=this._events[o];return c?c.fn?1:c.length:0},l.prototype.emit=function(t,o,c,_,v,h){var y=e?e+t:t;if(!this._events[y])return!1;var u=this._events[y],w=arguments.length,b,p;if(u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),w){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,o),!0;case 3:return u.fn.call(u.context,o,c),!0;case 4:return u.fn.call(u.context,o,c,_),!0;case 5:return u.fn.call(u.context,o,c,_,v),!0;case 6:return u.fn.call(u.context,o,c,_,v,h),!0}for(p=1,b=new Array(w-1);p<w;p++)b[p-1]=arguments[p];u.fn.apply(u.context,b)}else{var K=u.length,g;for(p=0;p<K;p++)switch(u[p].once&&this.removeListener(t,u[p].fn,void 0,!0),w){case 1:u[p].fn.call(u[p].context);break;case 2:u[p].fn.call(u[p].context,o);break;case 3:u[p].fn.call(u[p].context,o,c);break;case 4:u[p].fn.call(u[p].context,o,c,_);break;default:if(!b)for(g=1,b=new Array(w-1);g<w;g++)b[g-1]=arguments[g];u[p].fn.apply(u[p].context,b)}}return!0},l.prototype.on=function(t,o,c){return r(this,t,o,c,!1)},l.prototype.once=function(t,o,c){return r(this,t,o,c,!0)},l.prototype.removeListener=function(t,o,c,_){var v=e?e+t:t;if(!this._events[v])return this;if(!o)return d(this,v),this;var h=this._events[v];if(h.fn)h.fn===o&&(!_||h.once)&&(!c||h.context===c)&&d(this,v);else{for(var y=0,u=[],w=h.length;y<w;y++)(h[y].fn!==o||_&&!h[y].once||c&&h[y].context!==c)&&u.push(h[y]);u.length?this._events[v]=u.length===1?u[0]:u:d(this,v)}return this},l.prototype.removeAllListeners=function(t){var o;return t?(o=e?e+t:t,this._events[o]&&d(this,o)):(this._events=new n,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=e,l.EventEmitter=l,f.exports=l}(L)),L.exports}var R=M();const U=W(R);var $=function(){var f=function(s,e){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[r]=i[r])},f(s,e)};return function(s,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");f(s,e);function n(){this.constructor=s}s.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),q=function(f){$(s,f);function s(){return f!==null&&f.apply(this,arguments)||this}return s}(U),C={exports:{}},I;function D(){return I||(I=1,function(f){var s=Object.prototype.hasOwnProperty,e="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(e=!1));function i(a,t,o){this.fn=a,this.context=t,this.once=o||!1}function r(a,t,o,c,_){if(typeof o!="function")throw new TypeError("The listener must be a function");var v=new i(o,c||a,_),h=e?e+t:t;return a._events[h]?a._events[h].fn?a._events[h]=[a._events[h],v]:a._events[h].push(v):(a._events[h]=v,a._eventsCount++),a}function d(a,t){--a._eventsCount===0?a._events=new n:delete a._events[t]}function l(){this._events=new n,this._eventsCount=0}l.prototype.eventNames=function(){var t=[],o,c;if(this._eventsCount===0)return t;for(c in o=this._events)s.call(o,c)&&t.push(e?c.slice(1):c);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(o)):t},l.prototype.listeners=function(t){var o=e?e+t:t,c=this._events[o];if(!c)return[];if(c.fn)return[c.fn];for(var _=0,v=c.length,h=new Array(v);_<v;_++)h[_]=c[_].fn;return h},l.prototype.listenerCount=function(t){var o=e?e+t:t,c=this._events[o];return c?c.fn?1:c.length:0},l.prototype.emit=function(t,o,c,_,v,h){var y=e?e+t:t;if(!this._events[y])return!1;var u=this._events[y],w=arguments.length,b,p;if(u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),w){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,o),!0;case 3:return u.fn.call(u.context,o,c),!0;case 4:return u.fn.call(u.context,o,c,_),!0;case 5:return u.fn.call(u.context,o,c,_,v),!0;case 6:return u.fn.call(u.context,o,c,_,v,h),!0}for(p=1,b=new Array(w-1);p<w;p++)b[p-1]=arguments[p];u.fn.apply(u.context,b)}else{var K=u.length,g;for(p=0;p<K;p++)switch(u[p].once&&this.removeListener(t,u[p].fn,void 0,!0),w){case 1:u[p].fn.call(u[p].context);break;case 2:u[p].fn.call(u[p].context,o);break;case 3:u[p].fn.call(u[p].context,o,c);break;case 4:u[p].fn.call(u[p].context,o,c,_);break;default:if(!b)for(g=1,b=new Array(w-1);g<w;g++)b[g-1]=arguments[g];u[p].fn.apply(u[p].context,b)}}return!0},l.prototype.on=function(t,o,c){return r(this,t,o,c,!1)},l.prototype.once=function(t,o,c){return r(this,t,o,c,!0)},l.prototype.removeListener=function(t,o,c,_){var v=e?e+t:t;if(!this._events[v])return this;if(!o)return d(this,v),this;var h=this._events[v];if(h.fn)h.fn===o&&(!_||h.once)&&(!c||h.context===c)&&d(this,v);else{for(var y=0,u=[],w=h.length;y<w;y++)(h[y].fn!==o||_&&!h[y].once||c&&h[y].context!==c)&&u.push(h[y]);u.length?this._events[v]=u.length===1?u[0]:u:d(this,v)}return this},l.prototype.removeAllListeners=function(t){var o;return t?(o=e?e+t:t,this._events[o]&&d(this,o)):(this._events=new n,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=e,l.EventEmitter=l,f.exports=l}(C)),C.exports}var H=D();const N=W(H);var m=function(f,s,e,n){function i(r){return r instanceof e?r:new e(function(d){d(r)})}return new(e||(e=Promise))(function(r,d){function l(o){try{t(n.next(o))}catch(c){d(c)}}function a(o){try{t(n.throw(o))}catch(c){d(c)}}function t(o){o.done?r(o.value):i(o.value).then(l,a)}t((n=n.apply(f,s||[])).next())})};class z extends N{constructor(s,e){if(super(),this._network=e,this._publicKey=null,this._popup=null,this._handlerAdded=!1,this._nextRequestId=1,this._autoApprove=!1,this._responsePromises=new Map,this.handleMessage=n=>{var i;if(this._injectedProvider&&n.source===window||n.origin===((i=this._providerUrl)===null||i===void 0?void 0:i.origin)&&n.source===this._popup){if(n.data.method==="connected"){const r=new T(n.data.params.publicKey);(!this._publicKey||!this._publicKey.equals(r))&&(this._publicKey&&!this._publicKey.equals(r)&&this.handleDisconnect(),this._publicKey=r,this._autoApprove=!!n.data.params.autoApprove,this.emit("connect",this._publicKey))}else if(n.data.method==="disconnected")this.handleDisconnect();else if(n.data.result||n.data.error){const r=this._responsePromises.get(n.data.id);if(r){const[d,l]=r;n.data.result?d(n.data.result):l(new Error(n.data.error))}}}},this._beforeUnload=()=>{this.disconnect()},B(s))this._injectedProvider=s;else if(G(s))this._providerUrl=new URL(s),this._providerUrl.hash=new URLSearchParams({origin:window.location.origin,network:this._network}).toString();else throw new Error("provider parameter must be an injected provider or a URL string.")}handleConnect(){var s;return this._handlerAdded||(this._handlerAdded=!0,window.addEventListener("message",this.handleMessage),window.addEventListener("beforeunload",this._beforeUnload)),this._injectedProvider?new Promise(e=>{this.sendRequest("connect",{}),e()}):(window.name="parent",this._popup=window.open((s=this._providerUrl)===null||s===void 0?void 0:s.toString(),"_blank","location,resizable,width=460,height=675"),new Promise(e=>{this.once("connect",e)}))}handleDisconnect(){this._handlerAdded&&(this._handlerAdded=!1,window.removeEventListener("message",this.handleMessage),window.removeEventListener("beforeunload",this._beforeUnload)),this._publicKey&&(this._publicKey=null,this.emit("disconnect")),this._responsePromises.forEach(([,s],e)=>{this._responsePromises.delete(e),s(new Error("Wallet disconnected"))})}sendRequest(s,e){return m(this,void 0,void 0,function*(){if(s!=="connect"&&!this.connected)throw new Error("Wallet not connected");const n=this._nextRequestId;return++this._nextRequestId,new Promise((i,r)=>{var d,l,a,t;this._responsePromises.set(n,[i,r]),this._injectedProvider?this._injectedProvider.postMessage({jsonrpc:"2.0",id:n,method:s,params:Object.assign({network:this._network},e)}):((d=this._popup)===null||d===void 0||d.postMessage({jsonrpc:"2.0",id:n,method:s,params:e},(a=(l=this._providerUrl)===null||l===void 0?void 0:l.origin)!==null&&a!==void 0?a:""),this.autoApprove||(t=this._popup)===null||t===void 0||t.focus())})})}get publicKey(){return this._publicKey}get connected(){return this._publicKey!==null}get autoApprove(){return this._autoApprove}connect(){return m(this,void 0,void 0,function*(){this._popup&&this._popup.close(),yield this.handleConnect()})}disconnect(){return m(this,void 0,void 0,function*(){this._injectedProvider&&(yield this.sendRequest("disconnect",{})),this._popup&&this._popup.close(),this.handleDisconnect()})}sign(s,e){return m(this,void 0,void 0,function*(){if(!(s instanceof Uint8Array))throw new Error("Data must be an instance of Uint8Array");const n=yield this.sendRequest("sign",{data:s,display:e}),i=A.decode(n.signature),r=new T(n.publicKey);return{signature:i,publicKey:r}})}signTransaction(s){return m(this,void 0,void 0,function*(){const e=yield this.sendRequest("signTransaction",{message:A.encode(s.serializeMessage())}),n=A.decode(e.signature),i=new T(e.publicKey);return s.addSignature(i,n),s})}signAllTransactions(s){return m(this,void 0,void 0,function*(){const e=yield this.sendRequest("signAllTransactions",{messages:s.map(r=>A.encode(r.serializeMessage()))}),n=e.signatures.map(r=>A.decode(r)),i=new T(e.publicKey);return s=s.map((r,d)=>(r.addSignature(i,n[d]),r)),s})}diffieHellman(s){return m(this,void 0,void 0,function*(){if(!(s instanceof Uint8Array))throw new Error("Data must be an instance of Uint8Array");return yield this.sendRequest("diffieHellman",{publicKey:s})})}}function G(f){return typeof f=="string"}function B(f){return F(f)&&"postMessage"in f&&typeof f.postMessage=="function"}function F(f){return typeof f=="object"&&f!==null}var J=function(){var f=function(s,e){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[r]=i[r])},f(s,e)};return function(s,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");f(s,e);function n(){this.constructor=s}s.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),O=function(f,s,e,n){function i(r){return r instanceof e?r:new e(function(d){d(r)})}return new(e||(e=Promise))(function(r,d){function l(o){try{t(n.next(o))}catch(c){d(c)}}function a(o){try{t(n.throw(o))}catch(c){d(c)}}function t(o){o.done?r(o.value):i(o.value).then(l,a)}t((n=n.apply(f,s||[])).next())})},j=function(f,s){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,i,r,d;return d={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function l(t){return function(o){return a([t,o])}}function a(t){if(n)throw new TypeError("Generator is already executing.");for(;e;)try{if(n=1,i&&(r=t[0]&2?i.return:t[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,t[1])).done)return r;switch(i=0,r&&(t=[t[0]&2,r.value]),t[0]){case 0:case 1:r=t;break;case 4:return e.label++,{value:t[1],done:!1};case 5:e.label++,i=t[1],t=[0];continue;case 7:t=e.ops.pop(),e.trys.pop();continue;default:if(r=e.trys,!(r=r.length>0&&r[r.length-1])&&(t[0]===6||t[0]===2)){e=0;continue}if(t[0]===3&&(!r||t[1]>r[0]&&t[1]<r[3])){e.label=t[1];break}if(t[0]===6&&e.label<r[1]){e.label=r[1],r=t;break}if(r&&e.label<r[2]){e.label=r[2],e.ops.push(t);break}r[2]&&e.ops.pop(),e.trys.pop();continue}t=s.call(f,e)}catch(o){t=[6,o],i=0}finally{n=r=0}if(t[0]&5)throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}},Q=function(f){J(s,f);function s(e,n){var i=f.call(this)||this;return i._instance=null,i._handleConnect=function(){i.emit("connect")},i._handleDisconnect=function(){window.clearInterval(i._pollTimer),i.emit("disconnect")},i._provider=e,i._network=n,i}return Object.defineProperty(s.prototype,"publicKey",{get:function(){return this._instance.publicKey||null},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"connected",{get:function(){return this._instance.connected||!1},enumerable:!1,configurable:!0}),s.prototype.connect=function(){return O(this,void 0,void 0,function(){var e=this;return j(this,function(n){switch(n.label){case 0:return this._instance=new z(this._provider,this._network),this._instance.on("connect",this._handleConnect),this._instance.on("disconnect",this._handleDisconnect),this._pollTimer=window.setInterval(function(){var i,r;((r=(i=e._instance)===null||i===void 0?void 0:i._popup)===null||r===void 0?void 0:r.closed)!==!1&&e._handleDisconnect()},200),[4,this._instance.connect()];case 1:return n.sent(),[2]}})})},s.prototype.disconnect=function(){return O(this,void 0,void 0,function(){return j(this,function(e){switch(e.label){case 0:if(!this.connected)throw new Error("Wallet not connected");return this._instance.removeAllListeners("connect"),this._instance.removeAllListeners("disconnect"),[4,this._instance.disconnect()];case 1:return e.sent(),[2]}})})},s.prototype.signTransaction=function(e){return O(this,void 0,void 0,function(){return j(this,function(n){switch(n.label){case 0:if(!this.connected)throw new Error("Wallet not connected");return[4,this._instance.signTransaction(e)];case 1:return[2,n.sent()]}})})},s.prototype.signAllTransactions=function(e){return O(this,void 0,void 0,function(){return j(this,function(n){switch(n.label){case 0:if(!this.connected)throw new Error("Wallet not connected");return[4,this._instance.signAllTransactions(e)];case 1:return[2,n.sent()]}})})},s.prototype.signMessage=function(e,n){return n===void 0&&(n="hex"),O(this,void 0,void 0,function(){var i;return j(this,function(r){switch(r.label){case 0:if(!this.connected)throw new Error("Wallet not connected");return[4,this._instance.sign(e,n)];case 1:return i=r.sent().signature,[2,Uint8Array.from(i)]}})})},s}(q),V=function(){var f=function(s,e){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[r]=i[r])},f(s,e)};return function(s,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");f(s,e);function n(){this.constructor=s}s.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),k=function(f,s,e,n){function i(r){return r instanceof e?r:new e(function(d){d(r)})}return new(e||(e=Promise))(function(r,d){function l(o){try{t(n.next(o))}catch(c){d(c)}}function a(o){try{t(n.throw(o))}catch(c){d(c)}}function t(o){o.done?r(o.value):i(o.value).then(l,a)}t((n=n.apply(f,s||[])).next())})},P=function(f,s){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,i,r,d;return d={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function l(t){return function(o){return a([t,o])}}function a(t){if(n)throw new TypeError("Generator is already executing.");for(;e;)try{if(n=1,i&&(r=t[0]&2?i.return:t[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,t[1])).done)return r;switch(i=0,r&&(t=[t[0]&2,r.value]),t[0]){case 0:case 1:r=t;break;case 4:return e.label++,{value:t[1],done:!1};case 5:e.label++,i=t[1],t=[0];continue;case 7:t=e.ops.pop(),e.trys.pop();continue;default:if(r=e.trys,!(r=r.length>0&&r[r.length-1])&&(t[0]===6||t[0]===2)){e=0;continue}if(t[0]===3&&(!r||t[1]>r[0]&&t[1]<r[3])){e.label=t[1];break}if(t[0]===6&&e.label<r[1]){e.label=r[1],r=t;break}if(r&&e.label<r[2]){e.label=r[2],e.ops.push(t);break}r[2]&&e.ops.pop(),e.trys.pop();continue}t=s.call(f,e)}catch(o){t=[6,o],i=0}finally{n=r=0}if(t[0]&5)throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}},X=function(f){V(s,f);function s(e,n){var i=f.call(this)||this;return i._provider=e,i._network=n,i}return Object.defineProperty(s.prototype,"publicKey",{get:function(){return this._provider.publicKey},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"connected",{get:function(){return this._provider.isConnected},enumerable:!1,configurable:!0}),s.prototype.connect=function(){return k(this,void 0,void 0,function(){var e;return P(this,function(n){switch(n.label){case 0:if(n.trys.push([0,2,,3]),this.connected)throw new Error("Wallet already connected");return[4,this._provider.connect()];case 1:return n.sent(),this.emit("connect"),[3,3];case 2:throw e=n.sent(),this.emit("disconnect"),e;case 3:return[2]}})})},s.prototype.disconnect=function(){return k(this,void 0,void 0,function(){return P(this,function(e){switch(e.label){case 0:if(!this.connected)throw new Error("Wallet not connected");return[4,this._provider.disconnect()];case 1:return e.sent(),this.emit("disconnect"),[2]}})})},s.prototype.signTransaction=function(e){return k(this,void 0,void 0,function(){return P(this,function(n){switch(n.label){case 0:if(!this.connected)throw new Error("Wallet not connected");return[4,this._provider.signTransaction(e,this._network)];case 1:return[2,n.sent()]}})})},s.prototype.signAllTransactions=function(e){return k(this,void 0,void 0,function(){return P(this,function(n){switch(n.label){case 0:if(!this.connected)throw new Error("Wallet not connected");return[4,this._provider.signAllTransactions(e,this._network)];case 1:return[2,n.sent()]}})})},s.prototype.signMessage=function(e){return k(this,void 0,void 0,function(){var n;return P(this,function(i){switch(i.label){case 0:if(!this.connected)throw new Error("Wallet not connected");if(!(e instanceof Uint8Array))throw new Error("Data must be an instance of Uint8Array");return[4,this._provider.signMessage(e)];case 1:return n=i.sent().signature,[2,n]}})})},s}(q),Y=function(){var f=function(s,e){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[r]=i[r])},f(s,e)};return function(s,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");f(s,e);function n(){this.constructor=s}s.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),x=function(f,s,e,n){function i(r){return r instanceof e?r:new e(function(d){d(r)})}return new(e||(e=Promise))(function(r,d){function l(o){try{t(n.next(o))}catch(c){d(c)}}function a(o){try{t(n.throw(o))}catch(c){d(c)}}function t(o){o.done?r(o.value):i(o.value).then(l,a)}t((n=n.apply(f,s||[])).next())})},E=function(f,s){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,i,r,d;return d={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function l(t){return function(o){return a([t,o])}}function a(t){if(n)throw new TypeError("Generator is already executing.");for(;e;)try{if(n=1,i&&(r=t[0]&2?i.return:t[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,t[1])).done)return r;switch(i=0,r&&(t=[t[0]&2,r.value]),t[0]){case 0:case 1:r=t;break;case 4:return e.label++,{value:t[1],done:!1};case 5:e.label++,i=t[1],t=[0];continue;case 7:t=e.ops.pop(),e.trys.pop();continue;default:if(r=e.trys,!(r=r.length>0&&r[r.length-1])&&(t[0]===6||t[0]===2)){e=0;continue}if(t[0]===3&&(!r||t[1]>r[0]&&t[1]<r[3])){e.label=t[1];break}if(t[0]===6&&e.label<r[1]){e.label=r[1],r=t;break}if(r&&e.label<r[2]){e.label=r[2],e.ops.push(t);break}r[2]&&e.ops.pop(),e.trys.pop();continue}t=s.call(f,e)}catch(o){t=[6,o],i=0}finally{n=r=0}if(t[0]&5)throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}},ne=function(f){Y(s,f);function s(e){var n=f.call(this)||this;return n._network="mainnet-beta",n._adapterInstance=null,n._connectHandler=null,n._connected=function(){n._connectHandler&&(n._connectHandler.resolve(),n._connectHandler=null),n.emit("connect",n.publicKey)},n._disconnected=function(){n._connectHandler&&(n._connectHandler.reject(),n._connectHandler=null),n._adapterInstance=null,n.emit("disconnect")},e?.network&&(n._network=e?.network),e?.provider?n._provider=e?.provider:window.salmon?n._provider=window.salmon:n._provider="https://app.salmonwallet.io",n}return Object.defineProperty(s.prototype,"publicKey",{get:function(){var e;return((e=this._adapterInstance)===null||e===void 0?void 0:e.publicKey)||null},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"isConnected",{get:function(){var e;return!!(!((e=this._adapterInstance)===null||e===void 0)&&e.connected)},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"connected",{get:function(){return this.isConnected},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"autoApprove",{get:function(){return!1},enumerable:!1,configurable:!0}),s.prototype.connect=function(){return x(this,void 0,void 0,function(){var e=this;return E(this,function(n){switch(n.label){case 0:return this.connected?[2]:(typeof this._provider=="string"?this._adapterInstance=new Q(this._provider,this._network):this._adapterInstance=new X(this._provider,this._network),this._adapterInstance.on("connect",this._connected),this._adapterInstance.on("disconnect",this._disconnected),this._adapterInstance.connect(),[4,new Promise(function(i,r){e._connectHandler={resolve:i,reject:r}})]);case 1:return n.sent(),[2]}})})},s.prototype.disconnect=function(){return x(this,void 0,void 0,function(){return E(this,function(e){switch(e.label){case 0:return this._adapterInstance?[4,this._adapterInstance.disconnect()]:[2];case 1:return e.sent(),[2]}})})},s.prototype.signTransaction=function(e){return x(this,void 0,void 0,function(){return E(this,function(n){switch(n.label){case 0:if(!this.connected)throw new Error("Wallet not connected");return[4,this._adapterInstance.signTransaction(e)];case 1:return[2,n.sent()]}})})},s.prototype.signAllTransactions=function(e){return x(this,void 0,void 0,function(){return E(this,function(n){switch(n.label){case 0:if(!this.connected)throw new Error("Wallet not connected");return[4,this._adapterInstance.signAllTransactions(e)];case 1:return[2,n.sent()]}})})},s.prototype.signMessage=function(e,n){return n===void 0&&(n="utf8"),x(this,void 0,void 0,function(){return E(this,function(i){switch(i.label){case 0:if(!this.connected)throw new Error("Wallet not connected");return[4,this._adapterInstance.signMessage(e,n)];case 1:return[2,i.sent()]}})})},s.prototype.sign=function(e,n){return n===void 0&&(n="utf8"),x(this,void 0,void 0,function(){return E(this,function(i){switch(i.label){case 0:return[4,this.signMessage(e,n)];case 1:return[2,i.sent()]}})})},s}(U);export{ne as default};
|