diff --git a/koinos/koindx_tracker/koindx_tracker.proto b/koinos/koindx_tracker/koindx_tracker.proto new file mode 100644 index 0000000..6995649 --- /dev/null +++ b/koinos/koindx_tracker/koindx_tracker.proto @@ -0,0 +1,28 @@ +syntax = "proto3"; + +package koinos.koindx_tracker; +option go_package = "github.com/koinos/koinos-proto-golang/v2/koinos/koindx_tracker"; + +import "koinos/options.proto"; + +message liquidity_record { + bytes address = 1 [(btype) = ADDRESS]; + uint64 balance = 2 [jstype = JS_STRING]; + uint64 prev_coin_ms_hi = 3 [jstype = JS_STRING]; + uint64 prev_coin_ms_lo = 4 [jstype = JS_STRING]; + uint64 last_update = 5 [jstype = JS_STRING]; +} + +message tvl_record { + uint64 value = 1 [jstype = JS_STRING]; +} + +message initialize_event { + string token_a = 1; + string token_b = 2; +} + +message sync_event { + uint64 reserve_a = 1 [jstype = JS_STRING]; + uint64 reserve_b = 2 [jstype = JS_STRING]; +} diff --git a/koinos/rpc/koindx_tracker/koindx_tracker_rpc.proto b/koinos/rpc/koindx_tracker/koindx_tracker_rpc.proto new file mode 100644 index 0000000..209a485 --- /dev/null +++ b/koinos/rpc/koindx_tracker/koindx_tracker_rpc.proto @@ -0,0 +1,83 @@ +syntax = "proto3"; + +package koinos.rpc.koindx_tracker; +option go_package = "github.com/koinos/koinos-proto-golang/v2/koinos/rpc/koindx_tracker"; + +import "koinos/koindx_tracker/koindx_tracker.proto"; +import "koinos/options.proto"; +import "koinos/rpc/rpc.proto"; + +message pool_pair { + bytes pool = 1 [(btype) = ADDRESS]; + string token_a = 2; + string token_b = 3; +} + +message get_pools_request { + oneof target { + bytes start = 1 [(btype) = ADDRESS]; + bytes pool = 2 [(btype) = ADDRESS]; + } + uint64 limit = 3 [jstype = JS_STRING]; +} + +message get_pools_response { + repeated pool_pair values = 1; +} + +message account_liquidity { + bytes address = 1 [(btype) = ADDRESS]; + uint64 balance = 2 [jstype = JS_STRING]; + uint64 coin_ms_hi = 3 [jstype = JS_STRING]; + uint64 coin_ms_lo = 4 [jstype = JS_STRING]; +} + +message get_liquidity_request { + bytes pool = 1 [(btype) = ADDRESS]; + bytes start = 2 [(btype) = ADDRESS]; + uint64 limit = 3 [jstype = JS_STRING]; + optional uint64 start_ms = 4 [jstype = JS_STRING]; + optional uint64 end_ms = 5 [jstype = JS_STRING]; +} + +message get_liquidity_response { + repeated account_liquidity values = 1; +} + +message pool_tvl { + bytes pool = 1 [(btype) = ADDRESS]; + uint64 tvl = 2 [jstype = JS_STRING]; +} + +message get_tvl_request { + oneof target { + bytes start = 1 [(btype) = ADDRESS]; + bytes pool = 2 [(btype) = ADDRESS]; + } + + uint64 limit = 3 [jstype = JS_STRING]; + optional uint64 ms = 4 [jstype = JS_STRING]; +} + +message get_tvl_response { + repeated pool_tvl values = 1; +} + +message koindx_tracker_request { + oneof request { + rpc.reserved_rpc reserved = 1; + get_pools_request get_pools = 2; + get_liquidity_request get_liquidity = 3; + get_tvl_request get_tvl = 4; + } +} + +message koindx_tracker_response { + oneof response { + rpc.reserved_rpc reserved = 1; + rpc.error_status error = 2; + get_pools_response get_pools = 3; + get_liquidity_response get_liquidity = 4; + get_tvl_response get_tvl = 5; + } +} diff --git a/koinos/standards/kcs4.proto b/koinos/standards/kcs4.proto index a0d0d4c..c908a88 100644 --- a/koinos/standards/kcs4.proto +++ b/koinos/standards/kcs4.proto @@ -75,7 +75,7 @@ message transfer_arguments { bytes from = 1 [(btype) = ADDRESS]; bytes to = 2 [(btype) = ADDRESS]; uint64 value = 3 [jstype = JS_STRING]; - string memo = 4; + optional string memo = 4; } message transfer_result {} @@ -83,6 +83,7 @@ message transfer_result {} message mint_arguments { bytes to = 1 [(btype) = ADDRESS]; uint64 value = 2 [jstype = JS_STRING]; + optional string memo = 3; } message mint_result {} @@ -90,6 +91,7 @@ message mint_result {} message burn_arguments { bytes from = 1 [(btype) = ADDRESS]; uint64 value = 2 [jstype = JS_STRING]; + optional string memo = 3; } message burn_result {} @@ -98,6 +100,7 @@ message approve_arguments { bytes owner = 1 [(koinos.btype) = ADDRESS]; bytes spender = 2 [(koinos.btype) = ADDRESS]; uint64 value = 3 [jstype = JS_STRING]; + optional string memo = 4; } message approve_result {} @@ -105,22 +108,25 @@ message approve_result {} message burn_event { bytes from = 1 [(btype) = ADDRESS]; uint64 value = 2 [jstype = JS_STRING]; + optional string memo = 3; } message mint_event { bytes to = 1 [(btype) = ADDRESS]; uint64 value = 2 [jstype = JS_STRING]; + optional string memo = 3; } message transfer_event { bytes from = 1 [(btype) = ADDRESS]; bytes to = 2 [(btype) = ADDRESS]; uint64 value = 3 [jstype = JS_STRING]; - string memo = 4; + optional string memo = 4; } message approve_event { bytes owner = 1 [(koinos.btype) = ADDRESS]; bytes spender = 2 [(koinos.btype) = ADDRESS]; uint64 value = 3 [jstype = JS_STRING]; + optional string memo = 4; }