Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

solana:getEphemeralSigners feature #24

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions packages/core/features/src/getEphemeralSigners.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/** Name of the feature. */
export const SolanaGetEphemeralSigners = 'solana:getEphemeralSigners' as const;

/**
* Provides a secure way to request ephemeral signer addresses from the wallet.
* Ephemeral Signers are the addresses that can be used to sign a specific transaction once
* and be discarded after that.
* The wallet is responsible for:
* 1. secure generation and keeping track of the addresses;
* 2. making sure that the addresses sign the transactions where they are mentioned as signers;
*/
export type SolanaGetEphemeralSignersFeature = {
/** Name of the feature. */
readonly [SolanaGetEphemeralSigners]: {
/** Version of the feature API. */
readonly version: SolanaGetEphemeralSignersVersion;

/** Get any number of ephemeral signer addresses. */
readonly getEphemeralSigners: SolanaGetEphemeralSignersMethod;
};
};

/** Version of the feature. */
export type SolanaGetEphemeralSignersVersion = '1.0.0';

/** Get any number of ephemeral signer addresses. */
export type SolanaGetEphemeralSignersMethod = (numberOfSigners: number) => Promise<readonly string[]>;