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

    Constructors

    Methods

    • Parameters

      • __namedParameters: { customerId: string; id: string }

      Returns Promise<
          | { ok: true; value: { id: string } }
          | {
              error:
                  | ServiceError<"NOT_FOUND">
                  | ServiceError<"DEPOSIT_ALREADY_PROCESSED">;
              ok: false;
          },
      >

    • Syncs our state after GreenDot returns response code 111111111 (OldestBarcodeCancelled), which guarantees they already cancelled exactly one barcode on their side. We find the oldest CREATED barcode in our DB, confirm with GreenDot that it is indeed cancelled, and signal the workflow.

      If a concurrent workflow already handled the cancellation (row is no longer CREATED), the search will skip it and we fall through to ok(false).

      Parameters

      • __namedParameters: { customerId: string; entityId: string }

      Returns Promise<{ ok: true; value: boolean }>

    • Parameters

      • args: {
            amount?:
                | { source: { amount: BigNumber } }
                | { target: { amount: BigNumber } };
            customerId: string;
            deviceIpAddress?: string;
            deviceLocation?: { lat: number; long: number; source: "ip" };
            entityId: string;
            metadata?: Record<string, any>;
            reference: string;
            regionCode?: string;
            retailerId: string;
            targetCurrency?: "MOVEUSD" | "USDC";
            user: {
                address?: string;
                firstName: string;
                lastName: string;
                zipcode: string;
            };
            wallet: { address: string; blockchain: "SOLANA" };
        }

      Returns Promise<
          | {
              error: | PreRouteError
              | QuoteInvariantError
              | LimitExceededError
              | ServiceError<"INVALID_ENTITY_ID">
              | ServiceError<"UNSUPPORTED_PHONE_COUNTRY">
              | ServiceError<"LIMIT_EXCEEDED">;
              ok: false;
          }
          | {
              ok: true;
              value: {
                  aggregateQuote?: {
                      fees: (
                          {
                              amount: BigNumber;
                              receiver: (...)
                              | (...)
                              | (...);
                              type: (...) | (...);
                          } & { currency: string }
                      )[];
                      sourceAmount: BigNumber;
                      sourceAmountAfterFees: BigNumber;
                      sourceCurrency: string;
                      targetAmount: BigNumber;
                      targetAmountAfterFees: BigNumber;
                      targetCurrency: string;
                  };
                  createdAt: Date;
                  customerId: string;
                  data?: | {
                      address?: string;
                      barcodeNumber: string;
                      barcodeStatus: | "CREATED"
                      | "PENDING"
                      | "DECLINED"
                      | "EXPIRED"
                      | "CANCELLED"
                      | "CONSUMED"
                      | "VOIDED";
                      expiresAt: string;
                      firstName: string;
                      greendotId: string
                      | null;
                      lastName: string;
                      phone?: string;
                      retailerId: string;
                      retailerName: string;
                      targetCurrency?: "MOVEUSD" | "USDC";
                      zipcode: string;
                  }
                  | {
                      ffc_memo?: string;
                      imad?: string;
                      omad?: string;
                      sender_name?: string;
                  }
                  | {
                      achBatchId?: string;
                      achId: string;
                      bankId?: string;
                      sourcePaymentInstrumentId: string;
                      speed?: string;
                      victorTransactionId?: string;
                  }
                  | { providerId?: string; providerTransactionId?: string }
                  | { ffcMemo?: string }
                  | {
                      achId?: string;
                      achTraceId?: string;
                      ffcMemo?: string;
                      senderName?: string;
                  }
                  | { ffcMemo?: string; senderName?: string; tchInstitutionId?: string }
                  | null;
                  depositId?: string;
                  deviceIpAddress: string | null;
                  deviceLocation?: { lat: number; long: number; source: "ip" };
                  entityId: string;
                  id: string;
                  metadata: {
                      brand?: string;
                      marketing?:
                          | EmptyObject
                          | {
                              fbp?: string;
                              gclid?: string;
                              sub1?: string;
                              sub2?: string;
                              sub3?: string;
                              userAgent?: string;
                              utmCampaign?: string;
                              utmContent?: string;
                              utmMedium?: string;
                              utmSource?: string;
                          };
                  };
                  productQuoteId: string;
                  quote?: {
                      fees: (
                          {
                              amount: BigNumber;
                              receiver: (...)
                              | (...)
                              | (...);
                              type: (...) | (...);
                          } & { currency: string }
                      )[];
                      sourceAmount: BigNumber;
                      sourceAmountAfterFees: BigNumber;
                      sourceCurrency: string;
                      targetAmount: BigNumber;
                      targetAmountAfterFees: BigNumber;
                      targetCurrency: string;
                  };
                  reference: string;
                  status: "ACCEPTED"
                  | "ACTIVE"
                  | "EXPIRED"
                  | "REJECTED";
                  updatedAt: Date;
                  walletAddress: Address;
                  walletBlockchain: "SOLANA";
              } & { type: "CASH" } & {
                  address?: string;
                  barcodeNumber: string;
                  barcodeStatus:
                      | "CREATED"
                      | "PENDING"
                      | "DECLINED"
                      | "EXPIRED"
                      | "CANCELLED"
                      | "CONSUMED"
                      | "VOIDED";
                  expiresAt: Date;
                  firstName: string;
                  greendotId?: string
                  | null;
                  lastName: string;
                  phone?: string;
                  retailerId: string;
                  retailerName: string;
                  zipcode: string;
              } & { cancelOldest: boolean };
          },
      >

    • Parameters

      • args: {
            customerId: string;
            data: {
                barcodeStatus:
                    | "CREATED"
                    | "PENDING"
                    | "DECLINED"
                    | "EXPIRED"
                    | "CANCELLED"
                    | "CONSUMED"
                    | "VOIDED";
            };
            id: string;
        }

      Returns Promise<void>