@farcaster/frame-core 0.1.10 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +153 -10
- package/dist/index.js +18 -33
- package/esm/index.d.ts +153 -10
- package/esm/index.js +17 -10
- package/esm/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -8
- package/src/index.ts +50 -10
- package/dist/actions/AddMiniApp.d.ts +0 -36
- package/dist/actions/AddMiniApp.js +0 -57
- package/dist/actions/ComposeCast.d.ts +0 -37
- package/dist/actions/ComposeCast.js +0 -2
- package/dist/actions/Haptics.d.ts +0 -5
- package/dist/actions/Haptics.js +0 -2
- package/dist/actions/Ready.d.ts +0 -13
- package/dist/actions/Ready.js +0 -6
- package/dist/actions/SendToken.d.ts +0 -48
- package/dist/actions/SendToken.js +0 -2
- package/dist/actions/SignIn.d.ts +0 -55
- package/dist/actions/SignIn.js +0 -47
- package/dist/actions/SwapToken.d.ts +0 -46
- package/dist/actions/SwapToken.js +0 -2
- package/dist/actions/ViewCast.d.ts +0 -25
- package/dist/actions/ViewCast.js +0 -2
- package/dist/actions/ViewProfile.d.ts +0 -4
- package/dist/actions/ViewProfile.js +0 -2
- package/dist/actions/ViewToken.d.ts +0 -4
- package/dist/actions/ViewToken.js +0 -2
- package/dist/actions/index.d.ts +0 -10
- package/dist/actions/index.js +0 -46
- package/dist/back.d.ts +0 -13
- package/dist/back.js +0 -6
- package/dist/context.d.ts +0 -94
- package/dist/context.js +0 -2
- package/dist/errors.d.ts +0 -13
- package/dist/errors.js +0 -12
- package/dist/internal/types.d.ts +0 -8
- package/dist/internal/types.js +0 -2
- package/dist/manifest.d.ts +0 -101
- package/dist/manifest.js +0 -2
- package/dist/schemas/embeds.d.ts +0 -243
- package/dist/schemas/embeds.js +0 -32
- package/dist/schemas/events.d.ts +0 -131
- package/dist/schemas/events.js +0 -25
- package/dist/schemas/index.d.ts +0 -5
- package/dist/schemas/index.js +0 -21
- package/dist/schemas/manifest.d.ts +0 -334
- package/dist/schemas/manifest.js +0 -112
- package/dist/schemas/notifications.d.ts +0 -60
- package/dist/schemas/notifications.js +0 -23
- package/dist/schemas/shared.d.ts +0 -39
- package/dist/schemas/shared.js +0 -58
- package/dist/solana.d.ts +0 -72
- package/dist/solana.js +0 -15
- package/dist/solanaWire.d.ts +0 -3
- package/dist/solanaWire.js +0 -84
- package/dist/types.d.ts +0 -87
- package/dist/types.js +0 -41
- package/dist/wallet/ethereum.d.ts +0 -47
- package/dist/wallet/ethereum.js +0 -2
- package/dist/wallet/index.d.ts +0 -1
- package/dist/wallet/index.js +0 -37
- package/esm/actions/AddMiniApp.d.ts +0 -36
- package/esm/actions/AddMiniApp.js +0 -19
- package/esm/actions/ComposeCast.d.ts +0 -37
- package/esm/actions/ComposeCast.js +0 -1
- package/esm/actions/Haptics.d.ts +0 -5
- package/esm/actions/Haptics.js +0 -1
- package/esm/actions/Ready.d.ts +0 -13
- package/esm/actions/Ready.js +0 -3
- package/esm/actions/SendToken.d.ts +0 -48
- package/esm/actions/SendToken.js +0 -1
- package/esm/actions/SignIn.d.ts +0 -55
- package/esm/actions/SignIn.js +0 -10
- package/esm/actions/SwapToken.d.ts +0 -46
- package/esm/actions/SwapToken.js +0 -1
- package/esm/actions/ViewCast.d.ts +0 -25
- package/esm/actions/ViewCast.js +0 -1
- package/esm/actions/ViewProfile.d.ts +0 -4
- package/esm/actions/ViewProfile.js +0 -1
- package/esm/actions/ViewToken.d.ts +0 -4
- package/esm/actions/ViewToken.js +0 -1
- package/esm/actions/index.d.ts +0 -10
- package/esm/actions/index.js +0 -10
- package/esm/back.d.ts +0 -13
- package/esm/back.js +0 -3
- package/esm/context.d.ts +0 -94
- package/esm/context.js +0 -1
- package/esm/errors.d.ts +0 -13
- package/esm/errors.js +0 -8
- package/esm/internal/types.d.ts +0 -8
- package/esm/internal/types.js +0 -1
- package/esm/manifest.d.ts +0 -101
- package/esm/manifest.js +0 -1
- package/esm/schemas/embeds.d.ts +0 -243
- package/esm/schemas/embeds.js +0 -28
- package/esm/schemas/events.d.ts +0 -131
- package/esm/schemas/events.js +0 -22
- package/esm/schemas/index.d.ts +0 -5
- package/esm/schemas/index.js +0 -5
- package/esm/schemas/manifest.d.ts +0 -334
- package/esm/schemas/manifest.js +0 -109
- package/esm/schemas/notifications.d.ts +0 -60
- package/esm/schemas/notifications.js +0 -20
- package/esm/schemas/shared.d.ts +0 -39
- package/esm/schemas/shared.js +0 -54
- package/esm/solana.d.ts +0 -72
- package/esm/solana.js +0 -11
- package/esm/solanaWire.d.ts +0 -3
- package/esm/solanaWire.js +0 -80
- package/esm/types.d.ts +0 -87
- package/esm/types.js +0 -23
- package/esm/wallet/ethereum.d.ts +0 -47
- package/esm/wallet/ethereum.js +0 -1
- package/esm/wallet/index.d.ts +0 -1
- package/esm/wallet/index.js +0 -1
- package/src/actions/AddMiniApp.ts +0 -51
- package/src/actions/ComposeCast.ts +0 -44
- package/src/actions/Haptics.ts +0 -9
- package/src/actions/Ready.ts +0 -15
- package/src/actions/SendToken.ts +0 -57
- package/src/actions/SignIn.ts +0 -67
- package/src/actions/SwapToken.ts +0 -54
- package/src/actions/ViewCast.ts +0 -27
- package/src/actions/ViewProfile.ts +0 -5
- package/src/actions/ViewToken.ts +0 -5
- package/src/actions/index.ts +0 -10
- package/src/back.ts +0 -15
- package/src/context.ts +0 -117
- package/src/errors.ts +0 -21
- package/src/internal/types.ts +0 -20
- package/src/manifest.ts +0 -113
- package/src/schemas/embeds.ts +0 -44
- package/src/schemas/events.ts +0 -41
- package/src/schemas/index.ts +0 -5
- package/src/schemas/manifest.ts +0 -122
- package/src/schemas/notifications.ts +0 -33
- package/src/schemas/shared.ts +0 -81
- package/src/solana.ts +0 -108
- package/src/solanaWire.ts +0 -120
- package/src/types.ts +0 -155
- package/src/wallet/ethereum.ts +0 -65
- package/src/wallet/index.ts +0 -1
package/dist/solana.d.ts
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { Connection as SolanaConnection, type SendOptions as SolanaSendOptions, type Transaction as SolanaTransaction, type VersionedTransaction as SolanaVersionedTransaction } from '@solana/web3.js';
|
|
2
|
-
export { SolanaConnection };
|
|
3
|
-
export type { SolanaSendOptions };
|
|
4
|
-
export type SolanaCombinedTransaction = SolanaTransaction | SolanaVersionedTransaction;
|
|
5
|
-
export type SolanaConnectRequestArguments = {
|
|
6
|
-
method: 'connect';
|
|
7
|
-
};
|
|
8
|
-
export type SolanaSignMessageRequestArguments = {
|
|
9
|
-
method: 'signMessage';
|
|
10
|
-
params: {
|
|
11
|
-
message: string;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
export type SolanaSignAndSendTransactionRequestArguments = {
|
|
15
|
-
method: 'signAndSendTransaction';
|
|
16
|
-
params: {
|
|
17
|
-
transaction: SolanaCombinedTransaction;
|
|
18
|
-
options?: SolanaSendOptions;
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
export type SolanaSignTransactionRequestArguments<T extends SolanaCombinedTransaction = SolanaTransaction> = {
|
|
22
|
-
method: 'signTransaction';
|
|
23
|
-
params: {
|
|
24
|
-
transaction: T;
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
export type SolanaRequestFn = ((request: SolanaConnectRequestArguments) => Promise<{
|
|
28
|
-
publicKey: string;
|
|
29
|
-
}>) & ((request: SolanaSignMessageRequestArguments) => Promise<{
|
|
30
|
-
signature: string;
|
|
31
|
-
}>) & ((request: SolanaSignAndSendTransactionRequestArguments) => Promise<{
|
|
32
|
-
signature: string;
|
|
33
|
-
}>) & (<T extends SolanaCombinedTransaction>(request: SolanaSignTransactionRequestArguments<T>) => Promise<{
|
|
34
|
-
signedTransaction: T;
|
|
35
|
-
}>);
|
|
36
|
-
export interface SolanaWalletProvider {
|
|
37
|
-
request: SolanaRequestFn;
|
|
38
|
-
signMessage(message: string): Promise<{
|
|
39
|
-
signature: string;
|
|
40
|
-
}>;
|
|
41
|
-
signTransaction<T extends SolanaCombinedTransaction>(transaction: T): Promise<{
|
|
42
|
-
signedTransaction: T;
|
|
43
|
-
}>;
|
|
44
|
-
signAndSendTransaction(input: {
|
|
45
|
-
transaction: SolanaCombinedTransaction;
|
|
46
|
-
}): Promise<{
|
|
47
|
-
signature: string;
|
|
48
|
-
}>;
|
|
49
|
-
}
|
|
50
|
-
export declare const createSolanaWalletProvider: (request: SolanaRequestFn) => SolanaWalletProvider;
|
|
51
|
-
export type SolanaWireSignAndSendTransactionRequestArguments = {
|
|
52
|
-
method: 'signAndSendTransaction';
|
|
53
|
-
params: {
|
|
54
|
-
transaction: string;
|
|
55
|
-
options?: SolanaSendOptions;
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
export type SolanaWireSignTransactionRequestArguments = {
|
|
59
|
-
method: 'signTransaction';
|
|
60
|
-
params: {
|
|
61
|
-
transaction: string;
|
|
62
|
-
};
|
|
63
|
-
};
|
|
64
|
-
export type SolanaWireRequestFn = ((request: SolanaConnectRequestArguments) => Promise<{
|
|
65
|
-
publicKey: string;
|
|
66
|
-
}>) & ((request: SolanaSignMessageRequestArguments) => Promise<{
|
|
67
|
-
signature: string;
|
|
68
|
-
}>) & ((request: SolanaWireSignAndSendTransactionRequestArguments) => Promise<{
|
|
69
|
-
signature: string;
|
|
70
|
-
}>) & ((request: SolanaWireSignTransactionRequestArguments) => Promise<{
|
|
71
|
-
signedTransaction: string;
|
|
72
|
-
}>);
|
package/dist/solana.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createSolanaWalletProvider = exports.SolanaConnection = void 0;
|
|
4
|
-
const web3_js_1 = require("@solana/web3.js");
|
|
5
|
-
Object.defineProperty(exports, "SolanaConnection", { enumerable: true, get: function () { return web3_js_1.Connection; } });
|
|
6
|
-
const createSolanaWalletProvider = (request) => ({
|
|
7
|
-
request,
|
|
8
|
-
signMessage: (msg) => request({ method: 'signMessage', params: { message: msg } }),
|
|
9
|
-
signTransaction: (transaction) => request({ method: 'signTransaction', params: { transaction } }),
|
|
10
|
-
signAndSendTransaction: (input) => request({
|
|
11
|
-
method: 'signAndSendTransaction',
|
|
12
|
-
params: input,
|
|
13
|
-
}),
|
|
14
|
-
});
|
|
15
|
-
exports.createSolanaWalletProvider = createSolanaWalletProvider;
|
package/dist/solanaWire.d.ts
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { SolanaRequestFn, SolanaWireRequestFn } from './solana.ts';
|
|
2
|
-
export declare function wrapSolanaProviderRequest(requestFn: SolanaRequestFn): SolanaWireRequestFn;
|
|
3
|
-
export declare function unwrapSolanaProviderRequest(wrappedRequestFn: SolanaWireRequestFn): SolanaRequestFn;
|
package/dist/solanaWire.js
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.wrapSolanaProviderRequest = wrapSolanaProviderRequest;
|
|
4
|
-
exports.unwrapSolanaProviderRequest = unwrapSolanaProviderRequest;
|
|
5
|
-
const web3_js_1 = require("@solana/web3.js");
|
|
6
|
-
function serializeTransaction(transaction) {
|
|
7
|
-
return Buffer.from(transaction.serialize({
|
|
8
|
-
verifySignatures: false,
|
|
9
|
-
})).toString('base64');
|
|
10
|
-
}
|
|
11
|
-
function unserializeTransaction(transaction) {
|
|
12
|
-
const bytes = Buffer.from(transaction, 'base64');
|
|
13
|
-
const version = web3_js_1.VersionedMessage.deserializeMessageVersion(bytes);
|
|
14
|
-
return version === 'legacy'
|
|
15
|
-
? web3_js_1.VersionedTransaction.deserialize(bytes)
|
|
16
|
-
: web3_js_1.Transaction.from(bytes);
|
|
17
|
-
}
|
|
18
|
-
function wrapSolanaProviderRequest(requestFn) {
|
|
19
|
-
const wrappedFn = async (request) => {
|
|
20
|
-
if (request.method === 'connect') {
|
|
21
|
-
return await requestFn(request);
|
|
22
|
-
}
|
|
23
|
-
if (request.method === 'signMessage') {
|
|
24
|
-
return await requestFn(request);
|
|
25
|
-
}
|
|
26
|
-
if (request.method === 'signAndSendTransaction') {
|
|
27
|
-
const { transaction, options } = request.params;
|
|
28
|
-
const params = {
|
|
29
|
-
transaction: unserializeTransaction(transaction),
|
|
30
|
-
options,
|
|
31
|
-
};
|
|
32
|
-
return await requestFn({
|
|
33
|
-
method: 'signAndSendTransaction',
|
|
34
|
-
params,
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
if (request.method === 'signTransaction') {
|
|
38
|
-
const { transaction } = request.params;
|
|
39
|
-
const params = {
|
|
40
|
-
transaction: unserializeTransaction(transaction),
|
|
41
|
-
};
|
|
42
|
-
const { signedTransaction } = await requestFn({
|
|
43
|
-
method: 'signTransaction',
|
|
44
|
-
params,
|
|
45
|
-
});
|
|
46
|
-
return {
|
|
47
|
-
signedTransaction: serializeTransaction(signedTransaction),
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
return wrappedFn;
|
|
52
|
-
}
|
|
53
|
-
function unwrapSolanaProviderRequest(wrappedRequestFn) {
|
|
54
|
-
const unwrappedFn = async (request) => {
|
|
55
|
-
if (request.method === 'connect') {
|
|
56
|
-
return await wrappedRequestFn(request);
|
|
57
|
-
}
|
|
58
|
-
if (request.method === 'signMessage') {
|
|
59
|
-
return await wrappedRequestFn(request);
|
|
60
|
-
}
|
|
61
|
-
if (request.method === 'signAndSendTransaction') {
|
|
62
|
-
const { transaction, options } = request.params;
|
|
63
|
-
const params = {
|
|
64
|
-
transaction: serializeTransaction(transaction),
|
|
65
|
-
};
|
|
66
|
-
return await wrappedRequestFn({
|
|
67
|
-
method: 'signAndSendTransaction',
|
|
68
|
-
params,
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
if (request.method === 'signTransaction') {
|
|
72
|
-
const { transaction } = request.params;
|
|
73
|
-
const params = {
|
|
74
|
-
transaction: serializeTransaction(transaction),
|
|
75
|
-
};
|
|
76
|
-
const { signedTransaction } = await wrappedRequestFn({
|
|
77
|
-
method: 'signTransaction',
|
|
78
|
-
params,
|
|
79
|
-
});
|
|
80
|
-
return { signedTransaction: unserializeTransaction(signedTransaction) };
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
return unwrappedFn;
|
|
84
|
-
}
|
package/dist/types.d.ts
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import type { ImpactOccurred, NotificationOccurred, SelectionChanged } from './actions/Haptics.ts';
|
|
2
|
-
import type { AddMiniApp, ComposeCast, Ready, SendToken, SignIn, SwapToken, ViewCast, ViewProfile, ViewToken } from './actions/index.ts';
|
|
3
|
-
import type { UpdateBackState } from './back.ts';
|
|
4
|
-
import type { FrameContext } from './context.ts';
|
|
5
|
-
import type { EventFrameAdded, EventFrameRemoved, EventNotificationsDisabled, EventNotificationsEnabled } from './schemas/index.ts';
|
|
6
|
-
import type { SolanaRequestFn, SolanaWireRequestFn } from './solana.ts';
|
|
7
|
-
import type { Ethereum } from './wallet/index.ts';
|
|
8
|
-
export type SetPrimaryButtonOptions = {
|
|
9
|
-
text: string;
|
|
10
|
-
loading?: boolean;
|
|
11
|
-
disabled?: boolean;
|
|
12
|
-
hidden?: boolean;
|
|
13
|
-
};
|
|
14
|
-
export * from './wallet/ethereum.ts';
|
|
15
|
-
export { DEFAULT_READY_OPTIONS, ReadyOptions } from './actions/Ready.ts';
|
|
16
|
-
export type SignInOptions = SignIn.SignInOptions;
|
|
17
|
-
export type SetPrimaryButton = (options: SetPrimaryButtonOptions) => void;
|
|
18
|
-
export type { ImpactOccurred, NotificationOccurred, SelectionChanged };
|
|
19
|
-
export declare const miniAppHostCapabilityList: readonly ["wallet.getEthereumProvider", "wallet.getSolanaProvider", "actions.ready", "actions.openUrl", "actions.close", "actions.setPrimaryButton", "actions.addMiniApp", "actions.signIn", "actions.viewCast", "actions.viewProfile", "actions.composeCast", "actions.viewToken", "actions.sendToken", "actions.swapToken", "haptics.impactOccurred", "haptics.notificationOccurred", "haptics.selectionChanged", "back"];
|
|
20
|
-
export type MiniAppHostCapability = (typeof miniAppHostCapabilityList)[number];
|
|
21
|
-
export type GetCapabilities = () => Promise<MiniAppHostCapability[]>;
|
|
22
|
-
export type GetChains = () => Promise<string[]>;
|
|
23
|
-
export type WireFrameHost = {
|
|
24
|
-
context: FrameContext;
|
|
25
|
-
close: () => void;
|
|
26
|
-
ready: Ready.Ready;
|
|
27
|
-
openUrl: (url: string) => void;
|
|
28
|
-
signIn: SignIn.WireSignIn;
|
|
29
|
-
setPrimaryButton: SetPrimaryButton;
|
|
30
|
-
ethProviderRequest: Ethereum.EthProvideRequest;
|
|
31
|
-
ethProviderRequestV2: Ethereum.RpcTransport;
|
|
32
|
-
eip6963RequestProvider: () => void;
|
|
33
|
-
solanaProviderRequest?: SolanaWireRequestFn;
|
|
34
|
-
addFrame: AddMiniApp.WireAddMiniApp;
|
|
35
|
-
viewCast: ViewCast.ViewCast;
|
|
36
|
-
viewProfile: ViewProfile.ViewProfile;
|
|
37
|
-
viewToken: ViewToken.ViewToken;
|
|
38
|
-
sendToken: SendToken.SendToken;
|
|
39
|
-
swapToken: SwapToken.SwapToken;
|
|
40
|
-
composeCast: <close extends boolean | undefined = undefined>(options: ComposeCast.Options<close>) => Promise<ComposeCast.Result<close>>;
|
|
41
|
-
impactOccurred: ImpactOccurred;
|
|
42
|
-
notificationOccurred: NotificationOccurred;
|
|
43
|
-
selectionChanged: SelectionChanged;
|
|
44
|
-
getCapabilities: GetCapabilities;
|
|
45
|
-
getChains: GetChains;
|
|
46
|
-
updateBackState: UpdateBackState;
|
|
47
|
-
};
|
|
48
|
-
export type FrameHost = {
|
|
49
|
-
context: FrameContext;
|
|
50
|
-
close: () => void;
|
|
51
|
-
ready: Ready.Ready;
|
|
52
|
-
openUrl: (url: string) => void;
|
|
53
|
-
signIn: SignIn.SignIn;
|
|
54
|
-
setPrimaryButton: SetPrimaryButton;
|
|
55
|
-
ethProviderRequest: Ethereum.EthProvideRequest;
|
|
56
|
-
ethProviderRequestV2: Ethereum.RpcTransport;
|
|
57
|
-
/**
|
|
58
|
-
* Receive forwarded eip6963:requestProvider events from the frame document.
|
|
59
|
-
* Hosts must emit an EventEip6963AnnounceProvider in response.
|
|
60
|
-
*/
|
|
61
|
-
eip6963RequestProvider: () => void;
|
|
62
|
-
solanaProviderRequest?: SolanaRequestFn;
|
|
63
|
-
addFrame: AddMiniApp.AddMiniApp;
|
|
64
|
-
viewCast: ViewCast.ViewCast;
|
|
65
|
-
viewProfile: ViewProfile.ViewProfile;
|
|
66
|
-
viewToken: ViewToken.ViewToken;
|
|
67
|
-
sendToken: SendToken.SendToken;
|
|
68
|
-
swapToken: SwapToken.SwapToken;
|
|
69
|
-
composeCast: <close extends boolean | undefined = undefined>(options: ComposeCast.Options<close>) => Promise<ComposeCast.Result<close>>;
|
|
70
|
-
impactOccurred: ImpactOccurred;
|
|
71
|
-
notificationOccurred: NotificationOccurred;
|
|
72
|
-
selectionChanged: SelectionChanged;
|
|
73
|
-
getCapabilities: GetCapabilities;
|
|
74
|
-
getChains: GetChains;
|
|
75
|
-
updateBackState: UpdateBackState;
|
|
76
|
-
};
|
|
77
|
-
export type EventFrameAddRejected = {
|
|
78
|
-
event: 'frame_add_rejected';
|
|
79
|
-
reason: AddMiniApp.AddMiniAppRejectedReason;
|
|
80
|
-
};
|
|
81
|
-
export type EventPrimaryButtonClicked = {
|
|
82
|
-
event: 'primary_button_clicked';
|
|
83
|
-
};
|
|
84
|
-
export type EventBackNavigationTriggered = {
|
|
85
|
-
event: 'back_navigation_triggered';
|
|
86
|
-
};
|
|
87
|
-
export type FrameClientEvent = EventFrameAdded | EventFrameAddRejected | EventFrameRemoved | EventNotificationsEnabled | EventNotificationsDisabled | EventPrimaryButtonClicked | EventBackNavigationTriggered | Ethereum.EventEip6963AnnounceProvider;
|
package/dist/types.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
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
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.miniAppHostCapabilityList = exports.DEFAULT_READY_OPTIONS = void 0;
|
|
18
|
-
// start backwards compat, remove in 1.0
|
|
19
|
-
__exportStar(require("./wallet/ethereum.js"), exports);
|
|
20
|
-
var Ready_ts_1 = require("./actions/Ready.js");
|
|
21
|
-
Object.defineProperty(exports, "DEFAULT_READY_OPTIONS", { enumerable: true, get: function () { return Ready_ts_1.DEFAULT_READY_OPTIONS; } });
|
|
22
|
-
exports.miniAppHostCapabilityList = [
|
|
23
|
-
'wallet.getEthereumProvider',
|
|
24
|
-
'wallet.getSolanaProvider',
|
|
25
|
-
'actions.ready',
|
|
26
|
-
'actions.openUrl',
|
|
27
|
-
'actions.close',
|
|
28
|
-
'actions.setPrimaryButton',
|
|
29
|
-
'actions.addMiniApp',
|
|
30
|
-
'actions.signIn',
|
|
31
|
-
'actions.viewCast',
|
|
32
|
-
'actions.viewProfile',
|
|
33
|
-
'actions.composeCast',
|
|
34
|
-
'actions.viewToken',
|
|
35
|
-
'actions.sendToken',
|
|
36
|
-
'actions.swapToken',
|
|
37
|
-
'haptics.impactOccurred',
|
|
38
|
-
'haptics.notificationOccurred',
|
|
39
|
-
'haptics.selectionChanged',
|
|
40
|
-
'back',
|
|
41
|
-
];
|
|
@@ -1,47 +0,0 @@
|
|
|
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';
|
|
6
|
-
export type EthProvideRequest<schema extends RpcSchema.Generic = RpcSchema.Default> = Provider.RequestFn<schema>;
|
|
7
|
-
export type FrameEthProviderEventData = {
|
|
8
|
-
type: 'frame_eth_provider_event';
|
|
9
|
-
} & EthProviderWireEvent;
|
|
10
|
-
export type RpcTransport = (request: RpcRequest.RpcRequest) => Promise<RpcResponse.RpcResponse>;
|
|
11
|
-
export type ProviderRpcError = {
|
|
12
|
-
code: number;
|
|
13
|
-
details?: string;
|
|
14
|
-
message?: string;
|
|
15
|
-
};
|
|
16
|
-
export type EthProviderWireEvent = {
|
|
17
|
-
event: 'accountsChanged';
|
|
18
|
-
params: [readonly Address.Address[]];
|
|
19
|
-
} | {
|
|
20
|
-
event: 'chainChanged';
|
|
21
|
-
params: [string];
|
|
22
|
-
} | {
|
|
23
|
-
event: 'connect';
|
|
24
|
-
params: [Provider.ConnectInfo];
|
|
25
|
-
} | {
|
|
26
|
-
event: 'disconnect';
|
|
27
|
-
params: [ProviderRpcError];
|
|
28
|
-
} | {
|
|
29
|
-
event: 'message';
|
|
30
|
-
params: [Provider.Message];
|
|
31
|
-
};
|
|
32
|
-
export type EmitEthProvider = <event extends EthProviderWireEvent['event']>(event: event, params: Extract<EthProviderWireEvent, {
|
|
33
|
-
event: event;
|
|
34
|
-
}>['params']) => void;
|
|
35
|
-
/**
|
|
36
|
-
* Metadata of the EIP-1193 Provider.
|
|
37
|
-
*/
|
|
38
|
-
export interface EIP6963ProviderInfo {
|
|
39
|
-
icon: `data:image/${string}`;
|
|
40
|
-
name: string;
|
|
41
|
-
rdns: string;
|
|
42
|
-
uuid: string;
|
|
43
|
-
}
|
|
44
|
-
export type EventEip6963AnnounceProvider = {
|
|
45
|
-
event: 'eip6963:announceProvider';
|
|
46
|
-
info: EIP6963ProviderInfo;
|
|
47
|
-
};
|
package/dist/wallet/ethereum.js
DELETED
package/dist/wallet/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * as Ethereum from './ethereum.ts';
|
package/dist/wallet/index.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
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.js"));
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import * as Errors from '../errors.ts';
|
|
2
|
-
import type { OneOf } from '../internal/types.ts';
|
|
3
|
-
import type { FrameNotificationDetails } from '../schemas/index.ts';
|
|
4
|
-
export type AddMiniAppResult = {
|
|
5
|
-
notificationDetails?: FrameNotificationDetails;
|
|
6
|
-
};
|
|
7
|
-
export type AddMiniApp = () => Promise<AddMiniAppResult>;
|
|
8
|
-
type InvalidDomainManifestJsonError = {
|
|
9
|
-
type: 'invalid_domain_manifest';
|
|
10
|
-
};
|
|
11
|
-
type RejectedByUserJsonError = {
|
|
12
|
-
type: 'rejected_by_user';
|
|
13
|
-
};
|
|
14
|
-
export type AddMiniAppJsonError = InvalidDomainManifestJsonError | RejectedByUserJsonError;
|
|
15
|
-
export type AddMiniAppRejectedReason = AddMiniAppJsonError['type'];
|
|
16
|
-
export type AddMiniAppJsonResult = OneOf<{
|
|
17
|
-
result: AddMiniAppResult;
|
|
18
|
-
} | {
|
|
19
|
-
error: AddMiniAppJsonError;
|
|
20
|
-
}>;
|
|
21
|
-
export type WireAddMiniApp = () => Promise<AddMiniAppJsonResult>;
|
|
22
|
-
/**
|
|
23
|
-
* Thrown when the frame does not have a valid domain manifest.
|
|
24
|
-
*/
|
|
25
|
-
export declare class InvalidDomainManifest extends Errors.BaseError {
|
|
26
|
-
readonly name = "AddMiniApp.InvalidDomainManifest";
|
|
27
|
-
constructor();
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Thrown when add frame action was rejected by the user.
|
|
31
|
-
*/
|
|
32
|
-
export declare class RejectedByUser extends Errors.BaseError {
|
|
33
|
-
readonly name = "AddMiniApp.RejectedByUser";
|
|
34
|
-
constructor();
|
|
35
|
-
}
|
|
36
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import * as Errors from "../errors.js";
|
|
2
|
-
/**
|
|
3
|
-
* Thrown when the frame does not have a valid domain manifest.
|
|
4
|
-
*/
|
|
5
|
-
export class InvalidDomainManifest extends Errors.BaseError {
|
|
6
|
-
name = 'AddMiniApp.InvalidDomainManifest';
|
|
7
|
-
constructor() {
|
|
8
|
-
super('Invalid domain manifest');
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Thrown when add frame action was rejected by the user.
|
|
13
|
-
*/
|
|
14
|
-
export class RejectedByUser extends Errors.BaseError {
|
|
15
|
-
name = 'AddMiniApp.RejectedByUser';
|
|
16
|
-
constructor() {
|
|
17
|
-
super('Add frame rejected by user');
|
|
18
|
-
}
|
|
19
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
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-writable 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
|
-
/** Whether the cast should be posted to a channel. */
|
|
18
|
-
channelKey?: string;
|
|
19
|
-
};
|
|
20
|
-
export type ComposeCastInnerResult = {
|
|
21
|
-
/** Cast of the created cast */
|
|
22
|
-
hash: string;
|
|
23
|
-
/** Text of the created cast */
|
|
24
|
-
text?: string;
|
|
25
|
-
/** Embeds of the created cast */
|
|
26
|
-
embeds?: [] | [string] | [string, string];
|
|
27
|
-
/** Parent of the created cast */
|
|
28
|
-
parent?: {
|
|
29
|
-
type: 'cast';
|
|
30
|
-
hash: string;
|
|
31
|
-
};
|
|
32
|
-
/** Channel key of the created cast */
|
|
33
|
-
channelKey?: string;
|
|
34
|
-
};
|
|
35
|
-
export type Result<close extends boolean | undefined = undefined> = close extends true ? undefined : {
|
|
36
|
-
cast: ComposeCastInnerResult | null;
|
|
37
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/esm/actions/Haptics.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export type ImpactOccurredType = 'light' | 'medium' | 'heavy' | 'soft' | 'rigid';
|
|
2
|
-
export type NotificationOccurredType = 'success' | 'warning' | 'error';
|
|
3
|
-
export type ImpactOccurred = (type: ImpactOccurredType) => Promise<void>;
|
|
4
|
-
export type NotificationOccurred = (type: NotificationOccurredType) => Promise<void>;
|
|
5
|
-
export type SelectionChanged = () => Promise<void>;
|
package/esm/actions/Haptics.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/esm/actions/Ready.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
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/Ready.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
export type SendTokenOptions = {
|
|
2
|
-
/**
|
|
3
|
-
* CAIP-19 asset ID
|
|
4
|
-
* For example, Base USDC:
|
|
5
|
-
* eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
|
|
6
|
-
*/
|
|
7
|
-
token?: string;
|
|
8
|
-
/**
|
|
9
|
-
* Token amount, as numeric string.
|
|
10
|
-
* For example, 10 USDC: 1000000
|
|
11
|
-
*/
|
|
12
|
-
amount?: string;
|
|
13
|
-
/**
|
|
14
|
-
* Recipient address.
|
|
15
|
-
*/
|
|
16
|
-
recipientAddress?: string;
|
|
17
|
-
/**
|
|
18
|
-
* Recipient fid.
|
|
19
|
-
*/
|
|
20
|
-
recipientFid?: number;
|
|
21
|
-
};
|
|
22
|
-
type SendTokenDetails = {
|
|
23
|
-
/**
|
|
24
|
-
* Tx identifier.
|
|
25
|
-
*/
|
|
26
|
-
transaction: `0x${string}`;
|
|
27
|
-
};
|
|
28
|
-
type SendTokenErrorDetails = {
|
|
29
|
-
/**
|
|
30
|
-
* Error code.
|
|
31
|
-
*/
|
|
32
|
-
error: string;
|
|
33
|
-
/**
|
|
34
|
-
* Error message.
|
|
35
|
-
*/
|
|
36
|
-
message?: string;
|
|
37
|
-
};
|
|
38
|
-
export type SendTokenErrorReason = 'rejected_by_user' | 'send_failed';
|
|
39
|
-
export type SendTokenResult = {
|
|
40
|
-
success: true;
|
|
41
|
-
send: SendTokenDetails;
|
|
42
|
-
} | {
|
|
43
|
-
success: false;
|
|
44
|
-
reason: SendTokenErrorReason;
|
|
45
|
-
error?: SendTokenErrorDetails;
|
|
46
|
-
};
|
|
47
|
-
export type SendToken = (options: SendTokenOptions) => Promise<SendTokenResult>;
|
|
48
|
-
export {};
|
package/esm/actions/SendToken.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/esm/actions/SignIn.d.ts
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import * as Errors from '../errors.ts';
|
|
2
|
-
import type { OneOf } from '../internal/types.ts';
|
|
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
|
-
/**
|
|
19
|
-
* Whether an [Auth
|
|
20
|
-
* Address](https://github.com/farcasterxyz/protocol/discussions/225) signed
|
|
21
|
-
* message is acceptable. Defaults to `false` to maintain backwards
|
|
22
|
-
* compatibility, though applications should set this to `true` for the best
|
|
23
|
-
* user experience assuming their verification method supports it.
|
|
24
|
-
*
|
|
25
|
-
* @default false
|
|
26
|
-
*/
|
|
27
|
-
acceptAuthAddress?: boolean;
|
|
28
|
-
};
|
|
29
|
-
export type SignInResult = {
|
|
30
|
-
signature: string;
|
|
31
|
-
message: string;
|
|
32
|
-
/**
|
|
33
|
-
* Indicates if the signature was produced by a custody or auth address.
|
|
34
|
-
*/
|
|
35
|
-
authMethod: 'custody' | 'authAddress';
|
|
36
|
-
};
|
|
37
|
-
export type SignIn = (options: SignInOptions) => Promise<SignInResult>;
|
|
38
|
-
type RejectedByUserJsonError = {
|
|
39
|
-
type: 'rejected_by_user';
|
|
40
|
-
};
|
|
41
|
-
export type SignInJsonError = RejectedByUserJsonError;
|
|
42
|
-
export type SignInJsonResult = OneOf<{
|
|
43
|
-
result: SignInResult;
|
|
44
|
-
} | {
|
|
45
|
-
error: SignInJsonError;
|
|
46
|
-
}>;
|
|
47
|
-
export type WireSignIn = (options: SignInOptions) => Promise<SignInJsonResult>;
|
|
48
|
-
/**
|
|
49
|
-
* Thrown when a sign in action was rejected.
|
|
50
|
-
*/
|
|
51
|
-
export declare class RejectedByUser extends Errors.BaseError {
|
|
52
|
-
readonly name = "SignIn.RejectedByUser";
|
|
53
|
-
constructor();
|
|
54
|
-
}
|
|
55
|
-
export {};
|
package/esm/actions/SignIn.js
DELETED