New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@opensea/embedded-wallet-sdk

Package Overview
Dependencies
Maintainers
9
Versions
706
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@opensea/embedded-wallet-sdk - npm Package Compare versions

Comparing version 0.7.304 to 0.7.305

2

dist/index.js

@@ -1,2 +0,2 @@

import{EventEmitter as e}from"eventemitter3";import{Vessel as t}from"@opensea/vessel";var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},n(e,t)};function r(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function u(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,u)}c((r=r.apply(e,t||[])).next())}))}function o(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(u){return function(c){return function(u){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(s=0)),s;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return s.label++,{value:u[1],done:!1};case 5:s.label++,r=u[1],u=[0];continue;case 7:u=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){s=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){s.label=u[1];break}if(6===u[0]&&s.label<o[1]){s.label=o[1],o=u;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(u);break}o[2]&&s.ops.pop(),s.trys.pop();continue}u=t.call(e,s)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}}"function"==typeof SuppressedError&&SuppressedError;var i=function(e){function t(t){var n=t.message,r=t.code,o=t.data,i=e.call(this,n)||this;return i.code=r,i.data=o,i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(t,e),t}(Error),s=new e,u=function(){function e(e){var t=e.vessel;this.vessel=t,this.messageListener=this.handleInboundMessage.bind(this),this.vessel.addListener("message",this.messageListener)}return e.prototype.handleInboundMessage=function(e,t){return!!function(e){return!!e&&"object"==typeof e&&"type"in e&&"event"===e.type&&"event"in e&&"string"==typeof e.event}(e.payload)&&(s.emit(e.payload.event,e.payload.data),t(),!0)},e.prototype.request=function(e){return r(this,void 0,void 0,(function(){var t;return o(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.vessel.send({type:"action",action:"HeadlessRPCRequest",payload:e},{timeout:void 0})];case 1:return[2,n.sent()];case 2:if(t=n.sent(),(r=t)&&"object"==typeof r&&"message"in r&&"code"in r&&"number"==typeof r.code)throw new i(t);if(t instanceof Error)throw t.message="Error sending message to wallet: ".concat(t.message),t;throw new Error("Error sending message to wallet: ".concat(JSON.stringify(t)));case 3:return[2]}var r}))}))},e.prototype.on=function(e,t){s.on(e,t)},e.prototype.removeListener=function(e,t){s.removeListener(e,t)},e.prototype.disconnect=function(){return r(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return this.vessel.removeListener("message",this.messageListener),[4,this.vessel.send({type:"action",action:"Logout"})];case 1:return e.sent(),[2]}}))}))},e}(),c="https://privy-embedded-wallet-app-prod.preview.dev.privatesea.io",a="https://privy-embedded-wallet-app.preview.dev.privatesea.io",d="http://localhost:5173",l=new e,f=function(e,t){return!!((o=e.payload)&&"object"==typeof o&&"type"in o&&"action"===o.type&&"action"in o&&"PromptMfa"===o.action)&&(n=e.payload.mfaMethods,r=function(){return t({success:!0})},l.emit("mfa-required",n,r),!0);var n,r,o},v=function(e){return l.addListener("mfa-required",e),function(){return l.removeListener("mfa-required",e)}},h=void 0,p=void 0,m=void 0,y=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return r(void 0,function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}([],e,!0),void 0,(function(e){var n,i=void 0===e?{}:e,s=i.url,u=void 0===s?a:s,c=i.debug,d=void 0!==c&&c,l=i.retries,v=void 0===l?10:l;return o(this,(function(e){return m?[2,m]:"undefined"==typeof document?[2]:((h=null!==(n=document.querySelector("iframe#os-embedded-wallet-iframe"))&&void 0!==n?n:void 0)||((h=document.createElement("iframe")).src=u,h.hidden=!0,h.id="os-embedded-wallet-iframe",document.body.appendChild(h)),p=new t({iframe:h,targetOrigin:new URL(u).origin,debug:d,handshakeTimeout:1e3}),m=r(void 0,void 0,void 0,(function(){var e;return o(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,p.handshake()];case 1:return t.sent(),p.addListener("message",f),[3,3];case 2:if(e=t.sent(),m=void 0,v>0)return d&&console.debug("Retrying embedded wallet initialization (".concat(v-1," retries left)")),[2,y({url:u,debug:d,retries:v-1})];throw e;case 3:return[2]}}))})),[2,m])}))}))},b=function(){return r(void 0,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:if(!p)throw new Error("Wallet module not initialized");return[4,m];case 1:return e.sent(),[2,{vessel:p,iframe:h}]}}))}))},w=void 0,g=function(){return r(void 0,void 0,void 0,(function(){var e;return o(this,(function(t){switch(t.label){case 0:return"undefined"==typeof document?[2,void 0]:[4,b()];case 1:return e=t.sent().vessel,w||(w=new u({vessel:e})),[2,w]}}))}))},E=function(){return r(void 0,void 0,void 0,(function(){var e;return o(this,(function(t){switch(t.label){case 0:return[4,g()];case 1:if(!(e=t.sent()))throw new Error("Wallet module not initialized");return[2,e]}}))}))},S=function(){return r(void 0,void 0,void 0,(function(){var e,t,n,r;return o(this,(function(o){switch(o.label){case 0:return"undefined"==typeof document?[2,{accounts:[],chainId:1}]:[4,E()];case 1:return e=o.sent(),[4,Promise.all([e.request({method:"eth_accounts"}),e.request({method:"eth_chainId"})])];case 2:return t=o.sent(),n=t[0],r=t[1],[2,{accounts:n,chainId:Number(r)}]}}))}))},L=function(){return r(void 0,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,E()];case 1:return[4,e.sent().disconnect()];case 2:return e.sent(),[2]}}))}))},M=function(){return r(void 0,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return"undefined"==typeof document?[2,[]]:[4,E()];case 1:return[2,e.sent().request({method:"eth_accounts"})]}}))}))},_=function(){return r(void 0,void 0,void 0,(function(){var e;return o(this,(function(t){switch(t.label){case 0:return"undefined"==typeof document?[2,1]:[4,E()];case 1:return[4,t.sent().request({method:"eth_chainId"})];case 2:return e=t.sent(),[2,Number(e)]}}))}))},C=function(){return r(void 0,void 0,void 0,(function(){var e,t;return o(this,(function(n){switch(n.label){case 0:return"undefined"==typeof document?[2,!1]:[4,b()];case 1:e=n.sent().vessel,n.label=2;case 2:return n.trys.push([2,4,,5]),[4,e.send({type:"action",action:"CheckAuthStatus"})];case 3:return[2,n.sent()];case 4:return t=n.sent(),console.error(t),[2,!1];case 5:return[2]}}))}))},q=function(e){return r(void 0,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,E()];case 1:return[4,t.sent().request({method:"wallet_switchEthereumChain",params:[{chainId:"0x".concat(e.toString(16))}]})];case 2:return t.sent(),[2]}}))}))},I=function(e){return r(void 0,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,b()];case 1:return[4,t.sent().vessel.send({type:"action",action:"SendLoginCode",email:e})];case 2:return[2,t.sent()]}}))}))},x=function(e){return r(void 0,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,b()];case 1:return[4,t.sent().vessel.send({type:"action",action:"LoginWithCode",code:e})];case 2:return[2,t.sent()]}}))}))},W=function(){return r(void 0,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,b()];case 1:return[4,e.sent().vessel.send({type:"action",action:"CreateEmbeddedWallet"})];case 2:return[2,e.sent()]}}))}))},k=function(){return r(void 0,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,b()];case 1:return[4,e.sent().vessel.send({type:"action",action:"GetUser"})];case 2:return[2,e.sent()]}}))}))},O=function(e){return r(void 0,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,b()];case 1:return[4,t.sent().vessel.send({type:"action",action:"InitMfa",mfaMethod:e},{timeout:void 0})];case 2:return[2,t.sent()]}}))}))},j=function(e,t){return r(void 0,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return[4,b()];case 1:return[4,n.sent().vessel.send({type:"action",action:"SubmitMfa",mfaCode:t,mfaMethod:e},{timeout:void 0})];case 2:return[2,n.sent()]}}))}))},P=function(){return r(void 0,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,b()];case 1:return[4,e.sent().vessel.send({type:"action",action:"CancelMfa"},{timeout:void 0})];case 2:return[2,e.sent()]}}))}))},N=function(e){return r(void 0,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,b()];case 1:return[4,t.sent().vessel.send({type:"action",action:"InitMfaEnrollmentWithSms",phoneNumber:e},{timeout:void 0})];case 2:return[2,t.sent()]}}))}))},T=function(e,t){return r(void 0,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return[4,b()];case 1:return[4,n.sent().vessel.send({type:"action",action:"SubmitMfaEnrollmentWithSms",phoneNumber:e,mfaCode:t},{timeout:void 0})];case 2:return[2,n.sent()]}}))}))},A=function(){return r(void 0,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,b()];case 1:return[4,e.sent().vessel.send({type:"action",action:"InitMfaEnrollmentWithTotp"},{timeout:void 0})];case 2:return[2,e.sent()]}}))}))},R=function(e){return r(void 0,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,b()];case 1:return[4,t.sent().vessel.send({type:"action",action:"SubmitMfaEnrollmentWithTotp",mfaCode:e},{timeout:void 0})];case 2:return[2,t.sent()]}}))}))};export{a as DEV_OPENSEA_WALLET_URL,d as LOCAL_OPENSEA_WALLET_URL,c as PROD_OPENSEA_WALLET_URL,P as cancelMfaChallenge,S as connect,W as createWallet,L as disconnect,M as getAccounts,_ as getChainId,g as getProvider,k as getUser,O as initMfaChallenge,N as initMfaEnrollmentWithSms,A as initMfaEnrollmentWithTotp,y as initialize,C as isAuthorized,x as loginWithCode,v as onMfaRequired,I as sendLoginCode,j as submitMfaChallenge,T as submitMfaEnrollmentWithSms,R as submitMfaEnrollmentWithTotp,q as switchChain};
import{EventEmitter as e}from"eventemitter3";import{Vessel as t}from"@opensea/vessel";var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},n(e,t)};function r(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function u(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,u)}c((r=r.apply(e,t||[])).next())}))}function o(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(u){return function(c){return function(u){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(s=0)),s;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return s.label++,{value:u[1],done:!1};case 5:s.label++,r=u[1],u=[0];continue;case 7:u=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){s=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){s.label=u[1];break}if(6===u[0]&&s.label<o[1]){s.label=o[1],o=u;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(u);break}o[2]&&s.ops.pop(),s.trys.pop();continue}u=t.call(e,s)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}}"function"==typeof SuppressedError&&SuppressedError;var i=function(e){function t(t){var n=t.message,r=t.code,o=t.data,i=e.call(this,n)||this;return i.code=r,i.data=o,i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(t,e),t}(Error),s=new e,u=function(){function e(e){var t=e.vessel;this.vessel=t,this.messageListener=this.handleInboundMessage.bind(this),this.vessel.addListener("message",this.messageListener)}return e.prototype.handleInboundMessage=function(e,t){return!!function(e){return!!e&&"object"==typeof e&&"type"in e&&"event"===e.type&&"event"in e&&"string"==typeof e.event}(e.payload)&&(s.emit(e.payload.event,e.payload.data),t(),!0)},e.prototype.request=function(e){return r(this,void 0,void 0,(function(){var t;return o(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.vessel.send({type:"action",action:"HeadlessRPCRequest",payload:e},{timeout:void 0})];case 1:return[2,n.sent()];case 2:if(t=n.sent(),(r=t)&&"object"==typeof r&&"message"in r&&"code"in r&&"number"==typeof r.code)throw new i(t);if(t instanceof Error)throw t.message="Error sending message to wallet: ".concat(t.message),t;throw new Error("Error sending message to wallet: ".concat(JSON.stringify(t)));case 3:return[2]}var r}))}))},e.prototype.on=function(e,t){s.on(e,t)},e.prototype.removeListener=function(e,t){s.removeListener(e,t)},e.prototype.disconnect=function(){return r(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return this.vessel.removeListener("message",this.messageListener),[4,this.vessel.send({type:"action",action:"Logout"})];case 1:return e.sent(),[2]}}))}))},e}(),c="https://privy-embedded-wallet-app-prod.preview.dev.privatesea.io",a="https://privy-embedded-wallet-app.preview.dev.privatesea.io",d="http://localhost:5173",l=new e,f=function(e,t){return!!((o=e.payload)&&"object"==typeof o&&"type"in o&&"action"===o.type&&"action"in o&&"PromptMfa"===o.action)&&(n=e.payload.mfaMethods,r=function(){return t({success:!0})},l.emit("mfa-required",n,r),!0);var n,r,o},v=function(e){return l.addListener("mfa-required",e),function(){return l.removeListener("mfa-required",e)}},h=void 0,p=void 0,m=void 0,y=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return r(void 0,function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}([],e,!0),void 0,(function(e){var n,i=void 0===e?{}:e,s=i.url,u=void 0===s?a:s,c=i.debug,d=void 0!==c&&c,l=i.retries,v=void 0===l?10:l;return o(this,(function(e){return m?[2,m]:"undefined"==typeof document?[2]:((h=null!==(n=document.querySelector("iframe#os-embedded-wallet-iframe"))&&void 0!==n?n:void 0)||((h=document.createElement("iframe")).src=u,h.hidden=!0,h.id="os-embedded-wallet-iframe",document.body.appendChild(h)),p=new t({iframe:h,targetOrigin:new URL(u).origin,debug:d,handshakeTimeout:1e3}),m=r(void 0,void 0,void 0,(function(){var e;return o(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,p.handshake()];case 1:return t.sent(),p.addListener("message",f),[3,3];case 2:if(e=t.sent(),m=void 0,v>0)return d&&console.debug("Retrying embedded wallet initialization (".concat(v-1," retries left)")),[2,y({url:u,debug:d,retries:v-1})];throw e;case 3:return[2]}}))})),[2,m])}))}))},b=function(){return r(void 0,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:if(!p)throw new Error("Wallet module not initialized");return[4,m];case 1:return e.sent(),[2,{vessel:p,iframe:h}]}}))}))},w=void 0,g=function(){return r(void 0,void 0,void 0,(function(){var e;return o(this,(function(t){switch(t.label){case 0:return"undefined"==typeof document?[2,void 0]:[4,b()];case 1:return e=t.sent().vessel,w||(w=new u({vessel:e})),[2,w]}}))}))},E=function(){return r(void 0,void 0,void 0,(function(){var e;return o(this,(function(t){switch(t.label){case 0:return[4,g()];case 1:if(!(e=t.sent()))throw new Error("Wallet module not initialized");return[2,e]}}))}))},S=function(){return r(void 0,void 0,void 0,(function(){var e,t,n,r,i;return o(this,(function(o){switch(o.label){case 0:return e=setTimeout((function(){throw new Error("Connect method timed out")}),5e3),"undefined"==typeof document?[2,{accounts:[],chainId:1}]:[4,E()];case 1:return t=o.sent(),[4,Promise.all([t.request({method:"eth_accounts"}),t.request({method:"eth_chainId"})])];case 2:return n=o.sent(),r=n[0],i=n[1],clearTimeout(e),[2,{accounts:r,chainId:Number(i)}]}}))}))},L=function(){return r(void 0,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,E()];case 1:return[4,e.sent().disconnect()];case 2:return e.sent(),[2]}}))}))},C=function(){return r(void 0,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return"undefined"==typeof document?[2,[]]:[4,E()];case 1:return[2,e.sent().request({method:"eth_accounts"})]}}))}))},M=function(){return r(void 0,void 0,void 0,(function(){var e;return o(this,(function(t){switch(t.label){case 0:return"undefined"==typeof document?[2,1]:[4,E()];case 1:return[4,t.sent().request({method:"eth_chainId"})];case 2:return e=t.sent(),[2,Number(e)]}}))}))},_=function(){return r(void 0,void 0,void 0,(function(){var e,t;return o(this,(function(n){switch(n.label){case 0:return"undefined"==typeof document?[2,!1]:[4,b()];case 1:e=n.sent().vessel,n.label=2;case 2:return n.trys.push([2,4,,5]),[4,e.send({type:"action",action:"CheckAuthStatus"})];case 3:return[2,n.sent()];case 4:return t=n.sent(),console.error(t),[2,!1];case 5:return[2]}}))}))},q=function(e){return r(void 0,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,E()];case 1:return[4,t.sent().request({method:"wallet_switchEthereumChain",params:[{chainId:"0x".concat(e.toString(16))}]})];case 2:return t.sent(),[2]}}))}))},I=function(e){return r(void 0,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,b()];case 1:return[4,t.sent().vessel.send({type:"action",action:"SendLoginCode",email:e})];case 2:return[2,t.sent()]}}))}))},x=function(e){return r(void 0,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,b()];case 1:return[4,t.sent().vessel.send({type:"action",action:"LoginWithCode",code:e})];case 2:return[2,t.sent()]}}))}))},W=function(){return r(void 0,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,b()];case 1:return[4,e.sent().vessel.send({type:"action",action:"CreateEmbeddedWallet"})];case 2:return[2,e.sent()]}}))}))},k=function(){return r(void 0,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,b()];case 1:return[4,e.sent().vessel.send({type:"action",action:"GetUser"})];case 2:return[2,e.sent()]}}))}))},O=function(e){return r(void 0,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,b()];case 1:return[4,t.sent().vessel.send({type:"action",action:"InitMfa",mfaMethod:e},{timeout:void 0})];case 2:return[2,t.sent()]}}))}))},T=function(e,t){return r(void 0,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return[4,b()];case 1:return[4,n.sent().vessel.send({type:"action",action:"SubmitMfa",mfaCode:t,mfaMethod:e},{timeout:void 0})];case 2:return[2,n.sent()]}}))}))},j=function(){return r(void 0,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,b()];case 1:return[4,e.sent().vessel.send({type:"action",action:"CancelMfa"},{timeout:void 0})];case 2:return[2,e.sent()]}}))}))},P=function(e){return r(void 0,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,b()];case 1:return[4,t.sent().vessel.send({type:"action",action:"InitMfaEnrollmentWithSms",phoneNumber:e},{timeout:void 0})];case 2:return[2,t.sent()]}}))}))},N=function(e,t){return r(void 0,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return[4,b()];case 1:return[4,n.sent().vessel.send({type:"action",action:"SubmitMfaEnrollmentWithSms",phoneNumber:e,mfaCode:t},{timeout:void 0})];case 2:return[2,n.sent()]}}))}))},A=function(){return r(void 0,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,b()];case 1:return[4,e.sent().vessel.send({type:"action",action:"InitMfaEnrollmentWithTotp"},{timeout:void 0})];case 2:return[2,e.sent()]}}))}))},R=function(e){return r(void 0,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,b()];case 1:return[4,t.sent().vessel.send({type:"action",action:"SubmitMfaEnrollmentWithTotp",mfaCode:e},{timeout:void 0})];case 2:return[2,t.sent()]}}))}))};export{a as DEV_OPENSEA_WALLET_URL,d as LOCAL_OPENSEA_WALLET_URL,c as PROD_OPENSEA_WALLET_URL,j as cancelMfaChallenge,S as connect,W as createWallet,L as disconnect,C as getAccounts,M as getChainId,g as getProvider,k as getUser,O as initMfaChallenge,P as initMfaEnrollmentWithSms,A as initMfaEnrollmentWithTotp,y as initialize,_ as isAuthorized,x as loginWithCode,v as onMfaRequired,I as sendLoginCode,T as submitMfaChallenge,N as submitMfaEnrollmentWithSms,R as submitMfaEnrollmentWithTotp,q as switchChain};
//# sourceMappingURL=index.js.map
{
"name": "@opensea/embedded-wallet-sdk",
"version": "0.7.304",
"version": "0.7.305",
"description": "SDK for interacting with the OpenSea wallet product",

@@ -22,3 +22,3 @@ "license": "ISC",

"eventemitter3": "^5.0.1",
"@opensea/vessel": "0.7.304"
"@opensea/vessel": "0.7.305"
},

@@ -25,0 +25,0 @@ "devDependencies": {

@@ -40,3 +40,8 @@ import {

const CONNECTION_TIMEOUT_MS = 5_000
export const connect = async (): Promise<ConnectResponse> => {
const timeout = setTimeout(() => {
throw new Error("Connect method timed out")
}, CONNECTION_TIMEOUT_MS)
if (typeof document === "undefined") {

@@ -50,2 +55,3 @@ return { accounts: [], chainId: 1 }

])
clearTimeout(timeout)
return { accounts, chainId: Number(chainId) }

@@ -52,0 +58,0 @@ }

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc