//#region src/is-valid-bank-account/is-valid-bank-account.d.ts /** The bank account `isValidBankAccount` checks: the bank, the agency and the account with its check digit. */ export type IsValidBankAccountParams = { /** Three digit bank code (COMPE), e.g. "001" for Banco do Brasil. */ bankCode: string; /** Agency number, digits only, without its own check digit. */ agency: string; /** Account number, digits only, without the check digit. */ account: string; /** * The account check digit: one or two characters, or "X" for Banco do Brasil and "P" for * Bradesco. Banks with a published rule take a single character; the generic fallback also * accepts two, chaining mod10 and mod11 over the account. */ digit: string; }; /** * The bank account `isValidBankAccount` checks: the bank, the agency and the account with its * check digit. * * Kept from 2.3.0: the name violates the naming rule (`Options` is the type of a second, * usually optional, argument, and this object is the only argument `isValidBankAccount` takes), * but it shipped in 2.3.0 as the canonical name, so it stays as an alias until v3. * * @deprecated Use `IsValidBankAccountParams` instead. */ export type IsValidBankAccountOptions = IsValidBankAccountParams; /** * Validates a Brazilian bank account. The bank code must belong to the Banco Central do Brasil * STR participants list, otherwise the account is rejected. * * Banks validated by their published check digit algorithm: * Banco do Brasil (001), Santander (033), Banrisul (041), Caixa Econômica Federal (104), * Bradesco (237), Nubank (260, Verhoeff), Itaú Unibanco (341), HSBC/Kirton (399) and * Citibank (745). * * Banks validated by structure only, because they publish no check digit rule: * Inter (077), Ailos (085), XP (102), Unicred (136), Stone (197), BTG Pactual (208), * Original (212), PagBank (290), BMG (318), Mercado Pago (323), C6 (336), PicPay (380), * Cora (403), Pan (623), BV (655), Daycoval (707), Sicredi (748) and Sicoob (756). * For those the agency and account only need to match the documented digit lengths. * * Every other bank of the list falls back to a generic modulus 10 and modulus 11 check. * * @param {IsValidBankAccountParams} params - The bank account parameters. * @param {string} params.bankCode - The bank code (3 digits), as published by Banco Central. * @param {string} params.agency - The agency number (1-5 digits). * @param {string} params.account - The account number (1-13 digits). For Caixa, operação + conta. * @param {string} params.digit - The verification digit (1-2 digits, or "X" for Banco do Brasil and "P" for Bradesco). * @returns {boolean} True if the bank account is valid, false otherwise. * * @example * ```typescript * isValidBankAccount({ bankCode: "001", agency: "1584", account: "00210169", digit: "6" }); // true * isValidBankAccount({ bankCode: "041", agency: "2664", account: "358507670", digit: "6" }); // true * isValidBankAccount({ bankCode: "260", agency: "0001", account: "5216125", digit: "0" }); // true * isValidBankAccount({ bankCode: "999", agency: "1234", account: "123456", digit: "6" }); // false * ``` * * Only bank codes present in the bundled Banco Central participant table are accepted; that table is * regenerated weekly by the datasets workflow, so a bank created after the release becomes valid * on the next release. * * @see Official: https://www.bcb.gov.br/content/estabilidadefinanceira/str1/ParticipantesSTR.csv * @see Based on: https://github.com/eduardokum/laravel-boleto/blob/master/manuais/Regras%20Validacao%20Conta%20Corrente%20VI_EPS.pdf * Icatu Seguros compendium of per bank agency/account check digit rules. * @see Based on: https://github.com/ajmiciano/banktools-br/tree/master/lib/banktools-br/banks * @see Based on: https://github.com/luizalabs/heimdall/blob/main/heimdall_valid_bank/calculate_number_account.py * @see Based on: https://github.com/Xerpa/bran_checker/tree/master/lib/banks */ export declare const isValidBankAccount: (params: IsValidBankAccountParams) => boolean; //#endregion