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
0
Versions
726
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.5.104 to 0.5.105

2

dist/constants.d.ts

@@ -1,4 +0,4 @@

export declare const PROD_OPENSEA_WALLET_URL = "https://privy-embedded-wallet-app.preview.prod.privatesea.io";
export declare const PROD_OPENSEA_WALLET_URL = "https://privy-embedded-wallet-app-prod.preview.dev.privatesea.io";
export declare const DEV_OPENSEA_WALLET_URL = "https://privy-embedded-wallet-app.preview.dev.privatesea.io";
export declare const LOCAL_OPENSEA_WALLET_URL = "http://localhost:5173";
//# sourceMappingURL=constants.d.ts.map

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

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

"eventemitter3": "^5.0.1",
"@opensea/vessel": "0.5.104"
"@opensea/vessel": "0.5.105"
},

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

export const PROD_OPENSEA_WALLET_URL =
"https://privy-embedded-wallet-app.preview.prod.privatesea.io"
"https://privy-embedded-wallet-app-prod.preview.dev.privatesea.io"
export const DEV_OPENSEA_WALLET_URL =
"https://privy-embedded-wallet-app.preview.dev.privatesea.io"
export const LOCAL_OPENSEA_WALLET_URL = "http://localhost:5173"

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