@farcaster/frame-core 0.0.23 → 0.0.24
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/actions/ViewProfile.d.ts +4 -0
- package/dist/actions/ViewProfile.js +2 -0
- package/dist/actions/index.d.ts +1 -0
- package/dist/actions/index.js +2 -1
- package/dist/types.d.ts +3 -1
- package/esm/actions/AddFrame.d.ts +23 -27
- package/esm/actions/AddFrame.js +9 -9
- package/esm/actions/SignIn.d.ts +33 -35
- package/esm/actions/SignIn.js +5 -5
- package/esm/actions/ViewProfile.d.ts +4 -0
- package/esm/actions/ViewProfile.js +1 -0
- package/esm/actions/index.d.ts +3 -2
- package/esm/actions/index.js +3 -2
- package/esm/context.d.ts +61 -65
- package/esm/context.js +1 -1
- package/esm/errors.d.ts +7 -9
- package/esm/errors.js +6 -6
- package/esm/index.d.ts +4 -4
- package/esm/index.js +4 -4
- package/esm/internal/types.d.ts +7 -18
- package/esm/internal/types.js +1 -1
- package/esm/schemas/embeds.d.ts +169 -231
- package/esm/schemas/embeds.js +18 -24
- package/esm/schemas/events.d.ts +129 -225
- package/esm/schemas/events.js +17 -17
- package/esm/schemas/index.d.ts +5 -5
- package/esm/schemas/index.js +5 -5
- package/esm/schemas/manifest.d.ts +110 -154
- package/esm/schemas/manifest.js +23 -29
- package/esm/schemas/notifications.d.ts +58 -86
- package/esm/schemas/notifications.js +17 -17
- package/esm/schemas/shared.d.ts +33 -49
- package/esm/schemas/shared.js +19 -20
- package/esm/tsconfig.tsbuildinfo +1 -1
- package/esm/types.d.ts +102 -125
- package/esm/types.js +2 -2
- package/package.json +1 -1
- package/src/actions/ViewProfile.ts +5 -0
- package/src/actions/index.ts +1 -0
- package/src/types.ts +3 -1
package/dist/actions/index.d.ts
CHANGED
package/dist/actions/index.js
CHANGED
|
@@ -33,6 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.SignIn = exports.AddFrame = void 0;
|
|
36
|
+
exports.SignIn = exports.ViewProfile = exports.AddFrame = void 0;
|
|
37
37
|
exports.AddFrame = __importStar(require("./AddFrame"));
|
|
38
|
+
exports.ViewProfile = __importStar(require("./ViewProfile"));
|
|
38
39
|
exports.SignIn = __importStar(require("./SignIn"));
|
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Address, Provider, RpcRequest, RpcResponse, RpcSchema } from 'ox';
|
|
2
|
-
import type { AddFrame, SignIn } from './actions';
|
|
2
|
+
import type { AddFrame, SignIn, ViewProfile } from './actions';
|
|
3
3
|
import type { FrameContext } from './context';
|
|
4
4
|
import type { EventFrameAdded, EventFrameRemoved, EventNotificationsDisabled, EventNotificationsEnabled } from './schemas';
|
|
5
5
|
export type SetPrimaryButtonOptions = {
|
|
@@ -47,6 +47,7 @@ export type WireFrameHost = {
|
|
|
47
47
|
ethProviderRequestV2: RpcTransport;
|
|
48
48
|
eip6963RequestProvider: () => void;
|
|
49
49
|
addFrame: AddFrame.WireAddFrame;
|
|
50
|
+
viewProfile: ViewProfile.ViewProfile;
|
|
50
51
|
};
|
|
51
52
|
export type FrameHost = {
|
|
52
53
|
context: FrameContext;
|
|
@@ -63,6 +64,7 @@ export type FrameHost = {
|
|
|
63
64
|
*/
|
|
64
65
|
eip6963RequestProvider: () => void;
|
|
65
66
|
addFrame: AddFrame.AddFrame;
|
|
67
|
+
viewProfile: ViewProfile.ViewProfile;
|
|
66
68
|
};
|
|
67
69
|
export type FrameEthProviderEventData = {
|
|
68
70
|
type: 'frame_eth_provider_event';
|
|
@@ -1,40 +1,36 @@
|
|
|
1
|
-
import * as Errors from '../errors'
|
|
2
|
-
import type { OneOf } from '../internal/types'
|
|
3
|
-
import type { FrameNotificationDetails } from '../schemas'
|
|
1
|
+
import * as Errors from '../errors';
|
|
2
|
+
import type { OneOf } from '../internal/types';
|
|
3
|
+
import type { FrameNotificationDetails } from '../schemas';
|
|
4
4
|
export type AddFrameResult = {
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
export type AddFrame = () => Promise<AddFrameResult
|
|
5
|
+
notificationDetails?: FrameNotificationDetails;
|
|
6
|
+
};
|
|
7
|
+
export type AddFrame = () => Promise<AddFrameResult>;
|
|
8
8
|
type InvalidDomainManifestJsonError = {
|
|
9
|
-
|
|
10
|
-
}
|
|
9
|
+
type: 'invalid_domain_manifest';
|
|
10
|
+
};
|
|
11
11
|
type RejectedByUserJsonError = {
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
export type AddFrameJsonError =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
| {
|
|
23
|
-
error: AddFrameJsonError
|
|
24
|
-
}
|
|
25
|
-
>
|
|
26
|
-
export type WireAddFrame = () => Promise<AddFrameJsonResult>
|
|
12
|
+
type: 'rejected_by_user';
|
|
13
|
+
};
|
|
14
|
+
export type AddFrameJsonError = InvalidDomainManifestJsonError | RejectedByUserJsonError;
|
|
15
|
+
export type AddFrameRejectedReason = AddFrameJsonError['type'];
|
|
16
|
+
export type AddFrameJsonResult = OneOf<{
|
|
17
|
+
result: AddFrameResult;
|
|
18
|
+
} | {
|
|
19
|
+
error: AddFrameJsonError;
|
|
20
|
+
}>;
|
|
21
|
+
export type WireAddFrame = () => Promise<AddFrameJsonResult>;
|
|
27
22
|
/**
|
|
28
23
|
* Thrown when the frame does not have a valid domain manifest.
|
|
29
24
|
*/
|
|
30
25
|
export declare class InvalidDomainManifest extends Errors.BaseError {
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
readonly name = "AddFrame.InvalidDomainManifest";
|
|
27
|
+
constructor();
|
|
33
28
|
}
|
|
34
29
|
/**
|
|
35
30
|
* Thrown when add frame action was rejected by the user.
|
|
36
31
|
*/
|
|
37
32
|
export declare class RejectedByUser extends Errors.BaseError {
|
|
38
|
-
|
|
39
|
-
|
|
33
|
+
readonly name = "AddFrame.RejectedByUser";
|
|
34
|
+
constructor();
|
|
40
35
|
}
|
|
36
|
+
export {};
|
package/esm/actions/AddFrame.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import * as Errors from '../errors'
|
|
1
|
+
import * as Errors from '../errors';
|
|
2
2
|
/**
|
|
3
3
|
* Thrown when the frame does not have a valid domain manifest.
|
|
4
4
|
*/
|
|
5
5
|
export class InvalidDomainManifest extends Errors.BaseError {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
name = 'AddFrame.InvalidDomainManifest';
|
|
7
|
+
constructor() {
|
|
8
|
+
super('Invalid domain manifest');
|
|
9
|
+
}
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
12
|
* Thrown when add frame action was rejected by the user.
|
|
13
13
|
*/
|
|
14
14
|
export class RejectedByUser extends Errors.BaseError {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
name = 'AddFrame.RejectedByUser';
|
|
16
|
+
constructor() {
|
|
17
|
+
super('Add frame rejected by user');
|
|
18
|
+
}
|
|
19
19
|
}
|
package/esm/actions/SignIn.d.ts
CHANGED
|
@@ -1,43 +1,41 @@
|
|
|
1
|
-
import * as Errors from '../errors'
|
|
2
|
-
import type { OneOf } from '../internal/types'
|
|
1
|
+
import * as Errors from '../errors';
|
|
2
|
+
import type { OneOf } from '../internal/types';
|
|
3
3
|
export type SignInOptions = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
4
|
+
/**
|
|
5
|
+
* A random string used to prevent replay attacks.
|
|
6
|
+
*/
|
|
7
|
+
nonce: string;
|
|
8
|
+
/**
|
|
9
|
+
* Start time at which the signature becomes valid.
|
|
10
|
+
* ISO 8601 datetime.
|
|
11
|
+
*/
|
|
12
|
+
notBefore?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Expiration time at which the signature is no longer valid.
|
|
15
|
+
* ISO 8601 datetime.
|
|
16
|
+
*/
|
|
17
|
+
expirationTime?: string;
|
|
18
|
+
};
|
|
19
19
|
export type SignInResult = {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
export type SignIn = (options: SignInOptions) => Promise<SignInResult
|
|
20
|
+
signature: string;
|
|
21
|
+
message: string;
|
|
22
|
+
};
|
|
23
|
+
export type SignIn = (options: SignInOptions) => Promise<SignInResult>;
|
|
24
24
|
type RejectedByUserJsonError = {
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
export type SignInJsonError = RejectedByUserJsonError
|
|
28
|
-
export type SignInJsonResult = OneOf<
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
>
|
|
36
|
-
export type WireSignIn = (options: SignInOptions) => Promise<SignInJsonResult>
|
|
25
|
+
type: 'rejected_by_user';
|
|
26
|
+
};
|
|
27
|
+
export type SignInJsonError = RejectedByUserJsonError;
|
|
28
|
+
export type SignInJsonResult = OneOf<{
|
|
29
|
+
result: SignInResult;
|
|
30
|
+
} | {
|
|
31
|
+
error: SignInJsonError;
|
|
32
|
+
}>;
|
|
33
|
+
export type WireSignIn = (options: SignInOptions) => Promise<SignInJsonResult>;
|
|
37
34
|
/**
|
|
38
35
|
* Thrown when a sign in action was rejected.
|
|
39
36
|
*/
|
|
40
37
|
export declare class RejectedByUser extends Errors.BaseError {
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
readonly name = "SignIn.RejectedByUser";
|
|
39
|
+
constructor();
|
|
43
40
|
}
|
|
41
|
+
export {};
|
package/esm/actions/SignIn.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import * as Errors from '../errors'
|
|
1
|
+
import * as Errors from '../errors';
|
|
2
2
|
/**
|
|
3
3
|
* Thrown when a sign in action was rejected.
|
|
4
4
|
*/
|
|
5
5
|
export class RejectedByUser extends Errors.BaseError {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
name = 'SignIn.RejectedByUser';
|
|
7
|
+
constructor() {
|
|
8
|
+
super('Sign in rejected by user');
|
|
9
|
+
}
|
|
10
10
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/esm/actions/index.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export * as AddFrame from './AddFrame'
|
|
2
|
-
export * as
|
|
1
|
+
export * as AddFrame from './AddFrame';
|
|
2
|
+
export * as ViewProfile from './ViewProfile';
|
|
3
|
+
export * as SignIn from './SignIn';
|
package/esm/actions/index.js
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export * as AddFrame from './AddFrame'
|
|
2
|
-
export * as
|
|
1
|
+
export * as AddFrame from './AddFrame';
|
|
2
|
+
export * as ViewProfile from './ViewProfile';
|
|
3
|
+
export * as SignIn from './SignIn';
|
package/esm/context.d.ts
CHANGED
|
@@ -1,76 +1,72 @@
|
|
|
1
|
-
import type { FrameNotificationDetails } from './schemas'
|
|
1
|
+
import type { FrameNotificationDetails } from './schemas';
|
|
2
2
|
export type CastEmbedLocationContext = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
3
|
+
type: 'cast_embed';
|
|
4
|
+
embed: string;
|
|
5
|
+
cast: {
|
|
6
|
+
fid: number;
|
|
7
|
+
hash: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
10
|
export type NotificationLocationContext = {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
11
|
+
type: 'notification';
|
|
12
|
+
notification: {
|
|
13
|
+
notificationId: string;
|
|
14
|
+
title: string;
|
|
15
|
+
body: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
18
|
export type LauncherLocationContext = {
|
|
19
|
-
|
|
20
|
-
}
|
|
19
|
+
type: 'launcher';
|
|
20
|
+
};
|
|
21
21
|
export type ChannelLocationContext = {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
type: 'channel';
|
|
23
|
+
channel: {
|
|
24
|
+
/**
|
|
25
|
+
* Channel key identifier
|
|
26
|
+
*/
|
|
27
|
+
key: string;
|
|
28
|
+
/**
|
|
29
|
+
* Channel name
|
|
30
|
+
*/
|
|
31
|
+
name: string;
|
|
32
|
+
/**
|
|
33
|
+
* Channel profile image URL
|
|
34
|
+
*/
|
|
35
|
+
imageUrl?: string;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
export type LocationContext = CastEmbedLocationContext | NotificationLocationContext | LauncherLocationContext | ChannelLocationContext;
|
|
39
|
+
export type AccountLocation = {
|
|
40
|
+
placeId: string;
|
|
28
41
|
/**
|
|
29
|
-
*
|
|
42
|
+
* Human-readable string describing the location
|
|
30
43
|
*/
|
|
31
|
-
|
|
44
|
+
description: string;
|
|
45
|
+
};
|
|
46
|
+
export type UserContext = {
|
|
47
|
+
fid: number;
|
|
48
|
+
username?: string;
|
|
49
|
+
displayName?: string;
|
|
32
50
|
/**
|
|
33
|
-
*
|
|
51
|
+
* Profile image URL
|
|
34
52
|
*/
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
export type LocationContext =
|
|
39
|
-
| CastEmbedLocationContext
|
|
40
|
-
| NotificationLocationContext
|
|
41
|
-
| LauncherLocationContext
|
|
42
|
-
| ChannelLocationContext
|
|
43
|
-
export type AccountLocation = {
|
|
44
|
-
placeId: string
|
|
45
|
-
/**
|
|
46
|
-
* Human-readable string describing the location
|
|
47
|
-
*/
|
|
48
|
-
description: string
|
|
49
|
-
}
|
|
50
|
-
export type UserContext = {
|
|
51
|
-
fid: number
|
|
52
|
-
username?: string
|
|
53
|
-
displayName?: string
|
|
54
|
-
/**
|
|
55
|
-
* Profile image URL
|
|
56
|
-
*/
|
|
57
|
-
pfpUrl?: string
|
|
58
|
-
location?: AccountLocation
|
|
59
|
-
}
|
|
53
|
+
pfpUrl?: string;
|
|
54
|
+
location?: AccountLocation;
|
|
55
|
+
};
|
|
60
56
|
export type SafeAreaInsets = {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
57
|
+
top: number;
|
|
58
|
+
bottom: number;
|
|
59
|
+
left: number;
|
|
60
|
+
right: number;
|
|
61
|
+
};
|
|
66
62
|
export type ClientContext = {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
63
|
+
clientFid: number;
|
|
64
|
+
added: boolean;
|
|
65
|
+
notificationDetails?: FrameNotificationDetails;
|
|
66
|
+
safeAreaInsets?: SafeAreaInsets;
|
|
67
|
+
};
|
|
72
68
|
export type FrameContext = {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
69
|
+
client: ClientContext;
|
|
70
|
+
user: UserContext;
|
|
71
|
+
location?: LocationContext;
|
|
72
|
+
};
|
package/esm/context.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {}
|
|
1
|
+
export {};
|
package/esm/errors.d.ts
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
export declare class BaseError<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
cause: cause
|
|
6
|
-
constructor(message: string, options?: BaseError.Options<cause>)
|
|
1
|
+
export declare class BaseError<cause extends Error | undefined = undefined> extends Error {
|
|
2
|
+
name: string;
|
|
3
|
+
cause: cause;
|
|
4
|
+
constructor(message: string, options?: BaseError.Options<cause>);
|
|
7
5
|
}
|
|
8
6
|
export declare namespace BaseError {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
type Options<cause extends Error | undefined = Error | undefined> = {
|
|
8
|
+
cause?: cause | undefined;
|
|
9
|
+
};
|
|
12
10
|
}
|
package/esm/errors.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export class BaseError extends Error {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
name = 'BaseError';
|
|
3
|
+
cause;
|
|
4
|
+
constructor(message, options = {}) {
|
|
5
|
+
super(message, options.cause ? { cause: options.cause } : undefined);
|
|
6
|
+
this.cause = options.cause;
|
|
7
|
+
}
|
|
8
8
|
}
|
package/esm/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './actions'
|
|
2
|
-
export * as Context from './context'
|
|
3
|
-
export * from './types'
|
|
4
|
-
export * from './schemas'
|
|
1
|
+
export * from './actions';
|
|
2
|
+
export * as Context from './context';
|
|
3
|
+
export * from './types';
|
|
4
|
+
export * from './schemas';
|
package/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './actions'
|
|
2
|
-
export * as Context from './context'
|
|
3
|
-
export * from './types'
|
|
4
|
-
export * from './schemas'
|
|
1
|
+
export * from './actions';
|
|
2
|
+
export * as Context from './context';
|
|
3
|
+
export * from './types';
|
|
4
|
+
export * from './schemas';
|
package/esm/internal/types.d.ts
CHANGED
|
@@ -1,19 +1,8 @@
|
|
|
1
1
|
type Compute<type> = {
|
|
2
|
-
|
|
3
|
-
} & unknown
|
|
4
|
-
type KeyofUnion<type> = type extends type ? keyof type : never
|
|
5
|
-
export type OneOf<
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
> = union extends infer item
|
|
10
|
-
? Compute<
|
|
11
|
-
item & {
|
|
12
|
-
[key in Exclude<keys, keyof item>]?: fallback extends object
|
|
13
|
-
? key extends keyof fallback
|
|
14
|
-
? fallback[key]
|
|
15
|
-
: undefined
|
|
16
|
-
: undefined
|
|
17
|
-
}
|
|
18
|
-
>
|
|
19
|
-
: never
|
|
2
|
+
[key in keyof type]: type[key];
|
|
3
|
+
} & unknown;
|
|
4
|
+
type KeyofUnion<type> = type extends type ? keyof type : never;
|
|
5
|
+
export type OneOf<union extends object, fallback extends object | undefined = undefined, keys extends KeyofUnion<union> = KeyofUnion<union>> = union extends infer item ? Compute<item & {
|
|
6
|
+
[key in Exclude<keys, keyof item>]?: fallback extends object ? key extends keyof fallback ? fallback[key] : undefined : undefined;
|
|
7
|
+
}> : never;
|
|
8
|
+
export {};
|
package/esm/internal/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {}
|
|
1
|
+
export {};
|