import { Request, Response } from 'express'; import { LoginOptions } from '../auth/models'; import { AccountName, AccountType, AlgorandMultiSigOptions, AppAccessToken, AuthProvider, ChainAccount, ChainNetwork, ExternalWalletType, ProcessId, PublicKey } from '../common/models'; import { UserData } from '../user/models'; export declare enum RecoverAccountAction { Republic = "republic" } /** For creating a new chainAccount in an existing wallet */ export declare type NewAccountOptions = { account: AccountName; accountOptions?: CreateOnChainAccountsOptions; accountType: AccountType; chainNetwork?: ChainNetwork; provider?: AuthProvider; state?: string; }; export declare type DiscoverOptions = { walletType: ExternalWalletType; chainNetwork?: ChainNetwork; oreAccount?: ChainAccount; discoveryPathIndexList?: number[]; }; export declare type AuthResult = { account?: AccountName; accessToken?: string; idToken?: string; errors?: string[]; processId?: ProcessId; state?: string; }; export declare type NewAccountResult = { chainAccount?: string; errors?: string[]; processId?: ProcessId; state?: string; }; export declare type SignResult = { signedTransaction?: string; transactionId: string; errors?: string[]; processId?: ProcessId; state?: string; }; export declare type PasswordResetOptions = { provider: AuthProvider; chainAccount?: ChainAccount; chainNetwork?: ChainNetwork; state?: string; currentAccountPassword?: string; }; export declare type GetRecoverAccountUrlResult = string; export declare type LoginWithOreIdResult = { accessToken?: string; loginUrl?: string; errors?: string; processId?: ProcessId; }; export declare type NewAccountWithOreIdResult = { newAccountUrl: string; errors?: string; }; export declare type SignWithOreIdResult = { processId?: ProcessId; signedTransaction?: string; transactionId?: string; signUrl?: string; errors?: string; }; export declare type SignStringParams = { account: AccountName; walletType: ExternalWalletType; chainAccount?: ChainAccount; chainNetwork: ChainNetwork; string: string; message: string; metadata?: any; }; export declare type SignStringResult = { signedString: string; }; export declare type GetOreIdNewChainAccountUrlParams = NewAccountOptions & { callbackUrl: string; backgroundColor?: string; }; export declare type GetOreIdAuthUrlParams = LoginOptions & { callbackUrl: string; backgroundColor?: string; }; export declare type GetOreIdRecoverAccountUrlParams = LoginOptions & { account: AccountName; backgroundColor?: string; callbackUrl: string; recoverAction?: RecoverAccountAction; overrideAppAccessToken?: AppAccessToken; }; export declare type AppAccessTokenMetadata = { paramsNewAccount?: NewAccountAppTokenParams; newAccountPassword?: string; currentAccountPassword?: string; secrets?: { type: string; value: string; }[]; }; /** params for calling new-account service web endpoint (sent via AppAccessToken request) */ export declare type NewAccountAppTokenParams = { account: AccountName; accountType: AccountType; chainNetwork?: ChainNetwork; accountOptions: CreateOnChainAccountsOptions; }; export declare type CreateOnChainAccountsOptions = { keys?: { publicKeys: { owner?: PublicKey; active: PublicKey; }; }; multisigOptions?: AlgorandMultiSigOptions; }; declare type ParamsForRequest = { appId?: string; accessToken?: string; chainAccount?: string; idToken?: string; processId?: ProcessId; state?: string; signedTransaction?: string; transactionId?: string; user?: UserData; }; declare type ParamsForResponse = { myField?: string; }; export declare type RequestWithParams = Request & ParamsForRequest; export declare type ResponseWithParams = Response & ParamsForResponse; /** Generic SignatureProvider interface */ export interface SignatureProvider { /** Public keys associated with the private keys that the `SignatureProvider` holds */ getAvailableKeys: () => Promise; /** Sign a transaction */ sign: (args: SignatureProviderArgs) => Promise; } /** SignatureProvider params for sign() function */ export interface SignatureProviderArgs { /** Chain transaction is for */ chainId: string; /** Public keys associated with the private keys needed to sign the transaction */ requiredKeys: string[]; /** Transaction to sign */ serializedTransaction: Uint8Array; /** ABIs for all contracts with actions included in `serializedTransaction` */ abis: BinaryAbi[]; } /** Results from external wallet signTransction() - e.g. via Transit or UAL */ export interface SignatureProviderSignResult { signatures: string[]; serializedTransaction: Uint8Array; } /** Structure for the raw form of ABIs */ export interface BinaryAbi { /** account which has deployed the ABI */ accountName: string; /** abi in binary form */ abi: Uint8Array; } export {};