@magic-ext/farcaster
Advanced tools
Comparing version 0.0.3-canary.742.9605940540.0 to 0.0.3-canary.752.9614914380.0
@@ -1,2 +0,2 @@ | ||
"use strict";var d=Object.defineProperty;var I=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames,R=Object.getOwnPropertySymbols;var E=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable;var C=(n,e,t)=>e in n?d(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,b=(n,e)=>{for(var t in e||(e={}))E.call(e,t)&&C(n,t,e[t]);if(R)for(var t of R(e))v.call(e,t)&&C(n,t,e[t]);return n};var w=(n,e)=>{for(var t in e)d(n,t,{get:e[t],enumerable:!0})},P=(n,e,t,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of k(e))!E.call(n,o)&&o!==t&&d(n,o,{get:()=>e[o],enumerable:!(l=I(e,o))||l.enumerable});return n};var L=n=>P(d({},"__esModule",{value:!0}),n);var m=(n,e,t)=>new Promise((l,o)=>{var p=r=>{try{c(t.next(r))}catch(s){o(s)}},u=r=>{try{c(t.throw(r))}catch(s){o(s)}},c=r=>r.done?l(r.value):Promise.resolve(r.value).then(p,u);c((t=t.apply(n,e)).next())});var q={};w(q,{FarcasterExtension:()=>g});module.exports=L(q);var f=require("@magic-sdk/commons"),h=require("@farcaster/auth-client");function S(){return typeof navigator!="undefined"&&/android/i.test(navigator.userAgent)}function T(){return typeof navigator!="undefined"&&/iPhone|iPod/.test(navigator.userAgent)}function x(){return typeof navigator!="undefined"&&(/iPad/.test(navigator.userAgent)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)}function U(){return T()||x()}function y(){return S()||U()}var A={CHANNEL:"channel",DONE:"done",ERROR:"error"},_=n=>typeof n=="function",D=n=>typeof n=="function",H="https://relay.farcaster.xyz",F="https://example.com/login",O=6e4,N=500,g=class extends f.Extension.Internal{constructor(){super(...arguments);this.name="farcaster";this.config={};this.login=({showUI:t})=>{let l=(0,h.createAppClient)({relay:H,ethereum:(0,h.viemConnector)()}),o=l.createChannel({siweUri:F,domain:window.location.host}),p=o.then(({data:s})=>l.watchStatus({channelToken:s.channelToken,timeout:O,interval:N}).then(i=>{if(i.isError)throw i.error;return i})),u,c,r={on:(s,i)=>(s==="channel"&&m(this,null,function*(){let{data:a}=yield o;if(!!_(i)){if(i(a),c=a.channelToken,y()){console.info("Info: showUI parameter is ignored on mobile, open URL directly"),window.open(a.url,"_blank");return}u=this.utils.createJsonRpcRequestPayload("farcaster_show_QR",[{data:b({showUI:t},a)}]),this.request(u)}}),s===A.DONE&&m(this,null,function*(){let{data:a}=yield p;a.state==="completed"&&(this.createIntermediaryEvent(f.FarcasterLoginEventEmit.SuccessSignIn,u.id)({channel_token:c,message:a.message,signature:a.signature,fid:a.fid,username:a.username}),D(i)&&i(a))}),s===A.ERROR&&p.catch(a=>{i(a)}),r)};return r}}}; | ||
"use strict";var d=Object.defineProperty;var I=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames,R=Object.getOwnPropertySymbols;var E=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable;var C=(n,e,t)=>e in n?d(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,b=(n,e)=>{for(var t in e||(e={}))E.call(e,t)&&C(n,t,e[t]);if(R)for(var t of R(e))v.call(e,t)&&C(n,t,e[t]);return n};var w=(n,e)=>{for(var t in e)d(n,t,{get:e[t],enumerable:!0})},P=(n,e,t,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of k(e))!E.call(n,o)&&o!==t&&d(n,o,{get:()=>e[o],enumerable:!(l=I(e,o))||l.enumerable});return n};var L=n=>P(d({},"__esModule",{value:!0}),n);var m=(n,e,t)=>new Promise((l,o)=>{var p=r=>{try{c(t.next(r))}catch(s){o(s)}},u=r=>{try{c(t.throw(r))}catch(s){o(s)}},c=r=>r.done?l(r.value):Promise.resolve(r.value).then(p,u);c((t=t.apply(n,e)).next())});var q={};w(q,{FarcasterExtension:()=>g});module.exports=L(q);var f=require("@magic-sdk/commons"),h=require("@farcaster/auth-client");function S(){return typeof navigator!="undefined"&&/android/i.test(navigator.userAgent)}function T(){return typeof navigator!="undefined"&&/iPhone|iPod/.test(navigator.userAgent)}function x(){return typeof navigator!="undefined"&&(/iPad/.test(navigator.userAgent)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)}function U(){return T()||x()}function y(){return S()||U()}var A={CHANNEL:"channel",DONE:"done",ERROR:"error"},_=n=>typeof n=="function",D=n=>typeof n=="function",H="https://relay.farcaster.xyz",F="https://example.com/login",O=6e4,N=500,g=class extends f.Extension.Internal{constructor(){super(...arguments);this.name="farcaster";this.config={};this.login=({showUI:t})=>{let l=(0,h.createAppClient)({relay:H,ethereum:(0,h.viemConnector)()}),o=l.createChannel({siweUri:F,domain:window.location.host}),p=o.then(({data:s})=>l.watchStatus({channelToken:s.channelToken,timeout:O,interval:N}).then(i=>{if(i.isError)throw i.error;return i})),u,c,r={on:(s,i)=>(s==="channel"&&m(this,null,function*(){let{data:a}=yield o;!_(i)||(i(a),c=a.channelToken,y()&&(console.info("Info: showUI parameter is ignored on mobile, open URL directly"),window.open(a.url,"_blank")),u=this.utils.createJsonRpcRequestPayload("farcaster_show_QR",[{data:b({showUI:t},a)}]),this.request(u))}),s===A.DONE&&m(this,null,function*(){let{data:a}=yield p;a.state==="completed"&&(this.createIntermediaryEvent(f.FarcasterLoginEventEmit.SuccessSignIn,u.id)({channel_token:c,message:a.message,signature:a.signature,fid:a.fid,username:a.username}),D(i)&&i(a))}),s===A.ERROR&&p.catch(a=>{i(a)}),r)};return r}}}; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
"use strict";var d=Object.defineProperty;var I=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames,R=Object.getOwnPropertySymbols;var E=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable;var C=(n,e,t)=>e in n?d(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,b=(n,e)=>{for(var t in e||(e={}))E.call(e,t)&&C(n,t,e[t]);if(R)for(var t of R(e))v.call(e,t)&&C(n,t,e[t]);return n};var w=(n,e)=>{for(var t in e)d(n,t,{get:e[t],enumerable:!0})},P=(n,e,t,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of k(e))!E.call(n,o)&&o!==t&&d(n,o,{get:()=>e[o],enumerable:!(l=I(e,o))||l.enumerable});return n};var L=n=>P(d({},"__esModule",{value:!0}),n);var m=(n,e,t)=>new Promise((l,o)=>{var p=r=>{try{c(t.next(r))}catch(s){o(s)}},u=r=>{try{c(t.throw(r))}catch(s){o(s)}},c=r=>r.done?l(r.value):Promise.resolve(r.value).then(p,u);c((t=t.apply(n,e)).next())});var q={};w(q,{FarcasterExtension:()=>g});module.exports=L(q);var f=require("@magic-sdk/commons"),h=require("@farcaster/auth-client");function S(){return typeof navigator!="undefined"&&/android/i.test(navigator.userAgent)}function T(){return typeof navigator!="undefined"&&/iPhone|iPod/.test(navigator.userAgent)}function x(){return typeof navigator!="undefined"&&(/iPad/.test(navigator.userAgent)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)}function U(){return T()||x()}function y(){return S()||U()}var A={CHANNEL:"channel",DONE:"done",ERROR:"error"},_=n=>typeof n=="function",D=n=>typeof n=="function",H="https://relay.farcaster.xyz",F="https://example.com/login",O=6e4,N=500,g=class extends f.Extension.Internal{constructor(){super(...arguments);this.name="farcaster";this.config={};this.login=({showUI:t})=>{let l=(0,h.createAppClient)({relay:H,ethereum:(0,h.viemConnector)()}),o=l.createChannel({siweUri:F,domain:window.location.host}),p=o.then(({data:s})=>l.watchStatus({channelToken:s.channelToken,timeout:O,interval:N}).then(i=>{if(i.isError)throw i.error;return i})),u,c,r={on:(s,i)=>(s==="channel"&&m(this,null,function*(){let{data:a}=yield o;if(!!_(i)){if(i(a),c=a.channelToken,y()){console.info("Info: showUI parameter is ignored on mobile, open URL directly"),window.open(a.url,"_blank");return}u=this.utils.createJsonRpcRequestPayload("farcaster_show_QR",[{data:b({showUI:t},a)}]),this.request(u)}}),s===A.DONE&&m(this,null,function*(){let{data:a}=yield p;a.state==="completed"&&(this.createIntermediaryEvent(f.FarcasterLoginEventEmit.SuccessSignIn,u.id)({channel_token:c,message:a.message,signature:a.signature,fid:a.fid,username:a.username}),D(i)&&i(a))}),s===A.ERROR&&p.catch(a=>{i(a)}),r)};return r}}}; | ||
"use strict";var d=Object.defineProperty;var I=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames,R=Object.getOwnPropertySymbols;var E=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable;var C=(n,e,t)=>e in n?d(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,b=(n,e)=>{for(var t in e||(e={}))E.call(e,t)&&C(n,t,e[t]);if(R)for(var t of R(e))v.call(e,t)&&C(n,t,e[t]);return n};var w=(n,e)=>{for(var t in e)d(n,t,{get:e[t],enumerable:!0})},P=(n,e,t,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of k(e))!E.call(n,o)&&o!==t&&d(n,o,{get:()=>e[o],enumerable:!(l=I(e,o))||l.enumerable});return n};var L=n=>P(d({},"__esModule",{value:!0}),n);var m=(n,e,t)=>new Promise((l,o)=>{var p=r=>{try{c(t.next(r))}catch(s){o(s)}},u=r=>{try{c(t.throw(r))}catch(s){o(s)}},c=r=>r.done?l(r.value):Promise.resolve(r.value).then(p,u);c((t=t.apply(n,e)).next())});var q={};w(q,{FarcasterExtension:()=>g});module.exports=L(q);var f=require("@magic-sdk/commons"),h=require("@farcaster/auth-client");function S(){return typeof navigator!="undefined"&&/android/i.test(navigator.userAgent)}function T(){return typeof navigator!="undefined"&&/iPhone|iPod/.test(navigator.userAgent)}function x(){return typeof navigator!="undefined"&&(/iPad/.test(navigator.userAgent)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)}function U(){return T()||x()}function y(){return S()||U()}var A={CHANNEL:"channel",DONE:"done",ERROR:"error"},_=n=>typeof n=="function",D=n=>typeof n=="function",H="https://relay.farcaster.xyz",F="https://example.com/login",O=6e4,N=500,g=class extends f.Extension.Internal{constructor(){super(...arguments);this.name="farcaster";this.config={};this.login=({showUI:t})=>{let l=(0,h.createAppClient)({relay:H,ethereum:(0,h.viemConnector)()}),o=l.createChannel({siweUri:F,domain:window.location.host}),p=o.then(({data:s})=>l.watchStatus({channelToken:s.channelToken,timeout:O,interval:N}).then(i=>{if(i.isError)throw i.error;return i})),u,c,r={on:(s,i)=>(s==="channel"&&m(this,null,function*(){let{data:a}=yield o;!_(i)||(i(a),c=a.channelToken,y()&&(console.info("Info: showUI parameter is ignored on mobile, open URL directly"),window.open(a.url,"_blank")),u=this.utils.createJsonRpcRequestPayload("farcaster_show_QR",[{data:b({showUI:t},a)}]),this.request(u))}),s===A.DONE&&m(this,null,function*(){let{data:a}=yield p;a.state==="completed"&&(this.createIntermediaryEvent(f.FarcasterLoginEventEmit.SuccessSignIn,u.id)({channel_token:c,message:a.message,signature:a.signature,fid:a.fid,username:a.username}),D(i)&&i(a))}),s===A.ERROR&&p.catch(a=>{i(a)}),r)};return r}}}; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
var E=Object.defineProperty;var f=Object.getOwnPropertySymbols;var b=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable;var h=(n,t,e)=>t in n?E(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,m=(n,t)=>{for(var e in t||(t={}))b.call(t,e)&&h(n,e,t[e]);if(f)for(var e of f(t))y.call(t,e)&&h(n,e,t[e]);return n};var d=(n,t,e)=>new Promise((u,l)=>{var p=o=>{try{i(e.next(o))}catch(r){l(r)}},c=o=>{try{i(e.throw(o))}catch(r){l(r)}},i=o=>o.done?u(o.value):Promise.resolve(o.value).then(p,c);i((e=e.apply(n,t)).next())});import{Extension as w,FarcasterLoginEventEmit as P}from"@magic-sdk/commons";import{createAppClient as L,viemConnector as S}from"@farcaster/auth-client";function A(){return typeof navigator!="undefined"&&/android/i.test(navigator.userAgent)}function I(){return typeof navigator!="undefined"&&/iPhone|iPod/.test(navigator.userAgent)}function k(){return typeof navigator!="undefined"&&(/iPad/.test(navigator.userAgent)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)}function v(){return I()||k()}function g(){return A()||v()}var R={CHANNEL:"channel",DONE:"done",ERROR:"error"},T=n=>typeof n=="function",x=n=>typeof n=="function",U="https://relay.farcaster.xyz",_="https://example.com/login",D=6e4,H=500,C=class extends w.Internal{constructor(){super(...arguments);this.name="farcaster";this.config={};this.login=({showUI:e})=>{let u=L({relay:U,ethereum:S()}),l=u.createChannel({siweUri:_,domain:window.location.host}),p=l.then(({data:r})=>u.watchStatus({channelToken:r.channelToken,timeout:D,interval:H}).then(s=>{if(s.isError)throw s.error;return s})),c,i,o={on:(r,s)=>(r==="channel"&&d(this,null,function*(){let{data:a}=yield l;if(!!T(s)){if(s(a),i=a.channelToken,g()){console.info("Info: showUI parameter is ignored on mobile, open URL directly"),window.open(a.url,"_blank");return}c=this.utils.createJsonRpcRequestPayload("farcaster_show_QR",[{data:m({showUI:e},a)}]),this.request(c)}}),r===R.DONE&&d(this,null,function*(){let{data:a}=yield p;a.state==="completed"&&(this.createIntermediaryEvent(P.SuccessSignIn,c.id)({channel_token:i,message:a.message,signature:a.signature,fid:a.fid,username:a.username}),x(s)&&s(a))}),r===R.ERROR&&p.catch(a=>{s(a)}),o)};return o}}};export{C as FarcasterExtension}; | ||
var E=Object.defineProperty;var f=Object.getOwnPropertySymbols;var b=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable;var h=(n,t,e)=>t in n?E(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,m=(n,t)=>{for(var e in t||(t={}))b.call(t,e)&&h(n,e,t[e]);if(f)for(var e of f(t))y.call(t,e)&&h(n,e,t[e]);return n};var d=(n,t,e)=>new Promise((u,l)=>{var p=o=>{try{i(e.next(o))}catch(r){l(r)}},c=o=>{try{i(e.throw(o))}catch(r){l(r)}},i=o=>o.done?u(o.value):Promise.resolve(o.value).then(p,c);i((e=e.apply(n,t)).next())});import{Extension as w,FarcasterLoginEventEmit as P}from"@magic-sdk/commons";import{createAppClient as L,viemConnector as S}from"@farcaster/auth-client";function A(){return typeof navigator!="undefined"&&/android/i.test(navigator.userAgent)}function I(){return typeof navigator!="undefined"&&/iPhone|iPod/.test(navigator.userAgent)}function k(){return typeof navigator!="undefined"&&(/iPad/.test(navigator.userAgent)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)}function v(){return I()||k()}function g(){return A()||v()}var R={CHANNEL:"channel",DONE:"done",ERROR:"error"},T=n=>typeof n=="function",x=n=>typeof n=="function",U="https://relay.farcaster.xyz",_="https://example.com/login",D=6e4,H=500,C=class extends w.Internal{constructor(){super(...arguments);this.name="farcaster";this.config={};this.login=({showUI:e})=>{let u=L({relay:U,ethereum:S()}),l=u.createChannel({siweUri:_,domain:window.location.host}),p=l.then(({data:r})=>u.watchStatus({channelToken:r.channelToken,timeout:D,interval:H}).then(s=>{if(s.isError)throw s.error;return s})),c,i,o={on:(r,s)=>(r==="channel"&&d(this,null,function*(){let{data:a}=yield l;!T(s)||(s(a),i=a.channelToken,g()&&(console.info("Info: showUI parameter is ignored on mobile, open URL directly"),window.open(a.url,"_blank")),c=this.utils.createJsonRpcRequestPayload("farcaster_show_QR",[{data:m({showUI:e},a)}]),this.request(c))}),r===R.DONE&&d(this,null,function*(){let{data:a}=yield p;a.state==="completed"&&(this.createIntermediaryEvent(P.SuccessSignIn,c.id)({channel_token:i,message:a.message,signature:a.signature,fid:a.fid,username:a.username}),x(s)&&s(a))}),r===R.ERROR&&p.catch(a=>{s(a)}),o)};return o}}};export{C as FarcasterExtension}; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@magic-ext/farcaster", | ||
"version": "0.0.3-canary.742.9605940540.0", | ||
"version": "0.0.3-canary.752.9614914380.0", | ||
"description": "magic farcaster extension", | ||
@@ -35,3 +35,3 @@ "author": "Magic <team@magic.link> (https://magic.link/)", | ||
"devDependencies": { | ||
"@magic-sdk/commons": "24.0.7-canary.742.9605940540.0" | ||
"@magic-sdk/commons": "^24.0.5" | ||
}, | ||
@@ -43,3 +43,3 @@ "dependencies": { | ||
}, | ||
"gitHead": "df15115c2d0830f096ea3599393f7bce543b8d82" | ||
"gitHead": "a96bb1101be185a71fc742cb5a521091c19e47c9" | ||
} |
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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
958083