@depay/widgets 6.6.0 → 6.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/dist/esm/index.bundle.js +10 -9
- package/dist/esm/index.js +10 -9
- package/dist/umd/index.bundle.js +10 -9
- package/dist/umd/index.js +10 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -199,7 +199,8 @@ BODY:
|
|
|
199
199
|
"transaction": "0x4311a9820195c2a5af99c45c72c88848ed403a4020863c913feed81d15855ae4",
|
|
200
200
|
"sender": "0x769794c94e9f113e357023dab73e81dbd6db201c",
|
|
201
201
|
"nonce": 103,
|
|
202
|
-
"after_block": 13230369
|
|
202
|
+
"after_block": 13230369,
|
|
203
|
+
"to_token": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"
|
|
203
204
|
}
|
|
204
205
|
```
|
|
205
206
|
|
|
@@ -212,7 +213,7 @@ Make sure you read the [Payment Tracking API](https://depay.fi/documentation/api
|
|
|
212
213
|
|
|
213
214
|
Payment tracking requests will be attempted up to 3 times by the widget and will display "Payment tracking failed!" to the user if the widget was not able to start payment tracking via the given endpoint after 3 attempts.
|
|
214
215
|
|
|
215
|
-
A failed payment tracking will also call the [error callback](#
|
|
216
|
+
A failed payment tracking will also call the [error callback](#error) with `{code: "TRACKING_FAILED"}`.
|
|
216
217
|
|
|
217
218
|
#### connected
|
|
218
219
|
|
package/dist/esm/index.bundle.js
CHANGED
|
@@ -62487,7 +62487,7 @@ var PaymentProvider = (function (props) {
|
|
|
62487
62487
|
}
|
|
62488
62488
|
})).then(function (sentTransaction) {
|
|
62489
62489
|
if (tracking) {
|
|
62490
|
-
initializeTracking(sentTransaction, currentBlock);
|
|
62490
|
+
initializeTracking(sentTransaction, currentBlock, payment.route);
|
|
62491
62491
|
}
|
|
62492
62492
|
|
|
62493
62493
|
setTransaction(sentTransaction);
|
|
@@ -70238,13 +70238,13 @@ var TrackingProvider = (function (props) {
|
|
|
70238
70238
|
};
|
|
70239
70239
|
};
|
|
70240
70240
|
|
|
70241
|
-
var retryStartTracking = function retryStartTracking(transaction, afterBlock, attempt) {
|
|
70241
|
+
var retryStartTracking = function retryStartTracking(transaction, afterBlock, paymentRoute, attempt) {
|
|
70242
70242
|
attempt = parseInt(attempt || 1, 10);
|
|
70243
70243
|
console.log('RETRY TRACKING ATTEMPT ', attempt);
|
|
70244
70244
|
|
|
70245
70245
|
if (attempt < 3) {
|
|
70246
70246
|
setTimeout(function () {
|
|
70247
|
-
startTracking(transaction, afterBlock, attempt + 1);
|
|
70247
|
+
startTracking(transaction, afterBlock, paymentRoute, attempt + 1);
|
|
70248
70248
|
}, 3000);
|
|
70249
70249
|
} else {
|
|
70250
70250
|
console.log('TRACKING FAILED AFTER 3 ATTEMPTS!');
|
|
@@ -70258,7 +70258,7 @@ var TrackingProvider = (function (props) {
|
|
|
70258
70258
|
}
|
|
70259
70259
|
};
|
|
70260
70260
|
|
|
70261
|
-
var startTracking = function startTracking(transaction, afterBlock, attempt) {
|
|
70261
|
+
var startTracking = function startTracking(transaction, afterBlock, paymentRoute, attempt) {
|
|
70262
70262
|
fetch(track.endpoint, {
|
|
70263
70263
|
method: 'POST',
|
|
70264
70264
|
body: JSON.stringify({
|
|
@@ -70266,23 +70266,24 @@ var TrackingProvider = (function (props) {
|
|
|
70266
70266
|
transaction: transaction.id.toLowerCase(),
|
|
70267
70267
|
sender: transaction.from.toLowerCase(),
|
|
70268
70268
|
nonce: transaction.nonce,
|
|
70269
|
-
after_block: afterBlock
|
|
70269
|
+
after_block: afterBlock,
|
|
70270
|
+
to_token: paymentRoute.toToken.address
|
|
70270
70271
|
})
|
|
70271
70272
|
}).then(function (response) {
|
|
70272
70273
|
if (response.status == 200) {
|
|
70273
70274
|
console.log('TRACKING INITIALIZED');
|
|
70274
70275
|
} else {
|
|
70275
|
-
retryStartTracking(transaction, afterBlock, attempt);
|
|
70276
|
+
retryStartTracking(transaction, afterBlock, paymentRoute, attempt);
|
|
70276
70277
|
}
|
|
70277
70278
|
})["catch"](function (error) {
|
|
70278
70279
|
console.log('TRACKING FAILED', error);
|
|
70279
|
-
retryStartTracking(transaction, afterBlock, attempt);
|
|
70280
|
+
retryStartTracking(transaction, afterBlock, paymentRoute, attempt);
|
|
70280
70281
|
});
|
|
70281
70282
|
};
|
|
70282
70283
|
|
|
70283
|
-
var initializeTracking = function initializeTracking(transaction, afterBlock) {
|
|
70284
|
+
var initializeTracking = function initializeTracking(transaction, afterBlock, paymentRoute) {
|
|
70284
70285
|
openSocket(transaction);
|
|
70285
|
-
startTracking(transaction, afterBlock);
|
|
70286
|
+
startTracking(transaction, afterBlock, paymentRoute);
|
|
70286
70287
|
};
|
|
70287
70288
|
|
|
70288
70289
|
return /*#__PURE__*/react.createElement(TrackingContext.Provider, {
|
package/dist/esm/index.js
CHANGED
|
@@ -2334,7 +2334,7 @@ var PaymentProvider = (function (props) {
|
|
|
2334
2334
|
}
|
|
2335
2335
|
})).then(function (sentTransaction) {
|
|
2336
2336
|
if (tracking) {
|
|
2337
|
-
initializeTracking(sentTransaction, currentBlock);
|
|
2337
|
+
initializeTracking(sentTransaction, currentBlock, payment.route);
|
|
2338
2338
|
}
|
|
2339
2339
|
|
|
2340
2340
|
setTransaction(sentTransaction);
|
|
@@ -3615,13 +3615,13 @@ var TrackingProvider = (function (props) {
|
|
|
3615
3615
|
};
|
|
3616
3616
|
};
|
|
3617
3617
|
|
|
3618
|
-
var retryStartTracking = function retryStartTracking(transaction, afterBlock, attempt) {
|
|
3618
|
+
var retryStartTracking = function retryStartTracking(transaction, afterBlock, paymentRoute, attempt) {
|
|
3619
3619
|
attempt = parseInt(attempt || 1, 10);
|
|
3620
3620
|
console.log('RETRY TRACKING ATTEMPT ', attempt);
|
|
3621
3621
|
|
|
3622
3622
|
if (attempt < 3) {
|
|
3623
3623
|
setTimeout(function () {
|
|
3624
|
-
startTracking(transaction, afterBlock, attempt + 1);
|
|
3624
|
+
startTracking(transaction, afterBlock, paymentRoute, attempt + 1);
|
|
3625
3625
|
}, 3000);
|
|
3626
3626
|
} else {
|
|
3627
3627
|
console.log('TRACKING FAILED AFTER 3 ATTEMPTS!');
|
|
@@ -3635,7 +3635,7 @@ var TrackingProvider = (function (props) {
|
|
|
3635
3635
|
}
|
|
3636
3636
|
};
|
|
3637
3637
|
|
|
3638
|
-
var startTracking = function startTracking(transaction, afterBlock, attempt) {
|
|
3638
|
+
var startTracking = function startTracking(transaction, afterBlock, paymentRoute, attempt) {
|
|
3639
3639
|
fetch(track.endpoint, {
|
|
3640
3640
|
method: 'POST',
|
|
3641
3641
|
body: JSON.stringify({
|
|
@@ -3643,23 +3643,24 @@ var TrackingProvider = (function (props) {
|
|
|
3643
3643
|
transaction: transaction.id.toLowerCase(),
|
|
3644
3644
|
sender: transaction.from.toLowerCase(),
|
|
3645
3645
|
nonce: transaction.nonce,
|
|
3646
|
-
after_block: afterBlock
|
|
3646
|
+
after_block: afterBlock,
|
|
3647
|
+
to_token: paymentRoute.toToken.address
|
|
3647
3648
|
})
|
|
3648
3649
|
}).then(function (response) {
|
|
3649
3650
|
if (response.status == 200) {
|
|
3650
3651
|
console.log('TRACKING INITIALIZED');
|
|
3651
3652
|
} else {
|
|
3652
|
-
retryStartTracking(transaction, afterBlock, attempt);
|
|
3653
|
+
retryStartTracking(transaction, afterBlock, paymentRoute, attempt);
|
|
3653
3654
|
}
|
|
3654
3655
|
})["catch"](function (error) {
|
|
3655
3656
|
console.log('TRACKING FAILED', error);
|
|
3656
|
-
retryStartTracking(transaction, afterBlock, attempt);
|
|
3657
|
+
retryStartTracking(transaction, afterBlock, paymentRoute, attempt);
|
|
3657
3658
|
});
|
|
3658
3659
|
};
|
|
3659
3660
|
|
|
3660
|
-
var initializeTracking = function initializeTracking(transaction, afterBlock) {
|
|
3661
|
+
var initializeTracking = function initializeTracking(transaction, afterBlock, paymentRoute) {
|
|
3661
3662
|
openSocket(transaction);
|
|
3662
|
-
startTracking(transaction, afterBlock);
|
|
3663
|
+
startTracking(transaction, afterBlock, paymentRoute);
|
|
3663
3664
|
};
|
|
3664
3665
|
|
|
3665
3666
|
return /*#__PURE__*/React.createElement(TrackingContext.Provider, {
|
package/dist/umd/index.bundle.js
CHANGED
|
@@ -62493,7 +62493,7 @@
|
|
|
62493
62493
|
}
|
|
62494
62494
|
})).then(function (sentTransaction) {
|
|
62495
62495
|
if (tracking) {
|
|
62496
|
-
initializeTracking(sentTransaction, currentBlock);
|
|
62496
|
+
initializeTracking(sentTransaction, currentBlock, payment.route);
|
|
62497
62497
|
}
|
|
62498
62498
|
|
|
62499
62499
|
setTransaction(sentTransaction);
|
|
@@ -70244,13 +70244,13 @@
|
|
|
70244
70244
|
};
|
|
70245
70245
|
};
|
|
70246
70246
|
|
|
70247
|
-
var retryStartTracking = function retryStartTracking(transaction, afterBlock, attempt) {
|
|
70247
|
+
var retryStartTracking = function retryStartTracking(transaction, afterBlock, paymentRoute, attempt) {
|
|
70248
70248
|
attempt = parseInt(attempt || 1, 10);
|
|
70249
70249
|
console.log('RETRY TRACKING ATTEMPT ', attempt);
|
|
70250
70250
|
|
|
70251
70251
|
if (attempt < 3) {
|
|
70252
70252
|
setTimeout(function () {
|
|
70253
|
-
startTracking(transaction, afterBlock, attempt + 1);
|
|
70253
|
+
startTracking(transaction, afterBlock, paymentRoute, attempt + 1);
|
|
70254
70254
|
}, 3000);
|
|
70255
70255
|
} else {
|
|
70256
70256
|
console.log('TRACKING FAILED AFTER 3 ATTEMPTS!');
|
|
@@ -70264,7 +70264,7 @@
|
|
|
70264
70264
|
}
|
|
70265
70265
|
};
|
|
70266
70266
|
|
|
70267
|
-
var startTracking = function startTracking(transaction, afterBlock, attempt) {
|
|
70267
|
+
var startTracking = function startTracking(transaction, afterBlock, paymentRoute, attempt) {
|
|
70268
70268
|
fetch(track.endpoint, {
|
|
70269
70269
|
method: 'POST',
|
|
70270
70270
|
body: JSON.stringify({
|
|
@@ -70272,23 +70272,24 @@
|
|
|
70272
70272
|
transaction: transaction.id.toLowerCase(),
|
|
70273
70273
|
sender: transaction.from.toLowerCase(),
|
|
70274
70274
|
nonce: transaction.nonce,
|
|
70275
|
-
after_block: afterBlock
|
|
70275
|
+
after_block: afterBlock,
|
|
70276
|
+
to_token: paymentRoute.toToken.address
|
|
70276
70277
|
})
|
|
70277
70278
|
}).then(function (response) {
|
|
70278
70279
|
if (response.status == 200) {
|
|
70279
70280
|
console.log('TRACKING INITIALIZED');
|
|
70280
70281
|
} else {
|
|
70281
|
-
retryStartTracking(transaction, afterBlock, attempt);
|
|
70282
|
+
retryStartTracking(transaction, afterBlock, paymentRoute, attempt);
|
|
70282
70283
|
}
|
|
70283
70284
|
})["catch"](function (error) {
|
|
70284
70285
|
console.log('TRACKING FAILED', error);
|
|
70285
|
-
retryStartTracking(transaction, afterBlock, attempt);
|
|
70286
|
+
retryStartTracking(transaction, afterBlock, paymentRoute, attempt);
|
|
70286
70287
|
});
|
|
70287
70288
|
};
|
|
70288
70289
|
|
|
70289
|
-
var initializeTracking = function initializeTracking(transaction, afterBlock) {
|
|
70290
|
+
var initializeTracking = function initializeTracking(transaction, afterBlock, paymentRoute) {
|
|
70290
70291
|
openSocket(transaction);
|
|
70291
|
-
startTracking(transaction, afterBlock);
|
|
70292
|
+
startTracking(transaction, afterBlock, paymentRoute);
|
|
70292
70293
|
};
|
|
70293
70294
|
|
|
70294
70295
|
return /*#__PURE__*/react.createElement(TrackingContext.Provider, {
|
package/dist/umd/index.js
CHANGED
|
@@ -2329,7 +2329,7 @@
|
|
|
2329
2329
|
}
|
|
2330
2330
|
})).then(function (sentTransaction) {
|
|
2331
2331
|
if (tracking) {
|
|
2332
|
-
initializeTracking(sentTransaction, currentBlock);
|
|
2332
|
+
initializeTracking(sentTransaction, currentBlock, payment.route);
|
|
2333
2333
|
}
|
|
2334
2334
|
|
|
2335
2335
|
setTransaction(sentTransaction);
|
|
@@ -3610,13 +3610,13 @@
|
|
|
3610
3610
|
};
|
|
3611
3611
|
};
|
|
3612
3612
|
|
|
3613
|
-
var retryStartTracking = function retryStartTracking(transaction, afterBlock, attempt) {
|
|
3613
|
+
var retryStartTracking = function retryStartTracking(transaction, afterBlock, paymentRoute, attempt) {
|
|
3614
3614
|
attempt = parseInt(attempt || 1, 10);
|
|
3615
3615
|
console.log('RETRY TRACKING ATTEMPT ', attempt);
|
|
3616
3616
|
|
|
3617
3617
|
if (attempt < 3) {
|
|
3618
3618
|
setTimeout(function () {
|
|
3619
|
-
startTracking(transaction, afterBlock, attempt + 1);
|
|
3619
|
+
startTracking(transaction, afterBlock, paymentRoute, attempt + 1);
|
|
3620
3620
|
}, 3000);
|
|
3621
3621
|
} else {
|
|
3622
3622
|
console.log('TRACKING FAILED AFTER 3 ATTEMPTS!');
|
|
@@ -3630,7 +3630,7 @@
|
|
|
3630
3630
|
}
|
|
3631
3631
|
};
|
|
3632
3632
|
|
|
3633
|
-
var startTracking = function startTracking(transaction, afterBlock, attempt) {
|
|
3633
|
+
var startTracking = function startTracking(transaction, afterBlock, paymentRoute, attempt) {
|
|
3634
3634
|
fetch(track.endpoint, {
|
|
3635
3635
|
method: 'POST',
|
|
3636
3636
|
body: JSON.stringify({
|
|
@@ -3638,23 +3638,24 @@
|
|
|
3638
3638
|
transaction: transaction.id.toLowerCase(),
|
|
3639
3639
|
sender: transaction.from.toLowerCase(),
|
|
3640
3640
|
nonce: transaction.nonce,
|
|
3641
|
-
after_block: afterBlock
|
|
3641
|
+
after_block: afterBlock,
|
|
3642
|
+
to_token: paymentRoute.toToken.address
|
|
3642
3643
|
})
|
|
3643
3644
|
}).then(function (response) {
|
|
3644
3645
|
if (response.status == 200) {
|
|
3645
3646
|
console.log('TRACKING INITIALIZED');
|
|
3646
3647
|
} else {
|
|
3647
|
-
retryStartTracking(transaction, afterBlock, attempt);
|
|
3648
|
+
retryStartTracking(transaction, afterBlock, paymentRoute, attempt);
|
|
3648
3649
|
}
|
|
3649
3650
|
})["catch"](function (error) {
|
|
3650
3651
|
console.log('TRACKING FAILED', error);
|
|
3651
|
-
retryStartTracking(transaction, afterBlock, attempt);
|
|
3652
|
+
retryStartTracking(transaction, afterBlock, paymentRoute, attempt);
|
|
3652
3653
|
});
|
|
3653
3654
|
};
|
|
3654
3655
|
|
|
3655
|
-
var initializeTracking = function initializeTracking(transaction, afterBlock) {
|
|
3656
|
+
var initializeTracking = function initializeTracking(transaction, afterBlock, paymentRoute) {
|
|
3656
3657
|
openSocket(transaction);
|
|
3657
|
-
startTracking(transaction, afterBlock);
|
|
3658
|
+
startTracking(transaction, afterBlock, paymentRoute);
|
|
3658
3659
|
};
|
|
3659
3660
|
|
|
3660
3661
|
return /*#__PURE__*/React__default["default"].createElement(TrackingContext.Provider, {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depay/widgets",
|
|
3
3
|
"moduleName": "DePayWidgets",
|
|
4
|
-
"version": "6.
|
|
4
|
+
"version": "6.7.0",
|
|
5
5
|
"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.",
|
|
6
6
|
"main": "./dist/umd/index.js",
|
|
7
7
|
"module": "./dist/esm/index.js",
|