@xo-cash/state
    Preparing search index...

    Function createStorageAdapter

    • Creates a new storage adapter.

      Parameters

      • config: StorageConfig

        Storage configuration options

        Storage configuration options.

        • accountHash: string

          SHA-256 hex hash identifying the account. Appended to the database filename to isolate each account's data.

        • OptionaldatabaseFilename?: string

          Base name for the database file. The accountHash is appended to this name. Defaults to "XO".

        • OptionaldatabasePath?: string

          Directory path where the database will be stored

        • storageType: StorageType

          Type of storage to use

      Returns Promise<XOStorage>

      Promise that resolves to a new storage adapter instance

      If the account hash is not a valid 64-character hexadecimal string.

      If the given storage type is not supported.

      Currently config only controls naming. As new options are added to StorageConfig, care must be taken when passing them through here as some options may alter database behavior or break expected behavior if applied incorrectly.