Skip to content

Commit

Permalink
v2.11.7: fixes some minor wallet connectivity issues
Browse files Browse the repository at this point in the history
  • Loading branch information
0xNe0x1 committed Aug 25, 2024
1 parent c842dec commit a880052
Show file tree
Hide file tree
Showing 10 changed files with 91 additions and 76 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

![Web3 Payments for WooCommerce](/.wordpress-org/screenshot-2.gif)

Web3 Payments directly into your own wallet. Accept thousands of different tokens with on-the-fly conversion on multiple blockchains.
Accept Web3 payments, supporting various cryptocurrency tokens, blockchains and wallets, with the DePay Payments extension for WooCommerce. MetaMask, Phantom, USDC, USDT, ETH, SOL, BSC, POL, xDAI…

### Demo

Expand Down
3 changes: 3 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
*** DePay Web3 Payments for WooCommerce Changelog ***

2024-8-25 - version 2.11.7
* fixes some minor wallet connectivity issues

2024-8-13 - version 2.11.6
* fixes edge-case routing issues with low-liquidity tokens on Uniswap v3

Expand Down
6 changes: 3 additions & 3 deletions depay-woocommerce-payments.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Plugin Name: DePay Payments for WooCommerce
* Plugin URI: https://depay.com/plugins/woocommerce
* Description: Web3 Payments directly into your own wallet. Accept thousands of different tokens with on-the-fly conversion on multiple blockchains.
* Description: Accept Web3 payments, supporting various cryptocurrency tokens, blockchains and wallets, with the DePay Payments extension for WooCommerce. MetaMask, Phantom, USDC, USDT, ETH, SOL, BSC, POL, xDAI…
* Author: DePay
* Author URI: https://depay.com
* Text Domain: depay-payments
Expand All @@ -11,7 +11,7 @@
* WC tested up to: 8.7.0
* Requires at least: 5.8
* Requires PHP: 7.0
* Version: 2.11.6
* Version: 2.11.7
*
* @package DePay\Payments
*/
Expand All @@ -21,7 +21,7 @@
define( 'DEPAY_WC_PLUGIN_FILE', __FILE__ );
define( 'DEPAY_WC_ABSPATH', __DIR__ . '/' );
define( 'DEPAY_MIN_WC_ADMIN_VERSION', '0.23.2' );
define( 'DEPAY_CURRENT_VERSION', '2.11.6' );
define( 'DEPAY_CURRENT_VERSION', '2.11.7' );

require_once DEPAY_WC_ABSPATH . '/vendor/autoload.php';

Expand Down
3 changes: 1 addition & 2 deletions dist/web3-blockchains.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

80 changes: 47 additions & 33 deletions dist/web3-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
return getWindow()._Web3ClientConfiguration
};

function _optionalChain$3(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
function _optionalChain$5(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
const BATCH_INTERVAL$1 = 10;
const CHUNK_SIZE$1 = 99;
const MAX_RETRY$1 = 3;
const MAX_RETRY$1 = 5;

class StaticJsonRpcBatchProvider extends ethers.ethers.providers.JsonRpcProvider {

Expand Down Expand Up @@ -63,12 +63,12 @@
// on whether it was a success or error
chunk.forEach((inflightRequest, index) => {
const payload = result[index];
if (_optionalChain$3([payload, 'optionalAccess', _ => _.error])) {
if (_optionalChain$5([payload, 'optionalAccess', _ => _.error])) {
const error = new Error(payload.error.message);
error.code = payload.error.code;
error.data = payload.error.data;
inflightRequest.reject(error);
} else if(_optionalChain$3([payload, 'optionalAccess', _2 => _2.result])) {
} else if(_optionalChain$5([payload, 'optionalAccess', _2 => _2.result])) {
inflightRequest.resolve(payload.result);
} else {
inflightRequest.reject();
Expand Down Expand Up @@ -143,6 +143,7 @@

}

function _optionalChain$4(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
const getAllProviders$1 = ()=> {
if(getWindow()._Web3ClientProviders == undefined) {
getWindow()._Web3ClientProviders = {};
Expand Down Expand Up @@ -188,17 +189,20 @@
let timeout = 900;
let before = new Date().getTime();
setTimeout(()=>resolve(timeout), timeout);
const response = await fetch(endpoint, {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
referrer: "",
referrerPolicy: "no-referrer",
body: JSON.stringify({ method: 'net_version', id: 1, jsonrpc: '2.0' })
});
if(!response.ok) { return resolve(999) }
let response;
try {
response = await fetch(endpoint, {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
referrer: "",
referrerPolicy: "no-referrer",
body: JSON.stringify({ method: 'net_version', id: 1, jsonrpc: '2.0' })
});
} catch (e) {}
if(!_optionalChain$4([response, 'optionalAccess', _ => _.ok])) { return resolve(999) }
let after = new Date().getTime();
resolve(after-before);
})
Expand Down Expand Up @@ -253,10 +257,10 @@
setProvider: setProvider$2,
};

function _optionalChain$2(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
function _optionalChain$3(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
const BATCH_INTERVAL = 10;
const CHUNK_SIZE = 99;
const MAX_RETRY = 3;
const MAX_RETRY = 10;

class StaticJsonRpcSequentialProvider extends solanaWeb3_js.Connection {

Expand All @@ -272,9 +276,7 @@
}

handleError(error, attempt, chunk) {
if(attempt < MAX_RETRY && error && [
'Failed to fetch', 'limit reached', '504', '503', '502', '500', '429', '426', '422', '413', '409', '408', '406', '405', '404', '403', '402', '401', '400'
].some((errorType)=>error.toString().match(errorType))) {
if(attempt < MAX_RETRY) {
const index = this._endpoints.indexOf(this._endpoint)+1;
this._endpoint = index >= this._endpoints.length ? this._endpoints[0] : this._endpoints[index];
this._provider = new solanaWeb3_js.Connection(this._endpoint);
Expand Down Expand Up @@ -304,7 +306,15 @@
).then((response)=>{
if(response.ok) {
response.json().then((parsedJson)=>{
resolve(parsedJson);
if(parsedJson.find((entry)=>_optionalChain$3([entry, 'optionalAccess', _ => _.error]))) {
if(attempt < MAX_RETRY) {
reject('Error in batch found!');
} else {
resolve(parsedJson);
}
} else {
resolve(parsedJson);
}
}).catch(reject);
} else {
reject(`${response.status} ${response.text}`);
Expand All @@ -322,7 +332,7 @@
.then((result) => {
chunk.forEach((inflightRequest, index) => {
const payload = result[index];
if (_optionalChain$2([payload, 'optionalAccess', _ => _.error])) {
if (_optionalChain$3([payload, 'optionalAccess', _2 => _2.error])) {
const error = new Error(payload.error.message);
error.code = payload.error.code;
error.data = payload.error.data;
Expand Down Expand Up @@ -379,6 +389,7 @@
}
}

function _optionalChain$2(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
const getAllProviders = ()=> {
if(getWindow()._Web3ClientProviders == undefined) {
getWindow()._Web3ClientProviders = {};
Expand Down Expand Up @@ -424,17 +435,20 @@
let timeout = 900;
let before = new Date().getTime();
setTimeout(()=>resolve(timeout), timeout);
const response = await fetch(endpoint, {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
referrer: "",
referrerPolicy: "no-referrer",
body: JSON.stringify({ method: 'getIdentity', id: 1, jsonrpc: '2.0' })
});
if(!response.ok) { return resolve(999) }
let response;
try {
response = await fetch(endpoint, {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
referrer: "",
referrerPolicy: "no-referrer",
body: JSON.stringify({ method: 'getIdentity', id: 1, jsonrpc: '2.0' })
});
} catch (e) {}
if(!_optionalChain$2([response, 'optionalAccess', _ => _.ok])) { return resolve(999) }
let after = new Date().getTime();
resolve(after-before);
})
Expand Down
30 changes: 15 additions & 15 deletions dist/widgets.bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion languages/depay-woocommerce-payments.pot
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This file is distributed under the same license as the package.
msgid ""
msgstr ""
"Project-Id-Version: DePay WooCommerce Payments 2.11.6\n"
"Project-Id-Version: DePay WooCommerce Payments 2.11.7\n"
"Report-Msgid-Bugs-To: "
"[email protected]\n"
"MIME-Version: 1.0\n"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@depay/web3-woocommerce-depay-payments",
"moduleName": "WooCommerceDePayPayments",
"version": "2.11.6",
"version": "2.11.7",
"description": "WooCommerce DePay plugin to accept Web3 payments directly into your wallet with on-the-fly conversion.",
"main": "./dist/umd/index.js",
"module": "./dist/esm/index.js",
Expand Down
7 changes: 3 additions & 4 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ Tags: web3, payments, woocommerce, depay, cryptocurrency
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.2
Stable tag: 2.11.6
Stable tag: 2.11.7
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Accept Web3 payments, including thousands of cryptocurrency tokens, with the DePay Payments extension for WooCommerce.
Accept Web3 payments, supporting various cryptocurrency tokens, blockchains and wallets, with the DePay Payments extension for WooCommerce. MetaMask, Phantom, USDC, USDT, ETH, SOL, BSC, POL, xDAI…

== Simple Web3 Cryptocurrency Payments with DePay ==

Accept thousands of different tokens on multiple blockchains with on-the-fly conversion. Process cryptocurrency payments directly on your WooCommerce store and receive them directly into your crypto wallet.
Accept Web3 payments, supporting various cryptocurrency tokens, blockchains and wallets, with the DePay Payments extension for WooCommerce. MetaMask, Phantom, USDC, USDT, ETH, SOL, BSC, POL, xDAI…

[youtube https://www.youtube.com/watch?v=j8Vx0Rrx07E]

Expand Down Expand Up @@ -55,7 +55,6 @@ All* standard tokens.
* Peer-to-peer: Payments are made directly into your cryptocurrency wallet. No intermediary holds your funds at any time.
* No hassle: Payments settle immediately; no fraud and no chargebacks.


== Select DePay as the payment choice during checkout ==

* Get started for free: Pay-as-you-go fees per transaction (1.5%). No monthly or setup fees.
Expand Down
32 changes: 16 additions & 16 deletions src/widgets.bundle.js

Large diffs are not rendered by default.

0 comments on commit a880052

Please sign in to comment.