@dodoex/wallet-web3 0.0.29-3 → 0.0.29-5
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/blocto-ec220500.js +1 -0
- package/dist/cjs/blocto-06e9f41b.cjs +1 -0
- package/dist/cjs/index-10e8c244.cjs +1 -0
- package/dist/cjs/index-65ef3d76.cjs +1 -0
- package/dist/cjs/index-6f1e3af6.cjs +1 -0
- package/dist/cjs/index-8983bb88.cjs +1 -0
- package/dist/cjs/index-ae695e20.cjs +1 -0
- package/dist/cjs/index-ba62c069.cjs +1 -0
- package/dist/cjs/index-c149be38.cjs +1 -0
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/portis-2054bb58.cjs +1 -0
- package/dist/cjs/provider-037fd0ed.cjs +1 -0
- package/dist/cjs/providers/connector/types.d.ts +3 -1
- package/dist/cjs/rainbow-2ad12dd2.cjs +1 -0
- package/dist/cjs/uAuth-7e65d2cc.cjs +1 -0
- package/dist/cjs/walletConnect-ade9514f.cjs +1 -0
- package/dist/cjs/walletLink-b6336fc1.cjs +1 -0
- package/dist/index-17319257.js +1 -0
- package/dist/index-27e5c5a9.js +1 -0
- package/dist/index-2806301c.js +1 -0
- package/dist/index-3ea85737.js +1 -0
- package/dist/index-890a1073.js +1 -0
- package/dist/index-9149aa90.js +1 -0
- package/dist/index-ea777add.js +1 -0
- package/dist/index.js +1 -1
- package/dist/portis-8eca7dbf.js +1 -0
- package/dist/provider-a0690f64.js +1 -0
- package/dist/providers/connector/types.d.ts +3 -1
- package/dist/rainbow-9004d140.js +1 -0
- package/dist/uAuth-c2aa6d14.js +1 -0
- package/dist/walletConnect-3f4192dd.js +1 -0
- package/dist/walletLink-b8912567.js +1 -0
- package/package.json +2 -3
- package/dist/__node-resolve_empty-abf9d05c.js +0 -1
- package/dist/__tslib-2cf47e60.js +0 -1
- package/dist/_commonjs-dynamic-modules-7cfc9805.js +0 -1
- package/dist/blocto-81feb681.js +0 -7
- package/dist/bn-6112a089.js +0 -1
- package/dist/browser-ponyfill-561fcb2e.js +0 -1
- package/dist/cjs/__node-resolve_empty-7e18e37f.cjs +0 -1
- package/dist/cjs/__tslib-ea7958de.cjs +0 -1
- package/dist/cjs/_commonjs-dynamic-modules-f09a98c7.cjs +0 -1
- package/dist/cjs/blocto-dc48a1ad.cjs +0 -7
- package/dist/cjs/bn-f53db394.cjs +0 -1
- package/dist/cjs/browser-ponyfill-0731a4ed.cjs +0 -1
- package/dist/cjs/ethers-4e66d72a.cjs +0 -1
- package/dist/cjs/hash-282034e6.cjs +0 -1
- package/dist/cjs/id-8a644c33.cjs +0 -1
- package/dist/cjs/index-1466df1b.cjs +0 -6
- package/dist/cjs/index-2bdefe92.cjs +0 -1
- package/dist/cjs/index-4a570b13.cjs +0 -15
- package/dist/cjs/index-4b4d2602.cjs +0 -1
- package/dist/cjs/index-55ec09dc.cjs +0 -1
- package/dist/cjs/index-70269942.cjs +0 -1
- package/dist/cjs/index-815203b8.cjs +0 -1
- package/dist/cjs/index-a06b11a5.cjs +0 -1
- package/dist/cjs/index-a7b876c9.cjs +0 -1
- package/dist/cjs/index-cc9917b7.cjs +0 -1
- package/dist/cjs/index-cf3bf3b5.cjs +0 -3
- package/dist/cjs/index-d6d65bef.cjs +0 -9
- package/dist/cjs/index-df8e5839.cjs +0 -1
- package/dist/cjs/index-ea466b80.cjs +0 -72
- package/dist/cjs/index-eb09e54d.cjs +0 -60
- package/dist/cjs/index.es-21cc8770.cjs +0 -9
- package/dist/cjs/inherits_browser-f88a000a.cjs +0 -1
- package/dist/cjs/interface-225981df.cjs +0 -1
- package/dist/cjs/portis-3fafbe79.cjs +0 -24
- package/dist/cjs/provider-a262028d.cjs +0 -1
- package/dist/cjs/rainbow-b604cbf7.cjs +0 -1
- package/dist/cjs/typed-data-c4ecf952.cjs +0 -1
- package/dist/cjs/uAuth-f1305031.cjs +0 -1
- package/dist/cjs/walletConnect-a53f336c.cjs +0 -1
- package/dist/cjs/walletLink-df159d74.cjs +0 -1
- package/dist/ethers-acfbf5c9.js +0 -1
- package/dist/hash-a9ebd52a.js +0 -1
- package/dist/id-bc5c09f7.js +0 -1
- package/dist/index-030da250.js +0 -15
- package/dist/index-0ee5ef8d.js +0 -60
- package/dist/index-3e230de4.js +0 -1
- package/dist/index-48b745cb.js +0 -1
- package/dist/index-5a901c0e.js +0 -2
- package/dist/index-6be6f872.js +0 -1
- package/dist/index-7c8bbc42.js +0 -1
- package/dist/index-9006cf1c.js +0 -9
- package/dist/index-9d00f201.js +0 -72
- package/dist/index-a22d40f4.js +0 -6
- package/dist/index-cc5a134a.js +0 -1
- package/dist/index-e0d3617a.js +0 -1
- package/dist/index-f14e5faf.js +0 -1
- package/dist/index-f419935b.js +0 -1
- package/dist/index-fe8f3b3c.js +0 -1
- package/dist/index.es-0f31065d.js +0 -9
- package/dist/inherits_browser-06ba108b.js +0 -1
- package/dist/interface-0a756904.js +0 -1
- package/dist/portis-115bb575.js +0 -24
- package/dist/provider-a182bcd5.js +0 -1
- package/dist/rainbow-f5118874.js +0 -1
- package/dist/typed-data-a195e004.js +0 -1
- package/dist/uAuth-cf583f8b.js +0 -1
- package/dist/walletConnect-49aee65f.js +0 -1
- package/dist/walletLink-fbbe6e77.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("./index-d6d65bef.cjs");require("@ethersproject/providers"),require("zustand"),require("events"),require("@ethersproject/address"),require("@ethersproject/constants"),require("@ethersproject/contracts"),require("@ethersproject/properties"),require("@ethersproject/transactions"),require("@ethersproject/bytes");const t="dapp-inpage-integration",i="openblock-content-integration",n=["https://cocoswap.com","https://app.openocean.finance"],s=["https://oec.cocoswap.com"];class o{constructor(){console.log("start initialize openblockinpage provider"),this.callBackList={},this.eventListener={},this.isMetaMask=!0,this.isOpenBlock=!0,this.chainId=null,this.networkVersion=null,this.selectedAddress=null,this.request=this.request.bind(this),this.send=this.send.bind(this),this.sendAsync=this.sendAsync.bind(this),this.on=this.on.bind(this),this.isConnected=this.isConnected.bind(this),this.enable=this.enable.bind(this),this._metamask=this._getExperimentalApi(),this._initInpageListener(),this.getProviderData()}getProviderData(){var t;return e.__awaiter(this,void 0,void 0,(function*(){const e=yield this.request("metamask_getProviderState");this.chainId=null==e?void 0:e.chainId,this.networkVersion=null==e?void 0:e.networkVersion,this.selectedAddress=null===(t=null==e?void 0:e.accounts)||void 0===t?void 0:t[0]}))}request(t){return e.__awaiter(this,void 0,void 0,(function*(){if("eth_requestAccounts"===t.method){const e=yield this._hookRequest("eth_accounts");if(e.length)return new Promise((t=>t(e)))}return this._hookRequest(t)}))}send(...t){return e.__awaiter(this,void 0,void 0,(function*(){if("function"!=typeof t[1])return"string"==typeof t[0]?this.request({method:t[0],params:t[1]}):1===t.length?this.request(t):void 0;this.sendAsync(t[0],t[1])}))}sendAsync(...t){return e.__awaiter(this,void 0,void 0,(function*(){const e={method:t[0].method,params:t[0].params},i=t[0].id;this.request(e).then((e=>{t[1](null,{id:i,jsonrpc:"2.0",result:e})})).catch((e=>{t[1](null,{id:i,jsonrpc:"2.0",error:e})}))}))}isConnected(){return!0}enable(){return e.__awaiter(this,void 0,void 0,(function*(){const e=yield this._hookRequest("eth_accounts");return e.length?new Promise((t=>t(e))):this.request({method:"eth_requestAccounts"})}))}on(e,t){"string"==typeof e&&"function"==typeof t&&(this.eventListener[e]&&this.eventListener[e].length>5||(this.eventListener[e]?(this.eventListener[e].push(t),this.eventListener[e]=Array.from(new Set(this.eventListener[e]))):this.eventListener[e]||(this.eventListener=Object.assign(Object.assign({},this.eventListener),{[e]:[t]})),this._registerEvent(e)))}removeListener(){}_initInpageListener(){window.addEventListener("message",(e=>{var i,n,s;if(e.data.target!==t)return;const o=null===(s=null===(n=null===(i=e.data)||void 0===i?void 0:i.value)||void 0===n?void 0:n.data)||void 0===s?void 0:s.mark;o&&("call_method"===o.type?this._handleNormalMethod(o,e):"register_event"===o.type&&this._handleEventMethod(o,e))}),!1)}_handleNormalMethod(e,t){var i,n,s,o,r;(null===(i=t.data.value.data)||void 0===i?void 0:i.error)?null===(n=this.callBackList[e.id])||void 0===n||n.reject(null===(s=t.data.value.data)||void 0===s?void 0:s.error):null===(o=this.callBackList[e.id])||void 0===o||o.resolve(null===(r=t.data.value.data)||void 0===r?void 0:r.result),delete this.callBackList[e.id]}_handleEventMethod(e,t){var i,o,r,a,d,h,l;const c=null===(a=null===(r=null===(o=null===(i=t.data)||void 0===i?void 0:i.value)||void 0===o?void 0:o.data)||void 0===r?void 0:r.mark)||void 0===a?void 0:a.eventName,u=null===(l=null===(h=null===(d=t.data)||void 0===d?void 0:d.value)||void 0===h?void 0:h.data)||void 0===l?void 0:l.params;if(c){const e=this.eventListener[c];if(!e)return void("https://app.openocean.finance"===window.location.origin&&window.location.reload());e.forEach((e=>{"chainChanged"===c&&(this.chainId=u,this.networkVersion=Number(u)),s.includes(window.location.origin)&&"chainChanged"===c||(n.includes(window.location.origin)?window.location.reload():e(u))}))}}_hookRequest(e){return new Promise(((n,s)=>{const o=(()=>{function e(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return e()+e()+e()+e()+e()+e()+e()+e()})();"string"==typeof e&&(e={method:e}),e=Object.assign(Object.assign({},e),{mark:{id:o,method:e.method,type:"call_method"}}),window.parent.postMessage({from:t,target:i,data:e},"*"),this.callBackList[o]={resolve:n,reject:s}}))}_registerEvent(e){const n={mark:{eventName:e,type:"register_event"},eventName:e};window.parent.postMessage({from:t,target:i,data:n},"*")}_getExperimentalApi(){return new Proxy({isUnlocked:()=>new Promise((e=>e(!0)))},{get:(e,t,...i)=>Reflect.get(e,t,...i)})}}exports.default=function(){var e;if(null===(e=window.obethereum)||void 0===e?void 0:e.isOpenBlock)return window.obethereum;let t=new o;t=new Proxy(t,{deleteProperty:()=>!0});try{Object.defineProperty(window,"obethereum",{set(e){console.log("set ethereum",e)},get:()=>t})}catch(e){console.log("initializeProvider error",e),window.obethereum=t}return window.web3=Object.assign({},window.web3),window.web3.currentProvider=t,window.dispatchEvent(new Event("ethereum#initialized")),t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("./index-d6d65bef.cjs"),r=require("./index.es-21cc8770.cjs");require("@ethersproject/address"),require("@ethersproject/providers"),require("zustand"),require("events"),require("@ethersproject/constants"),require("@ethersproject/contracts"),require("@ethersproject/properties"),require("@ethersproject/transactions"),require("@ethersproject/bytes"),require("./_commonjs-dynamic-modules-f09a98c7.cjs"),require("./__node-resolve_empty-7e18e37f.cjs"),require("./__tslib-ea7958de.cjs"),require("./browser-ponyfill-0731a4ed.cjs"),exports.default=function({chainId:o,rpcUrl:n,rpc:t,walletConnectParams:i,darkMode:c},s){return e.__awaiter(this,void 0,void 0,(function*(){let a,d,l="wss://relay.walletconnect.com",u=!0;i&&(l=i.bridge||l,u=void 0!==i.qrcode?i.qrcode:u,i.infuraId,d=i.qrModalOptions||void 0),t?a=t:o&&n&&(a={[o]:n});const p=e.getIsMobile(),h=yield r.G.init({projectId:"59e050d1f27ed617e65bb9637c9498d6",chains:o?[o]:[],showQrModal:!p,rpcMap:a,qrModalOptions:Object.assign({themeMode:c?"dark":"light"},d)});return h.on("display_uri",(e=>{(null==d?void 0:d.openCallback)&&d.openCallback(e)})),h.on("connect",s.connect),h.on("disconnect",(e=>{s.disconnect(e),s.accountsChanged([])})),h.on("accountsChanged",s.accountsChanged),h.on("chainChanged",s.chainChanged),h.on("message",(({type:e,data:r})=>s.message(e,r))),new Promise((r=>e.__awaiter(this,void 0,void 0,(function*(){p?(h.once("display_uri",(o=>{let n=o;e.getIsIOS()&&(n=`rainbow://wc?uri=${encodeURIComponent(o)}&connector=rainbowkit`),window.location.href=n,r(e.convertWeb3Provider(h))})),h.enable()):(yield h.enable(),r(e.convertWeb3Provider(h)))}))))}))};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var t=require("@ethersproject/address"),r=require("@ethersproject/bytes"),e=require("./index-d6d65bef.cjs"),n=require("@ethersproject/properties"),i=require("./id-8a644c33.cjs");const o="hash/5.7.0";var a=function(t,r,e,n){return new(e||(e=Promise))((function(i,o){function a(t){try{c(n.next(t))}catch(t){o(t)}}function s(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var r;t.done?i(t.value):(r=t.value,r instanceof e?r:new e((function(t){t(r)}))).then(a,s)}c((n=n.apply(t,r||[])).next())}))};const s=new i.Logger(o),c=new Uint8Array(32);c.fill(0);const f=i.BigNumber.from(-1),u=i.BigNumber.from(0),h=i.BigNumber.from(1),y=i.BigNumber.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const m=r.hexZeroPad(h.toHexString(),32),d=r.hexZeroPad(u.toHexString(),32),g={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},p=["name","version","chainId","verifyingContract","salt"];function l(t){return function(r){return"string"!=typeof r&&s.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,r),r}}const v={name:l("name"),version:l("version"),chainId:function(t){try{return i.BigNumber.from(t).toString()}catch(t){}return s.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(r){try{return t.getAddress(r).toLowerCase()}catch(t){}return s.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",r)},salt:function(t){try{const e=r.arrayify(t);if(32!==e.length)throw new Error("bad length");return r.hexlify(e)}catch(t){}return s.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function w(n){{const t=n.match(/^(u?)int(\d*)$/);if(t){const e=""===t[1],o=parseInt(t[2]||"256");(o%8!=0||o>256||t[2]&&t[2]!==String(o))&&s.throwArgumentError("invalid numeric width","type",n);const a=y.mask(e?o-1:o),c=e?a.add(h).mul(f):u;return function(t){const e=i.BigNumber.from(t);return(e.lt(c)||e.gt(a))&&s.throwArgumentError(`value out-of-bounds for ${n}`,"value",t),r.hexZeroPad(e.toTwos(256).toHexString(),32)}}}{const t=n.match(/^bytes(\d+)$/);if(t){const e=parseInt(t[1]);return(0===e||e>32||t[1]!==String(e))&&s.throwArgumentError("invalid bytes width","type",n),function(t){return r.arrayify(t).length!==e&&s.throwArgumentError(`invalid length for ${n}`,"value",t),function(t){const e=r.arrayify(t),n=e.length%32;return n?r.hexConcat([e,c.slice(n)]):r.hexlify(e)}(t)}}}switch(n){case"address":return function(e){return r.hexZeroPad(t.getAddress(e),32)};case"bool":return function(t){return t?m:d};case"bytes":return function(t){return e.keccak256(t)};case"string":return function(t){return i.id(t)}}return null}function E(t,r){return`${t}(${r.map((({name:t,type:r})=>r+" "+t)).join(",")})`}class x{constructor(t){n.defineReadOnly(this,"types",Object.freeze(n.deepCopy(t))),n.defineReadOnly(this,"_encoderCache",{}),n.defineReadOnly(this,"_types",{});const r={},e={},i={};Object.keys(t).forEach((t=>{r[t]={},e[t]=[],i[t]={}}));for(const n in t){const i={};t[n].forEach((o=>{i[o.name]&&s.throwArgumentError(`duplicate variable name ${JSON.stringify(o.name)} in ${JSON.stringify(n)}`,"types",t),i[o.name]=!0;const a=o.type.match(/^([^\x5b]*)(\x5b|$)/)[1];a===n&&s.throwArgumentError(`circular type reference to ${JSON.stringify(a)}`,"types",t);w(a)||(e[a]||s.throwArgumentError(`unknown type ${JSON.stringify(a)}`,"types",t),e[a].push(n),r[n][a]=!0)}))}const o=Object.keys(e).filter((t=>0===e[t].length));0===o.length?s.throwArgumentError("missing primary type","types",t):o.length>1&&s.throwArgumentError(`ambiguous primary types or unused types: ${o.map((t=>JSON.stringify(t))).join(", ")}`,"types",t),n.defineReadOnly(this,"primaryType",o[0]),function n(o,a){a[o]&&s.throwArgumentError(`circular type reference to ${JSON.stringify(o)}`,"types",t),a[o]=!0,Object.keys(r[o]).forEach((t=>{e[t]&&(n(t,a),Object.keys(a).forEach((r=>{i[r][t]=!0})))})),delete a[o]}(this.primaryType,{});for(const r in i){const e=Object.keys(i[r]);e.sort(),this._types[r]=E(r,t[r])+e.map((r=>E(r,t[r]))).join("")}}getEncoder(t){let r=this._encoderCache[t];return r||(r=this._encoderCache[t]=this._getEncoder(t)),r}_getEncoder(t){{const r=w(t);if(r)return r}const n=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){const t=n[1],i=this.getEncoder(t),o=parseInt(n[3]);return n=>{o>=0&&n.length!==o&&s.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",n);let a=n.map(i);return this._types[t]&&(a=a.map(e.keccak256)),e.keccak256(r.hexConcat(a))}}const o=this.types[t];if(o){const n=i.id(this._types[t]);return t=>{const i=o.map((({name:r,type:n})=>{const i=this.getEncoder(n)(t[r]);return this._types[n]?e.keccak256(i):i}));return i.unshift(n),r.hexConcat(i)}}return s.throwArgumentError(`unknown type: ${t}`,"type",t)}encodeType(t){const r=this._types[t];return r||s.throwArgumentError(`unknown type: ${JSON.stringify(t)}`,"name",t),r}encodeData(t,r){return this.getEncoder(t)(r)}hashStruct(t,r){return e.keccak256(this.encodeData(t,r))}encode(t){return this.encodeData(this.primaryType,t)}hash(t){return this.hashStruct(this.primaryType,t)}_visit(t,r,e){if(w(t))return e(t,r);const n=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){const t=n[1],i=parseInt(n[3]);return i>=0&&r.length!==i&&s.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",r),r.map((r=>this._visit(t,r,e)))}const i=this.types[t];return i?i.reduce(((t,{name:n,type:i})=>(t[n]=this._visit(i,r[n],e),t)),{}):s.throwArgumentError(`unknown type: ${t}`,"type",t)}visit(t,r){return this._visit(this.primaryType,t,r)}static from(t){return new x(t)}static getPrimaryType(t){return x.from(t).primaryType}static hashStruct(t,r,e){return x.from(r).hashStruct(t,e)}static hashDomain(t){const r=[];for(const e in t){const n=g[e];n||s.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(e)}`,"domain",t),r.push({name:e,type:n})}return r.sort(((t,r)=>p.indexOf(t.name)-p.indexOf(r.name))),x.hashStruct("EIP712Domain",{EIP712Domain:r},t)}static encode(t,e,n){return r.hexConcat(["0x1901",x.hashDomain(t),x.from(e).hash(n)])}static hash(t,r,n){return e.keccak256(x.encode(t,r,n))}static resolveNames(t,e,i,o){return a(this,void 0,void 0,(function*(){t=n.shallowCopy(t);const a={};t.verifyingContract&&!r.isHexString(t.verifyingContract,20)&&(a[t.verifyingContract]="0x");const s=x.from(e);s.visit(i,((t,e)=>("address"!==t||r.isHexString(e,20)||(a[e]="0x"),e)));for(const t in a)a[t]=yield o(t);return t.verifyingContract&&a[t.verifyingContract]&&(t.verifyingContract=a[t.verifyingContract]),i=s.visit(i,((t,r)=>"address"===t&&a[r]?a[r]:r)),{domain:t,value:i}}))}static getPayload(t,e,o){x.hashDomain(t);const a={},c=[];p.forEach((r=>{const e=t[r];null!=e&&(a[r]=v[r](e),c.push({name:r,type:g[r]}))}));const f=x.from(e),u=n.shallowCopy(e);return u.EIP712Domain?s.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",e):u.EIP712Domain=c,f.encode(o),{types:u,domain:a,primaryType:f.primaryType,message:f.visit(o,((t,e)=>{if(t.match(/^bytes(\d*)/))return r.hexlify(r.arrayify(e));if(t.match(/^u?int/))return i.BigNumber.from(e).toString();switch(t){case"address":return e.toLowerCase();case"bool":return!!e;case"string":return"string"!=typeof e&&s.throwArgumentError("invalid string","value",e),e}return s.throwArgumentError("unsupported type","type",t)}))}}}exports.TypedDataEncoder=x,exports.version=o;
|