• Resolved graemeconradie

    (@graemeconradie)


    Hi Alex,

    I want to get the logged-in user’s coin address for a variable to pass to a form.

    I am on a page, with a coin variable (BTC / ETH / BCH), and I want to use that variable to get the users address for that coin.

    Like:

    $deposit_address = apply_filters( ‘wallets_api_deposit_address’, ”, array(
    ‘symbol’ => $atts[‘symbol’],
    ‘user_id’ => $atts[‘user_id’],
    ) );

    $deposit_address

    How do I get this done ?

    Graeme

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter graemeconradie

    (@graemeconradie)

    My apologies Alex,

    I found the API documentation.

    PHP API — Collection of WordPress actions and filters that can be used to interact with the wallets via PHP code. The PHP API is documented using phpDoc. The JSON API utilizes this PHP API.

    $deposit_address = apply_filters( ‘wallets_api_deposit_address’, ”, array( ‘symbol’ => ‘BTC’ ) );`

    $deposit_address = apply_filters( ‘wallets_api_deposit_address’, ”, array(
    ‘symbol’ => ‘LTC’,
    ‘user_id’ => 2,
    ‘check_capabilities’ => true,
    ‘force_new’ => true,
    ) );

    Plugin Author dashed-slug.net

    (@dashedslug)

    Hello,

    Glad you found it. For reference, the documentation is here: https://wallets-phpdoc.dashed-slug.net/classes/Dashed_Slug_Wallets_PHP_API.html#method_api_deposit_address_filter

    Note that the force_new argument will give you a brand new address and it will assign that address to that user and it will also mark all the other addresses for that user and coin as “old”.

    If you simply wish to get the deposit address, do not include force_new in your call.

    with regards

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘User Coin Address’ is closed to new replies.