synapse-filecoin-sdk 0.1.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 (64) hide show
  1. pynapse/__init__.py +6 -0
  2. pynapse/_version.py +1 -0
  3. pynapse/contracts/__init__.py +34 -0
  4. pynapse/contracts/abi_registry.py +11 -0
  5. pynapse/contracts/addresses.json +30 -0
  6. pynapse/contracts/erc20_abi.json +92 -0
  7. pynapse/contracts/errorsAbi.json +933 -0
  8. pynapse/contracts/filecoinPayV1Abi.json +2424 -0
  9. pynapse/contracts/filecoinWarmStorageServiceAbi.json +2363 -0
  10. pynapse/contracts/filecoinWarmStorageServiceStateViewAbi.json +651 -0
  11. pynapse/contracts/generated.py +35 -0
  12. pynapse/contracts/payments_abi.json +205 -0
  13. pynapse/contracts/pdpVerifierAbi.json +1266 -0
  14. pynapse/contracts/providerIdSetAbi.json +161 -0
  15. pynapse/contracts/serviceProviderRegistryAbi.json +1479 -0
  16. pynapse/contracts/sessionKeyRegistryAbi.json +147 -0
  17. pynapse/core/__init__.py +68 -0
  18. pynapse/core/abis.py +25 -0
  19. pynapse/core/chains.py +97 -0
  20. pynapse/core/constants.py +27 -0
  21. pynapse/core/errors.py +22 -0
  22. pynapse/core/piece.py +263 -0
  23. pynapse/core/rand.py +14 -0
  24. pynapse/core/typed_data.py +320 -0
  25. pynapse/core/utils.py +30 -0
  26. pynapse/evm/__init__.py +3 -0
  27. pynapse/evm/client.py +26 -0
  28. pynapse/filbeam/__init__.py +3 -0
  29. pynapse/filbeam/service.py +39 -0
  30. pynapse/payments/__init__.py +17 -0
  31. pynapse/payments/service.py +826 -0
  32. pynapse/pdp/__init__.py +21 -0
  33. pynapse/pdp/server.py +331 -0
  34. pynapse/pdp/types.py +38 -0
  35. pynapse/pdp/verifier.py +82 -0
  36. pynapse/retriever/__init__.py +12 -0
  37. pynapse/retriever/async_chain.py +227 -0
  38. pynapse/retriever/chain.py +209 -0
  39. pynapse/session/__init__.py +12 -0
  40. pynapse/session/key.py +30 -0
  41. pynapse/session/permissions.py +57 -0
  42. pynapse/session/registry.py +90 -0
  43. pynapse/sp_registry/__init__.py +11 -0
  44. pynapse/sp_registry/capabilities.py +25 -0
  45. pynapse/sp_registry/pdp_capabilities.py +102 -0
  46. pynapse/sp_registry/service.py +446 -0
  47. pynapse/sp_registry/types.py +52 -0
  48. pynapse/storage/__init__.py +57 -0
  49. pynapse/storage/async_context.py +682 -0
  50. pynapse/storage/async_manager.py +757 -0
  51. pynapse/storage/context.py +680 -0
  52. pynapse/storage/manager.py +758 -0
  53. pynapse/synapse.py +191 -0
  54. pynapse/utils/__init__.py +25 -0
  55. pynapse/utils/constants.py +25 -0
  56. pynapse/utils/errors.py +3 -0
  57. pynapse/utils/metadata.py +35 -0
  58. pynapse/utils/piece_url.py +16 -0
  59. pynapse/warm_storage/__init__.py +13 -0
  60. pynapse/warm_storage/service.py +513 -0
  61. synapse_filecoin_sdk-0.1.0.dist-info/METADATA +74 -0
  62. synapse_filecoin_sdk-0.1.0.dist-info/RECORD +64 -0
  63. synapse_filecoin_sdk-0.1.0.dist-info/WHEEL +4 -0
  64. synapse_filecoin_sdk-0.1.0.dist-info/licenses/LICENSE.md +228 -0
pynapse/__init__.py ADDED
@@ -0,0 +1,6 @@
1
+ """Pynapse - Python SDK for Filecoin Onchain Cloud."""
2
+
3
+ from ._version import __version__
4
+ from .synapse import AsyncSynapse, Synapse
5
+
6
+ __all__ = ["__version__", "Synapse", "AsyncSynapse"]
pynapse/_version.py ADDED
@@ -0,0 +1 @@
1
+ __version__ = "0.1.0"
@@ -0,0 +1,34 @@
1
+ from __future__ import annotations
2
+
3
+ from .abi_registry import load
4
+ from .generated import FILECOIN_PAY_V1_ABI
5
+
6
+ ERC20_ABI = load("erc20_abi.json")
7
+ # Use the complete FilecoinPayV1 ABI (payments_abi.json was a minimal stub)
8
+ PAYMENTS_ABI = FILECOIN_PAY_V1_ABI
9
+
10
+ from .generated import (
11
+ ADDRESSES,
12
+ ERRORS_ABI,
13
+ FILECOIN_PAY_V1_ABI,
14
+ FWSS_ABI,
15
+ FWSS_VIEW_ABI,
16
+ PDP_VERIFIER_ABI,
17
+ PROVIDER_ID_SET_ABI,
18
+ SERVICE_PROVIDER_REGISTRY_ABI,
19
+ SESSION_KEY_REGISTRY_ABI,
20
+ )
21
+
22
+ __all__ = [
23
+ "ERC20_ABI",
24
+ "PAYMENTS_ABI",
25
+ "ADDRESSES",
26
+ "ERRORS_ABI",
27
+ "FILECOIN_PAY_V1_ABI",
28
+ "FWSS_ABI",
29
+ "FWSS_VIEW_ABI",
30
+ "PDP_VERIFIER_ABI",
31
+ "PROVIDER_ID_SET_ABI",
32
+ "SERVICE_PROVIDER_REGISTRY_ABI",
33
+ "SESSION_KEY_REGISTRY_ABI",
34
+ ]
@@ -0,0 +1,11 @@
1
+ from __future__ import annotations
2
+
3
+ import json
4
+ from pathlib import Path
5
+ from typing import Any, List
6
+
7
+ _BASE = Path(__file__).parent
8
+
9
+
10
+ def load(name: str) -> List[Any]:
11
+ return json.loads((_BASE / name).read_text())
@@ -0,0 +1,30 @@
1
+ {
2
+ "filecoinPayV1Address": {
3
+ "314": "0x23b1e018F08BB982348b15a86ee926eEBf7F4DAa",
4
+ "314159": "0x09a0fDc2723fAd1A7b8e3e00eE5DF73841df55a0"
5
+ },
6
+ "filecoinWarmStorageServiceAddress": {
7
+ "314": "0x8408502033C418E1bbC97cE9ac48E5528F371A9f",
8
+ "314159": "0x02925630df557F957f70E112bA06e50965417CA0"
9
+ },
10
+ "filecoinWarmStorageServiceStateViewAddress": {
11
+ "314": "0x638a4986332bF9B889E5D7435B966C5ecdE077Fa",
12
+ "314159": "0x53d235D474585EC102ccaB7e0cdcE951dD00f716"
13
+ },
14
+ "serviceProviderRegistryAddress": {
15
+ "314": "0xf55dDbf63F1b55c3F1D4FA7e339a68AB7b64A5eB",
16
+ "314159": "0x839e5c9988e4e9977d40708d0094103c0839Ac9D"
17
+ },
18
+ "sessionKeyRegistryAddress": {
19
+ "314": "0x74FD50525A958aF5d484601E252271f9625231aB",
20
+ "314159": "0x518411c2062E119Aaf7A8B12A2eDf9a939347655"
21
+ },
22
+ "pdpVerifierAddress": {
23
+ "314": "0xBADd0B92C1c71d02E7d520f64c0876538fa2557F",
24
+ "314159": "0x85e366Cf9DD2c0aE37E963d9556F5f4718d6417C"
25
+ },
26
+ "providerIdSetAddress": {
27
+ "314": "0x59eFa2e8324E1551d46010d7B0B140eE2F5c726b",
28
+ "314159": "0xAA2f7CfC7ecAc616EC9C1f6d700fAd19087FAC84"
29
+ }
30
+ }
@@ -0,0 +1,92 @@
1
+ [
2
+ {
3
+ "type": "function",
4
+ "name": "name",
5
+ "inputs": [],
6
+ "outputs": [{"name": "", "type": "string"}],
7
+ "stateMutability": "view"
8
+ },
9
+ {
10
+ "type": "function",
11
+ "name": "symbol",
12
+ "inputs": [],
13
+ "outputs": [{"name": "", "type": "string"}],
14
+ "stateMutability": "view"
15
+ },
16
+ {
17
+ "type": "function",
18
+ "name": "decimals",
19
+ "inputs": [],
20
+ "outputs": [{"name": "", "type": "uint8"}],
21
+ "stateMutability": "view"
22
+ },
23
+ {
24
+ "type": "function",
25
+ "name": "totalSupply",
26
+ "inputs": [],
27
+ "outputs": [{"name": "", "type": "uint256"}],
28
+ "stateMutability": "view"
29
+ },
30
+ {
31
+ "type": "function",
32
+ "name": "balanceOf",
33
+ "inputs": [{"name": "account", "type": "address"}],
34
+ "outputs": [{"name": "", "type": "uint256"}],
35
+ "stateMutability": "view"
36
+ },
37
+ {
38
+ "type": "function",
39
+ "name": "allowance",
40
+ "inputs": [
41
+ {"name": "owner", "type": "address"},
42
+ {"name": "spender", "type": "address"}
43
+ ],
44
+ "outputs": [{"name": "", "type": "uint256"}],
45
+ "stateMutability": "view"
46
+ },
47
+ {
48
+ "type": "function",
49
+ "name": "approve",
50
+ "inputs": [
51
+ {"name": "spender", "type": "address"},
52
+ {"name": "amount", "type": "uint256"}
53
+ ],
54
+ "outputs": [{"name": "", "type": "bool"}],
55
+ "stateMutability": "nonpayable"
56
+ },
57
+ {
58
+ "type": "function",
59
+ "name": "transfer",
60
+ "inputs": [
61
+ {"name": "to", "type": "address"},
62
+ {"name": "amount", "type": "uint256"}
63
+ ],
64
+ "outputs": [{"name": "", "type": "bool"}],
65
+ "stateMutability": "nonpayable"
66
+ },
67
+ {
68
+ "type": "function",
69
+ "name": "transferFrom",
70
+ "inputs": [
71
+ {"name": "from", "type": "address"},
72
+ {"name": "to", "type": "address"},
73
+ {"name": "amount", "type": "uint256"}
74
+ ],
75
+ "outputs": [{"name": "", "type": "bool"}],
76
+ "stateMutability": "nonpayable"
77
+ },
78
+ {
79
+ "type": "function",
80
+ "name": "nonces",
81
+ "inputs": [{"name": "owner", "type": "address"}],
82
+ "outputs": [{"name": "", "type": "uint256"}],
83
+ "stateMutability": "view"
84
+ },
85
+ {
86
+ "type": "function",
87
+ "name": "DOMAIN_SEPARATOR",
88
+ "inputs": [],
89
+ "outputs": [{"name": "", "type": "bytes32"}],
90
+ "stateMutability": "view"
91
+ }
92
+ ]