@dodoex/wallet-web3 0.0.57-beta.1 → 0.0.57-beta.2
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-6b210484.js → alchemy-provider-5870b6fa-a8987c5c.js} +1 -1
- package/dist/{alchemy-websocket-provider-213da986-3ac05e5b.js → alchemy-websocket-provider-213da986-2d18a1a1.js} +1 -1
- package/dist/{blocto-8f5fd7d3.js → blocto-e541ed13.js} +1 -1
- package/dist/{ccip-d1744cf2.js → ccip-043f1b23.js} +1 -1
- package/dist/cjs/{alchemy-provider-5870b6fa-7453f6a0.cjs → alchemy-provider-5870b6fa-e2a879cc.cjs} +1 -1
- package/dist/cjs/{alchemy-websocket-provider-213da986-3b95cee6.cjs → alchemy-websocket-provider-213da986-bbc4c791.cjs} +1 -1
- package/dist/cjs/{blocto-b4a7092b.cjs → blocto-4b44f311.cjs} +1 -1
- package/dist/cjs/{ccip-ce28d6bf.cjs → ccip-cbc14b8a.cjs} +1 -1
- package/dist/cjs/{draggabilly-753ccd30.cjs → draggabilly-02ab10da.cjs} +1 -1
- package/dist/cjs/id-18dab5fc.cjs +1 -0
- package/dist/cjs/{index-fb968ad2.cjs → index-1a02c2de.cjs} +1 -1
- package/dist/cjs/{index-ecc3408d.cjs → index-1cc69d24.cjs} +1 -1
- package/dist/cjs/{index-90a9af5d.cjs → index-758f1b2f.cjs} +1 -1
- package/dist/cjs/{index-2a98c637.cjs → index-8fbffb61.cjs} +1 -1
- package/dist/cjs/{index-c32675d7.cjs → index-9ae61873.cjs} +1 -1
- package/dist/cjs/{index-edb35915.cjs → index-bedcfd6d.cjs} +1 -1
- package/dist/cjs/{index-17256a18.cjs → index-c6896d98.cjs} +4 -4
- package/dist/cjs/{index-c53fd9aa.cjs → index-cb5523c0.cjs} +9 -9
- package/dist/cjs/{index-09b465f6.cjs → index-cb57abcf.cjs} +2 -2
- package/dist/cjs/{index-fc09a87b.cjs → index-fb5ea88d.cjs} +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/{index.es-9ddf4378.cjs → index.es-1f8c95c7.cjs} +1 -1
- package/dist/cjs/{interface-2a09f64e.cjs → interface-9984f273.cjs} +1 -1
- package/dist/cjs/{lib-typedarrays-51607293.cjs → lib-typedarrays-39528723.cjs} +1 -1
- package/dist/cjs/{portis-f57258db.cjs → portis-c6d741ad.cjs} +1 -1
- package/dist/cjs/{provider-74da7349.cjs → provider-e92e86ea.cjs} +1 -1
- package/dist/cjs/providers/wallets/index.d.ts +1 -1
- package/dist/cjs/{rainbow-727e8ea5.cjs → rainbow-bb1b7a3c.cjs} +1 -1
- package/dist/cjs/{sha224-423d5841.cjs → sha224-d86645c4.cjs} +1 -1
- package/dist/cjs/{sha256-874c9a4f.cjs → sha256-bdd1f6be.cjs} +1 -1
- package/dist/cjs/{typed-data-d288b47c.cjs → typed-data-69e5f69d.cjs} +1 -1
- package/dist/cjs/{uAuth-361814ef.cjs → uAuth-882b002a.cjs} +1 -1
- package/dist/cjs/{walletConnect-90bdf48f.cjs → walletConnect-e8dbfe1b.cjs} +1 -1
- package/dist/cjs/{walletLink-1f27a868.cjs → walletLink-0e68d5c5.cjs} +1 -1
- package/dist/{draggabilly-9d05d32a.js → draggabilly-8aa5094a.js} +1 -1
- package/dist/id-672ebf99.js +1 -0
- package/dist/{index-54585d0b.js → index-128f696e.js} +1 -1
- package/dist/{index-20266fbe.js → index-1cb1a4bd.js} +1 -1
- package/dist/{index-2270e11e.js → index-477427ef.js} +1 -1
- package/dist/{index-4b539ae1.js → index-5464c7dc.js} +2 -2
- package/dist/{index-5865e5b8.js → index-5a10b30c.js} +4 -4
- package/dist/{index-afee6d12.js → index-6ac67cdd.js} +9 -9
- package/dist/{index-72b1f8bd.js → index-83a13e2d.js} +1 -1
- package/dist/{index-179c2bb2.js → index-be8b6bac.js} +1 -1
- package/dist/{index-013d9a80.js → index-c3b1f1e5.js} +1 -1
- package/dist/{index-9aad50a9.js → index-f538c157.js} +1 -1
- package/dist/{index.es-22ab18a7.js → index.es-cdd5584b.js} +1 -1
- package/dist/index.js +1 -1
- package/dist/{interface-76e42a07.js → interface-e6b76064.js} +1 -1
- package/dist/{lib-typedarrays-60ecdf93.js → lib-typedarrays-08d29b44.js} +1 -1
- package/dist/{portis-b9004d27.js → portis-662d7413.js} +1 -1
- package/dist/{provider-7049aff5.js → provider-c4961cea.js} +1 -1
- package/dist/providers/wallets/index.d.ts +1 -1
- package/dist/{rainbow-1e89ee8a.js → rainbow-671ba2d1.js} +1 -1
- package/dist/{sha224-778cae22.js → sha224-d9006a27.js} +1 -1
- package/dist/{sha256-a1fc65fb.js → sha256-f0ee03fb.js} +1 -1
- package/dist/{typed-data-976cda33.js → typed-data-7372705e.js} +1 -1
- package/dist/{uAuth-1ec9ee54.js → uAuth-c491c7b5.js} +1 -1
- package/dist/{walletConnect-4755969f.js → walletConnect-602aaca8.js} +1 -1
- package/dist/{walletLink-88901ef9.js → walletLink-47635a30.js} +1 -1
- package/package.json +1 -1
- package/dist/cjs/id-30b440b2.cjs +0 -1
- package/dist/id-d456493a.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as t}from"./index-
|
|
1
|
+
import{c as t}from"./index-5a10b30c.js";function i(t,i){return i.forEach((function(i){i&&"string"!=typeof i&&!Array.isArray(i)&&Object.keys(i).forEach((function(e){if("default"!==e&&!(e in t)){var n=Object.getOwnPropertyDescriptor(i,e);Object.defineProperty(t,e,n.get?n:{enumerable:!0,get:function(){return i[e]}})}}))})),Object.freeze(t)}var e,n={exports:{}},o={exports:{}};function s(){return e||(e=1,t=o,function(i,e){t.exports?t.exports=e():i.getSize=e()}(window,(function(){function t(t){let i=parseFloat(t);return-1==t.indexOf("%")&&!isNaN(i)&&i}let i=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"];return function(e){if("string"==typeof e&&(e=document.querySelector(e)),!e||"object"!=typeof e||!e.nodeType)return;let n=getComputedStyle(e);if("none"==n.display)return function(){let t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0};return i.forEach((i=>{t[i]=0})),t}();let o={};o.width=e.offsetWidth,o.height=e.offsetHeight;let s=o.isBorderBox="border-box"==n.boxSizing;i.forEach((t=>{let i=n[t],e=parseFloat(i);o[t]=isNaN(e)?0:e}));let r=o.paddingLeft+o.paddingRight,h=o.paddingTop+o.paddingBottom,a=o.marginLeft+o.marginRight,d=o.marginTop+o.marginBottom,l=o.borderLeftWidth+o.borderRightWidth,c=o.borderTopWidth+o.borderBottomWidth,u=t(n.width);!1!==u&&(o.width=u+(s?0:r+l));let p=t(n.height);return!1!==p&&(o.height=p+(s?0:h+c)),o.innerWidth=o.width-(r+l),o.innerHeight=o.height-(h+c),o.outerWidth=o.width+a,o.outerHeight=o.height+d,o}}))),o.exports;var t}var r,h,a,d={exports:{}},l={exports:{}};function c(){return r||(r=1,i=l,e="undefined"!=typeof window?window:t,n=function(){function t(){}let i=t.prototype;return i.on=function(t,i){if(!t||!i)return this;let e=this._events=this._events||{},n=e[t]=e[t]||[];return n.includes(i)||n.push(i),this},i.once=function(t,i){if(!t||!i)return this;this.on(t,i);let e=this._onceEvents=this._onceEvents||{};return(e[t]=e[t]||{})[i]=!0,this},i.off=function(t,i){let e=this._events&&this._events[t];if(!e||!e.length)return this;let n=e.indexOf(i);return-1!=n&&e.splice(n,1),this},i.emitEvent=function(t,i){let e=this._events&&this._events[t];if(!e||!e.length)return this;e=e.slice(0),i=i||[];let n=this._onceEvents&&this._onceEvents[t];for(let o of e)n&&n[o]&&(this.off(t,o),delete n[o]),o.apply(this,i);return this},i.allOff=function(){return delete this._events,delete this._onceEvents,this},t},i.exports?i.exports=n():e.EvEmitter=n()),l.exports;var i,e,n}
|
|
2
2
|
/*!
|
|
3
3
|
* Unidragger v3.0.1
|
|
4
4
|
* Draggable base class
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{k as r,t}from"./index-5a10b30c.js";function a(a){return r(t(a))}export{a as i};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a1 as e,a2 as t,a3 as n,a4 as s,Q as i,a5 as o,a6 as r,a7 as a,a8 as c,a9 as l,aa as d,ab as u,ac as h,ad as p,ae as m,af as f,ag as g,ah as w,ai as k,aj as y,ak as b,al as E,am as C,an as v,ao as S,ap as A,aq as I,ar as x,as as O,at as R,au as N,av as T,aw as M,ax as _,ay as B,az as P,aA as D,_ as j,A as L}from"./index-5865e5b8.js";export{ax as isInBinance}from"./index-5865e5b8.js";import*as F from"react";import z,{createContext as U,useState as H,useEffect as q,useCallback as V,useContext as W}from"react";import $ from"react-dom";import{I as J}from"./interface-76e42a07.js";import"@ethersproject/address";import"@ethersproject/providers";import"zustand";import"@ethersproject/bytes";import"@ethersproject/properties";import"@ethersproject/abstract-signer";import"buffer";import"@ethersproject/abstract-provider";import"@ethersproject/contracts";import"events";import"@ethersproject/constants";import"@ethersproject/transactions";import"./id-d456493a.js";var Q,K={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"},G=$;if("production"===process.env.NODE_ENV)Q=G.createRoot,G.hydrateRoot;else{var Z=G.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Q=function(e,t){Z.usingClientEntryPoint=!0;try{return G.createRoot(e,t)}finally{Z.usingClientEntryPoint=!1}}}var Y,X,ee=Object.defineProperty,te=Object.getOwnPropertySymbols,ne=Object.prototype.hasOwnProperty,se=Object.prototype.propertyIsEnumerable,ie=(e,t,n)=>t in e?ee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,oe=(e,t)=>{for(var n in t||(t={}))ne.call(t,n)&&ie(e,n,t[n]);if(te)for(var n of te(t))se.call(t,n)&&ie(e,n,t[n]);return e},re=(e,t)=>{var n={};for(var s in e)ne.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(null!=e&&te)for(var s of te(e))t.indexOf(s)<0&&se.call(e,s)&&(n[s]=e[s]);return n};(e=>{const t=class{constructor(e,n,s,i){if(this.version=e,this.errorCorrectionLevel=n,this.modules=[],this.isFunction=[],e<t.MIN_VERSION||e>t.MAX_VERSION)throw new RangeError("Version value out of range");if(i<-1||i>7)throw new RangeError("Mask value out of range");this.size=4*e+17;let r=[];for(let e=0;e<this.size;e++)r.push(!1);for(let e=0;e<this.size;e++)this.modules.push(r.slice()),this.isFunction.push(r.slice());this.drawFunctionPatterns();const a=this.addEccAndInterleave(s);if(this.drawCodewords(a),-1==i){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);const n=this.getPenaltyScore();n<e&&(i=t,e=n),this.applyMask(t)}}o(0<=i&&i<=7),this.mask=i,this.applyMask(i),this.drawFormatBits(i),this.isFunction=[]}static encodeText(n,s){const i=e.QrSegment.makeSegments(n);return t.encodeSegments(i,s)}static encodeBinary(n,s){const i=e.QrSegment.makeBytes(n);return t.encodeSegments([i],s)}static encodeSegments(e,n,i=1,r=40,c=-1,l=!0){if(!(t.MIN_VERSION<=i&&i<=r&&r<=t.MAX_VERSION)||c<-1||c>7)throw new RangeError("Invalid value");let d,u;for(d=i;;d++){const s=8*t.getNumDataCodewords(d,n),i=a.getTotalBits(e,d);if(i<=s){u=i;break}if(d>=r)throw new RangeError("Data too long")}for(const e of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])l&&u<=8*t.getNumDataCodewords(d,e)&&(n=e);let h=[];for(const t of e){s(t.mode.modeBits,4,h),s(t.numChars,t.mode.numCharCountBits(d),h);for(const e of t.getData())h.push(e)}o(h.length==u);const p=8*t.getNumDataCodewords(d,n);o(h.length<=p),s(0,Math.min(4,p-h.length),h),s(0,(8-h.length%8)%8,h),o(h.length%8==0);for(let e=236;h.length<p;e^=253)s(e,8,h);let m=[];for(;8*m.length<h.length;)m.push(0);return h.forEach(((e,t)=>m[t>>>3]|=e<<7-(7&t))),new t(d,n,m,c)}getModule(e,t){return 0<=e&&e<this.size&&0<=t&&t<this.size&&this.modules[t][e]}getModules(){return this.modules}drawFunctionPatterns(){for(let e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0),this.setFunctionModule(e,6,e%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const e=this.getAlignmentPatternPositions(),t=e.length;for(let n=0;n<t;n++)for(let s=0;s<t;s++)0==n&&0==s||0==n&&s==t-1||n==t-1&&0==s||this.drawAlignmentPattern(e[n],e[s]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){const t=this.errorCorrectionLevel.formatBits<<3|e;let n=t;for(let e=0;e<10;e++)n=n<<1^1335*(n>>>9);const s=21522^(t<<10|n);o(s>>>15==0);for(let e=0;e<=5;e++)this.setFunctionModule(8,e,i(s,e));this.setFunctionModule(8,7,i(s,6)),this.setFunctionModule(8,8,i(s,7)),this.setFunctionModule(7,8,i(s,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,i(s,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,i(s,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,i(s,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^7973*(e>>>11);const t=this.version<<12|e;o(t>>>18==0);for(let e=0;e<18;e++){const n=i(t,e),s=this.size-11+e%3,o=Math.floor(e/3);this.setFunctionModule(s,o,n),this.setFunctionModule(o,s,n)}}drawFinderPattern(e,t){for(let n=-4;n<=4;n++)for(let s=-4;s<=4;s++){const i=Math.max(Math.abs(s),Math.abs(n)),o=e+s,r=t+n;0<=o&&o<this.size&&0<=r&&r<this.size&&this.setFunctionModule(o,r,2!=i&&4!=i)}}drawAlignmentPattern(e,t){for(let n=-2;n<=2;n++)for(let s=-2;s<=2;s++)this.setFunctionModule(e+s,t+n,1!=Math.max(Math.abs(s),Math.abs(n)))}setFunctionModule(e,t,n){this.modules[t][e]=n,this.isFunction[t][e]=!0}addEccAndInterleave(e){const n=this.version,s=this.errorCorrectionLevel;if(e.length!=t.getNumDataCodewords(n,s))throw new RangeError("Invalid argument");const i=t.NUM_ERROR_CORRECTION_BLOCKS[s.ordinal][n],r=t.ECC_CODEWORDS_PER_BLOCK[s.ordinal][n],a=Math.floor(t.getNumRawDataModules(n)/8),c=i-a%i,l=Math.floor(a/i);let d=[];const u=t.reedSolomonComputeDivisor(r);for(let n=0,s=0;n<i;n++){let i=e.slice(s,s+l-r+(n<c?0:1));s+=i.length;const o=t.reedSolomonComputeRemainder(i,u);n<c&&i.push(0),d.push(i.concat(o))}let h=[];for(let e=0;e<d[0].length;e++)d.forEach(((t,n)=>{(e!=l-r||n>=c)&&h.push(t[e])}));return o(h.length==a),h}drawCodewords(e){if(e.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let n=0;for(let t=this.size-1;t>=1;t-=2){6==t&&(t=5);for(let s=0;s<this.size;s++)for(let o=0;o<2;o++){const r=t-o,a=0==(t+1&2)?this.size-1-s:s;!this.isFunction[a][r]&&n<8*e.length&&(this.modules[a][r]=i(e[n>>>3],7-(7&n)),n++)}}o(n==8*e.length)}applyMask(e){if(e<0||e>7)throw new RangeError("Mask value out of range");for(let t=0;t<this.size;t++)for(let n=0;n<this.size;n++){let s;switch(e){case 0:s=(n+t)%2==0;break;case 1:s=t%2==0;break;case 2:s=n%3==0;break;case 3:s=(n+t)%3==0;break;case 4:s=(Math.floor(n/3)+Math.floor(t/2))%2==0;break;case 5:s=n*t%2+n*t%3==0;break;case 6:s=(n*t%2+n*t%3)%2==0;break;case 7:s=((n+t)%2+n*t%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[t][n]&&s&&(this.modules[t][n]=!this.modules[t][n])}}getPenaltyScore(){let e=0;for(let n=0;n<this.size;n++){let s=!1,i=0,o=[0,0,0,0,0,0,0];for(let r=0;r<this.size;r++)this.modules[n][r]==s?(i++,5==i?e+=t.PENALTY_N1:i>5&&e++):(this.finderPenaltyAddHistory(i,o),s||(e+=this.finderPenaltyCountPatterns(o)*t.PENALTY_N3),s=this.modules[n][r],i=1);e+=this.finderPenaltyTerminateAndCount(s,i,o)*t.PENALTY_N3}for(let n=0;n<this.size;n++){let s=!1,i=0,o=[0,0,0,0,0,0,0];for(let r=0;r<this.size;r++)this.modules[r][n]==s?(i++,5==i?e+=t.PENALTY_N1:i>5&&e++):(this.finderPenaltyAddHistory(i,o),s||(e+=this.finderPenaltyCountPatterns(o)*t.PENALTY_N3),s=this.modules[r][n],i=1);e+=this.finderPenaltyTerminateAndCount(s,i,o)*t.PENALTY_N3}for(let n=0;n<this.size-1;n++)for(let s=0;s<this.size-1;s++){const i=this.modules[n][s];i==this.modules[n][s+1]&&i==this.modules[n+1][s]&&i==this.modules[n+1][s+1]&&(e+=t.PENALTY_N2)}let n=0;for(const e of this.modules)n=e.reduce(((e,t)=>e+(t?1:0)),n);const s=this.size*this.size,i=Math.ceil(Math.abs(20*n-10*s)/s)-1;return o(0<=i&&i<=9),e+=i*t.PENALTY_N4,o(0<=e&&e<=2568888),e}getAlignmentPatternPositions(){if(1==this.version)return[];{const e=Math.floor(this.version/7)+2,t=32==this.version?26:2*Math.ceil((4*this.version+4)/(2*e-2));let n=[6];for(let s=this.size-7;n.length<e;s-=t)n.splice(1,0,s);return n}}static getNumRawDataModules(e){if(e<t.MIN_VERSION||e>t.MAX_VERSION)throw new RangeError("Version number out of range");let n=(16*e+128)*e+64;if(e>=2){const t=Math.floor(e/7)+2;n-=(25*t-10)*t-55,e>=7&&(n-=36)}return o(208<=n&&n<=29648),n}static getNumDataCodewords(e,n){return Math.floor(t.getNumRawDataModules(e)/8)-t.ECC_CODEWORDS_PER_BLOCK[n.ordinal][e]*t.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw new RangeError("Degree out of range");let n=[];for(let t=0;t<e-1;t++)n.push(0);n.push(1);let s=1;for(let i=0;i<e;i++){for(let e=0;e<n.length;e++)n[e]=t.reedSolomonMultiply(n[e],s),e+1<n.length&&(n[e]^=n[e+1]);s=t.reedSolomonMultiply(s,2)}return n}static reedSolomonComputeRemainder(e,n){let s=n.map((e=>0));for(const i of e){const e=i^s.shift();s.push(0),n.forEach(((n,i)=>s[i]^=t.reedSolomonMultiply(n,e)))}return s}static reedSolomonMultiply(e,t){if(e>>>8!=0||t>>>8!=0)throw new RangeError("Byte out of range");let n=0;for(let s=7;s>=0;s--)n=n<<1^285*(n>>>7),n^=(t>>>s&1)*e;return o(n>>>8==0),n}finderPenaltyCountPatterns(e){const t=e[1];o(t<=3*this.size);const n=t>0&&e[2]==t&&e[3]==3*t&&e[4]==t&&e[5]==t;return(n&&e[0]>=4*t&&e[6]>=t?1:0)+(n&&e[6]>=4*t&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,t){0==t[0]&&(e+=this.size),t.pop(),t.unshift(e)}};let n=t;function s(e,t,n){if(t<0||t>31||e>>>t!=0)throw new RangeError("Value out of range");for(let s=t-1;s>=0;s--)n.push(e>>>s&1)}function i(e,t){return 0!=(e>>>t&1)}function o(e){if(!e)throw new Error("Assertion error")}n.MIN_VERSION=1,n.MAX_VERSION=40,n.PENALTY_N1=3,n.PENALTY_N2=3,n.PENALTY_N3=40,n.PENALTY_N4=10,n.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],n.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=n;const r=class{constructor(e,t,n){if(this.mode=e,this.numChars=t,this.bitData=n,t<0)throw new RangeError("Invalid argument");this.bitData=n.slice()}static makeBytes(e){let t=[];for(const n of e)s(n,8,t);return new r(r.Mode.BYTE,e.length,t)}static makeNumeric(e){if(!r.isNumeric(e))throw new RangeError("String contains non-numeric characters");let t=[];for(let n=0;n<e.length;){const i=Math.min(e.length-n,3);s(parseInt(e.substr(n,i),10),3*i+1,t),n+=i}return new r(r.Mode.NUMERIC,e.length,t)}static makeAlphanumeric(e){if(!r.isAlphanumeric(e))throw new RangeError("String contains unencodable characters in alphanumeric mode");let t,n=[];for(t=0;t+2<=e.length;t+=2){let i=45*r.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t));i+=r.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t+1)),s(i,11,n)}return t<e.length&&s(r.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t)),6,n),new r(r.Mode.ALPHANUMERIC,e.length,n)}static makeSegments(e){return""==e?[]:r.isNumeric(e)?[r.makeNumeric(e)]:r.isAlphanumeric(e)?[r.makeAlphanumeric(e)]:[r.makeBytes(r.toUtf8ByteArray(e))]}static makeEci(e){let t=[];if(e<0)throw new RangeError("ECI assignment value out of range");if(e<128)s(e,8,t);else if(e<16384)s(2,2,t),s(e,14,t);else{if(!(e<1e6))throw new RangeError("ECI assignment value out of range");s(6,3,t),s(e,21,t)}return new r(r.Mode.ECI,0,t)}static isNumeric(e){return r.NUMERIC_REGEX.test(e)}static isAlphanumeric(e){return r.ALPHANUMERIC_REGEX.test(e)}getData(){return this.bitData.slice()}static getTotalBits(e,t){let n=0;for(const s of e){const e=s.mode.numCharCountBits(t);if(s.numChars>=1<<e)return 1/0;n+=4+e+s.bitData.length}return n}static toUtf8ByteArray(e){e=encodeURI(e);let t=[];for(let n=0;n<e.length;n++)"%"!=e.charAt(n)?t.push(e.charCodeAt(n)):(t.push(parseInt(e.substr(n+1,2),16)),n+=2);return t}};let a=r;a.NUMERIC_REGEX=/^[0-9]*$/,a.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,a.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",e.QrSegment=a})(Y||(Y={})),(e=>{const t=class{constructor(e,t){this.ordinal=e,this.formatBits=t}};let n=t;n.LOW=new t(0,1),n.MEDIUM=new t(1,0),n.QUARTILE=new t(2,3),n.HIGH=new t(3,2),e.Ecc=n})((X=Y||(Y={})).QrCode||(X.QrCode={})),(e=>{(e=>{const t=class{constructor(e,t){this.modeBits=e,this.numBitsCharCount=t}numCharCountBits(e){return this.numBitsCharCount[Math.floor((e+7)/17)]}};let n=t;n.NUMERIC=new t(1,[10,12,14]),n.ALPHANUMERIC=new t(2,[9,11,13]),n.BYTE=new t(4,[8,16,16]),n.KANJI=new t(8,[8,10,12]),n.ECI=new t(7,[0,0,0]),e.Mode=n})(e.QrSegment||(e.QrSegment={}))})(Y||(Y={}));var ae=Y,ce={L:ae.QrCode.Ecc.LOW,M:ae.QrCode.Ecc.MEDIUM,Q:ae.QrCode.Ecc.QUARTILE,H:ae.QrCode.Ecc.HIGH},le=128,de="L",ue="#FFFFFF",he="#000000",pe=!1,me=4,fe=.1;
|
|
1
|
+
import{a1 as e,a2 as t,a3 as n,a4 as s,Q as i,a5 as o,a6 as r,a7 as a,a8 as c,a9 as l,aa as d,ab as u,ac as h,ad as p,ae as m,af as f,ag as g,ah as w,ai as k,aj as y,ak as b,al as E,am as C,an as v,ao as S,ap as A,aq as I,ar as x,as as O,at as R,au as N,av as T,aw as M,ax as _,ay as B,az as P,aA as D,_ as j,A as L}from"./index-5a10b30c.js";export{ax as isInBinance}from"./index-5a10b30c.js";import*as F from"react";import z,{createContext as U,useState as H,useEffect as q,useCallback as V,useContext as W}from"react";import $ from"react-dom";import{I as J}from"./interface-e6b76064.js";import"@ethersproject/address";import"@ethersproject/providers";import"zustand";import"@ethersproject/bytes";import"@ethersproject/properties";import"@ethersproject/abstract-signer";import"buffer";import"@ethersproject/abstract-provider";import"@ethersproject/contracts";import"events";import"@ethersproject/constants";import"@ethersproject/transactions";import"./id-672ebf99.js";var Q,K={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"},G=$;if("production"===process.env.NODE_ENV)Q=G.createRoot,G.hydrateRoot;else{var Z=G.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Q=function(e,t){Z.usingClientEntryPoint=!0;try{return G.createRoot(e,t)}finally{Z.usingClientEntryPoint=!1}}}var Y,X,ee=Object.defineProperty,te=Object.getOwnPropertySymbols,ne=Object.prototype.hasOwnProperty,se=Object.prototype.propertyIsEnumerable,ie=(e,t,n)=>t in e?ee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,oe=(e,t)=>{for(var n in t||(t={}))ne.call(t,n)&&ie(e,n,t[n]);if(te)for(var n of te(t))se.call(t,n)&&ie(e,n,t[n]);return e},re=(e,t)=>{var n={};for(var s in e)ne.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(null!=e&&te)for(var s of te(e))t.indexOf(s)<0&&se.call(e,s)&&(n[s]=e[s]);return n};(e=>{const t=class{constructor(e,n,s,i){if(this.version=e,this.errorCorrectionLevel=n,this.modules=[],this.isFunction=[],e<t.MIN_VERSION||e>t.MAX_VERSION)throw new RangeError("Version value out of range");if(i<-1||i>7)throw new RangeError("Mask value out of range");this.size=4*e+17;let r=[];for(let e=0;e<this.size;e++)r.push(!1);for(let e=0;e<this.size;e++)this.modules.push(r.slice()),this.isFunction.push(r.slice());this.drawFunctionPatterns();const a=this.addEccAndInterleave(s);if(this.drawCodewords(a),-1==i){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);const n=this.getPenaltyScore();n<e&&(i=t,e=n),this.applyMask(t)}}o(0<=i&&i<=7),this.mask=i,this.applyMask(i),this.drawFormatBits(i),this.isFunction=[]}static encodeText(n,s){const i=e.QrSegment.makeSegments(n);return t.encodeSegments(i,s)}static encodeBinary(n,s){const i=e.QrSegment.makeBytes(n);return t.encodeSegments([i],s)}static encodeSegments(e,n,i=1,r=40,c=-1,l=!0){if(!(t.MIN_VERSION<=i&&i<=r&&r<=t.MAX_VERSION)||c<-1||c>7)throw new RangeError("Invalid value");let d,u;for(d=i;;d++){const s=8*t.getNumDataCodewords(d,n),i=a.getTotalBits(e,d);if(i<=s){u=i;break}if(d>=r)throw new RangeError("Data too long")}for(const e of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])l&&u<=8*t.getNumDataCodewords(d,e)&&(n=e);let h=[];for(const t of e){s(t.mode.modeBits,4,h),s(t.numChars,t.mode.numCharCountBits(d),h);for(const e of t.getData())h.push(e)}o(h.length==u);const p=8*t.getNumDataCodewords(d,n);o(h.length<=p),s(0,Math.min(4,p-h.length),h),s(0,(8-h.length%8)%8,h),o(h.length%8==0);for(let e=236;h.length<p;e^=253)s(e,8,h);let m=[];for(;8*m.length<h.length;)m.push(0);return h.forEach(((e,t)=>m[t>>>3]|=e<<7-(7&t))),new t(d,n,m,c)}getModule(e,t){return 0<=e&&e<this.size&&0<=t&&t<this.size&&this.modules[t][e]}getModules(){return this.modules}drawFunctionPatterns(){for(let e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0),this.setFunctionModule(e,6,e%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const e=this.getAlignmentPatternPositions(),t=e.length;for(let n=0;n<t;n++)for(let s=0;s<t;s++)0==n&&0==s||0==n&&s==t-1||n==t-1&&0==s||this.drawAlignmentPattern(e[n],e[s]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){const t=this.errorCorrectionLevel.formatBits<<3|e;let n=t;for(let e=0;e<10;e++)n=n<<1^1335*(n>>>9);const s=21522^(t<<10|n);o(s>>>15==0);for(let e=0;e<=5;e++)this.setFunctionModule(8,e,i(s,e));this.setFunctionModule(8,7,i(s,6)),this.setFunctionModule(8,8,i(s,7)),this.setFunctionModule(7,8,i(s,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,i(s,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,i(s,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,i(s,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^7973*(e>>>11);const t=this.version<<12|e;o(t>>>18==0);for(let e=0;e<18;e++){const n=i(t,e),s=this.size-11+e%3,o=Math.floor(e/3);this.setFunctionModule(s,o,n),this.setFunctionModule(o,s,n)}}drawFinderPattern(e,t){for(let n=-4;n<=4;n++)for(let s=-4;s<=4;s++){const i=Math.max(Math.abs(s),Math.abs(n)),o=e+s,r=t+n;0<=o&&o<this.size&&0<=r&&r<this.size&&this.setFunctionModule(o,r,2!=i&&4!=i)}}drawAlignmentPattern(e,t){for(let n=-2;n<=2;n++)for(let s=-2;s<=2;s++)this.setFunctionModule(e+s,t+n,1!=Math.max(Math.abs(s),Math.abs(n)))}setFunctionModule(e,t,n){this.modules[t][e]=n,this.isFunction[t][e]=!0}addEccAndInterleave(e){const n=this.version,s=this.errorCorrectionLevel;if(e.length!=t.getNumDataCodewords(n,s))throw new RangeError("Invalid argument");const i=t.NUM_ERROR_CORRECTION_BLOCKS[s.ordinal][n],r=t.ECC_CODEWORDS_PER_BLOCK[s.ordinal][n],a=Math.floor(t.getNumRawDataModules(n)/8),c=i-a%i,l=Math.floor(a/i);let d=[];const u=t.reedSolomonComputeDivisor(r);for(let n=0,s=0;n<i;n++){let i=e.slice(s,s+l-r+(n<c?0:1));s+=i.length;const o=t.reedSolomonComputeRemainder(i,u);n<c&&i.push(0),d.push(i.concat(o))}let h=[];for(let e=0;e<d[0].length;e++)d.forEach(((t,n)=>{(e!=l-r||n>=c)&&h.push(t[e])}));return o(h.length==a),h}drawCodewords(e){if(e.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let n=0;for(let t=this.size-1;t>=1;t-=2){6==t&&(t=5);for(let s=0;s<this.size;s++)for(let o=0;o<2;o++){const r=t-o,a=0==(t+1&2)?this.size-1-s:s;!this.isFunction[a][r]&&n<8*e.length&&(this.modules[a][r]=i(e[n>>>3],7-(7&n)),n++)}}o(n==8*e.length)}applyMask(e){if(e<0||e>7)throw new RangeError("Mask value out of range");for(let t=0;t<this.size;t++)for(let n=0;n<this.size;n++){let s;switch(e){case 0:s=(n+t)%2==0;break;case 1:s=t%2==0;break;case 2:s=n%3==0;break;case 3:s=(n+t)%3==0;break;case 4:s=(Math.floor(n/3)+Math.floor(t/2))%2==0;break;case 5:s=n*t%2+n*t%3==0;break;case 6:s=(n*t%2+n*t%3)%2==0;break;case 7:s=((n+t)%2+n*t%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[t][n]&&s&&(this.modules[t][n]=!this.modules[t][n])}}getPenaltyScore(){let e=0;for(let n=0;n<this.size;n++){let s=!1,i=0,o=[0,0,0,0,0,0,0];for(let r=0;r<this.size;r++)this.modules[n][r]==s?(i++,5==i?e+=t.PENALTY_N1:i>5&&e++):(this.finderPenaltyAddHistory(i,o),s||(e+=this.finderPenaltyCountPatterns(o)*t.PENALTY_N3),s=this.modules[n][r],i=1);e+=this.finderPenaltyTerminateAndCount(s,i,o)*t.PENALTY_N3}for(let n=0;n<this.size;n++){let s=!1,i=0,o=[0,0,0,0,0,0,0];for(let r=0;r<this.size;r++)this.modules[r][n]==s?(i++,5==i?e+=t.PENALTY_N1:i>5&&e++):(this.finderPenaltyAddHistory(i,o),s||(e+=this.finderPenaltyCountPatterns(o)*t.PENALTY_N3),s=this.modules[r][n],i=1);e+=this.finderPenaltyTerminateAndCount(s,i,o)*t.PENALTY_N3}for(let n=0;n<this.size-1;n++)for(let s=0;s<this.size-1;s++){const i=this.modules[n][s];i==this.modules[n][s+1]&&i==this.modules[n+1][s]&&i==this.modules[n+1][s+1]&&(e+=t.PENALTY_N2)}let n=0;for(const e of this.modules)n=e.reduce(((e,t)=>e+(t?1:0)),n);const s=this.size*this.size,i=Math.ceil(Math.abs(20*n-10*s)/s)-1;return o(0<=i&&i<=9),e+=i*t.PENALTY_N4,o(0<=e&&e<=2568888),e}getAlignmentPatternPositions(){if(1==this.version)return[];{const e=Math.floor(this.version/7)+2,t=32==this.version?26:2*Math.ceil((4*this.version+4)/(2*e-2));let n=[6];for(let s=this.size-7;n.length<e;s-=t)n.splice(1,0,s);return n}}static getNumRawDataModules(e){if(e<t.MIN_VERSION||e>t.MAX_VERSION)throw new RangeError("Version number out of range");let n=(16*e+128)*e+64;if(e>=2){const t=Math.floor(e/7)+2;n-=(25*t-10)*t-55,e>=7&&(n-=36)}return o(208<=n&&n<=29648),n}static getNumDataCodewords(e,n){return Math.floor(t.getNumRawDataModules(e)/8)-t.ECC_CODEWORDS_PER_BLOCK[n.ordinal][e]*t.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw new RangeError("Degree out of range");let n=[];for(let t=0;t<e-1;t++)n.push(0);n.push(1);let s=1;for(let i=0;i<e;i++){for(let e=0;e<n.length;e++)n[e]=t.reedSolomonMultiply(n[e],s),e+1<n.length&&(n[e]^=n[e+1]);s=t.reedSolomonMultiply(s,2)}return n}static reedSolomonComputeRemainder(e,n){let s=n.map((e=>0));for(const i of e){const e=i^s.shift();s.push(0),n.forEach(((n,i)=>s[i]^=t.reedSolomonMultiply(n,e)))}return s}static reedSolomonMultiply(e,t){if(e>>>8!=0||t>>>8!=0)throw new RangeError("Byte out of range");let n=0;for(let s=7;s>=0;s--)n=n<<1^285*(n>>>7),n^=(t>>>s&1)*e;return o(n>>>8==0),n}finderPenaltyCountPatterns(e){const t=e[1];o(t<=3*this.size);const n=t>0&&e[2]==t&&e[3]==3*t&&e[4]==t&&e[5]==t;return(n&&e[0]>=4*t&&e[6]>=t?1:0)+(n&&e[6]>=4*t&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,t){0==t[0]&&(e+=this.size),t.pop(),t.unshift(e)}};let n=t;function s(e,t,n){if(t<0||t>31||e>>>t!=0)throw new RangeError("Value out of range");for(let s=t-1;s>=0;s--)n.push(e>>>s&1)}function i(e,t){return 0!=(e>>>t&1)}function o(e){if(!e)throw new Error("Assertion error")}n.MIN_VERSION=1,n.MAX_VERSION=40,n.PENALTY_N1=3,n.PENALTY_N2=3,n.PENALTY_N3=40,n.PENALTY_N4=10,n.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],n.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=n;const r=class{constructor(e,t,n){if(this.mode=e,this.numChars=t,this.bitData=n,t<0)throw new RangeError("Invalid argument");this.bitData=n.slice()}static makeBytes(e){let t=[];for(const n of e)s(n,8,t);return new r(r.Mode.BYTE,e.length,t)}static makeNumeric(e){if(!r.isNumeric(e))throw new RangeError("String contains non-numeric characters");let t=[];for(let n=0;n<e.length;){const i=Math.min(e.length-n,3);s(parseInt(e.substr(n,i),10),3*i+1,t),n+=i}return new r(r.Mode.NUMERIC,e.length,t)}static makeAlphanumeric(e){if(!r.isAlphanumeric(e))throw new RangeError("String contains unencodable characters in alphanumeric mode");let t,n=[];for(t=0;t+2<=e.length;t+=2){let i=45*r.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t));i+=r.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t+1)),s(i,11,n)}return t<e.length&&s(r.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t)),6,n),new r(r.Mode.ALPHANUMERIC,e.length,n)}static makeSegments(e){return""==e?[]:r.isNumeric(e)?[r.makeNumeric(e)]:r.isAlphanumeric(e)?[r.makeAlphanumeric(e)]:[r.makeBytes(r.toUtf8ByteArray(e))]}static makeEci(e){let t=[];if(e<0)throw new RangeError("ECI assignment value out of range");if(e<128)s(e,8,t);else if(e<16384)s(2,2,t),s(e,14,t);else{if(!(e<1e6))throw new RangeError("ECI assignment value out of range");s(6,3,t),s(e,21,t)}return new r(r.Mode.ECI,0,t)}static isNumeric(e){return r.NUMERIC_REGEX.test(e)}static isAlphanumeric(e){return r.ALPHANUMERIC_REGEX.test(e)}getData(){return this.bitData.slice()}static getTotalBits(e,t){let n=0;for(const s of e){const e=s.mode.numCharCountBits(t);if(s.numChars>=1<<e)return 1/0;n+=4+e+s.bitData.length}return n}static toUtf8ByteArray(e){e=encodeURI(e);let t=[];for(let n=0;n<e.length;n++)"%"!=e.charAt(n)?t.push(e.charCodeAt(n)):(t.push(parseInt(e.substr(n+1,2),16)),n+=2);return t}};let a=r;a.NUMERIC_REGEX=/^[0-9]*$/,a.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,a.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",e.QrSegment=a})(Y||(Y={})),(e=>{const t=class{constructor(e,t){this.ordinal=e,this.formatBits=t}};let n=t;n.LOW=new t(0,1),n.MEDIUM=new t(1,0),n.QUARTILE=new t(2,3),n.HIGH=new t(3,2),e.Ecc=n})((X=Y||(Y={})).QrCode||(X.QrCode={})),(e=>{(e=>{const t=class{constructor(e,t){this.modeBits=e,this.numBitsCharCount=t}numCharCountBits(e){return this.numBitsCharCount[Math.floor((e+7)/17)]}};let n=t;n.NUMERIC=new t(1,[10,12,14]),n.ALPHANUMERIC=new t(2,[9,11,13]),n.BYTE=new t(4,[8,16,16]),n.KANJI=new t(8,[8,10,12]),n.ECI=new t(7,[0,0,0]),e.Mode=n})(e.QrSegment||(e.QrSegment={}))})(Y||(Y={}));var ae=Y,ce={L:ae.QrCode.Ecc.LOW,M:ae.QrCode.Ecc.MEDIUM,Q:ae.QrCode.Ecc.QUARTILE,H:ae.QrCode.Ecc.HIGH},le=128,de="L",ue="#FFFFFF",he="#000000",pe=!1,me=4,fe=.1;
|
|
2
2
|
/**
|
|
3
3
|
* @license qrcode.react
|
|
4
4
|
* Copyright (c) Paul O'Shannessy
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as t,D as e,Z as n,$ as r,a0 as o,C as i}from"./index-
|
|
1
|
+
import{_ as t,D as e,Z as n,$ as r,a0 as o,C as i}from"./index-5a10b30c.js";import{getAddress as s}from"@ethersproject/address";import{Signer as a}from"@ethersproject/abstract-signer";import{UniPassPopupSDK as d}from"@unipasswallet/popup-sdk";import{defineReadOnly as c}from"@ethersproject/properties";import"@ethersproject/providers";import"zustand";import"@ethersproject/bytes";import"buffer";import"@ethersproject/abstract-provider";import"@ethersproject/contracts";import"events";import"@ethersproject/constants";import"@ethersproject/transactions";class l extends a{constructor(t,e,n,r){super(),this._address=n,this._index=null!=r?r:0,this.provider=t,this.upWallet=e}_legacySignMessage(t){throw new Error("Method not implemented.")}sendUncheckedTransaction(t){throw new Error("Method not implemented.")}unlock(t){throw new Error("Method not implemented.")}getAddress(){return t(this,void 0,void 0,(function*(){return Promise.resolve(s(this._address))}))}signMessage(e){return t(this,void 0,void 0,(function*(){if(!this.upWallet)throw new Error(`address unknown '${e}'`);return yield this.upWallet.signMessage(e,{isEIP191Prefix:!0,onAuthChain:!0})}))}_signTypedData(e,n,r){return t(this,void 0,void 0,(function*(){throw new Error("Method not implemented.")}))}signTransaction(e){return t(this,void 0,void 0,(function*(){if(!this.upWallet)throw new Error(`address unknown '${e.from}'`);return this.upWallet.sendTransaction({from:e.from,to:e.to,value:e.value,data:e.data})}))}sendTransaction(e){return t(this,void 0,void 0,(function*(){if(!this.upWallet)throw new Error(`address unknown '${e.from}'`);return{hash:yield this.upWallet.sendTransaction({from:e.from,to:e.to,value:e.value,data:e.data}),from:e.from}}))}connect(t){return new l(null!=t?t:this.provider,this.upWallet,this._address,this._index)}connectUnchecked(){return new l(this.provider,this.upWallet,this._address,this._index)}}function u(i){var a,u,p;return t(this,void 0,void 0,(function*(){const h=i.JsonRpcProvider||e,v=null!==(a=i.chainId)&&void 0!==a?a:1;let m=null!==(u=i.rpcUrl)&&void 0!==u?u:null===(p=i.rpc)||void 0===p?void 0:p[v];const f=new class extends h{constructor(t,e){super(t,e),this.updateUpWalletConfig=t=>{var e;const o=null===(e=i.rpc)||void 0===e?void 0:e[t];if(!n.includes(t))throw new Error(`chainId ${t} not supported`);if(this.upWallet.updateConfig({chainType:r(t),nodeRPC:o,appSettings:{chain:r(t)}}),"object"==typeof this.network)this.network.chainId=t;else{const e={chainId:t,name:"unknown"};c(this,"_network",e),this.emit("network",e,null)}return this.rpcUrl=o,this.emit("chainChanged",`0x${t.toString(16)}`),{result:!0}},this.rpcUrl=t,this.upWallet=new d({env:o(v),chainType:r(v),appSettings:{appIcon:i.appLogoUrl,appName:i.appName,chain:r(v)},rpcUrl:m,storageType:"sessionStorage"})}getSigner(){var t;const e=this.upWallet.getAccount();return new l(f,this.upWallet,null!==(t=null==e?void 0:e.address)&&void 0!==t?t:"",0)}connect(){return t(this,void 0,void 0,(function*(){const t=this.upWallet.getAccount();return t||(yield this.upWallet.login({email:false}))}))}disconnect(){return t(this,void 0,void 0,(function*(){yield this.upWallet.logout()}))}listAccounts(){return t(this,void 0,void 0,(function*(){const t=this.upWallet.getAccount();return(null==t?void 0:t.address)?[null==t?void 0:t.address]:[]}))}getAddress(){const t=this.upWallet.getAccount();return Promise.resolve((null==t?void 0:t.address)?s(null==t?void 0:t.address):null)}}(m,v);return f}))}function p(e,n){return t(this,void 0,void 0,(function*(){const t=yield u(e);return t.on("connect",n.connect),t.on("disconnect",(t=>{n.disconnect(t),n.accountsChanged([])})),t.on("accountsChanged",n.accountsChanged),t.on("chainChanged",n.chainChanged),t.on("message",(({type:t,data:e})=>n.message(t,e))),yield t.connect(),t}))}function h(){var t;null===(t=i.getState().provider)||void 0===t||t.disconnect()}function v(t){var e,n;return null===(n=null===(e=i.getState().provider)||void 0===e?void 0:e.upWallet)||void 0===n?void 0:n.signTypedData(t)}function m(t){var e;const r=t.addChainParameters.chainId,o="string"==typeof r&&(null==r?void 0:r.startsWith("0x"))?parseInt(r,16):Number(r);if(!n.includes(o))throw new Error(`chainId ${o} not supported`);return null===(e=i.getState().provider)||void 0===e?void 0:e.updateUpWalletConfig(o)}export{u as createProvider,p as default,h as disconnectWallet,v as signTypedData,m as switchChain};
|