@depay/widgets 7.15.0 → 7.15.3
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 +136 -112
- package/dist/esm/index.bundle.js +2 -2
- package/dist/esm/index.js +113 -91
- package/dist/umd/index.bundle.js +2 -2
- package/dist/umd/index.js +113 -91
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -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.com/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
|
|
|
@@ -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
|
|
|
@@ -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,29 @@ DePayWidgets.Payment({
|
|
|
660
660
|
})
|
|
661
661
|
```
|
|
662
662
|
|
|
663
|
-
|
|
663
|
+
Make sure to set the css value `position: relative;` for the container element. Otherwise it can not contain the widget.
|
|
664
|
+
|
|
665
|
+
React example:
|
|
666
|
+
|
|
667
|
+
```javascript
|
|
668
|
+
let CustomComponentWithWidget = (props)=>{
|
|
669
|
+
let container = useRef()
|
|
670
|
+
|
|
671
|
+
useEffect(()=>{
|
|
672
|
+
if(container.current) {
|
|
673
|
+
DePayWidgets.Payment({ ...defaultArguments, document,
|
|
674
|
+
container: container.current
|
|
675
|
+
})
|
|
676
|
+
}
|
|
677
|
+
}, [container])
|
|
678
|
+
|
|
679
|
+
return(
|
|
680
|
+
<div ref={container} style={{ position: 'relative', border: '1px solid black', width: "600px", height: "600px" }}></div>
|
|
681
|
+
)
|
|
682
|
+
}
|
|
683
|
+
```
|
|
684
|
+
|
|
685
|
+
#### style
|
|
664
686
|
|
|
665
687
|
`style`
|
|
666
688
|
|
|
@@ -687,7 +709,7 @@ DePayWidgets.Payment({
|
|
|
687
709
|
})
|
|
688
710
|
```
|
|
689
711
|
|
|
690
|
-
##### colors
|
|
712
|
+
##### colors
|
|
691
713
|
|
|
692
714
|
`colors`
|
|
693
715
|
|
|
@@ -707,7 +729,7 @@ DePayWidgets.Payment({
|
|
|
707
729
|
})
|
|
708
730
|
```
|
|
709
731
|
|
|
710
|
-
##### fontFamily
|
|
732
|
+
##### fontFamily
|
|
711
733
|
|
|
712
734
|
`fontFamily`
|
|
713
735
|
|
|
@@ -722,7 +744,7 @@ DePayWidgets.Payment({
|
|
|
722
744
|
})
|
|
723
745
|
```
|
|
724
746
|
|
|
725
|
-
##### css
|
|
747
|
+
##### css
|
|
726
748
|
|
|
727
749
|
`css`
|
|
728
750
|
|
|
@@ -743,7 +765,7 @@ DePayWidgets.Payment({
|
|
|
743
765
|
})
|
|
744
766
|
```
|
|
745
767
|
|
|
746
|
-
#### unmount
|
|
768
|
+
#### unmount
|
|
747
769
|
|
|
748
770
|
`unmount`
|
|
749
771
|
|
|
@@ -755,7 +777,7 @@ let { unmount } = await DePayWidgets.Payment({})
|
|
|
755
777
|
unmount()
|
|
756
778
|
```
|
|
757
779
|
|
|
758
|
-
#### recover
|
|
780
|
+
#### recover
|
|
759
781
|
|
|
760
782
|
`recover`
|
|
761
783
|
|
|
@@ -778,7 +800,7 @@ A recovered payment still results in a confirmed or failed payment, and also cal
|
|
|
778
800
|
|
|
779
801
|
```
|
|
780
802
|
|
|
781
|
-
#### closable
|
|
803
|
+
#### closable
|
|
782
804
|
|
|
783
805
|
`closable`
|
|
784
806
|
|
|
@@ -791,7 +813,7 @@ DePayWidgets.Payment({
|
|
|
791
813
|
|
|
792
814
|
```
|
|
793
815
|
|
|
794
|
-
#### integration
|
|
816
|
+
#### integration
|
|
795
817
|
|
|
796
818
|
`integration`
|
|
797
819
|
|
|
@@ -807,7 +829,7 @@ DePayWidgets.Payment({
|
|
|
807
829
|
|
|
808
830
|
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
831
|
|
|
810
|
-
### Preparation
|
|
832
|
+
### Preparation
|
|
811
833
|
|
|
812
834
|
In order to sell tokens in a decentralized way, that token needs to have a liquidity pool on a decentralized exchange:
|
|
813
835
|
|
|
@@ -815,11 +837,7 @@ In order to sell tokens in a decentralized way, that token needs to have a liqui
|
|
|
815
837
|
- [Create Uniswap v2 Liquidity Pool (Polygon)](https://app.uniswap.org/#/add/v2/ETH?chain=polygon)
|
|
816
838
|
- [Create Pancakeswap Liquidity Pool](https://pancakeswap.finance/add)
|
|
817
839
|
|
|
818
|
-
### Quick start
|
|
819
|
-
|
|
820
|
-
```
|
|
821
|
-
<script defer async src="https://integrate.depay.com/widgets/v7.js"/>
|
|
822
|
-
```
|
|
840
|
+
### Quick start
|
|
823
841
|
|
|
824
842
|
```javascript
|
|
825
843
|
DePayWidgets.Sale({
|
|
@@ -829,7 +847,7 @@ DePayWidgets.Sale({
|
|
|
829
847
|
});
|
|
830
848
|
```
|
|
831
849
|
|
|
832
|
-
### Configuration
|
|
850
|
+
### Configuration
|
|
833
851
|
|
|
834
852
|
You need to pass a configuration object to `DePayWidgets.Sale` which needs to at least contain the `sell` field:
|
|
835
853
|
|
|
@@ -852,7 +870,7 @@ DePayWidgets.Sale({
|
|
|
852
870
|
});
|
|
853
871
|
```
|
|
854
872
|
|
|
855
|
-
#### sell
|
|
873
|
+
#### sell
|
|
856
874
|
|
|
857
875
|
`"blockchain": "token"`
|
|
858
876
|
|
|
@@ -869,7 +887,7 @@ The address of the token you want to sell.
|
|
|
869
887
|
|
|
870
888
|
Use our [sale configurator](https://depay.com/documentation/sales#sale-configurator) in order to simplify configuring this.
|
|
871
889
|
|
|
872
|
-
#### amount
|
|
890
|
+
#### amount
|
|
873
891
|
|
|
874
892
|
When you want to control how the amount selection behaves, pass the `amount` configuration object,
|
|
875
893
|
alongside values for `start`, `min` and `step`.
|
|
@@ -891,7 +909,7 @@ DePayWidgets.Sale({
|
|
|
891
909
|
});
|
|
892
910
|
```
|
|
893
911
|
|
|
894
|
-
#### connected
|
|
912
|
+
#### connected
|
|
895
913
|
|
|
896
914
|
`connected`
|
|
897
915
|
|
|
@@ -908,7 +926,7 @@ DePayWidgets.Sale({
|
|
|
908
926
|
});
|
|
909
927
|
```
|
|
910
928
|
|
|
911
|
-
#### closed
|
|
929
|
+
#### closed
|
|
912
930
|
|
|
913
931
|
`closed`
|
|
914
932
|
|
|
@@ -923,7 +941,7 @@ DePayWidgets.Sale({
|
|
|
923
941
|
});
|
|
924
942
|
```
|
|
925
943
|
|
|
926
|
-
#### sent
|
|
944
|
+
#### sent
|
|
927
945
|
|
|
928
946
|
`sent`
|
|
929
947
|
|
|
@@ -940,7 +958,7 @@ DePayWidgets.Sale({
|
|
|
940
958
|
});
|
|
941
959
|
```
|
|
942
960
|
|
|
943
|
-
#### confirmed
|
|
961
|
+
#### confirmed
|
|
944
962
|
|
|
945
963
|
`confirmed`
|
|
946
964
|
|
|
@@ -957,7 +975,7 @@ DePayWidgets.Sale({
|
|
|
957
975
|
});
|
|
958
976
|
```
|
|
959
977
|
|
|
960
|
-
#### failed
|
|
978
|
+
#### failed
|
|
961
979
|
|
|
962
980
|
`failed`
|
|
963
981
|
|
|
@@ -975,7 +993,7 @@ DePayWidgets.Sale({
|
|
|
975
993
|
});
|
|
976
994
|
```
|
|
977
995
|
|
|
978
|
-
#### critical
|
|
996
|
+
#### critical
|
|
979
997
|
|
|
980
998
|
`critical`
|
|
981
999
|
|
|
@@ -990,7 +1008,7 @@ DePayWidgets.Sale({
|
|
|
990
1008
|
});
|
|
991
1009
|
```
|
|
992
1010
|
|
|
993
|
-
#### error
|
|
1011
|
+
#### error
|
|
994
1012
|
|
|
995
1013
|
`error`
|
|
996
1014
|
|
|
@@ -1006,7 +1024,7 @@ DePayWidgets.Sale({
|
|
|
1006
1024
|
});
|
|
1007
1025
|
```
|
|
1008
1026
|
|
|
1009
|
-
#### providers
|
|
1027
|
+
#### providers
|
|
1010
1028
|
|
|
1011
1029
|
Allows to set providers to be used for making RPC calls to the individiual blockchains:
|
|
1012
1030
|
|
|
@@ -1020,7 +1038,7 @@ DePayWidgets.Sale({
|
|
|
1020
1038
|
});
|
|
1021
1039
|
```
|
|
1022
1040
|
|
|
1023
|
-
#### currency
|
|
1041
|
+
#### currency
|
|
1024
1042
|
|
|
1025
1043
|
Allows you to enforce displayed local currency (instead of automatically detecting it):
|
|
1026
1044
|
|
|
@@ -1032,7 +1050,7 @@ DePayWidgets.Sale({
|
|
|
1032
1050
|
});
|
|
1033
1051
|
```
|
|
1034
1052
|
|
|
1035
|
-
#### blacklist
|
|
1053
|
+
#### blacklist
|
|
1036
1054
|
|
|
1037
1055
|
Allows to blacklist tokens so that they will not be suggested as means of payment (from the sender):
|
|
1038
1056
|
|
|
@@ -1067,7 +1085,7 @@ DePayWidgets.Sale({
|
|
|
1067
1085
|
});
|
|
1068
1086
|
```
|
|
1069
1087
|
|
|
1070
|
-
#### tokenImage
|
|
1088
|
+
#### tokenImage
|
|
1071
1089
|
|
|
1072
1090
|
`tokenImage`
|
|
1073
1091
|
|
|
@@ -1081,7 +1099,7 @@ DePayWidgets.Sale({
|
|
|
1081
1099
|
});
|
|
1082
1100
|
```
|
|
1083
1101
|
|
|
1084
|
-
#### style
|
|
1102
|
+
#### style
|
|
1085
1103
|
|
|
1086
1104
|
`style`
|
|
1087
1105
|
|
|
@@ -1109,7 +1127,7 @@ DePayWidgets.Sale({
|
|
|
1109
1127
|
});
|
|
1110
1128
|
```
|
|
1111
1129
|
|
|
1112
|
-
##### colors
|
|
1130
|
+
##### colors
|
|
1113
1131
|
|
|
1114
1132
|
`colors`
|
|
1115
1133
|
|
|
@@ -1129,7 +1147,7 @@ DePayWidgets.Sale({
|
|
|
1129
1147
|
});
|
|
1130
1148
|
```
|
|
1131
1149
|
|
|
1132
|
-
##### fontFamily
|
|
1150
|
+
##### fontFamily
|
|
1133
1151
|
|
|
1134
1152
|
`fontFamily`
|
|
1135
1153
|
|
|
@@ -1144,7 +1162,7 @@ DePayWidgets.Sale({
|
|
|
1144
1162
|
});
|
|
1145
1163
|
```
|
|
1146
1164
|
|
|
1147
|
-
##### css
|
|
1165
|
+
##### css
|
|
1148
1166
|
|
|
1149
1167
|
`css`
|
|
1150
1168
|
|
|
@@ -1165,7 +1183,7 @@ DePayWidgets.Sale({
|
|
|
1165
1183
|
});
|
|
1166
1184
|
```
|
|
1167
1185
|
|
|
1168
|
-
#### unmount
|
|
1186
|
+
#### unmount
|
|
1169
1187
|
|
|
1170
1188
|
`unmount`
|
|
1171
1189
|
|
|
@@ -1177,7 +1195,7 @@ let { unmount } = await DePayWidgets.Sale({})
|
|
|
1177
1195
|
unmount()
|
|
1178
1196
|
```
|
|
1179
1197
|
|
|
1180
|
-
#### closable
|
|
1198
|
+
#### closable
|
|
1181
1199
|
|
|
1182
1200
|
`closable`
|
|
1183
1201
|
|
|
@@ -1190,7 +1208,7 @@ DePayWidgets.Sale({
|
|
|
1190
1208
|
|
|
1191
1209
|
```
|
|
1192
1210
|
|
|
1193
|
-
#### integration
|
|
1211
|
+
#### integration
|
|
1194
1212
|
|
|
1195
1213
|
`integration`
|
|
1196
1214
|
|
|
@@ -1206,18 +1224,14 @@ DePayWidgets.Sale({
|
|
|
1206
1224
|
|
|
1207
1225
|
DePay Donations allows you to accept donation payments made with thousands of different crypto currencies.
|
|
1208
1226
|
|
|
1209
|
-
### Preparation
|
|
1227
|
+
### Preparation
|
|
1210
1228
|
|
|
1211
1229
|
In order to receive decentralized donation payments on any blockchain you need to have your own wallet on that particular blockchain first:
|
|
1212
1230
|
|
|
1213
1231
|
- [Create an Ethereum wallet](https://ethereum.org/en/wallets/)
|
|
1214
1232
|
- [Create an BSC wallet](https://academy.binance.com/en/articles/how-to-get-started-with-binance-smart-chain-bsc)
|
|
1215
1233
|
|
|
1216
|
-
### Quick start
|
|
1217
|
-
|
|
1218
|
-
```
|
|
1219
|
-
<script defer async src="https://integrate.depay.com/widgets/v7.js"/>
|
|
1220
|
-
```
|
|
1234
|
+
### Quick start
|
|
1221
1235
|
|
|
1222
1236
|
```javascript
|
|
1223
1237
|
DePayWidgets.Donation({
|
|
@@ -1229,7 +1243,7 @@ DePayWidgets.Donation({
|
|
|
1229
1243
|
});
|
|
1230
1244
|
```
|
|
1231
1245
|
|
|
1232
|
-
### Configuration
|
|
1246
|
+
### Configuration
|
|
1233
1247
|
|
|
1234
1248
|
You need to pass a configuration object to `DePayWidgets.Donation` which needs to at least contain the `accept` field:
|
|
1235
1249
|
|
|
@@ -1259,7 +1273,7 @@ DePayWidgets.Donation({
|
|
|
1259
1273
|
});
|
|
1260
1274
|
```
|
|
1261
1275
|
|
|
1262
|
-
#### accept
|
|
1276
|
+
#### accept
|
|
1263
1277
|
|
|
1264
1278
|
`blockchain`
|
|
1265
1279
|
|
|
@@ -1280,7 +1294,7 @@ Use our [donation configurator](https://depay.com/documentation/donations#donati
|
|
|
1280
1294
|
|
|
1281
1295
|
The address receiving the donation. Always double check that you've set the right address.
|
|
1282
1296
|
|
|
1283
|
-
#### amount
|
|
1297
|
+
#### amount
|
|
1284
1298
|
|
|
1285
1299
|
When you want to control how the amount selection behaves, pass the `amount` configuration object,
|
|
1286
1300
|
alongside values for `start`, `min` and `step`.
|
|
@@ -1291,7 +1305,7 @@ alongside values for `start`, `min` and `step`.
|
|
|
1291
1305
|
|
|
1292
1306
|
`step`: The number by wich to increment/decremten changes to the amount.
|
|
1293
1307
|
|
|
1294
|
-
#### connected
|
|
1308
|
+
#### connected
|
|
1295
1309
|
|
|
1296
1310
|
`connected`
|
|
1297
1311
|
|
|
@@ -1308,7 +1322,7 @@ DePayWidgets.Donation({
|
|
|
1308
1322
|
});
|
|
1309
1323
|
```
|
|
1310
1324
|
|
|
1311
|
-
#### fee
|
|
1325
|
+
#### fee
|
|
1312
1326
|
|
|
1313
1327
|
You can configure a fee which will be applied to every payment with it's own dedicated fee receiver address.
|
|
1314
1328
|
|
|
@@ -1328,7 +1342,7 @@ DePayWidgets.Donation({
|
|
|
1328
1342
|
});
|
|
1329
1343
|
```
|
|
1330
1344
|
|
|
1331
|
-
#### closed
|
|
1345
|
+
#### closed
|
|
1332
1346
|
|
|
1333
1347
|
`closed`
|
|
1334
1348
|
|
|
@@ -1343,7 +1357,7 @@ DePayWidgets.Donation({
|
|
|
1343
1357
|
});
|
|
1344
1358
|
```
|
|
1345
1359
|
|
|
1346
|
-
#### sent
|
|
1360
|
+
#### sent
|
|
1347
1361
|
|
|
1348
1362
|
`sent`
|
|
1349
1363
|
|
|
@@ -1360,7 +1374,7 @@ DePayWidgets.Donation({
|
|
|
1360
1374
|
});
|
|
1361
1375
|
```
|
|
1362
1376
|
|
|
1363
|
-
#### confirmed
|
|
1377
|
+
#### confirmed
|
|
1364
1378
|
|
|
1365
1379
|
`confirmed`
|
|
1366
1380
|
|
|
@@ -1377,7 +1391,7 @@ DePayWidgets.Donation({
|
|
|
1377
1391
|
});
|
|
1378
1392
|
```
|
|
1379
1393
|
|
|
1380
|
-
#### validated
|
|
1394
|
+
#### validated
|
|
1381
1395
|
|
|
1382
1396
|
`validated`
|
|
1383
1397
|
|
|
@@ -1392,7 +1406,7 @@ DePayWidgets.Payment({
|
|
|
1392
1406
|
})
|
|
1393
1407
|
```
|
|
1394
1408
|
|
|
1395
|
-
#### failed
|
|
1409
|
+
#### failed
|
|
1396
1410
|
|
|
1397
1411
|
`failed`
|
|
1398
1412
|
|
|
@@ -1410,7 +1424,7 @@ DePayWidgets.Donation({
|
|
|
1410
1424
|
});
|
|
1411
1425
|
```
|
|
1412
1426
|
|
|
1413
|
-
#### critical
|
|
1427
|
+
#### critical
|
|
1414
1428
|
|
|
1415
1429
|
`critical`
|
|
1416
1430
|
|
|
@@ -1425,7 +1439,7 @@ DePayWidgets.Donation({
|
|
|
1425
1439
|
});
|
|
1426
1440
|
```
|
|
1427
1441
|
|
|
1428
|
-
#### error
|
|
1442
|
+
#### error
|
|
1429
1443
|
|
|
1430
1444
|
`error`
|
|
1431
1445
|
|
|
@@ -1441,7 +1455,7 @@ DePayWidgets.Donation({
|
|
|
1441
1455
|
});
|
|
1442
1456
|
```
|
|
1443
1457
|
|
|
1444
|
-
#### providers
|
|
1458
|
+
#### providers
|
|
1445
1459
|
|
|
1446
1460
|
Allows to set providers to be used for making RPC calls to the individiual blockchains:
|
|
1447
1461
|
|
|
@@ -1455,7 +1469,7 @@ DePayWidgets.Donation({
|
|
|
1455
1469
|
});
|
|
1456
1470
|
```
|
|
1457
1471
|
|
|
1458
|
-
#### currency
|
|
1472
|
+
#### currency
|
|
1459
1473
|
|
|
1460
1474
|
Allows you to enforce displayed local currency (instead of automatically detecting it):
|
|
1461
1475
|
|
|
@@ -1467,7 +1481,7 @@ DePayWidgets.Donation({
|
|
|
1467
1481
|
});
|
|
1468
1482
|
```
|
|
1469
1483
|
|
|
1470
|
-
#### whitelist
|
|
1484
|
+
#### whitelist
|
|
1471
1485
|
|
|
1472
1486
|
Allows only the configured tokens to be eligible as means of payment (from the sender):
|
|
1473
1487
|
|
|
@@ -1493,7 +1507,7 @@ DePayWidgets.Donation({
|
|
|
1493
1507
|
})
|
|
1494
1508
|
```
|
|
1495
1509
|
|
|
1496
|
-
#### blacklist
|
|
1510
|
+
#### blacklist
|
|
1497
1511
|
|
|
1498
1512
|
Allows to blacklist tokens so that they will not be suggested as means of payment (from the sender):
|
|
1499
1513
|
|
|
@@ -1528,7 +1542,7 @@ DePayWidgets.Donation({
|
|
|
1528
1542
|
})
|
|
1529
1543
|
```
|
|
1530
1544
|
|
|
1531
|
-
#### container
|
|
1545
|
+
#### container
|
|
1532
1546
|
|
|
1533
1547
|
`container`
|
|
1534
1548
|
|
|
@@ -1540,7 +1554,29 @@ DePayWidgets.Dontaion({
|
|
|
1540
1554
|
})
|
|
1541
1555
|
```
|
|
1542
1556
|
|
|
1543
|
-
|
|
1557
|
+
Make sure to set the css value `position: relative;` for the container element. Otherwise it can not contain the widget.
|
|
1558
|
+
|
|
1559
|
+
React example:
|
|
1560
|
+
|
|
1561
|
+
```javascript
|
|
1562
|
+
let CustomComponentWithWidget = (props)=>{
|
|
1563
|
+
let container = useRef()
|
|
1564
|
+
|
|
1565
|
+
useEffect(()=>{
|
|
1566
|
+
if(container.current) {
|
|
1567
|
+
DePayWidgets.Payment({ ...defaultArguments, document,
|
|
1568
|
+
container: container.current
|
|
1569
|
+
})
|
|
1570
|
+
}
|
|
1571
|
+
}, [container])
|
|
1572
|
+
|
|
1573
|
+
return(
|
|
1574
|
+
<div ref={container} style={{ position: 'relative', border: '1px solid black', width: "600px", height: "600px" }}></div>
|
|
1575
|
+
)
|
|
1576
|
+
}
|
|
1577
|
+
```
|
|
1578
|
+
|
|
1579
|
+
#### style
|
|
1544
1580
|
|
|
1545
1581
|
`style`
|
|
1546
1582
|
|
|
@@ -1568,7 +1604,7 @@ DePayWidgets.Donation({
|
|
|
1568
1604
|
});
|
|
1569
1605
|
```
|
|
1570
1606
|
|
|
1571
|
-
##### colors
|
|
1607
|
+
##### colors
|
|
1572
1608
|
|
|
1573
1609
|
`colors`
|
|
1574
1610
|
|
|
@@ -1588,7 +1624,7 @@ DePayWidgets.Donation({
|
|
|
1588
1624
|
});
|
|
1589
1625
|
```
|
|
1590
1626
|
|
|
1591
|
-
##### fontFamily
|
|
1627
|
+
##### fontFamily
|
|
1592
1628
|
|
|
1593
1629
|
`fontFamily`
|
|
1594
1630
|
|
|
@@ -1603,7 +1639,7 @@ DePayWidgets.Donation({
|
|
|
1603
1639
|
});
|
|
1604
1640
|
```
|
|
1605
1641
|
|
|
1606
|
-
##### css
|
|
1642
|
+
##### css
|
|
1607
1643
|
|
|
1608
1644
|
`css`
|
|
1609
1645
|
|
|
@@ -1624,7 +1660,7 @@ DePayWidgets.Donation({
|
|
|
1624
1660
|
});
|
|
1625
1661
|
```
|
|
1626
1662
|
|
|
1627
|
-
#### unmount
|
|
1663
|
+
#### unmount
|
|
1628
1664
|
|
|
1629
1665
|
`unmount`
|
|
1630
1666
|
|
|
@@ -1636,7 +1672,7 @@ let { unmount } = await DePayWidgets.Donation({})
|
|
|
1636
1672
|
unmount()
|
|
1637
1673
|
```
|
|
1638
1674
|
|
|
1639
|
-
#### closable
|
|
1675
|
+
#### closable
|
|
1640
1676
|
|
|
1641
1677
|
`closable`
|
|
1642
1678
|
|
|
@@ -1649,7 +1685,7 @@ DePayWidgets.Donation({
|
|
|
1649
1685
|
|
|
1650
1686
|
```
|
|
1651
1687
|
|
|
1652
|
-
#### integration
|
|
1688
|
+
#### integration
|
|
1653
1689
|
|
|
1654
1690
|
`integration`
|
|
1655
1691
|
|
|
@@ -1661,23 +1697,19 @@ DePayWidgets.Donation({
|
|
|
1661
1697
|
})
|
|
1662
1698
|
```
|
|
1663
1699
|
|
|
1664
|
-
## DePay Connect
|
|
1700
|
+
## DePay Connect
|
|
1665
1701
|
|
|
1666
1702
|
DePay Connect allows you to have your users connect their crypto wallet to your dApp or website.
|
|
1667
1703
|
|
|
1668
1704
|
Returns connected `account`, `accounts` and `wallet` in return.
|
|
1669
1705
|
|
|
1670
|
-
```
|
|
1671
|
-
<script defer async src="https://integrate.depay.com/widgets/v7.js"/>
|
|
1672
|
-
```
|
|
1673
|
-
|
|
1674
1706
|
```javascript
|
|
1675
1707
|
let { account, accounts, wallet } = await DePayWidgets.Connect()
|
|
1676
1708
|
```
|
|
1677
1709
|
|
|
1678
1710
|
See [depay-web3-wallets](https://github.com/depayfi/depay-web3-wallets) for more details about the returned `wallet`.
|
|
1679
1711
|
|
|
1680
|
-
### Rejections
|
|
1712
|
+
### Rejections
|
|
1681
1713
|
|
|
1682
1714
|
1. Rejects if user just closes the dialog without connecting any wallet:
|
|
1683
1715
|
|
|
@@ -1695,10 +1727,6 @@ DePay Login allows you to perform web3 wallet logins with ease.
|
|
|
1695
1727
|
|
|
1696
1728
|
Returns `account` if succesfully signed and recovered log in message.
|
|
1697
1729
|
|
|
1698
|
-
```
|
|
1699
|
-
<script defer async src="https://integrate.depay.com/widgets/v7.js"/>
|
|
1700
|
-
```
|
|
1701
|
-
|
|
1702
1730
|
```javascript
|
|
1703
1731
|
let message = "Sign to login"
|
|
1704
1732
|
let account = await DePayWidgets.Login({ message })
|
|
@@ -1754,7 +1782,7 @@ DePayWidgets.Login({ message, recover: ({ message, signature })=>{
|
|
|
1754
1782
|
})
|
|
1755
1783
|
```
|
|
1756
1784
|
|
|
1757
|
-
### Rejections
|
|
1785
|
+
### Rejections
|
|
1758
1786
|
|
|
1759
1787
|
1. Rejects if user just closes the dialog without connecting any wallet:
|
|
1760
1788
|
|
|
@@ -1772,10 +1800,6 @@ DePay Select widget allows you to open a dialog that allows you to select things
|
|
|
1772
1800
|
|
|
1773
1801
|
Resolves with what has been selected by the user:
|
|
1774
1802
|
|
|
1775
|
-
```
|
|
1776
|
-
<script defer async src="https://integrate.depay.com/widgets/v7.js"/>
|
|
1777
|
-
```
|
|
1778
|
-
|
|
1779
1803
|
```javascript
|
|
1780
1804
|
let token = await DePayWidgets.Select({ what: 'token' })
|
|
1781
1805
|
|