How to Create Wallets in the Ledger System

A wallet is a collection of funds associated with a ledger account. Each wallet is uniquely identified by its address and is characterized by:

  • Currency: The type of currency the wallet supports (e.g., USD, GBP).

  • Accounting Type: Indicates the financial category (Asset, Liability, Revenue, Expense, Equity).

  • Decimal Places: Specifies the precision for balances.

Wallets enable:

  • Segregation of funds by purpose (e.g., operational funds vs. reserves).

  • Accurate accounting for transactions and balances.


When to Create Wallets

Wallets should be created in the following scenarios:

  • Setting Up New Accounts: Every account needs at least one wallet to store funds.

  • Handling Multiple Currencies: Separate wallets are required for each currency under an account.

  • Isolating Transactions: Use distinct wallets for different types of funds or transactions (e.g., revenue vs. expenses).


How to Create Wallets

1. Prepare the Parent Account

Before creating a wallet, ensure that a parent account (chart or group) is already set up. Wallets cannot exist independently and must be associated with an account.

Example Command (Create Parent Account):

./luca create-chart-account company operational-account
./luca transition /chart/company/operational-account OPEN

  1. Define Wallet Attributes

Determine the following attributes for the wallet:

  • Wallet Name: A unique identifier for the wallet under the account.

  • Currency: Specify the currency code (e.g., GBP, USD).

  • Accounting Type: Choose one of the following:

    • ASSET: Owned resources.

    • LIABILITY: Obligations to third parties (e.g., customer balances).

    • REVENUE: Income streams.

    • EXPENSE: Costs incurred.

    • EQUITY: Owner’s residual interest in assets.

  • Decimal Places: Define the precision for balance calculations.


3: Create the Wallet

Use the luca command-line tool to create the wallet. Include the parent account, wallet name, currency, accounting type, and decimal places.

Example Command:

./luca create-chart-wallet --create-parent company operational-account default GBP ASSET --decimal-places=2

This creates a wallet named default under the operational-account with:

  • Currency: GBP

  • Accounting Type: ASSET

  • Decimal Places: 2


4: Verify the Wallet

After creation, verify that the wallet has been set up correctly by retrieving its details.

Example Command:

./luca read-chart-account company operational-account

Best Practices

  • Use Clear Wallet Names: Names like default, sales, or savings make it easier to identify wallets later.

  • Ensure Accurate Decimal Places: Use sufficient precision to avoid errors in large transactions (e.g., cryptocurrency wallets may require up to 8 decimal places).

  • Plan Currency and Accounting Types: Define these attributes during account setup to prevent unnecessary modifications later.


Troubleshooting Wallet Creation

  • Error: Parent account does not exist.

    • Ensure the parent account is created and transitioned to OPEN.

    Command to Create Parent:

    ./luca create-chart-account company reserve-account
    ./luca transition /chart/company/reserve-account OPEN
  • Error: Invalid accounting type.

    • Confirm the accounting type matches one of the predefined types: ASSET, LIABILITY, REVENUE, EXPENSE, EQUITY.

  • Error: Wallet already exists.

    • Use the --modify-if-exists flag to update the wallet.

    Command:

    ./luca create-chart-wallet --modify-if-exists company operational-account default GBP ASSET --decimal-places=2

Last updated