import type { WalletAccount } from '@wallet-standard/base'; /** Name of the feature. */ export const SolanaSignIn = 'solana:signIn'; /** TODO: docs */ export type SolanaSignInFeature = { /** Name of the feature. */ readonly [SolanaSignIn]: { /** Version of the feature API. */ readonly version: SolanaSignInVersion; /** Sign In With Solana (based on https://eips.ethereum.org/EIPS/eip-4361 and https://github.com/ChainAgnostic/CAIPs/blob/master/CAIPs/caip-122.md). */ readonly signIn: SolanaSignInMethod; }; }; /** Version of the feature. */ export type SolanaSignInVersion = '1.0.0'; /** TODO: docs */ export type SolanaSignInMethod = (...inputs: readonly SolanaSignInInput[]) => Promise; /** Input for signing in. */ export interface SolanaSignInInput { /** * Optional EIP-4361 Domain. * If not provided, the wallet must determine the Domain to include in the message. */ readonly domain?: string; /** * Optional EIP-4361 Address. * If not provided, the wallet must determine the Address to include in the message. */ readonly address?: string; /** * Optional EIP-4361 Statement. * If not provided, the wallet must not include Statement in the message. */ readonly statement?: string; /** * Optional EIP-4361 URI. * If not provided, the wallet must not include URI in the message. */ readonly uri?: string; /** * Optional EIP-4361 Version. * If not provided, the wallet must not include Version in the message. */ readonly version?: string; /** * Optional EIP-4361 Chain ID. * If not provided, the wallet must not include Chain ID in the message. */ readonly chainId?: string; /** * Optional EIP-4361 Nonce. * If not provided, the wallet must not include Nonce in the message. */ readonly nonce?: string; /** * Optional EIP-4361 Issued At. * If not provided, the wallet must not include Issued At in the message. */ readonly issuedAt?: string; /** * Optional EIP-4361 Expiration Time. * If not provided, the wallet must not include Expiration Time in the message. */ readonly expirationTime?: string; /** * Optional EIP-4361 Not Before. * If not provided, the wallet must not include Not Before in the message. */ readonly notBefore?: string; /** * Optional EIP-4361 Request ID. * If not provided, the wallet must not include Request ID in the message. */ readonly requestId?: string; /** * Optional EIP-4361 Resources. * If not provided, the wallet must not include Resources in the message. */ readonly resources?: readonly string[]; } /** Output of signing in. */ export interface SolanaSignInOutput { /** * Account that was signed in. * The address of the account may be different from the provided input Address. */ readonly account: WalletAccount; /** * Message bytes that were signed. * The wallet may prefix or otherwise modify the message before signing it. */ readonly signedMessage: Uint8Array; /** * Message signature produced. * If the signature type is provided, the signature must be Ed25519. */ readonly signature: Uint8Array; /** * Optional type of the message signature produced. * If not provided, the signature must be Ed25519. */ readonly signatureType?: 'ed25519'; }