UNPKG

wallet-storage

Version:

BRC100 conforming wallet, wallet storage and wallet signer components

71 lines 4.22 kB
import { AcquireCertificateArgs, DiscoverByAttributesArgs, DiscoverByIdentityKeyArgs, ListCertificatesArgs, ProveCertificateArgs, RelinquishCertificateArgs } from '@bsv/sdk'; import { StorageKnex } from '../../src/index.all'; import { Wallet } from '../../src/Wallet'; export declare const setLogging: (enabled: boolean) => void; export declare const log: (message: string, ...optionalParams: any[]) => void; /** * Mock Utilities * Provides reusable mock implementations for WalletSigner and KeyDeriver. */ export declare const mockWalletSigner: () => any; export declare const mockKeyDeriver: () => any; /** * Argument and Response Generators * Creates reusable test data for arguments and expected responses. */ export declare const generateListCertificatesArgs: (overrides?: {}) => ListCertificatesArgs; export declare const generateMockCertificatesResponse: (overrides?: {}) => any; export declare const generateAcquireCertificateArgs: (overrides?: {}) => AcquireCertificateArgs; export declare const generateMockAcquireCertificateResponse: (overrides?: {}) => any; export declare const generateRelinquishCertificateArgs: (overrides?: {}) => RelinquishCertificateArgs; export declare const generateMockRelinquishCertificateResponse: (overrides?: {}) => any; export declare const generateProveCertificateArgs: (overrides?: {}) => ProveCertificateArgs; export declare const generateMockProveCertificateResponse: (overrides?: {}) => any; export declare const generateDiscoverByIdentityKeyArgs: (overrides?: {}) => DiscoverByIdentityKeyArgs; export declare const generateMockDiscoverByIdentityKeyResponse: (overrides?: {}) => any; export declare const generateDiscoverByAttributesArgs: (overrides?: {}) => DiscoverByAttributesArgs; export declare const generateMockDiscoverByAttributesResponse: (overrides?: {}) => any; /** * Validation Helpers * Provides functions to validate results and handle errors in tests. */ export declare const validateCertificatesResponse: (result: any, expected: any) => void; export declare const validateAcquireCertificateResponse: (result: any, expected: any) => void; export declare const validateRelinquishCertificateResponse: (result: any, expected: any) => void; export declare const validateProveCertificateResponse: (result: any, expected: any) => void; export declare const validateDiscoverByIdentityKeyResponse: (result: any, expected: any) => void; export declare const validateDiscoverByAttributesResponse: (result: any, expected: any) => void; /** * Test Utilities * Sets up a mock Wallet instance and associated dependencies for tests. */ export declare const setupTestWallet: () => { wallet: Wallet; mockSigner: any; mockKeyDeriver: any; }; /** * Aborts all transactions with the status `'nosend'` in the storage and verifies success. * * @param {Wallet} wallet - The wallet instance used to abort actions. * @param {StorageKnex} storage - The storage instance to query transactions from. * @returns {Promise<boolean>} - Resolves to `true` if all `'nosend'` transactions were successfully aborted. */ export declare function cleanUnsentTransactionsUsingAbort(wallet: Wallet, storage: StorageKnex): Promise<boolean>; /** * Aborts all transactions with the status `'unsigned'` in the storage and verifies success. * * @param {Wallet} wallet - The wallet instance used to abort actions. * @param {StorageKnex} storage - The storage instance to query transactions from. * @returns {Promise<boolean>} - Resolves to `true` if all `'unsigned'` transactions were successfully aborted. */ export declare function cleanUnsignedTransactionsUsingAbort(wallet: Wallet, storage: StorageKnex): Promise<boolean>; /** * Aborts all transactions with the status `'unprocessed'` in the storage and verifies success. * * @param {Wallet} wallet - The wallet instance used to abort actions. * @param {StorageKnex} storage - The storage instance to query transactions from. * @returns {Promise<boolean>} - Resolves to `true` if all `'unprocessed'` transactions were successfully aborted. */ export declare function cleanUnprocessedTransactionsUsingAbort(wallet: Wallet, storage: StorageKnex): Promise<boolean>; //# sourceMappingURL=TestUtilsMethodTests.d.ts.map