@depay/widgets 7.14.2 → 7.15.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
@@ -3,7 +3,7 @@
3
3
  You can either load the `@depay/widgets` package via CDN:
4
4
 
5
5
  ```
6
- <script src="https://integrate.depay.fi/widgets/v7.js"></script>
6
+ <script defer async src="https://integrate.depay.com/widgets/v7.js"></script>
7
7
  ```
8
8
 
9
9
  or you install `@depay/widgets` via the package manager of your choice and ship it as part of your application bundle:
@@ -24,7 +24,7 @@ import DePayWidgets from '@depay/widgets'
24
24
 
25
25
  ## Demo
26
26
 
27
- To easily configure DePay Payment Widgets please use our configurator here: https://app.depay.fi/integrations/new
27
+ To easily configure DePay Payment Widgets please use our configurator here: https://app.depay.com/integrations/new
28
28
 
29
29
  For a more low-key technical example/demo page have a look at: https://depayfi.github.io/widgets/dev.bundle.html
30
30
 
@@ -74,7 +74,7 @@ In order to receive decentralized payments on any blockchain you need to have yo
74
74
  ### Quick start (DePay Payments)
75
75
 
76
76
  ```
77
- <script src="https://integrate.depay.fi/widgets/v7.js"/>
77
+ <script defer async src="https://integrate.depay.com/widgets/v7.js"/>
78
78
  ```
79
79
 
80
80
  ```
@@ -144,7 +144,7 @@ Currently supported:
144
144
 
145
145
  The address of the token you want to receive.
146
146
 
147
- Use our [payment configurator](https://depay.fi/documentation/payments#payment-configurator) in order to simplify configuring this.
147
+ Use our [payment configurator](https://depay.com/documentation/payments#payment-configurator) in order to simplify configuring this.
148
148
 
149
149
  `amount` (Optional)
150
150
 
@@ -341,12 +341,12 @@ DePayWidgets.Payment({
341
341
 
342
342
  In case you pass a tracking method it needs to return a promise.
343
343
 
344
- Your endpoint needs to make sure to forward this to the [payment tracking api](https://depay.fi/documentation/api#payments).
344
+ Your endpoint needs to make sure to forward this to the [payment tracking api](https://depay.com/documentation/api#payments).
345
345
 
346
346
  Also make sure to add `token`, `amount` and `confirmations` when forwarding the request to the payments api.
347
347
  Those values are supposed to be set by your backend not the widget nor the fronted because any user could set these values to their liking otherwise, having you confirm payment amounts and tokens that you didn't intend to receive!
348
348
 
349
- Make sure you read the [Payment Tracking API](https://depay.fi/documentation/api#payments) for further details on how to integrate payment tracking.
349
+ Make sure you read the [Payment Tracking API](https://depay.com/documentation/api#payments) for further details on how to integrate payment tracking.
350
350
 
351
351
  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.
352
352
 
@@ -818,7 +818,7 @@ In order to sell tokens in a decentralized way, that token needs to have a liqui
818
818
  ### Quick start (DePay Sales)
819
819
 
820
820
  ```
821
- <script src="https://integrate.depay.fi/widgets/v7.js"/>
821
+ <script defer async src="https://integrate.depay.com/widgets/v7.js"/>
822
822
  ```
823
823
 
824
824
  ```javascript
@@ -867,7 +867,7 @@ Currently supported blockchains:
867
867
 
868
868
  The address of the token you want to sell.
869
869
 
870
- Use our [sale configurator](https://depay.fi/documentation/sales#sale-configurator) in order to simplify configuring this.
870
+ Use our [sale configurator](https://depay.com/documentation/sales#sale-configurator) in order to simplify configuring this.
871
871
 
872
872
  #### amount (DePay Sales)
873
873
 
@@ -1076,7 +1076,7 @@ Allows to set the token image used in the widget to represent the purchased toke
1076
1076
  ```javascript
1077
1077
  DePayWidgets.Sale({
1078
1078
 
1079
- tokenImage: 'https://depay.fi/favicon.png'
1079
+ tokenImage: 'https://depay.com/favicon.png'
1080
1080
 
1081
1081
  });
1082
1082
  ```
@@ -1216,7 +1216,7 @@ In order to receive decentralized donation payments on any blockchain you need t
1216
1216
  ### Quick start (DePay Donations)
1217
1217
 
1218
1218
  ```
1219
- <script src="https://integrate.depay.fi/widgets/v7.js"/>
1219
+ <script defer async src="https://integrate.depay.com/widgets/v7.js"/>
1220
1220
  ```
1221
1221
 
1222
1222
  ```javascript
@@ -1274,7 +1274,7 @@ Currently supported:
1274
1274
 
1275
1275
  The address of the token you want to receive.
1276
1276
 
1277
- Use our [donation configurator](https://depay.fi/documentation/donations#donation-configurator) in order to simplify configuring this.
1277
+ Use our [donation configurator](https://depay.com/documentation/donations#donation-configurator) in order to simplify configuring this.
1278
1278
 
1279
1279
  `receiver`
1280
1280
 
@@ -1467,6 +1467,32 @@ DePayWidgets.Donation({
1467
1467
  });
1468
1468
  ```
1469
1469
 
1470
+ #### whitelist (DePay Donations)
1471
+
1472
+ Allows only the configured tokens to be eligible as means of payment (from the sender):
1473
+
1474
+ ```javacript
1475
+ DePayWidgets.Donation({
1476
+
1477
+ whitelist: {
1478
+ ethereum: [
1479
+ '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE', // ETH
1480
+ '0xdac17f958d2ee523a2206206994597c13d831ec7', // USDT
1481
+ '0x6b175474e89094c44da98b954eedeac495271d0f' // DAI
1482
+ ],
1483
+ bsc: [
1484
+ '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE', // BNB
1485
+ '0xe9e7cea3dedca5984780bafc599bd69add087d56', // BUSD
1486
+ '0x55d398326f99059ff775485246999027b3197955' // BSC-USD
1487
+ ],
1488
+ polygon: [
1489
+ '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE', // MATIC
1490
+ '0x2791bca1f2de4661ed88a30c99a7a9449aa84174', // USDC
1491
+ ]
1492
+ }
1493
+ })
1494
+ ```
1495
+
1470
1496
  #### blacklist (DePay Donations)
1471
1497
 
1472
1498
  Allows to blacklist tokens so that they will not be suggested as means of payment (from the sender):
@@ -1642,7 +1668,7 @@ DePay Connect allows you to have your users connect their crypto wallet to your
1642
1668
  Returns connected `account`, `accounts` and `wallet` in return.
1643
1669
 
1644
1670
  ```
1645
- <script src="https://integrate.depay.fi/widgets/v7.js"/>
1671
+ <script defer async src="https://integrate.depay.com/widgets/v7.js"/>
1646
1672
  ```
1647
1673
 
1648
1674
  ```javascript
@@ -1670,7 +1696,7 @@ DePay Login allows you to perform web3 wallet logins with ease.
1670
1696
  Returns `account` if succesfully signed and recovered log in message.
1671
1697
 
1672
1698
  ```
1673
- <script src="https://integrate.depay.fi/widgets/v7.js"/>
1699
+ <script defer async src="https://integrate.depay.com/widgets/v7.js"/>
1674
1700
  ```
1675
1701
 
1676
1702
  ```javascript
@@ -1747,7 +1773,7 @@ DePay Select widget allows you to open a dialog that allows you to select things
1747
1773
  Resolves with what has been selected by the user:
1748
1774
 
1749
1775
  ```
1750
- <script src="https://integrate.depay.fi/widgets/v7.js"/>
1776
+ <script defer async src="https://integrate.depay.com/widgets/v7.js"/>
1751
1777
  ```
1752
1778
 
1753
1779
  ```javascript
@@ -1764,6 +1790,44 @@ let token = await DePayWidgets.Select({ what: 'token' })
1764
1790
  // }
1765
1791
  ```
1766
1792
 
1793
+ ## Examples
1794
+
1795
+ ### React
1796
+
1797
+ #### DePay Payments
1798
+
1799
+ ```javascript
1800
+
1801
+ import React from 'react'
1802
+ import DePayWidgets from '@depay/widgets'
1803
+
1804
+ export default (props)=>{
1805
+
1806
+ let unmount
1807
+
1808
+ const openPaymentWidget = ()=>{
1809
+ (
1810
+ { unmount } = DePayWidgets.Payment({...})
1811
+ )
1812
+ }
1813
+
1814
+ useEffect(() => {
1815
+ return ()=>{
1816
+ // make sure an open widgets gets closed/unmounted as part of this component
1817
+ if(unmount) { unmount() }
1818
+ }
1819
+ }, [])
1820
+
1821
+ return(
1822
+ <button onClick={ openPaymentWidget } type="button">
1823
+ Pay
1824
+ </button>
1825
+ )
1826
+ }
1827
+
1828
+ ```
1829
+
1830
+
1767
1831
  ## Development
1768
1832
 
1769
1833
  ### Quick start
@@ -1796,3 +1860,36 @@ npm login
1796
1860
  npm publish
1797
1861
  ```
1798
1862
 
1863
+ ## Web3 Payments
1864
+
1865
+ The future is [Web3 Payments](https://depay.com/web3-payments).
1866
+
1867
+ Blockchains hold the potential to faster, simpler and smarter payments.
1868
+
1869
+ Web3 Payments are borderless, peer-to-peer, and support multiple tokens and blockchains.
1870
+
1871
+ Accept any asset type that your customers already have in their wallet. [DePay](https://depay.com) is blockchain agnostic and can at any time be extended on any blockchain-specific plugin. Interoperability, scalability & flexibility are the cornerstones of our protocol. Accepting any asset that users already have in their wallets no matter which blockchain these are held on, reduces friction when performing decentralized payments.
1872
+
1873
+ ### Chain Agnostic (Multichain)
1874
+
1875
+ Interoperability is the key principle on which our infrastructure is built. [DePay](https://depay.com) is extensible around any blockchain, ensuring a competitive cross-chain future.
1876
+
1877
+ ### Permissionless
1878
+
1879
+ Interoperability is the key principle on which our infrastructure is built. [DePay](https://depay.com) is extensible around any blockchain, ensuring a competitive cross-chain future.
1880
+
1881
+ ### Trustless
1882
+
1883
+ Most Web3 Payment providers & processors receive payments to wallets that they manage themselves. Only in a further intermediate step are the payments paid out to sellers. [DePay](https://depay.com) does not act as an intermediary. Every intermediate step is replaced by smart contracts which are connected to decentralized liquidity pools. As a result, trust is no longer required.
1884
+
1885
+ ### Easy to use
1886
+
1887
+ Our ambition was to create an even easier user experience than you're used to from shopping in current non-crypto e-commerce stores. We think we've done a good job of that.
1888
+
1889
+ ### Open Source
1890
+
1891
+ Feel free to use & contribute to our codebase at. We're happy to have you look under our hood. The [DePay](https://depay.com) protocol will always remain open source.
1892
+
1893
+ ### Multichain
1894
+
1895
+ [DePay](https://depay.com) calculates payment routes on multiple blockchains simultaneously despite what your wallet is currently connected to. Our software automatically detects & switches the network if required.