@magic-sdk/provider 30.0.0-canary.879.15766542943.0 → 30.0.0-canary.915.16785411847.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 +3 -3
- package/dist/cjs/index.js.map +4 -4
- package/dist/es/index.js +3 -3
- package/dist/es/index.js.map +4 -4
- package/dist/es/index.mjs +3 -3
- package/dist/es/index.mjs.map +4 -4
- package/dist/types/core/sdk.d.ts +3 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/modules/base-extension.d.ts +11 -1
- package/dist/types/modules/user.d.ts +5 -0
- package/dist/types/util/promise-tools.d.ts +1 -1
- package/dist/types/util/type-guards.d.ts +1 -1
- package/package.json +3 -3
package/dist/types/core/sdk.d.ts
CHANGED
|
@@ -19,6 +19,9 @@ export interface MagicSDKAdditionalConfiguration<TCustomExtName extends string =
|
|
|
19
19
|
deferPreload?: boolean;
|
|
20
20
|
useStorageCache?: boolean;
|
|
21
21
|
meta?: any;
|
|
22
|
+
authConfig?: {
|
|
23
|
+
skipDIDToken: boolean;
|
|
24
|
+
};
|
|
22
25
|
}
|
|
23
26
|
export declare class SDKBase {
|
|
24
27
|
readonly apiKey: string;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -3,6 +3,6 @@ export type { MagicSDKAdditionalConfiguration, MagicSDKExtensionsOption } from '
|
|
|
3
3
|
export { createSDK } from './core/sdk-environment';
|
|
4
4
|
export { ViewController } from './core/view-controller';
|
|
5
5
|
export * from './core/sdk-exceptions';
|
|
6
|
-
export { Extension } from './modules/base-extension';
|
|
6
|
+
export { Extension, MultichainExtension } from './modules/base-extension';
|
|
7
7
|
export type { WithExtensions, InstanceWithExtensions } from './modules/base-extension';
|
|
8
8
|
export * from './util';
|
|
@@ -3,7 +3,7 @@ import { BaseModule } from './base-module';
|
|
|
3
3
|
import { SDKBase, MagicSDKAdditionalConfiguration, MagicSDKExtensionsOption } from '../core/sdk';
|
|
4
4
|
import { MagicExtensionError, MagicExtensionWarning } from '../core/sdk-exceptions';
|
|
5
5
|
import { createPromiEvent, encodeJSON, decodeJSON, storage, isPromiEvent } from '../util';
|
|
6
|
-
export declare abstract class BaseExtension<TName extends string> extends BaseModule {
|
|
6
|
+
export declare abstract class BaseExtension<TName extends string, TConfig extends any = any> extends BaseModule {
|
|
7
7
|
/**
|
|
8
8
|
* A structure describing the platform and version compatibility of this
|
|
9
9
|
* extension.
|
|
@@ -15,6 +15,7 @@ export declare abstract class BaseExtension<TName extends string> extends BaseMo
|
|
|
15
15
|
'@magic-sdk/react-native-expo': boolean | string;
|
|
16
16
|
};
|
|
17
17
|
abstract readonly name: TName;
|
|
18
|
+
abstract readonly config: TConfig;
|
|
18
19
|
private __sdk_access_field_descriptors__;
|
|
19
20
|
private __is_initialized__;
|
|
20
21
|
protected utils: {
|
|
@@ -76,6 +77,15 @@ export declare class Extension {
|
|
|
76
77
|
*/
|
|
77
78
|
static Internal: typeof InternalExtension;
|
|
78
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* Base class for multi-chain extensions, extracting getPublicAddress logic.
|
|
82
|
+
*/
|
|
83
|
+
export declare abstract class MultichainExtension<TName extends string, TConfig extends any = any> extends InternalExtension<TName, TConfig> {
|
|
84
|
+
readonly config: TConfig;
|
|
85
|
+
readonly chain: string;
|
|
86
|
+
constructor(config: TConfig, chain: string);
|
|
87
|
+
getPublicAddress<ResultType = any>(): Promise<ResultType>;
|
|
88
|
+
}
|
|
79
89
|
/**
|
|
80
90
|
* These fields are exposed on the `Extension` type,
|
|
81
91
|
* but should be hidden from the public interface.
|
|
@@ -38,6 +38,11 @@ export declare class UserModule extends BaseModule {
|
|
|
38
38
|
"recovery-factor-already-exists": () => void;
|
|
39
39
|
"malformed-phone-number": () => void;
|
|
40
40
|
"invalid-otp-code": () => void;
|
|
41
|
+
"recovery-factor-updated": (updatedFactor: {
|
|
42
|
+
type: string;
|
|
43
|
+
value: string;
|
|
44
|
+
}) => void;
|
|
45
|
+
"recovery-factor-deleted": () => void;
|
|
41
46
|
} & import("@magic-sdk/types").RecencyCheckEventHandlers & {
|
|
42
47
|
done: (result: string | null) => void;
|
|
43
48
|
error: (reason: any) => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UserEventsEmit } from '@magic-sdk/types';
|
|
2
2
|
import { TypedEmitter, EventsDefinition } from './events';
|
|
3
3
|
/**
|
|
4
|
-
* Extends `Promise` with a polymorphic `this` type to
|
|
4
|
+
* Extends `Promise` with a polymorphic `this` type to accommodate arbitrary
|
|
5
5
|
* `Promise` API extensions.
|
|
6
6
|
*/
|
|
7
7
|
interface ExtendedPromise<T> extends Promise<T> {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* This file contains our type guards.
|
|
3
3
|
*
|
|
4
4
|
* Type guards are a feature of TypeScript which narrow the type signature of
|
|
5
|
-
*
|
|
5
|
+
* intersection types (types that can be one thing or another).
|
|
6
6
|
*
|
|
7
7
|
* @see
|
|
8
8
|
* https://www.typescriptlang.org/docs/handbook/advanced-types.html#type-guards-and-differentiating-types
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@magic-sdk/provider",
|
|
3
|
-
"version": "30.0.0-canary.
|
|
3
|
+
"version": "30.0.0-canary.915.16785411847.0",
|
|
4
4
|
"description": "Core business logic for Magic SDK packages.",
|
|
5
5
|
"author": "Magic Labs <team@magic.link> (https://magic.link/)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -32,11 +32,11 @@
|
|
|
32
32
|
"tslib": "^2.3.1"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@magic-sdk/types": "
|
|
35
|
+
"@magic-sdk/types": "^24.21.0",
|
|
36
36
|
"eventemitter3": "^4.0.4"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"localforage": "^1.7.4"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "9cf0779be8b355d761a4dab41c5863e6369f9efb"
|
|
42
42
|
}
|