4848 BroadcastError ,
4949)
5050from .models import MessagesResponse
51- from .user_session import UserSession
51+ from .user_session import AuthenticatedUserSession , UserSession
5252from .utils import get_message_type_value
5353
5454logger = logging .getLogger (__name__ )
6060 magic = None # type:ignore
6161
6262
63- async def ipfs_push (session : UserSession , content : Mapping ) -> str :
63+ async def ipfs_push (session : AuthenticatedUserSession , content : Mapping ) -> str :
6464 """Push arbitrary content as JSON to the IPFS service."""
6565
6666 url = "/api/v0/ipfs/add_json"
@@ -71,7 +71,7 @@ async def ipfs_push(session: UserSession, content: Mapping) -> str:
7171 return (await resp .json ()).get ("hash" )
7272
7373
74- async def storage_push (session : UserSession , content : Mapping ) -> str :
74+ async def storage_push (session : AuthenticatedUserSession , content : Mapping ) -> str :
7575 """Push arbitrary content as JSON to the storage service."""
7676
7777 url = "/api/v0/storage/add_json"
@@ -82,7 +82,9 @@ async def storage_push(session: UserSession, content: Mapping) -> str:
8282 return (await resp .json ()).get ("hash" )
8383
8484
85- async def ipfs_push_file (session : UserSession , file_content : Union [str , bytes ]) -> str :
85+ async def ipfs_push_file (
86+ session : AuthenticatedUserSession , file_content : Union [str , bytes ]
87+ ) -> str :
8688 """Push a file to the IPFS service."""
8789 data = aiohttp .FormData ()
8890 data .add_field ("file" , file_content )
@@ -95,7 +97,7 @@ async def ipfs_push_file(session: UserSession, file_content: Union[str, bytes])
9597 return (await resp .json ()).get ("hash" )
9698
9799
98- async def storage_push_file (session : UserSession , file_content ) -> str :
100+ async def storage_push_file (session : AuthenticatedUserSession , file_content ) -> str :
99101 """Push a file to the storage service."""
100102 data = aiohttp .FormData ()
101103 data .add_field ("file" , file_content )
@@ -162,7 +164,7 @@ async def _handle_broadcast_deprecated_response(
162164
163165
164166async def _broadcast_deprecated (
165- session : UserSession , message_dict : Mapping [str , Any ]
167+ session : AuthenticatedUserSession , message_dict : Mapping [str , Any ]
166168) -> None :
167169
168170 """
@@ -212,7 +214,7 @@ async def _handle_broadcast_response(
212214
213215
214216async def _broadcast (
215- session : UserSession ,
217+ session : AuthenticatedUserSession ,
216218 message : AlephMessage ,
217219 sync : bool ,
218220) -> MessageStatus :
@@ -247,7 +249,7 @@ async def _broadcast(
247249
248250
249251async def create_post (
250- session : UserSession ,
252+ session : AuthenticatedUserSession ,
251253 post_content ,
252254 post_type : str ,
253255 ref : Optional [str ] = None ,
@@ -292,7 +294,7 @@ async def create_post(
292294
293295
294296async def create_aggregate (
295- session : UserSession ,
297+ session : AuthenticatedUserSession ,
296298 key : str ,
297299 content : Mapping [str , Any ],
298300 address : Optional [str ] = None ,
@@ -331,7 +333,7 @@ async def create_aggregate(
331333
332334
333335async def create_store (
334- session : UserSession ,
336+ session : AuthenticatedUserSession ,
335337 address : Optional [str ] = None ,
336338 file_content : Optional [bytes ] = None ,
337339 file_path : Optional [Union [str , Path ]] = None ,
@@ -414,7 +416,7 @@ async def create_store(
414416
415417
416418async def create_program (
417- session : UserSession ,
419+ session : AuthenticatedUserSession ,
418420 program_ref : str ,
419421 entrypoint : str ,
420422 runtime : str ,
@@ -517,7 +519,7 @@ async def create_program(
517519
518520
519521async def forget (
520- session : UserSession ,
522+ session : AuthenticatedUserSession ,
521523 hashes : List [str ],
522524 reason : Optional [str ],
523525 storage_engine : StorageEnum = StorageEnum .storage ,
@@ -566,7 +568,7 @@ def compute_sha256(s: str) -> str:
566568
567569
568570async def _prepare_aleph_message (
569- session : UserSession ,
571+ session : AuthenticatedUserSession ,
570572 message_type : MessageType ,
571573 content : Dict [str , Any ],
572574 channel : Optional [str ],
@@ -609,7 +611,7 @@ async def _prepare_aleph_message(
609611
610612
611613async def submit (
612- session : UserSession ,
614+ session : AuthenticatedUserSession ,
613615 content : Dict [str , Any ],
614616 message_type : MessageType ,
615617 channel : Optional [str ] = None ,
0 commit comments