Skip to content

Commit

Permalink
v12.10.8: fix some tracking edge-cases
Browse files Browse the repository at this point in the history
  • Loading branch information
0xNe0x1 committed Jun 14, 2024
1 parent 558da1c commit a3aba29
Show file tree
Hide file tree
Showing 19 changed files with 36 additions and 23 deletions.
16 changes: 11 additions & 5 deletions dev.html
Original file line number Diff line number Diff line change
Expand Up @@ -696,17 +696,23 @@ <h5 class="px-4">Payment: with tracking/validation</h5>
button.addEventListener("click",function(e){
DePayWidgets.Payment({
accept: [{
blockchain: 'ethereum',
amount: 0.1,
token: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
receiver: '0x317D875cA3B9f8d14f960486C0d1D1913be74e90'
blockchain: 'polygon',
amount: 0.01,
token: '0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359',
receiver: '0x08B277154218CCF3380CAE48d630DA13462E3950'
}],
track: {
method: (payment)=>{
console.log('TRACK', payment)
return axios.post('/track', payment)
},
poll: {
method: (data)=>{
console.log('POLL', data)
return new Promise((resolve)=>resolve)
}
}
}
},
});
});
</script>
Expand Down
2 changes: 1 addition & 1 deletion dist/esm/index.bundle.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion dist/esm/index.evm.js
Original file line number Diff line number Diff line change
Expand Up @@ -28493,7 +28493,7 @@ var PaymentTrackingProvider = (function (props) {
case 0:
_context.t0 = JSON;
_context.t1 = transaction.blockchain;
_context.t2 = transaction.from;
_context.t2 = transaction.from || account;
_context.next = 5;
return getNonce({
transaction: transaction,
Expand Down Expand Up @@ -28974,6 +28974,7 @@ var PaymentTrackingProvider = (function (props) {
return Promise.resolve();
}

openSocket(transaction);
return new Promise( /*#__PURE__*/function () {
var _ref6 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee6(resolve, reject) {
var _paymentRoute$feeAmou2;
Expand Down
2 changes: 1 addition & 1 deletion dist/esm/index.evm.js.map

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion dist/esm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28506,7 +28506,7 @@ var PaymentTrackingProvider = (function (props) {
case 0:
_context.t0 = JSON;
_context.t1 = transaction.blockchain;
_context.t2 = transaction.from;
_context.t2 = transaction.from || account;
_context.next = 5;
return getNonce({
transaction: transaction,
Expand Down Expand Up @@ -28987,6 +28987,7 @@ var PaymentTrackingProvider = (function (props) {
return Promise.resolve();
}

openSocket(transaction);
return new Promise( /*#__PURE__*/function () {
var _ref6 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee6(resolve, reject) {
var _paymentRoute$feeAmou2;
Expand Down
2 changes: 1 addition & 1 deletion dist/esm/index.js.map

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion dist/esm/index.solana.js
Original file line number Diff line number Diff line change
Expand Up @@ -28544,7 +28544,7 @@ var PaymentTrackingProvider = (function (props) {
case 0:
_context.t0 = JSON;
_context.t1 = transaction.blockchain;
_context.t2 = transaction.from;
_context.t2 = transaction.from || account;
_context.next = 5;
return getNonce({
transaction: transaction,
Expand Down Expand Up @@ -29025,6 +29025,7 @@ var PaymentTrackingProvider = (function (props) {
return Promise.resolve();
}

openSocket(transaction);
return new Promise( /*#__PURE__*/function () {
var _ref6 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee6(resolve, reject) {
var _paymentRoute$feeAmou2;
Expand Down
2 changes: 1 addition & 1 deletion dist/esm/index.solana.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/umd/index.bundle.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion dist/umd/index.evm.js
Original file line number Diff line number Diff line change
Expand Up @@ -28491,7 +28491,7 @@
case 0:
_context.t0 = JSON;
_context.t1 = transaction.blockchain;
_context.t2 = transaction.from;
_context.t2 = transaction.from || account;
_context.next = 5;
return getNonce({
transaction: transaction,
Expand Down Expand Up @@ -28972,6 +28972,7 @@
return Promise.resolve();
}

openSocket(transaction);
return new Promise( /*#__PURE__*/function () {
var _ref6 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee6(resolve, reject) {
var _paymentRoute$feeAmou2;
Expand Down
2 changes: 1 addition & 1 deletion dist/umd/index.evm.js.map

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion dist/umd/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28502,7 +28502,7 @@
case 0:
_context.t0 = JSON;
_context.t1 = transaction.blockchain;
_context.t2 = transaction.from;
_context.t2 = transaction.from || account;
_context.next = 5;
return getNonce({
transaction: transaction,
Expand Down Expand Up @@ -28983,6 +28983,7 @@
return Promise.resolve();
}

openSocket(transaction);
return new Promise( /*#__PURE__*/function () {
var _ref6 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee6(resolve, reject) {
var _paymentRoute$feeAmou2;
Expand Down
2 changes: 1 addition & 1 deletion dist/umd/index.js.map

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion dist/umd/index.solana.js
Original file line number Diff line number Diff line change
Expand Up @@ -28542,7 +28542,7 @@
case 0:
_context.t0 = JSON;
_context.t1 = transaction.blockchain;
_context.t2 = transaction.from;
_context.t2 = transaction.from || account;
_context.next = 5;
return getNonce({
transaction: transaction,
Expand Down Expand Up @@ -29023,6 +29023,7 @@
return Promise.resolve();
}

openSocket(transaction);
return new Promise( /*#__PURE__*/function () {
var _ref6 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee6(resolve, reject) {
var _paymentRoute$feeAmou2;
Expand Down
2 changes: 1 addition & 1 deletion dist/umd/index.solana.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.evm.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@depay/widgets-evm",
"moduleName": "DePayWidgets",
"version": "12.10.7",
"version": "12.10.8",
"description": "Web3 Payments with any token. DePay simplifies and improves Web3 Payments with the power of DeFi. Accept any token with on-the-fly conversion.",
"main": "./dist/umd/index.js",
"module": "./dist/esm/index.js",
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/widgets",
"moduleName": "DePayWidgets",
"version": "12.10.7",
"version": "12.10.8",
"description": "Web3 Payments with any token. DePay simplifies and improves Web3 Payments with the power of DeFi. Accept any token with on-the-fly conversion.",
"main": "./dist/umd/index.js",
"module": "./dist/esm/index.js",
Expand Down
2 changes: 1 addition & 1 deletion package.solana.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@depay/widgets-solana",
"moduleName": "DePayWidgets",
"version": "12.10.7",
"version": "12.10.8",
"description": "Web3 Payments with any token. DePay simplifies and improves Web3 Payments with the power of DeFi. Accept any token with on-the-fly conversion.",
"main": "./dist/umd/index.js",
"module": "./dist/esm/index.js",
Expand Down
3 changes: 2 additions & 1 deletion src/providers/PaymentTrackingProvider.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default (props)=>{
command: 'subscribe',
identifier: JSON.stringify({
blockchain: transaction.blockchain,
sender: transaction.from,
sender: transaction.from || account,
nonce: await getNonce({ transaction, account, wallet }),
channel: 'PaymentChannel'
}),
Expand Down Expand Up @@ -311,6 +311,7 @@ export default (props)=>{
const trace = (afterBlock, paymentRoute, transaction, deadline)=>{
setAttemptId() // reset attemptId in case payment is retried
if(!synchronousTracking && !asynchronousTracking) { return Promise.resolve() }
openSocket(transaction)
return new Promise(async(resolve, reject)=>{
let performedPayment = {
blockchain: paymentRoute.blockchain,
Expand Down

0 comments on commit a3aba29

Please sign in to comment.