diff --git a/cmd/soroban-rpc/internal/methods/get_events.go b/cmd/soroban-rpc/internal/methods/get_events.go index e63f9132..8312b530 100644 --- a/cmd/soroban-rpc/internal/methods/get_events.go +++ b/cmd/soroban-rpc/internal/methods/get_events.go @@ -92,6 +92,8 @@ type EventInfo struct { ContractID string `json:"contractId"` ID string `json:"id"` + // Deprecated: PagingToken field is deprecated, please use Cursor at top level for pagination + PagingToken string `json:"pagingToken"` InSuccessfulContractCall bool `json:"inSuccessfulContractCall"` TransactionHash string `json:"txHash"` @@ -553,6 +555,7 @@ func eventInfoForEvent( Ledger: int32(cursor.Ledger), LedgerClosedAt: ledgerClosedAt, ID: cursor.String(), + PagingToken: cursor.String(), InSuccessfulContractCall: event.InSuccessfulContractCall, TransactionHash: txHash, } diff --git a/cmd/soroban-rpc/internal/methods/get_events_test.go b/cmd/soroban-rpc/internal/methods/get_events_test.go index 81a9c169..cd06b0e3 100644 --- a/cmd/soroban-rpc/internal/methods/get_events_test.go +++ b/cmd/soroban-rpc/internal/methods/get_events_test.go @@ -649,6 +649,7 @@ func TestGetEvents(t *testing.T) { LedgerClosedAt: now.Format(time.RFC3339), ContractID: "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABSC4", ID: id, + PagingToken: id, TopicXDR: []string{value}, ValueXDR: value, InSuccessfulContractCall: true, @@ -795,6 +796,7 @@ func TestGetEvents(t *testing.T) { LedgerClosedAt: now.Format(time.RFC3339), ContractID: "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABSC4", ID: id, + PagingToken: id, TopicXDR: []string{counterXdr, value}, ValueXDR: value, InSuccessfulContractCall: true, @@ -941,6 +943,7 @@ func TestGetEvents(t *testing.T) { LedgerClosedAt: now.Format(time.RFC3339), ContractID: strkey.MustEncode(strkey.VersionByteContract, contractID[:]), ID: id, + PagingToken: id, TopicXDR: []string{counterXdr, value}, ValueXDR: value, InSuccessfulContractCall: true, @@ -1017,6 +1020,7 @@ func TestGetEvents(t *testing.T) { LedgerClosedAt: now.Format(time.RFC3339), ContractID: strkey.MustEncode(strkey.VersionByteContract, contractID[:]), ID: id, + PagingToken: id, TopicXDR: []string{counterXdr}, ValueXDR: counterXdr, InSuccessfulContractCall: true, @@ -1089,6 +1093,7 @@ func TestGetEvents(t *testing.T) { LedgerClosedAt: now.Format(time.RFC3339), ContractID: "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABSC4", ID: id, + PagingToken: id, TopicXDR: []string{value}, ValueXDR: value, InSuccessfulContractCall: true, @@ -1190,6 +1195,7 @@ func TestGetEvents(t *testing.T) { LedgerClosedAt: now.Format(time.RFC3339), ContractID: strkey.MustEncode(strkey.VersionByteContract, contractID[:]), ID: id, + PagingToken: id, TopicXDR: []string{counterXdr}, ValueXDR: expectedXdr, InSuccessfulContractCall: true,