ChainAgnostic / CASA

Chain Agnostic Standards Alliance organizational homebase
https://alliance.chainagnostic.org
111 stars 40 forks source link

RPC/Provider Authorization Call, 23 Nov #53

Closed bumblefudge closed 1 year ago

bumblefudge commented 1 year ago

2022-11-22

    "params": {
        "required":{
            eip155": {
                "chains": ["eip155:1", "eip155:137"],
                "methods": ["eth_sendTransaction", "eth_signTransaction", "eth_sign", "personal_sign"]
                "events": ["accountsChanged", "chainChanged"]
            },
            "eip155:10": {
                "methods": ["personal_sign"]
                "events": ["accountsChanged", "chainChanged"]
            },
            "cosmos": {
                ...
            }
        },
        "optional":{
            "eip155:10": {
                "methods": ["additional_novel_method"]
                "events": ["novel_event"]
            },
            "sessionVars" {
                "expiry": $timestamp
            }
        }
    },

result:

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "SessionIdentifier": "0xdeadbeef",
    "accounts": ["eip155:1:0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb"],
    "session": {
        eip155": {
            "chains": ["eip155:1", "eip155:137"],
            "methods": ["eth_sendTransaction", "eth_signTransaction", "eth_sign", "personal_sign"]
            "events": ["accountsChanged", "chainChanged"]
        },
        "eip155:10": {
            "methods": ["personal_sign"]
            "events": ["accountsChanged", "chainChanged", "novel_event"]
        },
        "sessionVars": {
            "expiry": $timestamp
        }    
    }
  }
}