@magic-sdk/types 24.0.1 → 24.0.2-canary.742.8791105617.0
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/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +3 -3
- package/dist/es/index.js +1 -1
- package/dist/es/index.js.map +3 -3
- package/dist/es/index.mjs +1 -1
- package/dist/es/index.mjs.map +3 -3
- package/dist/types/core/json-rpc-types.d.ts +3 -2
- package/dist/types/modules/intermediary-types.d.ts +2 -1
- package/package.json +2 -2
package/dist/cjs/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var p=Object.defineProperty;var
|
|
1
|
+
"use strict";var p=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var G=Object.prototype.hasOwnProperty;var V=(s,i)=>{for(var r in i)p(s,r,{get:i[r],enumerable:!0})},H=(s,i,r,n)=>{if(i&&typeof i=="object"||typeof i=="function")for(let a of D(i))!G.call(s,a)&&a!==r&&p(s,a,{get:()=>i[a],enumerable:!(n=y(i,a))||n.enumerable});return s};var F=s=>H(p({},"__esModule",{value:!0}),s);var J={};V(J,{DeepLinkPage:()=>N,DeviceVerificationEventEmit:()=>h,DeviceVerificationEventOnReceived:()=>O,EthChainType:()=>w,LoginWithEmailOTPEventEmit:()=>R,LoginWithEmailOTPEventOnReceived:()=>T,LoginWithMagicLinkEventEmit:()=>I,LoginWithMagicLinkEventOnReceived:()=>A,MagicIncomingWindowMessage:()=>g,MagicOutgoingWindowMessage:()=>x,MagicPayloadMethod:()=>d,RPCErrorCode:()=>v,RecencyCheckEventEmit:()=>U,RecencyCheckEventOnReceived:()=>L,RecoveryMethodType:()=>b,SDKErrorCode:()=>_,SDKWarningCode:()=>u,ThirdPartyWalletEvents:()=>f,UpdateEmailEventEmit:()=>k,UpdateEmailEventOnReceived:()=>S,Wallets:()=>E});module.exports=F(J);var _=(o=>(o.MissingApiKey="MISSING_API_KEY",o.ModalNotReady="MODAL_NOT_READY",o.MalformedResponse="MALFORMED_RESPONSE",o.InvalidArgument="INVALID_ARGUMENT",o.ExtensionNotInitialized="EXTENSION_NOT_INITIALIZED",o.IncompatibleExtensions="INCOMPATIBLE_EXTENSIONS",o))(_||{}),u=(c=>(c.SyncWeb3Method="SYNC_WEB3_METHOD",c.DuplicateIframe="DUPLICATE_IFRAME",c.ReactNativeEndpointConfiguration="REACT_NATIVE_ENDPOINT_CONFIGURATION",c.DeprecationNotice="DEPRECATION_NOTICE",c.ProductAnnouncement="ANNOUNCEMENT",c))(u||{}),v=(t=>(t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError",t[t.MagicLinkFailedVerification=-1e4]="MagicLinkFailedVerification",t[t.MagicLinkExpired=-10001]="MagicLinkExpired",t[t.MagicLinkRateLimited=-10002]="MagicLinkRateLimited",t[t.MagicLinkInvalidRedirectURL=-10006]="MagicLinkInvalidRedirectURL",t[t.UserAlreadyLoggedIn=-10003]="UserAlreadyLoggedIn",t[t.UpdateEmailFailed=-10004]="UpdateEmailFailed",t[t.UserRequestEditEmail=-10005]="UserRequestEditEmail",t[t.InactiveRecipient=-10010]="InactiveRecipient",t[t.AccessDeniedToUser=-10011]="AccessDeniedToUser",t[t.RedirectLoginComplete=-10015]="RedirectLoginComplete",t))(v||{});var E=(r=>(r.MetaMask="metamask",r.CoinbaseWallet="coinbase_wallet",r))(E||{}),f=(a=>(a.WalletSelected="wallet_selected",a.WalletConnected="wallet_connected",a.WalletRejected="wallet_rejected",a.Web3ModalSelected="web3modal_selected",a))(f||{}),d=(e=>(e.LoginWithSms="magic_auth_login_with_sms",e.LoginWithEmailOTP="magic_auth_login_with_email_otp",e.LoginWithMagicLink="magic_auth_login_with_magic_link",e.LoginWithCredential="magic_auth_login_with_credential",e.SetAuthorizationToken="magic_auth_set_authorization_token",e.GetIdToken="magic_auth_get_id_token",e.GenerateIdToken="magic_auth_generate_id_token",e.GetMetadata="magic_auth_get_metadata",e.IsLoggedIn="magic_is_logged_in",e.Logout="magic_auth_logout",e.UpdateEmail="magic_auth_update_email",e.UserSettings="magic_auth_settings",e.UserSettingsTestMode="magic_auth_settings_testing_mode",e.LoginWithSmsTestMode="magic_auth_login_with_sms_testing_mode",e.LoginWithEmailOTPTestMode="magic_auth_login_with_email_otp_testing_mode",e.LoginWithMagicLinkTestMode="magic_login_with_magic_link_testing_mode",e.LoginWithCredentialTestMode="magic_auth_login_with_credential_testing_mode",e.GetIdTokenTestMode="magic_auth_get_id_token_testing_mode",e.GenerateIdTokenTestMode="magic_auth_generate_id_token_testing_mode",e.GetMetadataTestMode="magic_auth_get_metadata_testing_mode",e.IsLoggedInTestMode="magic_auth_is_logged_in_testing_mode",e.LogoutTestMode="magic_auth_logout_testing_mode",e.UpdateEmailTestMode="magic_auth_update_email_testing_mode",e.IntermediaryEvent="magic_intermediary_event",e.RequestAccounts="eth_requestAccounts",e.GetInfo="magic_get_info",e.ShowUI="magic_wallet",e.NFTPurchase="magic_nft_purchase",e.NFTCheckout="magic_nft_checkout",e.NFTTransfer="magic_nft_transfer",e.RequestUserInfoWithUI="mc_request_user_info",e.Disconnect="mc_disconnect",e.RecoverAccount="magic_auth_recover_account",e.RecoverAccountTestMode="magic_auth_recover_account_testing_mode",e.MagicBoxHeartBeat="magic_box_heart_beat",e.AutoConnect="mc_auto_connect",e.Login="mc_login",e.EncryptV1="magic_auth_encrypt_v1",e.DecryptV1="magic_auth_decrypt_v1",e.ShowNFTs="magic_show_nfts",e.ShowOnRamp="magic_show_fiat_onramp",e.ShowSendTokensUI="magic_show_send_tokens_ui",e.ShowAddress="magic_show_address",e.ShowBalances="magic_show_balances",e.SendGaslessTransaction="eth_sendGaslessTransaction",e.RevealPK="magic_reveal_key",e))(d||{});var g=(l=>(l.MAGIC_HANDLE_RESPONSE="MAGIC_HANDLE_RESPONSE",l.MAGIC_OVERLAY_READY="MAGIC_OVERLAY_READY",l.MAGIC_SHOW_OVERLAY="MAGIC_SHOW_OVERLAY",l.MAGIC_HIDE_OVERLAY="MAGIC_HIDE_OVERLAY",l.MAGIC_HANDLE_EVENT="MAGIC_HANDLE_EVENT",l.MAGIC_MG_BOX_SEND_RECEIPT="MAGIC_MG_BOX_SEND_RECEIPT",l.MAGIC_SEND_PRODUCT_ANNOUNCEMENT="MAGIC_SEND_PRODUCT_ANNOUNCEMENT",l))(g||{}),x=(i=>(i.MAGIC_HANDLE_REQUEST="MAGIC_HANDLE_REQUEST",i))(x||{});var N=(n=>(n.UpdateEmail="update-email",n.MFA="mfa",n.Recovery="recovery",n))(N||{});var I=(i=>(i.Retry="retry",i))(I||{}),A=(r=>(r.EmailSent="email-sent",r.EmailNotDeliverable="email-not-deliverable",r))(A||{}),R=(r=>(r.VerifyEmailOtp="verify-email-otp",r.Cancel="cancel",r))(R||{}),T=(n=>(n.EmailOTPSent="email-otp-sent",n.InvalidEmailOtp="invalid-email-otp",n.ExpiredEmailOtp="expired-email-otp",n))(T||{}),h=(i=>(i.Retry="device-retry",i))(h||{}),O=(a=>(a.DeviceApproved="device-approved",a.DeviceNeedsApproval="device-needs-approval",a.DeviceVerificationLinkExpired="device-verification-link-expired",a.DeviceVerificationEmailSent="device-verification-email-sent",a))(O||{}),U=(n=>(n.Retry="Recency/auth-factor-retry",n.Cancel="Recency/auth-factor-verification-cancel",n.VerifyEmailOtp="Recency/auth-factor-verify-email-otp",n))(U||{}),L=(o=>(o.PrimaryAuthFactorNeedsVerification="Recency/auth-factor-needs-verification",o.PrimaryAuthFactorVerified="Recency/auth-factor-verified",o.InvalidEmailOtp="Recency/auth-factor-invalid-email-otp",o.EmailExpired="Recency/auth-factor-verification-email-expired",o.EmailSent="Recency/auth-factor-verification-email-sent",o.EmailNotDeliverable="Recency/auth-factor-verification-email-not-deliverable",o))(L||{}),k=(n=>(n.RetryWithNewEmail="UpdateEmail/retry-with-new-email",n.Cancel="UpdateEmail/new-email-verification-cancel",n.VerifyEmailOtp="UpdateEmail/new-email-verify-otp",n))(k||{}),S=(m=>(m.NewAuthFactorNeedsVerification="UpdateEmail/new-email-needs-verification",m.EmailUpdated="UpdateEmail/email-updated",m.InvalidEmailOtp="UpdateEmail/new-email-invalid-email-otp",m.EmailExpired="UpdateEmail/new-email-verification-email-expired",m.EmailSent="UpdateEmail/new-email-verification-email-sent",m.EmailNotDeliverable="UpdateEmail/new-email-verification-email-not-deliverable",m.InvalidEmail="UpdateEmail/new-email-invalid",m.EmailAlreadyExists="UpdateEmail/new-email-already-exists",m))(S||{});var w=(i=>(i.Harmony="HARMONY",i))(w||{});var b=(i=>(i.PhoneNumber="phone_number",i))(b||{});
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts", "../../src/core/exception-types.ts", "../../src/core/json-rpc-types.ts", "../../src/core/message-types.ts", "../../src/core/deep-link-pages.ts", "../../src/modules/auth-types.ts", "../../src/modules/rpc-provider-types.ts", "../../src/modules/user-types.ts"],
|
|
4
|
-
"sourcesContent": ["// Only re-export types that are intended for the public API from this file.\n// Deprecate test API key in v7.0.0\n\nexport * from './core/exception-types';\nexport * from './core/i18n';\nexport * from './core/json-rpc-types';\nexport * from './core/message-types';\nexport * from './core/query-types';\nexport * from './core/deep-link-pages';\n\nexport * from './modules/auth-types';\nexport * from './modules/rpc-provider-types';\nexport * from './modules/user-types';\nexport * from './modules/intermediary-types';\nexport * from './modules/nft-types';\nexport * from './modules/wallet-types';\n", "export enum SDKErrorCode {\n MissingApiKey = 'MISSING_API_KEY',\n ModalNotReady = 'MODAL_NOT_READY',\n MalformedResponse = 'MALFORMED_RESPONSE',\n InvalidArgument = 'INVALID_ARGUMENT',\n ExtensionNotInitialized = 'EXTENSION_NOT_INITIALIZED',\n IncompatibleExtensions = 'INCOMPATIBLE_EXTENSIONS',\n}\n\nexport enum SDKWarningCode {\n SyncWeb3Method = 'SYNC_WEB3_METHOD',\n DuplicateIframe = 'DUPLICATE_IFRAME',\n ReactNativeEndpointConfiguration = 'REACT_NATIVE_ENDPOINT_CONFIGURATION',\n DeprecationNotice = 'DEPRECATION_NOTICE',\n ProductAnnouncement = 'ANNOUNCEMENT',\n}\n\nexport enum RPCErrorCode {\n // Standard JSON RPC 2.0 Error Codes\n ParseError = -32700,\n InvalidRequest = -32600,\n MethodNotFound = -32601,\n InvalidParams = -32602,\n InternalError = -32603,\n\n // Custom RPC Error Codes\n MagicLinkFailedVerification = -10000,\n MagicLinkExpired = -10001,\n MagicLinkRateLimited = -10002,\n MagicLinkInvalidRedirectURL = -10006,\n UserAlreadyLoggedIn = -10003,\n UpdateEmailFailed = -10004,\n UserRequestEditEmail = -10005,\n InactiveRecipient = -10010,\n AccessDeniedToUser = -10011,\n RedirectLoginComplete = -10015,\n}\n\nexport type ErrorCode = SDKErrorCode | RPCErrorCode;\nexport type WarningCode = SDKWarningCode;\n", "import { RPCErrorCode } from './exception-types';\n\n// --- Request interfaces\n\nexport interface JsonRpcRequestPayload<TParams = any> {\n jsonrpc: string;\n id: string | number | null;\n method: string;\n params?: TParams;\n}\n\nexport interface JsonRpcRequestCallback {\n /** Callback executed upon JSON RPC response. */\n (err: JsonRpcError | null, result?: JsonRpcResponsePayload | null): void;\n}\n\nexport interface JsonRpcBatchRequestCallback {\n /** Callback executed upon JSON RPC response. */\n (err: JsonRpcError | null, result?: (JsonRpcResponsePayload | null)[] | null): void;\n}\n\n// --- Response interfaces\n\nexport interface JsonRpcError {\n message: string;\n code: RPCErrorCode;\n data?: any;\n}\n\nexport interface JsonRpcResponsePayload<ResultType = any> {\n jsonrpc: string;\n id: string | number | null;\n result?: ResultType | null;\n error?: JsonRpcError | null;\n}\n\nexport interface UserInfo {\n email?: string;\n}\n\nexport interface WalletInfo {\n walletType: 'magic' | 'metamask' | 'coinbase_wallet';\n}\n\nexport interface RequestUserInfoScope {\n scope?: {\n email?: 'required' | 'optional';\n };\n}\n\nexport enum Wallets {\n MetaMask = 'metamask',\n CoinbaseWallet = 'coinbase_wallet',\n}\n\nexport enum Events {\n WalletSelected = 'wallet_selected',\n WalletConnected = 'wallet_connected',\n WalletRejected = 'wallet_rejected',\n}\n\nexport interface UserEnv {\n env: {\n isMetaMaskInstalled: boolean;\n isCoinbaseWalletInstalled: boolean;\n };\n}\n\n// --- Payload methods\n\n/**\n * Enum of JSON RPC methods for interacting with the Magic SDK authentication\n * relayer.\n */\nexport enum MagicPayloadMethod {\n LoginWithSms = 'magic_auth_login_with_sms',\n LoginWithEmailOTP = 'magic_auth_login_with_email_otp',\n LoginWithMagicLink = 'magic_auth_login_with_magic_link',\n LoginWithCredential = 'magic_auth_login_with_credential',\n SetAuthorizationToken = 'magic_auth_set_authorization_token',\n GetIdToken = 'magic_auth_get_id_token',\n GenerateIdToken = 'magic_auth_generate_id_token',\n GetMetadata = 'magic_auth_get_metadata',\n IsLoggedIn = 'magic_is_logged_in',\n Logout = 'magic_auth_logout',\n UpdateEmail = 'magic_auth_update_email',\n UserSettings = 'magic_auth_settings',\n UserSettingsTestMode = 'magic_auth_settings_testing_mode',\n LoginWithSmsTestMode = 'magic_auth_login_with_sms_testing_mode',\n LoginWithEmailOTPTestMode = 'magic_auth_login_with_email_otp_testing_mode',\n LoginWithMagicLinkTestMode = 'magic_login_with_magic_link_testing_mode',\n LoginWithCredentialTestMode = 'magic_auth_login_with_credential_testing_mode',\n GetIdTokenTestMode = 'magic_auth_get_id_token_testing_mode',\n GenerateIdTokenTestMode = 'magic_auth_generate_id_token_testing_mode',\n GetMetadataTestMode = 'magic_auth_get_metadata_testing_mode',\n IsLoggedInTestMode = 'magic_auth_is_logged_in_testing_mode',\n LogoutTestMode = 'magic_auth_logout_testing_mode',\n UpdateEmailTestMode = 'magic_auth_update_email_testing_mode',\n IntermediaryEvent = 'magic_intermediary_event',\n RequestAccounts = 'eth_requestAccounts',\n GetInfo = 'magic_get_info',\n ShowUI = 'magic_wallet',\n NFTPurchase = 'magic_nft_purchase',\n NFTCheckout = 'magic_nft_checkout',\n NFTTransfer = 'magic_nft_transfer',\n RequestUserInfoWithUI = 'mc_request_user_info',\n Disconnect = 'mc_disconnect',\n // UpdatePhoneNumber = 'magic_auth_update_phone_number',\n // UpdatePhoneNumberTestMode = 'magic_auth_update_phone_number_testing_mode',\n RecoverAccount = 'magic_auth_recover_account',\n RecoverAccountTestMode = 'magic_auth_recover_account_testing_mode',\n MagicBoxHeartBeat = 'magic_box_heart_beat',\n AutoConnect = 'mc_auto_connect',\n Login = 'mc_login',\n EncryptV1 = 'magic_auth_encrypt_v1',\n DecryptV1 = 'magic_auth_decrypt_v1',\n ShowNFTs = 'magic_show_nfts',\n ShowOnRamp = 'magic_show_fiat_onramp',\n ShowSendTokensUI = 'magic_show_send_tokens_ui',\n ShowAddress = 'magic_show_address',\n ShowBalances = 'magic_show_balances',\n SendGaslessTransaction = 'eth_sendGaslessTransaction',\n RevealPK = 'magic_reveal_key',\n}\n", "import { JsonRpcResponsePayload, JsonRpcError, JsonRpcRequestPayload } from './json-rpc-types';\n\nexport enum MagicIncomingWindowMessage {\n MAGIC_HANDLE_RESPONSE = 'MAGIC_HANDLE_RESPONSE',\n MAGIC_OVERLAY_READY = 'MAGIC_OVERLAY_READY',\n MAGIC_SHOW_OVERLAY = 'MAGIC_SHOW_OVERLAY',\n MAGIC_HIDE_OVERLAY = 'MAGIC_HIDE_OVERLAY',\n MAGIC_HANDLE_EVENT = 'MAGIC_HANDLE_EVENT',\n MAGIC_MG_BOX_SEND_RECEIPT = 'MAGIC_MG_BOX_SEND_RECEIPT',\n MAGIC_SEND_PRODUCT_ANNOUNCEMENT = 'MAGIC_SEND_PRODUCT_ANNOUNCEMENT',\n}\n\nexport enum MagicOutgoingWindowMessage {\n MAGIC_HANDLE_REQUEST = 'MAGIC_HANDLE_REQUEST',\n}\n\n/** The shape of responding window message datas from the Magic iframe context. */\nexport interface MagicMessageRequest {\n msgType: string;\n payload: JsonRpcRequestPayload | JsonRpcRequestPayload[];\n rt?: string;\n jwt?: string;\n deviceShare?: string;\n}\n\n/** The shape of responding window message datas from the Magic iframe context. */\nexport interface MagicMessageResponse<ResultType = any> {\n msgType: string;\n response: Partial<JsonRpcError> & Partial<JsonRpcResponsePayload<ResultType>>;\n rt?: string;\n deviceShare?: string;\n}\n\n/** The expected message event returned by the Magic iframe context. */\nexport interface MagicMessageEvent extends Partial<MessageEvent> {\n data: MagicMessageResponse;\n}\n", "export enum DeepLinkPage {\n UpdateEmail = 'update-email',\n MFA = 'mfa',\n Recovery = 'recovery',\n}\n", "export interface LoginWithMagicLinkConfiguration {\n /**\n * The email address of the user attempting to login.\n */\n email: string;\n\n /**\n * When `true`, a pre-built modal interface will show to the user, directing\n * them to check their email for the \"magic link\" to complete their\n * authentication.\n */\n showUI?: boolean;\n\n /**\n * You can optionally provide a redirect URI that will be followed at the end\n * of the magic link flow. Don't forget to invoke\n * `magic.auth.loginWithCredential()` to complete the login from the route you\n * configure here.\n */\n redirectURI?: string;\n\n /**\n * Enterprise users with a custom SMTP can create custom email templates\n * from their dashboard. The default Magic loginWithMagicLink email will be\n * overriden when a variation is passed here.\n */\n overrides?: {\n variation?: string;\n };\n}\n\nexport interface LoginWithSmsConfiguration {\n /**\n * Specify the phone number of the user attempting to login.\n */\n phoneNumber: string;\n}\nexport interface LoginWithEmailOTPConfiguration {\n /**\n * Specify the email address of the user attempting to login.\n */\n email: string;\n\n /**\n * When `true`, a pre-built modal interface will show to the user, directing\n * them to check their email for the one time passcode (OTP) to complete their\n * authentication.\n *\n * When `false`, developers will be able to implement their own custom UI to\n * continue the email OTP flow.\n */\n showUI?: boolean;\n\n /**\n * Device Unrecognized UI will enforce showing up to secure user's login\n *\n * When set to true (default), an improved device recognition UI will be displayed to the user,\n * prompting them to verify their login by checking their email for device approval. This feature\n * enhances authentication security.\n *\n * This param will only be affect if showUI is false. When set to false,\n * developers have the flexibility to implement their own customized UI to\n * handle device check events, providing a more tailored user experience.\n */\n deviceCheckUI?: boolean;\n\n /**\n * Enterprise users with a custom SMTP can create custom email templates\n * from their dashboard. The default Magic loginWithOTP email will be\n * overriden when a variation is passed here.\n */\n overrides?: {\n variation?: string;\n };\n}\n\n/**\n * EventHandlers\n */\nexport type LoginWithMagicLinkEventHandlers = {\n // Event Received\n [LoginWithMagicLinkEventOnReceived.EmailSent]: () => void;\n [LoginWithMagicLinkEventOnReceived.EmailNotDeliverable]: () => void;\n\n // Event sent\n [LoginWithMagicLinkEventEmit.Retry]: () => void;\n} & DeviceVerificationEventHandlers;\n\nexport type LoginWithEmailOTPEventHandlers = {\n // Event Received\n [LoginWithEmailOTPEventOnReceived.EmailOTPSent]: () => void;\n [LoginWithEmailOTPEventOnReceived.InvalidEmailOtp]: () => void;\n [LoginWithEmailOTPEventOnReceived.ExpiredEmailOtp]: () => void;\n\n // Event sent\n [LoginWithEmailOTPEventEmit.VerifyEmailOtp]: (otp: string) => void;\n [LoginWithEmailOTPEventEmit.Cancel]: () => void;\n} & DeviceVerificationEventHandlers;\n\ntype DeviceVerificationEventHandlers = {\n // Event Received\n [DeviceVerificationEventOnReceived.DeviceNeedsApproval]: () => void;\n [DeviceVerificationEventOnReceived.DeviceVerificationEmailSent]: () => void;\n [DeviceVerificationEventOnReceived.DeviceVerificationLinkExpired]: () => void;\n [DeviceVerificationEventOnReceived.DeviceApproved]: () => void;\n\n // Event sent\n [DeviceVerificationEventEmit.Retry]: () => void;\n};\n\n/**\n * Auth Events Enum\n */\nexport enum LoginWithMagicLinkEventEmit {\n Retry = 'retry',\n}\n\nexport enum LoginWithMagicLinkEventOnReceived {\n EmailSent = 'email-sent',\n EmailNotDeliverable = 'email-not-deliverable',\n}\n\nexport enum LoginWithEmailOTPEventEmit {\n VerifyEmailOtp = 'verify-email-otp',\n Cancel = 'cancel',\n}\n\nexport enum LoginWithEmailOTPEventOnReceived {\n EmailOTPSent = 'email-otp-sent',\n InvalidEmailOtp = 'invalid-email-otp',\n ExpiredEmailOtp = 'expired-email-otp',\n}\n\nexport enum DeviceVerificationEventEmit {\n Retry = 'device-retry',\n}\n\nexport enum DeviceVerificationEventOnReceived {\n DeviceApproved = 'device-approved',\n DeviceNeedsApproval = 'device-needs-approval',\n DeviceVerificationLinkExpired = 'device-verification-link-expired',\n DeviceVerificationEmailSent = 'device-verification-email-sent',\n}\n\n/**\n * Update Email\n */\n\ntype RecencyCheckEventHandlers = {\n [RecencyCheckEventOnReceived.PrimaryAuthFactorNeedsVerification]: () => void;\n [RecencyCheckEventOnReceived.PrimaryAuthFactorVerified]: () => void;\n [RecencyCheckEventOnReceived.InvalidEmailOtp]: () => void;\n [RecencyCheckEventOnReceived.EmailNotDeliverable]: () => void;\n [RecencyCheckEventOnReceived.EmailExpired]: () => void;\n [RecencyCheckEventOnReceived.EmailSent]: () => void;\n\n [RecencyCheckEventEmit.Cancel]: () => void;\n [RecencyCheckEventEmit.Retry]: () => void;\n [RecencyCheckEventEmit.VerifyEmailOtp]: (otp: string) => void;\n};\n\nexport type UpdateEmailEventHandlers = {\n [UpdateEmailEventOnReceived.NewAuthFactorNeedsVerification]: () => void;\n [UpdateEmailEventOnReceived.EmailUpdated]: () => void;\n [UpdateEmailEventOnReceived.InvalidEmailOtp]: () => void;\n [UpdateEmailEventOnReceived.EmailNotDeliverable]: () => void;\n [UpdateEmailEventOnReceived.EmailExpired]: () => void;\n [UpdateEmailEventOnReceived.EmailSent]: () => void;\n [UpdateEmailEventOnReceived.InvalidEmail]: () => void;\n [UpdateEmailEventOnReceived.EmailAlreadyExists]: () => void;\n\n [UpdateEmailEventEmit.Cancel]: () => void;\n [UpdateEmailEventEmit.RetryWithNewEmail]: (email?: string) => void;\n [UpdateEmailEventEmit.VerifyEmailOtp]: (otp: string) => void;\n} & RecencyCheckEventHandlers;\n\nexport enum RecencyCheckEventEmit {\n Retry = 'Recency/auth-factor-retry',\n Cancel = 'Recency/auth-factor-verification-cancel',\n VerifyEmailOtp = 'Recency/auth-factor-verify-email-otp',\n}\n\nexport enum RecencyCheckEventOnReceived {\n PrimaryAuthFactorNeedsVerification = 'Recency/auth-factor-needs-verification',\n PrimaryAuthFactorVerified = 'Recency/auth-factor-verified',\n InvalidEmailOtp = 'Recency/auth-factor-invalid-email-otp',\n EmailExpired = 'Recency/auth-factor-verification-email-expired',\n EmailSent = 'Recency/auth-factor-verification-email-sent',\n EmailNotDeliverable = 'Recency/auth-factor-verification-email-not-deliverable',\n}\n\nexport enum UpdateEmailEventEmit {\n RetryWithNewEmail = 'UpdateEmail/retry-with-new-email',\n Cancel = 'UpdateEmail/new-email-verification-cancel',\n VerifyEmailOtp = 'UpdateEmail/new-email-verify-otp',\n}\n\nexport enum UpdateEmailEventOnReceived {\n NewAuthFactorNeedsVerification = 'UpdateEmail/new-email-needs-verification',\n EmailUpdated = 'UpdateEmail/email-updated',\n InvalidEmailOtp = 'UpdateEmail/new-email-invalid-email-otp',\n EmailExpired = 'UpdateEmail/new-email-verification-email-expired',\n EmailSent = 'UpdateEmail/new-email-verification-email-sent',\n EmailNotDeliverable = 'UpdateEmail/new-email-verification-email-not-deliverable',\n InvalidEmail = 'UpdateEmail/new-email-invalid',\n EmailAlreadyExists = 'UpdateEmail/new-email-already-exists',\n}\n", "export type EthNetworkName = 'mainnet' | 'goerli' | 'sepolia';\n\nexport enum EthChainType {\n Harmony = 'HARMONY',\n}\n\nexport interface CustomNodeConfiguration {\n rpcUrl: string;\n chainId?: number;\n chainType?: EthChainType;\n}\n\nexport type EthNetworkConfiguration = EthNetworkName | CustomNodeConfiguration;\n\nexport type ProviderEnableEvents = {\n 'id-token-created': (params: { idToken: string }) => void;\n};\n", "import { DeepLinkPage } from '../core/deep-link-pages';\n\nexport interface GetIdTokenConfiguration {\n /**\n * The number of seconds until the generated ID token will expire.\n */\n lifespan?: number;\n}\n\nexport interface GenerateIdTokenConfiguration extends GetIdTokenConfiguration {\n /**\n * An optional piece of data to sign with the token. Note, however, that the\n * unsigned data _will not_ be encoded in the token, only an encrypted\n * signature of the data.\n */\n attachment?: string;\n}\n\nexport interface MagicUserMetadata {\n issuer: string | null;\n publicAddress: string | null;\n email: string | null;\n phoneNumber: string | null;\n isMfaEnabled: boolean;\n recoveryFactors: [RecoveryFactor];\n}\n\ntype RecoveryFactor = {\n type: RecoveryMethodType;\n value: string;\n};\n\nexport enum RecoveryMethodType {\n PhoneNumber = 'phone_number',\n}\n\nexport interface UpdateEmailConfiguration {\n /**\n * The new email address to update to\n */\n email: string;\n\n /**\n * When `true`, a pre-built pending modal interface will\n * guide the user to check their new, followed by old emails\n * for confirmation emails.\n */\n showUI?: boolean;\n}\n\nexport interface UpdateWebAuthnInfoConfiguration {\n /**\n * WebAuthn info id\n */\n id: string;\n\n /**\n * nickname that user attempts to update to the webauth device associate to the id.\n */\n nickname: string;\n}\n\nexport interface RecoverAccountConfiguration {\n /**\n * The email to recover\n */\n email: string;\n}\n\nexport interface ShowSettingsConfiguration {\n /**\n * deep linking destination\n */\n page: DeepLinkPage;\n}\n"],
|
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,kBAAAE,EAAA,gCAAAC,EAAA,sCAAAC,EAAA,iBAAAC,EAAA
|
|
6
|
-
"names": ["src_exports", "__export", "DeepLinkPage", "DeviceVerificationEventEmit", "DeviceVerificationEventOnReceived", "EthChainType", "
|
|
4
|
+
"sourcesContent": ["// Only re-export types that are intended for the public API from this file.\n// Deprecate test API key in v7.0.0\n\nexport * from './core/exception-types';\nexport * from './core/i18n';\nexport * from './core/json-rpc-types';\nexport * from './core/message-types';\nexport * from './core/query-types';\nexport * from './core/deep-link-pages';\n\nexport * from './modules/auth-types';\nexport * from './modules/rpc-provider-types';\nexport * from './modules/user-types';\nexport * from './modules/intermediary-types';\nexport * from './modules/nft-types';\nexport * from './modules/wallet-types';\n", "export enum SDKErrorCode {\n MissingApiKey = 'MISSING_API_KEY',\n ModalNotReady = 'MODAL_NOT_READY',\n MalformedResponse = 'MALFORMED_RESPONSE',\n InvalidArgument = 'INVALID_ARGUMENT',\n ExtensionNotInitialized = 'EXTENSION_NOT_INITIALIZED',\n IncompatibleExtensions = 'INCOMPATIBLE_EXTENSIONS',\n}\n\nexport enum SDKWarningCode {\n SyncWeb3Method = 'SYNC_WEB3_METHOD',\n DuplicateIframe = 'DUPLICATE_IFRAME',\n ReactNativeEndpointConfiguration = 'REACT_NATIVE_ENDPOINT_CONFIGURATION',\n DeprecationNotice = 'DEPRECATION_NOTICE',\n ProductAnnouncement = 'ANNOUNCEMENT',\n}\n\nexport enum RPCErrorCode {\n // Standard JSON RPC 2.0 Error Codes\n ParseError = -32700,\n InvalidRequest = -32600,\n MethodNotFound = -32601,\n InvalidParams = -32602,\n InternalError = -32603,\n\n // Custom RPC Error Codes\n MagicLinkFailedVerification = -10000,\n MagicLinkExpired = -10001,\n MagicLinkRateLimited = -10002,\n MagicLinkInvalidRedirectURL = -10006,\n UserAlreadyLoggedIn = -10003,\n UpdateEmailFailed = -10004,\n UserRequestEditEmail = -10005,\n InactiveRecipient = -10010,\n AccessDeniedToUser = -10011,\n RedirectLoginComplete = -10015,\n}\n\nexport type ErrorCode = SDKErrorCode | RPCErrorCode;\nexport type WarningCode = SDKWarningCode;\n", "import { RPCErrorCode } from './exception-types';\n\n// --- Request interfaces\n\nexport interface JsonRpcRequestPayload<TParams = any> {\n jsonrpc: string;\n id: string | number | null;\n method: string;\n params?: TParams;\n}\n\nexport interface JsonRpcRequestCallback {\n /** Callback executed upon JSON RPC response. */\n (err: JsonRpcError | null, result?: JsonRpcResponsePayload | null): void;\n}\n\nexport interface JsonRpcBatchRequestCallback {\n /** Callback executed upon JSON RPC response. */\n (err: JsonRpcError | null, result?: (JsonRpcResponsePayload | null)[] | null): void;\n}\n\n// --- Response interfaces\n\nexport interface JsonRpcError {\n message: string;\n code: RPCErrorCode;\n data?: any;\n}\n\nexport interface JsonRpcResponsePayload<ResultType = any> {\n jsonrpc: string;\n id: string | number | null;\n result?: ResultType | null;\n error?: JsonRpcError | null;\n}\n\nexport interface UserInfo {\n email?: string;\n}\n\nexport interface WalletInfo {\n walletType: 'magic' | 'metamask' | 'coinbase_wallet';\n}\n\nexport interface RequestUserInfoScope {\n scope?: {\n email?: 'required' | 'optional';\n };\n}\n\nexport enum Wallets {\n MetaMask = 'metamask',\n CoinbaseWallet = 'coinbase_wallet',\n}\n\nexport enum ThirdPartyWalletEvents {\n WalletSelected = 'wallet_selected',\n WalletConnected = 'wallet_connected',\n WalletRejected = 'wallet_rejected',\n Web3ModalSelected = 'web3modal_selected',\n}\n\nexport interface UserEnv {\n env: {\n isMetaMaskInstalled: boolean;\n isCoinbaseWalletInstalled: boolean;\n };\n}\n\n// --- Payload methods\n\n/**\n * Enum of JSON RPC methods for interacting with the Magic SDK authentication\n * relayer.\n */\nexport enum MagicPayloadMethod {\n LoginWithSms = 'magic_auth_login_with_sms',\n LoginWithEmailOTP = 'magic_auth_login_with_email_otp',\n LoginWithMagicLink = 'magic_auth_login_with_magic_link',\n LoginWithCredential = 'magic_auth_login_with_credential',\n SetAuthorizationToken = 'magic_auth_set_authorization_token',\n GetIdToken = 'magic_auth_get_id_token',\n GenerateIdToken = 'magic_auth_generate_id_token',\n GetMetadata = 'magic_auth_get_metadata',\n IsLoggedIn = 'magic_is_logged_in',\n Logout = 'magic_auth_logout',\n UpdateEmail = 'magic_auth_update_email',\n UserSettings = 'magic_auth_settings',\n UserSettingsTestMode = 'magic_auth_settings_testing_mode',\n LoginWithSmsTestMode = 'magic_auth_login_with_sms_testing_mode',\n LoginWithEmailOTPTestMode = 'magic_auth_login_with_email_otp_testing_mode',\n LoginWithMagicLinkTestMode = 'magic_login_with_magic_link_testing_mode',\n LoginWithCredentialTestMode = 'magic_auth_login_with_credential_testing_mode',\n GetIdTokenTestMode = 'magic_auth_get_id_token_testing_mode',\n GenerateIdTokenTestMode = 'magic_auth_generate_id_token_testing_mode',\n GetMetadataTestMode = 'magic_auth_get_metadata_testing_mode',\n IsLoggedInTestMode = 'magic_auth_is_logged_in_testing_mode',\n LogoutTestMode = 'magic_auth_logout_testing_mode',\n UpdateEmailTestMode = 'magic_auth_update_email_testing_mode',\n IntermediaryEvent = 'magic_intermediary_event',\n RequestAccounts = 'eth_requestAccounts',\n GetInfo = 'magic_get_info',\n ShowUI = 'magic_wallet',\n NFTPurchase = 'magic_nft_purchase',\n NFTCheckout = 'magic_nft_checkout',\n NFTTransfer = 'magic_nft_transfer',\n RequestUserInfoWithUI = 'mc_request_user_info',\n Disconnect = 'mc_disconnect',\n // UpdatePhoneNumber = 'magic_auth_update_phone_number',\n // UpdatePhoneNumberTestMode = 'magic_auth_update_phone_number_testing_mode',\n RecoverAccount = 'magic_auth_recover_account',\n RecoverAccountTestMode = 'magic_auth_recover_account_testing_mode',\n MagicBoxHeartBeat = 'magic_box_heart_beat',\n AutoConnect = 'mc_auto_connect',\n Login = 'mc_login',\n EncryptV1 = 'magic_auth_encrypt_v1',\n DecryptV1 = 'magic_auth_decrypt_v1',\n ShowNFTs = 'magic_show_nfts',\n ShowOnRamp = 'magic_show_fiat_onramp',\n ShowSendTokensUI = 'magic_show_send_tokens_ui',\n ShowAddress = 'magic_show_address',\n ShowBalances = 'magic_show_balances',\n SendGaslessTransaction = 'eth_sendGaslessTransaction',\n RevealPK = 'magic_reveal_key',\n}\n", "import { JsonRpcResponsePayload, JsonRpcError, JsonRpcRequestPayload } from './json-rpc-types';\n\nexport enum MagicIncomingWindowMessage {\n MAGIC_HANDLE_RESPONSE = 'MAGIC_HANDLE_RESPONSE',\n MAGIC_OVERLAY_READY = 'MAGIC_OVERLAY_READY',\n MAGIC_SHOW_OVERLAY = 'MAGIC_SHOW_OVERLAY',\n MAGIC_HIDE_OVERLAY = 'MAGIC_HIDE_OVERLAY',\n MAGIC_HANDLE_EVENT = 'MAGIC_HANDLE_EVENT',\n MAGIC_MG_BOX_SEND_RECEIPT = 'MAGIC_MG_BOX_SEND_RECEIPT',\n MAGIC_SEND_PRODUCT_ANNOUNCEMENT = 'MAGIC_SEND_PRODUCT_ANNOUNCEMENT',\n}\n\nexport enum MagicOutgoingWindowMessage {\n MAGIC_HANDLE_REQUEST = 'MAGIC_HANDLE_REQUEST',\n}\n\n/** The shape of responding window message datas from the Magic iframe context. */\nexport interface MagicMessageRequest {\n msgType: string;\n payload: JsonRpcRequestPayload | JsonRpcRequestPayload[];\n rt?: string;\n jwt?: string;\n deviceShare?: string;\n}\n\n/** The shape of responding window message datas from the Magic iframe context. */\nexport interface MagicMessageResponse<ResultType = any> {\n msgType: string;\n response: Partial<JsonRpcError> & Partial<JsonRpcResponsePayload<ResultType>>;\n rt?: string;\n deviceShare?: string;\n}\n\n/** The expected message event returned by the Magic iframe context. */\nexport interface MagicMessageEvent extends Partial<MessageEvent> {\n data: MagicMessageResponse;\n}\n", "export enum DeepLinkPage {\n UpdateEmail = 'update-email',\n MFA = 'mfa',\n Recovery = 'recovery',\n}\n", "export interface LoginWithMagicLinkConfiguration {\n /**\n * The email address of the user attempting to login.\n */\n email: string;\n\n /**\n * When `true`, a pre-built modal interface will show to the user, directing\n * them to check their email for the \"magic link\" to complete their\n * authentication.\n */\n showUI?: boolean;\n\n /**\n * You can optionally provide a redirect URI that will be followed at the end\n * of the magic link flow. Don't forget to invoke\n * `magic.auth.loginWithCredential()` to complete the login from the route you\n * configure here.\n */\n redirectURI?: string;\n\n /**\n * Enterprise users with a custom SMTP can create custom email templates\n * from their dashboard. The default Magic loginWithMagicLink email will be\n * overriden when a variation is passed here.\n */\n overrides?: {\n variation?: string;\n };\n}\n\nexport interface LoginWithSmsConfiguration {\n /**\n * Specify the phone number of the user attempting to login.\n */\n phoneNumber: string;\n}\nexport interface LoginWithEmailOTPConfiguration {\n /**\n * Specify the email address of the user attempting to login.\n */\n email: string;\n\n /**\n * When `true`, a pre-built modal interface will show to the user, directing\n * them to check their email for the one time passcode (OTP) to complete their\n * authentication.\n *\n * When `false`, developers will be able to implement their own custom UI to\n * continue the email OTP flow.\n */\n showUI?: boolean;\n\n /**\n * Device Unrecognized UI will enforce showing up to secure user's login\n *\n * When set to true (default), an improved device recognition UI will be displayed to the user,\n * prompting them to verify their login by checking their email for device approval. This feature\n * enhances authentication security.\n *\n * This param will only be affect if showUI is false. When set to false,\n * developers have the flexibility to implement their own customized UI to\n * handle device check events, providing a more tailored user experience.\n */\n deviceCheckUI?: boolean;\n\n /**\n * Enterprise users with a custom SMTP can create custom email templates\n * from their dashboard. The default Magic loginWithOTP email will be\n * overriden when a variation is passed here.\n */\n overrides?: {\n variation?: string;\n };\n}\n\n/**\n * EventHandlers\n */\nexport type LoginWithMagicLinkEventHandlers = {\n // Event Received\n [LoginWithMagicLinkEventOnReceived.EmailSent]: () => void;\n [LoginWithMagicLinkEventOnReceived.EmailNotDeliverable]: () => void;\n\n // Event sent\n [LoginWithMagicLinkEventEmit.Retry]: () => void;\n} & DeviceVerificationEventHandlers;\n\nexport type LoginWithEmailOTPEventHandlers = {\n // Event Received\n [LoginWithEmailOTPEventOnReceived.EmailOTPSent]: () => void;\n [LoginWithEmailOTPEventOnReceived.InvalidEmailOtp]: () => void;\n [LoginWithEmailOTPEventOnReceived.ExpiredEmailOtp]: () => void;\n\n // Event sent\n [LoginWithEmailOTPEventEmit.VerifyEmailOtp]: (otp: string) => void;\n [LoginWithEmailOTPEventEmit.Cancel]: () => void;\n} & DeviceVerificationEventHandlers;\n\ntype DeviceVerificationEventHandlers = {\n // Event Received\n [DeviceVerificationEventOnReceived.DeviceNeedsApproval]: () => void;\n [DeviceVerificationEventOnReceived.DeviceVerificationEmailSent]: () => void;\n [DeviceVerificationEventOnReceived.DeviceVerificationLinkExpired]: () => void;\n [DeviceVerificationEventOnReceived.DeviceApproved]: () => void;\n\n // Event sent\n [DeviceVerificationEventEmit.Retry]: () => void;\n};\n\n/**\n * Auth Events Enum\n */\nexport enum LoginWithMagicLinkEventEmit {\n Retry = 'retry',\n}\n\nexport enum LoginWithMagicLinkEventOnReceived {\n EmailSent = 'email-sent',\n EmailNotDeliverable = 'email-not-deliverable',\n}\n\nexport enum LoginWithEmailOTPEventEmit {\n VerifyEmailOtp = 'verify-email-otp',\n Cancel = 'cancel',\n}\n\nexport enum LoginWithEmailOTPEventOnReceived {\n EmailOTPSent = 'email-otp-sent',\n InvalidEmailOtp = 'invalid-email-otp',\n ExpiredEmailOtp = 'expired-email-otp',\n}\n\nexport enum DeviceVerificationEventEmit {\n Retry = 'device-retry',\n}\n\nexport enum DeviceVerificationEventOnReceived {\n DeviceApproved = 'device-approved',\n DeviceNeedsApproval = 'device-needs-approval',\n DeviceVerificationLinkExpired = 'device-verification-link-expired',\n DeviceVerificationEmailSent = 'device-verification-email-sent',\n}\n\n/**\n * Update Email\n */\n\ntype RecencyCheckEventHandlers = {\n [RecencyCheckEventOnReceived.PrimaryAuthFactorNeedsVerification]: () => void;\n [RecencyCheckEventOnReceived.PrimaryAuthFactorVerified]: () => void;\n [RecencyCheckEventOnReceived.InvalidEmailOtp]: () => void;\n [RecencyCheckEventOnReceived.EmailNotDeliverable]: () => void;\n [RecencyCheckEventOnReceived.EmailExpired]: () => void;\n [RecencyCheckEventOnReceived.EmailSent]: () => void;\n\n [RecencyCheckEventEmit.Cancel]: () => void;\n [RecencyCheckEventEmit.Retry]: () => void;\n [RecencyCheckEventEmit.VerifyEmailOtp]: (otp: string) => void;\n};\n\nexport type UpdateEmailEventHandlers = {\n [UpdateEmailEventOnReceived.NewAuthFactorNeedsVerification]: () => void;\n [UpdateEmailEventOnReceived.EmailUpdated]: () => void;\n [UpdateEmailEventOnReceived.InvalidEmailOtp]: () => void;\n [UpdateEmailEventOnReceived.EmailNotDeliverable]: () => void;\n [UpdateEmailEventOnReceived.EmailExpired]: () => void;\n [UpdateEmailEventOnReceived.EmailSent]: () => void;\n [UpdateEmailEventOnReceived.InvalidEmail]: () => void;\n [UpdateEmailEventOnReceived.EmailAlreadyExists]: () => void;\n\n [UpdateEmailEventEmit.Cancel]: () => void;\n [UpdateEmailEventEmit.RetryWithNewEmail]: (email?: string) => void;\n [UpdateEmailEventEmit.VerifyEmailOtp]: (otp: string) => void;\n} & RecencyCheckEventHandlers;\n\nexport enum RecencyCheckEventEmit {\n Retry = 'Recency/auth-factor-retry',\n Cancel = 'Recency/auth-factor-verification-cancel',\n VerifyEmailOtp = 'Recency/auth-factor-verify-email-otp',\n}\n\nexport enum RecencyCheckEventOnReceived {\n PrimaryAuthFactorNeedsVerification = 'Recency/auth-factor-needs-verification',\n PrimaryAuthFactorVerified = 'Recency/auth-factor-verified',\n InvalidEmailOtp = 'Recency/auth-factor-invalid-email-otp',\n EmailExpired = 'Recency/auth-factor-verification-email-expired',\n EmailSent = 'Recency/auth-factor-verification-email-sent',\n EmailNotDeliverable = 'Recency/auth-factor-verification-email-not-deliverable',\n}\n\nexport enum UpdateEmailEventEmit {\n RetryWithNewEmail = 'UpdateEmail/retry-with-new-email',\n Cancel = 'UpdateEmail/new-email-verification-cancel',\n VerifyEmailOtp = 'UpdateEmail/new-email-verify-otp',\n}\n\nexport enum UpdateEmailEventOnReceived {\n NewAuthFactorNeedsVerification = 'UpdateEmail/new-email-needs-verification',\n EmailUpdated = 'UpdateEmail/email-updated',\n InvalidEmailOtp = 'UpdateEmail/new-email-invalid-email-otp',\n EmailExpired = 'UpdateEmail/new-email-verification-email-expired',\n EmailSent = 'UpdateEmail/new-email-verification-email-sent',\n EmailNotDeliverable = 'UpdateEmail/new-email-verification-email-not-deliverable',\n InvalidEmail = 'UpdateEmail/new-email-invalid',\n EmailAlreadyExists = 'UpdateEmail/new-email-already-exists',\n}\n", "export type EthNetworkName = 'mainnet' | 'goerli' | 'sepolia';\n\nexport enum EthChainType {\n Harmony = 'HARMONY',\n}\n\nexport interface CustomNodeConfiguration {\n rpcUrl: string;\n chainId?: number;\n chainType?: EthChainType;\n}\n\nexport type EthNetworkConfiguration = EthNetworkName | CustomNodeConfiguration;\n\nexport type ProviderEnableEvents = {\n 'id-token-created': (params: { idToken: string }) => void;\n};\n", "import { DeepLinkPage } from '../core/deep-link-pages';\n\nexport interface GetIdTokenConfiguration {\n /**\n * The number of seconds until the generated ID token will expire.\n */\n lifespan?: number;\n}\n\nexport interface GenerateIdTokenConfiguration extends GetIdTokenConfiguration {\n /**\n * An optional piece of data to sign with the token. Note, however, that the\n * unsigned data _will not_ be encoded in the token, only an encrypted\n * signature of the data.\n */\n attachment?: string;\n}\n\nexport interface MagicUserMetadata {\n issuer: string | null;\n publicAddress: string | null;\n email: string | null;\n phoneNumber: string | null;\n isMfaEnabled: boolean;\n recoveryFactors: [RecoveryFactor];\n}\n\ntype RecoveryFactor = {\n type: RecoveryMethodType;\n value: string;\n};\n\nexport enum RecoveryMethodType {\n PhoneNumber = 'phone_number',\n}\n\nexport interface UpdateEmailConfiguration {\n /**\n * The new email address to update to\n */\n email: string;\n\n /**\n * When `true`, a pre-built pending modal interface will\n * guide the user to check their new, followed by old emails\n * for confirmation emails.\n */\n showUI?: boolean;\n}\n\nexport interface UpdateWebAuthnInfoConfiguration {\n /**\n * WebAuthn info id\n */\n id: string;\n\n /**\n * nickname that user attempts to update to the webauth device associate to the id.\n */\n nickname: string;\n}\n\nexport interface RecoverAccountConfiguration {\n /**\n * The email to recover\n */\n email: string;\n}\n\nexport interface ShowSettingsConfiguration {\n /**\n * deep linking destination\n */\n page: DeepLinkPage;\n}\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["src_exports", "__export", "DeepLinkPage", "DeviceVerificationEventEmit", "DeviceVerificationEventOnReceived", "EthChainType", "LoginWithEmailOTPEventEmit", "LoginWithEmailOTPEventOnReceived", "LoginWithMagicLinkEventEmit", "LoginWithMagicLinkEventOnReceived", "MagicIncomingWindowMessage", "MagicOutgoingWindowMessage", "MagicPayloadMethod", "RPCErrorCode", "RecencyCheckEventEmit", "RecencyCheckEventOnReceived", "RecoveryMethodType", "SDKErrorCode", "SDKWarningCode", "ThirdPartyWalletEvents", "UpdateEmailEventEmit", "UpdateEmailEventOnReceived", "Wallets", "__toCommonJS", "SDKErrorCode", "SDKWarningCode", "RPCErrorCode", "Wallets", "ThirdPartyWalletEvents", "MagicPayloadMethod", "MagicIncomingWindowMessage", "MagicOutgoingWindowMessage", "DeepLinkPage", "LoginWithMagicLinkEventEmit", "LoginWithMagicLinkEventOnReceived", "LoginWithEmailOTPEventEmit", "LoginWithEmailOTPEventOnReceived", "DeviceVerificationEventEmit", "DeviceVerificationEventOnReceived", "RecencyCheckEventEmit", "RecencyCheckEventOnReceived", "UpdateEmailEventEmit", "UpdateEmailEventOnReceived", "EthChainType", "RecoveryMethodType"]
|
|
7
7
|
}
|
package/dist/es/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var c=(n=>(n.MissingApiKey="MISSING_API_KEY",n.ModalNotReady="MODAL_NOT_READY",n.MalformedResponse="MALFORMED_RESPONSE",n.InvalidArgument="INVALID_ARGUMENT",n.ExtensionNotInitialized="EXTENSION_NOT_INITIALIZED",n.IncompatibleExtensions="INCOMPATIBLE_EXTENSIONS",n))(c||{}),p=(
|
|
1
|
+
var c=(n=>(n.MissingApiKey="MISSING_API_KEY",n.ModalNotReady="MODAL_NOT_READY",n.MalformedResponse="MALFORMED_RESPONSE",n.InvalidArgument="INVALID_ARGUMENT",n.ExtensionNotInitialized="EXTENSION_NOT_INITIALIZED",n.IncompatibleExtensions="INCOMPATIBLE_EXTENSIONS",n))(c||{}),p=(l=>(l.SyncWeb3Method="SYNC_WEB3_METHOD",l.DuplicateIframe="DUPLICATE_IFRAME",l.ReactNativeEndpointConfiguration="REACT_NATIVE_ENDPOINT_CONFIGURATION",l.DeprecationNotice="DEPRECATION_NOTICE",l.ProductAnnouncement="ANNOUNCEMENT",l))(p||{}),_=(t=>(t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError",t[t.MagicLinkFailedVerification=-1e4]="MagicLinkFailedVerification",t[t.MagicLinkExpired=-10001]="MagicLinkExpired",t[t.MagicLinkRateLimited=-10002]="MagicLinkRateLimited",t[t.MagicLinkInvalidRedirectURL=-10006]="MagicLinkInvalidRedirectURL",t[t.UserAlreadyLoggedIn=-10003]="UserAlreadyLoggedIn",t[t.UpdateEmailFailed=-10004]="UpdateEmailFailed",t[t.UserRequestEditEmail=-10005]="UserRequestEditEmail",t[t.InactiveRecipient=-10010]="InactiveRecipient",t[t.AccessDeniedToUser=-10011]="AccessDeniedToUser",t[t.RedirectLoginComplete=-10015]="RedirectLoginComplete",t))(_||{});var u=(o=>(o.MetaMask="metamask",o.CoinbaseWallet="coinbase_wallet",o))(u||{}),v=(r=>(r.WalletSelected="wallet_selected",r.WalletConnected="wallet_connected",r.WalletRejected="wallet_rejected",r.Web3ModalSelected="web3modal_selected",r))(v||{}),E=(e=>(e.LoginWithSms="magic_auth_login_with_sms",e.LoginWithEmailOTP="magic_auth_login_with_email_otp",e.LoginWithMagicLink="magic_auth_login_with_magic_link",e.LoginWithCredential="magic_auth_login_with_credential",e.SetAuthorizationToken="magic_auth_set_authorization_token",e.GetIdToken="magic_auth_get_id_token",e.GenerateIdToken="magic_auth_generate_id_token",e.GetMetadata="magic_auth_get_metadata",e.IsLoggedIn="magic_is_logged_in",e.Logout="magic_auth_logout",e.UpdateEmail="magic_auth_update_email",e.UserSettings="magic_auth_settings",e.UserSettingsTestMode="magic_auth_settings_testing_mode",e.LoginWithSmsTestMode="magic_auth_login_with_sms_testing_mode",e.LoginWithEmailOTPTestMode="magic_auth_login_with_email_otp_testing_mode",e.LoginWithMagicLinkTestMode="magic_login_with_magic_link_testing_mode",e.LoginWithCredentialTestMode="magic_auth_login_with_credential_testing_mode",e.GetIdTokenTestMode="magic_auth_get_id_token_testing_mode",e.GenerateIdTokenTestMode="magic_auth_generate_id_token_testing_mode",e.GetMetadataTestMode="magic_auth_get_metadata_testing_mode",e.IsLoggedInTestMode="magic_auth_is_logged_in_testing_mode",e.LogoutTestMode="magic_auth_logout_testing_mode",e.UpdateEmailTestMode="magic_auth_update_email_testing_mode",e.IntermediaryEvent="magic_intermediary_event",e.RequestAccounts="eth_requestAccounts",e.GetInfo="magic_get_info",e.ShowUI="magic_wallet",e.NFTPurchase="magic_nft_purchase",e.NFTCheckout="magic_nft_checkout",e.NFTTransfer="magic_nft_transfer",e.RequestUserInfoWithUI="mc_request_user_info",e.Disconnect="mc_disconnect",e.RecoverAccount="magic_auth_recover_account",e.RecoverAccountTestMode="magic_auth_recover_account_testing_mode",e.MagicBoxHeartBeat="magic_box_heart_beat",e.AutoConnect="mc_auto_connect",e.Login="mc_login",e.EncryptV1="magic_auth_encrypt_v1",e.DecryptV1="magic_auth_decrypt_v1",e.ShowNFTs="magic_show_nfts",e.ShowOnRamp="magic_show_fiat_onramp",e.ShowSendTokensUI="magic_show_send_tokens_ui",e.ShowAddress="magic_show_address",e.ShowBalances="magic_show_balances",e.SendGaslessTransaction="eth_sendGaslessTransaction",e.RevealPK="magic_reveal_key",e))(E||{});var f=(s=>(s.MAGIC_HANDLE_RESPONSE="MAGIC_HANDLE_RESPONSE",s.MAGIC_OVERLAY_READY="MAGIC_OVERLAY_READY",s.MAGIC_SHOW_OVERLAY="MAGIC_SHOW_OVERLAY",s.MAGIC_HIDE_OVERLAY="MAGIC_HIDE_OVERLAY",s.MAGIC_HANDLE_EVENT="MAGIC_HANDLE_EVENT",s.MAGIC_MG_BOX_SEND_RECEIPT="MAGIC_MG_BOX_SEND_RECEIPT",s.MAGIC_SEND_PRODUCT_ANNOUNCEMENT="MAGIC_SEND_PRODUCT_ANNOUNCEMENT",s))(f||{}),d=(a=>(a.MAGIC_HANDLE_REQUEST="MAGIC_HANDLE_REQUEST",a))(d||{});var g=(i=>(i.UpdateEmail="update-email",i.MFA="mfa",i.Recovery="recovery",i))(g||{});var x=(a=>(a.Retry="retry",a))(x||{}),N=(o=>(o.EmailSent="email-sent",o.EmailNotDeliverable="email-not-deliverable",o))(N||{}),I=(o=>(o.VerifyEmailOtp="verify-email-otp",o.Cancel="cancel",o))(I||{}),A=(i=>(i.EmailOTPSent="email-otp-sent",i.InvalidEmailOtp="invalid-email-otp",i.ExpiredEmailOtp="expired-email-otp",i))(A||{}),R=(a=>(a.Retry="device-retry",a))(R||{}),T=(r=>(r.DeviceApproved="device-approved",r.DeviceNeedsApproval="device-needs-approval",r.DeviceVerificationLinkExpired="device-verification-link-expired",r.DeviceVerificationEmailSent="device-verification-email-sent",r))(T||{}),h=(i=>(i.Retry="Recency/auth-factor-retry",i.Cancel="Recency/auth-factor-verification-cancel",i.VerifyEmailOtp="Recency/auth-factor-verify-email-otp",i))(h||{}),O=(n=>(n.PrimaryAuthFactorNeedsVerification="Recency/auth-factor-needs-verification",n.PrimaryAuthFactorVerified="Recency/auth-factor-verified",n.InvalidEmailOtp="Recency/auth-factor-invalid-email-otp",n.EmailExpired="Recency/auth-factor-verification-email-expired",n.EmailSent="Recency/auth-factor-verification-email-sent",n.EmailNotDeliverable="Recency/auth-factor-verification-email-not-deliverable",n))(O||{}),U=(i=>(i.RetryWithNewEmail="UpdateEmail/retry-with-new-email",i.Cancel="UpdateEmail/new-email-verification-cancel",i.VerifyEmailOtp="UpdateEmail/new-email-verify-otp",i))(U||{}),L=(m=>(m.NewAuthFactorNeedsVerification="UpdateEmail/new-email-needs-verification",m.EmailUpdated="UpdateEmail/email-updated",m.InvalidEmailOtp="UpdateEmail/new-email-invalid-email-otp",m.EmailExpired="UpdateEmail/new-email-verification-email-expired",m.EmailSent="UpdateEmail/new-email-verification-email-sent",m.EmailNotDeliverable="UpdateEmail/new-email-verification-email-not-deliverable",m.InvalidEmail="UpdateEmail/new-email-invalid",m.EmailAlreadyExists="UpdateEmail/new-email-already-exists",m))(L||{});var k=(a=>(a.Harmony="HARMONY",a))(k||{});var S=(a=>(a.PhoneNumber="phone_number",a))(S||{});export{g as DeepLinkPage,R as DeviceVerificationEventEmit,T as DeviceVerificationEventOnReceived,k as EthChainType,I as LoginWithEmailOTPEventEmit,A as LoginWithEmailOTPEventOnReceived,x as LoginWithMagicLinkEventEmit,N as LoginWithMagicLinkEventOnReceived,f as MagicIncomingWindowMessage,d as MagicOutgoingWindowMessage,E as MagicPayloadMethod,_ as RPCErrorCode,h as RecencyCheckEventEmit,O as RecencyCheckEventOnReceived,S as RecoveryMethodType,c as SDKErrorCode,p as SDKWarningCode,v as ThirdPartyWalletEvents,U as UpdateEmailEventEmit,L as UpdateEmailEventOnReceived,u as Wallets};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/es/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/core/exception-types.ts", "../../src/core/json-rpc-types.ts", "../../src/core/message-types.ts", "../../src/core/deep-link-pages.ts", "../../src/modules/auth-types.ts", "../../src/modules/rpc-provider-types.ts", "../../src/modules/user-types.ts"],
|
|
4
|
-
"sourcesContent": ["export enum SDKErrorCode {\n MissingApiKey = 'MISSING_API_KEY',\n ModalNotReady = 'MODAL_NOT_READY',\n MalformedResponse = 'MALFORMED_RESPONSE',\n InvalidArgument = 'INVALID_ARGUMENT',\n ExtensionNotInitialized = 'EXTENSION_NOT_INITIALIZED',\n IncompatibleExtensions = 'INCOMPATIBLE_EXTENSIONS',\n}\n\nexport enum SDKWarningCode {\n SyncWeb3Method = 'SYNC_WEB3_METHOD',\n DuplicateIframe = 'DUPLICATE_IFRAME',\n ReactNativeEndpointConfiguration = 'REACT_NATIVE_ENDPOINT_CONFIGURATION',\n DeprecationNotice = 'DEPRECATION_NOTICE',\n ProductAnnouncement = 'ANNOUNCEMENT',\n}\n\nexport enum RPCErrorCode {\n // Standard JSON RPC 2.0 Error Codes\n ParseError = -32700,\n InvalidRequest = -32600,\n MethodNotFound = -32601,\n InvalidParams = -32602,\n InternalError = -32603,\n\n // Custom RPC Error Codes\n MagicLinkFailedVerification = -10000,\n MagicLinkExpired = -10001,\n MagicLinkRateLimited = -10002,\n MagicLinkInvalidRedirectURL = -10006,\n UserAlreadyLoggedIn = -10003,\n UpdateEmailFailed = -10004,\n UserRequestEditEmail = -10005,\n InactiveRecipient = -10010,\n AccessDeniedToUser = -10011,\n RedirectLoginComplete = -10015,\n}\n\nexport type ErrorCode = SDKErrorCode | RPCErrorCode;\nexport type WarningCode = SDKWarningCode;\n", "import { RPCErrorCode } from './exception-types';\n\n// --- Request interfaces\n\nexport interface JsonRpcRequestPayload<TParams = any> {\n jsonrpc: string;\n id: string | number | null;\n method: string;\n params?: TParams;\n}\n\nexport interface JsonRpcRequestCallback {\n /** Callback executed upon JSON RPC response. */\n (err: JsonRpcError | null, result?: JsonRpcResponsePayload | null): void;\n}\n\nexport interface JsonRpcBatchRequestCallback {\n /** Callback executed upon JSON RPC response. */\n (err: JsonRpcError | null, result?: (JsonRpcResponsePayload | null)[] | null): void;\n}\n\n// --- Response interfaces\n\nexport interface JsonRpcError {\n message: string;\n code: RPCErrorCode;\n data?: any;\n}\n\nexport interface JsonRpcResponsePayload<ResultType = any> {\n jsonrpc: string;\n id: string | number | null;\n result?: ResultType | null;\n error?: JsonRpcError | null;\n}\n\nexport interface UserInfo {\n email?: string;\n}\n\nexport interface WalletInfo {\n walletType: 'magic' | 'metamask' | 'coinbase_wallet';\n}\n\nexport interface RequestUserInfoScope {\n scope?: {\n email?: 'required' | 'optional';\n };\n}\n\nexport enum Wallets {\n MetaMask = 'metamask',\n CoinbaseWallet = 'coinbase_wallet',\n}\n\nexport enum Events {\n WalletSelected = 'wallet_selected',\n WalletConnected = 'wallet_connected',\n WalletRejected = 'wallet_rejected',\n}\n\nexport interface UserEnv {\n env: {\n isMetaMaskInstalled: boolean;\n isCoinbaseWalletInstalled: boolean;\n };\n}\n\n// --- Payload methods\n\n/**\n * Enum of JSON RPC methods for interacting with the Magic SDK authentication\n * relayer.\n */\nexport enum MagicPayloadMethod {\n LoginWithSms = 'magic_auth_login_with_sms',\n LoginWithEmailOTP = 'magic_auth_login_with_email_otp',\n LoginWithMagicLink = 'magic_auth_login_with_magic_link',\n LoginWithCredential = 'magic_auth_login_with_credential',\n SetAuthorizationToken = 'magic_auth_set_authorization_token',\n GetIdToken = 'magic_auth_get_id_token',\n GenerateIdToken = 'magic_auth_generate_id_token',\n GetMetadata = 'magic_auth_get_metadata',\n IsLoggedIn = 'magic_is_logged_in',\n Logout = 'magic_auth_logout',\n UpdateEmail = 'magic_auth_update_email',\n UserSettings = 'magic_auth_settings',\n UserSettingsTestMode = 'magic_auth_settings_testing_mode',\n LoginWithSmsTestMode = 'magic_auth_login_with_sms_testing_mode',\n LoginWithEmailOTPTestMode = 'magic_auth_login_with_email_otp_testing_mode',\n LoginWithMagicLinkTestMode = 'magic_login_with_magic_link_testing_mode',\n LoginWithCredentialTestMode = 'magic_auth_login_with_credential_testing_mode',\n GetIdTokenTestMode = 'magic_auth_get_id_token_testing_mode',\n GenerateIdTokenTestMode = 'magic_auth_generate_id_token_testing_mode',\n GetMetadataTestMode = 'magic_auth_get_metadata_testing_mode',\n IsLoggedInTestMode = 'magic_auth_is_logged_in_testing_mode',\n LogoutTestMode = 'magic_auth_logout_testing_mode',\n UpdateEmailTestMode = 'magic_auth_update_email_testing_mode',\n IntermediaryEvent = 'magic_intermediary_event',\n RequestAccounts = 'eth_requestAccounts',\n GetInfo = 'magic_get_info',\n ShowUI = 'magic_wallet',\n NFTPurchase = 'magic_nft_purchase',\n NFTCheckout = 'magic_nft_checkout',\n NFTTransfer = 'magic_nft_transfer',\n RequestUserInfoWithUI = 'mc_request_user_info',\n Disconnect = 'mc_disconnect',\n // UpdatePhoneNumber = 'magic_auth_update_phone_number',\n // UpdatePhoneNumberTestMode = 'magic_auth_update_phone_number_testing_mode',\n RecoverAccount = 'magic_auth_recover_account',\n RecoverAccountTestMode = 'magic_auth_recover_account_testing_mode',\n MagicBoxHeartBeat = 'magic_box_heart_beat',\n AutoConnect = 'mc_auto_connect',\n Login = 'mc_login',\n EncryptV1 = 'magic_auth_encrypt_v1',\n DecryptV1 = 'magic_auth_decrypt_v1',\n ShowNFTs = 'magic_show_nfts',\n ShowOnRamp = 'magic_show_fiat_onramp',\n ShowSendTokensUI = 'magic_show_send_tokens_ui',\n ShowAddress = 'magic_show_address',\n ShowBalances = 'magic_show_balances',\n SendGaslessTransaction = 'eth_sendGaslessTransaction',\n RevealPK = 'magic_reveal_key',\n}\n", "import { JsonRpcResponsePayload, JsonRpcError, JsonRpcRequestPayload } from './json-rpc-types';\n\nexport enum MagicIncomingWindowMessage {\n MAGIC_HANDLE_RESPONSE = 'MAGIC_HANDLE_RESPONSE',\n MAGIC_OVERLAY_READY = 'MAGIC_OVERLAY_READY',\n MAGIC_SHOW_OVERLAY = 'MAGIC_SHOW_OVERLAY',\n MAGIC_HIDE_OVERLAY = 'MAGIC_HIDE_OVERLAY',\n MAGIC_HANDLE_EVENT = 'MAGIC_HANDLE_EVENT',\n MAGIC_MG_BOX_SEND_RECEIPT = 'MAGIC_MG_BOX_SEND_RECEIPT',\n MAGIC_SEND_PRODUCT_ANNOUNCEMENT = 'MAGIC_SEND_PRODUCT_ANNOUNCEMENT',\n}\n\nexport enum MagicOutgoingWindowMessage {\n MAGIC_HANDLE_REQUEST = 'MAGIC_HANDLE_REQUEST',\n}\n\n/** The shape of responding window message datas from the Magic iframe context. */\nexport interface MagicMessageRequest {\n msgType: string;\n payload: JsonRpcRequestPayload | JsonRpcRequestPayload[];\n rt?: string;\n jwt?: string;\n deviceShare?: string;\n}\n\n/** The shape of responding window message datas from the Magic iframe context. */\nexport interface MagicMessageResponse<ResultType = any> {\n msgType: string;\n response: Partial<JsonRpcError> & Partial<JsonRpcResponsePayload<ResultType>>;\n rt?: string;\n deviceShare?: string;\n}\n\n/** The expected message event returned by the Magic iframe context. */\nexport interface MagicMessageEvent extends Partial<MessageEvent> {\n data: MagicMessageResponse;\n}\n", "export enum DeepLinkPage {\n UpdateEmail = 'update-email',\n MFA = 'mfa',\n Recovery = 'recovery',\n}\n", "export interface LoginWithMagicLinkConfiguration {\n /**\n * The email address of the user attempting to login.\n */\n email: string;\n\n /**\n * When `true`, a pre-built modal interface will show to the user, directing\n * them to check their email for the \"magic link\" to complete their\n * authentication.\n */\n showUI?: boolean;\n\n /**\n * You can optionally provide a redirect URI that will be followed at the end\n * of the magic link flow. Don't forget to invoke\n * `magic.auth.loginWithCredential()` to complete the login from the route you\n * configure here.\n */\n redirectURI?: string;\n\n /**\n * Enterprise users with a custom SMTP can create custom email templates\n * from their dashboard. The default Magic loginWithMagicLink email will be\n * overriden when a variation is passed here.\n */\n overrides?: {\n variation?: string;\n };\n}\n\nexport interface LoginWithSmsConfiguration {\n /**\n * Specify the phone number of the user attempting to login.\n */\n phoneNumber: string;\n}\nexport interface LoginWithEmailOTPConfiguration {\n /**\n * Specify the email address of the user attempting to login.\n */\n email: string;\n\n /**\n * When `true`, a pre-built modal interface will show to the user, directing\n * them to check their email for the one time passcode (OTP) to complete their\n * authentication.\n *\n * When `false`, developers will be able to implement their own custom UI to\n * continue the email OTP flow.\n */\n showUI?: boolean;\n\n /**\n * Device Unrecognized UI will enforce showing up to secure user's login\n *\n * When set to true (default), an improved device recognition UI will be displayed to the user,\n * prompting them to verify their login by checking their email for device approval. This feature\n * enhances authentication security.\n *\n * This param will only be affect if showUI is false. When set to false,\n * developers have the flexibility to implement their own customized UI to\n * handle device check events, providing a more tailored user experience.\n */\n deviceCheckUI?: boolean;\n\n /**\n * Enterprise users with a custom SMTP can create custom email templates\n * from their dashboard. The default Magic loginWithOTP email will be\n * overriden when a variation is passed here.\n */\n overrides?: {\n variation?: string;\n };\n}\n\n/**\n * EventHandlers\n */\nexport type LoginWithMagicLinkEventHandlers = {\n // Event Received\n [LoginWithMagicLinkEventOnReceived.EmailSent]: () => void;\n [LoginWithMagicLinkEventOnReceived.EmailNotDeliverable]: () => void;\n\n // Event sent\n [LoginWithMagicLinkEventEmit.Retry]: () => void;\n} & DeviceVerificationEventHandlers;\n\nexport type LoginWithEmailOTPEventHandlers = {\n // Event Received\n [LoginWithEmailOTPEventOnReceived.EmailOTPSent]: () => void;\n [LoginWithEmailOTPEventOnReceived.InvalidEmailOtp]: () => void;\n [LoginWithEmailOTPEventOnReceived.ExpiredEmailOtp]: () => void;\n\n // Event sent\n [LoginWithEmailOTPEventEmit.VerifyEmailOtp]: (otp: string) => void;\n [LoginWithEmailOTPEventEmit.Cancel]: () => void;\n} & DeviceVerificationEventHandlers;\n\ntype DeviceVerificationEventHandlers = {\n // Event Received\n [DeviceVerificationEventOnReceived.DeviceNeedsApproval]: () => void;\n [DeviceVerificationEventOnReceived.DeviceVerificationEmailSent]: () => void;\n [DeviceVerificationEventOnReceived.DeviceVerificationLinkExpired]: () => void;\n [DeviceVerificationEventOnReceived.DeviceApproved]: () => void;\n\n // Event sent\n [DeviceVerificationEventEmit.Retry]: () => void;\n};\n\n/**\n * Auth Events Enum\n */\nexport enum LoginWithMagicLinkEventEmit {\n Retry = 'retry',\n}\n\nexport enum LoginWithMagicLinkEventOnReceived {\n EmailSent = 'email-sent',\n EmailNotDeliverable = 'email-not-deliverable',\n}\n\nexport enum LoginWithEmailOTPEventEmit {\n VerifyEmailOtp = 'verify-email-otp',\n Cancel = 'cancel',\n}\n\nexport enum LoginWithEmailOTPEventOnReceived {\n EmailOTPSent = 'email-otp-sent',\n InvalidEmailOtp = 'invalid-email-otp',\n ExpiredEmailOtp = 'expired-email-otp',\n}\n\nexport enum DeviceVerificationEventEmit {\n Retry = 'device-retry',\n}\n\nexport enum DeviceVerificationEventOnReceived {\n DeviceApproved = 'device-approved',\n DeviceNeedsApproval = 'device-needs-approval',\n DeviceVerificationLinkExpired = 'device-verification-link-expired',\n DeviceVerificationEmailSent = 'device-verification-email-sent',\n}\n\n/**\n * Update Email\n */\n\ntype RecencyCheckEventHandlers = {\n [RecencyCheckEventOnReceived.PrimaryAuthFactorNeedsVerification]: () => void;\n [RecencyCheckEventOnReceived.PrimaryAuthFactorVerified]: () => void;\n [RecencyCheckEventOnReceived.InvalidEmailOtp]: () => void;\n [RecencyCheckEventOnReceived.EmailNotDeliverable]: () => void;\n [RecencyCheckEventOnReceived.EmailExpired]: () => void;\n [RecencyCheckEventOnReceived.EmailSent]: () => void;\n\n [RecencyCheckEventEmit.Cancel]: () => void;\n [RecencyCheckEventEmit.Retry]: () => void;\n [RecencyCheckEventEmit.VerifyEmailOtp]: (otp: string) => void;\n};\n\nexport type UpdateEmailEventHandlers = {\n [UpdateEmailEventOnReceived.NewAuthFactorNeedsVerification]: () => void;\n [UpdateEmailEventOnReceived.EmailUpdated]: () => void;\n [UpdateEmailEventOnReceived.InvalidEmailOtp]: () => void;\n [UpdateEmailEventOnReceived.EmailNotDeliverable]: () => void;\n [UpdateEmailEventOnReceived.EmailExpired]: () => void;\n [UpdateEmailEventOnReceived.EmailSent]: () => void;\n [UpdateEmailEventOnReceived.InvalidEmail]: () => void;\n [UpdateEmailEventOnReceived.EmailAlreadyExists]: () => void;\n\n [UpdateEmailEventEmit.Cancel]: () => void;\n [UpdateEmailEventEmit.RetryWithNewEmail]: (email?: string) => void;\n [UpdateEmailEventEmit.VerifyEmailOtp]: (otp: string) => void;\n} & RecencyCheckEventHandlers;\n\nexport enum RecencyCheckEventEmit {\n Retry = 'Recency/auth-factor-retry',\n Cancel = 'Recency/auth-factor-verification-cancel',\n VerifyEmailOtp = 'Recency/auth-factor-verify-email-otp',\n}\n\nexport enum RecencyCheckEventOnReceived {\n PrimaryAuthFactorNeedsVerification = 'Recency/auth-factor-needs-verification',\n PrimaryAuthFactorVerified = 'Recency/auth-factor-verified',\n InvalidEmailOtp = 'Recency/auth-factor-invalid-email-otp',\n EmailExpired = 'Recency/auth-factor-verification-email-expired',\n EmailSent = 'Recency/auth-factor-verification-email-sent',\n EmailNotDeliverable = 'Recency/auth-factor-verification-email-not-deliverable',\n}\n\nexport enum UpdateEmailEventEmit {\n RetryWithNewEmail = 'UpdateEmail/retry-with-new-email',\n Cancel = 'UpdateEmail/new-email-verification-cancel',\n VerifyEmailOtp = 'UpdateEmail/new-email-verify-otp',\n}\n\nexport enum UpdateEmailEventOnReceived {\n NewAuthFactorNeedsVerification = 'UpdateEmail/new-email-needs-verification',\n EmailUpdated = 'UpdateEmail/email-updated',\n InvalidEmailOtp = 'UpdateEmail/new-email-invalid-email-otp',\n EmailExpired = 'UpdateEmail/new-email-verification-email-expired',\n EmailSent = 'UpdateEmail/new-email-verification-email-sent',\n EmailNotDeliverable = 'UpdateEmail/new-email-verification-email-not-deliverable',\n InvalidEmail = 'UpdateEmail/new-email-invalid',\n EmailAlreadyExists = 'UpdateEmail/new-email-already-exists',\n}\n", "export type EthNetworkName = 'mainnet' | 'goerli' | 'sepolia';\n\nexport enum EthChainType {\n Harmony = 'HARMONY',\n}\n\nexport interface CustomNodeConfiguration {\n rpcUrl: string;\n chainId?: number;\n chainType?: EthChainType;\n}\n\nexport type EthNetworkConfiguration = EthNetworkName | CustomNodeConfiguration;\n\nexport type ProviderEnableEvents = {\n 'id-token-created': (params: { idToken: string }) => void;\n};\n", "import { DeepLinkPage } from '../core/deep-link-pages';\n\nexport interface GetIdTokenConfiguration {\n /**\n * The number of seconds until the generated ID token will expire.\n */\n lifespan?: number;\n}\n\nexport interface GenerateIdTokenConfiguration extends GetIdTokenConfiguration {\n /**\n * An optional piece of data to sign with the token. Note, however, that the\n * unsigned data _will not_ be encoded in the token, only an encrypted\n * signature of the data.\n */\n attachment?: string;\n}\n\nexport interface MagicUserMetadata {\n issuer: string | null;\n publicAddress: string | null;\n email: string | null;\n phoneNumber: string | null;\n isMfaEnabled: boolean;\n recoveryFactors: [RecoveryFactor];\n}\n\ntype RecoveryFactor = {\n type: RecoveryMethodType;\n value: string;\n};\n\nexport enum RecoveryMethodType {\n PhoneNumber = 'phone_number',\n}\n\nexport interface UpdateEmailConfiguration {\n /**\n * The new email address to update to\n */\n email: string;\n\n /**\n * When `true`, a pre-built pending modal interface will\n * guide the user to check their new, followed by old emails\n * for confirmation emails.\n */\n showUI?: boolean;\n}\n\nexport interface UpdateWebAuthnInfoConfiguration {\n /**\n * WebAuthn info id\n */\n id: string;\n\n /**\n * nickname that user attempts to update to the webauth device associate to the id.\n */\n nickname: string;\n}\n\nexport interface RecoverAccountConfiguration {\n /**\n * The email to recover\n */\n email: string;\n}\n\nexport interface ShowSettingsConfiguration {\n /**\n * deep linking destination\n */\n page: DeepLinkPage;\n}\n"],
|
|
5
|
-
"mappings": "AAAO,IAAKA,OACVA,EAAA,cAAgB,kBAChBA,EAAA,cAAgB,kBAChBA,EAAA,kBAAoB,qBACpBA,EAAA,gBAAkB,mBAClBA,EAAA,wBAA0B,4BAC1BA,EAAA,uBAAyB,0BANfA,OAAA,IASAC,OACVA,EAAA,eAAiB,mBACjBA,EAAA,gBAAkB,mBAClBA,EAAA,iCAAmC,sCACnCA,EAAA,kBAAoB,qBACpBA,EAAA,oBAAsB,eALZA,OAAA,IAQAC,OAEVA,IAAA,WAAa,QAAb,aACAA,IAAA,eAAiB,QAAjB,iBACAA,IAAA,eAAiB,QAAjB,iBACAA,IAAA,cAAgB,QAAhB,gBACAA,IAAA,cAAgB,QAAhB,gBAGAA,IAAA,4BAA8B,MAA9B,8BACAA,IAAA,iBAAmB,QAAnB,mBACAA,IAAA,qBAAuB,QAAvB,uBACAA,IAAA,4BAA8B,QAA9B,8BACAA,IAAA,oBAAsB,QAAtB,sBACAA,IAAA,kBAAoB,QAApB,oBACAA,IAAA,qBAAuB,QAAvB,uBACAA,IAAA,kBAAoB,QAApB,oBACAA,IAAA,mBAAqB,QAArB,qBACAA,IAAA,sBAAwB,QAAxB,wBAlBUA,OAAA,ICiCL,IAAKC,OACVA,EAAA,SAAW,WACXA,EAAA,eAAiB,kBAFPA,OAAA,IAKAC,OACVA,EAAA,eAAiB,kBACjBA,EAAA,gBAAkB,mBAClBA,EAAA,eAAiB,
|
|
6
|
-
"names": ["SDKErrorCode", "SDKWarningCode", "RPCErrorCode", "Wallets", "
|
|
4
|
+
"sourcesContent": ["export enum SDKErrorCode {\n MissingApiKey = 'MISSING_API_KEY',\n ModalNotReady = 'MODAL_NOT_READY',\n MalformedResponse = 'MALFORMED_RESPONSE',\n InvalidArgument = 'INVALID_ARGUMENT',\n ExtensionNotInitialized = 'EXTENSION_NOT_INITIALIZED',\n IncompatibleExtensions = 'INCOMPATIBLE_EXTENSIONS',\n}\n\nexport enum SDKWarningCode {\n SyncWeb3Method = 'SYNC_WEB3_METHOD',\n DuplicateIframe = 'DUPLICATE_IFRAME',\n ReactNativeEndpointConfiguration = 'REACT_NATIVE_ENDPOINT_CONFIGURATION',\n DeprecationNotice = 'DEPRECATION_NOTICE',\n ProductAnnouncement = 'ANNOUNCEMENT',\n}\n\nexport enum RPCErrorCode {\n // Standard JSON RPC 2.0 Error Codes\n ParseError = -32700,\n InvalidRequest = -32600,\n MethodNotFound = -32601,\n InvalidParams = -32602,\n InternalError = -32603,\n\n // Custom RPC Error Codes\n MagicLinkFailedVerification = -10000,\n MagicLinkExpired = -10001,\n MagicLinkRateLimited = -10002,\n MagicLinkInvalidRedirectURL = -10006,\n UserAlreadyLoggedIn = -10003,\n UpdateEmailFailed = -10004,\n UserRequestEditEmail = -10005,\n InactiveRecipient = -10010,\n AccessDeniedToUser = -10011,\n RedirectLoginComplete = -10015,\n}\n\nexport type ErrorCode = SDKErrorCode | RPCErrorCode;\nexport type WarningCode = SDKWarningCode;\n", "import { RPCErrorCode } from './exception-types';\n\n// --- Request interfaces\n\nexport interface JsonRpcRequestPayload<TParams = any> {\n jsonrpc: string;\n id: string | number | null;\n method: string;\n params?: TParams;\n}\n\nexport interface JsonRpcRequestCallback {\n /** Callback executed upon JSON RPC response. */\n (err: JsonRpcError | null, result?: JsonRpcResponsePayload | null): void;\n}\n\nexport interface JsonRpcBatchRequestCallback {\n /** Callback executed upon JSON RPC response. */\n (err: JsonRpcError | null, result?: (JsonRpcResponsePayload | null)[] | null): void;\n}\n\n// --- Response interfaces\n\nexport interface JsonRpcError {\n message: string;\n code: RPCErrorCode;\n data?: any;\n}\n\nexport interface JsonRpcResponsePayload<ResultType = any> {\n jsonrpc: string;\n id: string | number | null;\n result?: ResultType | null;\n error?: JsonRpcError | null;\n}\n\nexport interface UserInfo {\n email?: string;\n}\n\nexport interface WalletInfo {\n walletType: 'magic' | 'metamask' | 'coinbase_wallet';\n}\n\nexport interface RequestUserInfoScope {\n scope?: {\n email?: 'required' | 'optional';\n };\n}\n\nexport enum Wallets {\n MetaMask = 'metamask',\n CoinbaseWallet = 'coinbase_wallet',\n}\n\nexport enum ThirdPartyWalletEvents {\n WalletSelected = 'wallet_selected',\n WalletConnected = 'wallet_connected',\n WalletRejected = 'wallet_rejected',\n Web3ModalSelected = 'web3modal_selected',\n}\n\nexport interface UserEnv {\n env: {\n isMetaMaskInstalled: boolean;\n isCoinbaseWalletInstalled: boolean;\n };\n}\n\n// --- Payload methods\n\n/**\n * Enum of JSON RPC methods for interacting with the Magic SDK authentication\n * relayer.\n */\nexport enum MagicPayloadMethod {\n LoginWithSms = 'magic_auth_login_with_sms',\n LoginWithEmailOTP = 'magic_auth_login_with_email_otp',\n LoginWithMagicLink = 'magic_auth_login_with_magic_link',\n LoginWithCredential = 'magic_auth_login_with_credential',\n SetAuthorizationToken = 'magic_auth_set_authorization_token',\n GetIdToken = 'magic_auth_get_id_token',\n GenerateIdToken = 'magic_auth_generate_id_token',\n GetMetadata = 'magic_auth_get_metadata',\n IsLoggedIn = 'magic_is_logged_in',\n Logout = 'magic_auth_logout',\n UpdateEmail = 'magic_auth_update_email',\n UserSettings = 'magic_auth_settings',\n UserSettingsTestMode = 'magic_auth_settings_testing_mode',\n LoginWithSmsTestMode = 'magic_auth_login_with_sms_testing_mode',\n LoginWithEmailOTPTestMode = 'magic_auth_login_with_email_otp_testing_mode',\n LoginWithMagicLinkTestMode = 'magic_login_with_magic_link_testing_mode',\n LoginWithCredentialTestMode = 'magic_auth_login_with_credential_testing_mode',\n GetIdTokenTestMode = 'magic_auth_get_id_token_testing_mode',\n GenerateIdTokenTestMode = 'magic_auth_generate_id_token_testing_mode',\n GetMetadataTestMode = 'magic_auth_get_metadata_testing_mode',\n IsLoggedInTestMode = 'magic_auth_is_logged_in_testing_mode',\n LogoutTestMode = 'magic_auth_logout_testing_mode',\n UpdateEmailTestMode = 'magic_auth_update_email_testing_mode',\n IntermediaryEvent = 'magic_intermediary_event',\n RequestAccounts = 'eth_requestAccounts',\n GetInfo = 'magic_get_info',\n ShowUI = 'magic_wallet',\n NFTPurchase = 'magic_nft_purchase',\n NFTCheckout = 'magic_nft_checkout',\n NFTTransfer = 'magic_nft_transfer',\n RequestUserInfoWithUI = 'mc_request_user_info',\n Disconnect = 'mc_disconnect',\n // UpdatePhoneNumber = 'magic_auth_update_phone_number',\n // UpdatePhoneNumberTestMode = 'magic_auth_update_phone_number_testing_mode',\n RecoverAccount = 'magic_auth_recover_account',\n RecoverAccountTestMode = 'magic_auth_recover_account_testing_mode',\n MagicBoxHeartBeat = 'magic_box_heart_beat',\n AutoConnect = 'mc_auto_connect',\n Login = 'mc_login',\n EncryptV1 = 'magic_auth_encrypt_v1',\n DecryptV1 = 'magic_auth_decrypt_v1',\n ShowNFTs = 'magic_show_nfts',\n ShowOnRamp = 'magic_show_fiat_onramp',\n ShowSendTokensUI = 'magic_show_send_tokens_ui',\n ShowAddress = 'magic_show_address',\n ShowBalances = 'magic_show_balances',\n SendGaslessTransaction = 'eth_sendGaslessTransaction',\n RevealPK = 'magic_reveal_key',\n}\n", "import { JsonRpcResponsePayload, JsonRpcError, JsonRpcRequestPayload } from './json-rpc-types';\n\nexport enum MagicIncomingWindowMessage {\n MAGIC_HANDLE_RESPONSE = 'MAGIC_HANDLE_RESPONSE',\n MAGIC_OVERLAY_READY = 'MAGIC_OVERLAY_READY',\n MAGIC_SHOW_OVERLAY = 'MAGIC_SHOW_OVERLAY',\n MAGIC_HIDE_OVERLAY = 'MAGIC_HIDE_OVERLAY',\n MAGIC_HANDLE_EVENT = 'MAGIC_HANDLE_EVENT',\n MAGIC_MG_BOX_SEND_RECEIPT = 'MAGIC_MG_BOX_SEND_RECEIPT',\n MAGIC_SEND_PRODUCT_ANNOUNCEMENT = 'MAGIC_SEND_PRODUCT_ANNOUNCEMENT',\n}\n\nexport enum MagicOutgoingWindowMessage {\n MAGIC_HANDLE_REQUEST = 'MAGIC_HANDLE_REQUEST',\n}\n\n/** The shape of responding window message datas from the Magic iframe context. */\nexport interface MagicMessageRequest {\n msgType: string;\n payload: JsonRpcRequestPayload | JsonRpcRequestPayload[];\n rt?: string;\n jwt?: string;\n deviceShare?: string;\n}\n\n/** The shape of responding window message datas from the Magic iframe context. */\nexport interface MagicMessageResponse<ResultType = any> {\n msgType: string;\n response: Partial<JsonRpcError> & Partial<JsonRpcResponsePayload<ResultType>>;\n rt?: string;\n deviceShare?: string;\n}\n\n/** The expected message event returned by the Magic iframe context. */\nexport interface MagicMessageEvent extends Partial<MessageEvent> {\n data: MagicMessageResponse;\n}\n", "export enum DeepLinkPage {\n UpdateEmail = 'update-email',\n MFA = 'mfa',\n Recovery = 'recovery',\n}\n", "export interface LoginWithMagicLinkConfiguration {\n /**\n * The email address of the user attempting to login.\n */\n email: string;\n\n /**\n * When `true`, a pre-built modal interface will show to the user, directing\n * them to check their email for the \"magic link\" to complete their\n * authentication.\n */\n showUI?: boolean;\n\n /**\n * You can optionally provide a redirect URI that will be followed at the end\n * of the magic link flow. Don't forget to invoke\n * `magic.auth.loginWithCredential()` to complete the login from the route you\n * configure here.\n */\n redirectURI?: string;\n\n /**\n * Enterprise users with a custom SMTP can create custom email templates\n * from their dashboard. The default Magic loginWithMagicLink email will be\n * overriden when a variation is passed here.\n */\n overrides?: {\n variation?: string;\n };\n}\n\nexport interface LoginWithSmsConfiguration {\n /**\n * Specify the phone number of the user attempting to login.\n */\n phoneNumber: string;\n}\nexport interface LoginWithEmailOTPConfiguration {\n /**\n * Specify the email address of the user attempting to login.\n */\n email: string;\n\n /**\n * When `true`, a pre-built modal interface will show to the user, directing\n * them to check their email for the one time passcode (OTP) to complete their\n * authentication.\n *\n * When `false`, developers will be able to implement their own custom UI to\n * continue the email OTP flow.\n */\n showUI?: boolean;\n\n /**\n * Device Unrecognized UI will enforce showing up to secure user's login\n *\n * When set to true (default), an improved device recognition UI will be displayed to the user,\n * prompting them to verify their login by checking their email for device approval. This feature\n * enhances authentication security.\n *\n * This param will only be affect if showUI is false. When set to false,\n * developers have the flexibility to implement their own customized UI to\n * handle device check events, providing a more tailored user experience.\n */\n deviceCheckUI?: boolean;\n\n /**\n * Enterprise users with a custom SMTP can create custom email templates\n * from their dashboard. The default Magic loginWithOTP email will be\n * overriden when a variation is passed here.\n */\n overrides?: {\n variation?: string;\n };\n}\n\n/**\n * EventHandlers\n */\nexport type LoginWithMagicLinkEventHandlers = {\n // Event Received\n [LoginWithMagicLinkEventOnReceived.EmailSent]: () => void;\n [LoginWithMagicLinkEventOnReceived.EmailNotDeliverable]: () => void;\n\n // Event sent\n [LoginWithMagicLinkEventEmit.Retry]: () => void;\n} & DeviceVerificationEventHandlers;\n\nexport type LoginWithEmailOTPEventHandlers = {\n // Event Received\n [LoginWithEmailOTPEventOnReceived.EmailOTPSent]: () => void;\n [LoginWithEmailOTPEventOnReceived.InvalidEmailOtp]: () => void;\n [LoginWithEmailOTPEventOnReceived.ExpiredEmailOtp]: () => void;\n\n // Event sent\n [LoginWithEmailOTPEventEmit.VerifyEmailOtp]: (otp: string) => void;\n [LoginWithEmailOTPEventEmit.Cancel]: () => void;\n} & DeviceVerificationEventHandlers;\n\ntype DeviceVerificationEventHandlers = {\n // Event Received\n [DeviceVerificationEventOnReceived.DeviceNeedsApproval]: () => void;\n [DeviceVerificationEventOnReceived.DeviceVerificationEmailSent]: () => void;\n [DeviceVerificationEventOnReceived.DeviceVerificationLinkExpired]: () => void;\n [DeviceVerificationEventOnReceived.DeviceApproved]: () => void;\n\n // Event sent\n [DeviceVerificationEventEmit.Retry]: () => void;\n};\n\n/**\n * Auth Events Enum\n */\nexport enum LoginWithMagicLinkEventEmit {\n Retry = 'retry',\n}\n\nexport enum LoginWithMagicLinkEventOnReceived {\n EmailSent = 'email-sent',\n EmailNotDeliverable = 'email-not-deliverable',\n}\n\nexport enum LoginWithEmailOTPEventEmit {\n VerifyEmailOtp = 'verify-email-otp',\n Cancel = 'cancel',\n}\n\nexport enum LoginWithEmailOTPEventOnReceived {\n EmailOTPSent = 'email-otp-sent',\n InvalidEmailOtp = 'invalid-email-otp',\n ExpiredEmailOtp = 'expired-email-otp',\n}\n\nexport enum DeviceVerificationEventEmit {\n Retry = 'device-retry',\n}\n\nexport enum DeviceVerificationEventOnReceived {\n DeviceApproved = 'device-approved',\n DeviceNeedsApproval = 'device-needs-approval',\n DeviceVerificationLinkExpired = 'device-verification-link-expired',\n DeviceVerificationEmailSent = 'device-verification-email-sent',\n}\n\n/**\n * Update Email\n */\n\ntype RecencyCheckEventHandlers = {\n [RecencyCheckEventOnReceived.PrimaryAuthFactorNeedsVerification]: () => void;\n [RecencyCheckEventOnReceived.PrimaryAuthFactorVerified]: () => void;\n [RecencyCheckEventOnReceived.InvalidEmailOtp]: () => void;\n [RecencyCheckEventOnReceived.EmailNotDeliverable]: () => void;\n [RecencyCheckEventOnReceived.EmailExpired]: () => void;\n [RecencyCheckEventOnReceived.EmailSent]: () => void;\n\n [RecencyCheckEventEmit.Cancel]: () => void;\n [RecencyCheckEventEmit.Retry]: () => void;\n [RecencyCheckEventEmit.VerifyEmailOtp]: (otp: string) => void;\n};\n\nexport type UpdateEmailEventHandlers = {\n [UpdateEmailEventOnReceived.NewAuthFactorNeedsVerification]: () => void;\n [UpdateEmailEventOnReceived.EmailUpdated]: () => void;\n [UpdateEmailEventOnReceived.InvalidEmailOtp]: () => void;\n [UpdateEmailEventOnReceived.EmailNotDeliverable]: () => void;\n [UpdateEmailEventOnReceived.EmailExpired]: () => void;\n [UpdateEmailEventOnReceived.EmailSent]: () => void;\n [UpdateEmailEventOnReceived.InvalidEmail]: () => void;\n [UpdateEmailEventOnReceived.EmailAlreadyExists]: () => void;\n\n [UpdateEmailEventEmit.Cancel]: () => void;\n [UpdateEmailEventEmit.RetryWithNewEmail]: (email?: string) => void;\n [UpdateEmailEventEmit.VerifyEmailOtp]: (otp: string) => void;\n} & RecencyCheckEventHandlers;\n\nexport enum RecencyCheckEventEmit {\n Retry = 'Recency/auth-factor-retry',\n Cancel = 'Recency/auth-factor-verification-cancel',\n VerifyEmailOtp = 'Recency/auth-factor-verify-email-otp',\n}\n\nexport enum RecencyCheckEventOnReceived {\n PrimaryAuthFactorNeedsVerification = 'Recency/auth-factor-needs-verification',\n PrimaryAuthFactorVerified = 'Recency/auth-factor-verified',\n InvalidEmailOtp = 'Recency/auth-factor-invalid-email-otp',\n EmailExpired = 'Recency/auth-factor-verification-email-expired',\n EmailSent = 'Recency/auth-factor-verification-email-sent',\n EmailNotDeliverable = 'Recency/auth-factor-verification-email-not-deliverable',\n}\n\nexport enum UpdateEmailEventEmit {\n RetryWithNewEmail = 'UpdateEmail/retry-with-new-email',\n Cancel = 'UpdateEmail/new-email-verification-cancel',\n VerifyEmailOtp = 'UpdateEmail/new-email-verify-otp',\n}\n\nexport enum UpdateEmailEventOnReceived {\n NewAuthFactorNeedsVerification = 'UpdateEmail/new-email-needs-verification',\n EmailUpdated = 'UpdateEmail/email-updated',\n InvalidEmailOtp = 'UpdateEmail/new-email-invalid-email-otp',\n EmailExpired = 'UpdateEmail/new-email-verification-email-expired',\n EmailSent = 'UpdateEmail/new-email-verification-email-sent',\n EmailNotDeliverable = 'UpdateEmail/new-email-verification-email-not-deliverable',\n InvalidEmail = 'UpdateEmail/new-email-invalid',\n EmailAlreadyExists = 'UpdateEmail/new-email-already-exists',\n}\n", "export type EthNetworkName = 'mainnet' | 'goerli' | 'sepolia';\n\nexport enum EthChainType {\n Harmony = 'HARMONY',\n}\n\nexport interface CustomNodeConfiguration {\n rpcUrl: string;\n chainId?: number;\n chainType?: EthChainType;\n}\n\nexport type EthNetworkConfiguration = EthNetworkName | CustomNodeConfiguration;\n\nexport type ProviderEnableEvents = {\n 'id-token-created': (params: { idToken: string }) => void;\n};\n", "import { DeepLinkPage } from '../core/deep-link-pages';\n\nexport interface GetIdTokenConfiguration {\n /**\n * The number of seconds until the generated ID token will expire.\n */\n lifespan?: number;\n}\n\nexport interface GenerateIdTokenConfiguration extends GetIdTokenConfiguration {\n /**\n * An optional piece of data to sign with the token. Note, however, that the\n * unsigned data _will not_ be encoded in the token, only an encrypted\n * signature of the data.\n */\n attachment?: string;\n}\n\nexport interface MagicUserMetadata {\n issuer: string | null;\n publicAddress: string | null;\n email: string | null;\n phoneNumber: string | null;\n isMfaEnabled: boolean;\n recoveryFactors: [RecoveryFactor];\n}\n\ntype RecoveryFactor = {\n type: RecoveryMethodType;\n value: string;\n};\n\nexport enum RecoveryMethodType {\n PhoneNumber = 'phone_number',\n}\n\nexport interface UpdateEmailConfiguration {\n /**\n * The new email address to update to\n */\n email: string;\n\n /**\n * When `true`, a pre-built pending modal interface will\n * guide the user to check their new, followed by old emails\n * for confirmation emails.\n */\n showUI?: boolean;\n}\n\nexport interface UpdateWebAuthnInfoConfiguration {\n /**\n * WebAuthn info id\n */\n id: string;\n\n /**\n * nickname that user attempts to update to the webauth device associate to the id.\n */\n nickname: string;\n}\n\nexport interface RecoverAccountConfiguration {\n /**\n * The email to recover\n */\n email: string;\n}\n\nexport interface ShowSettingsConfiguration {\n /**\n * deep linking destination\n */\n page: DeepLinkPage;\n}\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["SDKErrorCode", "SDKWarningCode", "RPCErrorCode", "Wallets", "ThirdPartyWalletEvents", "MagicPayloadMethod", "MagicIncomingWindowMessage", "MagicOutgoingWindowMessage", "DeepLinkPage", "LoginWithMagicLinkEventEmit", "LoginWithMagicLinkEventOnReceived", "LoginWithEmailOTPEventEmit", "LoginWithEmailOTPEventOnReceived", "DeviceVerificationEventEmit", "DeviceVerificationEventOnReceived", "RecencyCheckEventEmit", "RecencyCheckEventOnReceived", "UpdateEmailEventEmit", "UpdateEmailEventOnReceived", "EthChainType", "RecoveryMethodType"]
|
|
7
7
|
}
|
package/dist/es/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var c=(n=>(n.MissingApiKey="MISSING_API_KEY",n.ModalNotReady="MODAL_NOT_READY",n.MalformedResponse="MALFORMED_RESPONSE",n.InvalidArgument="INVALID_ARGUMENT",n.ExtensionNotInitialized="EXTENSION_NOT_INITIALIZED",n.IncompatibleExtensions="INCOMPATIBLE_EXTENSIONS",n))(c||{}),p=(
|
|
1
|
+
var c=(n=>(n.MissingApiKey="MISSING_API_KEY",n.ModalNotReady="MODAL_NOT_READY",n.MalformedResponse="MALFORMED_RESPONSE",n.InvalidArgument="INVALID_ARGUMENT",n.ExtensionNotInitialized="EXTENSION_NOT_INITIALIZED",n.IncompatibleExtensions="INCOMPATIBLE_EXTENSIONS",n))(c||{}),p=(l=>(l.SyncWeb3Method="SYNC_WEB3_METHOD",l.DuplicateIframe="DUPLICATE_IFRAME",l.ReactNativeEndpointConfiguration="REACT_NATIVE_ENDPOINT_CONFIGURATION",l.DeprecationNotice="DEPRECATION_NOTICE",l.ProductAnnouncement="ANNOUNCEMENT",l))(p||{}),_=(t=>(t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError",t[t.MagicLinkFailedVerification=-1e4]="MagicLinkFailedVerification",t[t.MagicLinkExpired=-10001]="MagicLinkExpired",t[t.MagicLinkRateLimited=-10002]="MagicLinkRateLimited",t[t.MagicLinkInvalidRedirectURL=-10006]="MagicLinkInvalidRedirectURL",t[t.UserAlreadyLoggedIn=-10003]="UserAlreadyLoggedIn",t[t.UpdateEmailFailed=-10004]="UpdateEmailFailed",t[t.UserRequestEditEmail=-10005]="UserRequestEditEmail",t[t.InactiveRecipient=-10010]="InactiveRecipient",t[t.AccessDeniedToUser=-10011]="AccessDeniedToUser",t[t.RedirectLoginComplete=-10015]="RedirectLoginComplete",t))(_||{});var u=(o=>(o.MetaMask="metamask",o.CoinbaseWallet="coinbase_wallet",o))(u||{}),v=(r=>(r.WalletSelected="wallet_selected",r.WalletConnected="wallet_connected",r.WalletRejected="wallet_rejected",r.Web3ModalSelected="web3modal_selected",r))(v||{}),E=(e=>(e.LoginWithSms="magic_auth_login_with_sms",e.LoginWithEmailOTP="magic_auth_login_with_email_otp",e.LoginWithMagicLink="magic_auth_login_with_magic_link",e.LoginWithCredential="magic_auth_login_with_credential",e.SetAuthorizationToken="magic_auth_set_authorization_token",e.GetIdToken="magic_auth_get_id_token",e.GenerateIdToken="magic_auth_generate_id_token",e.GetMetadata="magic_auth_get_metadata",e.IsLoggedIn="magic_is_logged_in",e.Logout="magic_auth_logout",e.UpdateEmail="magic_auth_update_email",e.UserSettings="magic_auth_settings",e.UserSettingsTestMode="magic_auth_settings_testing_mode",e.LoginWithSmsTestMode="magic_auth_login_with_sms_testing_mode",e.LoginWithEmailOTPTestMode="magic_auth_login_with_email_otp_testing_mode",e.LoginWithMagicLinkTestMode="magic_login_with_magic_link_testing_mode",e.LoginWithCredentialTestMode="magic_auth_login_with_credential_testing_mode",e.GetIdTokenTestMode="magic_auth_get_id_token_testing_mode",e.GenerateIdTokenTestMode="magic_auth_generate_id_token_testing_mode",e.GetMetadataTestMode="magic_auth_get_metadata_testing_mode",e.IsLoggedInTestMode="magic_auth_is_logged_in_testing_mode",e.LogoutTestMode="magic_auth_logout_testing_mode",e.UpdateEmailTestMode="magic_auth_update_email_testing_mode",e.IntermediaryEvent="magic_intermediary_event",e.RequestAccounts="eth_requestAccounts",e.GetInfo="magic_get_info",e.ShowUI="magic_wallet",e.NFTPurchase="magic_nft_purchase",e.NFTCheckout="magic_nft_checkout",e.NFTTransfer="magic_nft_transfer",e.RequestUserInfoWithUI="mc_request_user_info",e.Disconnect="mc_disconnect",e.RecoverAccount="magic_auth_recover_account",e.RecoverAccountTestMode="magic_auth_recover_account_testing_mode",e.MagicBoxHeartBeat="magic_box_heart_beat",e.AutoConnect="mc_auto_connect",e.Login="mc_login",e.EncryptV1="magic_auth_encrypt_v1",e.DecryptV1="magic_auth_decrypt_v1",e.ShowNFTs="magic_show_nfts",e.ShowOnRamp="magic_show_fiat_onramp",e.ShowSendTokensUI="magic_show_send_tokens_ui",e.ShowAddress="magic_show_address",e.ShowBalances="magic_show_balances",e.SendGaslessTransaction="eth_sendGaslessTransaction",e.RevealPK="magic_reveal_key",e))(E||{});var f=(s=>(s.MAGIC_HANDLE_RESPONSE="MAGIC_HANDLE_RESPONSE",s.MAGIC_OVERLAY_READY="MAGIC_OVERLAY_READY",s.MAGIC_SHOW_OVERLAY="MAGIC_SHOW_OVERLAY",s.MAGIC_HIDE_OVERLAY="MAGIC_HIDE_OVERLAY",s.MAGIC_HANDLE_EVENT="MAGIC_HANDLE_EVENT",s.MAGIC_MG_BOX_SEND_RECEIPT="MAGIC_MG_BOX_SEND_RECEIPT",s.MAGIC_SEND_PRODUCT_ANNOUNCEMENT="MAGIC_SEND_PRODUCT_ANNOUNCEMENT",s))(f||{}),d=(a=>(a.MAGIC_HANDLE_REQUEST="MAGIC_HANDLE_REQUEST",a))(d||{});var g=(i=>(i.UpdateEmail="update-email",i.MFA="mfa",i.Recovery="recovery",i))(g||{});var x=(a=>(a.Retry="retry",a))(x||{}),N=(o=>(o.EmailSent="email-sent",o.EmailNotDeliverable="email-not-deliverable",o))(N||{}),I=(o=>(o.VerifyEmailOtp="verify-email-otp",o.Cancel="cancel",o))(I||{}),A=(i=>(i.EmailOTPSent="email-otp-sent",i.InvalidEmailOtp="invalid-email-otp",i.ExpiredEmailOtp="expired-email-otp",i))(A||{}),R=(a=>(a.Retry="device-retry",a))(R||{}),T=(r=>(r.DeviceApproved="device-approved",r.DeviceNeedsApproval="device-needs-approval",r.DeviceVerificationLinkExpired="device-verification-link-expired",r.DeviceVerificationEmailSent="device-verification-email-sent",r))(T||{}),h=(i=>(i.Retry="Recency/auth-factor-retry",i.Cancel="Recency/auth-factor-verification-cancel",i.VerifyEmailOtp="Recency/auth-factor-verify-email-otp",i))(h||{}),O=(n=>(n.PrimaryAuthFactorNeedsVerification="Recency/auth-factor-needs-verification",n.PrimaryAuthFactorVerified="Recency/auth-factor-verified",n.InvalidEmailOtp="Recency/auth-factor-invalid-email-otp",n.EmailExpired="Recency/auth-factor-verification-email-expired",n.EmailSent="Recency/auth-factor-verification-email-sent",n.EmailNotDeliverable="Recency/auth-factor-verification-email-not-deliverable",n))(O||{}),U=(i=>(i.RetryWithNewEmail="UpdateEmail/retry-with-new-email",i.Cancel="UpdateEmail/new-email-verification-cancel",i.VerifyEmailOtp="UpdateEmail/new-email-verify-otp",i))(U||{}),L=(m=>(m.NewAuthFactorNeedsVerification="UpdateEmail/new-email-needs-verification",m.EmailUpdated="UpdateEmail/email-updated",m.InvalidEmailOtp="UpdateEmail/new-email-invalid-email-otp",m.EmailExpired="UpdateEmail/new-email-verification-email-expired",m.EmailSent="UpdateEmail/new-email-verification-email-sent",m.EmailNotDeliverable="UpdateEmail/new-email-verification-email-not-deliverable",m.InvalidEmail="UpdateEmail/new-email-invalid",m.EmailAlreadyExists="UpdateEmail/new-email-already-exists",m))(L||{});var k=(a=>(a.Harmony="HARMONY",a))(k||{});var S=(a=>(a.PhoneNumber="phone_number",a))(S||{});export{g as DeepLinkPage,R as DeviceVerificationEventEmit,T as DeviceVerificationEventOnReceived,k as EthChainType,I as LoginWithEmailOTPEventEmit,A as LoginWithEmailOTPEventOnReceived,x as LoginWithMagicLinkEventEmit,N as LoginWithMagicLinkEventOnReceived,f as MagicIncomingWindowMessage,d as MagicOutgoingWindowMessage,E as MagicPayloadMethod,_ as RPCErrorCode,h as RecencyCheckEventEmit,O as RecencyCheckEventOnReceived,S as RecoveryMethodType,c as SDKErrorCode,p as SDKWarningCode,v as ThirdPartyWalletEvents,U as UpdateEmailEventEmit,L as UpdateEmailEventOnReceived,u as Wallets};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
package/dist/es/index.mjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/core/exception-types.ts", "../../src/core/json-rpc-types.ts", "../../src/core/message-types.ts", "../../src/core/deep-link-pages.ts", "../../src/modules/auth-types.ts", "../../src/modules/rpc-provider-types.ts", "../../src/modules/user-types.ts"],
|
|
4
|
-
"sourcesContent": ["export enum SDKErrorCode {\n MissingApiKey = 'MISSING_API_KEY',\n ModalNotReady = 'MODAL_NOT_READY',\n MalformedResponse = 'MALFORMED_RESPONSE',\n InvalidArgument = 'INVALID_ARGUMENT',\n ExtensionNotInitialized = 'EXTENSION_NOT_INITIALIZED',\n IncompatibleExtensions = 'INCOMPATIBLE_EXTENSIONS',\n}\n\nexport enum SDKWarningCode {\n SyncWeb3Method = 'SYNC_WEB3_METHOD',\n DuplicateIframe = 'DUPLICATE_IFRAME',\n ReactNativeEndpointConfiguration = 'REACT_NATIVE_ENDPOINT_CONFIGURATION',\n DeprecationNotice = 'DEPRECATION_NOTICE',\n ProductAnnouncement = 'ANNOUNCEMENT',\n}\n\nexport enum RPCErrorCode {\n // Standard JSON RPC 2.0 Error Codes\n ParseError = -32700,\n InvalidRequest = -32600,\n MethodNotFound = -32601,\n InvalidParams = -32602,\n InternalError = -32603,\n\n // Custom RPC Error Codes\n MagicLinkFailedVerification = -10000,\n MagicLinkExpired = -10001,\n MagicLinkRateLimited = -10002,\n MagicLinkInvalidRedirectURL = -10006,\n UserAlreadyLoggedIn = -10003,\n UpdateEmailFailed = -10004,\n UserRequestEditEmail = -10005,\n InactiveRecipient = -10010,\n AccessDeniedToUser = -10011,\n RedirectLoginComplete = -10015,\n}\n\nexport type ErrorCode = SDKErrorCode | RPCErrorCode;\nexport type WarningCode = SDKWarningCode;\n", "import { RPCErrorCode } from './exception-types';\n\n// --- Request interfaces\n\nexport interface JsonRpcRequestPayload<TParams = any> {\n jsonrpc: string;\n id: string | number | null;\n method: string;\n params?: TParams;\n}\n\nexport interface JsonRpcRequestCallback {\n /** Callback executed upon JSON RPC response. */\n (err: JsonRpcError | null, result?: JsonRpcResponsePayload | null): void;\n}\n\nexport interface JsonRpcBatchRequestCallback {\n /** Callback executed upon JSON RPC response. */\n (err: JsonRpcError | null, result?: (JsonRpcResponsePayload | null)[] | null): void;\n}\n\n// --- Response interfaces\n\nexport interface JsonRpcError {\n message: string;\n code: RPCErrorCode;\n data?: any;\n}\n\nexport interface JsonRpcResponsePayload<ResultType = any> {\n jsonrpc: string;\n id: string | number | null;\n result?: ResultType | null;\n error?: JsonRpcError | null;\n}\n\nexport interface UserInfo {\n email?: string;\n}\n\nexport interface WalletInfo {\n walletType: 'magic' | 'metamask' | 'coinbase_wallet';\n}\n\nexport interface RequestUserInfoScope {\n scope?: {\n email?: 'required' | 'optional';\n };\n}\n\nexport enum Wallets {\n MetaMask = 'metamask',\n CoinbaseWallet = 'coinbase_wallet',\n}\n\nexport enum Events {\n WalletSelected = 'wallet_selected',\n WalletConnected = 'wallet_connected',\n WalletRejected = 'wallet_rejected',\n}\n\nexport interface UserEnv {\n env: {\n isMetaMaskInstalled: boolean;\n isCoinbaseWalletInstalled: boolean;\n };\n}\n\n// --- Payload methods\n\n/**\n * Enum of JSON RPC methods for interacting with the Magic SDK authentication\n * relayer.\n */\nexport enum MagicPayloadMethod {\n LoginWithSms = 'magic_auth_login_with_sms',\n LoginWithEmailOTP = 'magic_auth_login_with_email_otp',\n LoginWithMagicLink = 'magic_auth_login_with_magic_link',\n LoginWithCredential = 'magic_auth_login_with_credential',\n SetAuthorizationToken = 'magic_auth_set_authorization_token',\n GetIdToken = 'magic_auth_get_id_token',\n GenerateIdToken = 'magic_auth_generate_id_token',\n GetMetadata = 'magic_auth_get_metadata',\n IsLoggedIn = 'magic_is_logged_in',\n Logout = 'magic_auth_logout',\n UpdateEmail = 'magic_auth_update_email',\n UserSettings = 'magic_auth_settings',\n UserSettingsTestMode = 'magic_auth_settings_testing_mode',\n LoginWithSmsTestMode = 'magic_auth_login_with_sms_testing_mode',\n LoginWithEmailOTPTestMode = 'magic_auth_login_with_email_otp_testing_mode',\n LoginWithMagicLinkTestMode = 'magic_login_with_magic_link_testing_mode',\n LoginWithCredentialTestMode = 'magic_auth_login_with_credential_testing_mode',\n GetIdTokenTestMode = 'magic_auth_get_id_token_testing_mode',\n GenerateIdTokenTestMode = 'magic_auth_generate_id_token_testing_mode',\n GetMetadataTestMode = 'magic_auth_get_metadata_testing_mode',\n IsLoggedInTestMode = 'magic_auth_is_logged_in_testing_mode',\n LogoutTestMode = 'magic_auth_logout_testing_mode',\n UpdateEmailTestMode = 'magic_auth_update_email_testing_mode',\n IntermediaryEvent = 'magic_intermediary_event',\n RequestAccounts = 'eth_requestAccounts',\n GetInfo = 'magic_get_info',\n ShowUI = 'magic_wallet',\n NFTPurchase = 'magic_nft_purchase',\n NFTCheckout = 'magic_nft_checkout',\n NFTTransfer = 'magic_nft_transfer',\n RequestUserInfoWithUI = 'mc_request_user_info',\n Disconnect = 'mc_disconnect',\n // UpdatePhoneNumber = 'magic_auth_update_phone_number',\n // UpdatePhoneNumberTestMode = 'magic_auth_update_phone_number_testing_mode',\n RecoverAccount = 'magic_auth_recover_account',\n RecoverAccountTestMode = 'magic_auth_recover_account_testing_mode',\n MagicBoxHeartBeat = 'magic_box_heart_beat',\n AutoConnect = 'mc_auto_connect',\n Login = 'mc_login',\n EncryptV1 = 'magic_auth_encrypt_v1',\n DecryptV1 = 'magic_auth_decrypt_v1',\n ShowNFTs = 'magic_show_nfts',\n ShowOnRamp = 'magic_show_fiat_onramp',\n ShowSendTokensUI = 'magic_show_send_tokens_ui',\n ShowAddress = 'magic_show_address',\n ShowBalances = 'magic_show_balances',\n SendGaslessTransaction = 'eth_sendGaslessTransaction',\n RevealPK = 'magic_reveal_key',\n}\n", "import { JsonRpcResponsePayload, JsonRpcError, JsonRpcRequestPayload } from './json-rpc-types';\n\nexport enum MagicIncomingWindowMessage {\n MAGIC_HANDLE_RESPONSE = 'MAGIC_HANDLE_RESPONSE',\n MAGIC_OVERLAY_READY = 'MAGIC_OVERLAY_READY',\n MAGIC_SHOW_OVERLAY = 'MAGIC_SHOW_OVERLAY',\n MAGIC_HIDE_OVERLAY = 'MAGIC_HIDE_OVERLAY',\n MAGIC_HANDLE_EVENT = 'MAGIC_HANDLE_EVENT',\n MAGIC_MG_BOX_SEND_RECEIPT = 'MAGIC_MG_BOX_SEND_RECEIPT',\n MAGIC_SEND_PRODUCT_ANNOUNCEMENT = 'MAGIC_SEND_PRODUCT_ANNOUNCEMENT',\n}\n\nexport enum MagicOutgoingWindowMessage {\n MAGIC_HANDLE_REQUEST = 'MAGIC_HANDLE_REQUEST',\n}\n\n/** The shape of responding window message datas from the Magic iframe context. */\nexport interface MagicMessageRequest {\n msgType: string;\n payload: JsonRpcRequestPayload | JsonRpcRequestPayload[];\n rt?: string;\n jwt?: string;\n deviceShare?: string;\n}\n\n/** The shape of responding window message datas from the Magic iframe context. */\nexport interface MagicMessageResponse<ResultType = any> {\n msgType: string;\n response: Partial<JsonRpcError> & Partial<JsonRpcResponsePayload<ResultType>>;\n rt?: string;\n deviceShare?: string;\n}\n\n/** The expected message event returned by the Magic iframe context. */\nexport interface MagicMessageEvent extends Partial<MessageEvent> {\n data: MagicMessageResponse;\n}\n", "export enum DeepLinkPage {\n UpdateEmail = 'update-email',\n MFA = 'mfa',\n Recovery = 'recovery',\n}\n", "export interface LoginWithMagicLinkConfiguration {\n /**\n * The email address of the user attempting to login.\n */\n email: string;\n\n /**\n * When `true`, a pre-built modal interface will show to the user, directing\n * them to check their email for the \"magic link\" to complete their\n * authentication.\n */\n showUI?: boolean;\n\n /**\n * You can optionally provide a redirect URI that will be followed at the end\n * of the magic link flow. Don't forget to invoke\n * `magic.auth.loginWithCredential()` to complete the login from the route you\n * configure here.\n */\n redirectURI?: string;\n\n /**\n * Enterprise users with a custom SMTP can create custom email templates\n * from their dashboard. The default Magic loginWithMagicLink email will be\n * overriden when a variation is passed here.\n */\n overrides?: {\n variation?: string;\n };\n}\n\nexport interface LoginWithSmsConfiguration {\n /**\n * Specify the phone number of the user attempting to login.\n */\n phoneNumber: string;\n}\nexport interface LoginWithEmailOTPConfiguration {\n /**\n * Specify the email address of the user attempting to login.\n */\n email: string;\n\n /**\n * When `true`, a pre-built modal interface will show to the user, directing\n * them to check their email for the one time passcode (OTP) to complete their\n * authentication.\n *\n * When `false`, developers will be able to implement their own custom UI to\n * continue the email OTP flow.\n */\n showUI?: boolean;\n\n /**\n * Device Unrecognized UI will enforce showing up to secure user's login\n *\n * When set to true (default), an improved device recognition UI will be displayed to the user,\n * prompting them to verify their login by checking their email for device approval. This feature\n * enhances authentication security.\n *\n * This param will only be affect if showUI is false. When set to false,\n * developers have the flexibility to implement their own customized UI to\n * handle device check events, providing a more tailored user experience.\n */\n deviceCheckUI?: boolean;\n\n /**\n * Enterprise users with a custom SMTP can create custom email templates\n * from their dashboard. The default Magic loginWithOTP email will be\n * overriden when a variation is passed here.\n */\n overrides?: {\n variation?: string;\n };\n}\n\n/**\n * EventHandlers\n */\nexport type LoginWithMagicLinkEventHandlers = {\n // Event Received\n [LoginWithMagicLinkEventOnReceived.EmailSent]: () => void;\n [LoginWithMagicLinkEventOnReceived.EmailNotDeliverable]: () => void;\n\n // Event sent\n [LoginWithMagicLinkEventEmit.Retry]: () => void;\n} & DeviceVerificationEventHandlers;\n\nexport type LoginWithEmailOTPEventHandlers = {\n // Event Received\n [LoginWithEmailOTPEventOnReceived.EmailOTPSent]: () => void;\n [LoginWithEmailOTPEventOnReceived.InvalidEmailOtp]: () => void;\n [LoginWithEmailOTPEventOnReceived.ExpiredEmailOtp]: () => void;\n\n // Event sent\n [LoginWithEmailOTPEventEmit.VerifyEmailOtp]: (otp: string) => void;\n [LoginWithEmailOTPEventEmit.Cancel]: () => void;\n} & DeviceVerificationEventHandlers;\n\ntype DeviceVerificationEventHandlers = {\n // Event Received\n [DeviceVerificationEventOnReceived.DeviceNeedsApproval]: () => void;\n [DeviceVerificationEventOnReceived.DeviceVerificationEmailSent]: () => void;\n [DeviceVerificationEventOnReceived.DeviceVerificationLinkExpired]: () => void;\n [DeviceVerificationEventOnReceived.DeviceApproved]: () => void;\n\n // Event sent\n [DeviceVerificationEventEmit.Retry]: () => void;\n};\n\n/**\n * Auth Events Enum\n */\nexport enum LoginWithMagicLinkEventEmit {\n Retry = 'retry',\n}\n\nexport enum LoginWithMagicLinkEventOnReceived {\n EmailSent = 'email-sent',\n EmailNotDeliverable = 'email-not-deliverable',\n}\n\nexport enum LoginWithEmailOTPEventEmit {\n VerifyEmailOtp = 'verify-email-otp',\n Cancel = 'cancel',\n}\n\nexport enum LoginWithEmailOTPEventOnReceived {\n EmailOTPSent = 'email-otp-sent',\n InvalidEmailOtp = 'invalid-email-otp',\n ExpiredEmailOtp = 'expired-email-otp',\n}\n\nexport enum DeviceVerificationEventEmit {\n Retry = 'device-retry',\n}\n\nexport enum DeviceVerificationEventOnReceived {\n DeviceApproved = 'device-approved',\n DeviceNeedsApproval = 'device-needs-approval',\n DeviceVerificationLinkExpired = 'device-verification-link-expired',\n DeviceVerificationEmailSent = 'device-verification-email-sent',\n}\n\n/**\n * Update Email\n */\n\ntype RecencyCheckEventHandlers = {\n [RecencyCheckEventOnReceived.PrimaryAuthFactorNeedsVerification]: () => void;\n [RecencyCheckEventOnReceived.PrimaryAuthFactorVerified]: () => void;\n [RecencyCheckEventOnReceived.InvalidEmailOtp]: () => void;\n [RecencyCheckEventOnReceived.EmailNotDeliverable]: () => void;\n [RecencyCheckEventOnReceived.EmailExpired]: () => void;\n [RecencyCheckEventOnReceived.EmailSent]: () => void;\n\n [RecencyCheckEventEmit.Cancel]: () => void;\n [RecencyCheckEventEmit.Retry]: () => void;\n [RecencyCheckEventEmit.VerifyEmailOtp]: (otp: string) => void;\n};\n\nexport type UpdateEmailEventHandlers = {\n [UpdateEmailEventOnReceived.NewAuthFactorNeedsVerification]: () => void;\n [UpdateEmailEventOnReceived.EmailUpdated]: () => void;\n [UpdateEmailEventOnReceived.InvalidEmailOtp]: () => void;\n [UpdateEmailEventOnReceived.EmailNotDeliverable]: () => void;\n [UpdateEmailEventOnReceived.EmailExpired]: () => void;\n [UpdateEmailEventOnReceived.EmailSent]: () => void;\n [UpdateEmailEventOnReceived.InvalidEmail]: () => void;\n [UpdateEmailEventOnReceived.EmailAlreadyExists]: () => void;\n\n [UpdateEmailEventEmit.Cancel]: () => void;\n [UpdateEmailEventEmit.RetryWithNewEmail]: (email?: string) => void;\n [UpdateEmailEventEmit.VerifyEmailOtp]: (otp: string) => void;\n} & RecencyCheckEventHandlers;\n\nexport enum RecencyCheckEventEmit {\n Retry = 'Recency/auth-factor-retry',\n Cancel = 'Recency/auth-factor-verification-cancel',\n VerifyEmailOtp = 'Recency/auth-factor-verify-email-otp',\n}\n\nexport enum RecencyCheckEventOnReceived {\n PrimaryAuthFactorNeedsVerification = 'Recency/auth-factor-needs-verification',\n PrimaryAuthFactorVerified = 'Recency/auth-factor-verified',\n InvalidEmailOtp = 'Recency/auth-factor-invalid-email-otp',\n EmailExpired = 'Recency/auth-factor-verification-email-expired',\n EmailSent = 'Recency/auth-factor-verification-email-sent',\n EmailNotDeliverable = 'Recency/auth-factor-verification-email-not-deliverable',\n}\n\nexport enum UpdateEmailEventEmit {\n RetryWithNewEmail = 'UpdateEmail/retry-with-new-email',\n Cancel = 'UpdateEmail/new-email-verification-cancel',\n VerifyEmailOtp = 'UpdateEmail/new-email-verify-otp',\n}\n\nexport enum UpdateEmailEventOnReceived {\n NewAuthFactorNeedsVerification = 'UpdateEmail/new-email-needs-verification',\n EmailUpdated = 'UpdateEmail/email-updated',\n InvalidEmailOtp = 'UpdateEmail/new-email-invalid-email-otp',\n EmailExpired = 'UpdateEmail/new-email-verification-email-expired',\n EmailSent = 'UpdateEmail/new-email-verification-email-sent',\n EmailNotDeliverable = 'UpdateEmail/new-email-verification-email-not-deliverable',\n InvalidEmail = 'UpdateEmail/new-email-invalid',\n EmailAlreadyExists = 'UpdateEmail/new-email-already-exists',\n}\n", "export type EthNetworkName = 'mainnet' | 'goerli' | 'sepolia';\n\nexport enum EthChainType {\n Harmony = 'HARMONY',\n}\n\nexport interface CustomNodeConfiguration {\n rpcUrl: string;\n chainId?: number;\n chainType?: EthChainType;\n}\n\nexport type EthNetworkConfiguration = EthNetworkName | CustomNodeConfiguration;\n\nexport type ProviderEnableEvents = {\n 'id-token-created': (params: { idToken: string }) => void;\n};\n", "import { DeepLinkPage } from '../core/deep-link-pages';\n\nexport interface GetIdTokenConfiguration {\n /**\n * The number of seconds until the generated ID token will expire.\n */\n lifespan?: number;\n}\n\nexport interface GenerateIdTokenConfiguration extends GetIdTokenConfiguration {\n /**\n * An optional piece of data to sign with the token. Note, however, that the\n * unsigned data _will not_ be encoded in the token, only an encrypted\n * signature of the data.\n */\n attachment?: string;\n}\n\nexport interface MagicUserMetadata {\n issuer: string | null;\n publicAddress: string | null;\n email: string | null;\n phoneNumber: string | null;\n isMfaEnabled: boolean;\n recoveryFactors: [RecoveryFactor];\n}\n\ntype RecoveryFactor = {\n type: RecoveryMethodType;\n value: string;\n};\n\nexport enum RecoveryMethodType {\n PhoneNumber = 'phone_number',\n}\n\nexport interface UpdateEmailConfiguration {\n /**\n * The new email address to update to\n */\n email: string;\n\n /**\n * When `true`, a pre-built pending modal interface will\n * guide the user to check their new, followed by old emails\n * for confirmation emails.\n */\n showUI?: boolean;\n}\n\nexport interface UpdateWebAuthnInfoConfiguration {\n /**\n * WebAuthn info id\n */\n id: string;\n\n /**\n * nickname that user attempts to update to the webauth device associate to the id.\n */\n nickname: string;\n}\n\nexport interface RecoverAccountConfiguration {\n /**\n * The email to recover\n */\n email: string;\n}\n\nexport interface ShowSettingsConfiguration {\n /**\n * deep linking destination\n */\n page: DeepLinkPage;\n}\n"],
|
|
5
|
-
"mappings": "AAAO,IAAKA,OACVA,EAAA,cAAgB,kBAChBA,EAAA,cAAgB,kBAChBA,EAAA,kBAAoB,qBACpBA,EAAA,gBAAkB,mBAClBA,EAAA,wBAA0B,4BAC1BA,EAAA,uBAAyB,0BANfA,OAAA,IASAC,OACVA,EAAA,eAAiB,mBACjBA,EAAA,gBAAkB,mBAClBA,EAAA,iCAAmC,sCACnCA,EAAA,kBAAoB,qBACpBA,EAAA,oBAAsB,eALZA,OAAA,IAQAC,OAEVA,IAAA,WAAa,QAAb,aACAA,IAAA,eAAiB,QAAjB,iBACAA,IAAA,eAAiB,QAAjB,iBACAA,IAAA,cAAgB,QAAhB,gBACAA,IAAA,cAAgB,QAAhB,gBAGAA,IAAA,4BAA8B,MAA9B,8BACAA,IAAA,iBAAmB,QAAnB,mBACAA,IAAA,qBAAuB,QAAvB,uBACAA,IAAA,4BAA8B,QAA9B,8BACAA,IAAA,oBAAsB,QAAtB,sBACAA,IAAA,kBAAoB,QAApB,oBACAA,IAAA,qBAAuB,QAAvB,uBACAA,IAAA,kBAAoB,QAApB,oBACAA,IAAA,mBAAqB,QAArB,qBACAA,IAAA,sBAAwB,QAAxB,wBAlBUA,OAAA,ICiCL,IAAKC,OACVA,EAAA,SAAW,WACXA,EAAA,eAAiB,kBAFPA,OAAA,IAKAC,OACVA,EAAA,eAAiB,kBACjBA,EAAA,gBAAkB,mBAClBA,EAAA,eAAiB,
|
|
6
|
-
"names": ["SDKErrorCode", "SDKWarningCode", "RPCErrorCode", "Wallets", "
|
|
4
|
+
"sourcesContent": ["export enum SDKErrorCode {\n MissingApiKey = 'MISSING_API_KEY',\n ModalNotReady = 'MODAL_NOT_READY',\n MalformedResponse = 'MALFORMED_RESPONSE',\n InvalidArgument = 'INVALID_ARGUMENT',\n ExtensionNotInitialized = 'EXTENSION_NOT_INITIALIZED',\n IncompatibleExtensions = 'INCOMPATIBLE_EXTENSIONS',\n}\n\nexport enum SDKWarningCode {\n SyncWeb3Method = 'SYNC_WEB3_METHOD',\n DuplicateIframe = 'DUPLICATE_IFRAME',\n ReactNativeEndpointConfiguration = 'REACT_NATIVE_ENDPOINT_CONFIGURATION',\n DeprecationNotice = 'DEPRECATION_NOTICE',\n ProductAnnouncement = 'ANNOUNCEMENT',\n}\n\nexport enum RPCErrorCode {\n // Standard JSON RPC 2.0 Error Codes\n ParseError = -32700,\n InvalidRequest = -32600,\n MethodNotFound = -32601,\n InvalidParams = -32602,\n InternalError = -32603,\n\n // Custom RPC Error Codes\n MagicLinkFailedVerification = -10000,\n MagicLinkExpired = -10001,\n MagicLinkRateLimited = -10002,\n MagicLinkInvalidRedirectURL = -10006,\n UserAlreadyLoggedIn = -10003,\n UpdateEmailFailed = -10004,\n UserRequestEditEmail = -10005,\n InactiveRecipient = -10010,\n AccessDeniedToUser = -10011,\n RedirectLoginComplete = -10015,\n}\n\nexport type ErrorCode = SDKErrorCode | RPCErrorCode;\nexport type WarningCode = SDKWarningCode;\n", "import { RPCErrorCode } from './exception-types';\n\n// --- Request interfaces\n\nexport interface JsonRpcRequestPayload<TParams = any> {\n jsonrpc: string;\n id: string | number | null;\n method: string;\n params?: TParams;\n}\n\nexport interface JsonRpcRequestCallback {\n /** Callback executed upon JSON RPC response. */\n (err: JsonRpcError | null, result?: JsonRpcResponsePayload | null): void;\n}\n\nexport interface JsonRpcBatchRequestCallback {\n /** Callback executed upon JSON RPC response. */\n (err: JsonRpcError | null, result?: (JsonRpcResponsePayload | null)[] | null): void;\n}\n\n// --- Response interfaces\n\nexport interface JsonRpcError {\n message: string;\n code: RPCErrorCode;\n data?: any;\n}\n\nexport interface JsonRpcResponsePayload<ResultType = any> {\n jsonrpc: string;\n id: string | number | null;\n result?: ResultType | null;\n error?: JsonRpcError | null;\n}\n\nexport interface UserInfo {\n email?: string;\n}\n\nexport interface WalletInfo {\n walletType: 'magic' | 'metamask' | 'coinbase_wallet';\n}\n\nexport interface RequestUserInfoScope {\n scope?: {\n email?: 'required' | 'optional';\n };\n}\n\nexport enum Wallets {\n MetaMask = 'metamask',\n CoinbaseWallet = 'coinbase_wallet',\n}\n\nexport enum ThirdPartyWalletEvents {\n WalletSelected = 'wallet_selected',\n WalletConnected = 'wallet_connected',\n WalletRejected = 'wallet_rejected',\n Web3ModalSelected = 'web3modal_selected',\n}\n\nexport interface UserEnv {\n env: {\n isMetaMaskInstalled: boolean;\n isCoinbaseWalletInstalled: boolean;\n };\n}\n\n// --- Payload methods\n\n/**\n * Enum of JSON RPC methods for interacting with the Magic SDK authentication\n * relayer.\n */\nexport enum MagicPayloadMethod {\n LoginWithSms = 'magic_auth_login_with_sms',\n LoginWithEmailOTP = 'magic_auth_login_with_email_otp',\n LoginWithMagicLink = 'magic_auth_login_with_magic_link',\n LoginWithCredential = 'magic_auth_login_with_credential',\n SetAuthorizationToken = 'magic_auth_set_authorization_token',\n GetIdToken = 'magic_auth_get_id_token',\n GenerateIdToken = 'magic_auth_generate_id_token',\n GetMetadata = 'magic_auth_get_metadata',\n IsLoggedIn = 'magic_is_logged_in',\n Logout = 'magic_auth_logout',\n UpdateEmail = 'magic_auth_update_email',\n UserSettings = 'magic_auth_settings',\n UserSettingsTestMode = 'magic_auth_settings_testing_mode',\n LoginWithSmsTestMode = 'magic_auth_login_with_sms_testing_mode',\n LoginWithEmailOTPTestMode = 'magic_auth_login_with_email_otp_testing_mode',\n LoginWithMagicLinkTestMode = 'magic_login_with_magic_link_testing_mode',\n LoginWithCredentialTestMode = 'magic_auth_login_with_credential_testing_mode',\n GetIdTokenTestMode = 'magic_auth_get_id_token_testing_mode',\n GenerateIdTokenTestMode = 'magic_auth_generate_id_token_testing_mode',\n GetMetadataTestMode = 'magic_auth_get_metadata_testing_mode',\n IsLoggedInTestMode = 'magic_auth_is_logged_in_testing_mode',\n LogoutTestMode = 'magic_auth_logout_testing_mode',\n UpdateEmailTestMode = 'magic_auth_update_email_testing_mode',\n IntermediaryEvent = 'magic_intermediary_event',\n RequestAccounts = 'eth_requestAccounts',\n GetInfo = 'magic_get_info',\n ShowUI = 'magic_wallet',\n NFTPurchase = 'magic_nft_purchase',\n NFTCheckout = 'magic_nft_checkout',\n NFTTransfer = 'magic_nft_transfer',\n RequestUserInfoWithUI = 'mc_request_user_info',\n Disconnect = 'mc_disconnect',\n // UpdatePhoneNumber = 'magic_auth_update_phone_number',\n // UpdatePhoneNumberTestMode = 'magic_auth_update_phone_number_testing_mode',\n RecoverAccount = 'magic_auth_recover_account',\n RecoverAccountTestMode = 'magic_auth_recover_account_testing_mode',\n MagicBoxHeartBeat = 'magic_box_heart_beat',\n AutoConnect = 'mc_auto_connect',\n Login = 'mc_login',\n EncryptV1 = 'magic_auth_encrypt_v1',\n DecryptV1 = 'magic_auth_decrypt_v1',\n ShowNFTs = 'magic_show_nfts',\n ShowOnRamp = 'magic_show_fiat_onramp',\n ShowSendTokensUI = 'magic_show_send_tokens_ui',\n ShowAddress = 'magic_show_address',\n ShowBalances = 'magic_show_balances',\n SendGaslessTransaction = 'eth_sendGaslessTransaction',\n RevealPK = 'magic_reveal_key',\n}\n", "import { JsonRpcResponsePayload, JsonRpcError, JsonRpcRequestPayload } from './json-rpc-types';\n\nexport enum MagicIncomingWindowMessage {\n MAGIC_HANDLE_RESPONSE = 'MAGIC_HANDLE_RESPONSE',\n MAGIC_OVERLAY_READY = 'MAGIC_OVERLAY_READY',\n MAGIC_SHOW_OVERLAY = 'MAGIC_SHOW_OVERLAY',\n MAGIC_HIDE_OVERLAY = 'MAGIC_HIDE_OVERLAY',\n MAGIC_HANDLE_EVENT = 'MAGIC_HANDLE_EVENT',\n MAGIC_MG_BOX_SEND_RECEIPT = 'MAGIC_MG_BOX_SEND_RECEIPT',\n MAGIC_SEND_PRODUCT_ANNOUNCEMENT = 'MAGIC_SEND_PRODUCT_ANNOUNCEMENT',\n}\n\nexport enum MagicOutgoingWindowMessage {\n MAGIC_HANDLE_REQUEST = 'MAGIC_HANDLE_REQUEST',\n}\n\n/** The shape of responding window message datas from the Magic iframe context. */\nexport interface MagicMessageRequest {\n msgType: string;\n payload: JsonRpcRequestPayload | JsonRpcRequestPayload[];\n rt?: string;\n jwt?: string;\n deviceShare?: string;\n}\n\n/** The shape of responding window message datas from the Magic iframe context. */\nexport interface MagicMessageResponse<ResultType = any> {\n msgType: string;\n response: Partial<JsonRpcError> & Partial<JsonRpcResponsePayload<ResultType>>;\n rt?: string;\n deviceShare?: string;\n}\n\n/** The expected message event returned by the Magic iframe context. */\nexport interface MagicMessageEvent extends Partial<MessageEvent> {\n data: MagicMessageResponse;\n}\n", "export enum DeepLinkPage {\n UpdateEmail = 'update-email',\n MFA = 'mfa',\n Recovery = 'recovery',\n}\n", "export interface LoginWithMagicLinkConfiguration {\n /**\n * The email address of the user attempting to login.\n */\n email: string;\n\n /**\n * When `true`, a pre-built modal interface will show to the user, directing\n * them to check their email for the \"magic link\" to complete their\n * authentication.\n */\n showUI?: boolean;\n\n /**\n * You can optionally provide a redirect URI that will be followed at the end\n * of the magic link flow. Don't forget to invoke\n * `magic.auth.loginWithCredential()` to complete the login from the route you\n * configure here.\n */\n redirectURI?: string;\n\n /**\n * Enterprise users with a custom SMTP can create custom email templates\n * from their dashboard. The default Magic loginWithMagicLink email will be\n * overriden when a variation is passed here.\n */\n overrides?: {\n variation?: string;\n };\n}\n\nexport interface LoginWithSmsConfiguration {\n /**\n * Specify the phone number of the user attempting to login.\n */\n phoneNumber: string;\n}\nexport interface LoginWithEmailOTPConfiguration {\n /**\n * Specify the email address of the user attempting to login.\n */\n email: string;\n\n /**\n * When `true`, a pre-built modal interface will show to the user, directing\n * them to check their email for the one time passcode (OTP) to complete their\n * authentication.\n *\n * When `false`, developers will be able to implement their own custom UI to\n * continue the email OTP flow.\n */\n showUI?: boolean;\n\n /**\n * Device Unrecognized UI will enforce showing up to secure user's login\n *\n * When set to true (default), an improved device recognition UI will be displayed to the user,\n * prompting them to verify their login by checking their email for device approval. This feature\n * enhances authentication security.\n *\n * This param will only be affect if showUI is false. When set to false,\n * developers have the flexibility to implement their own customized UI to\n * handle device check events, providing a more tailored user experience.\n */\n deviceCheckUI?: boolean;\n\n /**\n * Enterprise users with a custom SMTP can create custom email templates\n * from their dashboard. The default Magic loginWithOTP email will be\n * overriden when a variation is passed here.\n */\n overrides?: {\n variation?: string;\n };\n}\n\n/**\n * EventHandlers\n */\nexport type LoginWithMagicLinkEventHandlers = {\n // Event Received\n [LoginWithMagicLinkEventOnReceived.EmailSent]: () => void;\n [LoginWithMagicLinkEventOnReceived.EmailNotDeliverable]: () => void;\n\n // Event sent\n [LoginWithMagicLinkEventEmit.Retry]: () => void;\n} & DeviceVerificationEventHandlers;\n\nexport type LoginWithEmailOTPEventHandlers = {\n // Event Received\n [LoginWithEmailOTPEventOnReceived.EmailOTPSent]: () => void;\n [LoginWithEmailOTPEventOnReceived.InvalidEmailOtp]: () => void;\n [LoginWithEmailOTPEventOnReceived.ExpiredEmailOtp]: () => void;\n\n // Event sent\n [LoginWithEmailOTPEventEmit.VerifyEmailOtp]: (otp: string) => void;\n [LoginWithEmailOTPEventEmit.Cancel]: () => void;\n} & DeviceVerificationEventHandlers;\n\ntype DeviceVerificationEventHandlers = {\n // Event Received\n [DeviceVerificationEventOnReceived.DeviceNeedsApproval]: () => void;\n [DeviceVerificationEventOnReceived.DeviceVerificationEmailSent]: () => void;\n [DeviceVerificationEventOnReceived.DeviceVerificationLinkExpired]: () => void;\n [DeviceVerificationEventOnReceived.DeviceApproved]: () => void;\n\n // Event sent\n [DeviceVerificationEventEmit.Retry]: () => void;\n};\n\n/**\n * Auth Events Enum\n */\nexport enum LoginWithMagicLinkEventEmit {\n Retry = 'retry',\n}\n\nexport enum LoginWithMagicLinkEventOnReceived {\n EmailSent = 'email-sent',\n EmailNotDeliverable = 'email-not-deliverable',\n}\n\nexport enum LoginWithEmailOTPEventEmit {\n VerifyEmailOtp = 'verify-email-otp',\n Cancel = 'cancel',\n}\n\nexport enum LoginWithEmailOTPEventOnReceived {\n EmailOTPSent = 'email-otp-sent',\n InvalidEmailOtp = 'invalid-email-otp',\n ExpiredEmailOtp = 'expired-email-otp',\n}\n\nexport enum DeviceVerificationEventEmit {\n Retry = 'device-retry',\n}\n\nexport enum DeviceVerificationEventOnReceived {\n DeviceApproved = 'device-approved',\n DeviceNeedsApproval = 'device-needs-approval',\n DeviceVerificationLinkExpired = 'device-verification-link-expired',\n DeviceVerificationEmailSent = 'device-verification-email-sent',\n}\n\n/**\n * Update Email\n */\n\ntype RecencyCheckEventHandlers = {\n [RecencyCheckEventOnReceived.PrimaryAuthFactorNeedsVerification]: () => void;\n [RecencyCheckEventOnReceived.PrimaryAuthFactorVerified]: () => void;\n [RecencyCheckEventOnReceived.InvalidEmailOtp]: () => void;\n [RecencyCheckEventOnReceived.EmailNotDeliverable]: () => void;\n [RecencyCheckEventOnReceived.EmailExpired]: () => void;\n [RecencyCheckEventOnReceived.EmailSent]: () => void;\n\n [RecencyCheckEventEmit.Cancel]: () => void;\n [RecencyCheckEventEmit.Retry]: () => void;\n [RecencyCheckEventEmit.VerifyEmailOtp]: (otp: string) => void;\n};\n\nexport type UpdateEmailEventHandlers = {\n [UpdateEmailEventOnReceived.NewAuthFactorNeedsVerification]: () => void;\n [UpdateEmailEventOnReceived.EmailUpdated]: () => void;\n [UpdateEmailEventOnReceived.InvalidEmailOtp]: () => void;\n [UpdateEmailEventOnReceived.EmailNotDeliverable]: () => void;\n [UpdateEmailEventOnReceived.EmailExpired]: () => void;\n [UpdateEmailEventOnReceived.EmailSent]: () => void;\n [UpdateEmailEventOnReceived.InvalidEmail]: () => void;\n [UpdateEmailEventOnReceived.EmailAlreadyExists]: () => void;\n\n [UpdateEmailEventEmit.Cancel]: () => void;\n [UpdateEmailEventEmit.RetryWithNewEmail]: (email?: string) => void;\n [UpdateEmailEventEmit.VerifyEmailOtp]: (otp: string) => void;\n} & RecencyCheckEventHandlers;\n\nexport enum RecencyCheckEventEmit {\n Retry = 'Recency/auth-factor-retry',\n Cancel = 'Recency/auth-factor-verification-cancel',\n VerifyEmailOtp = 'Recency/auth-factor-verify-email-otp',\n}\n\nexport enum RecencyCheckEventOnReceived {\n PrimaryAuthFactorNeedsVerification = 'Recency/auth-factor-needs-verification',\n PrimaryAuthFactorVerified = 'Recency/auth-factor-verified',\n InvalidEmailOtp = 'Recency/auth-factor-invalid-email-otp',\n EmailExpired = 'Recency/auth-factor-verification-email-expired',\n EmailSent = 'Recency/auth-factor-verification-email-sent',\n EmailNotDeliverable = 'Recency/auth-factor-verification-email-not-deliverable',\n}\n\nexport enum UpdateEmailEventEmit {\n RetryWithNewEmail = 'UpdateEmail/retry-with-new-email',\n Cancel = 'UpdateEmail/new-email-verification-cancel',\n VerifyEmailOtp = 'UpdateEmail/new-email-verify-otp',\n}\n\nexport enum UpdateEmailEventOnReceived {\n NewAuthFactorNeedsVerification = 'UpdateEmail/new-email-needs-verification',\n EmailUpdated = 'UpdateEmail/email-updated',\n InvalidEmailOtp = 'UpdateEmail/new-email-invalid-email-otp',\n EmailExpired = 'UpdateEmail/new-email-verification-email-expired',\n EmailSent = 'UpdateEmail/new-email-verification-email-sent',\n EmailNotDeliverable = 'UpdateEmail/new-email-verification-email-not-deliverable',\n InvalidEmail = 'UpdateEmail/new-email-invalid',\n EmailAlreadyExists = 'UpdateEmail/new-email-already-exists',\n}\n", "export type EthNetworkName = 'mainnet' | 'goerli' | 'sepolia';\n\nexport enum EthChainType {\n Harmony = 'HARMONY',\n}\n\nexport interface CustomNodeConfiguration {\n rpcUrl: string;\n chainId?: number;\n chainType?: EthChainType;\n}\n\nexport type EthNetworkConfiguration = EthNetworkName | CustomNodeConfiguration;\n\nexport type ProviderEnableEvents = {\n 'id-token-created': (params: { idToken: string }) => void;\n};\n", "import { DeepLinkPage } from '../core/deep-link-pages';\n\nexport interface GetIdTokenConfiguration {\n /**\n * The number of seconds until the generated ID token will expire.\n */\n lifespan?: number;\n}\n\nexport interface GenerateIdTokenConfiguration extends GetIdTokenConfiguration {\n /**\n * An optional piece of data to sign with the token. Note, however, that the\n * unsigned data _will not_ be encoded in the token, only an encrypted\n * signature of the data.\n */\n attachment?: string;\n}\n\nexport interface MagicUserMetadata {\n issuer: string | null;\n publicAddress: string | null;\n email: string | null;\n phoneNumber: string | null;\n isMfaEnabled: boolean;\n recoveryFactors: [RecoveryFactor];\n}\n\ntype RecoveryFactor = {\n type: RecoveryMethodType;\n value: string;\n};\n\nexport enum RecoveryMethodType {\n PhoneNumber = 'phone_number',\n}\n\nexport interface UpdateEmailConfiguration {\n /**\n * The new email address to update to\n */\n email: string;\n\n /**\n * When `true`, a pre-built pending modal interface will\n * guide the user to check their new, followed by old emails\n * for confirmation emails.\n */\n showUI?: boolean;\n}\n\nexport interface UpdateWebAuthnInfoConfiguration {\n /**\n * WebAuthn info id\n */\n id: string;\n\n /**\n * nickname that user attempts to update to the webauth device associate to the id.\n */\n nickname: string;\n}\n\nexport interface RecoverAccountConfiguration {\n /**\n * The email to recover\n */\n email: string;\n}\n\nexport interface ShowSettingsConfiguration {\n /**\n * deep linking destination\n */\n page: DeepLinkPage;\n}\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["SDKErrorCode", "SDKWarningCode", "RPCErrorCode", "Wallets", "ThirdPartyWalletEvents", "MagicPayloadMethod", "MagicIncomingWindowMessage", "MagicOutgoingWindowMessage", "DeepLinkPage", "LoginWithMagicLinkEventEmit", "LoginWithMagicLinkEventOnReceived", "LoginWithEmailOTPEventEmit", "LoginWithEmailOTPEventOnReceived", "DeviceVerificationEventEmit", "DeviceVerificationEventOnReceived", "RecencyCheckEventEmit", "RecencyCheckEventOnReceived", "UpdateEmailEventEmit", "UpdateEmailEventOnReceived", "EthChainType", "RecoveryMethodType"]
|
|
7
7
|
}
|
|
@@ -39,10 +39,11 @@ export declare enum Wallets {
|
|
|
39
39
|
MetaMask = "metamask",
|
|
40
40
|
CoinbaseWallet = "coinbase_wallet"
|
|
41
41
|
}
|
|
42
|
-
export declare enum
|
|
42
|
+
export declare enum ThirdPartyWalletEvents {
|
|
43
43
|
WalletSelected = "wallet_selected",
|
|
44
44
|
WalletConnected = "wallet_connected",
|
|
45
|
-
WalletRejected = "wallet_rejected"
|
|
45
|
+
WalletRejected = "wallet_rejected",
|
|
46
|
+
Web3ModalSelected = "web3modal_selected"
|
|
46
47
|
}
|
|
47
48
|
export interface UserEnv {
|
|
48
49
|
env: {
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
import { ThirdPartyWalletEvents } from '../core/json-rpc-types';
|
|
1
2
|
import { DeviceVerificationEventEmit, DeviceVerificationEventOnReceived, LoginWithEmailOTPEventEmit, LoginWithEmailOTPEventOnReceived, LoginWithMagicLinkEventEmit, LoginWithMagicLinkEventOnReceived, RecencyCheckEventEmit, RecencyCheckEventOnReceived, UpdateEmailEventEmit, UpdateEmailEventOnReceived } from './auth-types';
|
|
2
|
-
export declare type IntermediaryEvents = `${LoginWithEmailOTPEventEmit}` | `${LoginWithEmailOTPEventOnReceived}` | `${LoginWithMagicLinkEventEmit}` | `${LoginWithMagicLinkEventOnReceived}` | `${DeviceVerificationEventEmit}` | `${DeviceVerificationEventOnReceived}` | `${RecencyCheckEventEmit}` | `${RecencyCheckEventOnReceived}` | `${UpdateEmailEventOnReceived}` | `${UpdateEmailEventEmit}`;
|
|
3
|
+
export declare type IntermediaryEvents = `${LoginWithEmailOTPEventEmit}` | `${LoginWithEmailOTPEventOnReceived}` | `${LoginWithMagicLinkEventEmit}` | `${LoginWithMagicLinkEventOnReceived}` | `${DeviceVerificationEventEmit}` | `${DeviceVerificationEventOnReceived}` | `${RecencyCheckEventEmit}` | `${RecencyCheckEventOnReceived}` | `${UpdateEmailEventOnReceived}` | `${UpdateEmailEventEmit}` | `${ThirdPartyWalletEvents}`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@magic-sdk/types",
|
|
3
|
-
"version": "24.0.
|
|
3
|
+
"version": "24.0.2-canary.742.8791105617.0",
|
|
4
4
|
"description": "Core typings for Magic SDK packages.",
|
|
5
5
|
"author": "Magic Labs <team@magic.link> (https://magic.link/)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -21,5 +21,5 @@
|
|
|
21
21
|
"import": "./dist/es/index.mjs",
|
|
22
22
|
"require": "./dist/cjs/index.js"
|
|
23
23
|
},
|
|
24
|
-
"gitHead": "
|
|
24
|
+
"gitHead": "80c796e4738efcb9616357337d478d8134c0e806"
|
|
25
25
|
}
|