Skip to content

Instantly share code, notes, and snippets.

@sbc64
Created February 3, 2022 14:49
Show Gist options
  • Save sbc64/cee3789f3c91096c460d86666e348bbd to your computer and use it in GitHub Desktop.
Save sbc64/cee3789f3c91096c460d86666e348bbd to your computer and use it in GitHub Desktop.
{
"openrpc": "1.2.4",
"info": {
"title": "WalletConnect API",
"description": "A specification of the P2P communication interface for WalletConnect clients.",
"license": {
"name": "",
"url": ""
},
"version": "2.0.0"
},
"methods": [
{
"name": "wc_pairingApprove",
"params": [],
"result": {
"$ref": "#/components/contentDescriptors/successResult"
}
},
{
"name": "wc_pairingReject",
"params": [],
"result": {
"$ref": "#/components/contentDescriptors/successResult"
}
},
{
"name": "wc_pairingUpdate",
"params": [],
"result": {
"$ref": "#/components/contentDescriptors/successResult"
}
},
{
"name": "wc_pairingUpgrade",
"params": [],
"result": {
"$ref": "#/components/contentDescriptors/successResult"
}
},
{
"name": "wc_pairingDelete",
"params": [],
"result": {
"$ref": "#/components/contentDescriptors/successResult"
}
},
{
"name": "wc_pairingPayload",
"params": [],
"result": {
"$ref": "#/components/contentDescriptors/successResult"
}
},
{
"name": "wc_pairingPing",
"params": [],
"result": {
"$ref": "#/components/contentDescriptors/successResult"
}
},
{
"name": "wc_pairingNotification",
"params": [],
"result": {
"$ref": "#/components/contentDescriptors/successResult"
}
},
{
"name": "wc_sessionPropose",
"params": [],
"result": {
"$ref": "#/components/contentDescriptors/successResult"
}
},
{
"name": "wc_sessionApprove",
"params": [],
"result": {
"$ref": "#/components/contentDescriptors/successResult"
}
},
{
"name": "wc_sessionReject",
"params": [],
"result": {
"$ref": "#/components/contentDescriptors/successResult"
}
},
{
"name": "wc_sessionUpdate",
"tags": [
{
"name": "Session"
}
],
"summary": "Updates the state of a settled session.",
"description": "The update method is used to update the state of a **settled session** participants by allowing the controller to expose extra accounts to the peer during the session lifetime. The caller must send only the new accounts that will add to the current set.\n#### Error reasons:\n+ **1003:** When the account identifiers are not conformant to CAIP-10.\n+ **1301:** If there is no session for the corresponding topic (e.g. session expired).\n+ **3003:** If the request is sent by a non-controller or the session is not settled yet.\n+ **3005:** If the request is received by a controller.",
"paramStructure": "by-name",
"params": [
{
"name": "state",
"summary": "The partial updated state of the session",
"description": "The partial state object hold a set of CAIP-10 accounts to add over the current accounts exposed through the session.",
"required": true,
"schema": {
"title": "SessionState",
"type": "object",
"description": "An object containing the state of a session",
"properties": {
"accounts": {
"title": "Accounts",
"type": "array",
"description": "An array of account strings conformant to CAIP-10"
}
}
}
}
],
"result": {
"$ref": "#/components/contentDescriptors/successResult"
},
"errors": [
{
"$ref": "#/components/errors/1003"
},
{
"$ref": "#/components/errors/1301"
},
{
"$ref": "#/components/errors/3003"
},
{
"$ref": "#/components/errors/3005"
}
],
"examples": [
{
"name": "Update example",
"params": [
{
"name": "state",
"value": {
"accounts": [
"eip155:1:0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb",
"bip122:000000000019d6689c085ae165831e93:128Lkh3S7CkDTBZ8W7BbpsN3YYizJMp8p6"
]
}
}
],
"result": {
"name": "success",
"value": true
}
}
]
},
{
"name": "wc_sessionUpgrade",
"params": [],
"result": {
"$ref": "#/components/contentDescriptors/successResult"
}
},
{
"name": "wc_sessionDelete",
"params": [],
"result": {
"$ref": "#/components/contentDescriptors/successResult"
}
},
{
"name": "wc_sessionPayload",
"params": [],
"result": {
"$ref": "#/components/contentDescriptors/successResult"
}
},
{
"name": "wc_sessionPing",
"params": [],
"result": {
"$ref": "#/components/contentDescriptors/successResult"
}
},
{
"name": "wc_sessionNotification",
"params": [],
"result": {
"$ref": "#/components/contentDescriptors/successResult"
}
}
],
"components": {
"contentDescriptors": {
"successResult": {
"name": "Success",
"summary": "Always true if received",
"description": "The result is always true if there was no error invoking the method.",
"schema": {
"title": "Success",
"type": "boolean"
}
}
},
"errors": {
"1003": {
"code": 1003,
"message": "Invalid ${context} update request"
},
"1004": {
"code": 1004,
"message": "Invalid ${context} upgrade request"
},
"1301": {
"code": 1301,
"message": "No matching ${context} with topic: ${topic}"
},
"3003": {
"code": 3003,
"message": "Unauthorized ${context} update request"
},
"3004": {
"code": 3004,
"message": "Unauthorized ${context} upgrade request"
},
"3005": {
"code": 3005,
"message": "Unauthorized: peer is also ${\"\" | \"not\"} controller"
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment