Skip to content

Currency class

The currency class is designed to work with Apirone currencies and contains all necessary data and methods. It is used to synchronize settings between the API and local settings, allows you to set the transfer address and processing fees in the API.

Create an instance

To create an instance, call the Currency::init() method and pass the json currency object received from the API account info method as a parameter.

INFO

If you work with currencies via the Settings class, you do not have to initialize the Currency class yourself.

Properties

PropertyMethod getDescription
namegetName()The full name of the cryptocurrency
abbrgetAbbr()Cryptocurrency abbreviation
unitsgetUnits()The minimal unit used for cryptocurrency
unitsFactorgetUnitsFactor()Factor for minimal unit
dustRategetDustRate()Fee free threshold. We don't charge the service fee for payments under this amount
addressgetAddres()Forwarding destination address
policygetPoloicy()Processing fee policies

Almost all properties are read-only. Two properties address and policy are available for modification. To do this, use setAddress() and setPolicy() methods.

Sinchronize with account

MethodDescription
loadSettings()
saveSettings()
hasError()
getError()

Additional methods

MethodDescription
isTestnet()Checks whether the currency is a testnet. For example tbtc.
isNetwork()Is the token over network (blockchain)
isToken()Is a network-based token.
getTokens()Returns an array with network tokens. An array of all currencies is used as a parameter.

Released under the MIT License.