@dodoex/wallet-web3 0.0.22-8 → 0.0.22

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.
Files changed (73) hide show
  1. package/dist/__node-resolve_empty-09491942.js +1 -0
  2. package/dist/__tslib-2360b071.js +1 -0
  3. package/dist/{blocto-ced8f2c5.js → blocto-c8a2e169.js} +1 -1
  4. package/dist/{bn-f5cc0852.js → bn-7ab71611.js} +1 -1
  5. package/dist/{browser-ponyfill-094cac02.js → browser-ponyfill-ed8a6d1b.js} +1 -1
  6. package/dist/cjs/{__node-resolve_empty-7a141153.cjs → __node-resolve_empty-25c307cf.cjs} +1 -1
  7. package/dist/cjs/__tslib-4e0a630c.cjs +1 -0
  8. package/dist/cjs/{blocto-853c1ae0.cjs → blocto-bfad26fc.cjs} +1 -1
  9. package/dist/cjs/{bn-fe543ab1.cjs → bn-e350978d.cjs} +1 -1
  10. package/dist/cjs/{browser-ponyfill-d7ce144d.cjs → browser-ponyfill-c9dcda02.cjs} +1 -1
  11. package/dist/cjs/ethers-811b0d74.cjs +1 -0
  12. package/dist/cjs/{id-2350f9a1.cjs → id-58904b04.cjs} +1 -1
  13. package/dist/cjs/index-65138f9a.cjs +1 -0
  14. package/dist/cjs/{index-8abd0652.cjs → index-6e11b773.cjs} +1 -1
  15. package/dist/cjs/index-7d1b7a41.cjs +1 -0
  16. package/dist/cjs/{index-045fd200.cjs → index-903c3a05.cjs} +1 -1
  17. package/dist/cjs/index-9e375fc1.cjs +9 -0
  18. package/dist/cjs/index-c1cf9f97.cjs +15 -0
  19. package/dist/cjs/index-d554a59a.cjs +1 -0
  20. package/dist/cjs/index-e5152d2e.cjs +6 -0
  21. package/dist/cjs/{index-2cd5ea91.cjs → index-f3e39d48.cjs} +1 -1
  22. package/dist/cjs/index.cjs +1 -1
  23. package/dist/cjs/{index.es-3f248818.cjs → index.es-ee80fe52.cjs} +1 -1
  24. package/dist/cjs/{interface-0722b24f.cjs → interface-ed22b420.cjs} +1 -1
  25. package/dist/cjs/{portis-d4538d2f.cjs → portis-47390c3b.cjs} +1 -1
  26. package/dist/cjs/{provider-a47a46da.cjs → provider-09de25ca.cjs} +1 -1
  27. package/dist/cjs/{rainbow-2e995150.cjs → rainbow-e6e281e7.cjs} +1 -1
  28. package/dist/cjs/typed-data-917359df.cjs +1 -0
  29. package/dist/cjs/{uAuth-ccf973b9.cjs → uAuth-7e57e430.cjs} +1 -1
  30. package/dist/cjs/{walletConnect-ca6a0b03.cjs → walletConnect-9d38a9ee.cjs} +1 -1
  31. package/dist/cjs/{walletLink-3d5e1ef7.cjs → walletLink-341b505b.cjs} +1 -1
  32. package/dist/ethers-335588b8.js +1 -0
  33. package/dist/{id-3d0400ed.js → id-e10fd856.js} +1 -1
  34. package/dist/index-0762dfa7.js +1 -0
  35. package/dist/index-18afc977.js +1 -0
  36. package/dist/index-44890e28.js +1 -0
  37. package/dist/{index-f1689e3c.js → index-5c902b5f.js} +1 -1
  38. package/dist/{index-1a98359c.js → index-65f251fa.js} +1 -1
  39. package/dist/index-a48e56f0.js +1 -0
  40. package/dist/index-dead85a9.js +9 -0
  41. package/dist/index-faec8e86.js +15 -0
  42. package/dist/index-ffb207e7.js +6 -0
  43. package/dist/{index.es-3ccb653b.js → index.es-bb0270d2.js} +1 -1
  44. package/dist/index.js +1 -1
  45. package/dist/{interface-04e156ba.js → interface-1f94c73a.js} +1 -1
  46. package/dist/{portis-770dc757.js → portis-e93494cc.js} +1 -1
  47. package/dist/{provider-1e4a8716.js → provider-2260b3d2.js} +1 -1
  48. package/dist/{rainbow-77bcf0df.js → rainbow-39689d2b.js} +1 -1
  49. package/dist/typed-data-63f3e0ac.js +1 -0
  50. package/dist/{uAuth-b7fbd410.js → uAuth-694a2506.js} +1 -1
  51. package/dist/{walletConnect-cb53c036.js → walletConnect-550e78ed.js} +1 -1
  52. package/dist/{walletLink-ebba2d98.js → walletLink-ac78b4ba.js} +1 -1
  53. package/package.json +6 -1
  54. package/dist/__node-resolve_empty-4d5a5e96.js +0 -1
  55. package/dist/__tslib-99a4b580.js +0 -1
  56. package/dist/cjs/__tslib-71bd1176.cjs +0 -1
  57. package/dist/cjs/ethers-239652d0.cjs +0 -1
  58. package/dist/cjs/index-3a311604.cjs +0 -1
  59. package/dist/cjs/index-3c0c71bb.cjs +0 -1
  60. package/dist/cjs/index-6315c0bb.cjs +0 -9
  61. package/dist/cjs/index-68365799.cjs +0 -1
  62. package/dist/cjs/index-b20a834d.cjs +0 -15
  63. package/dist/cjs/index-bf860a22.cjs +0 -1
  64. package/dist/cjs/index-e990c110.cjs +0 -46
  65. package/dist/ethers-269fa5ad.js +0 -1
  66. package/dist/index-20ab4726.js +0 -1
  67. package/dist/index-8f414b0d.js +0 -46
  68. package/dist/index-c2664c5d.js +0 -1
  69. package/dist/index-c49b30b4.js +0 -15
  70. package/dist/index-c5513fe3.js +0 -9
  71. package/dist/index-e57e4046.js +0 -1
  72. package/dist/index-edb70a33.js +0 -1
  73. package/dist/index-fe5304ca.js +0 -1
@@ -1 +0,0 @@
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-c5513fe3.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-3d0400ed.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};