Wallets

In the Bolbhav app, each user has access to multiple wallets designed to facilitate various financial transactions. This page provides an overview of the different types of wallets available to users.

Wallet Types:

Bolbhav app features various types of wallets for each user:

  1. Reward Wallet (Gold Token): Stores earned rewards, such as loyalty points or tokens.

  2. Membership Wallet (Silver Token) : Used for transactions related to membership plans and subscriptions.

  3. Payback Wallet: Facilitates payouts and refunds to users.

Utilization:

  1. Reward Wallet: Users accumulate rewards through various platform activities, such as contributions or referrals. These rewards can be redeemed into silver tokens or converted to Rupees (INR).

  2. Membership Wallet: Stores funds related to membership plans, enabling users to manage subscription payments easily and access exclusive features or content.

  3. Payback Wallet: Manages payouts and refunds initiated by Bolbhav or other users.

Wallet Creation:

  • When a new user logs into the app and submits an OTP, the API triggers the trigger_event_trial_membership_new_user function to add a trial plan of 20 tokens to the user's membership wallet. This creates the user's membership wallet and grants them 20 tokens for the trial. Trial plan is added in user membership wallet at the time of user login in app for first time . Endpoint Triggered - https://listag.net/api/v2/login

  • Previously, the reward wallet was created when users received rewards via various events such as contributions or referrals. However, now silver tokens are granted for all activities.

  • The payback wallet is created when a user initiates their first payout or purchases tokens from another user more described in page.

Accessing Wallet Details and History:

  • The user's Gold token and Silver token balances are displayed in the top-right corner of the Home Page.

  • Endpoint Triggered to Retrieve User Wallet Details and Profile Image URL: https://listag.net/api/v1/bolbhav-plus/get_current_user

  • When users click on the profile icon from the home screen, they are redirected to the "My Tokens" screen. Here, users can access both the Silver Token Passbook and the Gold Token Passbook pages.

  • This API returns the wallet history sorted based on created_at in descending order, providing users with a comprehensive record of their membership wallet transactions.

  • To view the transaction history of the Reward Token (membership wallet), users are redirected to the "Convert Gold Token" page. From there, users can access the Reward Token (Silver Token) passbook history.

  • This API also returns the wallet history sorted based on created_at in descending order, allowing users to track their Reward Token transactions efficiently.

Wallet Ledger Entries Events for Membership Wallet:

  • Trial plan reward received Source Wallet ID: The user's membership wallet ID serves as the source of the transaction. Target Wallet ID: The bank's membership wallet ID is designated as the target for receiving the deducted tokens. Amount: 20000 tokens (20 silver tokens) are credited to the user's membership wallet. Reason: The reason field provides context for the transaction, indicating the purpose as the New user trial plan . In Hindi, this is represented as "नए उपयोगकर्ता परीक्षण योजना. Ref ID: The reference ID stored in the Wallet Ledger table is "trial_plan_for_user_id_{user.id}", which helps track the transaction back to its origin.

  • Referral reward received Source Wallet ID: The user's membership wallet ID serves as the source of the transaction.

    Target Wallet ID: The bank's membership wallet ID is designated as the target for receiving the deducted tokens.

    Amount: 10000 tokens (10 silver tokens) are credited to the user's membership wallet.

    Reason: The reason field provides context for the transaction, indicating the purpose as the Referral reward; referral user {referral.id}; referrer user {referrer.id} . In Hindi, this is represented as "बोलभाव में दोस्तों को जोड़ने पर.

    Ref ID: The reference ID stored in the Wallet Ledger table is referral_user_id_{referral.id} which helps track the transaction back to its origin.

  • Purchases Membership plan

Wallet Ledger Entries Events for Payback Wallet:

  • Membership plan purchase between user to user.

  • User Convert Gold Token into Money

Wallet Ledger Entries Events for Reward Wallet:

  • Convert Gold token to silver token Endpoint Triggered: https://listag.net/api/v1/bolbhav-plus/convert-gold-to-silver API Purpose: This endpoint facilitates the conversion of Gold tokens into Silver tokens. Users can exchange their Gold tokens for Silver tokens. Upon conversion, tokens are debited from the user's reward wallet and credited to their membership wallet. The conversion rate is 1 Gold token equals 2 Silver tokens. For example, if a user converts 20 Gold tokens, 40 Silver tokens will be added to their membership wallet.

    def trigger_event_convert_gold_to_silver_token(tokens: int, user: UserModel):
        user_membership_wallet = user.get_membership_wallet()
        user_rewards_wallet = user.get_rewards_wallet()
    
        ref_id = f"token_coverted_{user.id}"
    
        user_rewards_wallet.use_credits(
            amount=(tokens // 2) * 1000,
            reason="coverted tokens gold to silver",
            ref_id=ref_id,
            force_commit=False,
        )
    
        user_membership_wallet.add_credits(
            amount=tokens * 1000,
            reason="coverted tokens silver to gold",
            ref_id=ref_id,
            created_at=datetime.now(),
        )

    Wallet ledger entry for user reward wallet: Source Wallet ID: The user's reward wallet ID serves as the source of the transaction.

    Target Wallet ID: The bank's reward wallet ID is designated as the target for receiving the deducted tokens.

    Amount: x tokens (x gold tokens) are debited to the user's reward wallet.

    Reason: The reason field provides context for the transaction, indicating the purpose as the coverted tokens gold to silver

    . In Hindi, this is represented as "सिल्वर टोकन में परिवर्तित किया".

    Ref ID: The reference ID stored in the Wallet Ledger table is token_coverted_{user.id} which helps track the transaction back to its origin. Wallet ledger entry for membership wallet Source Wallet ID: The user's membership wallet ID serves as the source of the transaction.

    Target Wallet ID: The bank's membership wallet ID is designated as the target for receiving the added tokens.

    Amount: x tokens (x slver tokens) are credited to the user's membership wallet.

    Reason: The reason field provides context for the transaction, indicating the purpose as the coverted tokens silver to gold

    . In Hindi, this is represented as "गोल्ड टोकन से परिवर्तित किया".

    Ref ID: The reference ID stored in the Wallet Ledger table is token_coverted_{user.id} which helps track the transaction back to its origin.

Last updated