Skip to content

Commit

Permalink
Copying *.proto files
Browse files Browse the repository at this point in the history
  • Loading branch information
githubswisschain committed Mar 9, 2024
1 parent 1c626cc commit 8d4fe0d
Show file tree
Hide file tree
Showing 3 changed files with 310 additions and 360 deletions.
179 changes: 69 additions & 110 deletions .proto/assets.proto
Original file line number Diff line number Diff line change
@@ -1,147 +1,106 @@
syntax = "proto3";

option csharp_namespace = "Swisschain.Sirius.Api.ApiContract.V2.Assets";
option csharp_namespace = "Swisschain.Sirius.Api.ApiContract.Asset";

import "common.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/wrappers.proto";

package swisschain.sirius.api.v2.assets;
package swisschain.sirius.api.assets;

service AssetsService {
service Assets {
rpc Search (AssetSearchRequest) returns (AssetSearchResponse);
rpc AddAttributes (AssetAddAttributesRequest) returns (AssetAddAttributesResponse);
rpc AddAttributes (AddAssetAttributesRequest) returns (AddAssetAttributesResponse);
}

// Search

message AssetSearchRequest {
google.protobuf.Int64Value id = 1;
google.protobuf.StringValue blockchain_id = 2;
google.protobuf.StringValue symbol = 3;
google.protobuf.StringValue token_id = 4;
google.protobuf.StringValue address = 5;
google.protobuf.Int32Value accuracy = 6;
swisschain.sirius.api.common.PaginationInt64 pagination = 7;
}

message AssetSearchResponse {
oneof result {
AssetSearchPayload payload = 1;
AssetSearchError error = 2;
}
}

message AssetSearchPayload {
swisschain.sirius.api.common.PaginatedInt64Response pagination = 1;
repeated Asset items = 2;
}

message Asset {
int64 id = 1;
string blockchain_id = 2;
google.protobuf.StringValue symbol = 3;
google.protobuf.StringValue address = 4;
google.protobuf.StringValue token_id = 5;
int32 accuracy = 6;
google.protobuf.StringValue name = 7;
google.protobuf.StringValue metadata_url = 8;
google.protobuf.StringValue type = 9;
BrokerageAssetAttributesInfo brokerage = 10;
AmlAssetAttributesInfo aml = 11;
}

message BrokerageAssetAttributesInfo {
int64 id = 1;
swisschain.sirius.api.common.BigDecimal min_deposit_threshold = 2;
swisschain.sirius.api.common.BigDecimal min_withdrawal_amount = 3;
google.protobuf.Timestamp created_at = 4;
google.protobuf.Timestamp updated_at = 5;
string display_name = 6;
}

message AmlAssetAttributesInfo {
int64 id = 1;
AmlChainalysisAssetAttributesInfo chainalysis = 2;
AmlMerkleScienceAssetAttributesInfo merkle_science = 3;
google.protobuf.Timestamp created_at = 4;
google.protobuf.Timestamp updated_at = 5;
}

message AssetSearchError {
enum AssetSearchErrorCode {
UNKNOWN = 0;
INVALID_PARAMETERS = 1;
DOMAIN_PROBLEM = 2;
TECHNICAL_PROBLEM = 3;
}

AssetSearchErrorCode code = 1;
string message = 2;
}

// AddAttributes

message AssetAddAttributesRequest {
string idempotency_id = 1;
message AddAssetAttributesRequest {
string request_id = 1;
int64 asset_id = 2;
BrokerageAssetAttributesCreateInfo brokerage = 3;
AmlAssetAttributesCreateInfo aml = 4;
BrokerageAssetAttributesInfoRequest brokerage = 3;
AmlAssetAttributesInfoRequest aml = 4;
}

message BrokerageAssetAttributesCreateInfo {
message BrokerageAssetAttributesInfoRequest {
swisschain.sirius.api.common.BigDecimal min_deposit_threshold = 1;
swisschain.sirius.api.common.BigDecimal min_withdrawal_amount = 2;
string display_name = 3;
}

message AmlAssetAttributesCreateInfo {
message AmlAssetAttributesInfoRequest {
AmlChainalysisAssetAttributesInfo chainalysis = 1;
AmlMerkleScienceAssetAttributesInfo merkle_science = 2;
}

message AssetAddAttributesResponse {
oneof body {
AddAssetAttributesPayload payload = 1;
AddAssetAttributesError error = 2;
}
}

message AddAssetAttributesPayload {
int64 brokerage_asset_attributes_id = 1;
google.protobuf.Int64Value aml_asset_attributes_id = 2;
}

message AddAssetAttributesError {
enum AddAssetAttributesErrorCode {
UNKNOWN = 0;
INVALID_PARAMETERS = 1;
DOMAIN_PROBLEM = 2;
TECHNICAL_PROBLEM = 3;
}

AddAssetAttributesErrorCode code = 1;
string message = 2;
}

// Common

message AmlChainalysisAssetAttributesInfo {
google.protobuf.StringValue symbol = 1;
string symbol = 1;
bool is_check_withdrawals_enabled = 2;
bool is_check_deposits_enabled = 3;
bool is_notify_withdrawals_enabled = 4;
ChainalysisTransferFormat transfer_format = 5;
}

message AmlMerkleScienceAssetAttributesInfo {
google.protobuf.StringValue symbol = 1;
int32 currency = 2;
bool is_disabled = 3;
}

enum ChainalysisTransferFormat {
HASH_AND_INDEX = 0;
HASH_AND_ADDRESS = 1;
HASH = 2;
}

message AmlMerkleScienceAssetAttributesInfo {
google.protobuf.StringValue symbol = 1;
int32 currency = 2;
bool is_disabled = 3;
message AddAssetAttributesResponse {
oneof body{
AssetResponse response = 1;
common.ErrorResponseBody error = 2;
}
}
message AssetSearchRequest {
google.protobuf.Int64Value id = 1;
google.protobuf.StringValue blockchain_id = 2;
google.protobuf.StringValue symbol = 3;
google.protobuf.StringValue address = 4;
google.protobuf.Int32Value accuracy = 5;
swisschain.sirius.api.common.PaginationInt64 pagination = 6;
}

message AssetSearchResponse {
oneof result {
AssetSearchResponseBody body = 1;
swisschain.sirius.api.common.ErrorResponseBody error = 2;
}
}

message AssetSearchResponseBody {
swisschain.sirius.api.common.PaginatedInt64Response pagination = 1;
repeated AssetResponse items = 2;
}

message AssetResponse {
int64 id = 1;
string blockchain_id = 2;
string symbol = 3;
google.protobuf.StringValue address = 4;
int32 accuracy = 5;
BrokerageAssetAttributesInfo brokerage = 6;
AmlAssetAttributesInfo aml = 7;
}

message BrokerageAssetAttributesInfo {
int64 id = 1;
google.protobuf.Timestamp created_at = 2;
google.protobuf.Timestamp updated_at = 3;
swisschain.sirius.api.common.BigDecimal min_deposit_threshold = 4;
swisschain.sirius.api.common.BigDecimal min_withdrawal_amount = 5;
string display_name = 6;
}

message AmlAssetAttributesInfo {
int64 id = 1;
AmlChainalysisAssetAttributesInfo chainalysis = 2;
AmlMerkleScienceAssetAttributesInfo merkle_science = 3;
google.protobuf.Timestamp created_at = 4;
google.protobuf.Timestamp updated_at = 5;
}
Loading

0 comments on commit 8d4fe0d

Please sign in to comment.