@farcaster/frame-core 0.0.27 → 0.0.29

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.
Files changed (61) hide show
  1. package/LICENSE +21 -0
  2. package/dist/actions/Ready.d.ts +13 -0
  3. package/dist/actions/Ready.js +6 -0
  4. package/dist/actions/index.d.ts +3 -2
  5. package/dist/actions/index.js +4 -3
  6. package/dist/index.d.ts +1 -0
  7. package/dist/index.js +1 -0
  8. package/dist/types.d.ts +12 -77
  9. package/dist/types.js +18 -3
  10. package/dist/wallet/ethereum.d.ts +43 -0
  11. package/dist/wallet/ethereum.js +2 -0
  12. package/dist/wallet/index.d.ts +1 -0
  13. package/dist/wallet/index.js +37 -0
  14. package/esm/actions/AddFrame.d.ts +27 -23
  15. package/esm/actions/AddFrame.js +9 -9
  16. package/esm/actions/Ready.d.ts +13 -0
  17. package/esm/actions/Ready.js +3 -0
  18. package/esm/actions/SignIn.d.ts +35 -33
  19. package/esm/actions/SignIn.js +5 -5
  20. package/esm/actions/Swap.d.ts +44 -43
  21. package/esm/actions/Swap.js +1 -1
  22. package/esm/actions/ViewProfile.d.ts +3 -3
  23. package/esm/actions/ViewProfile.js +1 -1
  24. package/esm/actions/ViewToken.d.ts +3 -3
  25. package/esm/actions/ViewToken.js +1 -1
  26. package/esm/actions/index.d.ts +6 -5
  27. package/esm/actions/index.js +6 -5
  28. package/esm/context.d.ts +65 -61
  29. package/esm/context.js +1 -1
  30. package/esm/errors.d.ts +9 -7
  31. package/esm/errors.js +6 -6
  32. package/esm/index.d.ts +5 -4
  33. package/esm/index.js +5 -4
  34. package/esm/internal/types.d.ts +18 -7
  35. package/esm/internal/types.js +1 -1
  36. package/esm/schemas/embeds.d.ts +346 -239
  37. package/esm/schemas/embeds.js +31 -23
  38. package/esm/schemas/events.d.ts +225 -129
  39. package/esm/schemas/events.js +17 -17
  40. package/esm/schemas/index.d.ts +5 -5
  41. package/esm/schemas/index.js +5 -5
  42. package/esm/schemas/manifest.d.ts +154 -110
  43. package/esm/schemas/manifest.js +29 -23
  44. package/esm/schemas/notifications.d.ts +86 -58
  45. package/esm/schemas/notifications.js +17 -17
  46. package/esm/schemas/shared.d.ts +53 -35
  47. package/esm/schemas/shared.js +25 -23
  48. package/esm/tsconfig.tsbuildinfo +1 -1
  49. package/esm/types.d.ts +69 -115
  50. package/esm/types.js +3 -3
  51. package/esm/wallet/ethereum.d.ts +58 -0
  52. package/esm/wallet/ethereum.js +1 -0
  53. package/esm/wallet/index.d.ts +1 -0
  54. package/esm/wallet/index.js +1 -0
  55. package/package.json +8 -2
  56. package/src/actions/Ready.ts +15 -0
  57. package/src/actions/index.ts +3 -2
  58. package/src/index.ts +1 -0
  59. package/src/types.ts +22 -100
  60. package/src/wallet/ethereum.ts +61 -0
  61. package/src/wallet/index.ts +1 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024-present Merkle Manufactory Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,13 @@
1
+ export type ReadyOptions = {
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
+ export declare const DEFAULT_READY_OPTIONS: {
11
+ disableNativeGestures: false;
12
+ };
13
+ export type Ready = (options?: Partial<ReadyOptions>) => void;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DEFAULT_READY_OPTIONS = void 0;
4
+ exports.DEFAULT_READY_OPTIONS = {
5
+ disableNativeGestures: false,
6
+ };
@@ -1,5 +1,6 @@
1
1
  export * as AddFrame from './AddFrame';
2
- export * as ViewProfile from './ViewProfile';
3
- export * as ViewToken from './ViewToken';
2
+ export * as Ready from './Ready';
4
3
  export * as SignIn from './SignIn';
5
4
  export * as Swap from './Swap';
5
+ export * as ViewProfile from './ViewProfile';
6
+ export * as ViewToken from './ViewToken';
@@ -33,9 +33,10 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.Swap = exports.SignIn = exports.ViewToken = exports.ViewProfile = exports.AddFrame = void 0;
36
+ exports.ViewToken = exports.ViewProfile = exports.Swap = exports.SignIn = exports.Ready = exports.AddFrame = void 0;
37
37
  exports.AddFrame = __importStar(require("./AddFrame"));
38
- exports.ViewProfile = __importStar(require("./ViewProfile"));
39
- exports.ViewToken = __importStar(require("./ViewToken"));
38
+ exports.Ready = __importStar(require("./Ready"));
40
39
  exports.SignIn = __importStar(require("./SignIn"));
41
40
  exports.Swap = __importStar(require("./Swap"));
41
+ exports.ViewProfile = __importStar(require("./ViewProfile"));
42
+ exports.ViewToken = __importStar(require("./ViewToken"));
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './actions';
2
+ export * from './wallet';
2
3
  export * as Context from './context';
3
4
  export * from './types';
4
5
  export * from './schemas';
package/dist/index.js CHANGED
@@ -38,6 +38,7 @@ var __importStar = (this && this.__importStar) || (function () {
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.Context = void 0;
40
40
  __exportStar(require("./actions"), exports);
41
+ __exportStar(require("./wallet"), exports);
41
42
  exports.Context = __importStar(require("./context"));
42
43
  __exportStar(require("./types"), exports);
43
44
  __exportStar(require("./schemas"), exports);
package/dist/types.d.ts CHANGED
@@ -1,50 +1,26 @@
1
- import type { Address, Provider, RpcRequest, RpcResponse, RpcSchema } from 'ox';
2
- import type { AddFrame, SignIn, Swap, ViewProfile, ViewToken } from './actions';
1
+ import type { AddFrame, Ready, SignIn, Swap, ViewProfile, ViewToken } from './actions';
3
2
  import type { FrameContext } from './context';
4
3
  import type { EventFrameAdded, EventFrameRemoved, EventNotificationsDisabled, EventNotificationsEnabled } from './schemas';
4
+ import type { Ethereum } from './wallet';
5
5
  export type SetPrimaryButtonOptions = {
6
6
  text: string;
7
7
  loading?: boolean;
8
8
  disabled?: boolean;
9
9
  hidden?: boolean;
10
10
  };
11
+ export * from './wallet/ethereum';
12
+ export { DEFAULT_READY_OPTIONS, ReadyOptions } from './actions/Ready';
13
+ export type SignInOptions = SignIn.SignInOptions;
11
14
  export type SetPrimaryButton = (options: SetPrimaryButtonOptions) => void;
12
- export type EthProviderRequest = Provider.RequestFn<RpcSchema.Default>;
13
- export type ReadyOptions = {
14
- /**
15
- * Disable native gestures. Use this option if your frame uses gestures
16
- * that conflict with native gestures.
17
- *
18
- * @defaultValue false
19
- */
20
- disableNativeGestures: boolean;
21
- };
22
- export declare const DEFAULT_READY_OPTIONS: ReadyOptions;
23
- export type SignInOptions = {
24
- /**
25
- * A random string used to prevent replay attacks.
26
- */
27
- nonce: string;
28
- /**
29
- * Start time at which the signature becomes valid.
30
- * ISO 8601 datetime.
31
- */
32
- notBefore?: string;
33
- /**
34
- * Expiration time at which the signature is no longer valid.
35
- * ISO 8601 datetime.
36
- */
37
- expirationTime?: string;
38
- };
39
15
  export type WireFrameHost = {
40
16
  context: FrameContext;
41
17
  close: () => void;
42
- ready: (options?: Partial<ReadyOptions>) => void;
18
+ ready: Ready.Ready;
43
19
  openUrl: (url: string) => void;
44
20
  signIn: SignIn.WireSignIn;
45
21
  setPrimaryButton: SetPrimaryButton;
46
- ethProviderRequest: EthProviderRequest;
47
- ethProviderRequestV2: RpcTransport;
22
+ ethProviderRequest: Ethereum.EthProvideRequest;
23
+ ethProviderRequestV2: Ethereum.RpcTransport;
48
24
  eip6963RequestProvider: () => void;
49
25
  addFrame: AddFrame.WireAddFrame;
50
26
  viewProfile: ViewProfile.ViewProfile;
@@ -54,12 +30,12 @@ export type WireFrameHost = {
54
30
  export type FrameHost = {
55
31
  context: FrameContext;
56
32
  close: () => void;
57
- ready: (options?: Partial<ReadyOptions>) => void;
33
+ ready: Ready.Ready;
58
34
  openUrl: (url: string) => void;
59
35
  signIn: SignIn.SignIn;
60
36
  setPrimaryButton: SetPrimaryButton;
61
- ethProviderRequest: EthProviderRequest;
62
- ethProviderRequestV2: RpcTransport;
37
+ ethProviderRequest: Ethereum.EthProvideRequest;
38
+ ethProviderRequestV2: Ethereum.RpcTransport;
63
39
  /**
64
40
  * Receive forwarded eip6963:requestProvider events from the frame document.
65
41
  * Hosts must emit an EventEip6963AnnounceProvider in response.
@@ -70,34 +46,6 @@ export type FrameHost = {
70
46
  viewToken: ViewToken.ViewToken;
71
47
  swap: Swap.Swap;
72
48
  };
73
- export type FrameEthProviderEventData = {
74
- type: 'frame_eth_provider_event';
75
- } & EthProviderWireEvent;
76
- export type RpcTransport = (request: RpcRequest.RpcRequest) => Promise<RpcResponse.RpcResponse>;
77
- export type ProviderRpcError = {
78
- code: number;
79
- details?: string;
80
- message?: string;
81
- };
82
- export type EthProviderWireEvent = {
83
- event: 'accountsChanged';
84
- params: [readonly Address.Address[]];
85
- } | {
86
- event: 'chainChanged';
87
- params: [string];
88
- } | {
89
- event: 'connect';
90
- params: [Provider.ConnectInfo];
91
- } | {
92
- event: 'disconnect';
93
- params: [ProviderRpcError];
94
- } | {
95
- event: 'message';
96
- params: [Provider.Message];
97
- };
98
- export type EmitEthProvider = <event extends EthProviderWireEvent['event']>(event: event, params: Extract<EthProviderWireEvent, {
99
- event: event;
100
- }>['params']) => void;
101
49
  export type EventFrameAddRejected = {
102
50
  event: 'frame_add_rejected';
103
51
  reason: AddFrame.AddFrameRejectedReason;
@@ -105,17 +53,4 @@ export type EventFrameAddRejected = {
105
53
  export type EventPrimaryButtonClicked = {
106
54
  event: 'primary_button_clicked';
107
55
  };
108
- /**
109
- * Metadata of the EIP-1193 Provider.
110
- */
111
- export interface EIP6963ProviderInfo {
112
- icon: `data:image/${string}`;
113
- name: string;
114
- rdns: string;
115
- uuid: string;
116
- }
117
- export type EventEip6963AnnounceProvider = {
118
- event: 'eip6963:announceProvider';
119
- info: EIP6963ProviderInfo;
120
- };
121
- export type FrameClientEvent = EventFrameAdded | EventFrameAddRejected | EventFrameRemoved | EventNotificationsEnabled | EventNotificationsDisabled | EventPrimaryButtonClicked | EventEip6963AnnounceProvider;
56
+ export type FrameClientEvent = EventFrameAdded | EventFrameAddRejected | EventFrameRemoved | EventNotificationsEnabled | EventNotificationsDisabled | EventPrimaryButtonClicked | Ethereum.EventEip6963AnnounceProvider;
package/dist/types.js CHANGED
@@ -1,6 +1,21 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
2
16
  Object.defineProperty(exports, "__esModule", { value: true });
3
17
  exports.DEFAULT_READY_OPTIONS = void 0;
4
- exports.DEFAULT_READY_OPTIONS = {
5
- disableNativeGestures: false,
6
- };
18
+ // start backwards compat, remove in 1.0
19
+ __exportStar(require("./wallet/ethereum"), exports);
20
+ var Ready_1 = require("./actions/Ready");
21
+ Object.defineProperty(exports, "DEFAULT_READY_OPTIONS", { enumerable: true, get: function () { return Ready_1.DEFAULT_READY_OPTIONS; } });
@@ -0,0 +1,43 @@
1
+ import type { Address, Provider, RpcRequest, RpcResponse, RpcSchema } from 'ox';
2
+ export type EthProvideRequest<schema extends RpcSchema.Generic = RpcSchema.Default> = Provider.RequestFn<schema>;
3
+ export type FrameEthProviderEventData = {
4
+ type: 'frame_eth_provider_event';
5
+ } & EthProviderWireEvent;
6
+ export type RpcTransport = (request: RpcRequest.RpcRequest) => Promise<RpcResponse.RpcResponse>;
7
+ export type ProviderRpcError = {
8
+ code: number;
9
+ details?: string;
10
+ message?: string;
11
+ };
12
+ export type EthProviderWireEvent = {
13
+ event: 'accountsChanged';
14
+ params: [readonly Address.Address[]];
15
+ } | {
16
+ event: 'chainChanged';
17
+ params: [string];
18
+ } | {
19
+ event: 'connect';
20
+ params: [Provider.ConnectInfo];
21
+ } | {
22
+ event: 'disconnect';
23
+ params: [ProviderRpcError];
24
+ } | {
25
+ event: 'message';
26
+ params: [Provider.Message];
27
+ };
28
+ export type EmitEthProvider = <event extends EthProviderWireEvent['event']>(event: event, params: Extract<EthProviderWireEvent, {
29
+ event: event;
30
+ }>['params']) => void;
31
+ /**
32
+ * Metadata of the EIP-1193 Provider.
33
+ */
34
+ export interface EIP6963ProviderInfo {
35
+ icon: `data:image/${string}`;
36
+ name: string;
37
+ rdns: string;
38
+ uuid: string;
39
+ }
40
+ export type EventEip6963AnnounceProvider = {
41
+ event: 'eip6963:announceProvider';
42
+ info: EIP6963ProviderInfo;
43
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export * as Ethereum from './ethereum';
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.Ethereum = void 0;
37
+ exports.Ethereum = __importStar(require("./ethereum"));
@@ -1,36 +1,40 @@
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
- notificationDetails?: FrameNotificationDetails;
6
- };
7
- export type AddFrame = () => Promise<AddFrameResult>;
5
+ notificationDetails?: FrameNotificationDetails
6
+ }
7
+ export type AddFrame = () => Promise<AddFrameResult>
8
8
  type InvalidDomainManifestJsonError = {
9
- type: 'invalid_domain_manifest';
10
- };
9
+ type: 'invalid_domain_manifest'
10
+ }
11
11
  type RejectedByUserJsonError = {
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>;
12
+ type: 'rejected_by_user'
13
+ }
14
+ export type AddFrameJsonError =
15
+ | InvalidDomainManifestJsonError
16
+ | RejectedByUserJsonError
17
+ export type AddFrameRejectedReason = AddFrameJsonError['type']
18
+ export type AddFrameJsonResult = OneOf<
19
+ | {
20
+ result: AddFrameResult
21
+ }
22
+ | {
23
+ error: AddFrameJsonError
24
+ }
25
+ >
26
+ export type WireAddFrame = () => Promise<AddFrameJsonResult>
22
27
  /**
23
28
  * Thrown when the frame does not have a valid domain manifest.
24
29
  */
25
30
  export declare class InvalidDomainManifest extends Errors.BaseError {
26
- readonly name = "AddFrame.InvalidDomainManifest";
27
- constructor();
31
+ readonly name = 'AddFrame.InvalidDomainManifest'
32
+ constructor()
28
33
  }
29
34
  /**
30
35
  * Thrown when add frame action was rejected by the user.
31
36
  */
32
37
  export declare class RejectedByUser extends Errors.BaseError {
33
- readonly name = "AddFrame.RejectedByUser";
34
- constructor();
38
+ readonly name = 'AddFrame.RejectedByUser'
39
+ constructor()
35
40
  }
36
- export {};
@@ -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
- name = 'AddFrame.InvalidDomainManifest';
7
- constructor() {
8
- super('Invalid domain manifest');
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
- name = 'AddFrame.RejectedByUser';
16
- constructor() {
17
- super('Add frame rejected by user');
18
- }
15
+ name = 'AddFrame.RejectedByUser'
16
+ constructor() {
17
+ super('Add frame rejected by user')
18
+ }
19
19
  }
@@ -0,0 +1,13 @@
1
+ export type ReadyOptions = {
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
+ export declare const DEFAULT_READY_OPTIONS: {
11
+ disableNativeGestures: false
12
+ }
13
+ export type Ready = (options?: Partial<ReadyOptions>) => void
@@ -0,0 +1,3 @@
1
+ export const DEFAULT_READY_OPTIONS = {
2
+ disableNativeGestures: false,
3
+ }
@@ -1,41 +1,43 @@
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
- * 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
- };
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
- signature: string;
21
- message: string;
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
- 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>;
25
+ type: 'rejected_by_user'
26
+ }
27
+ export type SignInJsonError = RejectedByUserJsonError
28
+ export type SignInJsonResult = OneOf<
29
+ | {
30
+ result: SignInResult
31
+ }
32
+ | {
33
+ error: SignInJsonError
34
+ }
35
+ >
36
+ export type WireSignIn = (options: SignInOptions) => Promise<SignInJsonResult>
34
37
  /**
35
38
  * Thrown when a sign in action was rejected.
36
39
  */
37
40
  export declare class RejectedByUser extends Errors.BaseError {
38
- readonly name = "SignIn.RejectedByUser";
39
- constructor();
41
+ readonly name = 'SignIn.RejectedByUser'
42
+ constructor()
40
43
  }
41
- export {};
@@ -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
- name = 'SignIn.RejectedByUser';
7
- constructor() {
8
- super('Sign in rejected by user');
9
- }
6
+ name = 'SignIn.RejectedByUser'
7
+ constructor() {
8
+ super('Sign in rejected by user')
9
+ }
10
10
  }
@@ -1,46 +1,47 @@
1
1
  export type SwapOptions = {
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
- };
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
- * 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
- };
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
- * 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 {};
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
+ | {
39
+ success: true
40
+ swap: SwapDetails
41
+ }
42
+ | {
43
+ success: false
44
+ reason: SwapErrorReason
45
+ error?: SwapErrorDetails
46
+ }
47
+ export type Swap = (options: SwapOptions) => Promise<SwapResult>
@@ -1 +1 @@
1
- export {};
1
+ export {}
@@ -1,4 +1,4 @@
1
1
  export type ViewProfileOptions = {
2
- fid: number;
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
- token: string;
3
- };
4
- export type ViewToken = (options: ViewTokenOptions) => Promise<void>;
2
+ token: string
3
+ }
4
+ export type ViewToken = (options: ViewTokenOptions) => Promise<void>
@@ -1 +1 @@
1
- export {};
1
+ export {}