Iban
Index
Constructors
publicconstructor
Construct a direct or indirect IBAN that has conversion methods and validity checks. If the provided string was not of either the length of a direct IBAN (34 or 35), nor the length of an indirect IBAN (20), an Error will be thrown ('Invalid IBAN was provided').
Parameters
iban: string
a Direct or an Indirect IBAN
Returns Iban
- Iban instance
Methods
publicchecksum
Returns the IBAN checksum of the early provided IBAN
Returns string
publicclient
Should be called to get client identifier within institution
Returns string
the client of the IBAN instance.
publicinstitution
Returns institution identifier from the early provided IBAN
Returns string
publicisDirect
An instance method that checks if iban number is Direct. It actually check the length of the provided variable and, only if it is 34 or 35, it returns true. Note: this is also available as a static method.
Returns boolean
true
if the providediban
is a Direct IBAN, andfalse
otherwise.
publicisIndirect
check if iban number if indirect It actually check the length of the provided variable and, only if it is 20, it returns true. Note: this is also available as a static method.
Returns boolean
true
if the providediban
is an Indirect IBAN, andfalse
otherwise.
publicisValid
Should be called to check if the early provided IBAN is correct. Note: this is also available as a static method.
Returns boolean
publictoAddress
This method should be used to create the equivalent ethereum address for the early provided Direct IBAN address. If the provided string was not a direct IBAN (has the length of 34 or 35), an Error will be thrown: ('Iban is indirect and cannot be converted. Must be length of 34 or 35'). Note: this is also available as a static method.
Returns string
the equivalent ethereum address
publictoString
Simply returns the early provided IBAN
Returns string
publicstaticcreateIndirect
Should be used to create IBAN object for given institution and identifier
Parameters
options: IbanOptions
an object holds the
institution
and theidentifier
which will be composed to create anIban
object from.
Returns Iban
an Iban class instance that holds the equivalent IBAN
publicstaticfromAddress
This method should be used to create iban object from an Ethereum address.
Parameters
address: string
an Ethereum address
Returns Iban
an Iban class instance that holds the equivalent IBAN
publicstaticfromBban
Convert the passed BBAN to an IBAN for this country specification. Please note that
<i>"generation of the IBAN shall be the exclusive responsibility of the bank/branch servicing the account"</i>. This method implements the preferred algorithm described in http://en.wikipedia.org/wiki/International_Bank_Account_Number#Generating_IBAN_check_digitsParameters
bban: string
the BBAN to convert to IBAN
Returns Iban
an Iban class instance that holds the equivalent IBAN
publicstaticisDirect
A static method that checks if an IBAN is Direct. It actually check the length of the provided variable and, only if it is 34 or 35, it returns true. Note: this is also available as a method at an Iban instance.
Parameters
iban: string
an IBAN to be checked
Returns boolean
true
if the providediban
is a Direct IBAN, andfalse
otherwise.
publicstaticisIndirect
A static method that checks if an IBAN is Indirect. It actually check the length of the provided variable and, only if it is 20, it returns true. Note: this is also available as a method at an Iban instance.
Parameters
iban: string
an IBAN to be checked
Returns boolean
true
if the providediban
is an Indirect IBAN, andfalse
otherwise.
publicstaticisValid
This method could be used to check if a given string is valid IBAN object. Note: this is also available as a method at an Iban instance.
Parameters
iban: string
a string to be checked if it is in IBAN
Returns boolean
- true if it is valid IBAN
publicstatictoAddress
This method should be used to create an ethereum address from a Direct IBAN address. If the provided string was not a direct IBAN (has the length of 34 or 35), an Error will be thrown: ('Iban is indirect and cannot be converted. Must be length of 34 or 35'). Note: this is also available as a method at an Iban instance.
Parameters
iban: string
a Direct IBAN address
Returns string
the equivalent ethereum address
publicstatictoIban
This method should be used to create IBAN address from an Ethereum address
Parameters
address: string
an Ethereum address
Returns string
the equivalent IBAN address
Converts Ethereum addresses to IBAN or BBAN addresses and vice versa. For using Iban package, first install Web3 package using:
npm i web3
oryarn add web3
based on your package manager, after that ENS features can be used.For using individual package install
web3-eth-iban
packages using:npm i web3-eth-iban
oryarn add web3-eth-iban
.