@dodoex/wallet-web3 0.0.22-3 → 0.0.22-4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/__node-resolve_empty-8632adc3.js +1 -0
- package/dist/__tslib-6ff4d83f.js +1 -0
- package/dist/{blocto-8d7de7b5.js → blocto-532eeb3b.js} +1 -1
- package/dist/{bn-e338479f.js → bn-d8b2aa48.js} +1 -1
- package/dist/{browser-ponyfill-4f8ec4cc.js → browser-ponyfill-17a49e59.js} +1 -1
- package/dist/cjs/{__node-resolve_empty-db84e05a.cjs → __node-resolve_empty-e6311036.cjs} +1 -1
- package/dist/cjs/__tslib-b9bb49bb.cjs +1 -0
- package/dist/cjs/{blocto-5784523c.cjs → blocto-dc83ab21.cjs} +1 -1
- package/dist/cjs/{bn-595d299a.cjs → bn-2f18fb63.cjs} +1 -1
- package/dist/cjs/{browser-ponyfill-99cd2b2a.cjs → browser-ponyfill-4411ec49.cjs} +1 -1
- package/dist/cjs/{ethers-8dd84195.cjs → ethers-bc02633f.cjs} +1 -1
- package/dist/cjs/{id-ae785b22.cjs → id-4255a5f8.cjs} +1 -1
- package/dist/cjs/{index-4ee3ab7f.cjs → index-0ec82476.cjs} +1 -1
- package/dist/cjs/{index-3bc984a2.cjs → index-165c948d.cjs} +1 -1
- package/dist/cjs/{index-773f2765.cjs → index-217a1036.cjs} +2 -2
- package/dist/cjs/index-27942063.cjs +1 -0
- package/dist/cjs/{index-1eddf6b7.cjs → index-3e255821.cjs} +1 -1
- package/dist/cjs/{index-2dac57a4.cjs → index-4e5d1d8d.cjs} +1 -1
- package/dist/cjs/{index-47036dc9.cjs → index-4f2d1da0.cjs} +1 -1
- package/dist/cjs/{index-1ee2a405.cjs → index-5672be01.cjs} +1 -1
- package/dist/cjs/{index-99b925f5.cjs → index-8e209085.cjs} +1 -1
- package/dist/cjs/{index-095f26b3.cjs → index-979d2927.cjs} +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/{index.es-6f21f76e.cjs → index.es-fa952979.cjs} +1 -1
- package/dist/cjs/{interface-6285bef3.cjs → interface-c0ab0ac8.cjs} +1 -1
- package/dist/cjs/{portis-ec351600.cjs → portis-c69e492c.cjs} +1 -1
- package/dist/cjs/{provider-6f06969f.cjs → provider-692e5c89.cjs} +1 -1
- package/dist/cjs/{rainbow-cb1bd1d4.cjs → rainbow-d0f3ec18.cjs} +1 -1
- package/dist/cjs/{uAuth-21c58fc5.cjs → uAuth-43d34532.cjs} +1 -1
- package/dist/cjs/{walletConnect-4e88eea6.cjs → walletConnect-c0e36fea.cjs} +1 -1
- package/dist/cjs/{walletLink-4cf61eb3.cjs → walletLink-7b9716e2.cjs} +1 -1
- package/dist/{ethers-d98a529c.js → ethers-7757efa9.js} +1 -1
- package/dist/{id-bb7887d8.js → id-8c638e81.js} +1 -1
- package/dist/{index-d1e775cf.js → index-30664326.js} +2 -2
- package/dist/{index-32669120.js → index-40f05896.js} +1 -1
- package/dist/{index-fbd509d6.js → index-4e992427.js} +1 -1
- package/dist/{index-fe1624e3.js → index-77db3261.js} +1 -1
- package/dist/{index-a0101310.js → index-82bd9877.js} +1 -1
- package/dist/index-89309b1f.js +1 -0
- package/dist/{index-c2c32c9a.js → index-b54cb21d.js} +2 -2
- package/dist/{index-9201db0c.js → index-bab1214b.js} +1 -1
- package/dist/{index-1dc7fa04.js → index-c2c42137.js} +1 -1
- package/dist/{index-98f05edd.js → index-c8690ee6.js} +1 -1
- package/dist/{index.es-e051edf2.js → index.es-571d50ca.js} +1 -1
- package/dist/index.js +1 -1
- package/dist/{interface-2066cc0e.js → interface-2082dd3f.js} +1 -1
- package/dist/{portis-a96be943.js → portis-fb908c06.js} +1 -1
- package/dist/{provider-01f3e885.js → provider-6caed3b7.js} +1 -1
- package/dist/rainbow-98eb30ca.js +1 -0
- package/dist/{uAuth-4cf1112e.js → uAuth-034cff41.js} +1 -1
- package/dist/walletConnect-2c923830.js +1 -0
- package/dist/{walletLink-ad1c9d2e.js → walletLink-d4240be5.js} +1 -1
- package/package.json +1 -1
- package/dist/__node-resolve_empty-0100ccbe.js +0 -1
- package/dist/__tslib-edb9da71.js +0 -1
- package/dist/cjs/__tslib-12427cac.cjs +0 -1
- package/dist/cjs/index-4d18447a.cjs +0 -1
- package/dist/index-e17029da.js +0 -1
- package/dist/rainbow-5bfe748a.js +0 -1
- package/dist/walletConnect-7c22cd4c.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,o as r,p as t,q as n,E as o,r as s,t as i,u as d}from"./index-
|
|
1
|
+
import{_ as e,o as r,p as t,q as n,E as o,r as s,t as i,u as d}from"./index-30664326.js";export{v as getIsCyber}from"./index-30664326.js";import{JsonRpcProvider as a}from"@ethersproject/providers";import{getAddress as c}from"@ethersproject/address";import"events";import{hexlify as h}from"@ethersproject/bytes";import{t as p}from"./id-8c638e81.js";import{S as u,T as l}from"./index-82bd9877.js";import{deepCopy as m}from"@ethersproject/properties";import{f as g}from"./index-77db3261.js";import"zustand";import"@ethersproject/constants";import"@ethersproject/contracts";import"@ethersproject/transactions";import"./__node-resolve_empty-8632adc3.js";class f extends u{constructor(e,r,t,n){super(),this._address=r,this._index=null!=t?t:0,this.provider=e,this.app=n}_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(c(this._address))}))}signMessage(t){return e(this,void 0,void 0,(function*(){const e=r(),n="string"==typeof t?p(t):t,o=yield this.getAddress();return yield e.send("personal_sign",[h(n),o.toLowerCase()])}))}_signTypedData(n,o,s){var i,d;return e(this,void 0,void 0,(function*(){const a=r(),c=yield l.resolveNames(n,o,s,(r=>e(this,void 0,void 0,(function*(){return yield a.resolveName(r)})))),h=null!==(d=null===(i=t())||void 0===i?void 0:i.ownerAddress)&&void 0!==d?d:"";return yield a.send("eth_signTypedData_v4",[h.toLowerCase(),JSON.stringify(l.getPayload(c.domain,o,c.value))])}))}signTransaction(r){return e(this,void 0,void 0,(function*(){throw new Error("Method not implemented.")}))}sendTransaction(r){return e(this,void 0,void 0,(function*(){const e=yield this.getChainId(),t=n(this.app,e);return{hash:yield t.sendTransaction({to:r.to,value:r.value,data:r.data}).catch((e=>{if(e.name===o.SendTransactionError)throw console.error(e.shortMessage),e}))}}))}connect(e){return new f(null!=e?e:this.provider,this._address,this._index,this.app)}connectUnchecked(){return new f(this.provider,this._address,this._index,this.app)}}function w(e){if(e.error){const r=new Error(e.error.message);throw r.code=e.error.code,r.data=e.error.data,r}return e.result}function y(r,t){return e(this,void 0,void 0,(function*(){const n=yield function({appName:r,appLogoUrl:t,rpcUrl:n,rpc:o,chainId:d,cyberParams:h}){return e(this,void 0,void 0,(function*(){if(!r||!t)throw new Error("appName and appLogoUrl is required.");if(!(null==h?void 0:h.appId))throw new Error("cyberParams.appId and appLogoUrl is required.");const{app:p,cyberAccount:u}=yield s({appName:r,appLogoUrl:t,appId:null==h?void 0:h.appId});if(!u)throw new Error("cyberAccount is not valid.");const l=u.address,v=new class extends a{constructor(e,r){super(e,r),this.updateUpWalletConfig=e=>{const r=null==o?void 0:o[e];if(!i.includes(e)||!r)throw new Error(`chainId ${e} not supported`);return this.chainId=e,r&&(this.rpcUrl=r),this.emit("chainChanged",`0x${e.toString(16)}`),{result:!0}},this.rpcUrl=e,this.chainId=d}getSigner(){return new f(v,l,0,p)}listAccounts(){return e(this,void 0,void 0,(function*(){return[l]}))}getNetwork(){return this.chainId?Promise.resolve({chainId:this.chainId,name:"unknown"}):super.getNetwork()}send(e,r){const t={method:e,params:r,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:m(t),provider:this});const n=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(n&&this._cache[e])return this._cache[e];const o=g({url:this.rpcUrl},JSON.stringify(t),w).then((e=>(this.emit("debug",{action:"response",request:t,response:e,provider:this}),e)),(e=>{throw this.emit("debug",{action:"response",error:e,request:t,provider:this}),e}));return n&&(this._cache[e]=o,setTimeout((()=>{this._cache[e]=null}),0)),o}getAddress(){return Promise.resolve(c(l))}}(n,d);return v}))}(r);return n.on("connect",t.connect),n.on("disconnect",t.disconnect),n.on("accountsChanged",t.accountsChanged),n.on("chainChanged",t.chainChanged),n.on("message",t.message),n}))}function _(e){var r;const t=e.addChainParameters.chainId,n="string"==typeof t&&(null==t?void 0:t.startsWith("0x"))?parseInt(t,16):Number(t);if(!i.includes(n))throw new Error(`chainId ${n} not supported`);return null===(r=d.getState().provider)||void 0===r?void 0:r.updateUpWalletConfig(n)}export{y as default,_ as switchChain};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{arrayify as e,isBytesLike as t,hexlify as r}from"@ethersproject/bytes";import{shallowCopy as o}from"@ethersproject/properties";import{L as n,t as s,a as i}from"./id-
|
|
1
|
+
import{arrayify as e,isBytesLike as t,hexlify as r}from"@ethersproject/bytes";import{shallowCopy as o}from"@ethersproject/properties";import{L as n,t as s,a as i}from"./id-8c638e81.js";function l(t){t=atob(t);const r=[];for(let e=0;e<t.length;e++)r.push(t.charCodeAt(e));return e(r)}function c(t){t=e(t);let r="";for(let e=0;e<t.length;e++)r+=String.fromCharCode(t[e]);return btoa(r)}var a=function(e,t,r,o){return new(r||(r=Promise))((function(n,s){function i(e){try{c(o.next(e))}catch(e){s(e)}}function l(e){try{c(o.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,l)}c((o=o.apply(e,t||[])).next())}))};function u(t,r){return a(this,void 0,void 0,(function*(){null==r&&(r={});const o={method:r.method||"GET",headers:r.headers||{},body:r.body||void 0};if(!0!==r.skipFetchSetup&&(o.mode="cors",o.cache="no-cache",o.credentials="same-origin",o.redirect="follow",o.referrer="client"),null!=r.fetchOptions){const e=r.fetchOptions;e.mode&&(o.mode=e.mode),e.cache&&(o.cache=e.cache),e.credentials&&(o.credentials=e.credentials),e.redirect&&(o.redirect=e.redirect),e.referrer&&(o.referrer=e.referrer)}const n=yield fetch(t,o),s=yield n.arrayBuffer(),i={};return n.headers.forEach?n.headers.forEach(((e,t)=>{i[t.toLowerCase()]=e})):n.headers.keys().forEach((e=>{i[e.toLowerCase()]=n.headers.get(e)})),{headers:i,statusCode:n.status,statusMessage:n.statusText,body:e(new Uint8Array(s))}}))}var h=function(e,t,r,o){return new(r||(r=Promise))((function(n,s){function i(e){try{c(o.next(e))}catch(e){s(e)}}function l(e){try{c(o.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,l)}c((o=o.apply(e,t||[])).next())}))};const d=new n("web/5.7.1");function f(e){return new Promise((t=>{setTimeout(t,e)}))}function p(e,o){if(null==e)return null;if("string"==typeof e)return e;if(t(e)){if(o&&("text"===o.split("/")[0]||"application/json"===o.split(";")[0].trim()))try{return i(e)}catch(e){}return r(e)}return e}function y(e,t,r){const i="object"==typeof e&&null!=e.throttleLimit?e.throttleLimit:12;d.assertArgument(i>0&&i%1==0,"invalid connection throttle limit","connection.throttleLimit",i);const a="object"==typeof e?e.throttleCallback:null,y="object"==typeof e&&"number"==typeof e.throttleSlotInterval?e.throttleSlotInterval:100;d.assertArgument(y>0&&y%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",y);const m="object"==typeof e&&!!e.errorPassThrough,E={};let g=null;const w={method:"GET"};let b=!1,R=12e4;if("string"==typeof e)g=e;else if("object"==typeof e){if(null!=e&&null!=e.url||d.throwArgumentError("missing URL","connection.url",e),g=e.url,"number"==typeof e.timeout&&e.timeout>0&&(R=e.timeout),e.headers)for(const t in e.headers)E[t.toLowerCase()]={key:t,value:String(e.headers[t])},["if-none-match","if-modified-since"].indexOf(t.toLowerCase())>=0&&(b=!0);if(w.allowGzip=!!e.allowGzip,null!=e.user&&null!=e.password){"https:"!==g.substring(0,6)&&!0!==e.allowInsecureAuthentication&&d.throwError("basic authentication requires a secure https url",n.errors.INVALID_ARGUMENT,{argument:"url",url:g,user:e.user,password:"[REDACTED]"});const t=e.user+":"+e.password;E.authorization={key:"Authorization",value:"Basic "+c(s(t))}}null!=e.skipFetchSetup&&(w.skipFetchSetup=!!e.skipFetchSetup),null!=e.fetchOptions&&(w.fetchOptions=o(e.fetchOptions))}const v=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),C=g?g.match(v):null;if(C)try{const e={statusCode:200,statusMessage:"OK",headers:{"content-type":C[1]||"text/plain"},body:C[2]?l(C[3]):(S=C[3],s(S.replace(/%([0-9a-f][0-9a-f])/gi,((e,t)=>String.fromCharCode(parseInt(t,16))))))};let t=e.body;return r&&(t=r(e.body,e)),Promise.resolve(t)}catch(e){d.throwError("processing response error",n.errors.SERVER_ERROR,{body:p(C[1],C[2]),error:e,requestBody:null,requestMethod:"GET",url:g})}var S;t&&(w.method="POST",w.body=t,null==E["content-type"]&&(E["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==E["content-length"]&&(E["content-length"]={key:"Content-Length",value:String(t.length)}));const O={};Object.keys(E).forEach((e=>{const t=E[e];O[t.key]=t.value})),w.headers=O;const T=function(){let e=null;return{promise:new Promise((function(t,r){R&&(e=setTimeout((()=>{null!=e&&(e=null,r(d.makeError("timeout",n.errors.TIMEOUT,{requestBody:p(w.body,O["content-type"]),requestMethod:w.method,timeout:R,url:g})))}),R))})),cancel:function(){null!=e&&(clearTimeout(e),e=null)}}}(),k=function(){return h(this,void 0,void 0,(function*(){for(let e=0;e<i;e++){let t=null;try{if(t=yield u(g,w),e<i)if(301===t.statusCode||302===t.statusCode){const e=t.headers.location||"";if("GET"===w.method&&e.match(/^https:/)){g=t.headers.location;continue}}else if(429===t.statusCode){let r=!0;if(a&&(r=yield a(e,g)),r){let r=0;const o=t.headers["retry-after"];r="string"==typeof o&&o.match(/^[1-9][0-9]*$/)?1e3*parseInt(o):y*parseInt(String(Math.random()*Math.pow(2,e))),yield f(r);continue}}}catch(e){t=e.response,null==t&&(T.cancel(),d.throwError("missing response",n.errors.SERVER_ERROR,{requestBody:p(w.body,O["content-type"]),requestMethod:w.method,serverError:e,url:g}))}let o=t.body;if(b&&304===t.statusCode?o=null:!m&&(t.statusCode<200||t.statusCode>=300)&&(T.cancel(),d.throwError("bad response",n.errors.SERVER_ERROR,{status:t.statusCode,headers:t.headers,body:p(o,t.headers?t.headers["content-type"]:null),requestBody:p(w.body,O["content-type"]),requestMethod:w.method,url:g})),r)try{const e=yield r(o,t);return T.cancel(),e}catch(r){if(r.throttleRetry&&e<i){let t=!0;if(a&&(t=yield a(e,g)),t){const t=y*parseInt(String(Math.random()*Math.pow(2,e)));yield f(t);continue}}T.cancel(),d.throwError("processing response error",n.errors.SERVER_ERROR,{body:p(o,t.headers?t.headers["content-type"]:null),error:r,requestBody:p(w.body,O["content-type"]),requestMethod:w.method,url:g})}return T.cancel(),o}return d.throwError("failed response",n.errors.SERVER_ERROR,{requestBody:p(w.body,O["content-type"]),requestMethod:w.method,url:g})}))}();return Promise.race([T.promise,k])}function m(e,t,r){let l=null;if(null!=t){l=s(t);const r="string"==typeof e?{url:e}:o(e);if(r.headers){0!==Object.keys(r.headers).filter((e=>"content-type"===e.toLowerCase())).length||(r.headers=o(r.headers),r.headers["content-type"]="application/json")}else r.headers={"content-type":"application/json"};e=r}return y(e,l,((e,t)=>{let o=null;if(null!=e)try{o=JSON.parse(i(e))}catch(t){d.throwError("invalid JSON",n.errors.SERVER_ERROR,{body:e,error:t})}return r&&(o=r(o,t)),o}))}function E(e,t){return t||(t={}),null==(t=o(t)).floor&&(t.floor=0),null==t.ceiling&&(t.ceiling=1e4),null==t.interval&&(t.interval=250),new Promise((function(r,o){let n=null,s=!1;const i=()=>!s&&(s=!0,n&&clearTimeout(n),!0);t.timeout&&(n=setTimeout((()=>{i()&&o(new Error("timeout"))}),t.timeout));const l=t.retryLimit;let c=0;!function n(){return e().then((function(e){if(void 0!==e)i()&&r(e);else if(t.oncePoll)t.oncePoll.once("poll",n);else if(t.onceBlock)t.onceBlock.once("block",n);else if(!s){if(c++,c>l)return void(i()&&o(new Error("retry limit reached")));let e=t.interval*parseInt(String(Math.random()*Math.pow(2,c)));e<t.floor&&(e=t.floor),e>t.ceiling&&(e=t.ceiling),setTimeout(n,e)}return null}),(function(e){i()&&o(e)}))}()}))}var g=Object.freeze({__proto__:null,_fetchData:y,fetchJson:m,poll:E});export{y as _,l as d,c as e,m as f,g as l,E as p};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getAddress as r}from"@ethersproject/address";import{hexZeroPad as t,hexConcat as e,isHexString as n,hexlify as i,arrayify as o}from"@ethersproject/bytes";import{k as s}from"./index-d1e775cf.js";import{defineReadOnly as a,deepCopy as c,shallowCopy as u,resolveProperties as h}from"@ethersproject/properties";import{L as d,B as f,i as m}from"./id-bb7887d8.js";const l="hash/5.7.0";var y=function(r,t,e,n){return new(e||(e=Promise))((function(i,o){function s(r){try{c(n.next(r))}catch(r){o(r)}}function a(r){try{c(n.throw(r))}catch(r){o(r)}}function c(r){var t;r.done?i(r.value):(t=r.value,t instanceof e?t:new e((function(r){r(t)}))).then(s,a)}c((n=n.apply(r,t||[])).next())}))};const g=new d(l),p=new Uint8Array(32);p.fill(0);const v=f.from(-1),P=f.from(0),E=f.from(1),w=f.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const x=t(E.toHexString(),32),A=t(P.toHexString(),32),T={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},_=["name","version","chainId","verifyingContract","salt"];function I(r){return function(t){return"string"!=typeof t&&g.throwArgumentError(`invalid domain value for ${JSON.stringify(r)}`,`domain.${r}`,t),t}}const S={name:I("name"),version:I("version"),chainId:function(r){try{return f.from(r).toString()}catch(r){}return g.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",r)},verifyingContract:function(t){try{return r(t).toLowerCase()}catch(r){}return g.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(r){try{const t=o(r);if(32!==t.length)throw new Error("bad length");return i(t)}catch(r){}return g.throwArgumentError('invalid domain value "salt"',"domain.salt",r)}};function G(n){{const r=n.match(/^(u?)int(\d*)$/);if(r){const e=""===r[1],i=parseInt(r[2]||"256");(i%8!=0||i>256||r[2]&&r[2]!==String(i))&&g.throwArgumentError("invalid numeric width","type",n);const o=w.mask(e?i-1:i),s=e?o.add(E).mul(v):P;return function(r){const e=f.from(r);return(e.lt(s)||e.gt(o))&&g.throwArgumentError(`value out-of-bounds for ${n}`,"value",r),t(e.toTwos(256).toHexString(),32)}}}{const r=n.match(/^bytes(\d+)$/);if(r){const t=parseInt(r[1]);return(0===t||t>32||r[1]!==String(t))&&g.throwArgumentError("invalid bytes width","type",n),function(r){return o(r).length!==t&&g.throwArgumentError(`invalid length for ${n}`,"value",r),function(r){const t=o(r),n=t.length%32;return n?e([t,p.slice(n)]):i(t)}(r)}}}switch(n){case"address":return function(e){return t(r(e),32)};case"bool":return function(r){return r?x:A};case"bytes":return function(r){return s(r)};case"string":return function(r){return m(r)}}return null}function C(r,t){return`${r}(${t.map((({name:r,type:t})=>t+" "+r)).join(",")})`}class F{constructor(r){a(this,"types",Object.freeze(c(r))),a(this,"_encoderCache",{}),a(this,"_types",{});const t={},e={},n={};Object.keys(r).forEach((r=>{t[r]={},e[r]=[],n[r]={}}));for(const n in r){const i={};r[n].forEach((o=>{i[o.name]&&g.throwArgumentError(`duplicate variable name ${JSON.stringify(o.name)} in ${JSON.stringify(n)}`,"types",r),i[o.name]=!0;const s=o.type.match(/^([^\x5b]*)(\x5b|$)/)[1];s===n&&g.throwArgumentError(`circular type reference to ${JSON.stringify(s)}`,"types",r);G(s)||(e[s]||g.throwArgumentError(`unknown type ${JSON.stringify(s)}`,"types",r),e[s].push(n),t[n][s]=!0)}))}const i=Object.keys(e).filter((r=>0===e[r].length));0===i.length?g.throwArgumentError("missing primary type","types",r):i.length>1&&g.throwArgumentError(`ambiguous primary types or unused types: ${i.map((r=>JSON.stringify(r))).join(", ")}`,"types",r),a(this,"primaryType",i[0]),function i(o,s){s[o]&&g.throwArgumentError(`circular type reference to ${JSON.stringify(o)}`,"types",r),s[o]=!0,Object.keys(t[o]).forEach((r=>{e[r]&&(i(r,s),Object.keys(s).forEach((t=>{n[t][r]=!0})))})),delete s[o]}(this.primaryType,{});for(const t in n){const e=Object.keys(n[t]);e.sort(),this._types[t]=C(t,r[t])+e.map((t=>C(t,r[t]))).join("")}}getEncoder(r){let t=this._encoderCache[r];return t||(t=this._encoderCache[r]=this._getEncoder(r)),t}_getEncoder(r){{const t=G(r);if(t)return t}const t=r.match(/^(.*)(\x5b(\d*)\x5d)$/);if(t){const r=t[1],n=this.getEncoder(r),i=parseInt(t[3]);return t=>{i>=0&&t.length!==i&&g.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t);let o=t.map(n);return this._types[r]&&(o=o.map(s)),s(e(o))}}const n=this.types[r];if(n){const t=m(this._types[r]);return r=>{const i=n.map((({name:t,type:e})=>{const n=this.getEncoder(e)(r[t]);return this._types[e]?s(n):n}));return i.unshift(t),e(i)}}return g.throwArgumentError(`unknown type: ${r}`,"type",r)}encodeType(r){const t=this._types[r];return t||g.throwArgumentError(`unknown type: ${JSON.stringify(r)}`,"name",r),t}encodeData(r,t){return this.getEncoder(r)(t)}hashStruct(r,t){return s(this.encodeData(r,t))}encode(r){return this.encodeData(this.primaryType,r)}hash(r){return this.hashStruct(this.primaryType,r)}_visit(r,t,e){if(G(r))return e(r,t);const n=r.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){const r=n[1],i=parseInt(n[3]);return i>=0&&t.length!==i&&g.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t),t.map((t=>this._visit(r,t,e)))}const i=this.types[r];return i?i.reduce(((r,{name:n,type:i})=>(r[n]=this._visit(i,t[n],e),r)),{}):g.throwArgumentError(`unknown type: ${r}`,"type",r)}visit(r,t){return this._visit(this.primaryType,r,t)}static from(r){return new F(r)}static getPrimaryType(r){return F.from(r).primaryType}static hashStruct(r,t,e){return F.from(t).hashStruct(r,e)}static hashDomain(r){const t=[];for(const e in r){const n=T[e];n||g.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(e)}`,"domain",r),t.push({name:e,type:n})}return t.sort(((r,t)=>_.indexOf(r.name)-_.indexOf(t.name))),F.hashStruct("EIP712Domain",{EIP712Domain:t},r)}static encode(r,t,n){return e(["0x1901",F.hashDomain(r),F.from(t).hash(n)])}static hash(r,t,e){return s(F.encode(r,t,e))}static resolveNames(r,t,e,i){return y(this,void 0,void 0,(function*(){r=u(r);const o={};r.verifyingContract&&!n(r.verifyingContract,20)&&(o[r.verifyingContract]="0x");const s=F.from(t);s.visit(e,((r,t)=>("address"!==r||n(t,20)||(o[t]="0x"),t)));for(const r in o)o[r]=yield i(r);return r.verifyingContract&&o[r.verifyingContract]&&(r.verifyingContract=o[r.verifyingContract]),e=s.visit(e,((r,t)=>"address"===r&&o[t]?o[t]:t)),{domain:r,value:e}}))}static getPayload(r,t,e){F.hashDomain(r);const n={},s=[];_.forEach((t=>{const e=r[t];null!=e&&(n[t]=S[t](e),s.push({name:t,type:T[t]}))}));const a=F.from(t),c=u(t);return c.EIP712Domain?g.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",t):c.EIP712Domain=s,a.encode(e),{types:c,domain:n,primaryType:a.primaryType,message:a.visit(e,((r,t)=>{if(r.match(/^bytes(\d*)/))return i(o(t));if(r.match(/^u?int/))return f.from(t).toString();switch(r){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return"string"!=typeof t&&g.throwArgumentError("invalid string","value",t),t}return g.throwArgumentError("unsupported type","type",r)}))}}}var N=function(r,t,e,n){return new(e||(e=Promise))((function(i,o){function s(r){try{c(n.next(r))}catch(r){o(r)}}function a(r){try{c(n.throw(r))}catch(r){o(r)}}function c(r){var t;r.done?i(r.value):(t=r.value,t instanceof e?t:new e((function(r){r(t)}))).then(s,a)}c((n=n.apply(r,t||[])).next())}))};const O=new d("abstract-signer/5.7.0"),k=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],D=[d.errors.INSUFFICIENT_FUNDS,d.errors.NONCE_EXPIRED,d.errors.REPLACEMENT_UNDERPRICED];class b{constructor(){O.checkAbstract(new.target,b),a(this,"_isSigner",!0)}getBalance(r){return N(this,void 0,void 0,(function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),r)}))}getTransactionCount(r){return N(this,void 0,void 0,(function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),r)}))}estimateGas(r){return N(this,void 0,void 0,(function*(){this._checkProvider("estimateGas");const t=yield h(this.checkTransaction(r));return yield this.provider.estimateGas(t)}))}call(r,t){return N(this,void 0,void 0,(function*(){this._checkProvider("call");const e=yield h(this.checkTransaction(r));return yield this.provider.call(e,t)}))}sendTransaction(r){return N(this,void 0,void 0,(function*(){this._checkProvider("sendTransaction");const t=yield this.populateTransaction(r),e=yield this.signTransaction(t);return yield this.provider.sendTransaction(e)}))}getChainId(){return N(this,void 0,void 0,(function*(){this._checkProvider("getChainId");return(yield this.provider.getNetwork()).chainId}))}getGasPrice(){return N(this,void 0,void 0,(function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()}))}getFeeData(){return N(this,void 0,void 0,(function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()}))}resolveName(r){return N(this,void 0,void 0,(function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(r)}))}checkTransaction(r){for(const t in r)-1===k.indexOf(t)&&O.throwArgumentError("invalid transaction key: "+t,"transaction",r);const t=u(r);return null==t.from?t.from=this.getAddress():t.from=Promise.all([Promise.resolve(t.from),this.getAddress()]).then((t=>(t[0].toLowerCase()!==t[1].toLowerCase()&&O.throwArgumentError("from address mismatch","transaction",r),t[0]))),t}populateTransaction(r){return N(this,void 0,void 0,(function*(){const t=yield h(this.checkTransaction(r));null!=t.to&&(t.to=Promise.resolve(t.to).then((r=>N(this,void 0,void 0,(function*(){if(null==r)return null;const t=yield this.resolveName(r);return null==t&&O.throwArgumentError("provided ENS name resolves to null","tx.to",r),t})))),t.to.catch((r=>{})));const e=null!=t.maxFeePerGas||null!=t.maxPriorityFeePerGas;if(null==t.gasPrice||2!==t.type&&!e?0!==t.type&&1!==t.type||!e||O.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",r):O.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",r),2!==t.type&&null!=t.type||null==t.maxFeePerGas||null==t.maxPriorityFeePerGas)if(0===t.type||1===t.type)null==t.gasPrice&&(t.gasPrice=this.getGasPrice());else{const r=yield this.getFeeData();if(null==t.type)if(null!=r.maxFeePerGas&&null!=r.maxPriorityFeePerGas)if(t.type=2,null!=t.gasPrice){const r=t.gasPrice;delete t.gasPrice,t.maxFeePerGas=r,t.maxPriorityFeePerGas=r}else null==t.maxFeePerGas&&(t.maxFeePerGas=r.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=r.maxPriorityFeePerGas);else null!=r.gasPrice?(e&&O.throwError("network does not support EIP-1559",d.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==t.gasPrice&&(t.gasPrice=r.gasPrice),t.type=0):O.throwError("failed to get consistent fee data",d.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else 2===t.type&&(null==t.maxFeePerGas&&(t.maxFeePerGas=r.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=r.maxPriorityFeePerGas))}else t.type=2;return null==t.nonce&&(t.nonce=this.getTransactionCount("pending")),null==t.gasLimit&&(t.gasLimit=this.estimateGas(t).catch((r=>{if(D.indexOf(r.code)>=0)throw r;return O.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",d.errors.UNPREDICTABLE_GAS_LIMIT,{error:r,tx:t})}))),null==t.chainId?t.chainId=this.getChainId():t.chainId=Promise.all([Promise.resolve(t.chainId),this.getChainId()]).then((t=>(0!==t[1]&&t[0]!==t[1]&&O.throwArgumentError("chainId address mismatch","transaction",r),t[0]))),yield h(t)}))}_checkProvider(r){this.provider||O.throwError("missing provider",d.errors.UNSUPPORTED_OPERATION,{operation:r||"_checkProvider"})}static isSigner(r){return!(!r||!r._isSigner)}}class $ extends b{constructor(r,t){super(),a(this,"address",r),a(this,"provider",t||null)}getAddress(){return Promise.resolve(this.address)}_fail(r,t){return Promise.resolve().then((()=>{O.throwError(r,d.errors.UNSUPPORTED_OPERATION,{operation:t})}))}signMessage(r){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(r){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(r,t,e){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(r){return new $(this.address,r)}}export{b as S,F as T,$ as V,l as v};
|
|
1
|
+
import{getAddress as r}from"@ethersproject/address";import{hexZeroPad as t,hexConcat as e,isHexString as n,hexlify as i,arrayify as o}from"@ethersproject/bytes";import{k as s}from"./index-30664326.js";import{defineReadOnly as a,deepCopy as c,shallowCopy as u,resolveProperties as h}from"@ethersproject/properties";import{L as d,B as f,i as m}from"./id-8c638e81.js";const l="hash/5.7.0";var y=function(r,t,e,n){return new(e||(e=Promise))((function(i,o){function s(r){try{c(n.next(r))}catch(r){o(r)}}function a(r){try{c(n.throw(r))}catch(r){o(r)}}function c(r){var t;r.done?i(r.value):(t=r.value,t instanceof e?t:new e((function(r){r(t)}))).then(s,a)}c((n=n.apply(r,t||[])).next())}))};const g=new d(l),p=new Uint8Array(32);p.fill(0);const v=f.from(-1),P=f.from(0),E=f.from(1),w=f.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const x=t(E.toHexString(),32),A=t(P.toHexString(),32),T={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},_=["name","version","chainId","verifyingContract","salt"];function I(r){return function(t){return"string"!=typeof t&&g.throwArgumentError(`invalid domain value for ${JSON.stringify(r)}`,`domain.${r}`,t),t}}const S={name:I("name"),version:I("version"),chainId:function(r){try{return f.from(r).toString()}catch(r){}return g.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",r)},verifyingContract:function(t){try{return r(t).toLowerCase()}catch(r){}return g.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(r){try{const t=o(r);if(32!==t.length)throw new Error("bad length");return i(t)}catch(r){}return g.throwArgumentError('invalid domain value "salt"',"domain.salt",r)}};function G(n){{const r=n.match(/^(u?)int(\d*)$/);if(r){const e=""===r[1],i=parseInt(r[2]||"256");(i%8!=0||i>256||r[2]&&r[2]!==String(i))&&g.throwArgumentError("invalid numeric width","type",n);const o=w.mask(e?i-1:i),s=e?o.add(E).mul(v):P;return function(r){const e=f.from(r);return(e.lt(s)||e.gt(o))&&g.throwArgumentError(`value out-of-bounds for ${n}`,"value",r),t(e.toTwos(256).toHexString(),32)}}}{const r=n.match(/^bytes(\d+)$/);if(r){const t=parseInt(r[1]);return(0===t||t>32||r[1]!==String(t))&&g.throwArgumentError("invalid bytes width","type",n),function(r){return o(r).length!==t&&g.throwArgumentError(`invalid length for ${n}`,"value",r),function(r){const t=o(r),n=t.length%32;return n?e([t,p.slice(n)]):i(t)}(r)}}}switch(n){case"address":return function(e){return t(r(e),32)};case"bool":return function(r){return r?x:A};case"bytes":return function(r){return s(r)};case"string":return function(r){return m(r)}}return null}function C(r,t){return`${r}(${t.map((({name:r,type:t})=>t+" "+r)).join(",")})`}class F{constructor(r){a(this,"types",Object.freeze(c(r))),a(this,"_encoderCache",{}),a(this,"_types",{});const t={},e={},n={};Object.keys(r).forEach((r=>{t[r]={},e[r]=[],n[r]={}}));for(const n in r){const i={};r[n].forEach((o=>{i[o.name]&&g.throwArgumentError(`duplicate variable name ${JSON.stringify(o.name)} in ${JSON.stringify(n)}`,"types",r),i[o.name]=!0;const s=o.type.match(/^([^\x5b]*)(\x5b|$)/)[1];s===n&&g.throwArgumentError(`circular type reference to ${JSON.stringify(s)}`,"types",r);G(s)||(e[s]||g.throwArgumentError(`unknown type ${JSON.stringify(s)}`,"types",r),e[s].push(n),t[n][s]=!0)}))}const i=Object.keys(e).filter((r=>0===e[r].length));0===i.length?g.throwArgumentError("missing primary type","types",r):i.length>1&&g.throwArgumentError(`ambiguous primary types or unused types: ${i.map((r=>JSON.stringify(r))).join(", ")}`,"types",r),a(this,"primaryType",i[0]),function i(o,s){s[o]&&g.throwArgumentError(`circular type reference to ${JSON.stringify(o)}`,"types",r),s[o]=!0,Object.keys(t[o]).forEach((r=>{e[r]&&(i(r,s),Object.keys(s).forEach((t=>{n[t][r]=!0})))})),delete s[o]}(this.primaryType,{});for(const t in n){const e=Object.keys(n[t]);e.sort(),this._types[t]=C(t,r[t])+e.map((t=>C(t,r[t]))).join("")}}getEncoder(r){let t=this._encoderCache[r];return t||(t=this._encoderCache[r]=this._getEncoder(r)),t}_getEncoder(r){{const t=G(r);if(t)return t}const t=r.match(/^(.*)(\x5b(\d*)\x5d)$/);if(t){const r=t[1],n=this.getEncoder(r),i=parseInt(t[3]);return t=>{i>=0&&t.length!==i&&g.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t);let o=t.map(n);return this._types[r]&&(o=o.map(s)),s(e(o))}}const n=this.types[r];if(n){const t=m(this._types[r]);return r=>{const i=n.map((({name:t,type:e})=>{const n=this.getEncoder(e)(r[t]);return this._types[e]?s(n):n}));return i.unshift(t),e(i)}}return g.throwArgumentError(`unknown type: ${r}`,"type",r)}encodeType(r){const t=this._types[r];return t||g.throwArgumentError(`unknown type: ${JSON.stringify(r)}`,"name",r),t}encodeData(r,t){return this.getEncoder(r)(t)}hashStruct(r,t){return s(this.encodeData(r,t))}encode(r){return this.encodeData(this.primaryType,r)}hash(r){return this.hashStruct(this.primaryType,r)}_visit(r,t,e){if(G(r))return e(r,t);const n=r.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){const r=n[1],i=parseInt(n[3]);return i>=0&&t.length!==i&&g.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t),t.map((t=>this._visit(r,t,e)))}const i=this.types[r];return i?i.reduce(((r,{name:n,type:i})=>(r[n]=this._visit(i,t[n],e),r)),{}):g.throwArgumentError(`unknown type: ${r}`,"type",r)}visit(r,t){return this._visit(this.primaryType,r,t)}static from(r){return new F(r)}static getPrimaryType(r){return F.from(r).primaryType}static hashStruct(r,t,e){return F.from(t).hashStruct(r,e)}static hashDomain(r){const t=[];for(const e in r){const n=T[e];n||g.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(e)}`,"domain",r),t.push({name:e,type:n})}return t.sort(((r,t)=>_.indexOf(r.name)-_.indexOf(t.name))),F.hashStruct("EIP712Domain",{EIP712Domain:t},r)}static encode(r,t,n){return e(["0x1901",F.hashDomain(r),F.from(t).hash(n)])}static hash(r,t,e){return s(F.encode(r,t,e))}static resolveNames(r,t,e,i){return y(this,void 0,void 0,(function*(){r=u(r);const o={};r.verifyingContract&&!n(r.verifyingContract,20)&&(o[r.verifyingContract]="0x");const s=F.from(t);s.visit(e,((r,t)=>("address"!==r||n(t,20)||(o[t]="0x"),t)));for(const r in o)o[r]=yield i(r);return r.verifyingContract&&o[r.verifyingContract]&&(r.verifyingContract=o[r.verifyingContract]),e=s.visit(e,((r,t)=>"address"===r&&o[t]?o[t]:t)),{domain:r,value:e}}))}static getPayload(r,t,e){F.hashDomain(r);const n={},s=[];_.forEach((t=>{const e=r[t];null!=e&&(n[t]=S[t](e),s.push({name:t,type:T[t]}))}));const a=F.from(t),c=u(t);return c.EIP712Domain?g.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",t):c.EIP712Domain=s,a.encode(e),{types:c,domain:n,primaryType:a.primaryType,message:a.visit(e,((r,t)=>{if(r.match(/^bytes(\d*)/))return i(o(t));if(r.match(/^u?int/))return f.from(t).toString();switch(r){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return"string"!=typeof t&&g.throwArgumentError("invalid string","value",t),t}return g.throwArgumentError("unsupported type","type",r)}))}}}var N=function(r,t,e,n){return new(e||(e=Promise))((function(i,o){function s(r){try{c(n.next(r))}catch(r){o(r)}}function a(r){try{c(n.throw(r))}catch(r){o(r)}}function c(r){var t;r.done?i(r.value):(t=r.value,t instanceof e?t:new e((function(r){r(t)}))).then(s,a)}c((n=n.apply(r,t||[])).next())}))};const O=new d("abstract-signer/5.7.0"),k=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],D=[d.errors.INSUFFICIENT_FUNDS,d.errors.NONCE_EXPIRED,d.errors.REPLACEMENT_UNDERPRICED];class b{constructor(){O.checkAbstract(new.target,b),a(this,"_isSigner",!0)}getBalance(r){return N(this,void 0,void 0,(function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),r)}))}getTransactionCount(r){return N(this,void 0,void 0,(function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),r)}))}estimateGas(r){return N(this,void 0,void 0,(function*(){this._checkProvider("estimateGas");const t=yield h(this.checkTransaction(r));return yield this.provider.estimateGas(t)}))}call(r,t){return N(this,void 0,void 0,(function*(){this._checkProvider("call");const e=yield h(this.checkTransaction(r));return yield this.provider.call(e,t)}))}sendTransaction(r){return N(this,void 0,void 0,(function*(){this._checkProvider("sendTransaction");const t=yield this.populateTransaction(r),e=yield this.signTransaction(t);return yield this.provider.sendTransaction(e)}))}getChainId(){return N(this,void 0,void 0,(function*(){this._checkProvider("getChainId");return(yield this.provider.getNetwork()).chainId}))}getGasPrice(){return N(this,void 0,void 0,(function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()}))}getFeeData(){return N(this,void 0,void 0,(function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()}))}resolveName(r){return N(this,void 0,void 0,(function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(r)}))}checkTransaction(r){for(const t in r)-1===k.indexOf(t)&&O.throwArgumentError("invalid transaction key: "+t,"transaction",r);const t=u(r);return null==t.from?t.from=this.getAddress():t.from=Promise.all([Promise.resolve(t.from),this.getAddress()]).then((t=>(t[0].toLowerCase()!==t[1].toLowerCase()&&O.throwArgumentError("from address mismatch","transaction",r),t[0]))),t}populateTransaction(r){return N(this,void 0,void 0,(function*(){const t=yield h(this.checkTransaction(r));null!=t.to&&(t.to=Promise.resolve(t.to).then((r=>N(this,void 0,void 0,(function*(){if(null==r)return null;const t=yield this.resolveName(r);return null==t&&O.throwArgumentError("provided ENS name resolves to null","tx.to",r),t})))),t.to.catch((r=>{})));const e=null!=t.maxFeePerGas||null!=t.maxPriorityFeePerGas;if(null==t.gasPrice||2!==t.type&&!e?0!==t.type&&1!==t.type||!e||O.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",r):O.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",r),2!==t.type&&null!=t.type||null==t.maxFeePerGas||null==t.maxPriorityFeePerGas)if(0===t.type||1===t.type)null==t.gasPrice&&(t.gasPrice=this.getGasPrice());else{const r=yield this.getFeeData();if(null==t.type)if(null!=r.maxFeePerGas&&null!=r.maxPriorityFeePerGas)if(t.type=2,null!=t.gasPrice){const r=t.gasPrice;delete t.gasPrice,t.maxFeePerGas=r,t.maxPriorityFeePerGas=r}else null==t.maxFeePerGas&&(t.maxFeePerGas=r.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=r.maxPriorityFeePerGas);else null!=r.gasPrice?(e&&O.throwError("network does not support EIP-1559",d.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==t.gasPrice&&(t.gasPrice=r.gasPrice),t.type=0):O.throwError("failed to get consistent fee data",d.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else 2===t.type&&(null==t.maxFeePerGas&&(t.maxFeePerGas=r.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=r.maxPriorityFeePerGas))}else t.type=2;return null==t.nonce&&(t.nonce=this.getTransactionCount("pending")),null==t.gasLimit&&(t.gasLimit=this.estimateGas(t).catch((r=>{if(D.indexOf(r.code)>=0)throw r;return O.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",d.errors.UNPREDICTABLE_GAS_LIMIT,{error:r,tx:t})}))),null==t.chainId?t.chainId=this.getChainId():t.chainId=Promise.all([Promise.resolve(t.chainId),this.getChainId()]).then((t=>(0!==t[1]&&t[0]!==t[1]&&O.throwArgumentError("chainId address mismatch","transaction",r),t[0]))),yield h(t)}))}_checkProvider(r){this.provider||O.throwError("missing provider",d.errors.UNSUPPORTED_OPERATION,{operation:r||"_checkProvider"})}static isSigner(r){return!(!r||!r._isSigner)}}class $ extends b{constructor(r,t){super(),a(this,"address",r),a(this,"provider",t||null)}getAddress(){return Promise.resolve(this.address)}_fail(r,t){return Promise.resolve().then((()=>{O.throwError(r,d.errors.UNSUPPORTED_OPERATION,{operation:t})}))}signMessage(r){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(r){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(r,t,e){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(r){return new $(this.address,r)}}export{b as S,F as T,$ as V,l as v};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as a}from"./index-30664326.js";import{C as r,E as e,a as s,F as t,b as o,P as n,c as i,A as c,d as m,I as d,f,e as p,L as F,T as g}from"./interface-2082dd3f.js";var u=a(Object.freeze({__proto__:null,ConstructorFragment:r,ErrorFragment:e,EventFragment:s,Fragment:t,FunctionFragment:o,ParamType:n,FormatTypes:i,AbiCoder:c,defaultAbiCoder:m,Interface:d,Indexed:f,checkResultErrors:p,LogDescription:F,TransactionDescription:g}));export{u as r};
|