Generates a random account number.
Optional
length: numberThe length of the account number. Defaults to 8
.
Generates a random account number.
Optional
options: { length?: number }An options object.
Optional
length?: numberThe length of the account number.
Generates a random account number.
Optional
optionsOrLength: number | { length?: number }An options object or the length of the account number.
Optional
length?: numberThe length of the account number.
Generates a random amount between the given bounds (inclusive).
Optional
options: {An options object.
Optional
autoFormat?: booleanIf true this method will use Number.toLocaleString()
. Otherwise it will use Number.toFixed()
.
Optional
dec?: numberThe number of decimal places for the amount.
Optional
max?: numberThe upper bound for the amount.
Optional
min?: numberThe lower bound for the amount.
Optional
symbol?: stringThe symbol used to prefix the amount.
faker.finance.amount() // '617.87'
faker.finance.amount({ min: 5, max: 10 }) // '5.53'
faker.finance.amount({ min: 5, max: 10, dec: 0 }) // '8'
faker.finance.amount({ min: 5, max: 10, dec: 2, symbol: '$' }) // '$5.85'
faker.finance.amount({ min: 5, max: 10, dec: 5, symbol: '', autoFormat: true }) // '9,75067'
Generates a random SWIFT/BIC code based on the ISO-9362 format.
Optional
options: { includeBranchCode?: boolean }Options object.
Optional
includeBranchCode?: booleanWhether to include a three-digit branch code at the end of the generated code.
Generates a random Bitcoin address.
Optional
options: {An optional options object.
Optional
network?: "mainnet" | "testnet"The bitcoin network ('mainnet'
or 'testnet'
).
Optional
type?: "legacy" | "segwit" | "bech32" | "taproot"The bitcoin address type ('legacy'
, 'sewgit'
, 'bech32'
or 'taproot'
).
Generates a random credit card number.
Optional
issuer: stringThe name of the issuer (case-insensitive) or the format used to generate one.
Generates a random credit card number.
Optional
options: { issuer?: string }An options object.
Optional
issuer?: stringThe name of the issuer (case-insensitive) or the format used to generate one.
Generates a random credit card number.
Optional
options: string | { issuer?: string }An options object, the issuer or a custom format.
Optional
issuer?: stringThe name of the issuer (case-insensitive) or the format used to generate one.
Returns a random currency object, containing code
, name
, symbol
, and numericCode
properties.
Creates a random, non-checksum Ethereum address.
To generate a checksummed Ethereum address (with specific per character casing), wrap this method in a custom method and use third-party libraries to transform the result.
Generates a random IBAN.
Please note that the generated IBAN might be invalid due to randomly generated bank codes/other country specific validation rules.
Optional
options: { countryCode?: string; formatted?: boolean }An options object.
Optional
countryCode?: stringThe country code from which you want to generate an IBAN, if none is provided a random country will be used.
Optional
formatted?: booleanReturn a formatted version of the generated IBAN.
Generates a random masked number.
Optional
length: numberThe length of the unmasked number. Defaults to 4
.
Generates a random masked number.
Optional
options: { ellipsis?: boolean; length?: number; parens?: boolean }An options object.
Optional
ellipsis?: booleanWhether to prefix the numbers with an ellipsis.
Optional
length?: numberThe length of the unmasked number.
Optional
parens?: booleanWhether to use surrounding parenthesis.
Generates a random masked number.
Optional
optionsOrLength: number | { ellipsis?: boolean; length?: number; parens?: boolean }An options object or the length of the unmask number.
Optional
ellipsis?: booleanWhether to prefix the numbers with an ellipsis.
Optional
length?: numberThe length of the unmasked number.
Optional
parens?: booleanWhether to use surrounding parenthesis.
Generates a random PIN number.
Optional
length: numberThe length of the PIN to generate. Defaults to 4
.
Generates a random PIN number.
Optional
options: { length?: number }An options object.
Optional
length?: numberThe length of the PIN to generate.
Generates a random PIN number.
Optional
options: number | { length?: number }An options object or the length of the PIN.
Optional
length?: numberThe length of the PIN to generate.
Module to generate finance and money related entries.
Overview
For a random amount, use
amount()
.For traditional bank accounts, use:
accountNumber()
,accountName()
,bic()
,iban()
,pin()
androutingNumber()
.For credit card related methods, use:
creditCardNumber()
,creditCardCVV()
,creditCardIssuer()
,transactionDescription()
andtransactionType()
.For blockchain related methods, use:
bitcoinAddress()
,ethereumAddress()
andlitecoinAddress()
.