namespace
.proposal namespaces
and session namespaces
.chains
, methods
and events
that the dapp intends to make use of.['polkadot:91b171bb158e2d3848fa23a9f1c25182']
in its requiredNamespaces chains
field but a wallet could return a session namespace with both Polkadot and Kusama ['polkadot:91b171bb158e2d3848fa23a9f1c25182','polkadot:b0a8d493285c2df73290dfb7e61f870f']
as part of the sessions namespaces.chains
is an array of chain ids which represent the chains the session will be using during its lifetime. For Polkadot, the format for each chain id is the chain agnostic namespace (e.g. eip155
, polkadot
, cosmos
etc) followed by a colon and the genesis hash for the chain (e.g. 91b171bb158e2d3848fa23a9f1c25182
for Polkadot).methods
is represented as an array of wallet defined methods that a session supports.polkadot_signMessage
and polkadot_signTransaction
. The idea for the functionality of these methods is to sign the relevant data (either a message or unsigned transaction) and return the signature. An example for each method.polkadot_getSignedHex
and creating an implementation that signs, and returns the hash of the signed transaction.events
represent specific changes in a sessions state that a dapp or wallet may want to take some action on.session_update
to update the accounts, chains, methods or events for the session or session_delete
to end a session. (More on events).
connect
method accepts an object based on the following interface:
ConnectParams
interface. All fields are optional and in the below example we use only the requiredNamespaces
field in our proposal namespace:
id
as well as the session namespaces
which are approved for use in the session. An example of what this looks like is below.