Skip to content

Commit

Permalink
Merge remote-tracking branch 'teritori/main' into feat/nft-clean-up
Browse files Browse the repository at this point in the history
  • Loading branch information
n0izn0iz committed Oct 16, 2023
2 parents 8444045 + b329e1f commit 9fa4466
Show file tree
Hide file tree
Showing 221 changed files with 35,134 additions and 2,717 deletions.
4 changes: 2 additions & 2 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ PRICES_DB_PASSWORD=magic

PRICES_SERVICE_URI=prices.mainnet.teritori.com:443

DISPLAYED_NETWORKS_IDS=teritori,teritori-testnet,ethereum,ethereum-goerli,cosmos-hub,juno,osmosis,osmosis-testnet,solana,gno-teritori,gno-test3,gno-dev
SELECTABLE_NETWORKS_IDS=teritori,teritori-testnet,ethereum,ethereum-goerli,osmosis,osmosis-testnet,gno-teritori,gno-test3,gno-dev
IMG_PROXY_URL=https://imgproxy.tools.teritori.com/insecure/

# MULTISIG_BACKEND_URL=http://localhost:9091 # you can use this for local testing
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ web-build/
# macOS
.DS_Store

# dbs
/multisig.db

# @generated: @expo/[email protected]
/.expo/*
# Expo Web
Expand Down
2 changes: 2 additions & 0 deletions App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { Provider as ReduxProvider } from "react-redux";
import { PersistGate } from "redux-persist/integration/react";

import { BrandText } from "./packages/components/BrandText";
import { MultisigDeauth } from "./packages/components/multisig/MultisigDeauth";
import { Navigator } from "./packages/components/navigation/Navigator";
import { DropdownsContextProvider } from "./packages/context/DropdownsProvider";
import { FeedbacksContextProvider } from "./packages/context/FeedbacksProvider";
Expand Down Expand Up @@ -78,6 +79,7 @@ export default function App() {
<DropdownsContextProvider>
<WalletsProvider>
<WalletSyncer />
<MultisigDeauth />
<SearchBarContextProvider>
<TransactionModalsProvider>
<TNSContextProvider>
Expand Down
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ PRICES_SERVICE_DOCKER_IMAGE=$(DOCKER_REGISTRY)/prices-service:$(shell git rev-pa
PRICES_OHLC_REFRESH_DOCKER_IMAGE=$(DOCKER_REGISTRY)/prices-ohlc-refresh:$(shell git rev-parse --short HEAD)
P2E_DOCKER_IMAGE=$(DOCKER_REGISTRY)/p2e-update-leaderboard:$(shell git rev-parse --short HEAD)
FEED_DOCKER_IMAGE=$(DOCKER_REGISTRY)/feed-clean-pinata-keys:$(shell git rev-parse --short HEAD)
MULTISIG_DOCKER_IMAGE=$(DOCKER_REGISTRY)/cosmos-multisig-backend:$(shell git rev-parse --short HEAD)

node_modules: package.json yarn.lock
yarn
Expand Down Expand Up @@ -235,6 +236,11 @@ publish.feed-clean-pinata-keys:
docker build -f go/cmd/feed-clean-pinata-keys/Dockerfile . --platform linux/amd64 -t $(FEED_DOCKER_IMAGE)
docker push $(FEED_DOCKER_IMAGE)

.PHONY: publish.multisig-backend
publish.multisig-backend:
docker build -f go/cmd/multisig-backend/Dockerfile . --platform linux/amd64 -t $(MULTISIG_DOCKER_IMAGE)
docker push $(MULTISIG_DOCKER_IMAGE)

.PHONY: validate-networks
validate-networks: node_modules
npx ts-node packages/scripts/validateNetworks.ts
Expand Down
232 changes: 232 additions & 0 deletions api/multisig/v1/multisig.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,232 @@
syntax = "proto3";

package multisig.v1;
option go_package = "./multisigpb";

import "google/protobuf/any.proto";

service MultisigService {
// Read
rpc Multisigs(MultisigsRequest) returns (MultisigsResponse);
rpc MultisigInfo(MultisigInfoRequest) returns (MultisigInfoResponse);
rpc Transactions(TransactionsRequest) returns (TransactionsResponse);
rpc TransactionsCounts(TransactionsCountsRequest) returns (TransactionsCountsResponse);

// Write
rpc CreateOrJoinMultisig(CreateOrJoinMultisigRequest) returns (CreateOrJoinMultisigResponse);
rpc LeaveMultisig(LeaveMultisigRequest) returns (LeaveMultisigResponse);
rpc CreateTransaction(CreateTransactionRequest) returns (CreateTransactionResponse);
rpc SignTransaction(SignTransactionRequest) returns (SignTransactionResponse);
rpc CompleteTransaction(CompleteTransactionRequest) returns (CompleteTransactionResponse);

// Auth
rpc GetChallenge(GetChallengeRequest) returns (GetChallengeResponse);
rpc GetToken(GetTokenRequest) returns (GetTokenResponse);
rpc ValidateToken(ValidateTokenRequest) returns (ValidateTokenResponse);
}

message Multisig {
string created_at = 1;
string chain_id = 2;
string address = 4;
bool joined = 5;
string name = 6;
string pubkey_json = 7;
repeated string users_addresses = 8;
uint32 threshold = 9;
}

message Signature {
string value = 1;
string user_address = 2;
bytes body_bytes = 3;
}

message Transaction {
string created_at = 1;
string final_hash = 2;
string multisig_address = 3;
string chain_id = 4;
repeated google.protobuf.Any msgs = 5;
string fee_json = 6;
uint32 account_number = 7;
uint32 sequence = 8;
string creator_address = 9;
uint32 threshold = 10;
uint32 members_count = 11;
string memo = 12;
repeated Signature signatures = 13;
string multisig_pubkey_json = 14;
uint32 id = 15;
}

// we use string here because browser storage poorly supports bytes
message Token {
string nonce = 1; // base64
string expiration = 2;
string user_address = 4;
string server_signature = 5; // base64 signature by server of protobuf encoding of Token with server_signature field zeroed out
}

message Challenge {
bytes nonce = 1;
string expiration = 2;
bytes server_signature = 3; // signature by server of protobuf encoding of Challenge with server_signature field zeroed out
}

enum JoinState {
JOIN_STATE_UNSPECIFIED = 0;
JOIN_STATE_IN = 1;
JOIN_STATE_OUT = 2;
}

message MultisigsRequest {
Token auth_token = 1;
uint32 limit = 2;
string start_after = 3;
string chain_id = 4;
JoinState join_state = 5;
}

message MultisigsResponse {
repeated Multisig multisigs = 1;
}

message MultisigInfoRequest {
Token auth_token = 1;
string multisig_address = 2;
string chain_id = 3;
}

message MultisigInfoResponse {
Multisig multisig = 1;
}

enum ExecutionState {
EXECUTION_STATE_UNSPECIFIED = 0;
EXECUTION_STATE_PENDING = 1;
EXECUTION_STATE_EXECUTED = 2;
}

message TransactionsRequest {
Token auth_token = 1;
uint32 limit = 2;
string start_after = 3;
string multisig_address = 4; // if unspecified, return transactions for all multisigs of this user
string chain_id = 5;
repeated string types = 6;
ExecutionState execution_state = 7;
}

message TransactionsResponse {
repeated Transaction transactions = 1;
}

message CreateOrJoinMultisigRequest {
string chain_id = 1;
string multisig_pubkey_json = 2;
Token auth_token = 3;
string name = 4;
string bech32_prefix = 5;
}

message CreateOrJoinMultisigResponse {
bool created = 1;
bool joined = 2;
string multisig_address = 3;
}

message LeaveMultisigRequest {
string multisig_address = 1;
Token auth_token = 2;
string chain_id = 3;
}

message LeaveMultisigResponse {
bool left = 1;
}

message CreateTransactionRequest {
Token auth_token = 1;
string multisig_address= 3;
uint32 account_number = 4;
uint32 sequence = 5;
repeated google.protobuf.Any msgs = 6;
string fee_json = 7;
string chain_id = 8;
}

message CreateTransactionResponse {

}

message SignTransactionRequest {
Token auth_token = 1;
string signature = 2;
uint32 transaction_id = 3;
bytes body_bytes = 4;
}

message SignTransactionResponse {

}

message CompleteTransactionRequest {
Token auth_token = 1;
uint32 transaction_id = 2;
string final_hash = 3;
}

message CompleteTransactionResponse {

}

message GetChallengeRequest {

}

message GetChallengeResponse {
Challenge challenge = 1;
}

message TokenRequestInfo {
string kind = 1;
Challenge challenge = 2;
string user_bech32_prefix = 3;
string user_pubkey_json = 4;
}

message GetTokenRequest {
string info_json = 1; // protojson encoding of TokenRequestInfo
string user_signature = 2; // signature by client of info_json
}

message GetTokenResponse {
Token auth_token = 1;
}

message TransactionsCountsRequest {
Token auth_token = 1;
string multisig_address = 2; // if unspecified, return transactions for all multisigs of this user
string chain_id = 3;
}

message TransactionsCount {
uint32 total = 1;
uint32 pending = 2;
uint32 executed = 3;
string type = 4;
}

message TransactionsCountsResponse {
TransactionsCount all = 1;
repeated TransactionsCount by_type = 2;
}

message ValidateTokenRequest {
Token auth_token = 1;
}

message ValidateTokenResponse {

}
10 changes: 10 additions & 0 deletions assets/icons/arrow-with-tail.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 40 additions & 0 deletions assets/icons/dao.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 9fa4466

Please sign in to comment.