@depay/widgets 6.23.0 → 6.25.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 +127 -78
- package/dist/esm/index.bundle.js +17820 -418
- package/dist/esm/index.js +121 -45
- package/dist/umd/index.bundle.js +17820 -418
- package/dist/umd/index.js +121 -45
- package/package.json +6 -5
package/README.md
CHANGED
|
@@ -52,14 +52,14 @@ via WalletConnect:
|
|
|
52
52
|
|
|
53
53
|
DePay Payments allows you to accept and perform crypto payments.
|
|
54
54
|
|
|
55
|
-
### Preparation
|
|
55
|
+
### Preparation (DePay Payments)
|
|
56
56
|
|
|
57
57
|
In order to receive decentralized payments on any blockchain you need to have your own wallet on that particular blockchain first:
|
|
58
58
|
|
|
59
59
|
- [Create an Ethereum wallet](https://ethereum.org/en/wallets/)
|
|
60
60
|
- [Create an BSC wallet](https://academy.binance.com/en/articles/how-to-get-started-with-binance-smart-chain-bsc)
|
|
61
61
|
|
|
62
|
-
### Quick start
|
|
62
|
+
### Quick start (DePay Payments)
|
|
63
63
|
|
|
64
64
|
```
|
|
65
65
|
<script src="https://integrate.depay.fi/widgets/v6.js"/>
|
|
@@ -76,7 +76,7 @@ DePayWidgets.Payment({
|
|
|
76
76
|
});
|
|
77
77
|
```
|
|
78
78
|
|
|
79
|
-
### Configuration
|
|
79
|
+
### Configuration (DePay Payments)
|
|
80
80
|
|
|
81
81
|
You need to pass a configuration object to `DePayWidgets.Payment` which needs to at least contain the `accept` field:
|
|
82
82
|
|
|
@@ -111,7 +111,7 @@ DePayWidgets.Payment({
|
|
|
111
111
|
});
|
|
112
112
|
```
|
|
113
113
|
|
|
114
|
-
#### accept
|
|
114
|
+
#### accept (DePay Payments)
|
|
115
115
|
|
|
116
116
|
`blockchain`
|
|
117
117
|
|
|
@@ -141,7 +141,7 @@ If you do not pass an amount, the user will be able to select an amount within t
|
|
|
141
141
|
|
|
142
142
|
The address receiving the payment. Always double check that you've set the right address.
|
|
143
143
|
|
|
144
|
-
#### amount
|
|
144
|
+
#### amount (DePay Payments)
|
|
145
145
|
|
|
146
146
|
When you want to control how the amount selection behaves, pass the `amount` configuration object,
|
|
147
147
|
alongside values for `start`, `min` and `step`.
|
|
@@ -152,7 +152,7 @@ alongside values for `start`, `min` and `step`.
|
|
|
152
152
|
|
|
153
153
|
`step`: The number by wich to increment/decremten changes to the amount.
|
|
154
154
|
|
|
155
|
-
#### receiver
|
|
155
|
+
#### receiver (DePay Payments)
|
|
156
156
|
|
|
157
157
|
Payment receivers can either be wallet addresses, but also smart contracts.
|
|
158
158
|
|
|
@@ -178,7 +178,7 @@ DePayWidgets.Payment({
|
|
|
178
178
|
|
|
179
179
|
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.
|
|
180
180
|
|
|
181
|
-
#### fee
|
|
181
|
+
#### fee (DePay Payments)
|
|
182
182
|
|
|
183
183
|
You can configure a fee which will be applied to every payment with it's own dedicated fee receiver address.
|
|
184
184
|
|
|
@@ -198,7 +198,7 @@ DePayWidgets.Payment({
|
|
|
198
198
|
});
|
|
199
199
|
```
|
|
200
200
|
|
|
201
|
-
#### fromToken, fromAmount + toToken
|
|
201
|
+
#### fromToken, fromAmount + toToken (DePay Payments)
|
|
202
202
|
|
|
203
203
|
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`.
|
|
204
204
|
|
|
@@ -218,11 +218,38 @@ DePayWidgets.Payment({
|
|
|
218
218
|
// This will open a payment widget to send 0.1 BUSD to the receiver, converting it to BNB along the way.
|
|
219
219
|
```
|
|
220
220
|
|
|
221
|
-
####
|
|
221
|
+
#### preload (DePay Payments)
|
|
222
|
+
|
|
223
|
+
To optimize initialization speed of the Payment Widget you can preload payment routes as soon as you become aware of the users wallet address.
|
|
224
|
+
|
|
225
|
+
Typically right after the users conncets his wallet, or in cases the user has his wallet already connected you can preload immediatelly:
|
|
226
|
+
|
|
227
|
+
```javascript
|
|
228
|
+
let address = '0x4aD374e0836c26BeC213a19D3e030F8b3A8AcDE4' // e.g. retrieve it right when you perform wallet connect
|
|
229
|
+
|
|
230
|
+
DePayWidgets.Payment.preload({
|
|
231
|
+
account: address,
|
|
232
|
+
accept: [
|
|
233
|
+
{
|
|
234
|
+
blockchain: 'ethereum',
|
|
235
|
+
amount: 10,
|
|
236
|
+
token: '0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb',
|
|
237
|
+
receiver: '0x4e260bB2b25EC6F3A59B478fCDe5eD5B8D783B02'
|
|
238
|
+
},{
|
|
239
|
+
blockchain: 'bsc',
|
|
240
|
+
amount: 10,
|
|
241
|
+
token: '0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb',
|
|
242
|
+
receiver: '0x4e260bB2b25EC6F3A59B478fCDe5eD5B8D783B02'
|
|
243
|
+
}
|
|
244
|
+
]
|
|
245
|
+
});
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
#### track (DePay Payments)
|
|
222
249
|
|
|
223
250
|
`track`
|
|
224
251
|
|
|
225
|
-
Allows to track payment confirmation via DePay to
|
|
252
|
+
Allows to track payment confirmation/validation via DePay API to trigger callbacks into your existing systems:
|
|
226
253
|
|
|
227
254
|
```javascript
|
|
228
255
|
DePayWidgets.Payment({
|
|
@@ -278,6 +305,28 @@ Payment tracking requests will be attempted up to 3 times by the widget and will
|
|
|
278
305
|
|
|
279
306
|
A failed payment tracking will also call the [error callback](#error) with `{code: "TRACKING_FAILED"}`.
|
|
280
307
|
|
|
308
|
+
##### Asynchronous Validation
|
|
309
|
+
|
|
310
|
+
For improving user experience, we recommend performing payment validation asynchronously as in certain situation in can take up to multiple minutes.
|
|
311
|
+
|
|
312
|
+
You can configure the widget to track/validate the payment asynchronously:
|
|
313
|
+
|
|
314
|
+
```javascript
|
|
315
|
+
DePayWidgets.Payment({
|
|
316
|
+
|
|
317
|
+
track: {
|
|
318
|
+
endpoint: '/track',
|
|
319
|
+
async: true
|
|
320
|
+
}
|
|
321
|
+
})
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
Which will release the user right after the payment has been confirmed on the user's machine.
|
|
325
|
+
|
|
326
|
+
It still tracks and validates the payment asynchronously and calls back your endpoints as soon as it has been validated.
|
|
327
|
+
|
|
328
|
+
This allows you to release the user immediately, showing him some confirmation and reconfirming his payment in an asynchronous step (like a notification or email).
|
|
329
|
+
|
|
281
330
|
##### Additional Polling
|
|
282
331
|
|
|
283
332
|
In order to ensure a 100% coverage that users are released and forwarded within your payment flow, you will need to implement polling in addition to tracking.
|
|
@@ -294,7 +343,7 @@ In case you want to redirect the user to the next step in your system the poll e
|
|
|
294
343
|
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
|
|
295
344
|
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.
|
|
296
345
|
|
|
297
|
-
#### connected
|
|
346
|
+
#### connected (DePay Payments)
|
|
298
347
|
|
|
299
348
|
`connected`
|
|
300
349
|
|
|
@@ -312,7 +361,7 @@ DePayWidgets.Payment({
|
|
|
312
361
|
|
|
313
362
|
```
|
|
314
363
|
|
|
315
|
-
#### closed
|
|
364
|
+
#### closed (DePay Payments)
|
|
316
365
|
|
|
317
366
|
`closed`
|
|
318
367
|
|
|
@@ -328,7 +377,7 @@ DePayWidgets.Payment({
|
|
|
328
377
|
|
|
329
378
|
```
|
|
330
379
|
|
|
331
|
-
#### sent
|
|
380
|
+
#### sent (DePay Payments)
|
|
332
381
|
|
|
333
382
|
`sent`
|
|
334
383
|
|
|
@@ -345,7 +394,7 @@ DePayWidgets.Payment({
|
|
|
345
394
|
})
|
|
346
395
|
```
|
|
347
396
|
|
|
348
|
-
#### confirmed
|
|
397
|
+
#### confirmed (DePay Payments)
|
|
349
398
|
|
|
350
399
|
`confirmed`
|
|
351
400
|
|
|
@@ -362,7 +411,7 @@ DePayWidgets.Payment({
|
|
|
362
411
|
})
|
|
363
412
|
```
|
|
364
413
|
|
|
365
|
-
#### failed
|
|
414
|
+
#### failed (DePay Payments)
|
|
366
415
|
|
|
367
416
|
`failed`
|
|
368
417
|
|
|
@@ -380,7 +429,7 @@ DePayWidgets.Payment({
|
|
|
380
429
|
})
|
|
381
430
|
```
|
|
382
431
|
|
|
383
|
-
#### critical
|
|
432
|
+
#### critical (DePay Payments)
|
|
384
433
|
|
|
385
434
|
`critical`
|
|
386
435
|
|
|
@@ -395,7 +444,7 @@ DePayWidgets.Payment({
|
|
|
395
444
|
})
|
|
396
445
|
```
|
|
397
446
|
|
|
398
|
-
#### error
|
|
447
|
+
#### error (DePay Payments)
|
|
399
448
|
|
|
400
449
|
`error`
|
|
401
450
|
|
|
@@ -411,7 +460,7 @@ DePayWidgets.Payment({
|
|
|
411
460
|
})
|
|
412
461
|
```
|
|
413
462
|
|
|
414
|
-
#### providers
|
|
463
|
+
#### providers (DePay Payments)
|
|
415
464
|
|
|
416
465
|
Allows to set providers to be used for making RPC calls to the individiual blockchains:
|
|
417
466
|
|
|
@@ -425,7 +474,7 @@ DePayWidgets.Payment({
|
|
|
425
474
|
})
|
|
426
475
|
```
|
|
427
476
|
|
|
428
|
-
#### currency
|
|
477
|
+
#### currency (DePay Payments)
|
|
429
478
|
|
|
430
479
|
Allows you to enforce displayed local currency (instead of automatically detecting it):
|
|
431
480
|
|
|
@@ -439,7 +488,7 @@ DePayWidgets.Payment({
|
|
|
439
488
|
|
|
440
489
|
```
|
|
441
490
|
|
|
442
|
-
#### whitelist
|
|
491
|
+
#### whitelist (DePay Payments)
|
|
443
492
|
|
|
444
493
|
Allows only the configured tokens to be eligible as means of payment (from the sender):
|
|
445
494
|
|
|
@@ -463,7 +512,7 @@ DePayWidgets.Payment({
|
|
|
463
512
|
|
|
464
513
|
```
|
|
465
514
|
|
|
466
|
-
#### blacklist
|
|
515
|
+
#### blacklist (DePay Payments)
|
|
467
516
|
|
|
468
517
|
Allows to blacklist tokens so that they will not be suggested as means of payment (from the sender):
|
|
469
518
|
|
|
@@ -498,7 +547,7 @@ DePayWidgets.Payment({
|
|
|
498
547
|
})
|
|
499
548
|
```
|
|
500
549
|
|
|
501
|
-
#### event
|
|
550
|
+
#### event (DePay Payments)
|
|
502
551
|
|
|
503
552
|
`event`
|
|
504
553
|
|
|
@@ -514,7 +563,7 @@ DePayWidgets.Payment({
|
|
|
514
563
|
})
|
|
515
564
|
```
|
|
516
565
|
|
|
517
|
-
#### style
|
|
566
|
+
#### style (DePay Payments)
|
|
518
567
|
|
|
519
568
|
`style`
|
|
520
569
|
|
|
@@ -541,7 +590,7 @@ DePayWidgets.Payment({
|
|
|
541
590
|
})
|
|
542
591
|
```
|
|
543
592
|
|
|
544
|
-
##### colors
|
|
593
|
+
##### colors (DePay Payments)
|
|
545
594
|
|
|
546
595
|
`colors`
|
|
547
596
|
|
|
@@ -561,7 +610,7 @@ DePayWidgets.Payment({
|
|
|
561
610
|
})
|
|
562
611
|
```
|
|
563
612
|
|
|
564
|
-
##### fontFamily
|
|
613
|
+
##### fontFamily (DePay Payments)
|
|
565
614
|
|
|
566
615
|
`fontFamily`
|
|
567
616
|
|
|
@@ -576,7 +625,7 @@ DePayWidgets.Payment({
|
|
|
576
625
|
})
|
|
577
626
|
```
|
|
578
627
|
|
|
579
|
-
##### css
|
|
628
|
+
##### css (DePay Payments)
|
|
580
629
|
|
|
581
630
|
`css`
|
|
582
631
|
|
|
@@ -597,7 +646,7 @@ DePayWidgets.Payment({
|
|
|
597
646
|
})
|
|
598
647
|
```
|
|
599
648
|
|
|
600
|
-
#### unmount
|
|
649
|
+
#### unmount (DePay Payments)
|
|
601
650
|
|
|
602
651
|
`unmount`
|
|
603
652
|
|
|
@@ -609,7 +658,7 @@ let { unmount } = await DePayWidgets.Payment({})
|
|
|
609
658
|
unmount()
|
|
610
659
|
```
|
|
611
660
|
|
|
612
|
-
#### recover
|
|
661
|
+
#### recover (DePay Payments)
|
|
613
662
|
|
|
614
663
|
`recover`
|
|
615
664
|
|
|
@@ -632,7 +681,7 @@ A recovered payment still results in a confirmed or failed payment, and also cal
|
|
|
632
681
|
|
|
633
682
|
```
|
|
634
683
|
|
|
635
|
-
#### closable
|
|
684
|
+
#### closable (DePay Payments)
|
|
636
685
|
|
|
637
686
|
`closable`
|
|
638
687
|
|
|
@@ -645,7 +694,7 @@ DePayWidgets.Payment({
|
|
|
645
694
|
|
|
646
695
|
```
|
|
647
696
|
|
|
648
|
-
#### integration
|
|
697
|
+
#### integration (DePay Payments)
|
|
649
698
|
|
|
650
699
|
`integration`
|
|
651
700
|
|
|
@@ -661,14 +710,14 @@ DePayWidgets.Payment({
|
|
|
661
710
|
|
|
662
711
|
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).
|
|
663
712
|
|
|
664
|
-
### Preparation
|
|
713
|
+
### Preparation (DePay Sales)
|
|
665
714
|
|
|
666
715
|
In order to sell tokens in a decentralized way, that token needs to have a liquidity pool on a decentralized exchange:
|
|
667
716
|
|
|
668
717
|
- [Create Uniswap v2 Liquidity Pool](https://app.uniswap.org/#/add/v2/ETH)
|
|
669
718
|
- [Create Pancakeswap Liquidity Pool](https://pancakeswap.finance/add)
|
|
670
719
|
|
|
671
|
-
### Quick start
|
|
720
|
+
### Quick start (DePay Sales)
|
|
672
721
|
|
|
673
722
|
```
|
|
674
723
|
<script src="https://integrate.depay.fi/widgets/v6.js"/>
|
|
@@ -682,7 +731,7 @@ DePayWidgets.Sale({
|
|
|
682
731
|
});
|
|
683
732
|
```
|
|
684
733
|
|
|
685
|
-
### Configuration
|
|
734
|
+
### Configuration (DePay Sales)
|
|
686
735
|
|
|
687
736
|
You need to pass a configuration object to `DePayWidgets.Sale` which needs to at least contain the `sell` field:
|
|
688
737
|
|
|
@@ -705,7 +754,7 @@ DePayWidgets.Sale({
|
|
|
705
754
|
});
|
|
706
755
|
```
|
|
707
756
|
|
|
708
|
-
#### sell
|
|
757
|
+
#### sell (DePay Sales)
|
|
709
758
|
|
|
710
759
|
`"blockchain": "token"`
|
|
711
760
|
|
|
@@ -722,7 +771,7 @@ The address of the token you want to sell.
|
|
|
722
771
|
|
|
723
772
|
Use our [sale configurator](https://depay.fi/documentation/sales#sale-configurator) in order to simplify configuring this.
|
|
724
773
|
|
|
725
|
-
#### amount
|
|
774
|
+
#### amount (DePay Sales)
|
|
726
775
|
|
|
727
776
|
When you want to control how the amount selection behaves, pass the `amount` configuration object,
|
|
728
777
|
alongside values for `start`, `min` and `step`.
|
|
@@ -744,7 +793,7 @@ DePayWidgets.Sale({
|
|
|
744
793
|
});
|
|
745
794
|
```
|
|
746
795
|
|
|
747
|
-
#### connected
|
|
796
|
+
#### connected (DePay Sales)
|
|
748
797
|
|
|
749
798
|
`connected`
|
|
750
799
|
|
|
@@ -761,7 +810,7 @@ DePayWidgets.Sale({
|
|
|
761
810
|
});
|
|
762
811
|
```
|
|
763
812
|
|
|
764
|
-
#### closed
|
|
813
|
+
#### closed (DePay Sales)
|
|
765
814
|
|
|
766
815
|
`closed`
|
|
767
816
|
|
|
@@ -776,7 +825,7 @@ DePayWidgets.Sale({
|
|
|
776
825
|
});
|
|
777
826
|
```
|
|
778
827
|
|
|
779
|
-
#### sent
|
|
828
|
+
#### sent (DePay Sales)
|
|
780
829
|
|
|
781
830
|
`sent`
|
|
782
831
|
|
|
@@ -793,7 +842,7 @@ DePayWidgets.Sale({
|
|
|
793
842
|
});
|
|
794
843
|
```
|
|
795
844
|
|
|
796
|
-
#### confirmed
|
|
845
|
+
#### confirmed (DePay Sales)
|
|
797
846
|
|
|
798
847
|
`confirmed`
|
|
799
848
|
|
|
@@ -810,7 +859,7 @@ DePayWidgets.Sale({
|
|
|
810
859
|
});
|
|
811
860
|
```
|
|
812
861
|
|
|
813
|
-
#### failed
|
|
862
|
+
#### failed (DePay Sales)
|
|
814
863
|
|
|
815
864
|
`failed`
|
|
816
865
|
|
|
@@ -828,7 +877,7 @@ DePayWidgets.Sale({
|
|
|
828
877
|
});
|
|
829
878
|
```
|
|
830
879
|
|
|
831
|
-
#### critical
|
|
880
|
+
#### critical (DePay Sales)
|
|
832
881
|
|
|
833
882
|
`critical`
|
|
834
883
|
|
|
@@ -843,7 +892,7 @@ DePayWidgets.Sale({
|
|
|
843
892
|
});
|
|
844
893
|
```
|
|
845
894
|
|
|
846
|
-
#### error
|
|
895
|
+
#### error (DePay Sales)
|
|
847
896
|
|
|
848
897
|
`error`
|
|
849
898
|
|
|
@@ -859,7 +908,7 @@ DePayWidgets.Sale({
|
|
|
859
908
|
});
|
|
860
909
|
```
|
|
861
910
|
|
|
862
|
-
#### providers
|
|
911
|
+
#### providers (DePay Sales)
|
|
863
912
|
|
|
864
913
|
Allows to set providers to be used for making RPC calls to the individiual blockchains:
|
|
865
914
|
|
|
@@ -873,7 +922,7 @@ DePayWidgets.Sale({
|
|
|
873
922
|
});
|
|
874
923
|
```
|
|
875
924
|
|
|
876
|
-
#### currency
|
|
925
|
+
#### currency (DePay Sales)
|
|
877
926
|
|
|
878
927
|
Allows you to enforce displayed local currency (instead of automatically detecting it):
|
|
879
928
|
|
|
@@ -885,7 +934,7 @@ DePayWidgets.Sale({
|
|
|
885
934
|
});
|
|
886
935
|
```
|
|
887
936
|
|
|
888
|
-
#### blacklist
|
|
937
|
+
#### blacklist (DePay Sales)
|
|
889
938
|
|
|
890
939
|
Allows to blacklist tokens so that they will not be suggested as means of payment (from the sender):
|
|
891
940
|
|
|
@@ -920,7 +969,7 @@ DePayWidgets.Sale({
|
|
|
920
969
|
});
|
|
921
970
|
```
|
|
922
971
|
|
|
923
|
-
#### tokenImage
|
|
972
|
+
#### tokenImage (DePay Sales)
|
|
924
973
|
|
|
925
974
|
`tokenImage`
|
|
926
975
|
|
|
@@ -934,7 +983,7 @@ DePayWidgets.Sale({
|
|
|
934
983
|
});
|
|
935
984
|
```
|
|
936
985
|
|
|
937
|
-
#### style
|
|
986
|
+
#### style (DePay Sales)
|
|
938
987
|
|
|
939
988
|
`style`
|
|
940
989
|
|
|
@@ -962,7 +1011,7 @@ DePayWidgets.Sale({
|
|
|
962
1011
|
});
|
|
963
1012
|
```
|
|
964
1013
|
|
|
965
|
-
##### colors
|
|
1014
|
+
##### colors (DePay Sales)
|
|
966
1015
|
|
|
967
1016
|
`colors`
|
|
968
1017
|
|
|
@@ -982,7 +1031,7 @@ DePayWidgets.Sale({
|
|
|
982
1031
|
});
|
|
983
1032
|
```
|
|
984
1033
|
|
|
985
|
-
##### fontFamily
|
|
1034
|
+
##### fontFamily (DePay Sales)
|
|
986
1035
|
|
|
987
1036
|
`fontFamily`
|
|
988
1037
|
|
|
@@ -997,7 +1046,7 @@ DePayWidgets.Sale({
|
|
|
997
1046
|
});
|
|
998
1047
|
```
|
|
999
1048
|
|
|
1000
|
-
##### css
|
|
1049
|
+
##### css (DePay Sales)
|
|
1001
1050
|
|
|
1002
1051
|
`css`
|
|
1003
1052
|
|
|
@@ -1018,7 +1067,7 @@ DePayWidgets.Sale({
|
|
|
1018
1067
|
});
|
|
1019
1068
|
```
|
|
1020
1069
|
|
|
1021
|
-
#### unmount
|
|
1070
|
+
#### unmount (DePay Sales)
|
|
1022
1071
|
|
|
1023
1072
|
`unmount`
|
|
1024
1073
|
|
|
@@ -1030,7 +1079,7 @@ let { unmount } = await DePayWidgets.Sale({})
|
|
|
1030
1079
|
unmount()
|
|
1031
1080
|
```
|
|
1032
1081
|
|
|
1033
|
-
#### closable
|
|
1082
|
+
#### closable (DePay Sales)
|
|
1034
1083
|
|
|
1035
1084
|
`closable`
|
|
1036
1085
|
|
|
@@ -1043,7 +1092,7 @@ DePayWidgets.Sale({
|
|
|
1043
1092
|
|
|
1044
1093
|
```
|
|
1045
1094
|
|
|
1046
|
-
#### integration
|
|
1095
|
+
#### integration (DePay Sales)
|
|
1047
1096
|
|
|
1048
1097
|
`integration`
|
|
1049
1098
|
|
|
@@ -1059,14 +1108,14 @@ DePayWidgets.Sale({
|
|
|
1059
1108
|
|
|
1060
1109
|
DePay Donations allows you to accept donation payments made with thousands of different crypto currencies.
|
|
1061
1110
|
|
|
1062
|
-
### Preparation
|
|
1111
|
+
### Preparation (DePay Donations)
|
|
1063
1112
|
|
|
1064
1113
|
In order to receive decentralized donation payments on any blockchain you need to have your own wallet on that particular blockchain first:
|
|
1065
1114
|
|
|
1066
1115
|
- [Create an Ethereum wallet](https://ethereum.org/en/wallets/)
|
|
1067
1116
|
- [Create an BSC wallet](https://academy.binance.com/en/articles/how-to-get-started-with-binance-smart-chain-bsc)
|
|
1068
1117
|
|
|
1069
|
-
### Quick start
|
|
1118
|
+
### Quick start (DePay Donations)
|
|
1070
1119
|
|
|
1071
1120
|
```
|
|
1072
1121
|
<script src="https://integrate.depay.fi/widgets/v6.js"/>
|
|
@@ -1082,7 +1131,7 @@ DePayWidgets.Donation({
|
|
|
1082
1131
|
});
|
|
1083
1132
|
```
|
|
1084
1133
|
|
|
1085
|
-
### Configuration
|
|
1134
|
+
### Configuration (DePay Donations)
|
|
1086
1135
|
|
|
1087
1136
|
You need to pass a configuration object to `DePayWidgets.Donation` which needs to at least contain the `accept` field:
|
|
1088
1137
|
|
|
@@ -1112,7 +1161,7 @@ DePayWidgets.Donation({
|
|
|
1112
1161
|
});
|
|
1113
1162
|
```
|
|
1114
1163
|
|
|
1115
|
-
#### accept
|
|
1164
|
+
#### accept (DePay Donations)
|
|
1116
1165
|
|
|
1117
1166
|
`blockchain`
|
|
1118
1167
|
|
|
@@ -1133,7 +1182,7 @@ Use our [donation configurator](https://depay.fi/documentation/donations#donatio
|
|
|
1133
1182
|
|
|
1134
1183
|
The address receiving the donation. Always double check that you've set the right address.
|
|
1135
1184
|
|
|
1136
|
-
#### amount
|
|
1185
|
+
#### amount (DePay Donations)
|
|
1137
1186
|
|
|
1138
1187
|
When you want to control how the amount selection behaves, pass the `amount` configuration object,
|
|
1139
1188
|
alongside values for `start`, `min` and `step`.
|
|
@@ -1144,7 +1193,7 @@ alongside values for `start`, `min` and `step`.
|
|
|
1144
1193
|
|
|
1145
1194
|
`step`: The number by wich to increment/decremten changes to the amount.
|
|
1146
1195
|
|
|
1147
|
-
#### connected
|
|
1196
|
+
#### connected (DePay Donations)
|
|
1148
1197
|
|
|
1149
1198
|
`connected`
|
|
1150
1199
|
|
|
@@ -1161,7 +1210,7 @@ DePayWidgets.Donation({
|
|
|
1161
1210
|
});
|
|
1162
1211
|
```
|
|
1163
1212
|
|
|
1164
|
-
#### closed
|
|
1213
|
+
#### closed (DePay Donations)
|
|
1165
1214
|
|
|
1166
1215
|
`closed`
|
|
1167
1216
|
|
|
@@ -1176,7 +1225,7 @@ DePayWidgets.Donation({
|
|
|
1176
1225
|
});
|
|
1177
1226
|
```
|
|
1178
1227
|
|
|
1179
|
-
#### sent
|
|
1228
|
+
#### sent (DePay Donations)
|
|
1180
1229
|
|
|
1181
1230
|
`sent`
|
|
1182
1231
|
|
|
@@ -1193,7 +1242,7 @@ DePayWidgets.Donation({
|
|
|
1193
1242
|
});
|
|
1194
1243
|
```
|
|
1195
1244
|
|
|
1196
|
-
#### confirmed
|
|
1245
|
+
#### confirmed (DePay Donations)
|
|
1197
1246
|
|
|
1198
1247
|
`confirmed`
|
|
1199
1248
|
|
|
@@ -1210,7 +1259,7 @@ DePayWidgets.Donation({
|
|
|
1210
1259
|
});
|
|
1211
1260
|
```
|
|
1212
1261
|
|
|
1213
|
-
#### failed
|
|
1262
|
+
#### failed (DePay Donations)
|
|
1214
1263
|
|
|
1215
1264
|
`failed`
|
|
1216
1265
|
|
|
@@ -1228,7 +1277,7 @@ DePayWidgets.Donation({
|
|
|
1228
1277
|
});
|
|
1229
1278
|
```
|
|
1230
1279
|
|
|
1231
|
-
#### critical
|
|
1280
|
+
#### critical (DePay Donations)
|
|
1232
1281
|
|
|
1233
1282
|
`critical`
|
|
1234
1283
|
|
|
@@ -1243,7 +1292,7 @@ DePayWidgets.Donation({
|
|
|
1243
1292
|
});
|
|
1244
1293
|
```
|
|
1245
1294
|
|
|
1246
|
-
#### error
|
|
1295
|
+
#### error (DePay Donations)
|
|
1247
1296
|
|
|
1248
1297
|
`error`
|
|
1249
1298
|
|
|
@@ -1259,7 +1308,7 @@ DePayWidgets.Donation({
|
|
|
1259
1308
|
});
|
|
1260
1309
|
```
|
|
1261
1310
|
|
|
1262
|
-
#### providers
|
|
1311
|
+
#### providers (DePay Donations)
|
|
1263
1312
|
|
|
1264
1313
|
Allows to set providers to be used for making RPC calls to the individiual blockchains:
|
|
1265
1314
|
|
|
@@ -1273,7 +1322,7 @@ DePayWidgets.Donation({
|
|
|
1273
1322
|
});
|
|
1274
1323
|
```
|
|
1275
1324
|
|
|
1276
|
-
#### currency
|
|
1325
|
+
#### currency (DePay Donations)
|
|
1277
1326
|
|
|
1278
1327
|
Allows you to enforce displayed local currency (instead of automatically detecting it):
|
|
1279
1328
|
|
|
@@ -1285,7 +1334,7 @@ DePayWidgets.Donation({
|
|
|
1285
1334
|
});
|
|
1286
1335
|
```
|
|
1287
1336
|
|
|
1288
|
-
#### blacklist
|
|
1337
|
+
#### blacklist (DePay Donations)
|
|
1289
1338
|
|
|
1290
1339
|
Allows to blacklist tokens so that they will not be suggested as means of payment (from the sender):
|
|
1291
1340
|
|
|
@@ -1320,7 +1369,7 @@ DePayWidgets.Donation({
|
|
|
1320
1369
|
})
|
|
1321
1370
|
```
|
|
1322
1371
|
|
|
1323
|
-
#### style
|
|
1372
|
+
#### style (DePay Donations)
|
|
1324
1373
|
|
|
1325
1374
|
`style`
|
|
1326
1375
|
|
|
@@ -1348,7 +1397,7 @@ DePayWidgets.Donation({
|
|
|
1348
1397
|
});
|
|
1349
1398
|
```
|
|
1350
1399
|
|
|
1351
|
-
##### colors
|
|
1400
|
+
##### colors (DePay Donations)
|
|
1352
1401
|
|
|
1353
1402
|
`colors`
|
|
1354
1403
|
|
|
@@ -1368,7 +1417,7 @@ DePayWidgets.Donation({
|
|
|
1368
1417
|
});
|
|
1369
1418
|
```
|
|
1370
1419
|
|
|
1371
|
-
##### fontFamily
|
|
1420
|
+
##### fontFamily (DePay Donations)
|
|
1372
1421
|
|
|
1373
1422
|
`fontFamily`
|
|
1374
1423
|
|
|
@@ -1383,7 +1432,7 @@ DePayWidgets.Donation({
|
|
|
1383
1432
|
});
|
|
1384
1433
|
```
|
|
1385
1434
|
|
|
1386
|
-
##### css
|
|
1435
|
+
##### css (DePay Donations)
|
|
1387
1436
|
|
|
1388
1437
|
`css`
|
|
1389
1438
|
|
|
@@ -1404,7 +1453,7 @@ DePayWidgets.Donation({
|
|
|
1404
1453
|
});
|
|
1405
1454
|
```
|
|
1406
1455
|
|
|
1407
|
-
#### unmount
|
|
1456
|
+
#### unmount (DePay Donations)
|
|
1408
1457
|
|
|
1409
1458
|
`unmount`
|
|
1410
1459
|
|
|
@@ -1416,7 +1465,7 @@ let { unmount } = await DePayWidgets.Donation({})
|
|
|
1416
1465
|
unmount()
|
|
1417
1466
|
```
|
|
1418
1467
|
|
|
1419
|
-
#### closable
|
|
1468
|
+
#### closable (DePay Donations)
|
|
1420
1469
|
|
|
1421
1470
|
`closable`
|
|
1422
1471
|
|
|
@@ -1429,7 +1478,7 @@ DePayWidgets.Donation({
|
|
|
1429
1478
|
|
|
1430
1479
|
```
|
|
1431
1480
|
|
|
1432
|
-
#### integration
|
|
1481
|
+
#### integration (DePay Donations)
|
|
1433
1482
|
|
|
1434
1483
|
`integration`
|
|
1435
1484
|
|
|
@@ -1441,7 +1490,7 @@ DePayWidgets.Donation({
|
|
|
1441
1490
|
})
|
|
1442
1491
|
```
|
|
1443
1492
|
|
|
1444
|
-
## DePay Connect
|
|
1493
|
+
## DePay Connect (DePay Donations)
|
|
1445
1494
|
|
|
1446
1495
|
DePay Connect allows you to have your users connect their crypto wallet to your dApp or website.
|
|
1447
1496
|
|
|
@@ -1457,7 +1506,7 @@ let { account, accounts, wallet } = await DePayWidgets.Connect()
|
|
|
1457
1506
|
|
|
1458
1507
|
See [depay-web3-wallets](https://github.com/depayfi/depay-web3-wallets) for more details about the returned `wallet`.
|
|
1459
1508
|
|
|
1460
|
-
### Rejections
|
|
1509
|
+
### Rejections (DePay Donations)
|
|
1461
1510
|
|
|
1462
1511
|
1. Rejects if user just closes the dialog without connecting any wallet:
|
|
1463
1512
|
|
|
@@ -1534,7 +1583,7 @@ DePayWidgets.Login({ message, recover: ({ message, signature })=>{
|
|
|
1534
1583
|
})
|
|
1535
1584
|
```
|
|
1536
1585
|
|
|
1537
|
-
### Rejections
|
|
1586
|
+
### Rejections (DePay Login)
|
|
1538
1587
|
|
|
1539
1588
|
1. Rejects if user just closes the dialog without connecting any wallet:
|
|
1540
1589
|
|