client+clmrpc: unify data types for amounts, fees and blocks

We use the same proto message types everywhere for these kinds
of fields:
- absolute amounts (sats): uint64
- fee rates (sat/kWU): uint64
- fee rates (ppm): uint32
- blocks (absolute and relative): uint32

Additionally we unify the comments and remove the [ json_name = "" ]
declarations in the trader proto as they aren't needed with the
jsonpb marshaller that we use.
Then we align the naming of the account key to be called trader key
everywhere instead of user's sub key.
This commit is contained in:
Oliver Gugger 2020-05-25 16:29:40 +02:00
parent 33246cda7d
commit c46bfef959
11 changed files with 642 additions and 646 deletions

View file

@ -78,7 +78,7 @@ func (s *acctSubscription) authenticate(ctx context.Context) error {
return s.sendMsg(&clmrpc.ClientAuctionMessage{
Msg: &clmrpc.ClientAuctionMessage_Subscribe{
Subscribe: &clmrpc.AccountSubscription{
UserSubKey: acctPubKey[:],
TraderKey: acctPubKey[:],
CommitNonce: nonce[:],
AuthSig: sig,
},

View file

@ -236,9 +236,9 @@ func (c *Client) InitAccount(ctx context.Context, account *account.Account) erro
OutputIndex: account.OutPoint.Index,
},
AccountScript: accountOutput.PkScript,
AccountValue: uint32(account.Value),
AccountValue: uint64(account.Value),
AccountExpiry: account.Expiry,
UserSubKey: account.TraderKey.PubKey.SerializeCompressed(),
TraderKey: account.TraderKey.PubKey.SerializeCompressed(),
})
return err
}
@ -269,7 +269,7 @@ func (c *Client) ModifyAccount(ctx context.Context, account *account.Account,
rpcOutputs := make([]*clmrpc.ServerOutput, 0, len(outputs))
for _, output := range outputs {
rpcOutputs = append(rpcOutputs, &clmrpc.ServerOutput{
Value: uint32(output.Value),
Value: uint64(output.Value),
Script: output.PkScript,
})
}
@ -278,12 +278,12 @@ func (c *Client) ModifyAccount(ctx context.Context, account *account.Account,
modifiedAccount := account.Copy(modifiers...)
if len(modifiers) > 0 {
rpcNewParams = &clmrpc.ServerModifyAccountRequest_NewAccountParameters{
Value: uint32(modifiedAccount.Value),
Value: uint64(modifiedAccount.Value),
}
}
resp, err := c.client.ModifyAccount(ctx, &clmrpc.ServerModifyAccountRequest{
UserSubKey: account.TraderKey.PubKey.SerializeCompressed(),
TraderKey: account.TraderKey.PubKey.SerializeCompressed(),
NewInputs: rpcInputs,
NewOutputs: rpcOutputs,
NewParams: rpcNewParams,
@ -311,15 +311,15 @@ func (c *Client) SubmitOrder(ctx context.Context, o order.Order,
})
}
details := &clmrpc.ServerOrder{
UserSubKey: o.Details().AcctKey[:],
RateFixed: int64(o.Details().FixedRate),
Amt: int64(o.Details().Amt),
TraderKey: o.Details().AcctKey[:],
RateFixed: o.Details().FixedRate,
Amt: uint64(o.Details().Amt),
OrderNonce: nonce[:],
OrderSig: serverParams.RawSig,
MultiSigKey: serverParams.MultiSigKey[:],
NodePub: serverParams.NodePubkey[:],
NodeAddr: nodeAddrs,
FundingFeeRateSatPerKw: int64(o.Details().FundingFeeRate),
FundingFeeRateSatPerKw: uint64(o.Details().FundingFeeRate),
}
// Split into server message which is type specific.
@ -327,7 +327,7 @@ func (c *Client) SubmitOrder(ctx context.Context, o order.Order,
case *order.Ask:
serverAsk := &clmrpc.ServerAsk{
Details: details,
MaxDurationBlocks: int64(castOrder.MaxDuration),
MaxDurationBlocks: castOrder.MaxDuration,
Version: uint32(castOrder.Version),
}
rpcRequest.Details = &clmrpc.ServerSubmitOrderRequest_Ask{
@ -337,7 +337,7 @@ func (c *Client) SubmitOrder(ctx context.Context, o order.Order,
case *order.Bid:
serverBid := &clmrpc.ServerBid{
Details: details,
MinDurationBlocks: int64(castOrder.MinDuration),
MinDurationBlocks: castOrder.MinDuration,
Version: uint32(castOrder.Version),
}
rpcRequest.Details = &clmrpc.ServerSubmitOrderRequest_Bid{

File diff suppressed because it is too large Load diff

View file

@ -36,45 +36,45 @@ message ReserveAccountResponse {
}
message ServerInitAccountRequest {
/**
/*
Transaction output of the account. Has to be unspent and be a P2WSH of
the account script below. The amount must also exactly correspond to the
account value below.
*/
OutPoint account_point = 1;
/**
/*
The script used to create the account point.
*/
bytes account_script = 2;
/**
/*
The value of the account in satoshis. Must match the amount of the
account_point output.
*/
uint32 account_value = 3;
uint64 account_value = 3;
/**
/*
The block height at which the account should expire.
*/
uint32 account_expiry = 4;
/**
The user's sub account key.
/*
The trader's account key.
*/
bytes user_sub_key = 5;
bytes trader_key = 5;
}
message ServerInitAccountResponse {
}
message ServerSubmitOrderRequest {
oneof details {
/**
/*
Submit an ask order.
*/
ServerAsk ask = 1;
/**
/*
Submit a bid order.
*/
ServerBid bid = 2;
@ -82,12 +82,12 @@ message ServerSubmitOrderRequest {
}
message ServerSubmitOrderResponse {
oneof details {
/**
/*
Order failed with the given reason.
*/
InvalidOrder invalid_order = 1;
/**
/*
Order was accepted.
*/
bool accepted = 2;
@ -95,7 +95,7 @@ message ServerSubmitOrderResponse {
}
message ServerCancelOrderRequest {
/**
/*
The order's unique 32 byte identifier.
*/
bytes order_nonce = 1;
@ -105,31 +105,31 @@ message ServerCancelOrderResponse {
message ClientAuctionMessage {
oneof msg {
/**
/*
Signal the intent to receive updates about a certain account and start
by sending the commitment part of the authentication handshake. This is
step 1 of the 3-way handshake.
*/
AccountCommitment commit = 1;
/**
/*
Subscribe to update and interactive order execution events for account
given and all its orders. Contains the final signature and is step 3 of
the 3-way authentication handshake.
*/
AccountSubscription subscribe = 2;
/**
/*
Accept the orders to be matched.
*/
OrderMatchAccept accept = 3;
/**
/*
Reject a whole batch.
*/
OrderMatchReject reject = 4;
/**
/*
The channel funding negotiations with the matched peer were successful
and the inputs to spend from the accounts are now signed.
*/
@ -138,13 +138,13 @@ message ClientAuctionMessage {
}
message AccountCommitment {
/**
The SHA256 hash of the user's account sub key and a 32 byte random nonce.
/*
The SHA256 hash of the trader's account key and a 32 byte random nonce.
commit_hash = SHA256(accountPubKey || nonce)
*/
bytes commit_hash = 1;
/**
/*
The batch verification protocol version the client is using. Clients that
don't use the latest version will be declined to connect and participate in
an auction. The user should then be informed that a software update is
@ -154,19 +154,19 @@ message AccountCommitment {
}
message AccountSubscription {
/**
The user's sub account key of the account to subscribe to.
/*
The trader's account key of the account to subscribe to.
*/
bytes user_sub_key = 1;
bytes trader_key = 1;
/**
/*
The random 32 byte nonce the trader used to create the commitment hash.
*/
bytes commit_nonce = 2;
/**
/*
The signature over the auth_hash which is the hash of the commitment and
challenge. The signature is created with the user's sub account key they
challenge. The signature is created with the trader's account key they
committed to.
auth_hash = SHA256(SHA256(accountPubKey || nonce) || challenge)
*/
@ -174,7 +174,7 @@ message AccountSubscription {
}
message OrderMatchAccept {
/**
/*
A list of all order nonces of the orders that are accepted by the trader to
be matched by the auctioneer. Orders that didn't have all their units
fulfilled need to be tracked by the trader locally by applying all diffs
@ -182,7 +182,7 @@ message OrderMatchAccept {
*/
repeated bytes order_nonce = 1;
/**
/*
The batch ID this acceptance message refers to. Must be set to avoid out-of-
order responses from disrupting the batching process.
*/
@ -191,64 +191,64 @@ message OrderMatchAccept {
message OrderMatchReject {
enum RejectReason {
/// The reason cannot be mapped to a specific code.
// The reason cannot be mapped to a specific code.
UNKNOWN = 0;
/**
/*
The client didn't come up with the same result as the server and is
rejecting the batch because of that.
*/
SERVER_MISBEHAVIOR = 1;
/**
/*
The client doesn't support the current batch verification version the
server is using.
*/
BATCH_VERSION_MISMATCH = 2;
}
/**
/*
The ID of the batch to reject.
*/
bytes batch_id = 1;
/**
/*
The reason/error string for the rejection.
*/
string reason = 2;
/**
/*
The reason as a code.
*/
RejectReason reason_code = 3;
}
message OrderMatchSign {
/**
/*
The ID of the batch that the signatures are meant for.
*/
bytes batch_id = 1;
/**
/*
A map with the signatures to spend the accounts being spent in a batch
transaction. The map key corresponds to the user's sub key of the account
in the batch transaction. The account key/ID has to be hex encoded into a
string because protobuf doesn't allow bytes as a map key data type.
transaction. The map key corresponds to the trader's account key of the
account in the batch transaction. The account key/ID has to be hex encoded
into a string because protobuf doesn't allow bytes as a map key data type.
*/
map<string, bytes> account_sigs = 2;
}
message ServerAuctionMessage {
oneof msg {
/**
/*
Step 2 of the 3-way authentication handshake. Contains the
authentication challenge. Subscriptions sent by the trader must sign
the message SHA256(SHA256(accountPubKey || nonce) || challenge)
with their account sub key to prove ownership of said key.
with their account key to prove ownership of said key.
*/
ServerChallenge challenge = 1;
/**
/*
The auctioneer has matched a set of orders into a batch and now
instructs the traders to validate the batch and prepare for order
execution. Because traders have the possibility of backing out of a
@ -256,20 +256,20 @@ message ServerAuctionMessage {
*/
OrderMatchPrepare prepare = 2;
/**
/*
This message is sent after all traders send back an OrderMatchAccept
method. It signals that the traders should execute their local funding
protocol, then send signatures for their accout inputs.
*/
OrderMatchSignBegin sign = 3;
/**
/*
All traders have accepted and signed the batch and the final transaction
was broadcast.
*/
OrderMatchFinalize finalize = 4;
/**
/*
An error occurred during any part of the communication. The trader
should inspect the error code and act accordingly.
*/
@ -278,67 +278,67 @@ message ServerAuctionMessage {
}
message ServerChallenge {
/**
The unique challenge for each stream that has to be signed with the user's
sub key for each account subscription.
/*
The unique challenge for each stream that has to be signed with the trader's
account key for each account subscription.
*/
bytes challenge = 1;
/**
/*
The commit hash the challenge was created for.
*/
bytes commit_hash = 2;
}
message OrderMatchPrepare {
/**
/*
Maps a user's own order_nonce to the opposite order type they were matched
with. The order_nonce is a 32 byte hex encoded string because bytes is not
allowed as a map key data type in protobuf.
*/
map<string, MatchedOrder> matched_orders = 1;
/**
/*
The uniform clearing price rate in parts per million that was used for this
batch.
*/
uint32 clearing_price_rate = 2;
/**
/*
A list of the user's own accounts that are being spent by the matched
orders. The list contains the differences that would be applied by the
server when executing the orders.
*/
repeated AccountDiff charged_accounts = 3;
/**
/*
The fee parameters used to calculate the execution fees.
*/
ExecutionFee execution_fee = 4;
/**
/*
The batch transaction with all non-witness data.
*/
bytes batch_transaction = 5;
/**
/*
Fee rate of the batch transaction, expressed in satoshis per 1000 weight
units (sat/kW).
*/
int64 fee_rate_sat_per_kw = 6;
uint64 fee_rate_sat_per_kw = 6;
/**
/*
Fee rebate in satoshis, offered if another batch participant wants to pay
more fees for a faster confirmation.
*/
int64 fee_rebate_sat = 7;
uint64 fee_rebate_sat = 7;
/**
/*
The 32 byte unique identifier of this batch.
*/
bytes batch_id = 8;
/**
/*
The batch verification protocol version the server is using. Clients that
don't support this version MUST return an `OrderMatchAccept` message with
an empty list of orders so the batch can continue. The user should then be
@ -348,24 +348,24 @@ message OrderMatchPrepare {
}
message OrderMatchSignBegin {
/**
/*
The 32 byte unique identifier of this batch.
*/
bytes batch_id = 1;
}
message OrderMatchFinalize {
/**
/*
The unique identifier of the finalized batch.
*/
bytes batch_id = 1;
/**
/*
The final transaction ID of the published batch transaction.
*/
bytes batch_txid = 2;
/**
/*
The current block height at the time the batch transaction was published to
the network.
*/
@ -374,37 +374,37 @@ message OrderMatchFinalize {
message SubscribeError {
enum Error {
/**
/*
The error cannot be mapped to a specific code.
*/
UNKNOWN = 0;
/**
/*
The server is shutting down for maintenance. Traders should close the
long-lived stream/connection and try to connect again after some time.
*/
SERVER_SHUTDOWN = 1;
}
/**
/*
The string representation of the subscription error.
*/
string error = 1;
/**
/*
The error code of the subscription error.
*/
Error error_code = 2;
}
message MatchedOrder {
/**
/*
The bids the trader's own order was matched against. This list is empty if
the trader's order was a bid order itself.
*/
repeated MatchedBid matched_bids = 1;
/**
/*
The asks the trader's own order was matched against. This list is empty if
the trader's order was an ask order itself.
*/
@ -412,23 +412,23 @@ message MatchedOrder {
}
message MatchedAsk {
/**
/*
The ask order that was matched against.
*/
ServerAsk ask = 1;
/**
/*
The number of units that were filled from/by this matched order.
*/
uint32 units_filled = 2;
}
message MatchedBid {
/**
/*
The ask order that was matched against.
*/
ServerBid bid = 1;
/**
/*
The number of units that were filled from/by this matched order.
*/
uint32 units_filled = 2;
@ -442,19 +442,19 @@ message AccountDiff {
OUTPUT_FULLY_SPENT = 3;
}
/**
/*
The final balance of the account after the executed batch.
*/
int64 ending_balance = 1;
uint64 ending_balance = 1;
/**
/*
Depending on the amount of the final balance of the account, the remainder
is either sent to a new on-chain output, extended off-chain or fully
consumed by the batch and its fees.
*/
AccountState ending_state = 2;
/**
/*
If the account was re-created on-chain then the new account's index in the
transaction is set here. If the account was fully spent or the remainder was
extended off-chain then no new account outpoint is created and -1 is
@ -462,39 +462,39 @@ message AccountDiff {
*/
int32 outpoint_index = 3;
/**
The user's sub account key this diff is referring to.
/*
The trader's account key this diff is referring to.
*/
bytes user_sub_key = 4;
bytes trader_key = 4;
}
message ServerOrder {
/**
The user's sub key of the account to use for the order.
/*
The trader's account key of the account to use for the order.
*/
bytes user_sub_key = 1;
bytes trader_key = 1;
/**
/*
Fixed order rate in parts per million.
*/
int64 rate_fixed = 2;
uint32 rate_fixed = 2;
/**
/*
Order amount in satoshis.
*/
int64 amt = 3;
uint64 amt = 3;
// TODO(guggero): implement
// bool kill_or_fill = 4;
// repeated bytes must_fill_pub = 5;
reserved 4, 5;
/**
/*
Order nonce of 32 byte length, acts as unique order identifier.
*/
bytes order_nonce = 6;
/**
/*
Signature of the order's digest, signed with the user's account key. The
signature must be fixed-size LN wire format encoded. Version 0 includes the
fields version, rate_fixed, amt, funding_fee_rate_sat_per_kw and
@ -502,18 +502,18 @@ message ServerOrder {
*/
bytes order_sig = 7;
/**
/*
The multi signature key of the node creating the order, will be used for the
target channel's funding TX 2-of-2 multi signature output.
*/
bytes multi_sig_key = 8;
/**
/*
The pubkey of the node creating the order.
*/
bytes node_pub = 9;
/**
/*
The network addresses of the node creating the order.
*/
repeated NodeAddress node_addr = 10;
@ -524,35 +524,35 @@ message ServerOrder {
*/
reserved 11;
/**
/*
The type of the channel that should be opened.
*/
uint32 chan_type = 12;
/**
/*
Preferred fee rate to be used for the channel funding transaction, expressed
in satoshis per 1000 weight units (sat/kW).
*/
int64 funding_fee_rate_sat_per_kw = 13;
uint64 funding_fee_rate_sat_per_kw = 13;
}
message ServerBid {
/**
/*
The common fields shared between both ask and bid order types.
*/
ServerOrder details = 1;
/**
/*
Required minimum number of blocks that a channel opened as a result of this
bid should be kept open.
*/
int64 min_duration_blocks = 2;
uint32 min_duration_blocks = 2;
// TODO(guggero): implement
// bool instant = 3;
reserved 3;
/**
/*
The version of the order format that is used. Will be increased once new
features are added.
*/
@ -560,18 +560,18 @@ message ServerBid {
}
message ServerAsk {
/**
/*
The common fields shared between both ask and bid order types.
*/
ServerOrder details = 1;
/**
/*
The maximum number of blocks the liquidity provider is willing to provide
the channel funds for.
*/
int64 max_duration_blocks = 4;
uint32 max_duration_blocks = 4;
/**
/*
The version of the order format that is used. Will be increased once new
features are added.
*/
@ -583,7 +583,6 @@ message CancelOrder {
}
message InvalidOrder {
enum FailReason {
INVALID_AMT = 0;
}
@ -600,18 +599,17 @@ message ServerInput {
message ServerOutput {
// The value, in satoshis, of the output.
uint32 value = 1 [json_name = "value"];
uint64 value = 1;
// The script of the output to send the value to.
bytes script = 2 [json_name = "script"];
bytes script = 2;
}
message ServerModifyAccountRequest {
/*
The user sub key that corresponds to the account to be modified. This is
also known as the trader key.
The trader's account key of the account to be modified.
*/
bytes user_sub_key = 1;
bytes trader_key = 1;
/*
An additional set of inputs that can be included in the spending transaction
@ -629,7 +627,7 @@ message ServerModifyAccountRequest {
message NewAccountParameters {
// The new value of the account.
uint32 value = 1;
uint64 value = 1;
}
// The new parameters to apply for the account.
@ -637,7 +635,7 @@ message ServerModifyAccountRequest {
}
message ServerModifyAccountResponse {
/**
/*
The auctioneer's signature that allows a trader to broadcast a transaction
spending from an account output.
*/
@ -659,12 +657,12 @@ enum OrderState {
}
message ServerOrderStateResponse {
/**
/*
The state the order currently is in.
*/
OrderState state = 1;
/**
/*
The number of currently unfilled units of this order. This will be equal to
the total amount of units until the order has reached the state PARTIAL_FILL
or EXECUTED.
@ -676,7 +674,7 @@ message FeeQuoteRequest {
}
message FeeQuoteResponse {
/**
/*
The execution fee charged per matched order.
*/
ExecutionFee execution_fee = 1;
@ -726,19 +724,19 @@ message RelevantBatch {
Fee rate of the batch transaction, expressed in satoshis per 1000 weight
units (sat/kW).
*/
uint32 fee_rate_sat_per_kw = 8;
uint64 fee_rate_sat_per_kw = 8;
}
message ExecutionFee {
/**
/*
The base fee in satoshis charged per order, regardless of the matched size.
*/
int64 base_fee = 1;
uint64 base_fee = 1;
/**
/*
The fee rate in parts per million
*/
int64 fee_rate = 2;
uint64 fee_rate = 2;
}
message NodeAddress {
@ -747,13 +745,13 @@ message NodeAddress {
}
message OutPoint {
/**
/*
Raw bytes representing the transaction id.
*/
bytes txid = 1 [json_name = "txid"];
bytes txid = 1;
/**
/*
The index of the output on the transaction.
*/
uint32 output_index = 2 [json_name = "output_index"];
uint32 output_index = 2;
}

View file

@ -74,7 +74,7 @@ func (AccountState) EnumDescriptor() ([]byte, []int) {
}
type InitAccountRequest struct {
AccountValue uint32 `protobuf:"varint,1,opt,name=account_value,json=accountValue,proto3" json:"account_value,omitempty"`
AccountValue uint64 `protobuf:"varint,1,opt,name=account_value,json=accountValue,proto3" json:"account_value,omitempty"`
AccountExpiry uint32 `protobuf:"varint,2,opt,name=account_expiry,json=accountExpiry,proto3" json:"account_expiry,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
@ -106,7 +106,7 @@ func (m *InitAccountRequest) XXX_DiscardUnknown() {
var xxx_messageInfo_InitAccountRequest proto.InternalMessageInfo
func (m *InitAccountRequest) GetAccountValue() uint32 {
func (m *InitAccountRequest) GetAccountValue() uint64 {
if m != nil {
return m.AccountValue
}
@ -192,7 +192,7 @@ func (m *ListAccountsResponse) GetAccounts() []*Account {
type Output struct {
// The value, in satoshis, of the output.
Value uint32 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"`
Value uint64 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"`
// The address corresponding to the output.
Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
@ -225,7 +225,7 @@ func (m *Output) XXX_DiscardUnknown() {
var xxx_messageInfo_Output proto.InternalMessageInfo
func (m *Output) GetValue() uint32 {
func (m *Output) GetValue() uint64 {
if m != nil {
return m.Value
}
@ -241,7 +241,7 @@ func (m *Output) GetAddress() string {
type CloseAccountRequest struct {
// The trader key associated with the account that will be closed.
TraderKey []byte `protobuf:"bytes,1,opt,name=trader_key,proto3" json:"trader_key,omitempty"`
TraderKey []byte `protobuf:"bytes,1,opt,name=trader_key,json=traderKey,proto3" json:"trader_key,omitempty"`
//
//The outputs that should be created as a result of closing the account. If
//none are specified, then the funds within the account are sent to an address
@ -293,7 +293,7 @@ func (m *CloseAccountRequest) GetOutputs() []*Output {
type CloseAccountResponse struct {
// The hash of the closing transaction.
CloseTxid []byte `protobuf:"bytes,1,opt,name=close_txid,proto3" json:"close_txid,omitempty"`
CloseTxid []byte `protobuf:"bytes,1,opt,name=close_txid,json=closeTxid,proto3" json:"close_txid,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
@ -340,7 +340,7 @@ type WithdrawAccountRequest struct {
Outputs []*Output `protobuf:"bytes,2,rep,name=outputs,proto3" json:"outputs,omitempty"`
//
//The fee rate, in satoshis per vbyte, to use for the withdrawal transaction.
SatPerByte uint32 `protobuf:"varint,3,opt,name=sat_per_byte,json=satPerByte,proto3" json:"sat_per_byte,omitempty"`
SatPerVbyte uint64 `protobuf:"varint,3,opt,name=sat_per_vbyte,json=satPerVbyte,proto3" json:"sat_per_vbyte,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
@ -385,9 +385,9 @@ func (m *WithdrawAccountRequest) GetOutputs() []*Output {
return nil
}
func (m *WithdrawAccountRequest) GetSatPerByte() uint32 {
func (m *WithdrawAccountRequest) GetSatPerVbyte() uint64 {
if m != nil {
return m.SatPerByte
return m.SatPerVbyte
}
return 0
}
@ -451,7 +451,7 @@ type Account struct {
//time the account has been updated.
Outpoint *OutPoint `protobuf:"bytes,2,opt,name=outpoint,proto3" json:"outpoint,omitempty"`
// The current value in satoshis of the account.
Value uint32 `protobuf:"varint,3,opt,name=value,proto3" json:"value,omitempty"`
Value uint64 `protobuf:"varint,3,opt,name=value,proto3" json:"value,omitempty"`
// The height at which the account will expire.
ExpirationHeight uint32 `protobuf:"varint,4,opt,name=expiration_height,json=expirationHeight,proto3" json:"expiration_height,omitempty"`
// The current state of the account.
@ -502,7 +502,7 @@ func (m *Account) GetOutpoint() *OutPoint {
return nil
}
func (m *Account) GetValue() uint32 {
func (m *Account) GetValue() uint64 {
if m != nil {
return m.Value
}
@ -839,33 +839,33 @@ func (m *CancelOrderResponse) XXX_DiscardUnknown() {
var xxx_messageInfo_CancelOrderResponse proto.InternalMessageInfo
type Order struct {
//*
//The user's sub key of the account that is used for the order.
UserSubKey []byte `protobuf:"bytes,1,opt,name=user_sub_key,proto3" json:"user_sub_key,omitempty"`
//*
//
//The trader's account key of the account that is used for the order.
TraderKey []byte `protobuf:"bytes,1,opt,name=trader_key,json=traderKey,proto3" json:"trader_key,omitempty"`
//
//Fixed order rate in parts per million.
RateFixed int64 `protobuf:"varint,2,opt,name=rate_fixed,proto3" json:"rate_fixed,omitempty"`
//*
RateFixed uint32 `protobuf:"varint,2,opt,name=rate_fixed,json=rateFixed,proto3" json:"rate_fixed,omitempty"`
//
//Order amount in satoshis.
Amt int64 `protobuf:"varint,3,opt,name=amt,proto3" json:"amt,omitempty"`
//*
Amt uint64 `protobuf:"varint,3,opt,name=amt,proto3" json:"amt,omitempty"`
//
//Preferred fee rate to be used for the channel funding transaction, expressed
//in satoshis per 1000 weight units (sat/kW).
FundingFeeRate int64 `protobuf:"varint,4,opt,name=funding_fee_rate,proto3" json:"funding_fee_rate,omitempty"`
//*
FundingFeeRate uint64 `protobuf:"varint,4,opt,name=funding_fee_rate,json=fundingFeeRate,proto3" json:"funding_fee_rate,omitempty"`
//
//Order nonce, acts as unique order identifier.
OrderNonce []byte `protobuf:"bytes,5,opt,name=order_nonce,proto3" json:"order_nonce,omitempty"`
//*
OrderNonce []byte `protobuf:"bytes,5,opt,name=order_nonce,json=orderNonce,proto3" json:"order_nonce,omitempty"`
//
//The state the order currently is in.
State string `protobuf:"bytes,6,opt,name=state,proto3" json:"state,omitempty"`
//*
//
//The number of order units the amount corresponds to.
Units uint32 `protobuf:"varint,7,opt,name=units,proto3" json:"units,omitempty"`
//*
//
//The number of currently unfilled units of this order. This will be equal to
//the total amount of units until the order has reached the state PARTIAL_FILL
//or EXECUTED.
UnitsUnfulfilled uint32 `protobuf:"varint,8,opt,name=units_unfulfilled,proto3" json:"units_unfulfilled,omitempty"`
UnitsUnfulfilled uint32 `protobuf:"varint,8,opt,name=units_unfulfilled,json=unitsUnfulfilled,proto3" json:"units_unfulfilled,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
@ -896,28 +896,28 @@ func (m *Order) XXX_DiscardUnknown() {
var xxx_messageInfo_Order proto.InternalMessageInfo
func (m *Order) GetUserSubKey() []byte {
func (m *Order) GetTraderKey() []byte {
if m != nil {
return m.UserSubKey
return m.TraderKey
}
return nil
}
func (m *Order) GetRateFixed() int64 {
func (m *Order) GetRateFixed() uint32 {
if m != nil {
return m.RateFixed
}
return 0
}
func (m *Order) GetAmt() int64 {
func (m *Order) GetAmt() uint64 {
if m != nil {
return m.Amt
}
return 0
}
func (m *Order) GetFundingFeeRate() int64 {
func (m *Order) GetFundingFeeRate() uint64 {
if m != nil {
return m.FundingFeeRate
}
@ -953,14 +953,14 @@ func (m *Order) GetUnitsUnfulfilled() uint32 {
}
type Bid struct {
//*
//
//The common fields shared between both ask and bid order types.
Details *Order `protobuf:"bytes,1,opt,name=details,proto3" json:"details,omitempty"`
//*
//
//Required minimum number of blocks that a channel opened as a result of this
//bid should be kept open.
MinDurationBlocks int64 `protobuf:"varint,2,opt,name=min_duration_blocks,proto3" json:"min_duration_blocks,omitempty"`
//*
MinDurationBlocks uint32 `protobuf:"varint,2,opt,name=min_duration_blocks,json=minDurationBlocks,proto3" json:"min_duration_blocks,omitempty"`
//
//The version of the order format that is used. Will be increased once new
//features are added.
Version uint32 `protobuf:"varint,3,opt,name=version,proto3" json:"version,omitempty"`
@ -1001,7 +1001,7 @@ func (m *Bid) GetDetails() *Order {
return nil
}
func (m *Bid) GetMinDurationBlocks() int64 {
func (m *Bid) GetMinDurationBlocks() uint32 {
if m != nil {
return m.MinDurationBlocks
}
@ -1016,14 +1016,14 @@ func (m *Bid) GetVersion() uint32 {
}
type Ask struct {
//*
//
//The common fields shared between both ask and bid order types.
Details *Order `protobuf:"bytes,1,opt,name=details,proto3" json:"details,omitempty"`
//*
//
//The maximum number of blocks the liquidity provider is willing to provide
//the channel funds for.
MaxDurationBlocks int64 `protobuf:"varint,2,opt,name=max_duration_blocks,proto3" json:"max_duration_blocks,omitempty"`
//*
MaxDurationBlocks uint32 `protobuf:"varint,2,opt,name=max_duration_blocks,json=maxDurationBlocks,proto3" json:"max_duration_blocks,omitempty"`
//
//The version of the order format that is used. Will be increased once new
//features are added.
Version uint32 `protobuf:"varint,3,opt,name=version,proto3" json:"version,omitempty"`
@ -1064,7 +1064,7 @@ func (m *Ask) GetDetails() *Order {
return nil
}
func (m *Ask) GetMaxDurationBlocks() int64 {
func (m *Ask) GetMaxDurationBlocks() uint32 {
if m != nil {
return m.MaxDurationBlocks
}
@ -1103,77 +1103,77 @@ func init() {
func init() { proto.RegisterFile("trader.proto", fileDescriptor_b8f61804588c75fe) }
var fileDescriptor_b8f61804588c75fe = []byte{
// 1109 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x56, 0xdf, 0x4e, 0x1b, 0xc7,
0x17, 0xc6, 0x18, 0xdb, 0xe4, 0x78, 0x21, 0xcb, 0xd8, 0xc9, 0xcf, 0x31, 0x04, 0xd0, 0xfe, 0x9a,
0x96, 0x9a, 0x08, 0x37, 0x54, 0xad, 0xaa, 0xf6, 0x8a, 0x3f, 0x56, 0x41, 0x8d, 0xc0, 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e9, 0x34, 0x49, 0xf7, 0x6d,
0xbe, 0x25, 0xde, 0xa1, 0xf7, 0x25, 0x78, 0x38, 0xb5, 0xac, 0xd0, 0xba, 0xbe, 0xb8, 0x78, 0x95,
0xb6, 0x37, 0xee, 0xc5, 0x15, 0xf7, 0x0b, 0xc9, 0xbd, 0xed, 0x7c, 0x3a, 0xc3, 0xad, 0x97, 0xd7,
0x84, 0x08, 0x91, 0x5e, 0x0c, 0x75, 0x63, 0xfa, 0xe6, 0xef, 0x36, 0x3b, 0xf6, 0xdb, 0xab, 0x85,
0x98, 0xa2, 0x7e, 0x22, 0xa9, 0x1b, 0xce, 0xb2, 0xa6, 0x96, 0x6d, 0x2e, 0x5f, 0xf0, 0x67, 0x80,
0x7c, 0x70, 0xa2, 0x27, 0xe6, 0x13, 0x4d, 0x4c, 0xd8, 0x76, 0xbb, 0x08, 0x52, 0xf7, 0x3f, 0x96,
0xf7, 0xdb, 0x68, 0xea, 0x7e, 0x14, 0x42, 0xdd, 0x18, 0x83, 0xb9, 0xfe, 0xd9, 0x91, 0x9a, 0xeb,
0x2f, 0x9a, 0x9b, 0x9f, 0xc8, 0xfb, 0xd7, 0x3b, 0x6b, 0x93, 0xf7, 0x77, 0xdf, 0x1a, 0xe3, 0xea,
0xdd, 0xa0, 0x2a, 0xff, 0x7f, 0x7e, 0xf9, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x85, 0xe2, 0xbf,
0xbe, 0xc7, 0x0a, 0x00, 0x00,
// 1110 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xdd, 0x6e, 0xdb, 0x36,
0x14, 0x8e, 0xe2, 0xbf, 0xe4, 0xf8, 0xa7, 0x2a, 0xed, 0x76, 0xae, 0xdb, 0x34, 0x81, 0xb6, 0x6e,
0x5e, 0x32, 0xc4, 0x68, 0x86, 0x02, 0xc3, 0x76, 0x95, 0x1f, 0x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 0x68, 0x3d, 0x91, 0x24, 0xeb, 0x9b, 0x6b, 0x79, 0x92, 0xde,
0x9b, 0xb4, 0x01, 0xdf, 0xa2, 0x77, 0x06, 0xdc, 0xc9, 0xad, 0x27, 0xf4, 0x58, 0x07, 0x5e, 0xbc,
0x3e, 0x3b, 0xeb, 0x1f, 0xc4, 0x15, 0xf7, 0x53, 0xc9, 0xbd, 0x65, 0x7d, 0x7e, 0x8b, 0x5b, 0xaf,
0xab, 0x39, 0x11, 0x22, 0xbd, 0x18, 0xaa, 0x99, 0x79, 0x9b, 0xbe, 0xdb, 0xed, 0x41, 0xdf, 0x79,
0xb8, 0x10, 0x53, 0xd4, 0x0f, 0x24, 0x75, 0xd3, 0x6a, 0x68, 0x6a, 0xd9, 0xe0, 0xf2, 0x05, 0x7f,
0x02, 0x48, 0x47, 0x25, 0x7a, 0x90, 0x7d, 0xa2, 0xb9, 0x99, 0xda, 0xe9, 0x2c, 0x82, 0x54, 0xfc,
0xfb, 0x32, 0xbe, 0x89, 0x72, 0xf1, 0x91, 0x0f, 0xd5, 0xcc, 0xe0, 0x4b, 0xf5, 0xdf, 0x1e, 0xa2,
0xa9, 0xfe, 0x45, 0x93, 0xf2, 0x33, 0x19, 0xff, 0xf1, 0xe6, 0xa3, 0xf9, 0xf8, 0xbd, 0x37, 0x99,
0xd9, 0xf5, 0x76, 0x58, 0x96, 0xff, 0x38, 0xbf, 0xfe, 0x27, 0x00, 0x00, 0xff, 0xff, 0x19, 0xc3,
0x98, 0x01, 0xb9, 0x0a, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.

View file

@ -53,7 +53,7 @@ service Trader {
}
message InitAccountRequest {
uint32 account_value = 1;
uint64 account_value = 1;
uint32 account_expiry = 2;
}
@ -65,7 +65,7 @@ message ListAccountsResponse {
message Output {
// The value, in satoshis, of the output.
uint32 value = 1;
uint64 value = 1;
// The address corresponding to the output.
string address = 2;
@ -73,18 +73,18 @@ message Output {
message CloseAccountRequest {
// The trader key associated with the account that will be closed.
bytes trader_key = 1 [json_name = "trader_key"];
bytes trader_key = 1;
/*
The outputs that should be created as a result of closing the account. If
none are specified, then the funds within the account are sent to an address
the backing lnd node controls.
*/
repeated Output outputs = 2 [json_name = "outputs"];
repeated Output outputs = 2;
}
message CloseAccountResponse {
// The hash of the closing transaction.
bytes close_txid = 1 [json_name = "close_txid"];
bytes close_txid = 1;
}
message WithdrawAccountRequest {
@ -100,7 +100,7 @@ message WithdrawAccountRequest {
/*
The fee rate, in satoshis per vbyte, to use for the withdrawal transaction.
*/
uint32 sat_per_byte = 3;
uint64 sat_per_vbyte = 3;
}
message WithdrawAccountResponse {
// The state of the account after processing the withdrawal.
@ -154,7 +154,7 @@ message Account {
OutPoint outpoint = 2;
// The current value in satoshis of the account.
uint32 value = 3;
uint64 value = 3;
// The height at which the account will expire.
uint32 expiration_height = 4;
@ -174,12 +174,12 @@ message SubmitOrderRequest {
}
message SubmitOrderResponse {
oneof details {
/**
/*
Order failed with the given reason.
*/
InvalidOrder invalid_order = 1;
/**
/*
The order nonce of the accepted order.
*/
bytes accepted_order_nonce = 2;
@ -200,84 +200,84 @@ message CancelOrderResponse {
}
message Order {
/**
The user's sub key of the account that is used for the order.
/*
The trader's account key of the account that is used for the order.
*/
bytes user_sub_key = 1 [json_name = "user_sub_key"];
bytes trader_key = 1;
/**
/*
Fixed order rate in parts per million.
*/
int64 rate_fixed = 2 [json_name = "rate_fixed"];
uint32 rate_fixed = 2;
/**
/*
Order amount in satoshis.
*/
int64 amt = 3 [json_name = "amt"];
uint64 amt = 3;
/**
/*
Preferred fee rate to be used for the channel funding transaction, expressed
in satoshis per 1000 weight units (sat/kW).
*/
int64 funding_fee_rate = 4 [json_name = "funding_fee_rate"];
uint64 funding_fee_rate = 4;
/**
/*
Order nonce, acts as unique order identifier.
*/
bytes order_nonce = 5 [json_name = "order_nonce"];
bytes order_nonce = 5;
/**
/*
The state the order currently is in.
*/
string state = 6 [json_name = "state"];
string state = 6;
/**
/*
The number of order units the amount corresponds to.
*/
uint32 units = 7 [json_name = "units"];
uint32 units = 7;
/**
/*
The number of currently unfilled units of this order. This will be equal to
the total amount of units until the order has reached the state PARTIAL_FILL
or EXECUTED.
*/
uint32 units_unfulfilled = 8 [json_name = "units_unfulfilled"];
uint32 units_unfulfilled = 8;
}
message Bid {
/**
/*
The common fields shared between both ask and bid order types.
*/
Order details = 1 [json_name = "details"];
Order details = 1;
/**
/*
Required minimum number of blocks that a channel opened as a result of this
bid should be kept open.
*/
int64 min_duration_blocks = 2 [json_name = "min_duration_blocks"];
uint32 min_duration_blocks = 2;
/**
/*
The version of the order format that is used. Will be increased once new
features are added.
*/
uint32 version = 3 [json_name = "version"];
uint32 version = 3;
}
message Ask {
/**
/*
The common fields shared between both ask and bid order types.
*/
Order details = 1 [json_name = "details"];
Order details = 1;
/**
/*
The maximum number of blocks the liquidity provider is willing to provide
the channel funds for.
*/
int64 max_duration_blocks = 2 [json_name = "max_duration_blocks"];
uint32 max_duration_blocks = 2;
/**
/*
The version of the order format that is used. Will be increased once new
features are added.
*/
uint32 version = 3 [json_name = "version"];
uint32 version = 3;
}

View file

@ -202,8 +202,8 @@
"description": "The current outpoint associated with the account. This will change every\ntime the account has been updated."
},
"value": {
"type": "integer",
"format": "int64",
"type": "string",
"format": "uint64",
"description": "The current value in satoshis of the account."
},
"expiration_height": {
@ -240,17 +240,17 @@
"properties": {
"details": {
"$ref": "#/definitions/clmrpcOrder",
"description": "*\nThe common fields shared between both ask and bid order types."
"description": "The common fields shared between both ask and bid order types."
},
"max_duration_blocks": {
"type": "string",
"type": "integer",
"format": "int64",
"description": "*\nThe maximum number of blocks the liquidity provider is willing to provide\nthe channel funds for."
"description": "The maximum number of blocks the liquidity provider is willing to provide\nthe channel funds for."
},
"version": {
"type": "integer",
"format": "int64",
"description": "*\nThe version of the order format that is used. Will be increased once new\nfeatures are added."
"description": "The version of the order format that is used. Will be increased once new\nfeatures are added."
}
}
},
@ -259,17 +259,17 @@
"properties": {
"details": {
"$ref": "#/definitions/clmrpcOrder",
"description": "*\nThe common fields shared between both ask and bid order types."
"description": "The common fields shared between both ask and bid order types."
},
"min_duration_blocks": {
"type": "string",
"type": "integer",
"format": "int64",
"description": "*\nRequired minimum number of blocks that a channel opened as a result of this\nbid should be kept open."
"description": "Required minimum number of blocks that a channel opened as a result of this\nbid should be kept open."
},
"version": {
"type": "integer",
"format": "int64",
"description": "*\nThe version of the order format that is used. Will be increased once new\nfeatures are added."
"description": "The version of the order format that is used. Will be increased once new\nfeatures are added."
}
}
},
@ -290,8 +290,8 @@
"type": "object",
"properties": {
"account_value": {
"type": "integer",
"format": "int64"
"type": "string",
"format": "uint64"
},
"account_expiry": {
"type": "integer",
@ -345,44 +345,44 @@
"clmrpcOrder": {
"type": "object",
"properties": {
"user_sub_key": {
"trader_key": {
"type": "string",
"format": "byte",
"description": "*\nThe user's sub key of the account that is used for the order."
"description": "The trader's account key of the account that is used for the order."
},
"rate_fixed": {
"type": "string",
"type": "integer",
"format": "int64",
"description": "*\nFixed order rate in parts per million."
"description": "Fixed order rate in parts per million."
},
"amt": {
"type": "string",
"format": "int64",
"description": "*\nOrder amount in satoshis."
"format": "uint64",
"description": "Order amount in satoshis."
},
"funding_fee_rate": {
"type": "string",
"format": "int64",
"description": "*\nPreferred fee rate to be used for the channel funding transaction, expressed\nin satoshis per 1000 weight units (sat/kW)."
"format": "uint64",
"description": "Preferred fee rate to be used for the channel funding transaction, expressed\nin satoshis per 1000 weight units (sat/kW)."
},
"order_nonce": {
"type": "string",
"format": "byte",
"description": "*\nOrder nonce, acts as unique order identifier."
"description": "Order nonce, acts as unique order identifier."
},
"state": {
"type": "string",
"description": "*\nThe state the order currently is in."
"description": "The state the order currently is in."
},
"units": {
"type": "integer",
"format": "int64",
"description": "*\nThe number of order units the amount corresponds to."
"description": "The number of order units the amount corresponds to."
},
"units_unfulfilled": {
"type": "integer",
"format": "int64",
"description": "*\nThe number of currently unfilled units of this order. This will be equal to\nthe total amount of units until the order has reached the state PARTIAL_FILL\nor EXECUTED."
"description": "The number of currently unfilled units of this order. This will be equal to\nthe total amount of units until the order has reached the state PARTIAL_FILL\nor EXECUTED."
}
}
},
@ -392,12 +392,12 @@
"txid": {
"type": "string",
"format": "byte",
"description": "*\nRaw bytes representing the transaction id."
"description": "Raw bytes representing the transaction id."
},
"output_index": {
"type": "integer",
"format": "int64",
"description": "*\nThe index of the output on the transaction."
"description": "The index of the output on the transaction."
}
}
},
@ -405,8 +405,8 @@
"type": "object",
"properties": {
"value": {
"type": "integer",
"format": "int64",
"type": "string",
"format": "uint64",
"description": "The value, in satoshis, of the output."
},
"address": {
@ -431,12 +431,12 @@
"properties": {
"invalid_order": {
"$ref": "#/definitions/clmrpcInvalidOrder",
"description": "*\nOrder failed with the given reason."
"description": "Order failed with the given reason."
},
"accepted_order_nonce": {
"type": "string",
"format": "byte",
"description": "*\nThe order nonce of the accepted order."
"description": "The order nonce of the accepted order."
}
}
},
@ -455,9 +455,9 @@
},
"description": "The outputs we'll withdraw funds from the account into."
},
"sat_per_byte": {
"type": "integer",
"format": "int64",
"sat_per_vbyte": {
"type": "string",
"format": "uint64",
"description": "The fee rate, in satoshis per vbyte, to use for the withdrawal transaction."
}
}

View file

@ -28,7 +28,7 @@ var accountsCommands = []cli.Command{
type Account struct {
TraderKey string `json:"trader_key"`
OutPoint string `json:"outpoint"`
Value uint32 `json:"value"`
Value uint64 `json:"value"`
ExpirationHeight uint32 `json:"expiration_height"`
State string `json:"state"`
CloseTxid string `json:"close_txid"`
@ -92,7 +92,7 @@ func newAccount(ctx *cli.Context) error {
resp, err := client.InitAccount(context.Background(),
&clmrpc.InitAccountRequest{
AccountValue: uint32(amt),
AccountValue: amt,
AccountExpiry: uint32(expiry),
},
)
@ -149,7 +149,7 @@ var withdrawAccountCommand = cli.Command{
Description: `
Withdraw funds from an existing account to a supported address.
`,
ArgsUsage: "addr sat_per_byte",
ArgsUsage: "addr sat_per_vbyte",
Flags: []cli.Flag{
cli.StringFlag{
Name: "trader_key",
@ -166,8 +166,8 @@ var withdrawAccountCommand = cli.Command{
"and withdrawn from the account",
},
cli.Uint64Flag{
Name: "sat_per_byte",
Usage: "the fee rate expressed in sat/byte that " +
Name: "sat_per_vbyte",
Usage: "the fee rate expressed in sat/vbyte that " +
"should be used for the withdrawal",
},
},
@ -188,7 +188,7 @@ func withdrawAccount(ctx *cli.Context) error {
if err != nil {
return err
}
satPerByte, err := parseUint64(ctx, 3, "sat_per_byte", cmd)
satPerVByte, err := parseUint64(ctx, 3, "sat_per_vbyte", cmd)
if err != nil {
return err
}
@ -204,11 +204,11 @@ func withdrawAccount(ctx *cli.Context) error {
TraderKey: traderKey,
Outputs: []*clmrpc.Output{
{
Value: uint32(amt),
Value: amt,
Address: addr,
},
},
SatPerByte: uint32(satPerByte),
SatPerVbyte: satPerVByte,
},
)
if err != nil {

View file

@ -65,23 +65,23 @@ func parseCommonParams(ctx *cli.Context) (*clmrpc.Order, error) {
switch {
case ctx.IsSet("amt"):
params.Amt = int64(ctx.Uint64("amt"))
params.Amt = ctx.Uint64("amt")
case args.Present():
amt, err = parseAmt(args.First())
params.Amt = int64(amt)
params.Amt = uint64(amt)
args = args.Tail()
}
if err != nil {
return nil, fmt.Errorf("unable to decode amount: %v", err)
}
params.UserSubKey, err = parseAccountKey(ctx, args)
params.TraderKey, err = parseAccountKey(ctx, args)
if err != nil {
return nil, fmt.Errorf("unable to parse acct_key: %v", err)
}
params.FundingFeeRate = int64(ctx.Uint64("funding_fee_rate"))
params.RateFixed = int64(ctx.Uint64("rate_fixed"))
params.FundingFeeRate = ctx.Uint64("funding_fee_rate")
params.RateFixed = uint32(ctx.Uint64("rate_fixed"))
return params, nil
}
@ -156,7 +156,7 @@ func ordersSubmitAsk(ctx *cli.Context) error { // nolint: dupl
}
ask := &clmrpc.Ask{
Details: params,
MaxDurationBlocks: int64(ctx.Uint64("max_duration_blocks")),
MaxDurationBlocks: uint32(ctx.Uint64("max_duration_blocks")),
Version: uint32(order.VersionDefault),
}
@ -230,7 +230,7 @@ func ordersSubmitBid(ctx *cli.Context) error { // nolint: dupl
}
bid := &clmrpc.Bid{
Details: params,
MinDurationBlocks: int64(ctx.Uint64("min_duration_blocks")),
MinDurationBlocks: uint32(ctx.Uint64("min_duration_blocks")),
Version: uint32(order.VersionDefault),
}

View file

@ -33,9 +33,9 @@ func ParseRPCOrder(version uint32, details *clmrpc.Order) (*Kit, error) {
kit = NewKitWithPreimage(preimage)
}
copy(kit.AcctKey[:], details.UserSubKey)
copy(kit.AcctKey[:], details.TraderKey)
kit.Version = Version(version)
kit.FixedRate = uint32(details.RateFixed)
kit.FixedRate = details.RateFixed
kit.Amt = btcutil.Amount(details.Amt)
kit.FundingFeeRate = chainfee.SatPerKWeight(details.FundingFeeRate)
kit.Units = NewSupplyFromSats(kit.Amt)
@ -58,7 +58,7 @@ func ParseRPCServerOrder(version uint32, details *clmrpc.ServerOrder) (*Kit,
copy(nonce[:], details.OrderNonce)
kit := NewKit(nonce)
kit.Version = Version(version)
kit.FixedRate = uint32(details.RateFixed)
kit.FixedRate = details.RateFixed
kit.Amt = btcutil.Amount(details.Amt)
kit.Units = NewSupplyFromSats(kit.Amt)
kit.UnitsUnfulfilled = kit.Units
@ -78,7 +78,7 @@ func ParseRPCServerOrder(version uint32, details *clmrpc.ServerOrder) (*Kit,
kit = NewKitWithPreimage(preimage)
}
copy(kit.AcctKey[:], details.UserSubKey)
copy(kit.AcctKey[:], details.TraderKey)
nodePubKey, err := btcec.ParsePubKey(details.NodePub, btcec.S256())
if err != nil {
@ -126,7 +126,7 @@ func ParseRPCServerAsk(details *clmrpc.ServerAsk) (*MatchedOrder, error) {
}
o.Order = &Ask{
Kit: *kit,
MaxDuration: uint32(details.MaxDurationBlocks),
MaxDuration: details.MaxDurationBlocks,
}
return o, nil
}
@ -146,7 +146,7 @@ func ParseRPCServerBid(details *clmrpc.ServerBid) (*MatchedOrder, error) {
}
o.Order = &Bid{
Kit: *kit,
MinDuration: uint32(details.MinDurationBlocks),
MinDuration: details.MinDurationBlocks,
}
return o, nil
}
@ -182,7 +182,7 @@ func ParseRPCBatch(prepareMsg *clmrpc.OrderMatchPrepare) (*Batch,
// Parse account diff.
for _, diff := range prepareMsg.ChargedAccounts {
var acctKeyRaw [33]byte
acctKey, err := btcec.ParsePubKey(diff.UserSubKey, btcec.S256())
acctKey, err := btcec.ParsePubKey(diff.TraderKey, btcec.S256())
if err != nil {
return nil, fmt.Errorf("error parsing account key: %v",
err)

View file

@ -728,7 +728,7 @@ func marshallAccount(a *account.Account) (*clmrpc.Account, error) {
Txid: a.OutPoint.Hash[:],
OutputIndex: a.OutPoint.Index,
},
Value: uint32(a.Value),
Value: uint64(a.Value),
ExpirationHeight: a.Expiry,
State: rpcState,
CloseTxid: closeTxHash[:],
@ -757,7 +757,7 @@ func (s *rpcServer) WithdrawAccount(ctx context.Context,
}
// Enforce a minimum fee rate of 1 sat/vbyte.
feeRate := chainfee.SatPerKVByte(req.SatPerByte * 1000).FeePerKWeight()
feeRate := chainfee.SatPerKVByte(req.SatPerVbyte * 1000).FeePerKWeight()
if feeRate < chainfee.FeePerKwFloor {
log.Infof("Manual fee rate input of %d sat/kw is too low, "+
"using %d sat/kw instead", feeRate,
@ -866,7 +866,7 @@ func (s *rpcServer) SubmitOrder(ctx context.Context,
}
o = &order.Ask{
Kit: *kit,
MaxDuration: uint32(a.MaxDurationBlocks),
MaxDuration: a.MaxDurationBlocks,
}
case *clmrpc.SubmitOrderRequest_Bid:
@ -877,7 +877,7 @@ func (s *rpcServer) SubmitOrder(ctx context.Context,
}
o = &order.Bid{
Kit: *kit,
MinDuration: uint32(b.MinDurationBlocks),
MinDuration: b.MinDurationBlocks,
}
default:
@ -972,10 +972,10 @@ func (s *rpcServer) ListOrders(ctx context.Context, _ *clmrpc.ListOrdersRequest)
dbDetails := dbOrder.Details()
details := &clmrpc.Order{
UserSubKey: dbDetails.AcctKey[:],
RateFixed: int64(dbDetails.FixedRate),
Amt: int64(dbDetails.Amt),
FundingFeeRate: int64(dbDetails.FixedRate),
TraderKey: dbDetails.AcctKey[:],
RateFixed: dbDetails.FixedRate,
Amt: uint64(dbDetails.Amt),
FundingFeeRate: uint64(dbDetails.FundingFeeRate),
OrderNonce: nonce[:],
State: state.String(),
Units: uint32(dbDetails.Units),
@ -986,7 +986,7 @@ func (s *rpcServer) ListOrders(ctx context.Context, _ *clmrpc.ListOrdersRequest)
case *order.Ask:
rpcAsk := &clmrpc.Ask{
Details: details,
MaxDurationBlocks: int64(o.MaxDuration),
MaxDurationBlocks: o.MaxDuration,
Version: uint32(o.Version),
}
asks = append(asks, rpcAsk)
@ -994,7 +994,7 @@ func (s *rpcServer) ListOrders(ctx context.Context, _ *clmrpc.ListOrdersRequest)
case *order.Bid:
rpcBid := &clmrpc.Bid{
Details: details,
MinDurationBlocks: int64(o.MinDuration),
MinDurationBlocks: o.MinDuration,
Version: uint32(o.Version),
}
bids = append(bids, rpcBid)