@farcaster/frame-core 0.0.29 → 0.0.31
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/shared.js +1 -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/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 +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 +35 -53
- package/esm/schemas/shared.js +23 -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 +35 -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/shared.ts +1 -1
- package/src/types.ts +7 -0
package/README.md
ADDED
|
@@ -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
|
+
};
|
package/dist/actions/index.d.ts
CHANGED
package/dist/actions/index.js
CHANGED
|
@@ -33,8 +33,9 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.ViewToken = exports.ViewProfile = exports.Swap = exports.SignIn = exports.Ready = exports.AddFrame = void 0;
|
|
36
|
+
exports.ViewToken = exports.ViewProfile = exports.Swap = exports.SignIn = exports.Ready = exports.ComposeCast = exports.AddFrame = void 0;
|
|
37
37
|
exports.AddFrame = __importStar(require("./AddFrame"));
|
|
38
|
+
exports.ComposeCast = __importStar(require("./ComposeCast"));
|
|
38
39
|
exports.Ready = __importStar(require("./Ready"));
|
|
39
40
|
exports.SignIn = __importStar(require("./SignIn"));
|
|
40
41
|
exports.Swap = __importStar(require("./Swap"));
|
package/dist/errors.d.ts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -36,9 +36,11 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
};
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.Context = void 0;
|
|
39
|
+
exports.Manifest = exports.Context = exports.Errors = void 0;
|
|
40
40
|
__exportStar(require("./actions"), exports);
|
|
41
41
|
__exportStar(require("./wallet"), exports);
|
|
42
|
+
exports.Errors = __importStar(require("./errors"));
|
|
42
43
|
exports.Context = __importStar(require("./context"));
|
|
44
|
+
exports.Manifest = __importStar(require("./manifest"));
|
|
43
45
|
__exportStar(require("./types"), exports);
|
|
44
46
|
__exportStar(require("./schemas"), exports);
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Farcaster manifest for a domain hosted at `/.well-known/farcaster.json`
|
|
3
|
+
*/
|
|
4
|
+
export type Manifest = {
|
|
5
|
+
accountAssociation: AccountAssociation;
|
|
6
|
+
frame: FrameConfig;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Signed domain association linking this frame to a Farcaster account
|
|
10
|
+
*
|
|
11
|
+
* A DomainAssociation can be generated using the {@link https://warpcast.com/~/developers/domains | Warpcast
|
|
12
|
+
* Domains Developer} tool.
|
|
13
|
+
*/
|
|
14
|
+
export type AccountAssociation = {
|
|
15
|
+
/**
|
|
16
|
+
* Base64URL encoded JFS signature
|
|
17
|
+
*/
|
|
18
|
+
header: string;
|
|
19
|
+
/**
|
|
20
|
+
* Base64URL encoded payload signature
|
|
21
|
+
*/
|
|
22
|
+
payload: string;
|
|
23
|
+
/**
|
|
24
|
+
* Base64URL encoded signature
|
|
25
|
+
*/
|
|
26
|
+
signature: string;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Frame configuration
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ``ts
|
|
33
|
+
* const frame: FrameConfig = {
|
|
34
|
+
* version: '1',
|
|
35
|
+
* name: 'Yoink!',
|
|
36
|
+
* homeUrl: 'https://yoink.party',
|
|
37
|
+
* iconUrl: 'https://yoink.party/img/icon.png',
|
|
38
|
+
* imageUrl: 'https://yoink.party/framesV2/opengraph-image',
|
|
39
|
+
* buttonTitle: '🚩 Start',
|
|
40
|
+
* splashImageUrl: 'https://yoink.party/img/splash.png',
|
|
41
|
+
* splashImageBackgroundColor: '#eeeee4',
|
|
42
|
+
* webhookUrl: 'https://yoink.party/webhook'
|
|
43
|
+
* };
|
|
44
|
+
* ``
|
|
45
|
+
*/
|
|
46
|
+
export type FrameConfig = {
|
|
47
|
+
/**
|
|
48
|
+
* Manifest version
|
|
49
|
+
*
|
|
50
|
+
* Must be the literal '1'.
|
|
51
|
+
*/
|
|
52
|
+
version: '1';
|
|
53
|
+
/**
|
|
54
|
+
* App name that will be displayed to users
|
|
55
|
+
*
|
|
56
|
+
* Max length of 32 characters.
|
|
57
|
+
*/
|
|
58
|
+
name: string;
|
|
59
|
+
/**
|
|
60
|
+
* Default launch URL
|
|
61
|
+
*
|
|
62
|
+
* Max length of 1024 characters.
|
|
63
|
+
*/
|
|
64
|
+
homeUrl: string;
|
|
65
|
+
/**
|
|
66
|
+
* Icon URL
|
|
67
|
+
*
|
|
68
|
+
* Max length of 1024 characters. Image must be 200x200px and less than 1MB.
|
|
69
|
+
*/
|
|
70
|
+
iconUrl: string;
|
|
71
|
+
/**
|
|
72
|
+
* Image URL
|
|
73
|
+
*
|
|
74
|
+
* Max length of 1024 characters. Image must have a 3:2 ratio.
|
|
75
|
+
*/
|
|
76
|
+
imageUrl: string;
|
|
77
|
+
/**
|
|
78
|
+
* Default button title to use when frame is rendered.
|
|
79
|
+
*
|
|
80
|
+
* Max length of 32 characters.
|
|
81
|
+
*/
|
|
82
|
+
buttonTitle: string;
|
|
83
|
+
/**
|
|
84
|
+
* Splash image URL
|
|
85
|
+
*
|
|
86
|
+
* Max length of 1024 characters. Image must be 200x200px and less than 1MB.
|
|
87
|
+
*/
|
|
88
|
+
splashImageUrl?: string;
|
|
89
|
+
/**
|
|
90
|
+
* Splash background color
|
|
91
|
+
*
|
|
92
|
+
* Must be a hex color code.
|
|
93
|
+
*/
|
|
94
|
+
splashBackgroundColor?: string;
|
|
95
|
+
/**
|
|
96
|
+
* URL to which clients will POST server events.
|
|
97
|
+
* Max length of 1024 characters.
|
|
98
|
+
* Required if the frame application uses notifications.
|
|
99
|
+
*/
|
|
100
|
+
webhookUrl?: string;
|
|
101
|
+
};
|
package/dist/manifest.js
ADDED
package/dist/schemas/shared.js
CHANGED
|
@@ -6,7 +6,7 @@ exports.secureUrlSchema = zod_1.z
|
|
|
6
6
|
.string()
|
|
7
7
|
.url()
|
|
8
8
|
.startsWith('https://', { message: 'Must be an https url' })
|
|
9
|
-
.max(
|
|
9
|
+
.max(1024);
|
|
10
10
|
exports.frameNameSchema = zod_1.z.string().max(32);
|
|
11
11
|
exports.buttonTitleSchema = zod_1.z.string().max(32);
|
|
12
12
|
const CAIP_19_REGEX = /^[-a-z0-9]{3,8}:[-_a-zA-Z0-9]{1,32}\/(?:[-a-z0-9]{3,8}:[-.%a-zA-Z0-9]{1,128}(?:\/[-.%a-zA-Z0-9]{1,78})?|native)$/;
|
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,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';
|