You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
implement message format and tests to check for correct messages
Maybe any valid message could look like:
onmessage=event=>{const[lid,from,path,ref,type,body]=event.dataconsole.log(from)// => e.g. `/wallet` or `/wallet/data-wallet-feature`? or any other capabilityconsole.log(type)// => e.g. `"error"`, `"pay"`, `"get"` ... (meaning depends on `path`)console.log(path)// => e.g.`/dapp` or `/dapp/marketplace` or any other feature of the dappconsole.log(from,lid)// uniquely identifies a messageconsole.log(lid)// => lid>0, probably just a counter maintained by code around `from`// it can be used by a sender to specifically "replay" to a previously received messageconsole.log(ref)// => a `lid` or a previous message where `from` was `path`console.log(body)// => any kind of data that makes sense in the context of `type` & `path`}
example scenarios
dapp requests payment confirmation from wallet and returns transaction response
or dapp listens to events and wallet sends a lot of "responses" over time every time
user revokes access in wallet and it sends a message about revoked access to dapp
....
"communication" - depending on wallet features - could be initiated by either:
the dapp
the wallet
every "protocol type" involves a certain amount of messages passing back and forth depending on what the communication is about and can be initiated and/or terminated by any party
so whether:
an API (list of methods/commands/querys/...) the wallet understands
an API (list of methods/commands/querys/...) the dapp understands
each method/command/query/... would:
start with a message
followed by 0 or more messages going back and forth
until success or fail or e.g. in case of subscribing to an event, this might go on forever...
The text was updated successfully, but these errors were encountered:
@todo
Maybe any valid message could look like:
example scenarios
dapp
requests payment confirmation fromwallet
and returns transaction responsedapp
listens to events andwallet
sends a lot of "responses" over time every timewallet
and it sends a message about revoked access todapp
"communication" - depending on wallet features - could be initiated by either:
dapp
wallet
every "protocol type" involves a certain amount of messages passing back and forth depending on what the communication is about and can be initiated and/or terminated by any party
so whether:
methods/commands/querys/...
) the wallet understandsmethods/commands/querys/...
) the dapp understandseach
method/command/query/...
would:The text was updated successfully, but these errors were encountered: