Changeset 3015422
- Timestamp:
- 12/29/2023 09:08:46 AM (2 years ago)
- Location:
- wallets/trunk
- Files:
-
- 20 added
- 20 deleted
- 11 edited
-
adapters/class-bank-fiat-adapter.php (modified) (2 diffs)
-
adapters/class-bitcoin-core-like-wallet-adapter.php (modified) (3 diffs)
-
admin/assets.php (modified) (7 diffs)
-
admin/dashboard.php (modified) (1 diff)
-
apis/wp-rest.php (modified) (1 diff)
-
assets/scripts/bs58check-6.2.0.min.js (deleted)
-
assets/scripts/bs58check-6.2.0.min.js.map (deleted)
-
assets/scripts/bs58check-6.2.1.min.js (added)
-
assets/scripts/bs58check-6.2.1.min.js.map (added)
-
assets/scripts/wallets-admin-capabilities-6.2.0.min.js (deleted)
-
assets/scripts/wallets-admin-capabilities-6.2.0.min.js.map (deleted)
-
assets/scripts/wallets-admin-capabilities-6.2.1.min.js (added)
-
assets/scripts/wallets-admin-capabilities-6.2.1.min.js.map (added)
-
assets/scripts/wallets-admin-cs-tool-6.2.0.min.js (deleted)
-
assets/scripts/wallets-admin-cs-tool-6.2.0.min.js.map (deleted)
-
assets/scripts/wallets-admin-cs-tool-6.2.1.min.js (added)
-
assets/scripts/wallets-admin-cs-tool-6.2.1.min.js.map (added)
-
assets/scripts/wallets-admin-dashboard-6.2.0.min.js (deleted)
-
assets/scripts/wallets-admin-dashboard-6.2.0.min.js.map (deleted)
-
assets/scripts/wallets-admin-dashboard-6.2.1.min.js (added)
-
assets/scripts/wallets-admin-dashboard-6.2.1.min.js.map (added)
-
assets/scripts/wallets-admin-deposit-tool-6.2.0.min.js (deleted)
-
assets/scripts/wallets-admin-deposit-tool-6.2.0.min.js.map (deleted)
-
assets/scripts/wallets-admin-deposit-tool-6.2.1.min.js (added)
-
assets/scripts/wallets-admin-deposit-tool-6.2.1.min.js.map (added)
-
assets/scripts/wallets-admin-docs-6.2.0.min.js (deleted)
-
assets/scripts/wallets-admin-docs-6.2.0.min.js.map (deleted)
-
assets/scripts/wallets-admin-docs-6.2.1.min.js (added)
-
assets/scripts/wallets-admin-docs-6.2.1.min.js.map (added)
-
assets/scripts/wallets-admin-editor-6.2.0.min.js (deleted)
-
assets/scripts/wallets-admin-editor-6.2.0.min.js.map (deleted)
-
assets/scripts/wallets-admin-editor-6.2.1.min.js (added)
-
assets/scripts/wallets-admin-editor-6.2.1.min.js.map (added)
-
assets/scripts/wallets-admin-menu-item-6.2.0.min.js (deleted)
-
assets/scripts/wallets-admin-menu-item-6.2.0.min.js.map (deleted)
-
assets/scripts/wallets-admin-menu-item-6.2.1.min.js (added)
-
assets/scripts/wallets-admin-menu-item-6.2.1.min.js.map (added)
-
assets/scripts/wallets-front-6.2.0.min.js (deleted)
-
assets/scripts/wallets-front-6.2.0.min.js.map (deleted)
-
assets/scripts/wallets-front-6.2.1.min.js (added)
-
assets/scripts/wallets-front-6.2.1.min.js.map (added)
-
assets/styles/wallets-6.2.0.min.css (deleted)
-
assets/styles/wallets-6.2.1.min.css (added)
-
assets/styles/wallets-admin-6.2.0.min.css (deleted)
-
assets/styles/wallets-admin-6.2.1.min.css (added)
-
docs/developer.md (modified) (1 diff)
-
frontend/assets.php (modified) (3 diffs)
-
post-types/class-currency.php (modified) (3 diffs)
-
post-types/class-wallet.php (modified) (1 diff)
-
readme.txt (modified) (4 diffs)
-
wallets.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
wallets/trunk/adapters/class-bank-fiat-adapter.php
r2996338 r3015422 158 158 159 159 public function get_wallet_version(): string { 160 return '6.2. 0';160 return '6.2.1'; 161 161 } 162 162 … … 683 683 get_asset_path( 'wallets-admin-deposit-tool' ), 684 684 [ 'jquery' ], 685 '6.2. 0',685 '6.2.1', 686 686 true 687 687 ); -
wallets/trunk/adapters/class-bitcoin-core-like-wallet-adapter.php
r2996338 r3015422 216 216 217 217 <?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(); 220 222 ?> 221 223 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> 223 225 224 226 <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> … … 266 268 267 269 </form> 270 <?php 271 } catch ( \Exception $e ) { 272 // don't show re-scrape form if wallet is not connected 273 }; 274 ?> 275 268 276 269 277 <p> … … 690 698 [ 691 699 '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', 693 701 'headers' => [ 694 702 'Accept-Encoding: gzip', -
wallets/trunk/admin/assets.php
r2996338 r3015422 22 22 get_asset_path( 'wallets-admin', 'style' ), 23 23 [], 24 '6.2. 0'24 '6.2.1' 25 25 ); 26 26 … … 52 52 get_asset_path( 'wallets-admin-menu-item' ), 53 53 [ 'jquery' ], 54 '6.2. 0',54 '6.2.1', 55 55 true 56 56 ); … … 60 60 get_asset_path( 'wallets-admin-cs-tool' ), 61 61 [ 'jquery-qrcode' ], 62 '6.2. 0',62 '6.2.1', 63 63 true 64 64 ); … … 75 75 get_asset_path( 'wallets-admin-capabilities' ), 76 76 [ 'jquery-ui-tabs' ], 77 '6.2. 0',77 '6.2.1', 78 78 true 79 79 ); … … 83 83 get_asset_path( 'wallets-admin-dashboard' ), 84 84 [ 'jquery-ui-tabs', 'jqcloud' ], 85 '6.2. 0',85 '6.2.1', 86 86 true 87 87 ); … … 91 91 get_asset_path( 'wallets-admin-docs' ), 92 92 [ 'jquery' ], 93 '6.2. 0',93 '6.2.1', 94 94 true 95 95 ); … … 99 99 get_asset_path( 'wallets-admin-editor' ), 100 100 [ 'suggest' ], 101 '6.2. 0',101 '6.2.1', 102 102 true 103 103 ); -
wallets/trunk/admin/dashboard.php
r2996338 r3015422 349 349 global $wpdb; 350 350 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'; 353 353 $debug_data[ (string) __( 'Web Server', 'wallets' ) ] = $_SERVER['SERVER_SOFTWARE']; 354 354 $debug_data[ (string) __( 'PHP version', 'wallets' ) ] = PHP_VERSION; -
wallets/trunk/apis/wp-rest.php
r2956686 r3015422 1148 1148 register_rest_route( 1149 1149 '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', 1150 1208 '/users/(?P<user_id>\d+)/currencies/(?P<currency_id>\d+)/addresses', 1151 1209 [ -
wallets/trunk/docs/developer.md
r2912451 r3015422 437 437 438 438 Allows 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 451 Retrieves an existing address. The address is specified by its post ID and must correspond to the specified user. 439 452 440 453 -
wallets/trunk/frontend/assets.php
r2996338 r3015422 23 23 get_asset_path( 'wallets', 'style' ), 24 24 [], 25 '6.2. 0'25 '6.2.1' 26 26 ); 27 27 … … 86 86 get_asset_path( 'jsqrcode' ), 87 87 [ 'jquery' ], 88 '6.2. 0',88 '6.2.1', 89 89 true 90 90 ); … … 128 128 get_asset_path( 'wallets-front' ), 129 129 [ 'knockout', 'jquery', 'style-scoped', 'sprintf.js' ], 130 '6.2. 0',130 '6.2.1', 131 131 true 132 132 ); -
wallets/trunk/post-types/class-currency.php
r2996338 r3015422 1252 1252 'the exchange rate (current value) of this currency against other currencies. ' . 1253 1253 '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).', 1255 1255 'wallets' 1256 1256 ); ?></p> … … 1351 1351 1352 1352 <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> 1354 1354 1355 1355 <input 1356 1356 id="wallets-currency-contract-address" 1357 1357 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' ); ?>" 1359 1359 type="text" 1360 1360 pattern="^(0x)?[0-9A-Fa-f]{8,}" … … 1362 1362 1363 1363 <p class="description"><?php esc_html_e( 1364 'Enter here the contract address or asset_id uniquely identifying this EVM token or Taprootasset. ' .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 the re 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 ' . 1369 1369 'the contract address will be filled in automatically for you from CoinGecko. ', 1370 1370 'wallets' -
wallets/trunk/post-types/class-wallet.php
r2973854 r3015422 548 548 $wallet = $meta_box['args']; 549 549 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 } 551 564 } 552 565 -
wallets/trunk/readme.txt
r2996338 r3015422 4 4 Tags: wallet, bitcoin, cryptocurrency, altcoin, coin, money, e-money, e-cash, deposit, withdraw, account, API 5 5 Requires at least: 5.0 6 Tested up to: 6.4. 16 Tested up to: 6.4.2 7 7 Requires PHP: 5.6 8 Stable tag: 6.2. 08 Stable tag: 6.2.1 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 30 30 The following wallet adapters are available for free to all [dashed-slug subscribers](https://www.dashed-slug.net/dashed-slug/subscribe/). 31 31 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. 32 33 - [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. 33 34 - [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. … … 336 337 337 338 == 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. 338 345 339 346 = 6.2.0 = … … 1533 1540 == Upgrade Notice == 1534 1541 1535 Version `6.2 ` brings a few minor improvements to the plugin. See the changelog for details.1542 Version `6.2.1` includes a bug fix and some changes necessary for the upcoming taproot assets adapter. See the changelog for details. 1536 1543 1537 1544 == Donating == -
wallets/trunk/wallets.php
r2996338 r3015422 3 3 * Plugin Name: Bitcoin and Altcoin Wallets 4 4 * Description: Custodial cryptocurrency wallets. 5 * Version: 6.2. 05 * Version: 6.2.1 6 6 * Plugin URI: https://www.dashed-slug.net/bitcoin-altcoin-wallets-wordpress-plugin 7 7 * Requires at least: 5.0
Note: See TracChangeset
for help on using the changeset viewer.