@cfxlabsinc/b2b-services
    Preparing search index...

    Manage reward claims

    This model is not persisted outside its corresponding workflow so we cannot offer many of the methods you would typically see here

    Hierarchy (View Summary)

    Index
    db: B2bDatabase
    instance: (...args: []) => RewardClaimService = ...

    The process default: the task queue read from the temporal namespace at each start.

    • Create a reward claim

      A claim debits the entity's reward account and pays the MOVEUSD out of the reward program, into one of the entity's own ledger accounts or to a wallet address.

      Parameters

      • __namedParameters: Pick<Reward, "amount" | "category" | "note"> & {
            customerId: string;
            entityId: string;
            idempotencyKey?: string;
            target: { ledgerAccountId: string } | { walletAddress: Address };
        }

      Returns Promise<
          | { ok: true; value: RewardClaim }
          | {
              error:
                  | RewardAccountError
                  | ServiceError<
                      | "IDEMPOTENCY_ERROR"
                      | "INVALID_AMOUNT"
                      | "REWARD_PROGRAM_NOT_FOUND"
                      | "RECIPIENT_NOT_REGISTERED"
                      | "LEDGER_ACCOUNT_NOT_FOUND",
                  >
                  | ServiceError<
                      "INSUFFICIENT_BALANCE",
                      {
                          balance: { amount: number; currency: "MOVEUSD" };
                          requested: { amount: number; currency: "MOVEUSD" };
                      },
                  >;
              ok: false;
          },
      >