Skip to content

Commit

Permalink
add repo sync
Browse files Browse the repository at this point in the history
  • Loading branch information
lxjhk committed Jan 15, 2024
1 parent 3326c05 commit 8827caf
Show file tree
Hide file tree
Showing 4 changed files with 180 additions and 1 deletion.
45 changes: 45 additions & 0 deletions .github/workflows/syncrepo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Repo Sync

on:
push:
branches: [ main ] # or any branch you want to watch

jobs:
repo-sync:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Pushes to another repository
run: |
SOURCE_DIRECTORY="$(pwd)" # Source directory path
DESTINATION_USERNAME="mpcvault" # Destination GitHub username
DESTINATION_REPOSITORY="mpcvaultapis" # Destination repository name
TARGET_BRANCH="main" # Target branch in the destination repository
USER_EMAIL="[email protected]"
USER_NAME="lxjhk"
git rm -r --cached .
git reset --hard
# Set user information
git config --global user.email "$USER_EMAIL"
git config --global user.name "$USER_NAME"
git config --unset http.https://github.com/.extraheader
GIT_CMD_REPOSITORY="https://$USER_NAME:${{ secrets.MPCVAULT_EXTERN_SYNC_GITHUB_TOKEN }}@github.com/$DESTINATION_USERNAME/$DESTINATION_REPOSITORY.git"
{
git clone --single-branch --depth 1 --branch "$TARGET_BRANCH" "$GIT_CMD_REPOSITORY"
} || {
echo "::error::Could not clone the destination repository. Command:"
echo "::error::git clone --single-branch --branch $TARGET_BRANCH $GIT_CMD_REPOSITORY"
exit 1
}
git remote remove origin
git remote add origin $GIT_CMD_REPOSITORY
git push -f origin main
74 changes: 73 additions & 1 deletion mpcvault/platform/v1/api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ syntax = "proto3";
package mpcvault.platform.v1;

import "google/protobuf/wrappers.proto";
import "mpcvault/rpc/v1/status.proto";

option go_package = "go.mpcvault.com/genproto/mpcvaultapis/platform/v1;platform";
option java_multiple_files = true;
Expand All @@ -39,6 +40,68 @@ service PlatformAPI {

// GetBatchPaymentDetails returns the details of a batch payment.
rpc GetBatchPaymentDetails (GetBatchPaymentDetailsRequest) returns (GetBatchPaymentDetailsResponse);

// CreateWallet creates a wallet.
rpc CreateWallet (CreateWalletRequest) returns (CreateWalletResponse);

// SignSigningRequest sign a signing request.
rpc SignSigningRequest (SignSigningRequestRequest) returns (SignSigningRequestResponse);
}

message CreateWalletRequest {
string vault_uuid = 1;
string client_signer_public_key = 2;
AddressFormat address_format = 3;
string ref = 4;
}
enum AddressFormat {
ADDRESS_FORMAT_UNKNOWN = 0;
ADDRESS_FORMAT_EVM = 1;
ADDRESS_FORMAT_BITCOIN = 2;
ADDRESS_FORMAT_TRON = 3;
ADDRESS_FORMAT_APTOS = 4;
ADDRESS_FORMAT_SUI = 5;
ADDRESS_FORMAT_SOLANA = 6;
}
enum KeyType {
KEY_TYPE_UNSPECIFIED = 0;
KEY_TYPE_ECC_SECP256K1 = 1;
KEY_TYPE_ECC_ED25519 = 2;
}
message Wallet {
string vault_uuid = 1;
string client_signer_public_key = 2;
KeyType key_type = 3;
string key_path = 4;
string public_key = 5;
AddressFormat address_format = 6;
string address = 7;
string ref = 8;
}
message CreateWalletResponse {
Wallet details = 1;
mpcvault.rpc.v1.Status error = 2;
}

message SignSigningRequestRequest {
string uuid = 1;
}
message SignSigningRequestError {
enum ErrorCode {
// Enum unspecified.
ERROR_CODE_UNSPECIFIED = 0;
// Insufficient funds
ERROR_CODE_INSUFFICIENT_FUNDS = 1;
// Denied
ERROR_CODE_ALREADY_DENIED = 2;
}
ErrorCode error_code = 1;
string message = 2;
}
message SignSigningRequestResponse {
mpcvault.rpc.v1.Status error = 1;
// tx_hash is the hash of the transaction, only set if status is STATUS_SUCCEEDED.
string tx_hash = 2;
}

// EVMGas is the gas fee settings for an EVM transaction.
Expand Down Expand Up @@ -254,18 +317,21 @@ message CreateSigningRequestRequest {
}
// notes is the transaction notes for the signing request.
google.protobuf.StringValue notes = 1000;
google.protobuf.StringValue vault_uuid = 1001;
google.protobuf.StringValue client_signer_public_key = 1002;
}

message CreateSigningRequestResponse {
SigningRequest signing_request = 1;
mpcvault.rpc.v1.Status error = 2;
}

message RejectSigningRequestRequest {
string uuid = 1;
}

message RejectSigningRequestResponse {

mpcvault.rpc.v1.Status error = 1;
}

message GetSigningRequestDetailsRequest {
Expand All @@ -274,6 +340,7 @@ message GetSigningRequestDetailsRequest {

message GetSigningRequestDetailsResponse {
SigningRequest signing_request = 1;
mpcvault.rpc.v1.Status error = 2;
}

message SigningRequest {
Expand Down Expand Up @@ -309,7 +376,10 @@ message SigningRequest {
SuiSendCustom sui_send_custom = 18;
SolanaSendNative solana_send_native = 19;
SolanaSendSPLToken solana_send_spl_token = 20;
CreateWalletRequest create_wallet = 21;
}
google.protobuf.StringValue vault_uuid = 1000;
google.protobuf.StringValue client_signer_public_key = 1001;
}

message BatchPaymentRecipient {
Expand Down Expand Up @@ -360,6 +430,7 @@ message CreateBatchPaymentRequest {

message CreateBatchPaymentResponse {
BatchPayment batch_payment = 1;
mpcvault.rpc.v1.Status error = 2;
}

message GetBatchPaymentDetailsRequest {
Expand All @@ -368,6 +439,7 @@ message GetBatchPaymentDetailsRequest {

message GetBatchPaymentDetailsResponse {
BatchPayment batch_payment = 1;
mpcvault.rpc.v1.Status error = 2;
}

message BatchPayment {
Expand Down
34 changes: 34 additions & 0 deletions mpcvault/platform/v1/error.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package mpcvault.platform.v1;

option go_package = "go.mpcvault.com/genproto/mpcvaultapis/platform/v1;platform";
option java_multiple_files = true;
option java_outer_classname = "ServiceErrorProto";
option java_package = "com.mpcvault.platform.v1";


message ServiceError {
enum ErrorCode {
ERROR_CODE_UNSPECIFIED = 0;
ERROR_CODE_ORG_SUBSCRIBED_PLAN_LIMIT_EXCEED = 1;
ERROR_CODE_ORG_SUBSCRIBED_PLAN_EXPIRED = 2;
ERROR_CODE_ORG_SUBSCRIBED_PLAN_NOT_SUPPORT = 3;
}
ErrorCode error_code = 1;
string message = 2;
}
28 changes: 28 additions & 0 deletions mpcvault/rpc/v1/status.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package mpcvault.rpc.v1;

import "google/protobuf/any.proto";

option go_package = "go.mpcvault.com/genproto/mpcvaultapis/rpc/v1;rpc";
option java_multiple_files = true;
option java_outer_classname = "StatusProto";
option java_package = "com.mpcvault.rpc.v1";

message Status {
repeated google.protobuf.Any details = 1;
}

0 comments on commit 8827caf

Please sign in to comment.