steem-auth-vue
Version:
A Vue 3 authentication component for Steem blockchain and MeeRay sidechain
40 lines (39 loc) • 1.4 kB
TypeScript
export interface TransactionState {
isPending: boolean;
isSuccess: boolean;
isError: boolean;
errorMessage: string;
transactionId: string;
type: string;
pendingMessage: string;
successMessage: string;
}
export interface TransactionRecord {
transactionId: string;
type: string;
status: 'pending' | 'success' | 'error';
timestamp: number;
message: string;
errorMessage?: string;
}
export interface TransactionStore {
state: TransactionState;
results: Record<string, {
success?: string;
error?: string;
}>;
transactions: TransactionRecord[];
startTransaction: (type: string, pendingMessage?: string) => void;
finishTransaction: (success: boolean, transactionId?: string, successMessage?: string, errorMessage?: string) => void;
resetState: () => void;
clearResults: (type?: string) => void;
saveTransaction: (record: TransactionRecord) => void;
getTransactions: () => TransactionRecord[];
deleteTransaction: (transactionId: string) => void;
}
/**
* Call this function ONLY from inside a component's setup() or a composable called from setup().
* Do NOT call at the top level of a module or in main.ts.
*/
export declare const provideTransactionStore: () => TransactionStore;
export declare const useTransactionStore: () => TransactionStore;