ERR_GET_USERS_INFO
ERR_GET_USERS_INFO
error code for exception thrown while getting user info
The core of this plugin.
Provides an API for other plugins and themes to perform wallet actions, bound to the current logged in user.
get_coin_adapters(string $symbol = null, boolean $check_capabilities = false) : \Dashed_Slug_Wallets_Coin_Adapter|array
Returns the coin adapter for the symbol specified, or an associative array of all the adapters if the symbol is omitted.
The adapters provide the low-level API for talking to the various wallets.
string | $symbol | (Usually) three-letter symbol of the wallet's coin. |
boolean | $check_capabilities | Capabilities are checked if set to true. Default: false. |
If the operation fails. Exception code will be one of Dashed_SlugWallets::ERR*.
The instance of the adapter or array of adapters requested.
add_option(string $option, mixed $value) : boolean
This helper delegates to add_site_option if the plugin is network activated on a multisite install, or to add_option otherwise.
string | $option | The option name. |
mixed | $value | The option value. |
The result of the wrapped function.
update_option(string $option, mixed $value) : boolean
This helper delegates to update_site_option if the plugin is network activated on a multisite install, or to update_option otherwise.
string | $option | The option name. |
mixed | $value | The option value. |
The result of the wrapped function.
get_option(string $option, $default = false) : boolean
This helper delegates to get_site_option if the plugin is network activated on a multisite install, or to get_option otherwise.
string | $option | The option name. |
$default |
The result of the wrapped function.
get_balance(string $symbol, null $minconf = null, boolean $check_capabilities = false, integer $account = null) : float
Get user's wallet balance.
Get the current logged in user's total wallet balance for a specific coin. Only transactions with status = 'done' are counted. This replaces the previous filtering based on the $minconf argument.
string | $symbol | (Usually) three-letter symbol of the wallet's coin. |
null | $minconf | Ignored. |
boolean | $check_capabilities | Capabilities are checked if set to true. Default: false. |
integer | $account | The user_id of the account to check, or null to retrieve logged in account's balance. Default: null. |
If the operation fails. Exception code will be one of Dashed_SlugWallets::ERR*.
The balance.
get_transactions(string $symbol, integer $count = 10, integer $from, integer $minconf = null, boolean $check_capabilities = false) : array
Get transactions of current logged in user.
Returns the deposits, withdrawals and intra-user transfers initiated by the current logged in user for the specified coin.
string | $symbol | Character symbol of the wallet's coin. |
integer | $count | Maximal number of transactions to return. |
integer | $from | Start retrieving transactions from this offset. |
integer | $minconf | (optional) Minimum number of confirmations for deposits and withdrawals. If left out, the default adapter setting is used. |
boolean | $check_capabilities | Capabilities are checked if set to true. Default: false. |
If the operation fails. Exception code will be one of Dashed_SlugWallets::ERR*.
The transactions.
do_withdraw(string $symbol, string $address, float $amount, string $comment = '', string $comment_to = '', boolean $check_capabilities = false, boolean $skip_confirm = false) : void
Withdraw from current logged in user's account.
string | $symbol | Character symbol of the wallet's coin. |
string | $address | Address to withdraw to. |
float | $amount | Amount to withdraw to. |
string | $comment | Optional comment to attach to the transaction. |
string | $comment_to | Optional comment to attach to the destination address. |
boolean | $check_capabilities | Capabilities are checked if set to true. Default: false. |
boolean | $skip_confirm | Set to true if the transaction should not require confirmations. Useful for feature extensions. |
If the operation fails. Exception code will be one of Dashed_SlugWallets::ERR*.
do_move(string $symbol, integer $toaccount, float $amount, string $comment, boolean $check_capabilities = false, string $tags = '', boolean $skip_confirm = false, integer|null $fromaccount = null) : void
Move funds from the current logged in user's balance to the specified user.
string | $symbol | Character symbol of the wallet's coin. |
integer | $toaccount | The WordPress user_ID of the recipient. |
float | $amount | Amount to withdraw to. |
string | $comment | Optional comment to attach to the transaction. |
boolean | $check_capabilities | Capabilities are checked if set to true. Default: false. |
string | $tags | A space separated list of tags, slugs, etc that further describe the type of transaction. |
boolean | $skip_confirm | Set to true if the transaction should not require confirmations. Useful for feature extensions. |
integer|null | $fromaccount | The WordPress user_ID of the sender, or null for current user ID. |
If move fails. Exception code will be one of Dashed_SlugWallets::ERR*.
get_deposit_address(string $symbol, $account = null, boolean $check_capabilities = false) : string
Get a deposit address for the current logged in user's account.
string | $symbol | Character symbol of the wallet's coin. |
$account | ||
boolean | $check_capabilities | Capabilities are checked if set to true. Default: false. |
If the operation fails.
A deposit address associated with the current logged in user.
get_new_address(string $symbol, boolean $check_capabilities = false) : string
Get a deposit address for the current logged in user's account.
string | $symbol | Character symbol of the wallet's coin. |
boolean | $check_capabilities | Capabilities are checked if set to true. Default: false. |
If the operation fails. Exception code will be one of Dashed_SlugWallets::ERR*.
A deposit address associated with the current logged in user.
get_exchange_rate(string $from, string $to) : boolean|\number
Returns the exchange rate between two fiat currencies or cryptocurrencies, using fixer.io and bittrex.
example: get_exchange_rate( 'USD', 'BTC' ) would return
string | $from | The currency to convert from. |
string | $to | The currency to convert to. |
Exchange rate or false.
None found |
None found |
None found |