@farcaster/frame-core 0.0.29 → 0.0.32
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/README.md +13 -0
- package/dist/actions/ComposeCast.d.ts +32 -0
- package/dist/actions/ComposeCast.js +2 -0
- package/dist/actions/index.d.ts +1 -0
- package/dist/actions/index.js +2 -1
- package/dist/errors.d.ts +3 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -1
- package/dist/manifest.d.ts +101 -0
- package/dist/manifest.js +2 -0
- package/dist/schemas/embeds.d.ts +20 -20
- package/dist/schemas/embeds.js +1 -1
- package/dist/schemas/manifest.d.ts +92 -6
- package/dist/schemas/manifest.js +31 -0
- package/dist/schemas/shared.d.ts +4 -0
- package/dist/schemas/shared.js +29 -2
- package/dist/types.d.ts +3 -1
- package/dist/wallet/ethereum.d.ts +5 -1
- package/esm/actions/AddFrame.d.ts +23 -27
- package/esm/actions/AddFrame.js +9 -9
- package/esm/actions/ComposeCast.d.ts +32 -0
- package/esm/actions/ComposeCast.js +1 -0
- package/esm/actions/Ready.d.ts +11 -11
- package/esm/actions/Ready.js +2 -2
- package/esm/actions/SignIn.d.ts +33 -35
- package/esm/actions/SignIn.js +5 -5
- package/esm/actions/Swap.d.ts +43 -44
- package/esm/actions/Swap.js +1 -1
- package/esm/actions/ViewProfile.d.ts +3 -3
- package/esm/actions/ViewProfile.js +1 -1
- package/esm/actions/ViewToken.d.ts +3 -3
- package/esm/actions/ViewToken.js +1 -1
- package/esm/actions/index.d.ts +7 -6
- package/esm/actions/index.js +7 -6
- package/esm/context.d.ts +61 -65
- package/esm/context.js +1 -1
- package/esm/errors.d.ts +10 -9
- package/esm/errors.js +6 -6
- package/esm/index.d.ts +7 -5
- package/esm/index.js +7 -5
- package/esm/internal/types.d.ts +7 -18
- package/esm/internal/types.js +1 -1
- package/esm/manifest.d.ts +101 -0
- package/esm/manifest.js +1 -0
- package/esm/schemas/embeds.d.ts +239 -346
- package/esm/schemas/embeds.js +23 -31
- 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 +196 -154
- package/esm/schemas/manifest.js +54 -29
- package/esm/schemas/notifications.d.ts +58 -86
- package/esm/schemas/notifications.js +17 -17
- package/esm/schemas/shared.d.ts +39 -53
- package/esm/schemas/shared.js +49 -25
- package/esm/tsconfig.tsbuildinfo +1 -1
- package/esm/types.d.ts +53 -70
- package/esm/types.js +2 -2
- package/esm/wallet/ethereum.d.ts +39 -50
- package/esm/wallet/ethereum.js +1 -1
- package/esm/wallet/index.d.ts +1 -1
- package/esm/wallet/index.js +1 -1
- package/package.json +1 -1
- package/src/actions/ComposeCast.ts +36 -0
- package/src/actions/index.ts +1 -0
- package/src/errors.ts +4 -0
- package/src/index.ts +2 -0
- package/src/manifest.ts +113 -0
- package/src/schemas/embeds.ts +1 -1
- package/src/schemas/manifest.ts +33 -0
- package/src/schemas/shared.ts +36 -1
- package/src/types.ts +7 -0
- package/src/wallet/ethereum.ts +5 -1
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AddFrame, Ready, SignIn, Swap, ViewProfile, ViewToken } from './actions';
|
|
1
|
+
import type { AddFrame, ComposeCast, Ready, SignIn, Swap, ViewProfile, ViewToken } from './actions';
|
|
2
2
|
import type { FrameContext } from './context';
|
|
3
3
|
import type { EventFrameAdded, EventFrameRemoved, EventNotificationsDisabled, EventNotificationsEnabled } from './schemas';
|
|
4
4
|
import type { Ethereum } from './wallet';
|
|
@@ -26,6 +26,7 @@ export type WireFrameHost = {
|
|
|
26
26
|
viewProfile: ViewProfile.ViewProfile;
|
|
27
27
|
viewToken: ViewToken.ViewToken;
|
|
28
28
|
swap: Swap.Swap;
|
|
29
|
+
composeCast: <close extends boolean | undefined = undefined>(options: ComposeCast.Options<close>) => Promise<ComposeCast.Result<close>>;
|
|
29
30
|
};
|
|
30
31
|
export type FrameHost = {
|
|
31
32
|
context: FrameContext;
|
|
@@ -45,6 +46,7 @@ export type FrameHost = {
|
|
|
45
46
|
viewProfile: ViewProfile.ViewProfile;
|
|
46
47
|
viewToken: ViewToken.ViewToken;
|
|
47
48
|
swap: Swap.Swap;
|
|
49
|
+
composeCast: <close extends boolean | undefined = undefined>(options: ComposeCast.Options<close>) => Promise<ComposeCast.Result<close>>;
|
|
48
50
|
};
|
|
49
51
|
export type EventFrameAddRejected = {
|
|
50
52
|
event: 'frame_add_rejected';
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import type * as Address from 'ox/Address';
|
|
2
|
+
import type * as Provider from 'ox/Provider';
|
|
3
|
+
import type * as RpcRequest from 'ox/RpcRequest';
|
|
4
|
+
import type * as RpcResponse from 'ox/RpcResponse';
|
|
5
|
+
import type * as RpcSchema from 'ox/RpcSchema';
|
|
2
6
|
export type EthProvideRequest<schema extends RpcSchema.Generic = RpcSchema.Default> = Provider.RequestFn<schema>;
|
|
3
7
|
export type FrameEthProviderEventData = {
|
|
4
8
|
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
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export type Options<close extends boolean | undefined = undefined> = {
|
|
2
|
+
/**
|
|
3
|
+
* Suggested text for the body of the cast.
|
|
4
|
+
*
|
|
5
|
+
* Mentions can be included using the human-writeable form (e.g. @farcaster).
|
|
6
|
+
**/
|
|
7
|
+
text?: string;
|
|
8
|
+
/** Suggested embeds. Max two. */
|
|
9
|
+
embeds?: [] | [string] | [string, string];
|
|
10
|
+
/** Suggested parent. */
|
|
11
|
+
parent?: {
|
|
12
|
+
type: 'cast';
|
|
13
|
+
hash: string;
|
|
14
|
+
};
|
|
15
|
+
/** Whether the app should be closed when this action is called. */
|
|
16
|
+
close?: close;
|
|
17
|
+
};
|
|
18
|
+
export type Result<close extends boolean | undefined = undefined> = close extends true ? undefined : {
|
|
19
|
+
cast: {
|
|
20
|
+
/** Cast of the created cast */
|
|
21
|
+
hash: string;
|
|
22
|
+
/** Text of the created cast */
|
|
23
|
+
text?: string;
|
|
24
|
+
/** Embeds of the created cast */
|
|
25
|
+
embeds?: [] | [string] | [string, string];
|
|
26
|
+
/** Parent of the created cast */
|
|
27
|
+
parent?: {
|
|
28
|
+
type: 'cast';
|
|
29
|
+
hash: string;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/esm/actions/Ready.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
export type ReadyOptions = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
2
|
+
/**
|
|
3
|
+
* Disable native gestures. Use this option if your frame uses gestures
|
|
4
|
+
* that conflict with native gestures.
|
|
5
|
+
*
|
|
6
|
+
* @defaultValue false
|
|
7
|
+
*/
|
|
8
|
+
disableNativeGestures: boolean;
|
|
9
|
+
};
|
|
10
10
|
export declare const DEFAULT_READY_OPTIONS: {
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
export type Ready = (options?: Partial<ReadyOptions>) => void
|
|
11
|
+
disableNativeGestures: false;
|
|
12
|
+
};
|
|
13
|
+
export type Ready = (options?: Partial<ReadyOptions>) => void;
|
package/esm/actions/Ready.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export const DEFAULT_READY_OPTIONS = {
|
|
2
|
-
|
|
3
|
-
}
|
|
2
|
+
disableNativeGestures: false,
|
|
3
|
+
};
|
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
|
}
|
package/esm/actions/Swap.d.ts
CHANGED
|
@@ -1,47 +1,46 @@
|
|
|
1
1
|
export type SwapOptions = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
2
|
+
/**
|
|
3
|
+
* CAIP-19 asset ID
|
|
4
|
+
* For example, Base USDC:
|
|
5
|
+
* eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
|
|
6
|
+
*/
|
|
7
|
+
sellToken?: string;
|
|
8
|
+
/**
|
|
9
|
+
* CAIP-19 token ID. For example, OP ETH:
|
|
10
|
+
* eip155:10/native
|
|
11
|
+
*/
|
|
12
|
+
buyToken?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Sell token amount, as numeric string.
|
|
15
|
+
* For example, 10 USDC: 1000000
|
|
16
|
+
*/
|
|
17
|
+
sellAmount?: string;
|
|
18
|
+
};
|
|
19
19
|
type SwapDetails = {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
20
|
+
/**
|
|
21
|
+
* Array of tx identifiers in order of execution.
|
|
22
|
+
* Some swaps will have both an approval and swap tx.
|
|
23
|
+
*/
|
|
24
|
+
transactions: `0x${string}`[];
|
|
25
|
+
};
|
|
26
26
|
type SwapErrorDetails = {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
export type SwapErrorReason = 'rejected_by_user' | 'swap_failed'
|
|
37
|
-
export type SwapResult =
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
export type Swap = (options: SwapOptions) => Promise<SwapResult>
|
|
27
|
+
/**
|
|
28
|
+
* Error code.
|
|
29
|
+
*/
|
|
30
|
+
error: string;
|
|
31
|
+
/**
|
|
32
|
+
* Error message.
|
|
33
|
+
*/
|
|
34
|
+
message?: string;
|
|
35
|
+
};
|
|
36
|
+
export type SwapErrorReason = 'rejected_by_user' | 'swap_failed';
|
|
37
|
+
export type SwapResult = {
|
|
38
|
+
success: true;
|
|
39
|
+
swap: SwapDetails;
|
|
40
|
+
} | {
|
|
41
|
+
success: false;
|
|
42
|
+
reason: SwapErrorReason;
|
|
43
|
+
error?: SwapErrorDetails;
|
|
44
|
+
};
|
|
45
|
+
export type Swap = (options: SwapOptions) => Promise<SwapResult>;
|
|
46
|
+
export {};
|
package/esm/actions/Swap.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {}
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export type ViewProfileOptions = {
|
|
2
|
-
|
|
3
|
-
}
|
|
4
|
-
export type ViewProfile = (options: ViewProfileOptions) => Promise<void
|
|
2
|
+
fid: number;
|
|
3
|
+
};
|
|
4
|
+
export type ViewProfile = (options: ViewProfileOptions) => Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {}
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export type ViewTokenOptions = {
|
|
2
|
-
|
|
3
|
-
}
|
|
4
|
-
export type ViewToken = (options: ViewTokenOptions) => Promise<void
|
|
2
|
+
token: string;
|
|
3
|
+
};
|
|
4
|
+
export type ViewToken = (options: ViewTokenOptions) => Promise<void>;
|
package/esm/actions/ViewToken.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {}
|
|
1
|
+
export {};
|
package/esm/actions/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export * as AddFrame from './AddFrame'
|
|
2
|
-
export * as
|
|
3
|
-
export * as
|
|
4
|
-
export * as
|
|
5
|
-
export * as
|
|
6
|
-
export * as
|
|
1
|
+
export * as AddFrame from './AddFrame';
|
|
2
|
+
export * as ComposeCast from './ComposeCast';
|
|
3
|
+
export * as Ready from './Ready';
|
|
4
|
+
export * as SignIn from './SignIn';
|
|
5
|
+
export * as Swap from './Swap';
|
|
6
|
+
export * as ViewProfile from './ViewProfile';
|
|
7
|
+
export * as ViewToken from './ViewToken';
|
package/esm/actions/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export * as AddFrame from './AddFrame'
|
|
2
|
-
export * as
|
|
3
|
-
export * as
|
|
4
|
-
export * as
|
|
5
|
-
export * as
|
|
6
|
-
export * as
|
|
1
|
+
export * as AddFrame from './AddFrame';
|
|
2
|
+
export * as ComposeCast from './ComposeCast';
|
|
3
|
+
export * as Ready from './Ready';
|
|
4
|
+
export * as SignIn from './SignIn';
|
|
5
|
+
export * as Swap from './Swap';
|
|
6
|
+
export * as ViewProfile from './ViewProfile';
|
|
7
|
+
export * as ViewToken from './ViewToken';
|
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,13 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
export type GlobalErrorType<name extends string = 'Error'> = Error & {
|
|
2
|
+
name: name;
|
|
3
|
+
};
|
|
4
|
+
export declare class BaseError<cause extends Error | undefined = undefined> extends Error {
|
|
5
|
+
name: string;
|
|
6
|
+
cause: cause;
|
|
7
|
+
constructor(message: string, options?: BaseError.Options<cause>);
|
|
7
8
|
}
|
|
8
9
|
export declare namespace BaseError {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
type Options<cause extends Error | undefined = Error | undefined> = {
|
|
11
|
+
cause?: cause | undefined;
|
|
12
|
+
};
|
|
12
13
|
}
|
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,5 +1,7 @@
|
|
|
1
|
-
export * from './actions'
|
|
2
|
-
export * from './wallet'
|
|
3
|
-
export * as
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './
|
|
1
|
+
export * from './actions';
|
|
2
|
+
export * from './wallet';
|
|
3
|
+
export * as Errors from './errors';
|
|
4
|
+
export * as Context from './context';
|
|
5
|
+
export * as Manifest from './manifest';
|
|
6
|
+
export * from './types';
|
|
7
|
+
export * from './schemas';
|
package/esm/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
export * from './actions'
|
|
2
|
-
export * from './wallet'
|
|
3
|
-
export * as
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './
|
|
1
|
+
export * from './actions';
|
|
2
|
+
export * from './wallet';
|
|
3
|
+
export * as Errors from './errors';
|
|
4
|
+
export * as Context from './context';
|
|
5
|
+
export * as Manifest from './manifest';
|
|
6
|
+
export * from './types';
|
|
7
|
+
export * from './schemas';
|