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

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    adminSearchCacheBuster: ServiceCache<CachedLedgerAccountAdminSearch>

    Buster over the cross-customer admin-search namespace owned by LedgerAccountAdminQueryService. Account create/update here bypass the admin service, so they must also bust the admin pickers' cache.

    cache: ServiceCache<CachedLedgerAccountSearch>
    entityEventPublisher: EntityEventPublisher
    entityService: EntityService
    mintfxProgramId: Address
    solanaAccountBalanceQueryService: SolanaAccountBalanceQueryService
    solanaTokenMintAddressService: SolanaTokenMintAddressService
    temporalClient: Client

    Methods

    • Parameters

      • __namedParameters: Omit<
            {
                address: Address;
                balance: BigNumber;
                createdAt: Date;
                id: string;
                name: string;
                notes?: string;
                paymentInstrumentId?: string;
                permissions: "ALL"
                | "ADMIN";
                referenceId?: string;
                tokenAccounts: Record<"MOVEUSD", { address: Address }>;
                updatedAt: Date;
                visibility: "PRIVATE" | "PUBLIC";
            },
            | "name"
            | "id"
            | "createdAt"
            | "updatedAt"
            | "address"
            | "balance"
            | "tokenAccounts",
        > & { customerId: string; entityId: string; name?: string }

      Returns Promise<
          | { error: ServiceError; ok: false }
          | {
              ok: true;
              value: {
                  address: Address;
                  balance: BigNumber;
                  createdAt: Date;
                  id: string;
                  name: string;
                  notes?: string;
                  paymentInstrumentId?: string;
                  permissions: "ALL" | "ADMIN";
                  referenceId?: string;
                  tokenAccounts: Record<"MOVEUSD", { address: Address }>;
                  updatedAt: Date;
                  visibility: "PRIVATE" | "PUBLIC";
              };
          },
      >

    • Get the given ledger account for the given customer

      Parameters

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

      Returns Promise<
          {
              ok: true;
              value: | {
                  address: Address;
                  balance: BigNumber;
                  createdAt: Date;
                  id: string;
                  name: string;
                  notes?: string;
                  paymentInstrumentId?: string;
                  permissions: "ALL"
                  | "ADMIN";
                  referenceId?: string;
                  tokenAccounts: Record<"MOVEUSD", { address: Address }>;
                  updatedAt: Date;
                  visibility: "PRIVATE" | "PUBLIC";
              } & {
                  customerOrganizationId: string;
                  entityDisplayName: string;
                  entityId: string;
                  entityReferenceId: string
                  | null;
                  entityType: "IDENTITY" | "ORGANIZATION";
              }
              | null;
          },
      >

    • Get a public ledger account that belongs to any customer

      Parameters

      • __namedParameters: { id: string }

      Returns Promise<
          | Omit<
              {
                  address: Address;
                  balance: BigNumber;
                  createdAt: Date;
                  id: string;
                  name: string;
                  notes?: string;
                  paymentInstrumentId?: string;
                  permissions: "ALL"
                  | "ADMIN";
                  referenceId?: string;
                  tokenAccounts: Record<"MOVEUSD", { address: Address }>;
                  updatedAt: Date;
                  visibility: "PRIVATE" | "PUBLIC";
              },
              "balance",
          > & { customer: { id: string; name: string } }
          | null,
      >

    • Return per-entity account metadata and counts for the given customer. One row per entity (identity or organization). main is true when the entity is the customer's primary organization.

      Parameters

      • __namedParameters: { customerId: string }

      Returns Promise<
          {
              ok: true;
              value: {
                  items: {
                      count: number;
                      customerOrganizationId: string;
                      entityDisplayName: string;
                      entityId: string;
                      entityReferenceId: string
                      | null;
                      entityType: "IDENTITY" | "ORGANIZATION";
                      main: boolean;
                  }[];
              };
          },
      >

    • Search all customers' public ledger accounts

      Parameters

      • __namedParameters: {
            addresses?: Address[];
            customerIds?: string[];
            customerNameLike?: string;
            ids?: string[];
        }

      Returns Promise<
          (
              Omit<
                  {
                      address: Address;
                      balance: BigNumber;
                      createdAt: Date;
                      id: string;
                      name: string;
                      notes?: string;
                      paymentInstrumentId?: string;
                      permissions: "ALL"
                      | "ADMIN";
                      referenceId?: string;
                      tokenAccounts: Record<"MOVEUSD", { address: Address }>;
                      updatedAt: Date;
                      visibility: "PRIVATE" | "PUBLIC";
                  },
                  "balance",
              > & { customer: { id: string; name: string } }
          )[],
      >

    • Parameters

      • __namedParameters: {
            customerId: string;
            data: Partial<Pick<LedgerAccount, "referenceId" | "name" | "notes">>;
            id: string;
        }

      Returns Promise<
          | {
              ok: true;
              value: {
                  address: Address;
                  balance: BigNumber;
                  createdAt: Date;
                  id: string;
                  name: string;
                  notes?: string;
                  paymentInstrumentId?: string;
                  permissions: "ALL"
                  | "ADMIN";
                  referenceId?: string;
                  tokenAccounts: Record<"MOVEUSD", { address: Address }>;
                  updatedAt: Date;
                  visibility: "PRIVATE" | "PUBLIC";
              };
          }
          | { error: ServiceError; ok: false },
      >