|
| 1 | +openrpc: 1.2.4 |
| 2 | +info: |
| 3 | + title: MetaMask MultiChain API |
| 4 | + version: 1.0.0 |
| 5 | + description: >- |
| 6 | + This provides the specs for the MultiChain API Layer for the MetaMask API |
| 7 | +methods: |
| 8 | + - name: "provider_authorize" |
| 9 | + paramStructure: "by-name" |
| 10 | + params: |
| 11 | + - name: "requiredScopes" |
| 12 | + description: "Scopes that the wallet must support in order to be used with this provider." |
| 13 | + schema: |
| 14 | + type: "object" |
| 15 | + patternProperties: |
| 16 | + "[-a-z0-9]{3,8}(:[-_a-zA-Z0-9]{1,32})?": |
| 17 | + $ref: "#/components/schemas/Scope" |
| 18 | + - name: "optionalScopes" |
| 19 | + description: "Scopes that the wallet may support in order to be used with this provider." |
| 20 | + schema: |
| 21 | + type: "object" |
| 22 | + patternProperties: |
| 23 | + "[-a-z0-9]{3,8}(:[-_a-zA-Z0-9]{1,32})?": |
| 24 | + $ref: "#/components/schemas/Scope" |
| 25 | + - name: "sessionProperties" |
| 26 | + description: "Properties that the wallet may use to determine if the session is valid." |
| 27 | + schema: |
| 28 | + type: "object" |
| 29 | + properties: |
| 30 | + expiry: |
| 31 | + type: "string" |
| 32 | + format: "date-time" |
| 33 | + result: |
| 34 | + name: "provider_authorizeResult" |
| 35 | + schema: |
| 36 | + type: "object" |
| 37 | + properties: |
| 38 | + sessionId: |
| 39 | + description: "A unique identifier for the session. Defined by [CAIP-171](https://github.com/ChainAgnostic/CAIPs/blob/master/CAIPs/caip-171.md)" |
| 40 | + type: "string" |
| 41 | + sessionScopes: |
| 42 | + type: "object" |
| 43 | + patternProperties: |
| 44 | + "[-a-z0-9]{3,8}:[-_a-zA-Z0-9]{1,32}": |
| 45 | + $ref: "#/components/schemas/Scope" |
| 46 | + sessionProperties: |
| 47 | + type: "object" |
| 48 | + properties: |
| 49 | + expiry: |
| 50 | + type: "string" |
| 51 | + format: "date-time" |
| 52 | + examples: |
| 53 | + - name: "provider_authorizeExample" |
| 54 | + description: "Example of a provider authorization request." |
| 55 | + params: |
| 56 | + - name: "requiredScopes" |
| 57 | + value: |
| 58 | + eip155: |
| 59 | + chains: |
| 60 | + - "eip155:1" |
| 61 | + - "eip155:137" |
| 62 | + methods: |
| 63 | + - "eth_sendTransaction" |
| 64 | + - "eth_getBalance" |
| 65 | + - "personal_sign" |
| 66 | + notifications: |
| 67 | + - "accountsChanged" |
| 68 | + - "chainChanged" |
| 69 | + "eip155:10": |
| 70 | + methods: |
| 71 | + - "eth_getBalance" |
| 72 | + notifications: |
| 73 | + - "accountsChanged" |
| 74 | + - "chainChanged" |
| 75 | + - name: "optionalScopes" |
| 76 | + value: |
| 77 | + "eip155:42161": |
| 78 | + methods: |
| 79 | + - "eth_sendTransaction" |
| 80 | + - "eth_getBalance" |
| 81 | + - "personal_sign" |
| 82 | + notifications: |
| 83 | + - "accountsChanged" |
| 84 | + - "chainChanged" |
| 85 | + - name: "sessionProperties" |
| 86 | + value: |
| 87 | + expiry: "2022-12-24T17:07:31+00:00" |
| 88 | + result: |
| 89 | + name: "provider_authorizationResultExample" |
| 90 | + value: |
| 91 | + sessionId: "0xdeadbeef" |
| 92 | + sessionScopes: |
| 93 | + eip155: |
| 94 | + chains: |
| 95 | + - "eip155:1" |
| 96 | + - "eip155:137" |
| 97 | + methods: |
| 98 | + - "eth_sendTransaction" |
| 99 | + - "eth_getBalance" |
| 100 | + - "personal_sign" |
| 101 | + notifications: |
| 102 | + - "accountsChanged" |
| 103 | + - "chainChanged" |
| 104 | + accounts: |
| 105 | + - "eip155:1:0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb" |
| 106 | + - "eip155:137:0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb" |
| 107 | + "eip155:10": |
| 108 | + methods: |
| 109 | + - "eth_getBalance" |
| 110 | + notifications: |
| 111 | + - "accountsChanged" |
| 112 | + - "chainChanged" |
| 113 | + accounts: [] |
| 114 | + "eip155:42161": |
| 115 | + methods: |
| 116 | + - "personal_sign" |
| 117 | + notifications: |
| 118 | + - "accountsChanged" |
| 119 | + - "chainChanged" |
| 120 | + accounts: |
| 121 | + - "eip155:42161:0x0910e12C68d02B561a34569E1367c9AAb42bd810" |
| 122 | + cosmos: {} |
| 123 | + sessionProperties: |
| 124 | + expiry: "2022-11-31T17:07:31+00:00" |
| 125 | + errors: |
| 126 | + - code: 5000 |
| 127 | + message: "User disapproved requested chains" |
| 128 | + - code: 5001 |
| 129 | + message: "User disapproved requested methods" |
| 130 | + - code: 5002 |
| 131 | + message: "User disapproved requested notifications" |
| 132 | + - code: 5100 |
| 133 | + message: "Requested chains are not supported" |
| 134 | + - code: 5101 |
| 135 | + message: "Requested methods are not supported" |
| 136 | + - code: 5102 |
| 137 | + message: "Requested notifications are not supported" |
| 138 | + - code: 5103 |
| 139 | + message: "Scope/chain mismatch" |
| 140 | + - code: 5104 |
| 141 | + message: "ChainId defined in two different scopes" |
| 142 | + - code: 5200 |
| 143 | + message: "Invalid Session Properties requested" |
| 144 | + - code: 5201 |
| 145 | + message: "Session Properties can only be optional" |
| 146 | +components: |
| 147 | + schemas: |
| 148 | + Scope: |
| 149 | + type: "object" |
| 150 | + title: "Scope" |
| 151 | + description: "Scope for a multi-chain connection" |
| 152 | + additionalProperties: true |
| 153 | + required: |
| 154 | + - notifications |
| 155 | + - methods |
| 156 | + properties: |
| 157 | + chains: |
| 158 | + type: "array" |
| 159 | + items: |
| 160 | + type: "string" |
| 161 | + pattern: "[-a-z0-9]{3,8}(:[-_a-zA-Z0-9]{1,32})?" |
| 162 | + methods: |
| 163 | + description: "Methods that the wallet must support in order to be used with this provider." |
| 164 | + type: "array" |
| 165 | + items: |
| 166 | + type: "string" |
| 167 | + notifications: |
| 168 | + description: "notifications that the wallet must support in order to be used with this provider." |
| 169 | + type: "array" |
| 170 | + items: |
| 171 | + type: "string" |
| 172 | + rpcEndpoints: |
| 173 | + description: "JSON-RPC endpoints for this namespace." |
| 174 | + type: "array" |
| 175 | + items: |
| 176 | + type: "string" |
| 177 | + format: "uri" |
| 178 | + rpcDocuments: |
| 179 | + type: "array" |
| 180 | + description: "OpenRPC documents that define RPC methods in which to anchor the methods authorized in a CAIP-25 interaction." |
| 181 | + items: |
| 182 | + type: "string" |
| 183 | + format: "uri" |
0 commit comments