Iban
Index
Constructors
constructor
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
Properties
toAddress
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.
Type declaration
Returns string
statictoAddress
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.
Type declaration
Parameters
iban: string
a Direct IBAN address
Returns string
Methods
checksum
Returns the IBAN checksum of the early provided IBAN
Returns string
client
Should be called to get client identifier within institution
Returns string
the client of the IBAN instance.
institution
Returns institution identifier from the early provided IBAN
Returns string
isDirect
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.
isIndirect
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.
isValid
Should be called to check if the early provided IBAN is correct. Note: this is also available as a static method.
Returns boolean
toString
Simply returns the early provided IBAN
Returns string
staticcreateIndirect
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
staticfromAddress
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
staticfromBban
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
staticisDirect
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.
staticisIndirect
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.
staticisValid
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
statictoIban
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
.