@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.
- package/LICENSE +21 -0
- package/dist/actions/Ready.d.ts +13 -0
- package/dist/actions/Ready.js +6 -0
- package/dist/actions/index.d.ts +3 -2
- package/dist/actions/index.js +4 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/types.d.ts +12 -77
- package/dist/types.js +18 -3
- package/dist/wallet/ethereum.d.ts +43 -0
- package/dist/wallet/ethereum.js +2 -0
- package/dist/wallet/index.d.ts +1 -0
- package/dist/wallet/index.js +37 -0
- package/esm/actions/AddFrame.d.ts +27 -23
- package/esm/actions/AddFrame.js +9 -9
- package/esm/actions/Ready.d.ts +13 -0
- package/esm/actions/Ready.js +3 -0
- package/esm/actions/SignIn.d.ts +35 -33
- package/esm/actions/SignIn.js +5 -5
- package/esm/actions/Swap.d.ts +44 -43
- 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 +6 -5
- package/esm/actions/index.js +6 -5
- package/esm/context.d.ts +65 -61
- package/esm/context.js +1 -1
- package/esm/errors.d.ts +9 -7
- package/esm/errors.js +6 -6
- package/esm/index.d.ts +5 -4
- package/esm/index.js +5 -4
- package/esm/internal/types.d.ts +18 -7
- package/esm/internal/types.js +1 -1
- package/esm/schemas/embeds.d.ts +346 -239
- package/esm/schemas/embeds.js +31 -23
- package/esm/schemas/events.d.ts +225 -129
- 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 +154 -110
- package/esm/schemas/manifest.js +29 -23
- package/esm/schemas/notifications.d.ts +86 -58
- package/esm/schemas/notifications.js +17 -17
- package/esm/schemas/shared.d.ts +53 -35
- package/esm/schemas/shared.js +25 -23
- package/esm/tsconfig.tsbuildinfo +1 -1
- package/esm/types.d.ts +69 -115
- package/esm/types.js +3 -3
- package/esm/wallet/ethereum.d.ts +58 -0
- package/esm/wallet/ethereum.js +1 -0
- package/esm/wallet/index.d.ts +1 -0
- package/esm/wallet/index.js +1 -0
- package/package.json +8 -2
- package/src/actions/Ready.ts +15 -0
- package/src/actions/index.ts +3 -2
- package/src/index.ts +1 -0
- package/src/types.ts +22 -100
- package/src/wallet/ethereum.ts +61 -0
- 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;
|
package/dist/actions/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * as AddFrame from './AddFrame';
|
|
2
|
-
export * as
|
|
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';
|
package/dist/actions/index.js
CHANGED
|
@@ -33,9 +33,10 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.
|
|
36
|
+
exports.ViewToken = exports.ViewProfile = exports.Swap = exports.SignIn = exports.Ready = exports.AddFrame = void 0;
|
|
37
37
|
exports.AddFrame = __importStar(require("./AddFrame"));
|
|
38
|
-
exports.
|
|
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
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 {
|
|
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:
|
|
18
|
+
ready: Ready.Ready;
|
|
43
19
|
openUrl: (url: string) => void;
|
|
44
20
|
signIn: SignIn.WireSignIn;
|
|
45
21
|
setPrimaryButton: SetPrimaryButton;
|
|
46
|
-
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:
|
|
33
|
+
ready: Ready.Ready;
|
|
58
34
|
openUrl: (url: string) => void;
|
|
59
35
|
signIn: SignIn.SignIn;
|
|
60
36
|
setPrimaryButton: SetPrimaryButton;
|
|
61
|
-
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
|
-
|
|
5
|
-
|
|
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 @@
|
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
27
|
-
|
|
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
|
-
|
|
34
|
-
|
|
38
|
+
readonly name = 'AddFrame.RejectedByUser'
|
|
39
|
+
constructor()
|
|
35
40
|
}
|
|
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,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
|
package/esm/actions/SignIn.d.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
39
|
-
|
|
41
|
+
readonly name = 'SignIn.RejectedByUser'
|
|
42
|
+
constructor()
|
|
40
43
|
}
|
|
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,46 +1,47 @@
|
|
|
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
|
-
|
|
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>
|
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 {}
|