Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Update RPC OpenRPC spec #1063

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 33 additions & 50 deletions static/stellar-rpc.openrpc.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
{
"name": "getEvents",
"summary": "returns contract events",
"description": "Clients can request a filtered list of events emitted by a given ledger range.\n\nSoroban-RPC will support querying within a maximum 24 hours of recent ledgers.\n\nNote, this could be used by the client to only prompt a refresh when there is a new ledger with relevant events. It should also be used by backend Dapp components to \"ingest\" events into their own database for querying and serving.\n\nIf making multiple requests, clients should deduplicate any events received, based on the event's unique id field. This prevents double-processing in the case of duplicate events being received.\n\nBy default soroban-rpc retains the most recent 24 hours of events.",
"description": "Clients can request a filtered list of events emitted by a given ledger range.\n\nSoroban-RPC will support querying within a maximum 7 days of ledgers (120960).\n\nNote, this could be used by the client to only prompt a refresh when there is a new ledger with relevant events. It should also be used by backend Dapp components to \"ingest\" events into their own database for querying and serving.\n\nIf making multiple requests, clients should deduplicate any events received, based on the event's unique id field. This prevents double-processing in the case of duplicate events being received.\n\nBy default soroban-rpc retains the most recent 24 hours of events.",
"externalDocs": {
"url": "https://developers.stellar.org/docs/data/rpc/api-reference/methods/getEvents"
},
Expand All @@ -50,6 +50,17 @@
"type": "number"
}
},
{
"name": "endLedger",
"summary": "ledger represents the end of search window",
"description": "Ledger sequence number represents the end of search window (exclusive). If a cursor is included in the request, `endLedger` must be omitted.",
"required": false,
"schema": {
"title": "ledgerSequence",
"description": "Sequence number of the ledger.",
"type": "number"
}
},
{
"name": "filters",
"summary": "filters to narrow events search",
Expand Down Expand Up @@ -130,6 +141,11 @@
"description": "The sequence number of the latest ledger known to Soroban RPC at the time it handled the request.",
"type": "number"
},
"cursor": {
"title": "cursor",
"type": "string",
"description": "A unique identifier that represents the last populated event ID if total events reach the limit or end of the search window"
},
"events": {
"type": "array",
"items": {
Expand Down Expand Up @@ -163,10 +179,6 @@
"description": "Unique identifier for this event.\n\n- The event's unique id field is based on a [`toid` from Horizon](https://github.com/stellar/go/blob/master/toid/main.go) as used in Horizon's /effects endpoint.\n\n- https://github.com/stellar/go/blob/master/services/horizon/internal/db2/history/effect.go#L58\n\n- Specifically, it is a string containing:\n\n- bigint(32 bit ledger sequence + 20 bit txn number + 12 bit operation) + `<hyphen>` + number for the event within the operation.\n\n- For example: `1234-1`",
"type": "string"
},
"pagingToken": {
"description": "Duplicate of `id` field, but in the standard place for pagination tokens.",
"type": "string"
},
"inSuccessfulContractCall": {
"description": "If true the event was emitted during a successful contract call.",
"type": "boolean"
Expand Down Expand Up @@ -245,7 +257,6 @@
"ledgerClosedAt": "2024-04-19T06:19:00Z",
"contractId": "CDLZFC3SYJYDZT7K67VZ75HPJVIEUVNIXF47ZG2FB2RMQQVU2HHGCYSC",
"id": "0005121327593697280-0000000002",
"pagingToken": "0005121327593697280-0000000002",
"topic": [
"AAAADwAAAAh0cmFuc2Zlcg==",
"AAAAEgAAAAAAAAAA/ItF3cwsGhkee6lL5X6kicifdluxtsuDq9J/F0zou6Q=",
Expand All @@ -262,7 +273,6 @@
"ledgerClosedAt": "2024-04-19T06:22:14Z",
"contractId": "CDLZFC3SYJYDZT7K67VZ75HPJVIEUVNIXF47ZG2FB2RMQQVU2HHGCYSC",
"id": "0005121482212511744-0000000002",
"pagingToken": "0005121482212511744-0000000002",
"topic": [
"AAAADwAAAAh0cmFuc2Zlcg==",
"AAAAEgAAAAAAAAAA/ItF3cwsGhkee6lL5X6kicifdluxtsuDq9J/F0zou6Q=",
Expand All @@ -274,7 +284,8 @@
"txHash": "3fa1787085a4aa585507751394d70494a02e71d347446095a763ecbfc647937c"
}
],
"latestLedger": 1197926
"latestLedger": 1197926,
"cursor": "0005121482212511744-0000000002"
}
}
},
Expand Down Expand Up @@ -303,7 +314,6 @@
"ledgerClosedAt": "2024-04-19T02:50:17Z",
"contractId": "",
"id": "0005111084096696320-0000000000",
"pagingToken": "0005111084096696320-0000000000",
"topic": [
"AAAADwAAAAdmbl9jYWxsAA==",
"AAAADQAAACBVkqNeeMWaJ6fGFVD0NhNxSTQdXVfI6TONZODy5H/xvg==",
Expand All @@ -319,7 +329,6 @@
"ledgerClosedAt": "2024-04-19T02:50:17Z",
"contractId": "CBKZFI26PDCZUJ5HYYKVB5BWCNYUSNA5LVL4R2JTRVSOB4XEP7Y34OPN",
"id": "0005111084096696320-0000000001",
"pagingToken": "0005111084096696320-0000000001",
"topic": [
"AAAADwAAAAlmbl9yZXR1cm4AAAA=",
"AAAADwAAAAlzZXRfcHJpY2UAAAA="
Expand All @@ -329,7 +338,8 @@
"txHash": "3f81b00a78830bb0186539cceed5ac137aad0d6872dd998c533c2758fbda0a6c"
}
],
"latestLedger": 1197964
"latestLedger": 1197964,
"cursor": "0005111084096696320-0000000001"
}
}
}
Expand Down Expand Up @@ -1360,33 +1370,33 @@
"type": "object",
"required": [
"version",
"commit_hash",
"build_time_stamp",
"captive_core_version",
"protocol_version"
"commitHash",
"buildTimeStamp",
"captiveCoreVersion",
"protocolVersion"
],
"properties": {
"version": {
"type": "string",
"description": "The version of the RPC server.",
"example": "21.1.0"
},
"commit_hash": {
"commitHash": {
"type": "string",
"description": "The commit hash of the RPC server.",
"example": "fcd2f0523f04279bae4502f3e3fa00ca627e6f6a"
},
"build_time_stamp": {
"buildTimeStamp": {
"type": "string",
"description": "The build timestamp of the RPC server.",
"example": "2024-05-10T11:18:38"
},
"captive_core_version": {
"captiveCoreVersion": {
"type": "string",
"description": "The version of the Captive Core.",
"example": "stellar-core 21.0.0.rc2 (c6f474133738ae5f6d11b07963ca841909210273)"
},
"protocol_version": {
"protocolVersion": {
"type": "integer",
"description": "The protocol version.",
"example": 21
Expand All @@ -1403,10 +1413,10 @@
"name": "getVersionInfoResult",
"value": {
"version": "21.1.0",
"commit_hash": "fcd2f0523f04279bae4502f3e3fa00ca627e6f6a",
"build_time_stamp": "2024-05-10T11:18:38",
"captive_core_version": "stellar-core 21.0.0.rc2 (c6f474133738ae5f6d11b07963ca841909210273)",
"protocol_version": 21
"commitHash": "fcd2f0523f04279bae4502f3e3fa00ca627e6f6a",
"buildTimeStamp": "2024-05-10T11:18:38",
"captiveCoreVersion": "stellar-core 21.0.0.rc2 (c6f474133738ae5f6d11b07963ca841909210273)",
"protocolVersion": 21
}
}
}
Expand Down Expand Up @@ -1636,25 +1646,6 @@
"type": "string",
"description": "(optional) Stringified number - Recommended minimum resource fee to add when submitting the transaction. This fee is to be added on top of the [Stellar network fee](https://developers.stellar.org/docs/learn/fundamentals/fees-resource-limits-metering#inclusion-fee). Not present in case of error."
},
"cost": {
"type": "object",
"description": "(optional) - The cost object is legacy, inaccurate, and will be deprecated in future RPC releases. Please decode transactionData XDR to retrieve the correct resources.",
"deprecated": true,
"required": [
"cpuInsns",
"memBytes"
],
"properties": {
"cpuInsns": {
"type": "string",
"description": "Stringified number - Total cpu instructions consumed by this transaction"
},
"memBytes": {
"type": "string",
"description": "Stringified number - Total memory bytes allocated by this transaction"
}
}
},
"results": {
"type": "array",
"description": "(optional) - This array will only have one element: the result for the Host Function invocation. Only present on successful simulation (i.e. no error) of `InvokeHostFunction` operations.",
Expand Down Expand Up @@ -1792,10 +1783,6 @@
"xdr": "AAAAAwAAAAw="
}
],
"cost": {
"cpuInsns": "1635562",
"memBytes": "1295756"
},
"latestLedger": 2552139
}
}
Expand Down Expand Up @@ -1827,10 +1814,6 @@
"AAAAAAAAAAAAAAAAAAAAAgAAAAAAAAADAAAADwAAAAdmbl9jYWxsAAAAAA0AAAAgzAP+dP0PsNzYvFF1pv7a8RQXwH5eg3uZBbbWjE9PwAsAAAAPAAAACWluY3JlbWVudAAAAAAAAAMAAAAD",
"AAAAAAAAAAAAAAABzAP+dP0PsNzYvFF1pv7a8RQXwH5eg3uZBbbWjE9PwAsAAAACAAAAAAAAAAIAAAAPAAAABWVycm9yAAAAAAAAAgAAAAEAAAAHAAAAEAAAAAEAAAACAAAADgAAAC1WTSBjYWxsIGZhaWxlZDogRnVuYyhNaXNtYXRjaGluZ1BhcmFtZXRlckxlbikAAAAAAAAPAAAACWluY3JlbWVudAAAAA=="
],
"cost": {
"cpuInsns": "0",
"memBytes": "0"
},
"latestLedger": 2552013
}
}
Expand Down