@magic-sdk/types 6.0.0-mfa-feature.0 → 7.1.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/CHANGELOG.md +148 -0
- package/README.md +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +7 -1
- package/dist/es/index.js +1 -1
- package/dist/es/index.js.map +7 -1
- package/dist/es/index.mjs +2 -0
- package/dist/es/index.mjs.map +7 -0
- package/dist/types/core/exception-types.d.ts +32 -32
- package/dist/types/core/i18n.d.ts +1 -1
- package/dist/types/core/json-rpc-types.d.ts +51 -53
- package/dist/types/core/message-types.d.ts +28 -28
- package/dist/types/core/query-types.d.ts +14 -14
- package/dist/types/index.d.ts +8 -8
- package/dist/types/modules/auth-types.d.ts +22 -22
- package/dist/types/modules/rpc-provider-types.d.ts +10 -10
- package/dist/types/modules/user-types.d.ts +42 -41
- package/package.json +8 -7
- package/dist/modern/index.js +0 -2
- package/dist/modern/index.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,151 @@
|
|
|
1
|
+
# v7.1.0 (Mon Mar 07 2022)
|
|
2
|
+
|
|
3
|
+
#### 🐛 Bug Fix
|
|
4
|
+
|
|
5
|
+
- Update READMEs with outdated context/hyperlinks ([@smithki](https://github.com/smithki))
|
|
6
|
+
|
|
7
|
+
#### 🏠 Internal
|
|
8
|
+
|
|
9
|
+
- Internal documentation updates (`BUILD_SYSTEM.md`) [#283](https://github.com/magiclabs/magic-js/pull/283) ([@smithki](https://github.com/smithki))
|
|
10
|
+
|
|
11
|
+
#### Authors: 1
|
|
12
|
+
|
|
13
|
+
- Ian K Smith ([@smithki](https://github.com/smithki))
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# v7.0.0 (Tue Jan 25 2022)
|
|
18
|
+
|
|
19
|
+
#### 💥 Breaking Change
|
|
20
|
+
|
|
21
|
+
- Switch from `microbundle` to `esbuild` [#220](https://github.com/magiclabs/magic-js/pull/220) ([@smithki](https://github.com/smithki))
|
|
22
|
+
|
|
23
|
+
#### 🐛 Bug Fix
|
|
24
|
+
|
|
25
|
+
- Merge with master ([@smithki](https://github.com/smithki))
|
|
26
|
+
- Merge branch 'master' into feat/faster-builds ([@smithki](https://github.com/smithki))
|
|
27
|
+
- Remove comments from README files ([@smithki](https://github.com/smithki))
|
|
28
|
+
- Fix build errors related to isolatedModules ([@smithki](https://github.com/smithki))
|
|
29
|
+
- Replace microbundle with ESBuild ([@smithki](https://github.com/smithki))
|
|
30
|
+
|
|
31
|
+
#### Authors: 1
|
|
32
|
+
|
|
33
|
+
- Ian K Smith ([@smithki](https://github.com/smithki))
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
# v6.0.0 (Tue Dec 14 2021)
|
|
38
|
+
|
|
39
|
+
#### 💥 Breaking Change
|
|
40
|
+
|
|
41
|
+
- Deprecate test API key [#252](https://github.com/magiclabs/magic-js/pull/252) (harry [@harryEth](https://github.com/harryEth))
|
|
42
|
+
|
|
43
|
+
#### Authors: 2
|
|
44
|
+
|
|
45
|
+
- [@harryEth](https://github.com/harryEth)
|
|
46
|
+
- harry (harry)
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
# v5.2.0 (Fri Oct 22 2021)
|
|
51
|
+
|
|
52
|
+
#### 🚀 Enhancement
|
|
53
|
+
|
|
54
|
+
- Add `UserModule#settings` endpoint [#231](https://github.com/magiclabs/magic-js/pull/231) ([@smithki](https://github.com/smithki))
|
|
55
|
+
|
|
56
|
+
#### Authors: 1
|
|
57
|
+
|
|
58
|
+
- Ian K Smith ([@smithki](https://github.com/smithki))
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
# v5.1.4 (Thu Oct 21 2021)
|
|
63
|
+
|
|
64
|
+
#### 🐛 Bug Fix
|
|
65
|
+
|
|
66
|
+
- Revert to `.js` extension for ES module builds targeting webpack/CRA [#232](https://github.com/magiclabs/magic-js/pull/232) ([@smithki](https://github.com/smithki))
|
|
67
|
+
|
|
68
|
+
#### Authors: 1
|
|
69
|
+
|
|
70
|
+
- Ian K Smith ([@smithki](https://github.com/smithki))
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
# v5.1.3 (Wed Oct 20 2021)
|
|
75
|
+
|
|
76
|
+
#### ⚠️ Pushed to `master`
|
|
77
|
+
|
|
78
|
+
- Fix dist files glob in package.json ([@smithki](https://github.com/smithki))
|
|
79
|
+
- Merge branch 'master' of github.com:magiclabs/magic-js ([@smithki](https://github.com/smithki))
|
|
80
|
+
- Force re-publish ([@smithki](https://github.com/smithki))
|
|
81
|
+
|
|
82
|
+
#### Authors: 1
|
|
83
|
+
|
|
84
|
+
- Ian K Smith ([@smithki](https://github.com/smithki))
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
# v5.1.2 (Wed Oct 20 2021)
|
|
89
|
+
|
|
90
|
+
#### 🐛 Bug Fix
|
|
91
|
+
|
|
92
|
+
- Use '.mjs' extension for ESM build files [#230](https://github.com/magiclabs/magic-js/pull/230) ([@smithki](https://github.com/smithki))
|
|
93
|
+
|
|
94
|
+
#### Authors: 1
|
|
95
|
+
|
|
96
|
+
- Ian K Smith ([@smithki](https://github.com/smithki))
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
# v5.1.1 (Tue Oct 19 2021)
|
|
101
|
+
|
|
102
|
+
#### 🐛 Bug Fix
|
|
103
|
+
|
|
104
|
+
- add typing for metadata phone number [#225](https://github.com/magiclabs/magic-js/pull/225) ([@dgerrellsMagic](https://github.com/dgerrellsMagic))
|
|
105
|
+
|
|
106
|
+
#### Authors: 1
|
|
107
|
+
|
|
108
|
+
- [@dgerrellsMagic](https://github.com/dgerrellsMagic)
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
# v5.1.0 (Fri Oct 01 2021)
|
|
113
|
+
|
|
114
|
+
#### 🚀 Enhancement
|
|
115
|
+
|
|
116
|
+
- Enable SMS login [#223](https://github.com/magiclabs/magic-js/pull/223) ([@dgerrellsMagic](https://github.com/dgerrellsMagic))
|
|
117
|
+
|
|
118
|
+
#### Authors: 1
|
|
119
|
+
|
|
120
|
+
- [@dgerrellsMagic](https://github.com/dgerrellsMagic)
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
# v5.0.3 (Thu Sep 23 2021)
|
|
125
|
+
|
|
126
|
+
#### 🐛 Bug Fix
|
|
127
|
+
|
|
128
|
+
- Port `@magic-ext/oauth`, `@magic-ext/react-native-oauth`, `@magic-ext/webauthn` extensions to Magic SDK monorepo [#218](https://github.com/magiclabs/magic-js/pull/218) ([@smithki](https://github.com/smithki))
|
|
129
|
+
- Add `@magic-sdk/pnp` package for out-of-the-box login page UIs [#217](https://github.com/magiclabs/magic-js/pull/217) ([@smithki](https://github.com/smithki))
|
|
130
|
+
|
|
131
|
+
#### Authors: 1
|
|
132
|
+
|
|
133
|
+
- Ian K Smith ([@smithki](https://github.com/smithki))
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
# v5.0.2 (Fri Sep 17 2021)
|
|
138
|
+
|
|
139
|
+
#### 🐛 Bug Fix
|
|
140
|
+
|
|
141
|
+
- Fix CJS-dependent entry-points using the 'exports' field in package.json [#214](https://github.com/magiclabs/magic-js/pull/214) ([@smithki](https://github.com/smithki))
|
|
142
|
+
|
|
143
|
+
#### Authors: 1
|
|
144
|
+
|
|
145
|
+
- Ian K Smith ([@smithki](https://github.com/smithki))
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
1
149
|
# v5.0.1 (Tue Sep 14 2021)
|
|
2
150
|
|
|
3
151
|
#### 🐛 Bug Fix
|
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
## 📖 Documentation
|
|
14
14
|
|
|
15
|
-
See the [developer documentation](https://
|
|
15
|
+
See the [developer documentation](https://magic.link/docs) to learn how you can master the Magic SDK in a matter of minutes.
|
|
16
16
|
|
|
17
17
|
## Looking to Get Started With Magic?
|
|
18
18
|
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var
|
|
1
|
+
var m=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var N=Object.getOwnPropertyNames;var T=Object.prototype.hasOwnProperty;var R=i=>m(i,"__esModule",{value:!0});var L=(i,n)=>{for(var s in n)m(i,s,{get:n[s],enumerable:!0})},x=(i,n,s,u)=>{if(n&&typeof n=="object"||typeof n=="function")for(let _ of N(n))!T.call(i,_)&&(s||_!=="default")&&m(i,_,{get:()=>n[_],enumerable:!(u=E(n,_))||u.enumerable});return i};var f=(i=>(n,s)=>i&&i.get(n)||(s=x(R({}),n,1),i&&i.set(n,s),s))(typeof WeakMap!="undefined"?new WeakMap:0);var O={};L(O,{EthChainType:()=>A,MagicIncomingWindowMessage:()=>c,MagicOutgoingWindowMessage:()=>I,MagicPayloadMethod:()=>r,RPCErrorCode:()=>l,SDKErrorCode:()=>o,SDKWarningCode:()=>g});var o=(a=>(a.MissingApiKey="MISSING_API_KEY",a.ModalNotReady="MODAL_NOT_READY",a.MalformedResponse="MALFORMED_RESPONSE",a.InvalidArgument="INVALID_ARGUMENT",a.ExtensionNotInitialized="EXTENSION_NOT_INITIALIZED",a.IncompatibleExtensions="INCOMPATIBLE_EXTENSIONS",a))(o||{}),g=(_=>(_.SyncWeb3Method="SYNC_WEB3_METHOD",_.DuplicateIframe="DUPLICATE_IFRAME",_.ReactNativeEndpointConfiguration="REACT_NATIVE_ENDPOINT_CONFIGURATION",_.DeprecationNotice="DEPRECATION_NOTICE",_))(g||{}),l=(e=>(e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.MagicLinkFailedVerification=-1e4]="MagicLinkFailedVerification",e[e.MagicLinkExpired=-10001]="MagicLinkExpired",e[e.MagicLinkRateLimited=-10002]="MagicLinkRateLimited",e[e.MagicLinkInvalidRedirectURL=-10006]="MagicLinkInvalidRedirectURL",e[e.UserAlreadyLoggedIn=-10003]="UserAlreadyLoggedIn",e[e.UpdateEmailFailed=-10004]="UpdateEmailFailed",e[e.UserRequestEditEmail=-10005]="UserRequestEditEmail",e[e.InactiveRecipient=-10010]="InactiveRecipient",e[e.AccessDeniedToUser=-10011]="AccessDeniedToUser",e))(l||{});var r=(t=>(t.LoginWithSms="magic_auth_login_with_sms",t.LoginWithMagicLink="magic_auth_login_with_magic_link",t.LoginWithCredential="magic_auth_login_with_credential",t.GetIdToken="magic_auth_get_id_token",t.GenerateIdToken="magic_auth_generate_id_token",t.GetMetadata="magic_auth_get_metadata",t.IsLoggedIn="magic_auth_is_logged_in",t.Logout="magic_auth_logout",t.UpdateEmail="magic_auth_update_email",t.UserSettings="magic_auth_settings",t.UserSettingsTestMode="magic_auth_settings_testing_mode",t.LoginWithSmsTestMode="magic_auth_login_with_sms_testing_mode",t.LoginWithMagicLinkTestMode="magic_login_with_magic_link_testing_mode",t.LoginWithCredentialTestMode="magic_auth_login_with_credential_testing_mode",t.GetIdTokenTestMode="magic_auth_get_id_token_testing_mode",t.GenerateIdTokenTestMode="magic_auth_generate_id_token_testing_mode",t.GetMetadataTestMode="magic_auth_get_metadata_testing_mode",t.IsLoggedInTestMode="magic_auth_is_logged_in_testing_mode",t.LogoutTestMode="magic_auth_logout_testing_mode",t.UpdateEmailTestMode="magic_auth_update_email_testing_mode",t))(r||{});var c=(p=>(p.MAGIC_HANDLE_RESPONSE="MAGIC_HANDLE_RESPONSE",p.MAGIC_OVERLAY_READY="MAGIC_OVERLAY_READY",p.MAGIC_SHOW_OVERLAY="MAGIC_SHOW_OVERLAY",p.MAGIC_HIDE_OVERLAY="MAGIC_HIDE_OVERLAY",p.MAGIC_HANDLE_EVENT="MAGIC_HANDLE_EVENT",p))(c||{}),I=(n=>(n.MAGIC_HANDLE_REQUEST="MAGIC_HANDLE_REQUEST",n))(I||{});var A=(n=>(n.Harmony="HARMONY",n))(A||{});module.exports=f(O);
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/index.ts", "../../src/core/exception-types.ts", "../../src/core/json-rpc-types.ts", "../../src/core/message-types.ts", "../../src/modules/rpc-provider-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';\n\nexport * from './modules/auth-types';\nexport * from './modules/rpc-provider-types';\nexport * from './modules/user-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}\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}\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}\n\nexport interface JsonRpcResponsePayload<ResultType = any> {\n jsonrpc: string;\n id: string | number | null;\n result?: ResultType | null;\n error?: JsonRpcError | null;\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 LoginWithMagicLink = 'magic_auth_login_with_magic_link',\n LoginWithCredential = 'magic_auth_login_with_credential',\n GetIdToken = 'magic_auth_get_id_token',\n GenerateIdToken = 'magic_auth_generate_id_token',\n GetMetadata = 'magic_auth_get_metadata',\n IsLoggedIn = 'magic_auth_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 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}\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}\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}\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}\n\n/** The expected message event returned by the Magic iframe context. */\nexport interface MagicMessageEvent extends Partial<MessageEvent> {\n data: MagicMessageResponse;\n}\n", "export type EthNetworkName = 'mainnet' | 'rinkeby' | 'ropsten' | 'kovan';\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"],
|
|
5
|
+
"mappings": "8gBAAA,yLCAO,GAAK,GAAL,CAAK,GACV,iBAAgB,kBAChB,gBAAgB,kBAChB,oBAAoB,qBACpB,kBAAkB,mBAClB,0BAA0B,4BAC1B,yBAAyB,0BANf,WASA,EAAL,CAAK,GACV,kBAAiB,mBACjB,kBAAkB,mBAClB,mCAAmC,sCACnC,oBAAoB,qBAJV,WAOA,EAAL,CAAK,GAEV,gBAAa,QAAb,aACA,mBAAiB,QAAjB,iBACA,mBAAiB,QAAjB,iBACA,kBAAgB,QAAhB,gBACA,kBAAgB,QAAhB,gBAGA,gCAA8B,MAA9B,8BACA,qBAAmB,QAAnB,mBACA,yBAAuB,QAAvB,uBACA,gCAA8B,QAA9B,8BACA,wBAAsB,QAAtB,sBACA,sBAAoB,QAApB,oBACA,yBAAuB,QAAvB,uBACA,sBAAoB,QAApB,oBACA,uBAAqB,QAArB,qBAjBU,WCyBL,GAAK,GAAL,CAAK,GACV,gBAAe,4BACf,qBAAqB,mCACrB,sBAAsB,mCACtB,aAAa,0BACb,kBAAkB,+BAClB,cAAc,0BACd,aAAa,0BACb,SAAS,oBACT,cAAc,0BACd,eAAe,sBACf,uBAAuB,mCACvB,uBAAuB,yCACvB,6BAA6B,2CAC7B,8BAA8B,gDAC9B,qBAAqB,uCACrB,0BAA0B,4CAC1B,sBAAsB,uCACtB,qBAAqB,uCACrB,iBAAiB,iCACjB,sBAAsB,uCApBZ,WCvCL,GAAK,GAAL,CAAK,GACV,yBAAwB,wBACxB,sBAAsB,sBACtB,qBAAqB,qBACrB,qBAAqB,qBACrB,qBAAqB,qBALX,WAQA,EAAL,CAAK,GACV,wBAAuB,uBADb,WCRL,GAAK,GAAL,CAAK,GACV,WAAU,UADA",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/es/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var
|
|
1
|
+
var a=(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))(a||{}),p=(_=>(_.SyncWeb3Method="SYNC_WEB3_METHOD",_.DuplicateIframe="DUPLICATE_IFRAME",_.ReactNativeEndpointConfiguration="REACT_NATIVE_ENDPOINT_CONFIGURATION",_.DeprecationNotice="DEPRECATION_NOTICE",_))(p||{}),m=(e=>(e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.MagicLinkFailedVerification=-1e4]="MagicLinkFailedVerification",e[e.MagicLinkExpired=-10001]="MagicLinkExpired",e[e.MagicLinkRateLimited=-10002]="MagicLinkRateLimited",e[e.MagicLinkInvalidRedirectURL=-10006]="MagicLinkInvalidRedirectURL",e[e.UserAlreadyLoggedIn=-10003]="UserAlreadyLoggedIn",e[e.UpdateEmailFailed=-10004]="UpdateEmailFailed",e[e.UserRequestEditEmail=-10005]="UserRequestEditEmail",e[e.InactiveRecipient=-10010]="InactiveRecipient",e[e.AccessDeniedToUser=-10011]="AccessDeniedToUser",e))(m||{});var u=(t=>(t.LoginWithSms="magic_auth_login_with_sms",t.LoginWithMagicLink="magic_auth_login_with_magic_link",t.LoginWithCredential="magic_auth_login_with_credential",t.GetIdToken="magic_auth_get_id_token",t.GenerateIdToken="magic_auth_generate_id_token",t.GetMetadata="magic_auth_get_metadata",t.IsLoggedIn="magic_auth_is_logged_in",t.Logout="magic_auth_logout",t.UpdateEmail="magic_auth_update_email",t.UserSettings="magic_auth_settings",t.UserSettingsTestMode="magic_auth_settings_testing_mode",t.LoginWithSmsTestMode="magic_auth_login_with_sms_testing_mode",t.LoginWithMagicLinkTestMode="magic_login_with_magic_link_testing_mode",t.LoginWithCredentialTestMode="magic_auth_login_with_credential_testing_mode",t.GetIdTokenTestMode="magic_auth_get_id_token_testing_mode",t.GenerateIdTokenTestMode="magic_auth_generate_id_token_testing_mode",t.GetMetadataTestMode="magic_auth_get_metadata_testing_mode",t.IsLoggedInTestMode="magic_auth_is_logged_in_testing_mode",t.LogoutTestMode="magic_auth_logout_testing_mode",t.UpdateEmailTestMode="magic_auth_update_email_testing_mode",t))(u||{});var o=(i=>(i.MAGIC_HANDLE_RESPONSE="MAGIC_HANDLE_RESPONSE",i.MAGIC_OVERLAY_READY="MAGIC_OVERLAY_READY",i.MAGIC_SHOW_OVERLAY="MAGIC_SHOW_OVERLAY",i.MAGIC_HIDE_OVERLAY="MAGIC_HIDE_OVERLAY",i.MAGIC_HANDLE_EVENT="MAGIC_HANDLE_EVENT",i))(o||{}),g=(s=>(s.MAGIC_HANDLE_REQUEST="MAGIC_HANDLE_REQUEST",s))(g||{});var l=(s=>(s.Harmony="HARMONY",s))(l||{});export{l as EthChainType,o as MagicIncomingWindowMessage,g as MagicOutgoingWindowMessage,u as MagicPayloadMethod,m as RPCErrorCode,a as SDKErrorCode,p as SDKWarningCode};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/es/index.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/core/exception-types.ts", "../../src/core/json-rpc-types.ts", "../../src/core/message-types.ts", "../../src/modules/rpc-provider-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}\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}\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}\n\nexport interface JsonRpcResponsePayload<ResultType = any> {\n jsonrpc: string;\n id: string | number | null;\n result?: ResultType | null;\n error?: JsonRpcError | null;\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 LoginWithMagicLink = 'magic_auth_login_with_magic_link',\n LoginWithCredential = 'magic_auth_login_with_credential',\n GetIdToken = 'magic_auth_get_id_token',\n GenerateIdToken = 'magic_auth_generate_id_token',\n GetMetadata = 'magic_auth_get_metadata',\n IsLoggedIn = 'magic_auth_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 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}\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}\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}\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}\n\n/** The expected message event returned by the Magic iframe context. */\nexport interface MagicMessageEvent extends Partial<MessageEvent> {\n data: MagicMessageResponse;\n}\n", "export type EthNetworkName = 'mainnet' | 'rinkeby' | 'ropsten' | 'kovan';\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"],
|
|
5
|
+
"mappings": "AAAO,GAAK,GAAL,CAAK,GACV,iBAAgB,kBAChB,gBAAgB,kBAChB,oBAAoB,qBACpB,kBAAkB,mBAClB,0BAA0B,4BAC1B,yBAAyB,0BANf,WASA,EAAL,CAAK,GACV,kBAAiB,mBACjB,kBAAkB,mBAClB,mCAAmC,sCACnC,oBAAoB,qBAJV,WAOA,EAAL,CAAK,GAEV,gBAAa,QAAb,aACA,mBAAiB,QAAjB,iBACA,mBAAiB,QAAjB,iBACA,kBAAgB,QAAhB,gBACA,kBAAgB,QAAhB,gBAGA,gCAA8B,MAA9B,8BACA,qBAAmB,QAAnB,mBACA,yBAAuB,QAAvB,uBACA,gCAA8B,QAA9B,8BACA,wBAAsB,QAAtB,sBACA,sBAAoB,QAApB,oBACA,yBAAuB,QAAvB,uBACA,sBAAoB,QAApB,oBACA,uBAAqB,QAArB,qBAjBU,WCyBL,GAAK,GAAL,CAAK,GACV,gBAAe,4BACf,qBAAqB,mCACrB,sBAAsB,mCACtB,aAAa,0BACb,kBAAkB,+BAClB,cAAc,0BACd,aAAa,0BACb,SAAS,oBACT,cAAc,0BACd,eAAe,sBACf,uBAAuB,mCACvB,uBAAuB,yCACvB,6BAA6B,2CAC7B,8BAA8B,gDAC9B,qBAAqB,uCACrB,0BAA0B,4CAC1B,sBAAsB,uCACtB,qBAAqB,uCACrB,iBAAiB,iCACjB,sBAAsB,uCApBZ,WCvCL,GAAK,GAAL,CAAK,GACV,yBAAwB,wBACxB,sBAAsB,sBACtB,qBAAqB,qBACrB,qBAAqB,qBACrB,qBAAqB,qBALX,WAQA,EAAL,CAAK,GACV,wBAAuB,uBADb,WCRL,GAAK,GAAL,CAAK,GACV,WAAU,UADA",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var a=(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))(a||{}),p=(_=>(_.SyncWeb3Method="SYNC_WEB3_METHOD",_.DuplicateIframe="DUPLICATE_IFRAME",_.ReactNativeEndpointConfiguration="REACT_NATIVE_ENDPOINT_CONFIGURATION",_.DeprecationNotice="DEPRECATION_NOTICE",_))(p||{}),m=(e=>(e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.MagicLinkFailedVerification=-1e4]="MagicLinkFailedVerification",e[e.MagicLinkExpired=-10001]="MagicLinkExpired",e[e.MagicLinkRateLimited=-10002]="MagicLinkRateLimited",e[e.MagicLinkInvalidRedirectURL=-10006]="MagicLinkInvalidRedirectURL",e[e.UserAlreadyLoggedIn=-10003]="UserAlreadyLoggedIn",e[e.UpdateEmailFailed=-10004]="UpdateEmailFailed",e[e.UserRequestEditEmail=-10005]="UserRequestEditEmail",e[e.InactiveRecipient=-10010]="InactiveRecipient",e[e.AccessDeniedToUser=-10011]="AccessDeniedToUser",e))(m||{});var u=(t=>(t.LoginWithSms="magic_auth_login_with_sms",t.LoginWithMagicLink="magic_auth_login_with_magic_link",t.LoginWithCredential="magic_auth_login_with_credential",t.GetIdToken="magic_auth_get_id_token",t.GenerateIdToken="magic_auth_generate_id_token",t.GetMetadata="magic_auth_get_metadata",t.IsLoggedIn="magic_auth_is_logged_in",t.Logout="magic_auth_logout",t.UpdateEmail="magic_auth_update_email",t.UserSettings="magic_auth_settings",t.UserSettingsTestMode="magic_auth_settings_testing_mode",t.LoginWithSmsTestMode="magic_auth_login_with_sms_testing_mode",t.LoginWithMagicLinkTestMode="magic_login_with_magic_link_testing_mode",t.LoginWithCredentialTestMode="magic_auth_login_with_credential_testing_mode",t.GetIdTokenTestMode="magic_auth_get_id_token_testing_mode",t.GenerateIdTokenTestMode="magic_auth_generate_id_token_testing_mode",t.GetMetadataTestMode="magic_auth_get_metadata_testing_mode",t.IsLoggedInTestMode="magic_auth_is_logged_in_testing_mode",t.LogoutTestMode="magic_auth_logout_testing_mode",t.UpdateEmailTestMode="magic_auth_update_email_testing_mode",t))(u||{});var o=(i=>(i.MAGIC_HANDLE_RESPONSE="MAGIC_HANDLE_RESPONSE",i.MAGIC_OVERLAY_READY="MAGIC_OVERLAY_READY",i.MAGIC_SHOW_OVERLAY="MAGIC_SHOW_OVERLAY",i.MAGIC_HIDE_OVERLAY="MAGIC_HIDE_OVERLAY",i.MAGIC_HANDLE_EVENT="MAGIC_HANDLE_EVENT",i))(o||{}),g=(s=>(s.MAGIC_HANDLE_REQUEST="MAGIC_HANDLE_REQUEST",s))(g||{});var l=(s=>(s.Harmony="HARMONY",s))(l||{});export{l as EthChainType,o as MagicIncomingWindowMessage,g as MagicOutgoingWindowMessage,u as MagicPayloadMethod,m as RPCErrorCode,a as SDKErrorCode,p as SDKWarningCode};
|
|
2
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/core/exception-types.ts", "../../src/core/json-rpc-types.ts", "../../src/core/message-types.ts", "../../src/modules/rpc-provider-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}\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}\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}\n\nexport interface JsonRpcResponsePayload<ResultType = any> {\n jsonrpc: string;\n id: string | number | null;\n result?: ResultType | null;\n error?: JsonRpcError | null;\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 LoginWithMagicLink = 'magic_auth_login_with_magic_link',\n LoginWithCredential = 'magic_auth_login_with_credential',\n GetIdToken = 'magic_auth_get_id_token',\n GenerateIdToken = 'magic_auth_generate_id_token',\n GetMetadata = 'magic_auth_get_metadata',\n IsLoggedIn = 'magic_auth_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 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}\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}\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}\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}\n\n/** The expected message event returned by the Magic iframe context. */\nexport interface MagicMessageEvent extends Partial<MessageEvent> {\n data: MagicMessageResponse;\n}\n", "export type EthNetworkName = 'mainnet' | 'rinkeby' | 'ropsten' | 'kovan';\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"],
|
|
5
|
+
"mappings": "AAAO,GAAK,GAAL,CAAK,GACV,iBAAgB,kBAChB,gBAAgB,kBAChB,oBAAoB,qBACpB,kBAAkB,mBAClB,0BAA0B,4BAC1B,yBAAyB,0BANf,WASA,EAAL,CAAK,GACV,kBAAiB,mBACjB,kBAAkB,mBAClB,mCAAmC,sCACnC,oBAAoB,qBAJV,WAOA,EAAL,CAAK,GAEV,gBAAa,QAAb,aACA,mBAAiB,QAAjB,iBACA,mBAAiB,QAAjB,iBACA,kBAAgB,QAAhB,gBACA,kBAAgB,QAAhB,gBAGA,gCAA8B,MAA9B,8BACA,qBAAmB,QAAnB,mBACA,yBAAuB,QAAvB,uBACA,gCAA8B,QAA9B,8BACA,wBAAsB,QAAtB,sBACA,sBAAoB,QAApB,oBACA,yBAAuB,QAAvB,uBACA,sBAAoB,QAApB,oBACA,uBAAqB,QAArB,qBAjBU,WCyBL,GAAK,GAAL,CAAK,GACV,gBAAe,4BACf,qBAAqB,mCACrB,sBAAsB,mCACtB,aAAa,0BACb,kBAAkB,+BAClB,cAAc,0BACd,aAAa,0BACb,SAAS,oBACT,cAAc,0BACd,eAAe,sBACf,uBAAuB,mCACvB,uBAAuB,yCACvB,6BAA6B,2CAC7B,8BAA8B,gDAC9B,qBAAqB,uCACrB,0BAA0B,4CAC1B,sBAAsB,uCACtB,qBAAqB,uCACrB,iBAAiB,iCACjB,sBAAsB,uCApBZ,WCvCL,GAAK,GAAL,CAAK,GACV,yBAAwB,wBACxB,sBAAsB,sBACtB,qBAAqB,qBACrB,qBAAqB,qBACrB,qBAAqB,qBALX,WAQA,EAAL,CAAK,GACV,wBAAuB,uBADb,WCRL,GAAK,GAAL,CAAK,GACV,WAAU,UADA",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
export declare enum SDKErrorCode {
|
|
2
|
-
MissingApiKey = "MISSING_API_KEY",
|
|
3
|
-
ModalNotReady = "MODAL_NOT_READY",
|
|
4
|
-
MalformedResponse = "MALFORMED_RESPONSE",
|
|
5
|
-
InvalidArgument = "INVALID_ARGUMENT",
|
|
6
|
-
ExtensionNotInitialized = "EXTENSION_NOT_INITIALIZED",
|
|
7
|
-
IncompatibleExtensions = "INCOMPATIBLE_EXTENSIONS"
|
|
8
|
-
}
|
|
9
|
-
export declare enum SDKWarningCode {
|
|
10
|
-
SyncWeb3Method = "SYNC_WEB3_METHOD",
|
|
11
|
-
DuplicateIframe = "DUPLICATE_IFRAME",
|
|
12
|
-
ReactNativeEndpointConfiguration = "REACT_NATIVE_ENDPOINT_CONFIGURATION",
|
|
13
|
-
DeprecationNotice = "DEPRECATION_NOTICE"
|
|
14
|
-
}
|
|
15
|
-
export declare enum RPCErrorCode {
|
|
16
|
-
ParseError = -32700,
|
|
17
|
-
InvalidRequest = -32600,
|
|
18
|
-
MethodNotFound = -32601,
|
|
19
|
-
InvalidParams = -32602,
|
|
20
|
-
InternalError = -32603,
|
|
21
|
-
MagicLinkFailedVerification = -10000,
|
|
22
|
-
MagicLinkExpired = -10001,
|
|
23
|
-
MagicLinkRateLimited = -10002,
|
|
24
|
-
MagicLinkInvalidRedirectURL = -10006,
|
|
25
|
-
UserAlreadyLoggedIn = -10003,
|
|
26
|
-
UpdateEmailFailed = -10004,
|
|
27
|
-
UserRequestEditEmail = -10005,
|
|
28
|
-
InactiveRecipient = -10010,
|
|
29
|
-
AccessDeniedToUser = -10011
|
|
30
|
-
}
|
|
31
|
-
export declare type ErrorCode = SDKErrorCode | RPCErrorCode;
|
|
32
|
-
export declare type WarningCode = SDKWarningCode;
|
|
1
|
+
export declare enum SDKErrorCode {
|
|
2
|
+
MissingApiKey = "MISSING_API_KEY",
|
|
3
|
+
ModalNotReady = "MODAL_NOT_READY",
|
|
4
|
+
MalformedResponse = "MALFORMED_RESPONSE",
|
|
5
|
+
InvalidArgument = "INVALID_ARGUMENT",
|
|
6
|
+
ExtensionNotInitialized = "EXTENSION_NOT_INITIALIZED",
|
|
7
|
+
IncompatibleExtensions = "INCOMPATIBLE_EXTENSIONS"
|
|
8
|
+
}
|
|
9
|
+
export declare enum SDKWarningCode {
|
|
10
|
+
SyncWeb3Method = "SYNC_WEB3_METHOD",
|
|
11
|
+
DuplicateIframe = "DUPLICATE_IFRAME",
|
|
12
|
+
ReactNativeEndpointConfiguration = "REACT_NATIVE_ENDPOINT_CONFIGURATION",
|
|
13
|
+
DeprecationNotice = "DEPRECATION_NOTICE"
|
|
14
|
+
}
|
|
15
|
+
export declare enum RPCErrorCode {
|
|
16
|
+
ParseError = -32700,
|
|
17
|
+
InvalidRequest = -32600,
|
|
18
|
+
MethodNotFound = -32601,
|
|
19
|
+
InvalidParams = -32602,
|
|
20
|
+
InternalError = -32603,
|
|
21
|
+
MagicLinkFailedVerification = -10000,
|
|
22
|
+
MagicLinkExpired = -10001,
|
|
23
|
+
MagicLinkRateLimited = -10002,
|
|
24
|
+
MagicLinkInvalidRedirectURL = -10006,
|
|
25
|
+
UserAlreadyLoggedIn = -10003,
|
|
26
|
+
UpdateEmailFailed = -10004,
|
|
27
|
+
UserRequestEditEmail = -10005,
|
|
28
|
+
InactiveRecipient = -10010,
|
|
29
|
+
AccessDeniedToUser = -10011
|
|
30
|
+
}
|
|
31
|
+
export declare type ErrorCode = SDKErrorCode | RPCErrorCode;
|
|
32
|
+
export declare type WarningCode = SDKWarningCode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare type SupportedLocale = 'en_US' | 'pl_PL' | 'af' | 'az' | 'ca' | 'cy' | 'da' | 'de' | 'et' | 'en' | 'es' | 'fr' | 'hr' | 'id' | 'it' | 'lv' | 'lt' | 'hu' | 'nl' | 'no' | 'pl' | 'pt' | 'ro' | 'sk' | 'sl' | 'fi' | 'sv' | 'tr' | 'vi' | 'cs' | 'el' | 'bg' | 'mk' | 'ru' | 'sr' | 'th' | 'zh_TW' | 'zh_CN' | 'ja' | 'ko';
|
|
1
|
+
export declare type SupportedLocale = 'en_US' | 'pl_PL' | 'af' | 'az' | 'ca' | 'cy' | 'da' | 'de' | 'et' | 'en' | 'es' | 'fr' | 'hr' | 'id' | 'it' | 'lv' | 'lt' | 'hu' | 'nl' | 'no' | 'pl' | 'pt' | 'ro' | 'sk' | 'sl' | 'fi' | 'sv' | 'tr' | 'vi' | 'cs' | 'el' | 'bg' | 'mk' | 'ru' | 'sr' | 'th' | 'zh_TW' | 'zh_CN' | 'ja' | 'ko';
|
|
@@ -1,53 +1,51 @@
|
|
|
1
|
-
import { RPCErrorCode } from './exception-types';
|
|
2
|
-
export interface JsonRpcRequestPayload<TParams = any> {
|
|
3
|
-
jsonrpc: string;
|
|
4
|
-
id: string | number | null;
|
|
5
|
-
method: string;
|
|
6
|
-
params?: TParams;
|
|
7
|
-
}
|
|
8
|
-
export interface JsonRpcRequestCallback {
|
|
9
|
-
/** Callback executed upon JSON RPC response. */
|
|
10
|
-
(err: JsonRpcError | null, result?: JsonRpcResponsePayload | null): void;
|
|
11
|
-
}
|
|
12
|
-
export interface JsonRpcBatchRequestCallback {
|
|
13
|
-
/** Callback executed upon JSON RPC response. */
|
|
14
|
-
(err: JsonRpcError | null, result?: (JsonRpcResponsePayload | null)[] | null): void;
|
|
15
|
-
}
|
|
16
|
-
export interface JsonRpcError {
|
|
17
|
-
message: string;
|
|
18
|
-
code: RPCErrorCode;
|
|
19
|
-
}
|
|
20
|
-
export interface JsonRpcResponsePayload<ResultType = any> {
|
|
21
|
-
jsonrpc: string;
|
|
22
|
-
id: string | number | null;
|
|
23
|
-
result?: ResultType | null;
|
|
24
|
-
error?: JsonRpcError | null;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Enum of JSON RPC methods for interacting with the Magic SDK authentication
|
|
28
|
-
* relayer.
|
|
29
|
-
*/
|
|
30
|
-
export declare enum MagicPayloadMethod {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
LoginWithSmsTestMode = "magic_auth_login_with_sms_testing_mode",
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
UpdateEmailTestMode = "magic_auth_update_email_testing_mode"
|
|
53
|
-
}
|
|
1
|
+
import { RPCErrorCode } from './exception-types';
|
|
2
|
+
export interface JsonRpcRequestPayload<TParams = any> {
|
|
3
|
+
jsonrpc: string;
|
|
4
|
+
id: string | number | null;
|
|
5
|
+
method: string;
|
|
6
|
+
params?: TParams;
|
|
7
|
+
}
|
|
8
|
+
export interface JsonRpcRequestCallback {
|
|
9
|
+
/** Callback executed upon JSON RPC response. */
|
|
10
|
+
(err: JsonRpcError | null, result?: JsonRpcResponsePayload | null): void;
|
|
11
|
+
}
|
|
12
|
+
export interface JsonRpcBatchRequestCallback {
|
|
13
|
+
/** Callback executed upon JSON RPC response. */
|
|
14
|
+
(err: JsonRpcError | null, result?: (JsonRpcResponsePayload | null)[] | null): void;
|
|
15
|
+
}
|
|
16
|
+
export interface JsonRpcError {
|
|
17
|
+
message: string;
|
|
18
|
+
code: RPCErrorCode;
|
|
19
|
+
}
|
|
20
|
+
export interface JsonRpcResponsePayload<ResultType = any> {
|
|
21
|
+
jsonrpc: string;
|
|
22
|
+
id: string | number | null;
|
|
23
|
+
result?: ResultType | null;
|
|
24
|
+
error?: JsonRpcError | null;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Enum of JSON RPC methods for interacting with the Magic SDK authentication
|
|
28
|
+
* relayer.
|
|
29
|
+
*/
|
|
30
|
+
export declare enum MagicPayloadMethod {
|
|
31
|
+
LoginWithSms = "magic_auth_login_with_sms",
|
|
32
|
+
LoginWithMagicLink = "magic_auth_login_with_magic_link",
|
|
33
|
+
LoginWithCredential = "magic_auth_login_with_credential",
|
|
34
|
+
GetIdToken = "magic_auth_get_id_token",
|
|
35
|
+
GenerateIdToken = "magic_auth_generate_id_token",
|
|
36
|
+
GetMetadata = "magic_auth_get_metadata",
|
|
37
|
+
IsLoggedIn = "magic_auth_is_logged_in",
|
|
38
|
+
Logout = "magic_auth_logout",
|
|
39
|
+
UpdateEmail = "magic_auth_update_email",
|
|
40
|
+
UserSettings = "magic_auth_settings",
|
|
41
|
+
UserSettingsTestMode = "magic_auth_settings_testing_mode",
|
|
42
|
+
LoginWithSmsTestMode = "magic_auth_login_with_sms_testing_mode",
|
|
43
|
+
LoginWithMagicLinkTestMode = "magic_login_with_magic_link_testing_mode",
|
|
44
|
+
LoginWithCredentialTestMode = "magic_auth_login_with_credential_testing_mode",
|
|
45
|
+
GetIdTokenTestMode = "magic_auth_get_id_token_testing_mode",
|
|
46
|
+
GenerateIdTokenTestMode = "magic_auth_generate_id_token_testing_mode",
|
|
47
|
+
GetMetadataTestMode = "magic_auth_get_metadata_testing_mode",
|
|
48
|
+
IsLoggedInTestMode = "magic_auth_is_logged_in_testing_mode",
|
|
49
|
+
LogoutTestMode = "magic_auth_logout_testing_mode",
|
|
50
|
+
UpdateEmailTestMode = "magic_auth_update_email_testing_mode"
|
|
51
|
+
}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { JsonRpcResponsePayload, JsonRpcError, JsonRpcRequestPayload } from './json-rpc-types';
|
|
2
|
-
export declare enum MagicIncomingWindowMessage {
|
|
3
|
-
MAGIC_HANDLE_RESPONSE = "MAGIC_HANDLE_RESPONSE",
|
|
4
|
-
MAGIC_OVERLAY_READY = "MAGIC_OVERLAY_READY",
|
|
5
|
-
MAGIC_SHOW_OVERLAY = "MAGIC_SHOW_OVERLAY",
|
|
6
|
-
MAGIC_HIDE_OVERLAY = "MAGIC_HIDE_OVERLAY",
|
|
7
|
-
MAGIC_HANDLE_EVENT = "MAGIC_HANDLE_EVENT"
|
|
8
|
-
}
|
|
9
|
-
export declare enum MagicOutgoingWindowMessage {
|
|
10
|
-
MAGIC_HANDLE_REQUEST = "MAGIC_HANDLE_REQUEST"
|
|
11
|
-
}
|
|
12
|
-
/** The shape of responding window message datas from the Magic iframe context. */
|
|
13
|
-
export interface MagicMessageRequest {
|
|
14
|
-
msgType: string;
|
|
15
|
-
payload: JsonRpcRequestPayload | JsonRpcRequestPayload[];
|
|
16
|
-
rt?: string;
|
|
17
|
-
jwt?: string;
|
|
18
|
-
}
|
|
19
|
-
/** The shape of responding window message datas from the Magic iframe context. */
|
|
20
|
-
export interface MagicMessageResponse<ResultType = any> {
|
|
21
|
-
msgType: string;
|
|
22
|
-
response: Partial<JsonRpcError> & Partial<JsonRpcResponsePayload<ResultType>>;
|
|
23
|
-
rt?: string;
|
|
24
|
-
}
|
|
25
|
-
/** The expected message event returned by the Magic iframe context. */
|
|
26
|
-
export interface MagicMessageEvent extends Partial<MessageEvent> {
|
|
27
|
-
data: MagicMessageResponse;
|
|
28
|
-
}
|
|
1
|
+
import { JsonRpcResponsePayload, JsonRpcError, JsonRpcRequestPayload } from './json-rpc-types';
|
|
2
|
+
export declare enum MagicIncomingWindowMessage {
|
|
3
|
+
MAGIC_HANDLE_RESPONSE = "MAGIC_HANDLE_RESPONSE",
|
|
4
|
+
MAGIC_OVERLAY_READY = "MAGIC_OVERLAY_READY",
|
|
5
|
+
MAGIC_SHOW_OVERLAY = "MAGIC_SHOW_OVERLAY",
|
|
6
|
+
MAGIC_HIDE_OVERLAY = "MAGIC_HIDE_OVERLAY",
|
|
7
|
+
MAGIC_HANDLE_EVENT = "MAGIC_HANDLE_EVENT"
|
|
8
|
+
}
|
|
9
|
+
export declare enum MagicOutgoingWindowMessage {
|
|
10
|
+
MAGIC_HANDLE_REQUEST = "MAGIC_HANDLE_REQUEST"
|
|
11
|
+
}
|
|
12
|
+
/** The shape of responding window message datas from the Magic iframe context. */
|
|
13
|
+
export interface MagicMessageRequest {
|
|
14
|
+
msgType: string;
|
|
15
|
+
payload: JsonRpcRequestPayload | JsonRpcRequestPayload[];
|
|
16
|
+
rt?: string;
|
|
17
|
+
jwt?: string;
|
|
18
|
+
}
|
|
19
|
+
/** The shape of responding window message datas from the Magic iframe context. */
|
|
20
|
+
export interface MagicMessageResponse<ResultType = any> {
|
|
21
|
+
msgType: string;
|
|
22
|
+
response: Partial<JsonRpcError> & Partial<JsonRpcResponsePayload<ResultType>>;
|
|
23
|
+
rt?: string;
|
|
24
|
+
}
|
|
25
|
+
/** The expected message event returned by the Magic iframe context. */
|
|
26
|
+
export interface MagicMessageEvent extends Partial<MessageEvent> {
|
|
27
|
+
data: MagicMessageResponse;
|
|
28
|
+
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { EthNetworkConfiguration } from '../modules/rpc-provider-types';
|
|
2
|
-
/**
|
|
3
|
-
* The shape of encoded query parameters sent along with the `<iframe>` request.
|
|
4
|
-
*/
|
|
5
|
-
export interface QueryParameters {
|
|
6
|
-
API_KEY?: string;
|
|
7
|
-
DOMAIN_ORIGIN?: string;
|
|
8
|
-
ETH_NETWORK?: EthNetworkConfiguration;
|
|
9
|
-
host?: string;
|
|
10
|
-
sdk?: string;
|
|
11
|
-
version?: string;
|
|
12
|
-
ext?: any;
|
|
13
|
-
locale?: string;
|
|
14
|
-
}
|
|
1
|
+
import { EthNetworkConfiguration } from '../modules/rpc-provider-types';
|
|
2
|
+
/**
|
|
3
|
+
* The shape of encoded query parameters sent along with the `<iframe>` request.
|
|
4
|
+
*/
|
|
5
|
+
export interface QueryParameters {
|
|
6
|
+
API_KEY?: string;
|
|
7
|
+
DOMAIN_ORIGIN?: string;
|
|
8
|
+
ETH_NETWORK?: EthNetworkConfiguration;
|
|
9
|
+
host?: string;
|
|
10
|
+
sdk?: string;
|
|
11
|
+
version?: string;
|
|
12
|
+
ext?: any;
|
|
13
|
+
locale?: string;
|
|
14
|
+
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export * from './core/exception-types';
|
|
2
|
-
export * from './core/i18n';
|
|
3
|
-
export * from './core/json-rpc-types';
|
|
4
|
-
export * from './core/message-types';
|
|
5
|
-
export * from './core/query-types';
|
|
6
|
-
export * from './modules/auth-types';
|
|
7
|
-
export * from './modules/rpc-provider-types';
|
|
8
|
-
export * from './modules/user-types';
|
|
1
|
+
export * from './core/exception-types';
|
|
2
|
+
export * from './core/i18n';
|
|
3
|
+
export * from './core/json-rpc-types';
|
|
4
|
+
export * from './core/message-types';
|
|
5
|
+
export * from './core/query-types';
|
|
6
|
+
export * from './modules/auth-types';
|
|
7
|
+
export * from './modules/rpc-provider-types';
|
|
8
|
+
export * from './modules/user-types';
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
export interface LoginWithMagicLinkConfiguration {
|
|
2
|
-
/**
|
|
3
|
-
* The email address of the user attempting to login.
|
|
4
|
-
*/
|
|
5
|
-
email: string;
|
|
6
|
-
/**
|
|
7
|
-
* When `true`, a pre-built modal interface will show to the user, directing
|
|
8
|
-
* them to check their email for the "magic link" to complete their
|
|
9
|
-
* authentication.
|
|
10
|
-
*/
|
|
11
|
-
showUI?: boolean;
|
|
12
|
-
/**
|
|
13
|
-
* You can optionally provide a redirect URI that will be followed at the end
|
|
14
|
-
* of the magic link flow. Don't forget to invoke
|
|
15
|
-
* `magic.auth.loginWithCredential()` to complete the login from the route you
|
|
16
|
-
* configure here.
|
|
17
|
-
*/
|
|
18
|
-
redirectURI?: string;
|
|
19
|
-
}
|
|
20
|
-
export interface LoginWithSmsConfiguration {
|
|
21
|
-
phoneNumber: string;
|
|
22
|
-
}
|
|
1
|
+
export interface LoginWithMagicLinkConfiguration {
|
|
2
|
+
/**
|
|
3
|
+
* The email address of the user attempting to login.
|
|
4
|
+
*/
|
|
5
|
+
email: string;
|
|
6
|
+
/**
|
|
7
|
+
* When `true`, a pre-built modal interface will show to the user, directing
|
|
8
|
+
* them to check their email for the "magic link" to complete their
|
|
9
|
+
* authentication.
|
|
10
|
+
*/
|
|
11
|
+
showUI?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* You can optionally provide a redirect URI that will be followed at the end
|
|
14
|
+
* of the magic link flow. Don't forget to invoke
|
|
15
|
+
* `magic.auth.loginWithCredential()` to complete the login from the route you
|
|
16
|
+
* configure here.
|
|
17
|
+
*/
|
|
18
|
+
redirectURI?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface LoginWithSmsConfiguration {
|
|
21
|
+
phoneNumber: string;
|
|
22
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export declare type EthNetworkName = 'mainnet' | 'rinkeby' | 'ropsten' | 'kovan';
|
|
2
|
-
export declare enum EthChainType {
|
|
3
|
-
Harmony = "HARMONY"
|
|
4
|
-
}
|
|
5
|
-
export interface CustomNodeConfiguration {
|
|
6
|
-
rpcUrl: string;
|
|
7
|
-
chainId?: number;
|
|
8
|
-
chainType?: EthChainType;
|
|
9
|
-
}
|
|
10
|
-
export declare type EthNetworkConfiguration = EthNetworkName | CustomNodeConfiguration;
|
|
1
|
+
export declare type EthNetworkName = 'mainnet' | 'rinkeby' | 'ropsten' | 'kovan';
|
|
2
|
+
export declare enum EthChainType {
|
|
3
|
+
Harmony = "HARMONY"
|
|
4
|
+
}
|
|
5
|
+
export interface CustomNodeConfiguration {
|
|
6
|
+
rpcUrl: string;
|
|
7
|
+
chainId?: number;
|
|
8
|
+
chainType?: EthChainType;
|
|
9
|
+
}
|
|
10
|
+
export declare type EthNetworkConfiguration = EthNetworkName | CustomNodeConfiguration;
|
|
@@ -1,41 +1,42 @@
|
|
|
1
|
-
export interface GetIdTokenConfiguration {
|
|
2
|
-
/**
|
|
3
|
-
* The number of seconds until the generated ID token will expire.
|
|
4
|
-
*/
|
|
5
|
-
lifespan?: number;
|
|
6
|
-
}
|
|
7
|
-
export interface GenerateIdTokenConfiguration extends GetIdTokenConfiguration {
|
|
8
|
-
/**
|
|
9
|
-
* An optional piece of data to sign with the token. Note, however, that the
|
|
10
|
-
* unsigned data _will not_ be encoded in the token, only an encrypted
|
|
11
|
-
* signature of the data.
|
|
12
|
-
*/
|
|
13
|
-
attachment?: string;
|
|
14
|
-
}
|
|
15
|
-
export interface MagicUserMetadata {
|
|
16
|
-
issuer: string | null;
|
|
17
|
-
publicAddress: string | null;
|
|
18
|
-
email: string | null;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
1
|
+
export interface GetIdTokenConfiguration {
|
|
2
|
+
/**
|
|
3
|
+
* The number of seconds until the generated ID token will expire.
|
|
4
|
+
*/
|
|
5
|
+
lifespan?: number;
|
|
6
|
+
}
|
|
7
|
+
export interface GenerateIdTokenConfiguration extends GetIdTokenConfiguration {
|
|
8
|
+
/**
|
|
9
|
+
* An optional piece of data to sign with the token. Note, however, that the
|
|
10
|
+
* unsigned data _will not_ be encoded in the token, only an encrypted
|
|
11
|
+
* signature of the data.
|
|
12
|
+
*/
|
|
13
|
+
attachment?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface MagicUserMetadata {
|
|
16
|
+
issuer: string | null;
|
|
17
|
+
publicAddress: string | null;
|
|
18
|
+
email: string | null;
|
|
19
|
+
phoneNumber: string | null;
|
|
20
|
+
}
|
|
21
|
+
export interface UpdateEmailConfiguration {
|
|
22
|
+
/**
|
|
23
|
+
* The new email address to update to
|
|
24
|
+
*/
|
|
25
|
+
email: string;
|
|
26
|
+
/**
|
|
27
|
+
* When `true`, a pre-built pending modal interface will
|
|
28
|
+
* guide the user to check their new, followed by old emails
|
|
29
|
+
* for confirmation emails.
|
|
30
|
+
*/
|
|
31
|
+
showUI?: boolean;
|
|
32
|
+
}
|
|
33
|
+
export interface UpdateWebAuthnInfoConfiguration {
|
|
34
|
+
/**
|
|
35
|
+
* WebAuthn info id
|
|
36
|
+
*/
|
|
37
|
+
id: string;
|
|
38
|
+
/**
|
|
39
|
+
* nickname that user attempts to update to the webauth device associate to the id.
|
|
40
|
+
*/
|
|
41
|
+
nickname: string;
|
|
42
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@magic-sdk/types",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.1.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",
|
|
@@ -10,14 +10,15 @@
|
|
|
10
10
|
},
|
|
11
11
|
"homepage": "https://magic.link",
|
|
12
12
|
"files": [
|
|
13
|
-
"dist
|
|
14
|
-
"dist/**/*.js.map",
|
|
15
|
-
"dist/**/*.d.ts"
|
|
13
|
+
"dist"
|
|
16
14
|
],
|
|
17
|
-
"target": "
|
|
15
|
+
"target": "browser",
|
|
18
16
|
"main": "./dist/cjs/index.js",
|
|
19
17
|
"module": "./dist/es/index.js",
|
|
20
|
-
"exports": "./dist/modern/index.js",
|
|
21
18
|
"types": "./dist/types/index.d.ts",
|
|
22
|
-
"
|
|
19
|
+
"exports": {
|
|
20
|
+
"import": "./dist/es/index.mjs",
|
|
21
|
+
"require": "./dist/cjs/index.js"
|
|
22
|
+
},
|
|
23
|
+
"gitHead": "6aa5a25b33865cfe27444ca6094efade16a82f9f"
|
|
23
24
|
}
|
package/dist/modern/index.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var e,i,t,a,_,n,o;!function(e){e.MissingApiKey="MISSING_API_KEY",e.ModalNotReady="MODAL_NOT_READY",e.MalformedResponse="MALFORMED_RESPONSE",e.InvalidArgument="INVALID_ARGUMENT",e.ExtensionNotInitialized="EXTENSION_NOT_INITIALIZED",e.IncompatibleExtensions="INCOMPATIBLE_EXTENSIONS"}(e||(e={})),function(e){e.SyncWeb3Method="SYNC_WEB3_METHOD",e.DuplicateIframe="DUPLICATE_IFRAME",e.ReactNativeEndpointConfiguration="REACT_NATIVE_ENDPOINT_CONFIGURATION",e.DeprecationNotice="DEPRECATION_NOTICE"}(i||(i={})),function(e){e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.MagicLinkFailedVerification=-1e4]="MagicLinkFailedVerification",e[e.MagicLinkExpired=-10001]="MagicLinkExpired",e[e.MagicLinkRateLimited=-10002]="MagicLinkRateLimited",e[e.MagicLinkInvalidRedirectURL=-10006]="MagicLinkInvalidRedirectURL",e[e.UserAlreadyLoggedIn=-10003]="UserAlreadyLoggedIn",e[e.UpdateEmailFailed=-10004]="UpdateEmailFailed",e[e.UserRequestEditEmail=-10005]="UserRequestEditEmail",e[e.InactiveRecipient=-10010]="InactiveRecipient",e[e.AccessDeniedToUser=-10011]="AccessDeniedToUser"}(t||(t={})),function(e){e.EnableMfa="magic_auth_enable_mfa_flow",e.DisableMfa="magic_auth_disable_mfa_flow",e.LoginWithSms="magic_auth_login_with_sms",e.LoginWithMagicLink="magic_auth_login_with_magic_link",e.LoginWithCredential="magic_auth_login_with_credential",e.GetIdToken="magic_auth_get_id_token",e.GenerateIdToken="magic_auth_generate_id_token",e.GetMetadata="magic_auth_get_metadata",e.IsLoggedIn="magic_auth_is_logged_in",e.Logout="magic_auth_logout",e.UpdateEmail="magic_auth_update_email",e.LoginWithSmsTestMode="magic_auth_login_with_sms_testing_mode",e.EnableMfaTestMode="magic_auth_enable_mfa_flow_testing_mode",e.DisableMfaTestMode="magic_auth_disable_mfa_flow_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"}(a||(a={})),function(e){e.MAGIC_HANDLE_RESPONSE="MAGIC_HANDLE_RESPONSE",e.MAGIC_OVERLAY_READY="MAGIC_OVERLAY_READY",e.MAGIC_SHOW_OVERLAY="MAGIC_SHOW_OVERLAY",e.MAGIC_HIDE_OVERLAY="MAGIC_HIDE_OVERLAY",e.MAGIC_HANDLE_EVENT="MAGIC_HANDLE_EVENT"}(_||(_={})),function(e){e.MAGIC_HANDLE_REQUEST="MAGIC_HANDLE_REQUEST"}(n||(n={})),function(e){e.Harmony="HARMONY"}(o||(o={}));export{o as EthChainType,_ as MagicIncomingWindowMessage,n as MagicOutgoingWindowMessage,a as MagicPayloadMethod,t as RPCErrorCode,e as SDKErrorCode,i as SDKWarningCode};
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
package/dist/modern/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/core/exception-types.ts","../../src/core/json-rpc-types.ts","../../src/core/message-types.ts","../../src/modules/rpc-provider-types.ts"],"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}\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}\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}\n\nexport interface JsonRpcResponsePayload<ResultType = any> {\n jsonrpc: string;\n id: string | number | null;\n result?: ResultType | null;\n error?: JsonRpcError | null;\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 EnableMfa = 'magic_auth_enable_mfa_flow',\n DisableMfa = 'magic_auth_disable_mfa_flow',\n LoginWithSms = 'magic_auth_login_with_sms',\n LoginWithMagicLink = 'magic_auth_login_with_magic_link',\n LoginWithCredential = 'magic_auth_login_with_credential',\n GetIdToken = 'magic_auth_get_id_token',\n GenerateIdToken = 'magic_auth_generate_id_token',\n GetMetadata = 'magic_auth_get_metadata',\n IsLoggedIn = 'magic_auth_is_logged_in',\n Logout = 'magic_auth_logout',\n UpdateEmail = 'magic_auth_update_email',\n LoginWithSmsTestMode = 'magic_auth_login_with_sms_testing_mode',\n EnableMfaTestMode = 'magic_auth_enable_mfa_flow_testing_mode',\n DisableMfaTestMode = 'magic_auth_disable_mfa_flow_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}\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}\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}\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}\n\n/** The expected message event returned by the Magic iframe context. */\nexport interface MagicMessageEvent extends Partial<MessageEvent> {\n data: MagicMessageResponse;\n}\n","export type EthNetworkName = 'mainnet' | 'rinkeby' | 'ropsten' | 'kovan';\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"],"names":["SDKErrorCode","SDKWarningCode","RPCErrorCode","MagicPayloadMethod","MagicIncomingWindowMessage","MagicOutgoingWindowMessage","EthChainType"],"mappings":"AAAYA,IAAAA,EASAC,EAOAC,ECyBAC,ECvCAC,EAQAC,ECRAC,GHFZ,SAAYN,GACVA,kCACAA,kCACAA,yCACAA,qCACAA,sDACAA,mDANF,CAAYA,IAAAA,OASZ,SAAYC,GACVA,oCACAA,qCACAA,yEACAA,yCAJF,CAAYA,IAAAA,OAOZ,SAAYC,GAEVA,oCACAA,4CACAA,4CACAA,0CACAA,0CAGAA,oEACAA,gDACAA,wDACAA,sEACAA,sDACAA,kDACAA,wDACAA,kDACAA,oDAjBF,CAAYA,IAAAA,OCyBZ,SAAYC,GACVA,yCACAA,2CACAA,2CACAA,wDACAA,yDACAA,uCACAA,iDACAA,wCACAA,uCACAA,6BACAA,wCACAA,gEACAA,8DACAA,gEACAA,wEACAA,8EACAA,4DACAA,sEACAA,6DACAA,4DACAA,kDACAA,6DAtBF,CAAYA,IAAAA,OCvCZ,SAAYC,GACVA,gDACAA,4CACAA,0CACAA,0CACAA,0CALF,CAAYA,IAAAA,OAQZ,SAAYC,GACVA,8CADF,CAAYA,IAAAA,OCRZ,SAAYC,GACVA,oBADF,CAAYA,IAAAA"}
|