# @lokavaluto/lokapi-backend-cyclos

> Cyclos backend for Lokavaluto API

Latest version **0.1.1-alpha.202605290932** (published 2026-05-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install @lokavaluto/lokapi-backend-cyclos
pnpm add @lokavaluto/lokapi-backend-cyclos
yarn add @lokavaluto/lokapi-backend-cyclos
bun add @lokavaluto/lokapi-backend-cyclos
```

## Health

**Score 60/100 (C)** — status: active.

Positive: has types; no vulnerabilities; high maintenance score; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.1.1-alpha.202605290932 |
| Published | 2026-05-29 |
| First published | 2021-11-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 82.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Valentin LAB |
| Maintainers | vaab |

## Links

- npm: https://www.npmjs.com/package/@lokavaluto/lokapi-backend-cyclos
- Repository: https://github.com/Lokavaluto/lokapi-backend-cyclos
- Homepage: https://github.com/Lokavaluto/lokapi-backend-cyclos#readme
- Issues: https://github.com/Lokavaluto/lokapi-backend-cyclos/issues
- npm.io page: https://npm.io/package/@lokavaluto/lokapi-backend-cyclos

## Dependencies (3)

- [@0k/cache](https://npm.io/package/@0k/cache.md) ^0.2.0
- [@0k/types-request](https://npm.io/package/@0k/types-request.md) ^1.0.1
- [@lokavaluto/lokapi](https://npm.io/package/@lokavaluto/lokapi.md) 0.1.0 || >=0.1.1-alpha

## Recent versions

- 0.1.1-alpha.202605290932 (latest) — 2026-05-29
- 0.1.1-alpha.202605271044 — 2026-05-27
- 0.1.1-alpha.202604170537 — 2026-04-17
- 0.1.1-alpha.202604141451 — 2026-04-14
- 0.1.1-alpha.202511131512 — 2025-11-13
- 0.1.1-alpha.202509231558 — 2025-09-23
- 0.1.1-alpha.202505242247 — 2025-05-25
- 0.1.1-alpha.202505241558 — 2025-05-24
- 0.1.1-alpha.202505111822 — 2025-05-11
- 0.1.1-alpha.202505050822 — 2025-05-05
- 0.1.1-alpha.202505041535 — 2025-05-04
- 0.1.1-alpha.202504191513 — 2025-04-19
- 0.1.1-alpha.202504181057 — 2025-04-18
- 0.1.1-alpha.202504180912 — 2025-04-18
- 0.1.1-alpha.202504180908 — 2025-04-18
- … 27 more at https://npm.io/package/@lokavaluto/lokapi-backend-cyclos/versions

## README

This is a backend for managing any cyclos currency through LokAPI.
The latter aims at providing a simple framework for building client
app to manage currency payments. You can refer to `@lokavaluto/lokapi`'s doc to
get more knowledge of how to use it.

# Adding `@lokavaluto/lokapi-backend-cyclos` to your project

From the root of your project:

```sh
npm install --save @lokavaluto/lokapi-backend-cyclos
```

Or better, as `@lokavaluto/lokapi-backend-cyclos` is still in early release,

```sh
npm install --save Lokavaluto/lokapi-backend-cyclos#master
```

To be sure to get the latest version, relaunch this last command
whenever you want to update.

# Usage

You can provide this backend when subclassing LokAPI:

For instance:

```typescript
import LokAPIBrowserAbstract from "@lokavaluto/lokapi-browser"

import cyclos from '@lokavaluto/lokapi-backend-cyclos'

class LokAPI extends LokAPIBrowserAbstract {

  BackendFactories = {
    cyclos,
  }

  requestLocalPassword = async function (state: string) {
    // ... your UI code to request password from user
  }

  requestLogin() {
    // ... your UI code to request password from user
  }

}

if (!process.env.VUE_APP_LOKAPI_HOST) {
  throw new Error("Please specify VUE_APP_LOKAPI_HOST in '.env'")
}

if (!process.env.VUE_APP_LOKAPI_DB) {
  throw new Error("Please specify VUE_APP_LOKAPI_DB in '.env'")
}

export var lokAPI = new LokAPI(
  process.env.VUE_APP_LOKAPI_HOST,
  process.env.VUE_APP_LOKAPI_DB,
)
```


For usage of `@lokavaluto/lokapi`, please refer to `@lokavaluto/lokapi`'s documentation.

# Developers

To get started developing and tinkering with this code, you can:

## Install dependencies

```sh
npm install
```

## Build the project

```sh
npx tsc -w
```
Changelog
=========


(unreleased)
------------

New
~~~
- Add ``status`` getter on ``CyclosUserAccount`` [Valentin Lab]
- Add ``ident`` getter on ``CyclosUserAccount`` and ``CyclosRecipient``
  [Valentin Lab]
- Add ``Backend.getCurrencyName()`` [Valentin Lab]
- Add ``Backend.getUserAccountsFromWalletIdent()`` [Valentin Lab]
- Repair ``Recipient.internalId`` [Valentin Lab]
- Add ``Backend.isUnconfigured()`` [Seddik]
- Support of ``Recipient.userAccountInternalId`` property. [Valentin
  Lab]
- Upgrade API to support the ``.prepareTransfer()`` new process.
  [Valentin Lab]
- Add
  ``{UserAccount,Account,Recipient}.isBusinessForFinanceBackend(..)``
  [Valentin Lab]
- ``transaction.isReconversion`` property now return string state.
  [Valentin Lab]

  If false, it is not a reconversion, if true it is a reconversion but wasn't
  yet acknowledged by the administrative backend. If it is a string, then it
  is the state as defined by the administrative backend.
- Add ``transaction.isTopUp`` and ``transaction.isReconversion``
  properties. [Valentin Lab]
- Do not cache failure of ``Backend.getAccounts(..)`` [Valentin Lab]
- Add implementation of split memo interface. [Valentin Lab]

  Note that there are no split memo support yet on cyclos backends, but
  we still need to advertise this and support the new prototypes.
- Provide implementation of ``CreditRequest`` [Valentin Lab]

  All backends now require to provide an implementation of
  ``CreditRequest`` as they could be displayed before actual payment and
  canceled.

Changes
~~~~~~~
- Chg: upgrade ``@0k/cache`` to ``^0.2.0`` [Valentin Lab]
- Make ``Recipient.transfer()`` return a full ``Transaction`` object.
  [Valentin Lab]

Fix
~~~
- Prevent requesting an amount that exceeds internal javascript float
  representation. [Valentin Lab]
- Get the correct currency symbol for all transactions. [Seddik]
- Return cyclos symbol identifier as ``Transaction.currency`` instead of
  cyclos currency name. [Valentin Lab]


0.1.0 (2023-05-08)
------------------

New
~~~
- New: enforce ``@0k.io/types-request`` version ``0.0.4`` or higher for
  timeout support. [Valentin Lab]
- Add date filter to ``getTransactions(..)`` [Valentin Lab]
- Resolve transaction's related name using odoo's new ``cyclos/contact``
  API endpoint. [Valentin Lab]
- Add ``Recipient.getSymbol()`` method implementation. [Valentin Lab]
- Add ``Recipient.fromUserAccount`` property. [Valentin Lab]
- Add ``UserAccount.getSymbol()`` implementation. [Valentin Lab]
- Make ``UserAccount.getAccounts()`` debounced and cached. [Valentin
  Lab]
- Provide ``UserAccount.requiresUnlock()`` to advertise if an unlock is
  required on current ``userAccount`` [Valentin Lab]
- Single out insufficient balance error to throw common exception.
  [Seddik Kadi]
- Make accounts answer to ``creditable`` boolean property. [Valentin
  Lab]
- Inactive user account don't have any money account accessible.
  [Valentin Lab]
- ``Backend.internalId`` property is now implemented on super class.
  [Valentin Lab]

Changes
~~~~~~~
- Chg: use new package ``@0k.io/types-request`` [Valentin Lab]

  This new package refactored out from lokapi some
  exceptions and types.

Fix
~~~
- Prevent exception upon listing transaction data with deleted user
  account. [Valentin Lab]
- New: api v12 changed structure of backend data ``bank_accounts`` ->
  ``accounts`` [Valentin Lab]
- Use new location of lokapi exceptions. [Valentin Lab]

  Re-introduce the ``instanceof`` check as it was tested as working
  on different builds (dev, production), and minified.


0.0.1 (2021-11-17)
------------------
- First import. [Valentin Lab]

---
_Source: https://npm.io/package/@lokavaluto/lokapi-backend-cyclos · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
