@depay/widgets 7.14.3 → 7.15.1
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 +157 -118
- package/dist/esm/index.bundle.js +2 -2
- package/dist/esm/index.js +103 -87
- package/dist/umd/index.bundle.js +2 -2
- package/dist/umd/index.js +103 -87
- package/package.json +6 -6
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 defer async src="https://integrate.depay.
|
|
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,9 +24,13 @@ import DePayWidgets from '@depay/widgets'
|
|
|
24
24
|
|
|
25
25
|
## Demo
|
|
26
26
|
|
|
27
|
-
To easily configure DePay Payment Widgets please use our configurator here:
|
|
27
|
+
To easily configure DePay Payment Widgets please use our configurator here:
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
https://app.depay.com/integrations/new
|
|
30
|
+
|
|
31
|
+
For a more low-key technical example/demo page have a look at:
|
|
32
|
+
|
|
33
|
+
https://depayfi.github.io/widgets/dev.bundle.html
|
|
30
34
|
|
|
31
35
|
## Support
|
|
32
36
|
|
|
@@ -43,7 +47,7 @@ DePay supports the most popular crypto wallets:
|
|
|
43
47
|
- [MetaMask](https://metamask.io)
|
|
44
48
|
- [Coinbase Wallet](https://wallet.coinbase.com)
|
|
45
49
|
|
|
46
|
-
100+
|
|
50
|
+
100+ additional wallets via [WalletConnect](https://walletconnect.org), such as:
|
|
47
51
|
- [Trust Wallet](https://trustwallet.com)
|
|
48
52
|
- [DeFi Wallet by crypto.com](https://crypto.com/defi-wallet)
|
|
49
53
|
- [1inch Wallet](https://1inch.io/wallet/)
|
|
@@ -63,7 +67,7 @@ DePay supports the most popular crypto wallets:
|
|
|
63
67
|
|
|
64
68
|
DePay Payments allows you to accept and perform crypto payments.
|
|
65
69
|
|
|
66
|
-
### Preparation
|
|
70
|
+
### Preparation
|
|
67
71
|
|
|
68
72
|
In order to receive decentralized payments on any blockchain you need to have your own wallet on that particular blockchain first:
|
|
69
73
|
|
|
@@ -71,11 +75,7 @@ In order to receive decentralized payments on any blockchain you need to have yo
|
|
|
71
75
|
- [Create an BSC wallet](https://academy.binance.com/en/articles/how-to-get-started-with-binance-smart-chain-bsc)
|
|
72
76
|
- [Create a Polygon wallet](https://wallet.polygon.technology/)
|
|
73
77
|
|
|
74
|
-
### Quick start
|
|
75
|
-
|
|
76
|
-
```
|
|
77
|
-
<script defer async src="https://integrate.depay.fi/widgets/v7.js"/>
|
|
78
|
-
```
|
|
78
|
+
### Quick start
|
|
79
79
|
|
|
80
80
|
```
|
|
81
81
|
DePayWidgets.Payment({
|
|
@@ -88,7 +88,7 @@ DePayWidgets.Payment({
|
|
|
88
88
|
});
|
|
89
89
|
```
|
|
90
90
|
|
|
91
|
-
### Configuration
|
|
91
|
+
### Configuration
|
|
92
92
|
|
|
93
93
|
You need to pass a configuration object to `DePayWidgets.Payment` which needs to at least contain the `accept` field:
|
|
94
94
|
|
|
@@ -128,7 +128,7 @@ DePayWidgets.Payment({
|
|
|
128
128
|
});
|
|
129
129
|
```
|
|
130
130
|
|
|
131
|
-
#### accept
|
|
131
|
+
#### accept
|
|
132
132
|
|
|
133
133
|
`blockchain`
|
|
134
134
|
|
|
@@ -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.
|
|
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
|
|
|
@@ -159,7 +159,7 @@ If you do not pass an amount, the user will be able to select an amount within t
|
|
|
159
159
|
|
|
160
160
|
The address receiving the payment. Always double check that you've set the right address.
|
|
161
161
|
|
|
162
|
-
#### amount
|
|
162
|
+
#### amount
|
|
163
163
|
|
|
164
164
|
##### fixed currency amounts
|
|
165
165
|
|
|
@@ -193,7 +193,7 @@ alongside values for `start`, `min` and `step`.
|
|
|
193
193
|
|
|
194
194
|
`step`: The number by wich to increment/decremten changes to the amount.
|
|
195
195
|
|
|
196
|
-
#### receiver
|
|
196
|
+
#### receiver
|
|
197
197
|
|
|
198
198
|
Payment receivers can either be wallet addresses, but also smart contracts.
|
|
199
199
|
|
|
@@ -219,7 +219,7 @@ DePayWidgets.Payment({
|
|
|
219
219
|
|
|
220
220
|
Checkout [DePay Web3 Payments](https://github.com/DePayFi/depay-web3-payments#pay-into-smart-contracts) and [DePay Router Smart Contract](https://github.com/DePayFi/depay-evm-router) for more details.
|
|
221
221
|
|
|
222
|
-
#### fee
|
|
222
|
+
#### fee
|
|
223
223
|
|
|
224
224
|
You can configure a fee which will be applied to every payment with it's own dedicated fee receiver address.
|
|
225
225
|
|
|
@@ -239,7 +239,7 @@ DePayWidgets.Payment({
|
|
|
239
239
|
});
|
|
240
240
|
```
|
|
241
241
|
|
|
242
|
-
#### fromToken, fromAmount + toToken
|
|
242
|
+
#### fromToken, fromAmount + toToken
|
|
243
243
|
|
|
244
244
|
In case where you want to configure payments based on the source token + amount, rather than target token and amount, you can pass `fromToken`, `fromAmount` and `toToken` to `accept`.
|
|
245
245
|
|
|
@@ -259,7 +259,7 @@ DePayWidgets.Payment({
|
|
|
259
259
|
// This will open a payment widget to send 0.1 BUSD to the receiver, converting it to BNB along the way.
|
|
260
260
|
```
|
|
261
261
|
|
|
262
|
-
#### preload
|
|
262
|
+
#### preload
|
|
263
263
|
|
|
264
264
|
To optimize initialization speed of the Payment Widget you can preload payment routes as soon as you become aware of the users wallet address.
|
|
265
265
|
|
|
@@ -286,7 +286,7 @@ DePayWidgets.Payment.preload({
|
|
|
286
286
|
});
|
|
287
287
|
```
|
|
288
288
|
|
|
289
|
-
#### track
|
|
289
|
+
#### track
|
|
290
290
|
|
|
291
291
|
`track`
|
|
292
292
|
|
|
@@ -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.
|
|
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.
|
|
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
|
|
|
@@ -390,7 +390,7 @@ In case you want to redirect the user to the next step in your system the poll e
|
|
|
390
390
|
It is not enough to rely on setting `forward_to` initially with the tracking request, you will also need to respond with `forward_to` when implementing polling
|
|
391
391
|
as the entire reason for polling is to cover cases where websockets fail and the initial `forward_to` can not be communicated to the client.
|
|
392
392
|
|
|
393
|
-
#### connected
|
|
393
|
+
#### connected
|
|
394
394
|
|
|
395
395
|
`connected`
|
|
396
396
|
|
|
@@ -408,7 +408,7 @@ DePayWidgets.Payment({
|
|
|
408
408
|
|
|
409
409
|
```
|
|
410
410
|
|
|
411
|
-
#### closed
|
|
411
|
+
#### closed
|
|
412
412
|
|
|
413
413
|
`closed`
|
|
414
414
|
|
|
@@ -424,7 +424,7 @@ DePayWidgets.Payment({
|
|
|
424
424
|
|
|
425
425
|
```
|
|
426
426
|
|
|
427
|
-
#### before
|
|
427
|
+
#### before
|
|
428
428
|
|
|
429
429
|
`before`
|
|
430
430
|
|
|
@@ -442,7 +442,7 @@ DePayWidgets.Payment({
|
|
|
442
442
|
})
|
|
443
443
|
```
|
|
444
444
|
|
|
445
|
-
#### sent
|
|
445
|
+
#### sent
|
|
446
446
|
|
|
447
447
|
`sent`
|
|
448
448
|
|
|
@@ -459,7 +459,7 @@ DePayWidgets.Payment({
|
|
|
459
459
|
})
|
|
460
460
|
```
|
|
461
461
|
|
|
462
|
-
#### confirmed
|
|
462
|
+
#### confirmed
|
|
463
463
|
|
|
464
464
|
`confirmed`
|
|
465
465
|
|
|
@@ -476,7 +476,7 @@ DePayWidgets.Payment({
|
|
|
476
476
|
})
|
|
477
477
|
```
|
|
478
478
|
|
|
479
|
-
#### validated
|
|
479
|
+
#### validated
|
|
480
480
|
|
|
481
481
|
`validated`
|
|
482
482
|
|
|
@@ -491,7 +491,7 @@ DePayWidgets.Payment({
|
|
|
491
491
|
})
|
|
492
492
|
```
|
|
493
493
|
|
|
494
|
-
#### failed
|
|
494
|
+
#### failed
|
|
495
495
|
|
|
496
496
|
`failed`
|
|
497
497
|
|
|
@@ -509,7 +509,7 @@ DePayWidgets.Payment({
|
|
|
509
509
|
})
|
|
510
510
|
```
|
|
511
511
|
|
|
512
|
-
#### critical
|
|
512
|
+
#### critical
|
|
513
513
|
|
|
514
514
|
`critical`
|
|
515
515
|
|
|
@@ -524,7 +524,7 @@ DePayWidgets.Payment({
|
|
|
524
524
|
})
|
|
525
525
|
```
|
|
526
526
|
|
|
527
|
-
#### error
|
|
527
|
+
#### error
|
|
528
528
|
|
|
529
529
|
`error`
|
|
530
530
|
|
|
@@ -540,7 +540,7 @@ DePayWidgets.Payment({
|
|
|
540
540
|
})
|
|
541
541
|
```
|
|
542
542
|
|
|
543
|
-
#### providers
|
|
543
|
+
#### providers
|
|
544
544
|
|
|
545
545
|
Allows to set providers to be used for making RPC calls to the individiual blockchains:
|
|
546
546
|
|
|
@@ -555,7 +555,7 @@ DePayWidgets.Payment({
|
|
|
555
555
|
})
|
|
556
556
|
```
|
|
557
557
|
|
|
558
|
-
#### currency
|
|
558
|
+
#### currency
|
|
559
559
|
|
|
560
560
|
Allows you to enforce displayed local currency (instead of automatically detecting it):
|
|
561
561
|
|
|
@@ -569,7 +569,7 @@ DePayWidgets.Payment({
|
|
|
569
569
|
|
|
570
570
|
```
|
|
571
571
|
|
|
572
|
-
#### whitelist
|
|
572
|
+
#### whitelist
|
|
573
573
|
|
|
574
574
|
Allows only the configured tokens to be eligible as means of payment (from the sender):
|
|
575
575
|
|
|
@@ -597,7 +597,7 @@ DePayWidgets.Payment({
|
|
|
597
597
|
|
|
598
598
|
```
|
|
599
599
|
|
|
600
|
-
#### blacklist
|
|
600
|
+
#### blacklist
|
|
601
601
|
|
|
602
602
|
Allows to blacklist tokens so that they will not be suggested as means of payment (from the sender):
|
|
603
603
|
|
|
@@ -632,7 +632,7 @@ DePayWidgets.Payment({
|
|
|
632
632
|
})
|
|
633
633
|
```
|
|
634
634
|
|
|
635
|
-
#### event
|
|
635
|
+
#### event
|
|
636
636
|
|
|
637
637
|
`event`
|
|
638
638
|
|
|
@@ -648,7 +648,7 @@ DePayWidgets.Payment({
|
|
|
648
648
|
})
|
|
649
649
|
```
|
|
650
650
|
|
|
651
|
-
#### container
|
|
651
|
+
#### container
|
|
652
652
|
|
|
653
653
|
`container`
|
|
654
654
|
|
|
@@ -660,7 +660,7 @@ DePayWidgets.Payment({
|
|
|
660
660
|
})
|
|
661
661
|
```
|
|
662
662
|
|
|
663
|
-
#### style
|
|
663
|
+
#### style
|
|
664
664
|
|
|
665
665
|
`style`
|
|
666
666
|
|
|
@@ -687,7 +687,7 @@ DePayWidgets.Payment({
|
|
|
687
687
|
})
|
|
688
688
|
```
|
|
689
689
|
|
|
690
|
-
##### colors
|
|
690
|
+
##### colors
|
|
691
691
|
|
|
692
692
|
`colors`
|
|
693
693
|
|
|
@@ -707,7 +707,7 @@ DePayWidgets.Payment({
|
|
|
707
707
|
})
|
|
708
708
|
```
|
|
709
709
|
|
|
710
|
-
##### fontFamily
|
|
710
|
+
##### fontFamily
|
|
711
711
|
|
|
712
712
|
`fontFamily`
|
|
713
713
|
|
|
@@ -722,7 +722,7 @@ DePayWidgets.Payment({
|
|
|
722
722
|
})
|
|
723
723
|
```
|
|
724
724
|
|
|
725
|
-
##### css
|
|
725
|
+
##### css
|
|
726
726
|
|
|
727
727
|
`css`
|
|
728
728
|
|
|
@@ -743,7 +743,7 @@ DePayWidgets.Payment({
|
|
|
743
743
|
})
|
|
744
744
|
```
|
|
745
745
|
|
|
746
|
-
#### unmount
|
|
746
|
+
#### unmount
|
|
747
747
|
|
|
748
748
|
`unmount`
|
|
749
749
|
|
|
@@ -755,7 +755,7 @@ let { unmount } = await DePayWidgets.Payment({})
|
|
|
755
755
|
unmount()
|
|
756
756
|
```
|
|
757
757
|
|
|
758
|
-
#### recover
|
|
758
|
+
#### recover
|
|
759
759
|
|
|
760
760
|
`recover`
|
|
761
761
|
|
|
@@ -778,7 +778,7 @@ A recovered payment still results in a confirmed or failed payment, and also cal
|
|
|
778
778
|
|
|
779
779
|
```
|
|
780
780
|
|
|
781
|
-
#### closable
|
|
781
|
+
#### closable
|
|
782
782
|
|
|
783
783
|
`closable`
|
|
784
784
|
|
|
@@ -791,7 +791,7 @@ DePayWidgets.Payment({
|
|
|
791
791
|
|
|
792
792
|
```
|
|
793
793
|
|
|
794
|
-
#### integration
|
|
794
|
+
#### integration
|
|
795
795
|
|
|
796
796
|
`integration`
|
|
797
797
|
|
|
@@ -807,7 +807,7 @@ DePayWidgets.Payment({
|
|
|
807
807
|
|
|
808
808
|
DePay Sales allows you to sell tokens directly from your website or dApp with automatic any-to-any payment conversion (so people can use any token when buying your token directly off your website or dApp).
|
|
809
809
|
|
|
810
|
-
### Preparation
|
|
810
|
+
### Preparation
|
|
811
811
|
|
|
812
812
|
In order to sell tokens in a decentralized way, that token needs to have a liquidity pool on a decentralized exchange:
|
|
813
813
|
|
|
@@ -815,11 +815,7 @@ In order to sell tokens in a decentralized way, that token needs to have a liqui
|
|
|
815
815
|
- [Create Uniswap v2 Liquidity Pool (Polygon)](https://app.uniswap.org/#/add/v2/ETH?chain=polygon)
|
|
816
816
|
- [Create Pancakeswap Liquidity Pool](https://pancakeswap.finance/add)
|
|
817
817
|
|
|
818
|
-
### Quick start
|
|
819
|
-
|
|
820
|
-
```
|
|
821
|
-
<script defer async src="https://integrate.depay.fi/widgets/v7.js"/>
|
|
822
|
-
```
|
|
818
|
+
### Quick start
|
|
823
819
|
|
|
824
820
|
```javascript
|
|
825
821
|
DePayWidgets.Sale({
|
|
@@ -829,7 +825,7 @@ DePayWidgets.Sale({
|
|
|
829
825
|
});
|
|
830
826
|
```
|
|
831
827
|
|
|
832
|
-
### Configuration
|
|
828
|
+
### Configuration
|
|
833
829
|
|
|
834
830
|
You need to pass a configuration object to `DePayWidgets.Sale` which needs to at least contain the `sell` field:
|
|
835
831
|
|
|
@@ -852,7 +848,7 @@ DePayWidgets.Sale({
|
|
|
852
848
|
});
|
|
853
849
|
```
|
|
854
850
|
|
|
855
|
-
#### sell
|
|
851
|
+
#### sell
|
|
856
852
|
|
|
857
853
|
`"blockchain": "token"`
|
|
858
854
|
|
|
@@ -867,9 +863,9 @@ Currently supported blockchains:
|
|
|
867
863
|
|
|
868
864
|
The address of the token you want to sell.
|
|
869
865
|
|
|
870
|
-
Use our [sale configurator](https://depay.
|
|
866
|
+
Use our [sale configurator](https://depay.com/documentation/sales#sale-configurator) in order to simplify configuring this.
|
|
871
867
|
|
|
872
|
-
#### amount
|
|
868
|
+
#### amount
|
|
873
869
|
|
|
874
870
|
When you want to control how the amount selection behaves, pass the `amount` configuration object,
|
|
875
871
|
alongside values for `start`, `min` and `step`.
|
|
@@ -891,7 +887,7 @@ DePayWidgets.Sale({
|
|
|
891
887
|
});
|
|
892
888
|
```
|
|
893
889
|
|
|
894
|
-
#### connected
|
|
890
|
+
#### connected
|
|
895
891
|
|
|
896
892
|
`connected`
|
|
897
893
|
|
|
@@ -908,7 +904,7 @@ DePayWidgets.Sale({
|
|
|
908
904
|
});
|
|
909
905
|
```
|
|
910
906
|
|
|
911
|
-
#### closed
|
|
907
|
+
#### closed
|
|
912
908
|
|
|
913
909
|
`closed`
|
|
914
910
|
|
|
@@ -923,7 +919,7 @@ DePayWidgets.Sale({
|
|
|
923
919
|
});
|
|
924
920
|
```
|
|
925
921
|
|
|
926
|
-
#### sent
|
|
922
|
+
#### sent
|
|
927
923
|
|
|
928
924
|
`sent`
|
|
929
925
|
|
|
@@ -940,7 +936,7 @@ DePayWidgets.Sale({
|
|
|
940
936
|
});
|
|
941
937
|
```
|
|
942
938
|
|
|
943
|
-
#### confirmed
|
|
939
|
+
#### confirmed
|
|
944
940
|
|
|
945
941
|
`confirmed`
|
|
946
942
|
|
|
@@ -957,7 +953,7 @@ DePayWidgets.Sale({
|
|
|
957
953
|
});
|
|
958
954
|
```
|
|
959
955
|
|
|
960
|
-
#### failed
|
|
956
|
+
#### failed
|
|
961
957
|
|
|
962
958
|
`failed`
|
|
963
959
|
|
|
@@ -975,7 +971,7 @@ DePayWidgets.Sale({
|
|
|
975
971
|
});
|
|
976
972
|
```
|
|
977
973
|
|
|
978
|
-
#### critical
|
|
974
|
+
#### critical
|
|
979
975
|
|
|
980
976
|
`critical`
|
|
981
977
|
|
|
@@ -990,7 +986,7 @@ DePayWidgets.Sale({
|
|
|
990
986
|
});
|
|
991
987
|
```
|
|
992
988
|
|
|
993
|
-
#### error
|
|
989
|
+
#### error
|
|
994
990
|
|
|
995
991
|
`error`
|
|
996
992
|
|
|
@@ -1006,7 +1002,7 @@ DePayWidgets.Sale({
|
|
|
1006
1002
|
});
|
|
1007
1003
|
```
|
|
1008
1004
|
|
|
1009
|
-
#### providers
|
|
1005
|
+
#### providers
|
|
1010
1006
|
|
|
1011
1007
|
Allows to set providers to be used for making RPC calls to the individiual blockchains:
|
|
1012
1008
|
|
|
@@ -1020,7 +1016,7 @@ DePayWidgets.Sale({
|
|
|
1020
1016
|
});
|
|
1021
1017
|
```
|
|
1022
1018
|
|
|
1023
|
-
#### currency
|
|
1019
|
+
#### currency
|
|
1024
1020
|
|
|
1025
1021
|
Allows you to enforce displayed local currency (instead of automatically detecting it):
|
|
1026
1022
|
|
|
@@ -1032,7 +1028,7 @@ DePayWidgets.Sale({
|
|
|
1032
1028
|
});
|
|
1033
1029
|
```
|
|
1034
1030
|
|
|
1035
|
-
#### blacklist
|
|
1031
|
+
#### blacklist
|
|
1036
1032
|
|
|
1037
1033
|
Allows to blacklist tokens so that they will not be suggested as means of payment (from the sender):
|
|
1038
1034
|
|
|
@@ -1067,7 +1063,7 @@ DePayWidgets.Sale({
|
|
|
1067
1063
|
});
|
|
1068
1064
|
```
|
|
1069
1065
|
|
|
1070
|
-
#### tokenImage
|
|
1066
|
+
#### tokenImage
|
|
1071
1067
|
|
|
1072
1068
|
`tokenImage`
|
|
1073
1069
|
|
|
@@ -1076,12 +1072,12 @@ Allows to set the token image used in the widget to represent the purchased toke
|
|
|
1076
1072
|
```javascript
|
|
1077
1073
|
DePayWidgets.Sale({
|
|
1078
1074
|
|
|
1079
|
-
tokenImage: 'https://depay.
|
|
1075
|
+
tokenImage: 'https://depay.com/favicon.png'
|
|
1080
1076
|
|
|
1081
1077
|
});
|
|
1082
1078
|
```
|
|
1083
1079
|
|
|
1084
|
-
#### style
|
|
1080
|
+
#### style
|
|
1085
1081
|
|
|
1086
1082
|
`style`
|
|
1087
1083
|
|
|
@@ -1109,7 +1105,7 @@ DePayWidgets.Sale({
|
|
|
1109
1105
|
});
|
|
1110
1106
|
```
|
|
1111
1107
|
|
|
1112
|
-
##### colors
|
|
1108
|
+
##### colors
|
|
1113
1109
|
|
|
1114
1110
|
`colors`
|
|
1115
1111
|
|
|
@@ -1129,7 +1125,7 @@ DePayWidgets.Sale({
|
|
|
1129
1125
|
});
|
|
1130
1126
|
```
|
|
1131
1127
|
|
|
1132
|
-
##### fontFamily
|
|
1128
|
+
##### fontFamily
|
|
1133
1129
|
|
|
1134
1130
|
`fontFamily`
|
|
1135
1131
|
|
|
@@ -1144,7 +1140,7 @@ DePayWidgets.Sale({
|
|
|
1144
1140
|
});
|
|
1145
1141
|
```
|
|
1146
1142
|
|
|
1147
|
-
##### css
|
|
1143
|
+
##### css
|
|
1148
1144
|
|
|
1149
1145
|
`css`
|
|
1150
1146
|
|
|
@@ -1165,7 +1161,7 @@ DePayWidgets.Sale({
|
|
|
1165
1161
|
});
|
|
1166
1162
|
```
|
|
1167
1163
|
|
|
1168
|
-
#### unmount
|
|
1164
|
+
#### unmount
|
|
1169
1165
|
|
|
1170
1166
|
`unmount`
|
|
1171
1167
|
|
|
@@ -1177,7 +1173,7 @@ let { unmount } = await DePayWidgets.Sale({})
|
|
|
1177
1173
|
unmount()
|
|
1178
1174
|
```
|
|
1179
1175
|
|
|
1180
|
-
#### closable
|
|
1176
|
+
#### closable
|
|
1181
1177
|
|
|
1182
1178
|
`closable`
|
|
1183
1179
|
|
|
@@ -1190,7 +1186,7 @@ DePayWidgets.Sale({
|
|
|
1190
1186
|
|
|
1191
1187
|
```
|
|
1192
1188
|
|
|
1193
|
-
#### integration
|
|
1189
|
+
#### integration
|
|
1194
1190
|
|
|
1195
1191
|
`integration`
|
|
1196
1192
|
|
|
@@ -1206,18 +1202,14 @@ DePayWidgets.Sale({
|
|
|
1206
1202
|
|
|
1207
1203
|
DePay Donations allows you to accept donation payments made with thousands of different crypto currencies.
|
|
1208
1204
|
|
|
1209
|
-
### Preparation
|
|
1205
|
+
### Preparation
|
|
1210
1206
|
|
|
1211
1207
|
In order to receive decentralized donation payments on any blockchain you need to have your own wallet on that particular blockchain first:
|
|
1212
1208
|
|
|
1213
1209
|
- [Create an Ethereum wallet](https://ethereum.org/en/wallets/)
|
|
1214
1210
|
- [Create an BSC wallet](https://academy.binance.com/en/articles/how-to-get-started-with-binance-smart-chain-bsc)
|
|
1215
1211
|
|
|
1216
|
-
### Quick start
|
|
1217
|
-
|
|
1218
|
-
```
|
|
1219
|
-
<script defer async src="https://integrate.depay.fi/widgets/v7.js"/>
|
|
1220
|
-
```
|
|
1212
|
+
### Quick start
|
|
1221
1213
|
|
|
1222
1214
|
```javascript
|
|
1223
1215
|
DePayWidgets.Donation({
|
|
@@ -1229,7 +1221,7 @@ DePayWidgets.Donation({
|
|
|
1229
1221
|
});
|
|
1230
1222
|
```
|
|
1231
1223
|
|
|
1232
|
-
### Configuration
|
|
1224
|
+
### Configuration
|
|
1233
1225
|
|
|
1234
1226
|
You need to pass a configuration object to `DePayWidgets.Donation` which needs to at least contain the `accept` field:
|
|
1235
1227
|
|
|
@@ -1259,7 +1251,7 @@ DePayWidgets.Donation({
|
|
|
1259
1251
|
});
|
|
1260
1252
|
```
|
|
1261
1253
|
|
|
1262
|
-
#### accept
|
|
1254
|
+
#### accept
|
|
1263
1255
|
|
|
1264
1256
|
`blockchain`
|
|
1265
1257
|
|
|
@@ -1274,13 +1266,13 @@ Currently supported:
|
|
|
1274
1266
|
|
|
1275
1267
|
The address of the token you want to receive.
|
|
1276
1268
|
|
|
1277
|
-
Use our [donation configurator](https://depay.
|
|
1269
|
+
Use our [donation configurator](https://depay.com/documentation/donations#donation-configurator) in order to simplify configuring this.
|
|
1278
1270
|
|
|
1279
1271
|
`receiver`
|
|
1280
1272
|
|
|
1281
1273
|
The address receiving the donation. Always double check that you've set the right address.
|
|
1282
1274
|
|
|
1283
|
-
#### amount
|
|
1275
|
+
#### amount
|
|
1284
1276
|
|
|
1285
1277
|
When you want to control how the amount selection behaves, pass the `amount` configuration object,
|
|
1286
1278
|
alongside values for `start`, `min` and `step`.
|
|
@@ -1291,7 +1283,7 @@ alongside values for `start`, `min` and `step`.
|
|
|
1291
1283
|
|
|
1292
1284
|
`step`: The number by wich to increment/decremten changes to the amount.
|
|
1293
1285
|
|
|
1294
|
-
#### connected
|
|
1286
|
+
#### connected
|
|
1295
1287
|
|
|
1296
1288
|
`connected`
|
|
1297
1289
|
|
|
@@ -1308,7 +1300,7 @@ DePayWidgets.Donation({
|
|
|
1308
1300
|
});
|
|
1309
1301
|
```
|
|
1310
1302
|
|
|
1311
|
-
#### fee
|
|
1303
|
+
#### fee
|
|
1312
1304
|
|
|
1313
1305
|
You can configure a fee which will be applied to every payment with it's own dedicated fee receiver address.
|
|
1314
1306
|
|
|
@@ -1328,7 +1320,7 @@ DePayWidgets.Donation({
|
|
|
1328
1320
|
});
|
|
1329
1321
|
```
|
|
1330
1322
|
|
|
1331
|
-
#### closed
|
|
1323
|
+
#### closed
|
|
1332
1324
|
|
|
1333
1325
|
`closed`
|
|
1334
1326
|
|
|
@@ -1343,7 +1335,7 @@ DePayWidgets.Donation({
|
|
|
1343
1335
|
});
|
|
1344
1336
|
```
|
|
1345
1337
|
|
|
1346
|
-
#### sent
|
|
1338
|
+
#### sent
|
|
1347
1339
|
|
|
1348
1340
|
`sent`
|
|
1349
1341
|
|
|
@@ -1360,7 +1352,7 @@ DePayWidgets.Donation({
|
|
|
1360
1352
|
});
|
|
1361
1353
|
```
|
|
1362
1354
|
|
|
1363
|
-
#### confirmed
|
|
1355
|
+
#### confirmed
|
|
1364
1356
|
|
|
1365
1357
|
`confirmed`
|
|
1366
1358
|
|
|
@@ -1377,7 +1369,7 @@ DePayWidgets.Donation({
|
|
|
1377
1369
|
});
|
|
1378
1370
|
```
|
|
1379
1371
|
|
|
1380
|
-
#### validated
|
|
1372
|
+
#### validated
|
|
1381
1373
|
|
|
1382
1374
|
`validated`
|
|
1383
1375
|
|
|
@@ -1392,7 +1384,7 @@ DePayWidgets.Payment({
|
|
|
1392
1384
|
})
|
|
1393
1385
|
```
|
|
1394
1386
|
|
|
1395
|
-
#### failed
|
|
1387
|
+
#### failed
|
|
1396
1388
|
|
|
1397
1389
|
`failed`
|
|
1398
1390
|
|
|
@@ -1410,7 +1402,7 @@ DePayWidgets.Donation({
|
|
|
1410
1402
|
});
|
|
1411
1403
|
```
|
|
1412
1404
|
|
|
1413
|
-
#### critical
|
|
1405
|
+
#### critical
|
|
1414
1406
|
|
|
1415
1407
|
`critical`
|
|
1416
1408
|
|
|
@@ -1425,7 +1417,7 @@ DePayWidgets.Donation({
|
|
|
1425
1417
|
});
|
|
1426
1418
|
```
|
|
1427
1419
|
|
|
1428
|
-
#### error
|
|
1420
|
+
#### error
|
|
1429
1421
|
|
|
1430
1422
|
`error`
|
|
1431
1423
|
|
|
@@ -1441,7 +1433,7 @@ DePayWidgets.Donation({
|
|
|
1441
1433
|
});
|
|
1442
1434
|
```
|
|
1443
1435
|
|
|
1444
|
-
#### providers
|
|
1436
|
+
#### providers
|
|
1445
1437
|
|
|
1446
1438
|
Allows to set providers to be used for making RPC calls to the individiual blockchains:
|
|
1447
1439
|
|
|
@@ -1455,7 +1447,7 @@ DePayWidgets.Donation({
|
|
|
1455
1447
|
});
|
|
1456
1448
|
```
|
|
1457
1449
|
|
|
1458
|
-
#### currency
|
|
1450
|
+
#### currency
|
|
1459
1451
|
|
|
1460
1452
|
Allows you to enforce displayed local currency (instead of automatically detecting it):
|
|
1461
1453
|
|
|
@@ -1467,7 +1459,33 @@ DePayWidgets.Donation({
|
|
|
1467
1459
|
});
|
|
1468
1460
|
```
|
|
1469
1461
|
|
|
1470
|
-
####
|
|
1462
|
+
#### whitelist
|
|
1463
|
+
|
|
1464
|
+
Allows only the configured tokens to be eligible as means of payment (from the sender):
|
|
1465
|
+
|
|
1466
|
+
```javacript
|
|
1467
|
+
DePayWidgets.Donation({
|
|
1468
|
+
|
|
1469
|
+
whitelist: {
|
|
1470
|
+
ethereum: [
|
|
1471
|
+
'0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE', // ETH
|
|
1472
|
+
'0xdac17f958d2ee523a2206206994597c13d831ec7', // USDT
|
|
1473
|
+
'0x6b175474e89094c44da98b954eedeac495271d0f' // DAI
|
|
1474
|
+
],
|
|
1475
|
+
bsc: [
|
|
1476
|
+
'0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE', // BNB
|
|
1477
|
+
'0xe9e7cea3dedca5984780bafc599bd69add087d56', // BUSD
|
|
1478
|
+
'0x55d398326f99059ff775485246999027b3197955' // BSC-USD
|
|
1479
|
+
],
|
|
1480
|
+
polygon: [
|
|
1481
|
+
'0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE', // MATIC
|
|
1482
|
+
'0x2791bca1f2de4661ed88a30c99a7a9449aa84174', // USDC
|
|
1483
|
+
]
|
|
1484
|
+
}
|
|
1485
|
+
})
|
|
1486
|
+
```
|
|
1487
|
+
|
|
1488
|
+
#### blacklist
|
|
1471
1489
|
|
|
1472
1490
|
Allows to blacklist tokens so that they will not be suggested as means of payment (from the sender):
|
|
1473
1491
|
|
|
@@ -1502,7 +1520,7 @@ DePayWidgets.Donation({
|
|
|
1502
1520
|
})
|
|
1503
1521
|
```
|
|
1504
1522
|
|
|
1505
|
-
#### container
|
|
1523
|
+
#### container
|
|
1506
1524
|
|
|
1507
1525
|
`container`
|
|
1508
1526
|
|
|
@@ -1514,7 +1532,7 @@ DePayWidgets.Dontaion({
|
|
|
1514
1532
|
})
|
|
1515
1533
|
```
|
|
1516
1534
|
|
|
1517
|
-
#### style
|
|
1535
|
+
#### style
|
|
1518
1536
|
|
|
1519
1537
|
`style`
|
|
1520
1538
|
|
|
@@ -1542,7 +1560,7 @@ DePayWidgets.Donation({
|
|
|
1542
1560
|
});
|
|
1543
1561
|
```
|
|
1544
1562
|
|
|
1545
|
-
##### colors
|
|
1563
|
+
##### colors
|
|
1546
1564
|
|
|
1547
1565
|
`colors`
|
|
1548
1566
|
|
|
@@ -1562,7 +1580,7 @@ DePayWidgets.Donation({
|
|
|
1562
1580
|
});
|
|
1563
1581
|
```
|
|
1564
1582
|
|
|
1565
|
-
##### fontFamily
|
|
1583
|
+
##### fontFamily
|
|
1566
1584
|
|
|
1567
1585
|
`fontFamily`
|
|
1568
1586
|
|
|
@@ -1577,7 +1595,7 @@ DePayWidgets.Donation({
|
|
|
1577
1595
|
});
|
|
1578
1596
|
```
|
|
1579
1597
|
|
|
1580
|
-
##### css
|
|
1598
|
+
##### css
|
|
1581
1599
|
|
|
1582
1600
|
`css`
|
|
1583
1601
|
|
|
@@ -1598,7 +1616,7 @@ DePayWidgets.Donation({
|
|
|
1598
1616
|
});
|
|
1599
1617
|
```
|
|
1600
1618
|
|
|
1601
|
-
#### unmount
|
|
1619
|
+
#### unmount
|
|
1602
1620
|
|
|
1603
1621
|
`unmount`
|
|
1604
1622
|
|
|
@@ -1610,7 +1628,7 @@ let { unmount } = await DePayWidgets.Donation({})
|
|
|
1610
1628
|
unmount()
|
|
1611
1629
|
```
|
|
1612
1630
|
|
|
1613
|
-
#### closable
|
|
1631
|
+
#### closable
|
|
1614
1632
|
|
|
1615
1633
|
`closable`
|
|
1616
1634
|
|
|
@@ -1623,7 +1641,7 @@ DePayWidgets.Donation({
|
|
|
1623
1641
|
|
|
1624
1642
|
```
|
|
1625
1643
|
|
|
1626
|
-
#### integration
|
|
1644
|
+
#### integration
|
|
1627
1645
|
|
|
1628
1646
|
`integration`
|
|
1629
1647
|
|
|
@@ -1635,23 +1653,19 @@ DePayWidgets.Donation({
|
|
|
1635
1653
|
})
|
|
1636
1654
|
```
|
|
1637
1655
|
|
|
1638
|
-
## DePay Connect
|
|
1656
|
+
## DePay Connect
|
|
1639
1657
|
|
|
1640
1658
|
DePay Connect allows you to have your users connect their crypto wallet to your dApp or website.
|
|
1641
1659
|
|
|
1642
1660
|
Returns connected `account`, `accounts` and `wallet` in return.
|
|
1643
1661
|
|
|
1644
|
-
```
|
|
1645
|
-
<script defer async src="https://integrate.depay.fi/widgets/v7.js"/>
|
|
1646
|
-
```
|
|
1647
|
-
|
|
1648
1662
|
```javascript
|
|
1649
1663
|
let { account, accounts, wallet } = await DePayWidgets.Connect()
|
|
1650
1664
|
```
|
|
1651
1665
|
|
|
1652
1666
|
See [depay-web3-wallets](https://github.com/depayfi/depay-web3-wallets) for more details about the returned `wallet`.
|
|
1653
1667
|
|
|
1654
|
-
### Rejections
|
|
1668
|
+
### Rejections
|
|
1655
1669
|
|
|
1656
1670
|
1. Rejects if user just closes the dialog without connecting any wallet:
|
|
1657
1671
|
|
|
@@ -1669,10 +1683,6 @@ DePay Login allows you to perform web3 wallet logins with ease.
|
|
|
1669
1683
|
|
|
1670
1684
|
Returns `account` if succesfully signed and recovered log in message.
|
|
1671
1685
|
|
|
1672
|
-
```
|
|
1673
|
-
<script defer async src="https://integrate.depay.fi/widgets/v7.js"/>
|
|
1674
|
-
```
|
|
1675
|
-
|
|
1676
1686
|
```javascript
|
|
1677
1687
|
let message = "Sign to login"
|
|
1678
1688
|
let account = await DePayWidgets.Login({ message })
|
|
@@ -1728,7 +1738,7 @@ DePayWidgets.Login({ message, recover: ({ message, signature })=>{
|
|
|
1728
1738
|
})
|
|
1729
1739
|
```
|
|
1730
1740
|
|
|
1731
|
-
### Rejections
|
|
1741
|
+
### Rejections
|
|
1732
1742
|
|
|
1733
1743
|
1. Rejects if user just closes the dialog without connecting any wallet:
|
|
1734
1744
|
|
|
@@ -1746,10 +1756,6 @@ DePay Select widget allows you to open a dialog that allows you to select things
|
|
|
1746
1756
|
|
|
1747
1757
|
Resolves with what has been selected by the user:
|
|
1748
1758
|
|
|
1749
|
-
```
|
|
1750
|
-
<script defer async src="https://integrate.depay.fi/widgets/v7.js"/>
|
|
1751
|
-
```
|
|
1752
|
-
|
|
1753
1759
|
```javascript
|
|
1754
1760
|
let token = await DePayWidgets.Select({ what: 'token' })
|
|
1755
1761
|
|
|
@@ -1834,3 +1840,36 @@ npm login
|
|
|
1834
1840
|
npm publish
|
|
1835
1841
|
```
|
|
1836
1842
|
|
|
1843
|
+
## Web3 Payments
|
|
1844
|
+
|
|
1845
|
+
The future is [Web3 Payments](https://depay.com/web3-payments).
|
|
1846
|
+
|
|
1847
|
+
Blockchains hold the potential to faster, simpler and smarter payments.
|
|
1848
|
+
|
|
1849
|
+
Web3 Payments are borderless, peer-to-peer, and support multiple tokens and blockchains.
|
|
1850
|
+
|
|
1851
|
+
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.
|
|
1852
|
+
|
|
1853
|
+
### Chain Agnostic (Multichain)
|
|
1854
|
+
|
|
1855
|
+
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.
|
|
1856
|
+
|
|
1857
|
+
### Permissionless
|
|
1858
|
+
|
|
1859
|
+
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.
|
|
1860
|
+
|
|
1861
|
+
### Trustless
|
|
1862
|
+
|
|
1863
|
+
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.
|
|
1864
|
+
|
|
1865
|
+
### Easy to use
|
|
1866
|
+
|
|
1867
|
+
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.
|
|
1868
|
+
|
|
1869
|
+
### Open Source
|
|
1870
|
+
|
|
1871
|
+
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.
|
|
1872
|
+
|
|
1873
|
+
### Multichain
|
|
1874
|
+
|
|
1875
|
+
[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.
|