diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..26c9e8f --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +jsonrpc/openrpc.json +jsonrpc/node_modules diff --git a/jsonrpc/src/content/params.json b/jsonrpc/src/content/params.json index 0e9d6b3..59176d6 100644 --- a/jsonrpc/src/content/params.json +++ b/jsonrpc/src/content/params.json @@ -43,6 +43,19 @@ } } }, + "ContentItems": { + "name": "content_items", + "required": true, + "schema": { + "title": "content_item", + "type": "array", + "items": { + "$ref": "#/components/schemas/ContentItem" + }, + "minItems": 1, + "maxItems": 64 + } + }, "Enr": { "name": "enr", "required": true, diff --git a/jsonrpc/src/methods/beacon.json b/jsonrpc/src/methods/beacon.json index 1dae686..fd24183 100644 --- a/jsonrpc/src/methods/beacon.json +++ b/jsonrpc/src/methods/beacon.json @@ -99,16 +99,13 @@ }, { "name": "portal_beaconOffer", - "summary": "Send an OFFER request with given ContentKey, to the designated peer and wait for a response.", + "summary": "Send an OFFER request with given array of content items (keys & values), to the designated peer and wait for a response. The client MUST return an error if more than 64 content items are provided or less than 1 content items are provided.", "params": [ { "$ref": "#/components/contentDescriptors/Enr" }, { - "$ref": "#/components/contentDescriptors/ContentKey" - }, - { - "$ref": "#/components/contentDescriptors/ContentValue" + "$ref": "#/components/contentDescriptors/ContentItems" } ], "result": { diff --git a/jsonrpc/src/methods/history.json b/jsonrpc/src/methods/history.json index e94d8ab..7ae4129 100644 --- a/jsonrpc/src/methods/history.json +++ b/jsonrpc/src/methods/history.json @@ -99,16 +99,13 @@ }, { "name": "portal_historyOffer", - "summary": "Send an OFFER request with given ContentKey, to the designated peer and wait for a response.", + "summary": "Send an OFFER request with given array of content items (keys & values), to the designated peer and wait for a response. The client MUST return an error if more than 64 content items are provided or less than 1 content items are provided.", "params": [ { "$ref": "#/components/contentDescriptors/Enr" }, { - "$ref": "#/components/contentDescriptors/ContentKey" - }, - { - "$ref": "#/components/contentDescriptors/ContentValue" + "$ref": "#/components/contentDescriptors/ContentItems" } ], "result": { diff --git a/jsonrpc/src/methods/state.json b/jsonrpc/src/methods/state.json index 166275e..2767caf 100644 --- a/jsonrpc/src/methods/state.json +++ b/jsonrpc/src/methods/state.json @@ -99,16 +99,13 @@ }, { "name": "portal_stateOffer", - "summary": "Send an OFFER request with given ContentKey, to the designated peer and wait for a response.", + "summary": "Send an OFFER request with given array of content items (keys & values), to the designated peer and wait for a response. The client MUST return an error if more than 64 content items are provided or less than 1 content items are provided.", "params": [ { "$ref": "#/components/contentDescriptors/Enr" }, { - "$ref": "#/components/contentDescriptors/ContentKey" - }, - { - "$ref": "#/components/contentDescriptors/ContentValue" + "$ref": "#/components/contentDescriptors/ContentItems" } ], "result": { diff --git a/jsonrpc/src/schemas/portal.json b/jsonrpc/src/schemas/portal.json index 8103a2c..7b08401 100644 --- a/jsonrpc/src/schemas/portal.json +++ b/jsonrpc/src/schemas/portal.json @@ -38,5 +38,24 @@ "title": "UDP port number", "type": "string", "pattern": "^([1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$" + }, + "ContentItem": { + "title": "content_item", + "type": "array", + "items": [ + { + "title": "Content key", + "description": "The encoded Portal content key", + "$ref": "#/components/schemas/hexString" + }, + { + "title": "Content value", + "description": "The encoded Portal content value", + "$ref": "#/components/schemas/hexString" + } + ], + "minItems": 2, + "maxItems": 2, + "additionalItems": false } }