Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wallet: Major rpc version bump #3969

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ const initialState = {
},
version: {
// RequiredVersion
requiredVersion: "7.12.0",
requiredVersion: "8.0.0",
versionInvalid: false,
versionInvalidError: null,
// VersionService
Expand Down
186 changes: 59 additions & 127 deletions app/middleware/api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";

package walletrpc;

option go_package = "decred.org/dcrwallet/rpc/walletrpc";
option go_package = "decred.org/dcrwallet/v5/rpc/walletrpc";

service VersionService {
rpc Version (VersionRequest) returns (VersionResponse);
Expand All @@ -25,6 +25,7 @@ service WalletService {
rpc CoinType (CoinTypeRequest) returns (CoinTypeResponse);
rpc AccountNumber (AccountNumberRequest) returns (AccountNumberResponse);
rpc Accounts (AccountsRequest) returns (AccountsResponse);
rpc Address (AddressRequest) returns (AddressResponse);
rpc Balance (BalanceRequest) returns (BalanceResponse);
rpc GetAccountExtendedPubKey (GetAccountExtendedPubKeyRequest) returns (GetAccountExtendedPubKeyResponse);
rpc GetAccountExtendedPrivKey (GetAccountExtendedPrivKeyRequest) returns (GetAccountExtendedPrivKeyResponse);
Expand All @@ -39,6 +40,8 @@ service WalletService {
rpc Spender (SpenderRequest) returns (SpenderResponse);
rpc GetCFilters (GetCFiltersRequest) returns (stream GetCFiltersResponse);
rpc GetPeerInfo(GetPeerInfoRequest) returns (GetPeerInfoResponse);
rpc DumpPrivateKey (DumpPrivateKeyRequest) returns (DumpPrivateKeyResponse);
rpc BirthBlock (BirthBlockRequest) returns (BirthBlockResponse);

// Notifications
rpc TransactionNotifications (TransactionNotificationsRequest) returns (stream TransactionNotificationsResponse);
Expand Down Expand Up @@ -103,23 +106,8 @@ service WalletLoaderService {
service AccountMixerService {
rpc RunAccountMixer (RunAccountMixerRequest) returns (stream RunAccountMixerResponse);
}
service TicketBuyerV2Service {
rpc RunTicketBuyer (RunTicketBuyerRequest) returns (stream RunTicketBuyerResponse);
}

service TicketBuyerService {
rpc StartAutoBuyer (StartAutoBuyerRequest) returns (StartAutoBuyerResponse);
rpc StopAutoBuyer (StopAutoBuyerRequest) returns (StopAutoBuyerResponse);
rpc TicketBuyerConfig (TicketBuyerConfigRequest) returns (TicketBuyerConfigResponse);
rpc SetAccount (SetAccountRequest) returns (SetAccountResponse);
rpc SetBalanceToMaintain (SetBalanceToMaintainRequest) returns (SetBalanceToMaintainResponse);
rpc SetMaxFee (SetMaxFeeRequest) returns (SetMaxFeeResponse);
rpc SetMaxPriceRelative (SetMaxPriceRelativeRequest) returns (SetMaxPriceRelativeResponse);
rpc SetMaxPriceAbsolute (SetMaxPriceAbsoluteRequest) returns (SetMaxPriceAbsoluteResponse);
rpc SetVotingAddress (SetVotingAddressRequest) returns (SetVotingAddressResponse);
rpc SetPoolAddress (SetPoolAddressRequest) returns (SetPoolAddressResponse);
rpc SetPoolFees (SetPoolFeesRequest) returns (SetPoolFeesResponse);
rpc SetMaxPerBlock (SetMaxPerBlockRequest) returns (SetMaxPerBlockResponse);
rpc RunTicketBuyer (RunTicketBuyerRequest) returns (stream RunTicketBuyerResponse);
}

service SeedService {
Expand Down Expand Up @@ -236,6 +224,21 @@ message AccountsResponse {
int32 current_block_height = 3;
}

message AddressRequest {
uint32 account = 1;
enum Kind {
BIP0044_EXTERNAL = 0;
BIP0044_INTERNAL = 1;
}
Kind kind = 2;
uint32 index = 3;
}
message AddressResponse {
string address = 1;
string public_key = 2;
}


message RenameAccountRequest {
uint32 account_number = 1;
string new_name = 2;
Expand Down Expand Up @@ -297,6 +300,20 @@ message ImportExtendedPublicKeyRequest {
message ImportExtendedPublicKeyResponse {
}

message DumpPrivateKeyRequest {
string address = 1;
}
message DumpPrivateKeyResponse {
string private_key_wif = 1;
}

message BirthBlockRequest {
}
message BirthBlockResponse {
bytes hash = 1;
uint32 height = 2;
}

message ImportVotingAccountFromSeedRequest {
bytes seed = 1;
string name = 2;
Expand Down Expand Up @@ -616,19 +633,19 @@ message PurchaseTicketsRequest {
uint32 required_confirmations = 4;
string ticket_address = 5;
uint32 num_tickets = 6;
string pool_address = 7;
double pool_fees = 8;
uint32 expiry = 9;
int64 tx_fee = 10;
int64 ticket_fee = 11;
bool dont_sign_tx = 12;
string cspp_server = 13;
uint32 mixed_account = 14;
uint32 mixed_account_branch = 15;
uint32 mixed_split_account = 16;
uint32 change_account = 17;
string vsp_host = 18;
string vsp_pubkey = 19;
uint32 expiry = 7;
int64 tx_fee = 8;
int64 ticket_fee = 9;
bool dont_sign_tx = 10;
string cspp_server = 11;
uint32 mixed_account = 12;
uint32 mixed_account_branch = 13;
uint32 mixed_split_account = 14;
uint32 change_account = 15;
string vsp_host = 16;
string vsp_pubkey = 17;
bool use_voting_account = 18;
uint32 voting_account = 19;
}
message PurchaseTicketsResponse {
repeated bytes ticket_hashes = 1;
Expand Down Expand Up @@ -726,6 +743,10 @@ message CreateWalletRequest {
bytes public_passphrase = 1;
bytes private_passphrase = 2;
bytes seed = 3;
bool set_birth_time = 4;
int64 birth_time = 5;
bool set_birth_height = 6;
uint32 birth_height = 7;
}
message CreateWalletResponse {}

Expand Down Expand Up @@ -875,16 +896,14 @@ message RunTicketBuyerRequest {
uint32 voting_account = 3;
int64 balance_to_maintain = 4;
string voting_address = 5;
string pool_address = 6;
double pool_fees = 7;
string vsp_host = 8;
string vsp_pubkey = 9;
int32 limit = 10;
string cspp_server = 11;
uint32 mixed_account = 12;
uint32 mixed_account_branch = 13;
uint32 mixed_split_account = 14;
uint32 change_account = 15;
string vsp_host = 6;
string vsp_pubkey = 7;
int32 limit = 8;
string cspp_server = 9;
uint32 mixed_account = 10;
uint32 mixed_account_branch = 11;
uint32 mixed_split_account = 12;
uint32 change_account = 13;
}

message RunTicketBuyerResponse {}
Expand All @@ -899,93 +918,6 @@ message RunAccountMixerRequest {

message RunAccountMixerResponse {}

message StartAutoBuyerRequest {
bytes passphrase = 1;
uint32 account = 2;
int64 balance_to_maintain = 3;
int64 max_fee_per_kb = 4;
double max_price_relative = 5;
int64 max_price_absolute = 6;
string voting_address = 7;
string pool_address = 8;
double pool_fees = 9;
int64 max_per_block = 10;
}
message StartAutoBuyerResponse {}

message StopAutoBuyerRequest {}
message StopAutoBuyerResponse {}
message TicketBuyerConfigRequest{
}

message TicketBuyerConfigResponse{
uint32 account = 1;
string avg_price_mode = 2;
int64 avg_priceVWAP_delta = 3;
int64 balance_to_maintain = 4;
int64 blocks_to_avg = 5;
bool dont_wait_for_tickets = 6;
int64 expiry_delta = 7;
string fee_source = 8;
double fee_target_scaling = 9;
int64 min_fee = 10;
int64 max_fee = 12;
int64 max_per_block = 13;
int64 max_price_absolute = 14;
double max_price_relative = 15;
int64 max_in_mempool = 17;
string pool_address = 18;
double pool_fees = 19;
bool spread_ticket_purchases = 20;
string voting_address = 21;
int64 tx_fee = 22;
}

message SetAccountRequest{
uint32 account = 1;
}
message SetAccountResponse{}

message SetBalanceToMaintainRequest{
int64 balance_to_maintain = 1;
}
message SetBalanceToMaintainResponse{}

message SetMaxFeeRequest{
int64 max_fee_per_kb = 1;
}
message SetMaxFeeResponse{}

message SetMaxPriceRelativeRequest{
double max_price_relative = 1;
}
message SetMaxPriceRelativeResponse{}

message SetMaxPriceAbsoluteRequest{
int64 max_price_absolute = 1;
}
message SetMaxPriceAbsoluteResponse{}

message SetVotingAddressRequest{
string voting_address = 1;
}
message SetVotingAddressResponse{}

message SetPoolAddressRequest{
string pool_address = 1;
}
message SetPoolAddressResponse{}

message SetPoolFeesRequest{
double pool_fees = 1;
}
message SetPoolFeesResponse{}

message SetMaxPerBlockRequest{
int64 max_per_block = 1;
}
message SetMaxPerBlockResponse{}

message AgendasRequest {}
message AgendasResponse {
message Agenda {
Expand Down
4 changes: 2 additions & 2 deletions app/middleware/grpc/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ const getServiceClient =
};

export const getWalletService = getServiceClient(services.WalletService);
export const getTicketBuyerV2Service = getServiceClient(
services.TicketBuyerV2Service
export const getTicketBuyerService = getServiceClient(
services.TicketBuyerService
);
export const loader = getServiceClient(services.WalletLoaderService);
export const getSeedService = getServiceClient(services.SeedService);
Expand Down
Loading
Loading