@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
    • Create a reward claim

      Claims deduct from reward balance and deposit MOVEUSD into target wallets

      Parameters

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

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