@farcaster/frame-core 0.0.0-canary-20250509164556 → 0.0.0-canary-20250510204457
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 +1 -1
- package/dist/index.js +1 -1
- package/dist/schemas/index.d.ts +0 -1
- package/dist/schemas/index.js +0 -1
- package/dist/solana.d.ts +51 -0
- package/dist/solana.js +13 -0
- package/dist/types.d.ts +3 -3
- package/esm/index.d.ts +1 -1
- package/esm/index.js +1 -1
- package/esm/schemas/index.d.ts +0 -1
- package/esm/schemas/index.js +0 -1
- package/esm/solana.d.ts +51 -0
- package/esm/solana.js +9 -0
- package/esm/tsconfig.tsbuildinfo +1 -1
- package/esm/types.d.ts +3 -3
- package/package.json +2 -1
- package/src/index.ts +1 -1
- package/src/schemas/index.ts +0 -1
- package/src/solana.ts +82 -0
- package/src/types.ts +3 -3
- package/dist/funcs.d.ts +0 -20
- package/dist/funcs.js +0 -2
- package/dist/schemas/funcs.d.ts +0 -11
- package/dist/schemas/funcs.js +0 -78
- package/esm/funcs.d.ts +0 -20
- package/esm/funcs.js +0 -1
- package/esm/schemas/funcs.d.ts +0 -11
- package/esm/schemas/funcs.js +0 -75
- package/src/funcs.ts +0 -22
- package/src/schemas/funcs.ts +0 -83
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -44,4 +44,4 @@ exports.Context = __importStar(require("./context"));
|
|
|
44
44
|
exports.Manifest = __importStar(require("./manifest"));
|
|
45
45
|
__exportStar(require("./types"), exports);
|
|
46
46
|
__exportStar(require("./schemas"), exports);
|
|
47
|
-
__exportStar(require("./
|
|
47
|
+
__exportStar(require("./solana"), exports);
|
package/dist/schemas/index.d.ts
CHANGED
package/dist/schemas/index.js
CHANGED
package/dist/solana.d.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { Connection as SolanaConnection, SendOptions as SolanaSendOptions, Transaction as SolanaTransaction, VersionedTransaction as SolanaVersionedTransaction } from '@solana/web3.js';
|
|
2
|
+
export type { SolanaConnection };
|
|
3
|
+
export type SolanaCombinedTransaction = SolanaTransaction | SolanaVersionedTransaction;
|
|
4
|
+
export type SolanaConnectRequestArguments = {
|
|
5
|
+
method: 'connect';
|
|
6
|
+
};
|
|
7
|
+
export type SolanaSignMessageRequestArguments = {
|
|
8
|
+
method: 'signMessage';
|
|
9
|
+
params: {
|
|
10
|
+
message: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export type SolanaSignAndSendTransactionRequestArguments = {
|
|
14
|
+
method: 'signAndSendTransaction';
|
|
15
|
+
params: {
|
|
16
|
+
transaction: SolanaCombinedTransaction;
|
|
17
|
+
connection: SolanaConnection;
|
|
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
|
+
connection: SolanaConnection;
|
|
47
|
+
}): Promise<{
|
|
48
|
+
signature: string;
|
|
49
|
+
}>;
|
|
50
|
+
}
|
|
51
|
+
export declare const createSolanaWalletProvider: (request: SolanaRequestFn) => SolanaWalletProvider;
|
package/dist/solana.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createSolanaWalletProvider = void 0;
|
|
4
|
+
const createSolanaWalletProvider = (request) => ({
|
|
5
|
+
request,
|
|
6
|
+
signMessage: (msg) => request({ method: 'signMessage', params: { message: msg } }),
|
|
7
|
+
signTransaction: (transaction) => request({ method: 'signTransaction', params: { transaction } }),
|
|
8
|
+
signAndSendTransaction: (input) => request({
|
|
9
|
+
method: 'signAndSendTransaction',
|
|
10
|
+
params: input,
|
|
11
|
+
}),
|
|
12
|
+
});
|
|
13
|
+
exports.createSolanaWalletProvider = createSolanaWalletProvider;
|
package/dist/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AddFrame, ComposeCast, Ready, SendToken, SignIn, SwapToken, ViewProfile, ViewToken } from './actions';
|
|
2
2
|
import type { FrameContext } from './context';
|
|
3
|
-
import type { ShareStateProvider } from './funcs';
|
|
4
3
|
import type { EventFrameAdded, EventFrameRemoved, EventNotificationsDisabled, EventNotificationsEnabled } from './schemas';
|
|
4
|
+
import type { SolanaRequestFn } from './solana';
|
|
5
5
|
import type { Ethereum } from './wallet';
|
|
6
6
|
export type SetPrimaryButtonOptions = {
|
|
7
7
|
text: string;
|
|
@@ -23,13 +23,13 @@ export type WireFrameHost = {
|
|
|
23
23
|
ethProviderRequest: Ethereum.EthProvideRequest;
|
|
24
24
|
ethProviderRequestV2: Ethereum.RpcTransport;
|
|
25
25
|
eip6963RequestProvider: () => void;
|
|
26
|
+
solanaProviderRequest?: SolanaRequestFn;
|
|
26
27
|
addFrame: AddFrame.WireAddFrame;
|
|
27
28
|
viewProfile: ViewProfile.ViewProfile;
|
|
28
29
|
viewToken: ViewToken.ViewToken;
|
|
29
30
|
sendToken: SendToken.SendToken;
|
|
30
31
|
swapToken: SwapToken.SwapToken;
|
|
31
32
|
composeCast: <close extends boolean | undefined = undefined>(options: ComposeCast.Options<close>) => Promise<ComposeCast.Result<close>>;
|
|
32
|
-
setShareStateProvider: (fn: ShareStateProvider) => void;
|
|
33
33
|
};
|
|
34
34
|
export type FrameHost = {
|
|
35
35
|
context: FrameContext;
|
|
@@ -45,13 +45,13 @@ export type FrameHost = {
|
|
|
45
45
|
* Hosts must emit an EventEip6963AnnounceProvider in response.
|
|
46
46
|
*/
|
|
47
47
|
eip6963RequestProvider: () => void;
|
|
48
|
+
solanaProviderRequest?: SolanaRequestFn;
|
|
48
49
|
addFrame: AddFrame.AddFrame;
|
|
49
50
|
viewProfile: ViewProfile.ViewProfile;
|
|
50
51
|
viewToken: ViewToken.ViewToken;
|
|
51
52
|
sendToken: SendToken.SendToken;
|
|
52
53
|
swapToken: SwapToken.SwapToken;
|
|
53
54
|
composeCast: <close extends boolean | undefined = undefined>(options: ComposeCast.Options<close>) => Promise<ComposeCast.Result<close>>;
|
|
54
|
-
setShareStateProvider: (fn: ShareStateProvider) => void;
|
|
55
55
|
};
|
|
56
56
|
export type EventFrameAddRejected = {
|
|
57
57
|
event: 'frame_add_rejected';
|
package/esm/index.d.ts
CHANGED
package/esm/index.js
CHANGED
package/esm/schemas/index.d.ts
CHANGED
package/esm/schemas/index.js
CHANGED
package/esm/solana.d.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { Connection as SolanaConnection, SendOptions as SolanaSendOptions, Transaction as SolanaTransaction, VersionedTransaction as SolanaVersionedTransaction } from '@solana/web3.js';
|
|
2
|
+
export type { SolanaConnection };
|
|
3
|
+
export type SolanaCombinedTransaction = SolanaTransaction | SolanaVersionedTransaction;
|
|
4
|
+
export type SolanaConnectRequestArguments = {
|
|
5
|
+
method: 'connect';
|
|
6
|
+
};
|
|
7
|
+
export type SolanaSignMessageRequestArguments = {
|
|
8
|
+
method: 'signMessage';
|
|
9
|
+
params: {
|
|
10
|
+
message: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export type SolanaSignAndSendTransactionRequestArguments = {
|
|
14
|
+
method: 'signAndSendTransaction';
|
|
15
|
+
params: {
|
|
16
|
+
transaction: SolanaCombinedTransaction;
|
|
17
|
+
connection: SolanaConnection;
|
|
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
|
+
connection: SolanaConnection;
|
|
47
|
+
}): Promise<{
|
|
48
|
+
signature: string;
|
|
49
|
+
}>;
|
|
50
|
+
}
|
|
51
|
+
export declare const createSolanaWalletProvider: (request: SolanaRequestFn) => SolanaWalletProvider;
|
package/esm/solana.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export const createSolanaWalletProvider = (request) => ({
|
|
2
|
+
request,
|
|
3
|
+
signMessage: (msg) => request({ method: 'signMessage', params: { message: msg } }),
|
|
4
|
+
signTransaction: (transaction) => request({ method: 'signTransaction', params: { transaction } }),
|
|
5
|
+
signAndSendTransaction: (input) => request({
|
|
6
|
+
method: 'signAndSendTransaction',
|
|
7
|
+
params: input,
|
|
8
|
+
}),
|
|
9
|
+
});
|