@lokavaluto/lokapi-backend-cyclos
v0.1.1-alpha.202511131512
Published
Cyclos backend for Lokavaluto API
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:
npm install --save @lokavaluto/lokapi-backend-cyclosOr better, as @lokavaluto/lokapi-backend-cyclos is still in early release,
npm install --save Lokavaluto/lokapi-backend-cyclos#masterTo 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:
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
npm installBuild the project
npx tsc -wChangelog
(unreleased)
New
- 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- Make
Recipient.transfer()return a fullTransactionobject. [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-requestversion0.0.4or higher for timeout support. [Valentin Lab] - Add date filter to
getTransactions(..)[Valentin Lab] - Resolve transaction's related name using odoo's new
cyclos/contactAPI endpoint. [Valentin Lab] - Add
Recipient.getSymbol()method implementation. [Valentin Lab] - Add
Recipient.fromUserAccountproperty. [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 currentuserAccount[Valentin Lab] - Single out insufficient balance error to throw common exception. [Seddik Kadi]
- Make accounts answer to
creditableboolean property. [Valentin Lab] - Inactive user account don't have any money account accessible. [Valentin Lab]
Backend.internalIdproperty 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]
