Plugin Directory

Changeset 3015422


Ignore:
Timestamp:
12/29/2023 09:08:46 AM (2 years ago)
Author:
dashedslug
Message:

Adding version 6.2.1 of wallets

Location:
wallets/trunk
Files:
20 added
20 deleted
11 edited

Legend:

Unmodified
Added
Removed
  • wallets/trunk/adapters/class-bank-fiat-adapter.php

    r2996338 r3015422  
    158158
    159159    public function get_wallet_version(): string {
    160         return '6.2.0';
     160        return '6.2.1';
    161161    }
    162162
     
    683683                    get_asset_path( 'wallets-admin-deposit-tool' ),
    684684                    [ 'jquery' ],
    685                     '6.2.0',
     685                    '6.2.1',
    686686                    true
    687687                );
  • wallets/trunk/adapters/class-bitcoin-core-like-wallet-adapter.php

    r2996338 r3015422  
    216216
    217217        <?php
    218         $transient_name = "dsw_bitcoin_{$this->wallet->post_id}_height";
    219         $block_height   = absint( get_ds_transient( $transient_name, 0 ) );
     218            try {
     219                $transient_name = "dsw_bitcoin_{$this->wallet->post_id}_height";
     220                $block_height   = absint( get_ds_transient( $transient_name, 0 ) );
     221                $current_block_height = $this->get_block_height();
    220222        ?>
    221223
    222         <p><?php printf( __( 'The wallet is synced up to a block height of <code>%1$d</code>. The wallet adapter is currently scraping the wallet for transactions with block height of <code>%2$d</code> or more.', 'wallets' ), $this->get_block_height(), $block_height  ); ?></p>
     224        <p><?php printf( __( 'The wallet is synced up to a block height of <code>%1$d</code>. The wallet adapter is currently scraping the wallet for transactions with block height of <code>%2$d</code> or more.', 'wallets' ), $current_block_height, $block_height  ); ?></p>
    223225
    224226        <p><?php esc_html_e( 'If some transactions were missed, you may restart scraping from a specific block height. If you set the height too far back, scraping will take a long time.', 'wallets' ); ?></p>
     
    266268
    267269        </form>
     270        <?php
     271            } catch ( \Exception $e ) {
     272                // don't show re-scrape form if wallet is not connected
     273            };
     274        ?>
     275
    268276
    269277        <p>
     
    690698                [
    691699                    'timeout'     => absint( get_ds_option( 'wallets_http_timeout', 5 ) ),
    692                     'user-agent'  => 'Bitcoin and Altcoin Wallets version 6.2.0',
     700                    'user-agent'  => 'Bitcoin and Altcoin Wallets version 6.2.1',
    693701                    'headers'     => [
    694702                        'Accept-Encoding: gzip',
  • wallets/trunk/admin/assets.php

    r2996338 r3015422  
    2222                get_asset_path( 'wallets-admin', 'style' ),
    2323                [],
    24                 '6.2.0'
     24                '6.2.1'
    2525            );
    2626
     
    5252                get_asset_path( 'wallets-admin-menu-item' ),
    5353                [ 'jquery' ],
    54                 '6.2.0',
     54                '6.2.1',
    5555                true
    5656            );
     
    6060                get_asset_path( 'wallets-admin-cs-tool' ),
    6161                [ 'jquery-qrcode' ],
    62                 '6.2.0',
     62                '6.2.1',
    6363                true
    6464            );
     
    7575                get_asset_path( 'wallets-admin-capabilities' ),
    7676                [ 'jquery-ui-tabs' ],
    77                 '6.2.0',
     77                '6.2.1',
    7878                true
    7979            );
     
    8383                get_asset_path( 'wallets-admin-dashboard' ),
    8484                [ 'jquery-ui-tabs', 'jqcloud' ],
    85                 '6.2.0',
     85                '6.2.1',
    8686                true
    8787            );
     
    9191                get_asset_path( 'wallets-admin-docs' ),
    9292                [ 'jquery' ],
    93                 '6.2.0',
     93                '6.2.1',
    9494                true
    9595            );
     
    9999                get_asset_path( 'wallets-admin-editor' ),
    100100                [ 'suggest' ],
    101                 '6.2.0',
     101                '6.2.1',
    102102                true
    103103            );
  • wallets/trunk/admin/dashboard.php

    r2996338 r3015422  
    349349        global $wpdb;
    350350
    351         $debug_data[ (string) __( 'Plugin version', 'wallets' ) ]         = '6.2.0';
    352         $debug_data[ (string) __( 'Git SHA', 'wallets' ) ]                = '57fc9fff';
     351        $debug_data[ (string) __( 'Plugin version', 'wallets' ) ]         = '6.2.1';
     352        $debug_data[ (string) __( 'Git SHA', 'wallets' ) ]                = 'fbcc11f2';
    353353        $debug_data[ (string) __( 'Web Server', 'wallets' ) ]             = $_SERVER['SERVER_SOFTWARE'];
    354354        $debug_data[ (string) __( 'PHP version', 'wallets' ) ]            = PHP_VERSION;
  • wallets/trunk/apis/wp-rest.php

    r2956686 r3015422  
    11481148        register_rest_route(
    11491149            'dswallets/v1',
     1150            '/users/(?P<user_id>\d+)/addresses/(?P<address_id>\d+)',
     1151            [
     1152                'methods'  => \WP_REST_SERVER::READABLE,
     1153                'callback' => function( $data ) {
     1154                    $params     = $data->get_url_params();
     1155                    $user_id    = $params['user_id'];
     1156                    $address_id = $params['address_id'];
     1157
     1158                    try {
     1159                        $address = Address::load( $address_id );
     1160                    } catch ( \Exception $e ) {
     1161                        return new \WP_Error(
     1162                            'address_not_found',
     1163                            __( 'Address not found!', 'wallets' ),
     1164                            [ 'status' => 404 ]
     1165                        );
     1166                    }
     1167
     1168                    if ( $address->user->ID != $user_id ) {
     1169                        return new \WP_Error(
     1170                            'address_not_found',
     1171                            __( 'Address not found!', 'wallets' ),
     1172                            [ 'status' => 404 ]
     1173                        );
     1174                    }
     1175
     1176                    $result = [
     1177                        'id'          => $address->post_id,
     1178                        'address'     => $address->address,
     1179                        'extra'       => $address->extra ? $address->extra : null,
     1180                        'type'        => $address->type,
     1181                        'currency_id' => $address->currency->post_id,
     1182                        'label'       => $address->label,
     1183                    ];
     1184
     1185                    /** This filter is documented in this file. See above. */
     1186                    $result = apply_filters( 'wallets_address_filter', $result );
     1187
     1188                    $max_age = max( 0, absint( get_ds_option( 'wallets_polling_interval', 0 ) ) - 1 );
     1189                    $response = new \WP_Rest_Response( $result, 200 );
     1190                    $response->set_headers( [ 'Cache-Control' => "max-age=$max_age" ] );
     1191
     1192                    return $response;
     1193                },
     1194                'args' => [
     1195                    'user_id' => [
     1196                        'sanitize_callback' => 'absint',
     1197                    ],
     1198                    'address_id' => [
     1199                        'sanitize_callback' => 'absint',
     1200                    ],
     1201                ],
     1202                'permission_callback' => $permission_callback,
     1203            ]
     1204        );
     1205
     1206        register_rest_route(
     1207            'dswallets/v1',
    11501208            '/users/(?P<user_id>\d+)/currencies/(?P<currency_id>\d+)/addresses',
    11511209            [
  • wallets/trunk/docs/developer.md

    r2912451 r3015422  
    437437
    438438Allows a user to set a `label` text string to an existing address. The address is specified by its post ID.
     439
     440#### /users/USER_ID/addresses/ADDRESS_ID
     441
     442|     |     |
     443| --- | --- |
     444| *Endpoint* | `/dswallets/v1/users/USER_ID/addresses/ADDRESS_ID` |
     445| *Method* | `GET` |
     446| *URI Parameters* | `USER_ID`, an integer and `ADDRESS_ID`, an integer |
     447| *Optional GET Parameters* | No |
     448| *Requires login* | Yes |
     449| *Requires capabilities* | If data on a user other than the currently logged in user is requested, requires `manage_wallets`. |
     450
     451Retrieves an existing address. The address is specified by its post ID and must correspond to the specified user.
    439452
    440453
  • wallets/trunk/frontend/assets.php

    r2996338 r3015422  
    2323            get_asset_path( 'wallets', 'style' ),
    2424            [],
    25             '6.2.0'
     25            '6.2.1'
    2626        );
    2727
     
    8686            get_asset_path( 'jsqrcode' ),
    8787            [ 'jquery' ],
    88             '6.2.0',
     88            '6.2.1',
    8989            true
    9090        );
     
    128128            get_asset_path( 'wallets-front' ),
    129129            [ 'knockout', 'jquery', 'style-scoped', 'sprintf.js' ],
    130             '6.2.0',
     130            '6.2.1',
    131131            true
    132132        );
  • wallets/trunk/post-types/class-currency.php

    r2996338 r3015422  
    12521252                'the exchange rate (current value) of this currency against other currencies. ' .
    12531253                'If you enter the CoinGecko ID only and click "Update", the plugin will fill in the following details, if they are missing: ' .
    1254                 'name/title, ticker symbol, tags, icon/logo, and contract address (for tokens).',
     1254                'name/title, ticker symbol, tags, icon/logo, and contract address (for EVM tokens).',
    12551255                'wallets'
    12561256            ); ?></p>
     
    13511351
    13521352        <label class="wallets_meta_box_label">
    1353             <span><?php esc_html_e( 'Contract address / Asset ID (hex string)', 'wallets' ); ?></span>
     1353            <span><?php esc_html_e( 'Contract address or asset group key (hex string)', 'wallets' ); ?></span>
    13541354
    13551355            <input
    13561356                id="wallets-currency-contract-address"
    13571357                name="wallets_contract_address"
    1358                 title="<?php esc_attr_e( 'Contract address / Asset ID (hex string)', 'wallets' ); ?>"
     1358                title="<?php esc_attr_e( 'Contract address or asset group key (hex string)', 'wallets' ); ?>"
    13591359                type="text"
    13601360                pattern="^(0x)?[0-9A-Fa-f]{8,}"
     
    13621362
    13631363                <p class="description"><?php esc_html_e(
    1364                     'Enter here the contract address or asset_id uniquely identifying this EVM token or Taproot asset. ' .
    1365                     'For EVM tokens, this will always start with 0x. ' .
    1366                     'For Taproot Assets, this will typically be a string without the 0x prefix. ' .
    1367                     'For other coins that are native to their blockchain, this should be left empty. ' .
    1368                     'NOTE: If you set the CoingeckoID correctly and there is a contract address, ' .
     1364                    'Enter here the unique ID identifying this asset. ' .
     1365                    'For EVM tokens, this will be the contract address (a hex string starting with 0x). ' .
     1366                    'For Taproot Assets, this will be the asset\'s group_key (a hex string without a 0x prefix). ' .
     1367                    'For other coins that are native to their blockchain (e.g. Bitcoin), this should be left empty. ' .
     1368                    'NOTE: If you set the CoingeckoID correctly and the currency is an EVM token, then ' .
    13691369                    'the contract address will be filled in automatically for you from CoinGecko. ',
    13701370                    'wallets'
  • wallets/trunk/post-types/class-wallet.php

    r2973854 r3015422  
    548548        $wallet  = $meta_box['args'];
    549549
    550         $wallet->adapter->do_description_text();
     550        try {
     551            $wallet->adapter->do_description_text();
     552        } catch ( \Exception $e ) {
     553            ?>
     554            <p style="color:red;"><?php
     555                esc_html_e(
     556                    sprintf(
     557                        'This wallet adapter failed to display its description text. The error was: %s',
     558                        $e->getMessage()
     559                    )
     560                );
     561            ?></p>
     562            <?php
     563        }
    551564    }
    552565
  • wallets/trunk/readme.txt

    r2996338 r3015422  
    44Tags: wallet, bitcoin, cryptocurrency, altcoin, coin, money, e-money, e-cash, deposit, withdraw, account, API
    55Requires at least: 5.0
    6 Tested up to: 6.4.1
     6Tested up to: 6.4.2
    77Requires PHP: 5.6
    8 Stable tag: 6.2.0
     8Stable tag: 6.2.1
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    3030 The following wallet adapters are available for free to all [dashed-slug subscribers](https://www.dashed-slug.net/dashed-slug/subscribe/).
    3131
     32- [lnd Wallet Adapter extension](https://www.dashed-slug.net/bitcoin-altcoin-wallets-wordpress-plugin/lnd-wallet-adapter-extension/) - Connect to an lnd node, and perform transactions on the Bitcoin Lightning network.
    3233- [CoinPayments Adapter extension](https://www.dashed-slug.net/bitcoin-altcoin-wallets-wordpress-plugin/coinpayments-adapter-extension/) - Third-party wallet for many cryptocurrencies. Saves you from the hassle of hosting wallets on servers. But you don't control the private keys.
    3334- [Monero Coin Adapter extension](https://www.dashed-slug.net/bitcoin-altcoin-wallets-wordpress-plugin/monero-coin-adapter-extension/) - Full node wallet adapter for Monero and its forks.
     
    336337
    337338== Changelog ==
     339
     340= 6.2.1 =
     341- Fix: Issue introduced in `6.2.0` where the wallet admin screen would crash on new installations is now fixed.
     342- Add: Generic error handling for when the metabox of a wallet adapter crashes.
     343- Add: New REST API endpoint for retrieving an Address by its post ID. See the REST API documentation for details.
     344- Change: The wording for the description for the "Contract Address" field under Addresses is now changed to include Taproot Asset IDs for the upcoming tapd Wallet adapter.
    338345
    339346= 6.2.0 =
     
    15331540== Upgrade Notice ==
    15341541
    1535 Version `6.2` brings a few minor improvements to the plugin. See the changelog for details.
     1542Version `6.2.1` includes a bug fix and some changes necessary for the upcoming taproot assets adapter. See the changelog for details.
    15361543
    15371544== Donating ==
  • wallets/trunk/wallets.php

    r2996338 r3015422  
    33 * Plugin Name:         Bitcoin and Altcoin Wallets
    44 * Description:         Custodial cryptocurrency wallets.
    5  * Version:             6.2.0
     5 * Version:             6.2.1
    66 * Plugin URI:          https://www.dashed-slug.net/bitcoin-altcoin-wallets-wordpress-plugin
    77 * Requires at least:   5.0
Note: See TracChangeset for help on using the changeset viewer.