Skip to content
Merged
Show file tree
Hide file tree
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
12 changes: 6 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions lazer/publisher_sdk/proto/governance_instruction.proto
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ message GovernanceInstructionItem {
RemoveFeed remove_feed = 113;
AddFeatureFlag add_feature_flag = 114;
RemoveFeatureFlag remove_feature_flag = 115;
AddAsset add_asset = 116;
UpdateAsset update_asset = 117;
RemoveAsset remove_asset = 118;
}
}

Expand Down Expand Up @@ -368,3 +371,33 @@ message RemoveFeatureFlag {
// [required] Feature flag to remove.
optional string feature_flag = 1;
}

// Add a new asset. Refer to `Asset` message fields documentation.
message AddAsset {
// [required]
optional uint32 asset_id = 1;
// [required]
optional DynamicValue.Map metadata = 2;
}

message UpdateAsset {
// [required] ID of the asset that is being updated. Rejects if there is no such asset.
optional uint32 asset_id = 1;
// [required]
// Note: when adding a new variant here, update `Permissions` as well.
oneof action {
UpdateAssetMetadata update_asset_metadata = 101;
}
}

message RemoveAsset {
// [required] ID of the asset that is being removed. Rejects if there is no such asset.
optional uint32 asset_id = 1;
}

message UpdateAssetMetadata {
// [required] Property name.
optional string name = 1;
// [optional] Property value. If unset, the property will be removed.
optional DynamicValue value = 2;
}
22 changes: 22 additions & 0 deletions lazer/publisher_sdk/proto/state.proto
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ message State {
repeated GovernanceSourceState governance_sources = 9;
// Currently active feature flags. Feature flags influence the aggregator's behavior.
repeated string feature_flags = 10;
// List of assets.
repeated Asset assets = 11;
}

// An item of the state describing a publisher.
Expand Down Expand Up @@ -195,6 +197,14 @@ message FeedAggregateData {
optional int64 confidence = 8;
}

// An item of the state describing an asset.
message Asset {
// [required] ID of the asset.
optional uint32 asset_id = 1;
// [required] Additional metadata values. These values will be exposed in the APIs.
optional DynamicValue.Map metadata = 2;
}

// State associated with a governance source.
message GovernanceSourceState {
// [required]
Expand Down Expand Up @@ -233,6 +243,11 @@ message Permissions {
REMOVE_FEED = 113;
ADD_FEATURE_FLAG = 114;
REMOVE_FEATURE_FLAG = 115;
ADD_ASSET = 116;
// All operations under `UpdateAsset`,
// including operations added in the future.
UPDATE_ASSET = 117;
REMOVE_ASSET = 118;
}

enum UpdateGovernanceSourceAction {
Expand Down Expand Up @@ -263,10 +278,17 @@ message Permissions {
DISABLE_FEED_IN_SHARD = 104;
}

enum UpdateAssetAction {
// Required by protobuf. Instruction will be rejected if this value is encountered.
UPDATE_ASSET_ACTION_UNSPECIFIED = 0;
UPDATE_ASSET_METADATA = 101;
}

repeated ShardAction actions = 1;
repeated UpdateGovernanceSourceAction update_governance_source_actions = 2;
repeated UpdatePublisherAction update_publisher_actions = 3;
repeated UpdateFeedAction update_feed_actions = 4;
repeated UpdateAssetAction update_asset_actions = 5;
}


Expand Down
2 changes: 1 addition & 1 deletion lazer/publisher_sdk/rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pyth-lazer-publisher-sdk"
version = "0.18.0"
version = "0.19.0"
edition = "2021"
description = "Pyth Lazer Publisher SDK types."
license = "Apache-2.0"
Expand Down