@acedatacloud/nexior 3.31.0 → 3.31.1
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-FDpP6sdw.js → Auth-BMFPBOLC.js} +1 -1
- package/dist/assets/{BotPlaceholder-C_tpj9cL.js → BotPlaceholder-C2zBHB2O.js} +1 -1
- package/dist/assets/{Callback-CF8NsFTN.js → Callback-PEFsbUF_.js} +1 -1
- package/dist/assets/{Console-DyDrK8jD.js → Console-DzC4Pf1q.js} +1 -1
- package/dist/assets/{Conversation-CbIvRgjb.js → Conversation-D2Iq4Xrq.js} +1 -1
- package/dist/assets/{CopyToClipboard-BGClcrVG.js → CopyToClipboard-D0zLUUky.js} +1 -1
- package/dist/assets/{Detail-Cc46R_61.js → Detail-DXaYd7bz.js} +2 -2
- package/dist/assets/{EditArray-DhB4A-4P.js → EditArray-CKHCiyfj.js} +1 -1
- package/dist/assets/{Extra-OG6qZqkS.js → Extra-QjRtYRyw.js} +1 -1
- package/dist/assets/{FilePreview-vHpQ_39Y.js → FilePreview-Cr0a54pM.js} +1 -1
- package/dist/assets/{History-DkRw43Cl.js → History-AVZYRpis.js} +1 -1
- package/dist/assets/{ImagePreview-Dif2Q49Y.js → ImagePreview-Dl9A5DPA.js} +1 -1
- package/dist/assets/{ImageWrapper-BskBzKqs.js → ImageWrapper-SReVU_Bh.js} +1 -1
- package/dist/assets/{Index-D-RbCzhR.js → Index-BOfXGPWU.js} +1 -1
- package/dist/assets/{Index-CQsHLtL9.js → Index-BPCnDcO8.js} +1 -1
- package/dist/assets/{Index-B_WaHvVq.js → Index-BSk3PuY2.js} +1 -1
- package/dist/assets/{Index-Q9b6AHOk.css → Index-BTa-g985.css} +1 -1
- package/dist/assets/{Index-BhtS87g8.js → Index-BZNFCobX.js} +1 -1
- package/dist/assets/{Index-BJeIJzAF.js → Index-Bdyvwk3P.js} +1 -1
- package/dist/assets/{Index-DAl7VUx0.js → Index-Bryr2--q.js} +1 -1
- package/dist/assets/{Index-CvWL3dnP.js → Index-BtOH7NOk.js} +1 -1
- package/dist/assets/{Index-AOp1iyZX.js → Index-CRlM8kzc.js} +1 -1
- package/dist/assets/{Index-Bs6AJerX.js → Index-CjLBLZu5.js} +1 -1
- package/dist/assets/{Index-DI0a679Y.js → Index-CooEkPU1.js} +1 -1
- package/dist/assets/{Index-BhKFb4US.js → Index-CvDrq9oO.js} +1 -1
- package/dist/assets/{Index-fmHObafV.js → Index-CziKsoUM.js} +1 -1
- package/dist/assets/{Index-BOSlmfKu.js → Index-Di6YZiYf.js} +1 -1
- package/dist/assets/{Index-B13mfXWf.js → Index-Dj0TB3rn.js} +1 -1
- package/dist/assets/{Index-By3C66Xq.js → Index-Dp_xDqU5.js} +1 -1
- package/dist/assets/{Index-7-MqNqOx.js → Index-DvcOw7mQ.js} +1 -1
- package/dist/assets/{Index-Bi5z34-z.js → Index-L4ganskU.js} +1 -1
- package/dist/assets/{Index-CE9mr3hy.js → Index-U9e5mECO.js} +1 -1
- package/dist/assets/{Index-m8G7Pz-J.js → Index-V9wxs9fX.js} +1 -1
- package/dist/assets/{Index-CvNs7Qc8.js → Index-ZQdXM0Qi.js} +1 -1
- package/dist/assets/{Invitees-BjwE0w-8.js → Invitees-BkrIczI4.js} +1 -1
- package/dist/assets/{List-DVknUaOz.js → List-ByCyyjcy.js} +1 -1
- package/dist/assets/{List-8o9CvgyI.js → List-D9VBxGDJ.js} +1 -1
- package/dist/assets/{List-BfHX6UFu.js → List-DnnTHjwR.js} +1 -1
- package/dist/assets/{Main-B9Wl0aM6.js → Main-B7Iuj_gr.js} +1 -1
- package/dist/assets/{Navigator-CZkWVWzN.js → Navigator-Bfg5MB9U.js} +1 -1
- package/dist/assets/{NoTasks-4TJvTcNH.js → NoTasks-CXFbDY0A.js} +1 -1
- package/dist/assets/{Pagination-DrZT-YqX.js → Pagination-pUGLnKvW.js} +1 -1
- package/dist/assets/{ScrollList-BSHydg5K.js → ScrollList-Ctwoso0M.js} +1 -1
- package/dist/assets/{Status-CU3tRVGG.js → Status-zVvonX-o.js} +1 -1
- package/dist/assets/{Subscribe-DEpZJt9v.js → Subscribe-Csw468W0.js} +1 -1
- package/dist/assets/{TransportWebHID-x82bKdqW.js → TransportWebHID-CrwmabwY.js} +1 -1
- package/dist/assets/{VideoPlayer-DhXW0ZpT.js → VideoPlayer-CQ5XJCD4.js} +1 -1
- package/dist/assets/avatar-Bz6boBn2.js +1 -0
- package/dist/assets/avatar-CfYRMFXV.css +1 -0
- package/dist/assets/{bignumber-D2i_F2iN.js → bignumber-B90gMj7-.js} +1 -1
- package/dist/assets/{distribution-DQWow-W5.js → distribution-tc7Ny12x.js} +1 -1
- package/dist/assets/{index-DgtHfSqf.js → index-Cg8W5HXP.js} +4 -4
- package/dist/assets/{index-Dd5huPwi.js → index-D-UbBaog.js} +1 -1
- package/dist/assets/{index-nzc2MroZ.js → index-DLFOYy34.js} +1 -1
- package/dist/assets/{index-BPpDhZjH.js → index-QbelgbtK.js} +1 -1
- package/dist/assets/{index-BJU-syOe.js → index-Qp3BWPL0.js} +1 -1
- package/dist/assets/{index-BnkMqzhi.js → index-at5IgPRK.js} +1 -1
- package/dist/assets/{index-DWmgW--A.js → index-hETw3-Tt.js} +1 -1
- package/dist/assets/{index-7qIS8l-a.js → index-kPB6cEeA.js} +1 -1
- package/dist/assets/{index.es-CQANB9vJ.js → index.es-sibb1JwV.js} +1 -1
- package/dist/assets/{order-iKdGqXyS.js → order-DBr_GxfO.js} +1 -1
- package/dist/assets/{price-Cbls6Qoc.js → price-CUVRj46N.js} +1 -1
- package/dist/assets/{solana-wallets-CkstrrV4.js → solana-wallets-CzHDaNyx.js} +2 -2
- package/dist/assets/{solanaEmbed.esm-B1Go1xNW.js → solanaEmbed.esm-E1uzZz_Y.js} +1 -1
- package/dist/assets/{string_decoder-ll7baEuM.js → string_decoder-CImFLFld.js} +1 -1
- package/dist/assets/{vendor-web3-BXoVw72d.js → vendor-web3-vJ0jlMeb.js} +4 -4
- package/dist/assets/{web-Bl4nr7zA.js → web-CmA02DXc.js} +1 -1
- package/dist/assets/{web-DE8XF-r4.js → web-DUcCuWS_.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/dist/assets/avatar-Bypfdb1U.js +0 -1
- package/dist/assets/avatar-i-yziJxn.css +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as W}from"./vendor-dayjs-CzbnksQQ.js";import{P as T,A}from"./vendor-web3-BXoVw72d.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()},F(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 F(f){return B(f)&&"postMessage"in f&&typeof f.postMessage=="function"}function B(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,A}from"./vendor-web3-vJ0jlMeb.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()},F(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 F(f){return B(f)&&"postMessage"in f&&typeof f.postMessage=="function"}function B(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};
|