crypticorn 2.11.8__py3-none-any.whl → 2.12.0__py3-none-any.whl

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.
Files changed (32) hide show
  1. crypticorn/common/errors.py +4 -4
  2. crypticorn/common/exceptions.py +10 -0
  3. crypticorn/hive/client/__init__.py +1 -0
  4. crypticorn/hive/client/models/__init__.py +1 -0
  5. crypticorn/hive/client/models/api_error_identifier.py +2 -0
  6. crypticorn/hive/client/models/coin_info.py +106 -0
  7. crypticorn/hive/client/models/data_info.py +17 -6
  8. crypticorn/hive/client/models/target_info.py +20 -6
  9. crypticorn/pay/client/__init__.py +5 -3
  10. crypticorn/pay/client/api/admin_api.py +35 -33
  11. crypticorn/pay/client/api/now_payments_api.py +476 -5
  12. crypticorn/pay/client/api/payments_api.py +43 -264
  13. crypticorn/pay/client/api/products_api.py +16 -16
  14. crypticorn/pay/client/models/__init__.py +5 -3
  15. crypticorn/pay/client/models/api_error_identifier.py +117 -0
  16. crypticorn/pay/client/models/api_error_level.py +37 -0
  17. crypticorn/pay/client/models/api_error_type.py +37 -0
  18. crypticorn/pay/client/models/exception_detail.py +7 -4
  19. crypticorn/pay/client/models/{product_read.py → product.py} +4 -4
  20. crypticorn/pay/client/models/product_create.py +1 -1
  21. crypticorn/pay/client/models/scope.py +1 -0
  22. crypticorn/pay/client/models/{product_sub_read.py → subscription.py} +5 -5
  23. crypticorn/trade/client/api/notifications_api.py +15 -15
  24. crypticorn/trade/client/api/trading_actions_api.py +9 -9
  25. crypticorn/trade/client/models/api_error_identifier.py +1 -0
  26. {crypticorn-2.11.8.dist-info → crypticorn-2.12.0.dist-info}/METADATA +1 -1
  27. {crypticorn-2.11.8.dist-info → crypticorn-2.12.0.dist-info}/RECORD +31 -28
  28. {crypticorn-2.11.8.dist-info → crypticorn-2.12.0.dist-info}/WHEEL +1 -1
  29. crypticorn/pay/client/models/response_getuptime.py +0 -159
  30. {crypticorn-2.11.8.dist-info → crypticorn-2.12.0.dist-info}/entry_points.txt +0 -0
  31. {crypticorn-2.11.8.dist-info → crypticorn-2.12.0.dist-info}/licenses/LICENSE +0 -0
  32. {crypticorn-2.11.8.dist-info → crypticorn-2.12.0.dist-info}/top_level.txt +0 -0
@@ -16,10 +16,12 @@ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
16
16
  from typing import Any, Dict, List, Optional, Tuple, Union
17
17
  from typing_extensions import Annotated
18
18
 
19
- from pydantic import StrictStr
20
- from typing import Any
19
+ from pydantic import Field, StrictInt, StrictStr
20
+ from typing import Any, List
21
+ from typing_extensions import Annotated
21
22
  from crypticorn.pay.client.models.now_create_invoice_req import NowCreateInvoiceReq
22
23
  from crypticorn.pay.client.models.now_create_invoice_res import NowCreateInvoiceRes
24
+ from crypticorn.pay.client.models.payment import Payment
23
25
 
24
26
  from crypticorn.pay.client.api_client import ApiClient, RequestSerialized
25
27
  from crypticorn.pay.client.api_response import ApiResponse
@@ -56,7 +58,7 @@ class NOWPaymentsApi:
56
58
  ) -> NowCreateInvoiceRes:
57
59
  """Create Invoice
58
60
 
59
- Create a payment invoice with a payment link for customer completion
61
+ Create a payment invoice with a payment link for customer completion. Only JWT authentication is supported.
60
62
 
61
63
  :param now_create_invoice_req: (required)
62
64
  :type now_create_invoice_req: NowCreateInvoiceReq
@@ -120,7 +122,7 @@ class NOWPaymentsApi:
120
122
  ) -> ApiResponse[NowCreateInvoiceRes]:
121
123
  """Create Invoice
122
124
 
123
- Create a payment invoice with a payment link for customer completion
125
+ Create a payment invoice with a payment link for customer completion. Only JWT authentication is supported.
124
126
 
125
127
  :param now_create_invoice_req: (required)
126
128
  :type now_create_invoice_req: NowCreateInvoiceReq
@@ -184,7 +186,7 @@ class NOWPaymentsApi:
184
186
  ) -> RESTResponseType:
185
187
  """Create Invoice
186
188
 
187
- Create a payment invoice with a payment link for customer completion
189
+ Create a payment invoice with a payment link for customer completion. Only JWT authentication is supported.
188
190
 
189
191
  :param now_create_invoice_req: (required)
190
192
  :type now_create_invoice_req: NowCreateInvoiceReq
@@ -517,6 +519,475 @@ class NOWPaymentsApi:
517
519
  _request_auth=_request_auth,
518
520
  )
519
521
 
522
+ @validate_call
523
+ async def get_now_payment_by_invoice(
524
+ self,
525
+ id: Annotated[StrictInt, Field(description="The invoice ID")],
526
+ _request_timeout: Union[
527
+ None,
528
+ Annotated[StrictFloat, Field(gt=0)],
529
+ Tuple[
530
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
531
+ ],
532
+ ] = None,
533
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
534
+ _content_type: Optional[StrictStr] = None,
535
+ _headers: Optional[Dict[StrictStr, Any]] = None,
536
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
537
+ ) -> Payment:
538
+ """Get Now Payment By Invoice
539
+
540
+ Get a NOW payment by invoice ID
541
+
542
+ :param id: The invoice ID (required)
543
+ :type id: int
544
+ :param _request_timeout: timeout setting for this request. If one
545
+ number provided, it will be total request
546
+ timeout. It can also be a pair (tuple) of
547
+ (connection, read) timeouts.
548
+ :type _request_timeout: int, tuple(int, int), optional
549
+ :param _request_auth: set to override the auth_settings for an a single
550
+ request; this effectively ignores the
551
+ authentication in the spec for a single request.
552
+ :type _request_auth: dict, optional
553
+ :param _content_type: force content-type for the request.
554
+ :type _content_type: str, Optional
555
+ :param _headers: set to override the headers for a single
556
+ request; this effectively ignores the headers
557
+ in the spec for a single request.
558
+ :type _headers: dict, optional
559
+ :param _host_index: set to override the host_index for a single
560
+ request; this effectively ignores the host_index
561
+ in the spec for a single request.
562
+ :type _host_index: int, optional
563
+ :return: Returns the result object.
564
+ """ # noqa: E501
565
+
566
+ _param = self._get_now_payment_by_invoice_serialize(
567
+ id=id,
568
+ _request_auth=_request_auth,
569
+ _content_type=_content_type,
570
+ _headers=_headers,
571
+ _host_index=_host_index,
572
+ )
573
+
574
+ _response_types_map: Dict[str, Optional[str]] = {
575
+ "200": "Payment",
576
+ }
577
+ response_data = await self.api_client.call_api(
578
+ *_param, _request_timeout=_request_timeout
579
+ )
580
+ await response_data.read()
581
+ return self.api_client.response_deserialize(
582
+ response_data=response_data,
583
+ response_types_map=_response_types_map,
584
+ ).data
585
+
586
+ @validate_call
587
+ async def get_now_payment_by_invoice_with_http_info(
588
+ self,
589
+ id: Annotated[StrictInt, Field(description="The invoice ID")],
590
+ _request_timeout: Union[
591
+ None,
592
+ Annotated[StrictFloat, Field(gt=0)],
593
+ Tuple[
594
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
595
+ ],
596
+ ] = None,
597
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
598
+ _content_type: Optional[StrictStr] = None,
599
+ _headers: Optional[Dict[StrictStr, Any]] = None,
600
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
601
+ ) -> ApiResponse[Payment]:
602
+ """Get Now Payment By Invoice
603
+
604
+ Get a NOW payment by invoice ID
605
+
606
+ :param id: The invoice ID (required)
607
+ :type id: int
608
+ :param _request_timeout: timeout setting for this request. If one
609
+ number provided, it will be total request
610
+ timeout. It can also be a pair (tuple) of
611
+ (connection, read) timeouts.
612
+ :type _request_timeout: int, tuple(int, int), optional
613
+ :param _request_auth: set to override the auth_settings for an a single
614
+ request; this effectively ignores the
615
+ authentication in the spec for a single request.
616
+ :type _request_auth: dict, optional
617
+ :param _content_type: force content-type for the request.
618
+ :type _content_type: str, Optional
619
+ :param _headers: set to override the headers for a single
620
+ request; this effectively ignores the headers
621
+ in the spec for a single request.
622
+ :type _headers: dict, optional
623
+ :param _host_index: set to override the host_index for a single
624
+ request; this effectively ignores the host_index
625
+ in the spec for a single request.
626
+ :type _host_index: int, optional
627
+ :return: Returns the result object.
628
+ """ # noqa: E501
629
+
630
+ _param = self._get_now_payment_by_invoice_serialize(
631
+ id=id,
632
+ _request_auth=_request_auth,
633
+ _content_type=_content_type,
634
+ _headers=_headers,
635
+ _host_index=_host_index,
636
+ )
637
+
638
+ _response_types_map: Dict[str, Optional[str]] = {
639
+ "200": "Payment",
640
+ }
641
+ response_data = await self.api_client.call_api(
642
+ *_param, _request_timeout=_request_timeout
643
+ )
644
+ await response_data.read()
645
+ return self.api_client.response_deserialize(
646
+ response_data=response_data,
647
+ response_types_map=_response_types_map,
648
+ )
649
+
650
+ @validate_call
651
+ async def get_now_payment_by_invoice_without_preload_content(
652
+ self,
653
+ id: Annotated[StrictInt, Field(description="The invoice ID")],
654
+ _request_timeout: Union[
655
+ None,
656
+ Annotated[StrictFloat, Field(gt=0)],
657
+ Tuple[
658
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
659
+ ],
660
+ ] = None,
661
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
662
+ _content_type: Optional[StrictStr] = None,
663
+ _headers: Optional[Dict[StrictStr, Any]] = None,
664
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
665
+ ) -> RESTResponseType:
666
+ """Get Now Payment By Invoice
667
+
668
+ Get a NOW payment by invoice ID
669
+
670
+ :param id: The invoice ID (required)
671
+ :type id: int
672
+ :param _request_timeout: timeout setting for this request. If one
673
+ number provided, it will be total request
674
+ timeout. It can also be a pair (tuple) of
675
+ (connection, read) timeouts.
676
+ :type _request_timeout: int, tuple(int, int), optional
677
+ :param _request_auth: set to override the auth_settings for an a single
678
+ request; this effectively ignores the
679
+ authentication in the spec for a single request.
680
+ :type _request_auth: dict, optional
681
+ :param _content_type: force content-type for the request.
682
+ :type _content_type: str, Optional
683
+ :param _headers: set to override the headers for a single
684
+ request; this effectively ignores the headers
685
+ in the spec for a single request.
686
+ :type _headers: dict, optional
687
+ :param _host_index: set to override the host_index for a single
688
+ request; this effectively ignores the host_index
689
+ in the spec for a single request.
690
+ :type _host_index: int, optional
691
+ :return: Returns the result object.
692
+ """ # noqa: E501
693
+
694
+ _param = self._get_now_payment_by_invoice_serialize(
695
+ id=id,
696
+ _request_auth=_request_auth,
697
+ _content_type=_content_type,
698
+ _headers=_headers,
699
+ _host_index=_host_index,
700
+ )
701
+
702
+ _response_types_map: Dict[str, Optional[str]] = {
703
+ "200": "Payment",
704
+ }
705
+ response_data = await self.api_client.call_api(
706
+ *_param, _request_timeout=_request_timeout
707
+ )
708
+ return response_data.response
709
+
710
+ def _get_now_payment_by_invoice_serialize(
711
+ self,
712
+ id,
713
+ _request_auth,
714
+ _content_type,
715
+ _headers,
716
+ _host_index,
717
+ ) -> RequestSerialized:
718
+
719
+ _host = None
720
+
721
+ _collection_formats: Dict[str, str] = {}
722
+
723
+ _path_params: Dict[str, str] = {}
724
+ _query_params: List[Tuple[str, str]] = []
725
+ _header_params: Dict[str, Optional[str]] = _headers or {}
726
+ _form_params: List[Tuple[str, str]] = []
727
+ _files: Dict[
728
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
729
+ ] = {}
730
+ _body_params: Optional[bytes] = None
731
+
732
+ # process the path parameters
733
+ if id is not None:
734
+ _path_params["id"] = id
735
+ # process the query parameters
736
+ # process the header parameters
737
+ # process the form parameters
738
+ # process the body parameter
739
+
740
+ # set the HTTP header `Accept`
741
+ if "Accept" not in _header_params:
742
+ _header_params["Accept"] = self.api_client.select_header_accept(
743
+ ["application/json"]
744
+ )
745
+
746
+ # authentication setting
747
+ _auth_settings: List[str] = ["APIKeyHeader", "HTTPBearer"]
748
+
749
+ return self.api_client.param_serialize(
750
+ method="GET",
751
+ resource_path="/now/payments/by-invoice/{id}",
752
+ path_params=_path_params,
753
+ query_params=_query_params,
754
+ header_params=_header_params,
755
+ body=_body_params,
756
+ post_params=_form_params,
757
+ files=_files,
758
+ auth_settings=_auth_settings,
759
+ collection_formats=_collection_formats,
760
+ _host=_host,
761
+ _request_auth=_request_auth,
762
+ )
763
+
764
+ @validate_call
765
+ async def get_now_payments(
766
+ self,
767
+ _request_timeout: Union[
768
+ None,
769
+ Annotated[StrictFloat, Field(gt=0)],
770
+ Tuple[
771
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
772
+ ],
773
+ ] = None,
774
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
775
+ _content_type: Optional[StrictStr] = None,
776
+ _headers: Optional[Dict[StrictStr, Any]] = None,
777
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
778
+ ) -> List[Payment]:
779
+ """Get Now Payments
780
+
781
+ Get all of the user's NOW payments
782
+
783
+ :param _request_timeout: timeout setting for this request. If one
784
+ number provided, it will be total request
785
+ timeout. It can also be a pair (tuple) of
786
+ (connection, read) timeouts.
787
+ :type _request_timeout: int, tuple(int, int), optional
788
+ :param _request_auth: set to override the auth_settings for an a single
789
+ request; this effectively ignores the
790
+ authentication in the spec for a single request.
791
+ :type _request_auth: dict, optional
792
+ :param _content_type: force content-type for the request.
793
+ :type _content_type: str, Optional
794
+ :param _headers: set to override the headers for a single
795
+ request; this effectively ignores the headers
796
+ in the spec for a single request.
797
+ :type _headers: dict, optional
798
+ :param _host_index: set to override the host_index for a single
799
+ request; this effectively ignores the host_index
800
+ in the spec for a single request.
801
+ :type _host_index: int, optional
802
+ :return: Returns the result object.
803
+ """ # noqa: E501
804
+
805
+ _param = self._get_now_payments_serialize(
806
+ _request_auth=_request_auth,
807
+ _content_type=_content_type,
808
+ _headers=_headers,
809
+ _host_index=_host_index,
810
+ )
811
+
812
+ _response_types_map: Dict[str, Optional[str]] = {
813
+ "200": "List[Payment]",
814
+ }
815
+ response_data = await self.api_client.call_api(
816
+ *_param, _request_timeout=_request_timeout
817
+ )
818
+ await response_data.read()
819
+ return self.api_client.response_deserialize(
820
+ response_data=response_data,
821
+ response_types_map=_response_types_map,
822
+ ).data
823
+
824
+ @validate_call
825
+ async def get_now_payments_with_http_info(
826
+ self,
827
+ _request_timeout: Union[
828
+ None,
829
+ Annotated[StrictFloat, Field(gt=0)],
830
+ Tuple[
831
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
832
+ ],
833
+ ] = None,
834
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
835
+ _content_type: Optional[StrictStr] = None,
836
+ _headers: Optional[Dict[StrictStr, Any]] = None,
837
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
838
+ ) -> ApiResponse[List[Payment]]:
839
+ """Get Now Payments
840
+
841
+ Get all of the user's NOW payments
842
+
843
+ :param _request_timeout: timeout setting for this request. If one
844
+ number provided, it will be total request
845
+ timeout. It can also be a pair (tuple) of
846
+ (connection, read) timeouts.
847
+ :type _request_timeout: int, tuple(int, int), optional
848
+ :param _request_auth: set to override the auth_settings for an a single
849
+ request; this effectively ignores the
850
+ authentication in the spec for a single request.
851
+ :type _request_auth: dict, optional
852
+ :param _content_type: force content-type for the request.
853
+ :type _content_type: str, Optional
854
+ :param _headers: set to override the headers for a single
855
+ request; this effectively ignores the headers
856
+ in the spec for a single request.
857
+ :type _headers: dict, optional
858
+ :param _host_index: set to override the host_index for a single
859
+ request; this effectively ignores the host_index
860
+ in the spec for a single request.
861
+ :type _host_index: int, optional
862
+ :return: Returns the result object.
863
+ """ # noqa: E501
864
+
865
+ _param = self._get_now_payments_serialize(
866
+ _request_auth=_request_auth,
867
+ _content_type=_content_type,
868
+ _headers=_headers,
869
+ _host_index=_host_index,
870
+ )
871
+
872
+ _response_types_map: Dict[str, Optional[str]] = {
873
+ "200": "List[Payment]",
874
+ }
875
+ response_data = await self.api_client.call_api(
876
+ *_param, _request_timeout=_request_timeout
877
+ )
878
+ await response_data.read()
879
+ return self.api_client.response_deserialize(
880
+ response_data=response_data,
881
+ response_types_map=_response_types_map,
882
+ )
883
+
884
+ @validate_call
885
+ async def get_now_payments_without_preload_content(
886
+ self,
887
+ _request_timeout: Union[
888
+ None,
889
+ Annotated[StrictFloat, Field(gt=0)],
890
+ Tuple[
891
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
892
+ ],
893
+ ] = None,
894
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
895
+ _content_type: Optional[StrictStr] = None,
896
+ _headers: Optional[Dict[StrictStr, Any]] = None,
897
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
898
+ ) -> RESTResponseType:
899
+ """Get Now Payments
900
+
901
+ Get all of the user's NOW payments
902
+
903
+ :param _request_timeout: timeout setting for this request. If one
904
+ number provided, it will be total request
905
+ timeout. It can also be a pair (tuple) of
906
+ (connection, read) timeouts.
907
+ :type _request_timeout: int, tuple(int, int), optional
908
+ :param _request_auth: set to override the auth_settings for an a single
909
+ request; this effectively ignores the
910
+ authentication in the spec for a single request.
911
+ :type _request_auth: dict, optional
912
+ :param _content_type: force content-type for the request.
913
+ :type _content_type: str, Optional
914
+ :param _headers: set to override the headers for a single
915
+ request; this effectively ignores the headers
916
+ in the spec for a single request.
917
+ :type _headers: dict, optional
918
+ :param _host_index: set to override the host_index for a single
919
+ request; this effectively ignores the host_index
920
+ in the spec for a single request.
921
+ :type _host_index: int, optional
922
+ :return: Returns the result object.
923
+ """ # noqa: E501
924
+
925
+ _param = self._get_now_payments_serialize(
926
+ _request_auth=_request_auth,
927
+ _content_type=_content_type,
928
+ _headers=_headers,
929
+ _host_index=_host_index,
930
+ )
931
+
932
+ _response_types_map: Dict[str, Optional[str]] = {
933
+ "200": "List[Payment]",
934
+ }
935
+ response_data = await self.api_client.call_api(
936
+ *_param, _request_timeout=_request_timeout
937
+ )
938
+ return response_data.response
939
+
940
+ def _get_now_payments_serialize(
941
+ self,
942
+ _request_auth,
943
+ _content_type,
944
+ _headers,
945
+ _host_index,
946
+ ) -> RequestSerialized:
947
+
948
+ _host = None
949
+
950
+ _collection_formats: Dict[str, str] = {}
951
+
952
+ _path_params: Dict[str, str] = {}
953
+ _query_params: List[Tuple[str, str]] = []
954
+ _header_params: Dict[str, Optional[str]] = _headers or {}
955
+ _form_params: List[Tuple[str, str]] = []
956
+ _files: Dict[
957
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
958
+ ] = {}
959
+ _body_params: Optional[bytes] = None
960
+
961
+ # process the path parameters
962
+ # process the query parameters
963
+ # process the header parameters
964
+ # process the form parameters
965
+ # process the body parameter
966
+
967
+ # set the HTTP header `Accept`
968
+ if "Accept" not in _header_params:
969
+ _header_params["Accept"] = self.api_client.select_header_accept(
970
+ ["application/json"]
971
+ )
972
+
973
+ # authentication setting
974
+ _auth_settings: List[str] = ["APIKeyHeader", "HTTPBearer"]
975
+
976
+ return self.api_client.param_serialize(
977
+ method="GET",
978
+ resource_path="/now/payments",
979
+ path_params=_path_params,
980
+ query_params=_query_params,
981
+ header_params=_header_params,
982
+ body=_body_params,
983
+ post_params=_form_params,
984
+ files=_files,
985
+ auth_settings=_auth_settings,
986
+ collection_formats=_collection_formats,
987
+ _host=_host,
988
+ _request_auth=_request_auth,
989
+ )
990
+
520
991
  @validate_call
521
992
  async def handle_now_webhook(
522
993
  self,