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

Mobilecoind scis #3212

Merged
merged 9 commits into from
Mar 11, 2023
Merged
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
6 changes: 1 addition & 5 deletions mob
Original file line number Diff line number Diff line change
Expand Up @@ -394,11 +394,7 @@ if args.name:
image_and_tag = get_image(conf='.mobconf', image=args.image, tag=args.tag)
if not args.no_pull:
pull_image_command = ["docker", "image", "pull", image_and_tag]

if args.verbose:
maybe_run(pull_image_command)
else:
maybe_run_quiet(pull_image_command)
maybe_run(pull_image_command)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jgreat i changed this because, i had a negative user experience when the docker image was revved. The mob prompt command seems to just hang for several minutes without any output. This way, it shows that output. Since the first time the user uses the tool, it's going to do that, I think this is a big improvement


docker_run.append(image_and_tag)

Expand Down
52 changes: 52 additions & 0 deletions mobilecoind/api/proto/mobilecoind_api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ service MobilecoindAPI {
rpc GenerateBurnRedemptionTx (GenerateBurnRedemptionTxRequest) returns (GenerateBurnRedemptionTxResponse) {}
rpc SubmitTx (SubmitTxRequest) returns (SubmitTxResponse) {}

// Swaps
rpc GenerateSwap (GenerateSwapRequest) returns (GenerateSwapResponse) {}

// Databases
rpc GetLedgerInfo (google.protobuf.Empty) returns (GetLedgerInfoResponse) {}
rpc GetBlockInfo (GetBlockInfoRequest) returns (GetBlockInfoResponse) {}
Expand Down Expand Up @@ -491,6 +494,7 @@ message GenerateTxRequest {
// Token id to use for the transaction.
uint64 token_id = 7;
}

message GenerateTxResponse {
TxProposal tx_proposal = 1;
}
Expand Down Expand Up @@ -611,6 +615,54 @@ message GenerateBurnRedemptionTxResponse {
TxProposal tx_proposal = 1;
}

// Generate a simple swap proposal. The result is a signed contingent input
cbeck88 marked this conversation as resolved.
Show resolved Hide resolved
// which trades one currency for another and is suitable for use with the deqs.
// (This API is restrictive and doesn't let you build more complex SCIs.)
message GenerateSwapRequest {
// Monitor id sending the funds.
bytes sender_monitor_id = 1;

// Subaddress to return change to.
uint64 change_subaddress = 2;

// A specific input, whose value will be offered in full by the swap.
//
// This becomes the "base token" amount from the point of view of a quoting service.
//
// You may need to conduct a self-spend first to make an input of exactly
// the correct value before using this API if none of your inputs match
// the volume of the quote you want to make.
UnspentTxOut input = 3;

// The u64 value we are asking for in exchange for our input
//
// This becomes the "counter token" value from the point of view of a quoting service.
uint64 counter_value = 4;

// The token_id we are asking for in exchange for our input
//
// This becomes the "counter token" token id from the point of view of a quoting service.
uint64 counter_token_id = 5;

// If set to false, the offer is "all or nothing", the entire counter token value must be supplied,
// in exchange for the entire value of the input we are signing over.
// Otherwise, it is a "partial-fill" SCI, and can be filled at less than the maximum volume for
// proportionally more of the input value.
bool allow_partial_fill = 6;
cbeck88 marked this conversation as resolved.
Show resolved Hide resolved

// The smallest u64 value that we will accept to conduct the swap.
// This can be set to avoid receiving "dust" amounts when allow_partial_fill is true.
// This is ignored if allow_partial_fill is false.
uint64 minimum_fill_value = 7;

// Tombstone block (setting to 0 means this offer does not expire).
uint64 tombstone = 8;
}

message GenerateSwapResponse {
external.SignedContingentInput sci = 1;
}

// Submits a transaction to the network.
message SubmitTxRequest {
TxProposal tx_proposal = 1;
Expand Down
Loading