@depay/widgets 5.0.5 → 5.1.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 CHANGED
@@ -1298,7 +1298,7 @@ test:cypress:debug
1298
1298
  Test and debug single cypress file:
1299
1299
 
1300
1300
  ```
1301
- yarn test:cypress:debug --spec "cypress/integration/Payment/approve.js"
1301
+ yarn test:cypress:debug --spec "cypress/integration/Donation/overview.js"
1302
1302
  ```
1303
1303
 
1304
1304
  ### Release new versions to npm
@@ -65330,11 +65330,11 @@ class Currency {
65330
65330
 
65331
65331
  static async fromUSD({ amount, code, timeZone, apiKey }) {
65332
65332
  let currency = new Currency({ amount, code, timeZone });
65333
- let rate = await fetch('https://api.depay.pro/v1/fiat?symbol=' + currency.code, {
65333
+ let rate = await fetch('https://api.depay.fi/v2/currencies/' + currency.code, {
65334
65334
  headers: { 'X-Api-Key': apiKey },
65335
65335
  })
65336
65336
  .then((response) => response.json())
65337
- .then((data) => parseFloat(data.usd));
65337
+ .then((data) => parseFloat(data));
65338
65338
  currency.amount = currency.amount * rate;
65339
65339
  return currency
65340
65340
  }
@@ -65701,8 +65701,8 @@ const getAssets = async (options) => {
65701
65701
  let assets = Promise.all(
65702
65702
  (options.blockchain ? [options.blockchain] : wallet.blockchains).map((blockchain) =>{
65703
65703
 
65704
- return fetch('https://api.depay.pro/v1/assets?account=' + account + '&blockchain=' + blockchain, {
65705
- headers: { 'X-Api-Key': options.apiKey }
65704
+ return fetch(`https://api.depay.fi/v2/accounts/${blockchain}/${account}/assets`, {
65705
+ headers: { 'x-api-key': options.apiKey }
65706
65706
  })
65707
65707
  .then((response) => response.json())
65708
65708
  .then(async (assets) => {
@@ -70283,7 +70283,7 @@ let filterNotRoutable = (routes) => {
70283
70283
  })
70284
70284
  };
70285
70285
 
70286
- let filterInsufficientBalance = (routes) => {
70286
+ let filterInsufficientBalance = async(routes) => {
70287
70287
  return routes.filter((route) => {
70288
70288
  if (route.fromToken.address.toLowerCase() == route.toToken.address.toLowerCase()) {
70289
70289
  return BigNumber.from(route.fromBalance).gte(BigNumber.from(route.toAmount))
@@ -65328,11 +65328,11 @@ class Currency {
65328
65328
 
65329
65329
  static async fromUSD({ amount, code, timeZone, apiKey }) {
65330
65330
  let currency = new Currency({ amount, code, timeZone });
65331
- let rate = await fetch('https://api.depay.pro/v1/fiat?symbol=' + currency.code, {
65331
+ let rate = await fetch('https://api.depay.fi/v2/currencies/' + currency.code, {
65332
65332
  headers: { 'X-Api-Key': apiKey },
65333
65333
  })
65334
65334
  .then((response) => response.json())
65335
- .then((data) => parseFloat(data.usd));
65335
+ .then((data) => parseFloat(data));
65336
65336
  currency.amount = currency.amount * rate;
65337
65337
  return currency
65338
65338
  }
@@ -65699,8 +65699,8 @@ const getAssets = async (options) => {
65699
65699
  let assets = Promise.all(
65700
65700
  (options.blockchain ? [options.blockchain] : wallet.blockchains).map((blockchain) =>{
65701
65701
 
65702
- return fetch('https://api.depay.pro/v1/assets?account=' + account + '&blockchain=' + blockchain, {
65703
- headers: { 'X-Api-Key': options.apiKey }
65702
+ return fetch(`https://api.depay.fi/v2/accounts/${blockchain}/${account}/assets`, {
65703
+ headers: { 'x-api-key': options.apiKey }
65704
65704
  })
65705
65705
  .then((response) => response.json())
65706
65706
  .then(async (assets) => {
@@ -70281,7 +70281,7 @@ let filterNotRoutable = (routes) => {
70281
70281
  })
70282
70282
  };
70283
70283
 
70284
- let filterInsufficientBalance = (routes) => {
70284
+ let filterInsufficientBalance = async(routes) => {
70285
70285
  return routes.filter((route) => {
70286
70286
  if (route.fromToken.address.toLowerCase() == route.toToken.address.toLowerCase()) {
70287
70287
  return BigNumber.from(route.fromBalance).gte(BigNumber.from(route.toAmount))
@@ -65334,11 +65334,11 @@
65334
65334
 
65335
65335
  static async fromUSD({ amount, code, timeZone, apiKey }) {
65336
65336
  let currency = new Currency({ amount, code, timeZone });
65337
- let rate = await fetch('https://api.depay.pro/v1/fiat?symbol=' + currency.code, {
65337
+ let rate = await fetch('https://api.depay.fi/v2/currencies/' + currency.code, {
65338
65338
  headers: { 'X-Api-Key': apiKey },
65339
65339
  })
65340
65340
  .then((response) => response.json())
65341
- .then((data) => parseFloat(data.usd));
65341
+ .then((data) => parseFloat(data));
65342
65342
  currency.amount = currency.amount * rate;
65343
65343
  return currency
65344
65344
  }
@@ -65705,8 +65705,8 @@
65705
65705
  let assets = Promise.all(
65706
65706
  (options.blockchain ? [options.blockchain] : wallet.blockchains).map((blockchain) =>{
65707
65707
 
65708
- return fetch('https://api.depay.pro/v1/assets?account=' + account + '&blockchain=' + blockchain, {
65709
- headers: { 'X-Api-Key': options.apiKey }
65708
+ return fetch(`https://api.depay.fi/v2/accounts/${blockchain}/${account}/assets`, {
65709
+ headers: { 'x-api-key': options.apiKey }
65710
65710
  })
65711
65711
  .then((response) => response.json())
65712
65712
  .then(async (assets) => {
@@ -70287,7 +70287,7 @@
70287
70287
  })
70288
70288
  };
70289
70289
 
70290
- let filterInsufficientBalance = (routes) => {
70290
+ let filterInsufficientBalance = async(routes) => {
70291
70291
  return routes.filter((route) => {
70292
70292
  if (route.fromToken.address.toLowerCase() == route.toToken.address.toLowerCase()) {
70293
70293
  return BigNumber.from(route.fromBalance).gte(BigNumber.from(route.toAmount))
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@depay/widgets",
3
3
  "moduleName": "DePayWidgets",
4
- "version": "5.0.5",
4
+ "version": "5.1.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/cjs/index.js",
7
7
  "files": [
@@ -32,19 +32,19 @@
32
32
  "test": "yarn test:jest && yarn test:cypress"
33
33
  },
34
34
  "dependencies": {
35
- "@depay/local-currency": "=2.0.0",
35
+ "@depay/local-currency": "^2.1.0",
36
36
  "@depay/react-dialog-stack": "^3.0.1",
37
37
  "@depay/react-shadow-dom": "^3.0.0",
38
- "@depay/react-token-image": "^2.0.0",
39
- "@depay/walletconnect": "^2.0.0",
40
- "@depay/web3-assets": "^3.0.0",
38
+ "@depay/react-token-image": "^2.1.0",
39
+ "@depay/walletconnect-v1": "^1.0.17",
40
+ "@depay/web3-assets": "^4.0.2",
41
41
  "@depay/web3-blockchains": "^3.0.0",
42
42
  "@depay/web3-client": "^7.2.0",
43
43
  "@depay/web3-constants": "^4.0.1",
44
- "@depay/web3-exchanges": "^7.1.2",
45
- "@depay/web3-payments": "^7.0.2",
44
+ "@depay/web3-exchanges": "^7.1.4",
45
+ "@depay/web3-payments": "^8.0.2",
46
46
  "@depay/web3-tokens": "^7.2.0",
47
- "@depay/web3-wallets": "^6.1.3",
47
+ "@depay/web3-wallets": "^6.1.6",
48
48
  "decimal.js": "^10.3.1",
49
49
  "react-rangeslider": "^2.2.0"
50
50
  },