@dodoex/wallet-web3 0.0.43-beta.1 → 0.0.43-beta.3
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/alchemy-provider-5870b6fa-233c80b6.js +1 -0
- package/dist/alchemy-websocket-provider-213da986-64068b80.js +1 -0
- package/dist/blocto-4c3b71f5.js +1 -0
- package/dist/ccip-da46c435.js +1 -0
- package/dist/cjs/alchemy-provider-5870b6fa-686578f0.cjs +1 -0
- package/dist/cjs/alchemy-websocket-provider-213da986-fff1f59d.cjs +1 -0
- package/dist/cjs/blocto-621f54a9.cjs +1 -0
- package/dist/cjs/ccip-4b1d6858.cjs +1 -0
- package/dist/cjs/{draggabilly-79573f3a.cjs → draggabilly-5b36eaf0.cjs} +1 -1
- package/dist/cjs/id-0b41bc31.cjs +1 -0
- package/dist/{index-11a0760f.js → cjs/index-1e729250.cjs} +2 -2
- package/dist/cjs/index-283b89ff.cjs +1 -0
- package/dist/cjs/index-2d5de895.cjs +1 -0
- package/dist/cjs/{index-eb09e54d.cjs → index-35edc6a0.cjs} +1 -1
- package/dist/cjs/{index-ae56e5a3.cjs → index-44b7a45e.cjs} +3 -3
- package/dist/cjs/index-5560dc58.cjs +17 -0
- package/dist/cjs/index-73e4d7eb.cjs +6 -0
- package/dist/cjs/{index-df8e5839.cjs → index-9f2a69d5.cjs} +1 -1
- package/dist/cjs/index-a4478ddb.cjs +1 -0
- package/dist/cjs/index-d528b9d2.cjs +1 -0
- package/dist/cjs/index-d54b57b8.cjs +1 -0
- package/dist/cjs/index-db36b0fa.cjs +29 -0
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/index.es-e3bf027a.cjs +9 -0
- package/dist/cjs/{interface-22e176bf.cjs → interface-d076e79e.cjs} +1 -1
- package/dist/cjs/{lib-typedarrays-4ea60734.cjs → lib-typedarrays-68c72268.cjs} +1 -1
- package/dist/cjs/{portis-5a7056fa.cjs → portis-7f3437fb.cjs} +1 -1
- package/dist/cjs/provider-e53a855b.cjs +1 -0
- package/dist/cjs/providers/connector/alchemy/index.d.ts +913 -0
- package/dist/cjs/providers/connector/alchemy/provider.d.ts +914 -0
- package/dist/cjs/providers/connector/alchemy/signer.d.ts +23 -0
- package/dist/cjs/providers/connector/index.d.ts +951 -43
- package/dist/cjs/providers/connector/ledgerUSB/index.d.ts +43 -43
- package/dist/cjs/providers/connector/ledgerUSB/provider.d.ts +10 -10
- package/dist/cjs/providers/connector/types.d.ts +4 -0
- package/dist/cjs/providers/connector/uniPass/index.d.ts +43 -43
- package/dist/cjs/providers/connector/uniPass/provider.d.ts +10 -10
- package/dist/cjs/providers/wallets/index.d.ts +2 -1
- package/dist/cjs/providers/wallets/standalone.d.ts +1 -0
- package/dist/cjs/providers/wallets/types.d.ts +1 -0
- package/dist/cjs/rainbow-dc533bc9.cjs +1 -0
- package/dist/cjs/{sha224-75e384f0.cjs → sha224-d1ef1120.cjs} +1 -1
- package/dist/cjs/sha256-0f5b78af.cjs +1 -0
- package/dist/cjs/typed-data-248c37d5.cjs +1 -0
- package/dist/cjs/uAuth-d9d66e7c.cjs +1 -0
- package/dist/cjs/walletConnect-0d1d9c65.cjs +1 -0
- package/dist/cjs/walletLink-a6046616.cjs +3 -0
- package/dist/{draggabilly-830dc949.js → draggabilly-ad95d562.js} +1 -1
- package/dist/id-d4f3e36f.js +1 -0
- package/dist/index-21179dd1.js +1 -0
- package/dist/index-2691f407.js +1 -0
- package/dist/index-4f86d0d9.js +1 -0
- package/dist/{index-3c4637f0.js → index-52949a22.js} +2 -2
- package/dist/index-5526977f.js +17 -0
- package/dist/index-5a7908b7.js +1 -0
- package/dist/{index-0ee5ef8d.js → index-65d96278.js} +1 -1
- package/dist/index-7e9e2ba1.js +1 -0
- package/dist/{index-a33c0bc7.js → index-7f74b1e8.js} +3 -3
- package/dist/index-af6c16a1.js +29 -0
- package/dist/{cjs/index-4d414966.cjs → index-cd1a9a88.js} +2 -2
- package/dist/{index-e0d3617a.js → index-f08d6a6b.js} +1 -1
- package/dist/index.es-bb0f01ae.js +9 -0
- package/dist/index.js +1 -1
- package/dist/{interface-c16329c9.js → interface-8030d5f3.js} +1 -1
- package/dist/{lib-typedarrays-f90f59e3.js → lib-typedarrays-a4c67579.js} +1 -1
- package/dist/{portis-a86b0a05.js → portis-e2bba602.js} +1 -1
- package/dist/provider-459277d5.js +1 -0
- package/dist/providers/connector/alchemy/index.d.ts +913 -0
- package/dist/providers/connector/alchemy/provider.d.ts +914 -0
- package/dist/providers/connector/alchemy/signer.d.ts +23 -0
- package/dist/providers/connector/index.d.ts +951 -43
- package/dist/providers/connector/ledgerUSB/index.d.ts +43 -43
- package/dist/providers/connector/ledgerUSB/provider.d.ts +10 -10
- package/dist/providers/connector/types.d.ts +4 -0
- package/dist/providers/connector/uniPass/index.d.ts +43 -43
- package/dist/providers/connector/uniPass/provider.d.ts +10 -10
- package/dist/providers/wallets/index.d.ts +2 -1
- package/dist/providers/wallets/standalone.d.ts +1 -0
- package/dist/providers/wallets/types.d.ts +1 -0
- package/dist/rainbow-a06575a1.js +1 -0
- package/dist/sha224-10712709.js +1 -0
- package/dist/sha256-656b18f4.js +1 -0
- package/dist/typed-data-b07573b9.js +1 -0
- package/dist/uAuth-7b727766.js +1 -0
- package/dist/walletConnect-9c01b144.js +1 -0
- package/dist/{walletLink-df58109a.js → walletLink-1b8c2056.js} +2 -2
- package/package.json +11 -4
- package/dist/DefaultJsonRpcProvider-48aec187.js +0 -1
- package/dist/__node-resolve_empty-59fa3c56.js +0 -1
- package/dist/blocto-478b3978.js +0 -1
- package/dist/bn-efc414a2.js +0 -1
- package/dist/browser-ponyfill-bc327969.js +0 -1
- package/dist/cjs/DefaultJsonRpcProvider-55c338f0.cjs +0 -1
- package/dist/cjs/__node-resolve_empty-fd72eb2c.cjs +0 -1
- package/dist/cjs/blocto-965564db.cjs +0 -1
- package/dist/cjs/bn-d506e85d.cjs +0 -1
- package/dist/cjs/browser-ponyfill-323d988f.cjs +0 -1
- package/dist/cjs/ethers-1ba31973.cjs +0 -1
- package/dist/cjs/id-1118c8d9.cjs +0 -1
- package/dist/cjs/index-0122b1eb.cjs +0 -6
- package/dist/cjs/index-0740e7fe.cjs +0 -1
- package/dist/cjs/index-0ce04635.cjs +0 -9
- package/dist/cjs/index-285c5389.cjs +0 -1
- package/dist/cjs/index-3c74ed4c.cjs +0 -1
- package/dist/cjs/index-58465208.cjs +0 -1
- package/dist/cjs/index-685f72cf.cjs +0 -1
- package/dist/cjs/index-99521957.cjs +0 -1
- package/dist/cjs/index-ac9f2e8f.cjs +0 -15
- package/dist/cjs/index-dc6a6c03.cjs +0 -1
- package/dist/cjs/index.es-6fd28bfe.cjs +0 -9
- package/dist/cjs/provider-d22e1228.cjs +0 -1
- package/dist/cjs/rainbow-54c01ab2.cjs +0 -1
- package/dist/cjs/sha256-ab07124e.cjs +0 -1
- package/dist/cjs/uAuth-b9d43d2e.cjs +0 -1
- package/dist/cjs/walletConnect-398a4c97.cjs +0 -1
- package/dist/cjs/walletLink-6199ae38.cjs +0 -3
- package/dist/ethers-1d40d86b.js +0 -1
- package/dist/id-62e12510.js +0 -1
- package/dist/index-02350ba2.js +0 -1
- package/dist/index-115f7417.js +0 -1
- package/dist/index-37f47216.js +0 -1
- package/dist/index-6e901e7d.js +0 -15
- package/dist/index-acc28a9b.js +0 -1
- package/dist/index-b32df058.js +0 -1
- package/dist/index-b659401e.js +0 -9
- package/dist/index-bcc0fefa.js +0 -1
- package/dist/index-d00482ad.js +0 -1
- package/dist/index.es-d4badfa1.js +0 -9
- package/dist/provider-e4a0ed94.js +0 -1
- package/dist/rainbow-3df70217.js +0 -1
- package/dist/sha224-57921047.js +0 -1
- package/dist/sha256-5bd230f1.js +0 -1
- package/dist/uAuth-2e999ea5.js +0 -1
- package/dist/walletConnect-565fd3db.js +0 -1
package/dist/index-bcc0fefa.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as e,g as t,q as n,c as r,S as o,r as i,t as a,u as s}from"./index-b659401e.js";import c,{getAddress as u}from"@ethersproject/address";import{Signer as p}from"@ethersproject/abstract-signer";import{JsonRpcProvider as l}from"@ethersproject/providers";import f,{arrayify as d}from"@ethersproject/bytes";import{T as h,l as g}from"./index-02350ba2.js";import{r as y}from"./index-b32df058.js";import{f as m,p as b,n as v,d as w,b as P,i as x,c as O,m as j,h as _,g as S,r as E,s as k,j as T,S as U,k as L,o as A,q as C,t as N,x as D,y as I,z as R,A as M,B as F}from"./ethers-1d40d86b.js";import{d as z,t as B,c as W,a as G,e as J,f as V,U as H,i as K,l as Z}from"./id-62e12510.js";import $ from"@ethersproject/json-wallets";import q,{defineReadOnly as Y}from"@ethersproject/properties";import{l as Q}from"./index-37f47216.js";import X from"@ethersproject/transactions";import{Contract as ee}from"@ethersproject/contracts";import{D as te}from"./DefaultJsonRpcProvider-48aec187.js";import"zustand";import"events";import"@ethersproject/constants";import"./interface-c16329c9.js";import"@ethersproject/abstract-provider";import"./__node-resolve_empty-59fa3c56.js";import"./hash-b468659c.js";import"./inherits_browser-51bb8c3c.js";var ne,re=Object.freeze({__proto__:null,_toEscapedUtf8String:z,toUtf8Bytes:B,toUtf8CodePoints:W,toUtf8String:G,Utf8ErrorFuncs:J,get Utf8ErrorReason(){return V},get UnicodeNormalizationForm(){return H},formatBytes32String:m,parseBytes32String:b,nameprep:v}),oe=Object.freeze({__proto__:null,id:K,dnsEncode:w,namehash:P,isValidName:x,ensNormalize:O,messagePrefix:j,hashMessage:_,_TypedDataEncoder:h}),ie=Object.freeze({__proto__:null,computeHmac:S,ripemd160:E,sha256:k,sha512:T,get SupportedAlgorithm(){return U}}),ae=Object.freeze({__proto__:null,randomBytes:L,shuffled:A});class se extends p{constructor(e,t,n,r){super(),this._address=n,this._index=null!=r?r:0,this.provider=e,this.upWallet=t}_legacySignMessage(e){throw new Error("Method not implemented.")}sendUncheckedTransaction(e){throw new Error("Method not implemented.")}unlock(e){throw new Error("Method not implemented.")}getAddress(){return e(this,void 0,void 0,(function*(){return Promise.resolve(u(this._address))}))}signMessage(t){return e(this,void 0,void 0,(function*(){if(!this.upWallet)throw new Error(`address unknown '${t}'`);return yield this.upWallet.signMessage(t,{isEIP191Prefix:!0,onAuthChain:!0})}))}_signTypedData(t,n,r){return e(this,void 0,void 0,(function*(){throw new Error("Method not implemented.")}))}signTransaction(t){return e(this,void 0,void 0,(function*(){if(!this.upWallet)throw new Error(`address unknown '${t.from}'`);return this.upWallet.sendTransaction({from:t.from,to:t.to,value:t.value,data:t.data})}))}sendTransaction(t){return e(this,void 0,void 0,(function*(){if(!this.upWallet)throw new Error(`address unknown '${t.from}'`);return{hash:yield this.upWallet.sendTransaction({from:t.from,to:t.to,value:t.value,data:t.data}),from:t.from}}))}connect(e){return new se(null!=e?e:this.provider,this.upWallet,this._address,this._index)}connectUnchecked(){return new se(this.provider,this.upWallet,this._address,this._index)}}!function(e){e.REGISTER="register"}(ne||(ne={}));var ce,ue=function(e,t,n,r,o){this.from=e,this.msg=t,this.type=n,this.isEIP191Prefix=r,this.onAuthChain=o},pe=function(e,t){this.type=e,this.data=t},le=function(e,t,n){this.type=e,this.payload=t,this.appSetting=n};function fe(){return fe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fe.apply(this,arguments)}!function(e){e.LIGHT="light",e.DARK="dark"}(ce||(ce={}));var de=function(e){return d(function(e){var t=fe({},e.types);return delete t.EIP712Domain,h.hash(e.domain,t,e.message)}(e))},he={},ge=t(C),ye=t(N),me=t(oe),be=t(D),ve=t(n),we=t(Z),Pe=t(ie),xe=t(I),Oe=t(ae),je=t(Q),_e=t(R),Se=t(re),Ee=t(M),ke=t(F),Te=t(g);function Ue(){Ue=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(e,t,n,o){var i=t&&t.prototype instanceof f?t:f,a=Object.create(i.prototype),s=new _(o||[]);return r(a,"_invoke",{value:P(e,n,s)}),a}function p(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var l={};function f(){}function d(){}function h(){}var g={};c(g,i,(function(){return this}));var y=Object.getPrototypeOf,m=y&&y(y(S([])));m&&m!==t&&n.call(m,i)&&(g=m);var b=h.prototype=f.prototype=Object.create(g);function v(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){function o(r,i,a,s){var c=p(e[r],e,i);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==typeof l&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){o("next",e,a,s)}),(function(e){o("throw",e,a,s)})):t.resolve(l).then((function(e){u.value=e,a(u)}),(function(e){return o("throw",e,a,s)}))}s(c.arg)}var i;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){o(e,n,t,r)}))}return i=i?i.then(r,r):r()}})}function P(e,t,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return E()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=x(a,n);if(s){if(s===l)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=p(e,t,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===l)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}function x(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,x(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),l;var o=p(r,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,l;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,l):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,l)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function j(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function S(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,o=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:E}}function E(){return{value:void 0,done:!0}}return d.prototype=h,r(b,"constructor",{value:h,configurable:!0}),r(h,"constructor",{value:d,configurable:!0}),d.displayName=c(h,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,c(e,s,"GeneratorFunction")),e.prototype=Object.create(b),e},e.awrap=function(e){return{__await:e}},v(w.prototype),c(w.prototype,a,(function(){return this})),e.AsyncIterator=w,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new w(u(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},v(b),c(b,s,"Generator"),c(b,i,(function(){return this})),c(b,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=S,_.prototype={constructor:_,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(j),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,l):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),l},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),j(n),l}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;j(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:S(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},e}function Le(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}function Ae(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Le(i,r,o,a,s,"next",e)}function s(e){Le(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Ce(){return Ce=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ce.apply(this,arguments)}!function(e){var t=r&&r.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=r&&r.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&t(r,e,o);return n(r,e),r};Object.defineProperty(e,"__esModule",{value:!0}),e.formatBytes32String=e.Utf8ErrorFuncs=e.toUtf8String=e.toUtf8CodePoints=e.toUtf8Bytes=e._toEscapedUtf8String=e.nameprep=e.hexDataSlice=e.hexDataLength=e.hexZeroPad=e.hexValue=e.hexStripZeros=e.hexConcat=e.isHexString=e.hexlify=e.base64=e.base58=e.TransactionDescription=e.LogDescription=e.Interface=e.SigningKey=e.HDNode=e.defaultPath=e.isBytesLike=e.isBytes=e.zeroPad=e.stripZeros=e.concat=e.arrayify=e.shallowCopy=e.resolveProperties=e.getStatic=e.defineReadOnly=e.deepCopy=e.checkProperties=e.poll=e.fetchJson=e._fetchData=e.RLP=e.Logger=e.checkResultErrors=e.FormatTypes=e.ParamType=e.FunctionFragment=e.EventFragment=e.ErrorFragment=e.ConstructorFragment=e.Fragment=e.defaultAbiCoder=e.AbiCoder=void 0,e.Indexed=e.Utf8ErrorReason=e.UnicodeNormalizationForm=e.SupportedAlgorithm=e.mnemonicToSeed=e.isValidMnemonic=e.entropyToMnemonic=e.mnemonicToEntropy=e.getAccountPath=e.verifyTypedData=e.verifyMessage=e.recoverPublicKey=e.computePublicKey=e.recoverAddress=e.computeAddress=e.getJsonWalletAddress=e.TransactionTypes=e.serializeTransaction=e.parseTransaction=e.accessListify=e.joinSignature=e.splitSignature=e.soliditySha256=e.solidityKeccak256=e.solidityPack=e.shuffled=e.randomBytes=e.sha512=e.sha256=e.ripemd160=e.keccak256=e.computeHmac=e.commify=e.parseUnits=e.formatUnits=e.parseEther=e.formatEther=e.isAddress=e.getCreate2Address=e.getContractAddress=e.getIcapAddress=e.getAddress=e._TypedDataEncoder=e.id=e.isValidName=e.namehash=e.hashMessage=e.dnsEncode=e.parseBytes32String=void 0;var i=y;Object.defineProperty(e,"AbiCoder",{enumerable:!0,get:function(){return i.AbiCoder}}),Object.defineProperty(e,"checkResultErrors",{enumerable:!0,get:function(){return i.checkResultErrors}}),Object.defineProperty(e,"ConstructorFragment",{enumerable:!0,get:function(){return i.ConstructorFragment}}),Object.defineProperty(e,"defaultAbiCoder",{enumerable:!0,get:function(){return i.defaultAbiCoder}}),Object.defineProperty(e,"ErrorFragment",{enumerable:!0,get:function(){return i.ErrorFragment}}),Object.defineProperty(e,"EventFragment",{enumerable:!0,get:function(){return i.EventFragment}}),Object.defineProperty(e,"FormatTypes",{enumerable:!0,get:function(){return i.FormatTypes}}),Object.defineProperty(e,"Fragment",{enumerable:!0,get:function(){return i.Fragment}}),Object.defineProperty(e,"FunctionFragment",{enumerable:!0,get:function(){return i.FunctionFragment}}),Object.defineProperty(e,"Indexed",{enumerable:!0,get:function(){return i.Indexed}}),Object.defineProperty(e,"Interface",{enumerable:!0,get:function(){return i.Interface}}),Object.defineProperty(e,"LogDescription",{enumerable:!0,get:function(){return i.LogDescription}}),Object.defineProperty(e,"ParamType",{enumerable:!0,get:function(){return i.ParamType}}),Object.defineProperty(e,"TransactionDescription",{enumerable:!0,get:function(){return i.TransactionDescription}});var a=c;Object.defineProperty(e,"getAddress",{enumerable:!0,get:function(){return a.getAddress}}),Object.defineProperty(e,"getCreate2Address",{enumerable:!0,get:function(){return a.getCreate2Address}}),Object.defineProperty(e,"getContractAddress",{enumerable:!0,get:function(){return a.getContractAddress}}),Object.defineProperty(e,"getIcapAddress",{enumerable:!0,get:function(){return a.getIcapAddress}}),Object.defineProperty(e,"isAddress",{enumerable:!0,get:function(){return a.isAddress}});var s=o(ge);e.base64=s;var u=ye;Object.defineProperty(e,"base58",{enumerable:!0,get:function(){return u.Base58}});var p=f;Object.defineProperty(e,"arrayify",{enumerable:!0,get:function(){return p.arrayify}}),Object.defineProperty(e,"concat",{enumerable:!0,get:function(){return p.concat}}),Object.defineProperty(e,"hexConcat",{enumerable:!0,get:function(){return p.hexConcat}}),Object.defineProperty(e,"hexDataSlice",{enumerable:!0,get:function(){return p.hexDataSlice}}),Object.defineProperty(e,"hexDataLength",{enumerable:!0,get:function(){return p.hexDataLength}}),Object.defineProperty(e,"hexlify",{enumerable:!0,get:function(){return p.hexlify}}),Object.defineProperty(e,"hexStripZeros",{enumerable:!0,get:function(){return p.hexStripZeros}}),Object.defineProperty(e,"hexValue",{enumerable:!0,get:function(){return p.hexValue}}),Object.defineProperty(e,"hexZeroPad",{enumerable:!0,get:function(){return p.hexZeroPad}}),Object.defineProperty(e,"isBytes",{enumerable:!0,get:function(){return p.isBytes}}),Object.defineProperty(e,"isBytesLike",{enumerable:!0,get:function(){return p.isBytesLike}}),Object.defineProperty(e,"isHexString",{enumerable:!0,get:function(){return p.isHexString}}),Object.defineProperty(e,"joinSignature",{enumerable:!0,get:function(){return p.joinSignature}}),Object.defineProperty(e,"zeroPad",{enumerable:!0,get:function(){return p.zeroPad}}),Object.defineProperty(e,"splitSignature",{enumerable:!0,get:function(){return p.splitSignature}}),Object.defineProperty(e,"stripZeros",{enumerable:!0,get:function(){return p.stripZeros}});var l=me;Object.defineProperty(e,"_TypedDataEncoder",{enumerable:!0,get:function(){return l._TypedDataEncoder}}),Object.defineProperty(e,"dnsEncode",{enumerable:!0,get:function(){return l.dnsEncode}}),Object.defineProperty(e,"hashMessage",{enumerable:!0,get:function(){return l.hashMessage}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return l.id}}),Object.defineProperty(e,"isValidName",{enumerable:!0,get:function(){return l.isValidName}}),Object.defineProperty(e,"namehash",{enumerable:!0,get:function(){return l.namehash}});var d=be;Object.defineProperty(e,"defaultPath",{enumerable:!0,get:function(){return d.defaultPath}}),Object.defineProperty(e,"entropyToMnemonic",{enumerable:!0,get:function(){return d.entropyToMnemonic}}),Object.defineProperty(e,"getAccountPath",{enumerable:!0,get:function(){return d.getAccountPath}}),Object.defineProperty(e,"HDNode",{enumerable:!0,get:function(){return d.HDNode}}),Object.defineProperty(e,"isValidMnemonic",{enumerable:!0,get:function(){return d.isValidMnemonic}}),Object.defineProperty(e,"mnemonicToEntropy",{enumerable:!0,get:function(){return d.mnemonicToEntropy}}),Object.defineProperty(e,"mnemonicToSeed",{enumerable:!0,get:function(){return d.mnemonicToSeed}});var h=$;Object.defineProperty(e,"getJsonWalletAddress",{enumerable:!0,get:function(){return h.getJsonWalletAddress}});var g=ve;Object.defineProperty(e,"keccak256",{enumerable:!0,get:function(){return g.keccak256}});var m=we;Object.defineProperty(e,"Logger",{enumerable:!0,get:function(){return m.Logger}});var b=Pe;Object.defineProperty(e,"computeHmac",{enumerable:!0,get:function(){return b.computeHmac}}),Object.defineProperty(e,"ripemd160",{enumerable:!0,get:function(){return b.ripemd160}}),Object.defineProperty(e,"sha256",{enumerable:!0,get:function(){return b.sha256}}),Object.defineProperty(e,"sha512",{enumerable:!0,get:function(){return b.sha512}});var v=xe;Object.defineProperty(e,"solidityKeccak256",{enumerable:!0,get:function(){return v.keccak256}}),Object.defineProperty(e,"solidityPack",{enumerable:!0,get:function(){return v.pack}}),Object.defineProperty(e,"soliditySha256",{enumerable:!0,get:function(){return v.sha256}});var w=Oe;Object.defineProperty(e,"randomBytes",{enumerable:!0,get:function(){return w.randomBytes}}),Object.defineProperty(e,"shuffled",{enumerable:!0,get:function(){return w.shuffled}});var P=q;Object.defineProperty(e,"checkProperties",{enumerable:!0,get:function(){return P.checkProperties}}),Object.defineProperty(e,"deepCopy",{enumerable:!0,get:function(){return P.deepCopy}}),Object.defineProperty(e,"defineReadOnly",{enumerable:!0,get:function(){return P.defineReadOnly}}),Object.defineProperty(e,"getStatic",{enumerable:!0,get:function(){return P.getStatic}}),Object.defineProperty(e,"resolveProperties",{enumerable:!0,get:function(){return P.resolveProperties}}),Object.defineProperty(e,"shallowCopy",{enumerable:!0,get:function(){return P.shallowCopy}});var x=o(je);e.RLP=x;var O=_e;Object.defineProperty(e,"computePublicKey",{enumerable:!0,get:function(){return O.computePublicKey}}),Object.defineProperty(e,"recoverPublicKey",{enumerable:!0,get:function(){return O.recoverPublicKey}}),Object.defineProperty(e,"SigningKey",{enumerable:!0,get:function(){return O.SigningKey}});var j=Se;Object.defineProperty(e,"formatBytes32String",{enumerable:!0,get:function(){return j.formatBytes32String}}),Object.defineProperty(e,"nameprep",{enumerable:!0,get:function(){return j.nameprep}}),Object.defineProperty(e,"parseBytes32String",{enumerable:!0,get:function(){return j.parseBytes32String}}),Object.defineProperty(e,"_toEscapedUtf8String",{enumerable:!0,get:function(){return j._toEscapedUtf8String}}),Object.defineProperty(e,"toUtf8Bytes",{enumerable:!0,get:function(){return j.toUtf8Bytes}}),Object.defineProperty(e,"toUtf8CodePoints",{enumerable:!0,get:function(){return j.toUtf8CodePoints}}),Object.defineProperty(e,"toUtf8String",{enumerable:!0,get:function(){return j.toUtf8String}}),Object.defineProperty(e,"Utf8ErrorFuncs",{enumerable:!0,get:function(){return j.Utf8ErrorFuncs}});var _=X;Object.defineProperty(e,"accessListify",{enumerable:!0,get:function(){return _.accessListify}}),Object.defineProperty(e,"computeAddress",{enumerable:!0,get:function(){return _.computeAddress}}),Object.defineProperty(e,"parseTransaction",{enumerable:!0,get:function(){return _.parse}}),Object.defineProperty(e,"recoverAddress",{enumerable:!0,get:function(){return _.recoverAddress}}),Object.defineProperty(e,"serializeTransaction",{enumerable:!0,get:function(){return _.serialize}}),Object.defineProperty(e,"TransactionTypes",{enumerable:!0,get:function(){return _.TransactionTypes}});var S=Ee;Object.defineProperty(e,"commify",{enumerable:!0,get:function(){return S.commify}}),Object.defineProperty(e,"formatEther",{enumerable:!0,get:function(){return S.formatEther}}),Object.defineProperty(e,"parseEther",{enumerable:!0,get:function(){return S.parseEther}}),Object.defineProperty(e,"formatUnits",{enumerable:!0,get:function(){return S.formatUnits}}),Object.defineProperty(e,"parseUnits",{enumerable:!0,get:function(){return S.parseUnits}});var E=ke;Object.defineProperty(e,"verifyMessage",{enumerable:!0,get:function(){return E.verifyMessage}}),Object.defineProperty(e,"verifyTypedData",{enumerable:!0,get:function(){return E.verifyTypedData}});var k=Te;Object.defineProperty(e,"_fetchData",{enumerable:!0,get:function(){return k._fetchData}}),Object.defineProperty(e,"fetchJson",{enumerable:!0,get:function(){return k.fetchJson}}),Object.defineProperty(e,"poll",{enumerable:!0,get:function(){return k.poll}});var T=Pe;Object.defineProperty(e,"SupportedAlgorithm",{enumerable:!0,get:function(){return T.SupportedAlgorithm}});var U=Se;Object.defineProperty(e,"UnicodeNormalizationForm",{enumerable:!0,get:function(){return U.UnicodeNormalizationForm}}),Object.defineProperty(e,"Utf8ErrorReason",{enumerable:!0,get:function(){return U.Utf8ErrorReason}})}(he);var Ne="wallet.unipass.id",De={upDomain:Ne,upConnectUrl:"https://"+Ne+"/connect",upLogoutUrl:"https://"+Ne+"/logout",upSignMessageUrl:"https://"+Ne+"/sign-message",upTransactionUrl:"https://"+Ne+"/send-transaction",upLoadingUrl:"https://"+Ne+"/connect/loading"},Ie=function(){return De},Re={protocol:"https",domain:"testnet.wallet.unipass.id"},Me={protocol:"https",domain:"wallet.unipass.id"},Fe={mainnet:{eth:"https://node.wallet.unipass.id/eth-mainnet",polygon:"https://node.wallet.unipass.id/polygon-mainnet",bsc:"https://node.wallet.unipass.id/bsc-mainnet",rangers:"https://node.wallet.unipass.id/rangers-mainnet",scroll:"https://node.wallet.unipass.id/scroll-mainnet",arbitrum:"https://node.wallet.unipass.id/arbitrum-mainnet",avalanche:"https://node.wallet.unipass.id/avalanche-mainnet",kcc:"https://node.wallet.unipass.id/kcc-mainnet",platon:"https://node.wallet.unipass.id/platon-mainnet",okc:"https://node.wallet.unipass.id/okc-mainnet"},testnet:{eth:"https://node.wallet.unipass.id/eth-goerli",polygon:"https://node.wallet.unipass.id/polygon-mumbai",bsc:"https://node.wallet.unipass.id/bsc-testnet",rangers:"https://node.wallet.unipass.id/rangers-robin",scroll:"https://node.wallet.unipass.id/scroll-testnet",arbitrum:"https://node.wallet.unipass.id/arbitrum-testnet",avalanche:"https://node.wallet.unipass.id/avalanche-testnet",kcc:"https://node.wallet.unipass.id/kcc-testnet",platon:"https://node.wallet.unipass.id/platon-testnet",okc:"https://node.wallet.unipass.id/okc-testnet"}},ze=function(e){var t;t="localStorage"===e?window.localStorage||localStorage:window.sessionStorage||sessionStorage;return{get:function(e){return t.getItem(e)||""},set:function(e,n){return t.setItem(e,n||"")},remove:function(e){return t.removeItem(e)}}},Be=function(){var e=Ae(Ue().mark((function e(t,n){var r,o;return Ue().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=ze(t.storageType).get(nt),e.t0=r&&JSON.parse(r),e.t0){e.next=6;break}return e.next=5,Ge(t,n);case 5:e.t0=e.sent;case 6:return o=e.t0,e.abrupt("return",o);case 8:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),We=function(){var e=Ae(Ue().mark((function e(t){var n;return Ue().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t){e.next=4;break}return n=new le("UP_LOGOUT"),e.next=4,rt(n);case 4:ze("localStorage").remove(nt),ze("sessionStorage").remove(nt);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Ge=function(){var e=Ae(Ue().mark((function e(t,n){var r,o,i;return Ue().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,r=n?JSON.stringify(n):"",o=new le("UP_LOGIN",r,t.appSettings),e.next=5,rt(o,null==n?void 0:n.connectType,null==n?void 0:n.forceLogin,null==n?void 0:n.eventListener);case 5:return(i=e.sent)&&i.address&&ze(t.storageType).set(nt,JSON.stringify(i)),e.abrupt("return",i);case 10:throw e.prev=10,e.t0=e.catch(0),new Error("Account Not Available");case 13:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(t,n){return e.apply(this,arguments)}}(),Je="UP_WALLET_POP",Ve=null,He=null;function Ke(e,t,n){var r="innerWidth=462,width=462,innerHeight=810,height=810,top="+.5*(n.screen.availHeight-30-810)+",left="+.8*(n.screen.availWidth-10-462)+",toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,";return n.open(e,t,r)}function Ze(e,t,n){return $e.apply(this,arguments)}function $e(){return($e=Ae(Ue().mark((function e(t,n,r){var o,i,a;return Ue().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(null==Ve||null!=(o=Ve)&&o.closed)){e.next=8;break}if(null!=(Ve=Ke(t,Je,window))){e.next=6;break}return e.next=5,qe(t,n,r);case 5:return e.abrupt("return",e.sent);case 6:e.next=9;break;case 8:He!==t?(Ve.location.replace(t),Ve.focus()):Ve.focus();case 9:return i=setInterval((function(){if(Ve&&Ve.closed){var e={data:new le("UP_RESPONSE",JSON.stringify(new pe("DECLINE","user reject connection")))};n(e,{close:function(){},send:function(){}}),clearInterval(i)}}),1e3),a=function(){Ve&&!Ve.closed&&Ve.close(),Ve=null},e.abrupt("return",{popup:Ve,unmount:a});case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function qe(e,t,n){return Ye.apply(this,arguments)}function Ye(){return(Ye=Ae(Ue().mark((function e(t,n,r){var o,i;return Ue().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=document.createElement("div"),'\n <div\n class="up_notification"\n style="\n position: fixed;\n display: flex;\n flex-flow: row nowrap;\n justify-content: space-between;\n align-items: center;\n top: 26px;\n right: 26px;\n width: 340px;\n height: 96px;\n z-index: 100001;\n background-color: #362866;\n box-sizing: border-box;\n border: 2px solid #ffffff;\n border-radius: 8px;\n padding: 16px 20px;\n "\n>\n <div class="up_notification_left" style="color: white">\n <div\n class="up_notification_title"\n style="\n font-weight: 500;\n font-size: 14px;\n line-height: 20px;\n margin-bottom: 8px;\n "\n >\n Request Pop-up\n </div>\n <div\n class="up_notification_tip"\n style="\n font-weight: 450;\n font-size: 12px;\n line-height: 20px;\n color: rgba(255, 255, 255, 0.8);\n "\n >\n Click Approve to complete creating or using wallet\n </div>\n </div>\n <div\n class="up_notification_right"\n style="\n width: 90px;\n height: 35px;\n font-size: 12px;\n text-align: center;\n background: linear-gradient(270deg, #997afb 0%, #7a55f8 63.6%);\n border-radius: 6px;\n line-height: 35px;\n color: white;\n margin-left: 20px;\n cursor: pointer;\n "\n >\n Approve\n </div>\n</div>\n ',o.innerHTML='\n <div\n class="up_notification"\n style="\n position: fixed;\n display: flex;\n flex-flow: row nowrap;\n justify-content: space-between;\n align-items: center;\n top: 26px;\n right: 26px;\n width: 340px;\n height: 96px;\n z-index: 100001;\n background-color: #362866;\n box-sizing: border-box;\n border: 2px solid #ffffff;\n border-radius: 8px;\n padding: 16px 20px;\n "\n>\n <div class="up_notification_left" style="color: white">\n <div\n class="up_notification_title"\n style="\n font-weight: 500;\n font-size: 14px;\n line-height: 20px;\n margin-bottom: 8px;\n "\n >\n Request Pop-up\n </div>\n <div\n class="up_notification_tip"\n style="\n font-weight: 450;\n font-size: 12px;\n line-height: 20px;\n color: rgba(255, 255, 255, 0.8);\n "\n >\n Click Approve to complete creating or using wallet\n </div>\n </div>\n <div\n class="up_notification_right"\n style="\n width: 90px;\n height: 35px;\n font-size: 12px;\n text-align: center;\n background: linear-gradient(270deg, #997afb 0%, #7a55f8 63.6%);\n border-radius: 6px;\n line-height: 35px;\n color: white;\n margin-left: 20px;\n cursor: pointer;\n "\n >\n Approve\n </div>\n</div>\n ',document.body.appendChild(o),i=document.querySelector(".up_notification_right"),e.abrupt("return",new Promise((function(e){null==i||i.addEventListener("click",(function(){document.body.removeChild(o),e(Ze(t,n,r))}),!1)})));case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Qe=function(){};function Xe(e,t,n){if("UP_LOGIN"===e)return"google"===t?Ie().upConnectUrl+"?connectType=google&forceLogin="+(n?"1":"0"):"email"===t?Ie().upConnectUrl+"?connectType=email&forceLogin="+(n?"1":"0"):Ie().upConnectUrl+"?forceLogin="+(n?"1":"0");if("UP_LOGOUT"===e)return Ie().upLogoutUrl;if("UP_SIGN_MESSAGE"===e)return Ie().upSignMessageUrl;if("UP_TRANSACTION"===e)return Ie().upTransactionUrl;if("UP_READY"===e)return Ie().upLoadingUrl;throw new Error("unsupport type "+e)}function et(e,t,n,r){return tt.apply(this,arguments)}function tt(){return tt=Ae(Ue().mark((function e(t,n,r,o){var i,a,s,c,u,p,l,f,d,h;return Ue().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(h=function(e){try{null==p||p.postMessage(JSON.parse(JSON.stringify(e||{})),"*")}catch(t){console.error("Popup Send Error",e,t)}},d=function(){try{window.removeEventListener("message",f),l(),i()}catch(e){console.error("Popup Close Error",e)}},f=function(e){try{if("object"!=typeof e.data)return;var t=e.data;if(!t||!t.type)return;"UP_CLOSE"===e.data.type&&d(),"UP_READY"===t.type&&s(e,{send:h,close:d}),"UP_RESPONSE"===t.type&&c(e,{send:h,close:d}),"UP_EVENT"===t.type&&a(e,{send:h,close:d})}catch(e){console.error("Popup Callback Error",e),d()}},null!=t){e.next=5;break}return e.abrupt("return",{send:Qe,close:Qe});case 5:return i=(null==o?void 0:o.onClose)||Qe,a=(null==o?void 0:o.onMessage)||Qe,s=(null==o?void 0:o.onReady)||Qe,c=(null==o?void 0:o.onResponse)||Qe,window.addEventListener("message",f),e.next=12,Ze(Xe(t.type,n,r),c,t.appSetting);case 12:return u=e.sent,p=u.popup,l=u.unmount,e.abrupt("return",{send:h,close:d});case 16:case"end":return e.stop()}}),e)}))),tt.apply(this,arguments)}var nt="UP-A";function rt(e,t,n,r){return new Promise(function(){var o=Ae(Ue().mark((function o(i,a){return Ue().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,et(e,t,n,{onReady:function(t,n){return Ae(Ue().mark((function t(){var r;return Ue().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=n.send,t.prev=1,r(e),t.next=8;break;case 5:throw t.prev=5,t.t0=t.catch(1),t.t0;case 8:case"end":return t.stop()}}),t,null,[[1,5]])})))()},onResponse:function(t,n){return Ae(Ue().mark((function r(){var o,s,c;return Ue().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(o=n.close,r.prev=1,"object"==typeof t.data){r.next=4;break}return r.abrupt("return");case 4:s=t.data,c=JSON.parse(s.payload),r.t0=c.type,r.next="APPROVE"===r.t0?9:"DECLINE"===r.t0?12:27;break;case 9:return i(c.data),o(),r.abrupt("break",30);case 12:if("expired"!==c.data){r.next=24;break}if("UP_LOGIN"!==e.type){r.next=15;break}return r.abrupt("return");case 15:if("UP_LOGOUT"!==e.type){r.next=19;break}return i(c.data),o(),r.abrupt("return");case 19:if("UP_TRANSACTION"!==e.type&&"UP_SIGN_MESSAGE"!==e.type){r.next=24;break}return We(!1),a("can not authorize without login"),o(),r.abrupt("break",30);case 24:return a("Declined: "+(c.data||"No reason supplied")),o(),r.abrupt("break",30);case 27:return a("Declined: No reason supplied"),o(),r.abrupt("break",30);case 30:r.next=35;break;case 32:throw r.prev=32,r.t1=r.catch(1),r.t1;case 35:case"end":return r.stop()}}),r,null,[[1,32]])})))()},onMessage:function(e,t){return Ae(Ue().mark((function t(){var n,o;return Ue().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r){t.next=2;break}return t.abrupt("return");case 2:if(t.prev=2,"object"==typeof e.data){t.next=5;break}return t.abrupt("return");case 5:n=e.data,o=JSON.parse(n.payload),r(o),t.next=13;break;case 10:throw t.prev=10,t.t0=t.catch(2),t.t0;case 13:case"end":return t.stop()}}),t,null,[[2,10]])})))()},onClose:function(){return Ae(Ue().mark((function e(){return Ue().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a("Declined: Externally Halted");case 1:case"end":return e.stop()}}),e)})))()}});case 2:case"end":return o.stop()}}),o)})));return function(e,t){return o.apply(this,arguments)}}())}var ot=function(){var e=Ae(Ue().mark((function e(t,n){var r,o,i,a;return Ue().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=ze(n.storageType).get(nt),(o=r&&JSON.parse(r))&&t.from&&o.address.toLowerCase()===t.from.toLowerCase()){e.next=4;break}throw new Error("can not authorize without login");case 4:return i=new le("UP_SIGN_MESSAGE",JSON.stringify(t),null==n?void 0:n.appSettings),e.prev=5,e.next=8,rt(i);case 8:return a=e.sent,e.abrupt("return",a);case 12:throw e.prev=12,e.t0=e.catch(5),new Error(e.t0);case 15:case"end":return e.stop()}}),e,null,[[5,12]])})));return function(t,n){return e.apply(this,arguments)}}(),it=function(){var e=Ae(Ue().mark((function e(t,n){var r,o,i,a;return Ue().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=ze(n.storageType).get(nt),(o=r&&JSON.parse(r))&&t.from&&o.address.toLowerCase()===t.from.toLowerCase()){e.next=4;break}throw new Error("can not authorize without login");case 4:return i=new le("UP_TRANSACTION",JSON.stringify(t),n.appSettings),e.prev=5,e.next=8,rt(i);case 8:return a=e.sent,e.abrupt("return",a);case 12:throw e.prev=12,e.t0=e.catch(5),new Error(e.t0);case 15:case"end":return e.stop()}}),e,null,[[5,12]])})));return function(t,n){return e.apply(this,arguments)}}(),at="0x1626ba7e";var st=function(){function e(e){this.initConfig(e)}var t=e.prototype;return t.initConfig=function(e){this._config={env:"prod",nodeRPC:"",chainType:"polygon",storageType:"sessionStorage"},this._config.env=e.env||"prod",this._config.chainType=e.chainType||"polygon";var t,n,r=(t=this._config.env,n=this._config.chainType,{env:t,nodeRPC:"prod"===t?Fe.mainnet[n]:Fe.testnet[n],chainType:n,walletUrl:"prod"===t?Me:Re});this._config.nodeRPC=e.nodeRPC||r.nodeRPC,this._config.appSettings=function(e,t){return Ce({},t||{},{chain:(null==t?void 0:t.chain)||e,appName:(null==t?void 0:t.appName)||"MyDemo"})}(this._config.chainType,e.appSettings),this._provider=new l(this._config.nodeRPC),this._auth_provider=new l(function(e){return"prod"===e?Fe.mainnet.polygon:Fe.testnet.polygon}(this._config.env));var o,i,a,s=e.walletUrl||r.walletUrl;s&&(i=(o=s).domain,a=o.protocol,De={upDomain:i=i||Ne,upConnectUrl:(a=a||"https")+"://"+i+"/connect",upLogoutUrl:a+"://"+i+"/logout",upSignMessageUrl:a+"://"+i+"/sign-message",upTransactionUrl:a+"://"+i+"/send-transaction",upLoadingUrl:a+"://"+i+"/connect/loading"}),this._config.storageType=e.storageType||"sessionStorage"},t.updateConfig=function(e){this._config&&(e.chainType&&(this._config.chainType=e.chainType),e.nodeRPC&&(this._config.nodeRPC=e.nodeRPC,this._provider=new l(this._config.nodeRPC)),e.appSettings&&(this._config.appSettings=e.appSettings))},t.login=function(){var e=Ae(Ue().mark((function e(t){return Ue().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Be(this._config,t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.getAccount=function(){var e,t;return e=this._config.storageType,(t=ze(e).get(nt))?JSON.parse(t):void 0},t.logout=function(){var e=Ae(Ue().mark((function e(t){return Ue().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return void 0===t&&(t=!1),e.next=3,We(t);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),t.getProvider=function(){return this._provider},t.getAuthProvider=function(){return this._auth_provider},t.isLogin=function(){return!!this.getAccount()},t.assertLogin=function(){if(!this.isLogin())throw new Error("user is not login")},t.getAddress=function(){return this.assertLogin(),this.getAccount().address},t.sendTransaction=function(){var e=Ae(Ue().mark((function e(t){return Ue().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.assertLogin(),e.next=3,it(t,this._config);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.signMessage=function(){var e=Ae(Ue().mark((function e(t,n){var r,o,i,a,s;return Ue().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.assertLogin(),o=(r=n||{}).isEIP191Prefix,i=void 0!==o&&o,a=r.onAuthChain,s=void 0===a||a,"string"==typeof t&&(t=he.toUtf8Bytes(t)),e.next=5,ot(new ue(this.getAddress(),he.hexlify(t),"V1",i,s),this._config);case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}(),t.isValidSignature=function(){var e=Ae(Ue().mark((function e(t,n,r){var o,i;return Ue().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r||(this.assertLogin(),r=this.getAddress()),o=new ee(r,[{inputs:[{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],name:"isValidSignature",outputs:[{internalType:"bytes4",name:"magicValue",type:"bytes4"}],stateMutability:"view",type:"function"}],this._auth_provider),e.next=4,o.isValidSignature(("string"==typeof(a=t)&&(a=he.toUtf8Bytes(a)),he.keccak256(he.concat([he.toUtf8Bytes("UniPass Signed Message:\n"),he.toUtf8Bytes(String(a.length)),a]))),n);case 4:return i=e.sent,e.abrupt("return",i===at);case 6:case"end":return e.stop()}var a}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}(),t.signTypedData=function(){var e=Ae(Ue().mark((function e(t,n){var r,o;return Ue().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.assertLogin(),null!=t){e.next=3;break}throw new Error("Missing data parameter");case 3:return r=(n||{}).onAuthChain,o=void 0===r||r,e.next=6,ot(new ue(this.getAddress(),JSON.stringify(t),"V4",!1,o),this._config);case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}(),t.isValidTypedSignature=function(){var e=Ae(Ue().mark((function e(t,n,r){var o,i,a;return Ue().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t){e.next=2;break}throw new Error("Missing data parameter");case 2:return n||(this.assertLogin(),n=this.getAddress()),o=new ee(n,[{inputs:[{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],name:"isValidSignature",outputs:[{internalType:"bytes4",name:"magicValue",type:"bytes4"}],stateMutability:"view",type:"function"}],this._auth_provider),i=de(t),e.next=7,o.isValidSignature(i,r);case 7:return a=e.sent,e.abrupt("return",a===at);case 9:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}(),e}();function ct(t){var n,r,s;return e(this,void 0,void 0,(function*(){const c=t.JsonRpcProvider||te,p=null!==(n=t.chainId)&&void 0!==n?n:1;let l=null!==(r=t.rpcUrl)&&void 0!==r?r:null===(s=t.rpc)||void 0===s?void 0:s[p];const f=new class extends c{constructor(e,n){super(e,n),this.updateUpWalletConfig=e=>{var n;const r=null===(n=t.rpc)||void 0===n?void 0:n[e];if(!o.includes(e))throw new Error(`chainId ${e} not supported`);if(this.upWallet.updateConfig({chainType:i(e),nodeRPC:r,appSettings:{chain:i(e)}}),"object"==typeof this.network)this.network.chainId=e;else{const t={chainId:e,name:"unknown"};Y(this,"_network",t),this.emit("network",t,null)}return this.rpcUrl=r,this.emit("chainChanged",`0x${e.toString(16)}`),{result:!0}},this.rpcUrl=e,this.upWallet=new st({env:a(p),chainType:i(p),appSettings:{appIcon:t.appLogoUrl,appName:t.appName,chain:i(p)},rpcUrl:l,storageType:"sessionStorage"})}getSigner(){var e;const t=this.upWallet.getAccount();return new se(f,this.upWallet,null!==(e=null==t?void 0:t.address)&&void 0!==e?e:"",0)}connect(){return e(this,void 0,void 0,(function*(){const e=this.upWallet.getAccount();return e||(yield this.upWallet.login({email:false}))}))}disconnect(){return e(this,void 0,void 0,(function*(){yield this.upWallet.logout()}))}listAccounts(){return e(this,void 0,void 0,(function*(){const e=this.upWallet.getAccount();return(null==e?void 0:e.address)?[null==e?void 0:e.address]:[]}))}getAddress(){const e=this.upWallet.getAccount();return Promise.resolve((null==e?void 0:e.address)?u(null==e?void 0:e.address):null)}}(l,p);return f}))}function ut(t,n){return e(this,void 0,void 0,(function*(){const e=yield ct(t);return e.on("connect",n.connect),e.on("disconnect",(e=>{n.disconnect(e),n.accountsChanged([])})),e.on("accountsChanged",n.accountsChanged),e.on("chainChanged",n.chainChanged),e.on("message",(({type:e,data:t})=>n.message(e,t))),yield e.connect(),e}))}function pt(){var e;null===(e=s.getState().provider)||void 0===e||e.disconnect()}function lt(e){var t,n;return null===(n=null===(t=s.getState().provider)||void 0===t?void 0:t.upWallet)||void 0===n?void 0:n.signTypedData(e)}function ft(e){var t;const n=e.addChainParameters.chainId,r="string"==typeof n&&(null==n?void 0:n.startsWith("0x"))?parseInt(n,16):Number(n);if(!o.includes(r))throw new Error(`chainId ${r} not supported`);return null===(t=s.getState().provider)||void 0===t?void 0:t.updateUpWalletConfig(r)}export{ct as createProvider,ut as default,pt as disconnectWallet,lt as signTypedData,ft as switchChain};
|
package/dist/index-d00482ad.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}function o(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function s(e,t,r,s,i){if("function"!=typeof r)throw new TypeError("The listener must be a function");var c=new o(r,s||e,i),f=n?n+t:t;return e._events[f]?e._events[f].fn?e._events[f]=[e._events[f],c]:e._events[f].push(c):(e._events[f]=c,e._eventsCount++),e}function i(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function c(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),c.prototype.eventNames=function(){var e,r,o=[];if(0===this._eventsCount)return o;for(r in e=this._events)t.call(e,r)&&o.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(e)):o},c.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var o=0,s=r.length,i=new Array(s);o<s;o++)i[o]=r[o].fn;return i},c.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},c.prototype.emit=function(e,t,r,o,s,i){var c=n?n+e:e;if(!this._events[c])return!1;var f,a,u=this._events[c],v=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),v){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,r),!0;case 4:return u.fn.call(u.context,t,r,o),!0;case 5:return u.fn.call(u.context,t,r,o,s),!0;case 6:return u.fn.call(u.context,t,r,o,s,i),!0}for(a=1,f=new Array(v-1);a<v;a++)f[a-1]=arguments[a];u.fn.apply(u.context,f)}else{var p,l=u.length;for(a=0;a<l;a++)switch(u[a].once&&this.removeListener(e,u[a].fn,void 0,!0),v){case 1:u[a].fn.call(u[a].context);break;case 2:u[a].fn.call(u[a].context,t);break;case 3:u[a].fn.call(u[a].context,t,r);break;case 4:u[a].fn.call(u[a].context,t,r,o);break;default:if(!f)for(p=1,f=new Array(v-1);p<v;p++)f[p-1]=arguments[p];u[a].fn.apply(u[a].context,f)}}return!0},c.prototype.on=function(e,t,n){return s(this,e,t,n,!1)},c.prototype.once=function(e,t,n){return s(this,e,t,n,!0)},c.prototype.removeListener=function(e,t,r,o){var s=n?n+e:e;if(!this._events[s])return this;if(!t)return i(this,s),this;var c=this._events[s];if(c.fn)c.fn!==t||o&&!c.once||r&&c.context!==r||i(this,s);else{for(var f=0,a=[],u=c.length;f<u;f++)(c[f].fn!==t||o&&!c[f].once||r&&c[f].context!==r)&&a.push(c[f]);a.length?this._events[s]=1===a.length?a[0]:a:i(this,s)}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&i(this,t)):(this._events=new r,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=n,c.EventEmitter=c,e.exports=c}(e);var t=e.exports;export{e,t as u};
|