From 557c91f1050c9615702e92a6996e35d4ea0d477e Mon Sep 17 00:00:00 2001 From: Vladimir Guguiev <1524432+vovacodes@users.noreply.github.com> Date: Mon, 26 Jun 2023 18:57:07 +0200 Subject: [PATCH] solana:getEphemeralSigners feature definition --- .../core/features/src/getEphemeralSigners.ts | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 packages/core/features/src/getEphemeralSigners.ts diff --git a/packages/core/features/src/getEphemeralSigners.ts b/packages/core/features/src/getEphemeralSigners.ts new file mode 100644 index 00000000..ce5db4c4 --- /dev/null +++ b/packages/core/features/src/getEphemeralSigners.ts @@ -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;