subscription.proto

SubscriptionRequest

Used by the client to subscribe to a subset of events from the shop

On success responds with a subscription_id in the payload of GenericResponse

SubscriptionRequest type fields

Field

Type

Label

Description

start_shop_seq_no

uint64

The relay will send events from the shop log starting from this sequence number.

shop_id

Uint256

The id of the shop that is being subscribed to. If an objectType is not specified then the relay will return all the events for the shop given the current level of authentication.

filters

SubscriptionRequest.Filter

repeated

Filter can be applied to return only a subset of events

SubscriptionRequest.Filter

SubscriptionRequest.Filter type fields

Field

Type

Label

Description

object_type

ObjectType

Which object is being subscribed to. Subscribing to an object will return a stream of events that modify that object type. For example subscribing to LISTING will return a stream of all the events that modify listings in the shop.

object_id

ObjectId

optional_object_id

Optional subscribe to only events that modify a single item. We assume object_id is only unique for a given object_type, so object_type is required.

SubscriptionPushRequest

Used by the relay to push events to the client. Will not send more events until the client has acknowledged the last batch.

Client sends a GenericResponse without an error to acknowledge recption. To close a subscription, respond with ERROR_CODES_CLOSE_SUBSCRIPTION

SubscriptionPushRequest type fields

Field

Type

Label

Description

subscription_id

bytes

sets

SubscriptionPushRequest.SequencedPartialPatchSet

repeated

SubscriptionPushRequest.SequencedPartialPatchSet

SubscriptionPushRequest.SequencedPartialPatchSet type fields

Field

Type

Label

Description

shop_seq_no

uint64

sequence number of the patchSet in the shop log

patch_leaf_index

uint32

index of the patch in the patch set

header

bytes

cbor patchSet header data (see go/cbor/patches.go)

signature

bytes

eip191 signature of the above

patches

bytes

repeated

array of cbor patch data

proofs

bytes

repeated

array of cbor proof data [index, tree_size, [proof1, proof2, …]]

SubscriptionCancelRequest

Used by a client to stop a relay from sending more events for a given subscription

SubscriptionCancelRequest type fields

Field

Type

Label

Description

subscription_id

bytes

ObjectType

The types of objects that events affect

Enum ObjectType values

Name

Number

Description

OBJECT_TYPE_UNSPECIFIED

0

invalid

OBJECT_TYPE_LISTING

1

OBJECT_TYPE_TAG

2

OBJECT_TYPE_ORDER

3

OBJECT_TYPE_ACCOUNT

4

accounts refer to keycard enrollments and customer accounts

OBJECT_TYPE_MANIFEST

5

OBJECT_TYPE_INVENTORY

6

inventory is separated since you must first authenticate to get the events