@dodoex/wallet-web3 0.0.14-8 → 0.0.14-9
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-0c4e57ad.js → blocto-d52a1c4b.js} +1 -1
- package/dist/cjs/{blocto-e4a07c08.cjs → blocto-7759f9b8.cjs} +1 -1
- package/dist/cjs/helpers/index.d.ts +0 -1
- package/dist/cjs/{index-1e297b7f.cjs → index-12fd3907.cjs} +1 -1
- package/dist/cjs/{index-4d593146.cjs → index-62634ced.cjs} +1 -1
- package/dist/cjs/{index-a842d21e.cjs → index-7c4585fb.cjs} +1 -1
- package/dist/cjs/{index-ed8d4516.cjs → index-ed3ba9e6.cjs} +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/{portis-032212fc.cjs → portis-79a20f0f.cjs} +1 -1
- package/dist/cjs/{provider-dcbb2951.cjs → provider-9c645f94.cjs} +1 -1
- package/dist/cjs/providers/connector/index.d.ts +1 -0
- package/dist/cjs/providers/wallets/index.d.ts +0 -1
- package/dist/cjs/providers/wallets/types.d.ts +0 -1
- package/dist/cjs/{rainbow-fcc581a0.cjs → rainbow-0ba0fb09.cjs} +1 -1
- package/dist/cjs/{uAuth-370cf937.cjs → uAuth-ebdf947a.cjs} +1 -1
- package/dist/cjs/{walletConnect-93d9e10c.cjs → walletConnect-f4a59868.cjs} +1 -1
- package/dist/cjs/{walletLink-646f85b1.cjs → walletLink-768366a9.cjs} +1 -1
- package/dist/helpers/index.d.ts +0 -1
- package/dist/{index-d26721cf.js → index-0012d639.js} +1 -1
- package/dist/{index-491a3df7.js → index-18c36a46.js} +1 -1
- package/dist/{index-8dbc8f13.js → index-4f4992b7.js} +1 -1
- package/dist/{index-d9f84889.js → index-ebd3bdf9.js} +1 -1
- package/dist/index.js +1 -1
- package/dist/{portis-dc7c35bb.js → portis-55589da0.js} +1 -1
- package/dist/{provider-bf5c01d1.js → provider-45ab4fc5.js} +1 -1
- package/dist/providers/connector/index.d.ts +1 -0
- package/dist/providers/wallets/index.d.ts +0 -1
- package/dist/providers/wallets/types.d.ts +0 -1
- package/dist/{rainbow-54a25d58.js → rainbow-cfa0c610.js} +1 -1
- package/dist/{uAuth-54163a24.js → uAuth-af956c98.js} +1 -1
- package/dist/{walletConnect-534d169c.js → walletConnect-30c00f8b.js} +1 -1
- package/dist/{walletLink-1a28abc0.js → walletLink-d5d606a2.js} +1 -1
- package/package.json +1 -1
- package/dist/cjs/helpers/wallet.d.ts +0 -1
- package/dist/helpers/wallet.d.ts +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e}from"./index-
|
|
1
|
+
import{_ as e}from"./index-ebd3bdf9.js";import"@ethersproject/providers";import"zustand";import"@ethersproject/strings";import"@ethersproject/bytes";import"@ethersproject/constants";import"@ethersproject/contracts";import"@ethersproject/address";import"@ethersproject/properties";import"@ethersproject/transactions";import"@ethersproject/keccak256";const t="dapp-inpage-integration",i="openblock-content-integration",n=["https://cocoswap.com","https://app.openocean.finance"],o=["https://oec.cocoswap.com"];class s{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(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(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(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(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(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,o;if(e.data.target!==t)return;const s=null===(o=null===(n=null===(i=e.data)||void 0===i?void 0:i.value)||void 0===n?void 0:n.data)||void 0===o?void 0:o.mark;s&&("call_method"===s.type?this._handleNormalMethod(s,e):"register_event"===s.type&&this._handleEventMethod(s,e))}),!1)}_handleNormalMethod(e,t){var i,n,o,s,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===(o=t.data.value.data)||void 0===o?void 0:o.error):null===(s=this.callBackList[e.id])||void 0===s||s.resolve(null===(r=t.data.value.data)||void 0===r?void 0:r.result),delete this.callBackList[e.id]}_handleEventMethod(e,t){var i,s,r,d,a,h,l;const c=null===(d=null===(r=null===(s=null===(i=t.data)||void 0===i?void 0:i.value)||void 0===s?void 0:s.data)||void 0===r?void 0:r.mark)||void 0===d?void 0:d.eventName,u=null===(l=null===(h=null===(a=t.data)||void 0===a?void 0:a.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)),o.includes(window.location.origin)&&"chainChanged"===c||(n.includes(window.location.origin)?window.location.reload():e(u))}))}}_hookRequest(e){return new Promise(((n,o)=>{const s=(()=>{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:s,method:e.method,type:"call_method"}}),window.parent.postMessage({from:t,target:i,data:e},"*"),this.callBackList[s]={resolve:n,reject:o}}))}_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)})}}function r(){var e;if(null===(e=window.obethereum)||void 0===e?void 0:e.isOpenBlock)return window.obethereum;let t=new s;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}export{r as default};
|
|
@@ -27,6 +27,7 @@ export declare function getUniPassConnector(params: ConnectorParams, events: Con
|
|
|
27
27
|
disconnect(): Promise<void>;
|
|
28
28
|
listAccounts(): Promise<string[]>;
|
|
29
29
|
getAddress(): Promise<string | null>;
|
|
30
|
+
updateUpWalletConfig: (chainId: number) => void;
|
|
30
31
|
readonly connection: import("@ethersproject/web").ConnectionInfo;
|
|
31
32
|
_pendingFilter: Promise<number>;
|
|
32
33
|
_nextId: number;
|
|
@@ -46,7 +46,6 @@ export declare const OpenBlockIframeWallet: {
|
|
|
46
46
|
signTypedData?: boolean | undefined;
|
|
47
47
|
sendTransaction?: boolean | undefined;
|
|
48
48
|
} | undefined;
|
|
49
|
-
signType?: "eip1271" | "eip712" | undefined;
|
|
50
49
|
};
|
|
51
50
|
export interface WalletListParams {
|
|
52
51
|
excludes?: WalletType[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,g as o,b as t,a as r}from"./index-
|
|
1
|
+
import{_ as e,g as o,b as t,a as r}from"./index-ebd3bdf9.js";import{EthereumProvider as n}from"@walletconnect/ethereum-provider";import"@ethersproject/address";import"@ethersproject/providers";import"zustand";import"@ethersproject/strings";import"@ethersproject/bytes";import"@ethersproject/constants";import"@ethersproject/contracts";import"@ethersproject/properties";import"@ethersproject/transactions";import"@ethersproject/keccak256";function c({chainId:c,rpcUrl:i,rpc:a,walletConnectParams:s,darkMode:d},p){return e(this,void 0,void 0,(function*(){let l,h,m="wss://relay.walletconnect.com",u=!0;s&&(m=s.bridge||m,u=void 0!==s.qrcode?s.qrcode:u,s.infuraId,h=s.qrModalOptions||void 0),a?l=a:c&&i&&(l={[c]:i});const b=o(),g=yield n.init({projectId:"59e050d1f27ed617e65bb9637c9498d6",chains:c?[c]:[],showQrModal:!b,rpcMap:l,qrModalOptions:Object.assign({themeMode:d?"dark":"light"},h)});return g.on("display_uri",(e=>{(null==h?void 0:h.openCallback)&&h.openCallback(e)})),g.on("connect",p.connect),g.on("disconnect",(e=>{p.disconnect(e),p.accountsChanged([])})),g.on("accountsChanged",p.accountsChanged),g.on("chainChanged",p.chainChanged),g.on("message",(({type:e,data:o})=>p.message(e,o))),new Promise((o=>e(this,void 0,void 0,(function*(){b?(g.once("display_uri",(e=>{let n=e;t()&&(n=`rainbow://wc?uri=${encodeURIComponent(e)}&connector=rainbowkit`),window.location.href=n,o(r(g))})),g.enable()):(yield g.enable(),o(r(g)))}))))}))}export{c as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as t,i as e}from"./index-
|
|
1
|
+
import{_ as t,i as e}from"./index-ebd3bdf9.js";import r from"@uauth/js";import"@ethersproject/providers";import"zustand";import"@ethersproject/strings";import"@ethersproject/bytes";import"@ethersproject/constants";import"@ethersproject/contracts";import"@ethersproject/address";import"@ethersproject/properties";import"@ethersproject/transactions";import"@ethersproject/keccak256";let o,i=!1;function n(n,s){return t(this,void 0,void 0,(function*(){if(i)return;const{uAuthParams:t}=n;if(!(null==t?void 0:t.clientID))throw new Error("uAuthParams is not valid.");i=!0;try{const n=Object.assign(Object.assign({},t),{redirectUri:t.redirectUri||window.location.origin});let l,c;o=new r(n);try{l=yield o.user()}catch(t){if(!o.fallbackLoginOptions.scope.includes("wallet"))throw new Error('Must request the "wallet" scope for connector to work.');if(n.shouldLoginWithRedirect)throw yield o.login(),yield new Promise((()=>{})),new Error("Should never get here.");yield o.loginWithPopup(),l=yield o.user()}if(null==l.wallet_type_hint)throw new Error("no wallet type present");if(["web3","injected"].includes(l.wallet_type_hint))c=e(void 0,s);else{if("walletconnect"!==l.wallet_type_hint||!n.walletConnect)throw new Error("Connector not supported");c=n.walletConnect()}return i=!1,c}catch(t){i=!1}}))}function s(){return null==o?void 0:o.logout()}export{n as default,s as disconnectWallet};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,a as t}from"./index-
|
|
1
|
+
import{_ as e,a as t}from"./index-ebd3bdf9.js";import{EthereumProvider as o}from"@walletconnect/ethereum-provider";import"@ethersproject/providers";import"zustand";import"@ethersproject/strings";import"@ethersproject/bytes";import"@ethersproject/constants";import"@ethersproject/contracts";import"@ethersproject/address";import"@ethersproject/properties";import"@ethersproject/transactions";import"@ethersproject/keccak256";function r({chainId:r,rpcUrl:n,rpc:c,walletConnectParams:a,darkMode:s},i){return e(this,void 0,void 0,(function*(){let e,d,p="wss://relay.walletconnect.com",l=!0;a&&(p=a.bridge||p,l=void 0!==a.qrcode?a.qrcode:l,a.infuraId,d=a.qrModalOptions||void 0),c?e=c:r&&n&&(e={[r]:n});const h=yield o.init({projectId:"59e050d1f27ed617e65bb9637c9498d6",chains:r?[r]:[],showQrModal:!0,rpcMap:e,qrModalOptions:Object.assign({themeMode:s?"dark":"light"},d)});return h.on("display_uri",(e=>{(null==d?void 0:d.openCallback)&&d.openCallback(e)})),yield h.enable(),h.on("connect",i.connect),h.on("disconnect",(e=>{i.disconnect(e),i.accountsChanged([])})),h.on("accountsChanged",i.accountsChanged),h.on("chainChanged",i.chainChanged),h.on("message",(({type:e,data:t})=>i.message(e,t))),t(h)}))}export{r as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,i as r,a as t}from"./index-
|
|
1
|
+
import{_ as e,i as r,a as t}from"./index-ebd3bdf9.js";import o from"@coinbase/wallet-sdk";import"@ethersproject/providers";import"zustand";import"@ethersproject/strings";import"@ethersproject/bytes";import"@ethersproject/constants";import"@ethersproject/contracts";import"@ethersproject/address";import"@ethersproject/properties";import"@ethersproject/transactions";import"@ethersproject/keccak256";function n({chainId:n,rpcUrl:i,appName:s,appLogoUrl:a,darkMode:p},c){return e(this,void 0,void 0,(function*(){if(window.ethereum&&(window.ethereum.isWalletLink||window.ethereum.isToshi))return r(window.ethereum,c);if(!s)throw new Error("walletLink need appName");const e=new o({appName:s,appLogoUrl:a,darkMode:p}).makeWeb3Provider(i,n);return yield e.enable(),e.on("connect",c.connect),e.on("disconnect",c.disconnect),e.on("accountsChanged",c.accountsChanged),e.on("chainChanged",c.chainChanged),e.on("message",c.message),t(e)}))}export{n as default};
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function getWalletSignType(): "eip1271" | "eip712" | null;
|
package/dist/helpers/wallet.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function getWalletSignType(): "eip1271" | "eip712" | null;
|