-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathwallet.proto
More file actions
1733 lines (1385 loc) · 67.4 KB
/
Copy pathwallet.proto
File metadata and controls
1733 lines (1385 loc) · 67.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
syntax = "proto3";
package wavewalletrpc;
option go_package = "github.com/lightninglabs/wavelength/rpc/wavewalletrpc";
// WalletService exposes a simplified, swap-vocabulary-free wallet API on top
// of the running daemon. It composes the underlying swap subsystem, ark VTXO
// operations, boarding deposits, cooperative leave (VTXO-to-onchain), and
// unilateral exit behind one small surface: the seven core verbs that map
// 1:1 to what a user actually does day-to-day — create, unlock, send, recv,
// list, balance, exit — plus a few additional methods (Deposit, Status,
// SubscribeWallet) used internally and by recv --onchain. The service is
// registered only when the daemon is built with the wavewalletrpc build tag
// (which also requires swapruntime).
service WalletService {
// Create initializes a new wallet from a freshly generated aezeed
// mnemonic. The daemon generates the seed, encrypts it with the
// supplied password, and returns the mnemonic so the caller can record
// it. For recovery flows the caller MAY supply an existing mnemonic in
// the request; in that case the same mnemonic is echoed back. Proxies
// waverpc.GenSeed + waverpc.InitWallet server-side.
rpc Create (CreateRequest) returns (CreateResponse);
// Unlock decrypts the on-disk wallet seed using the supplied password
// and starts the wallet subsystem. Proxies waverpc.UnlockWallet.
rpc Unlock (UnlockRequest) returns (UnlockResponse);
// PrepareSend validates and previews an outbound payment without
// moving funds. The response carries a short-lived send_intent_id
// that must be consumed by Send.
rpc PrepareSend (PrepareSendRequest) returns (PrepareSendResponse);
// Send dispatches a previously prepared outbound payment. The
// request is intentionally intent-only: callers must use
// PrepareSend first so they can present amount, rail, fee, and
// total-outflow details before funds move.
rpc Send (SendRequest) returns (SendResponse);
// Recv asks the daemon for a Lightning invoice the caller can hand
// out. Internally the daemon sets up the inbound receive via its
// owned swap subsystem; the invoice is signed with a daemon-managed
// key, not an ephemeral process-local key.
rpc Recv (RecvRequest) returns (RecvResponse);
// List returns the unified wallet view selected by ListRequest.view:
// ACTIVITY (default) is the merged WalletEntry stream; VTXOS is the
// live VTXO inventory; ONCHAIN is the boarding-plus-sweep on-chain
// history. The body oneof on ListResponse discriminates the typed
// result so agents see a tagged union, not a polymorphic blob.
rpc List (ListRequest) returns (ListResponse);
// Deposit returns a boarding onchain address the caller can fund. The
// daemon rolls the boarding output into a VTXO during the next round.
// Surfaced internally and via `recv --onchain`; not a top-level CLI
// verb.
rpc Deposit (DepositRequest) returns (DepositResponse);
// Balance returns the unified balance across confirmed VTXOs and
// in-flight inbound and outbound amounts.
rpc Balance (BalanceRequest) returns (BalanceResponse);
// Status returns a wallet-level readiness summary: daemon readiness,
// wallet-unlocked state, balance summary, pending-entry count. Kept in
// the proto for programmatic callers; not surfaced as a CLI verb (the
// `getinfo` CLI verb covers the human-facing readiness view).
rpc Status (StatusRequest) returns (StatusResponse);
// GetExitPlan previews unilateral-exit readiness for one VTXO. The
// response includes CPFP fee input requirements and, when funding is
// needed, a backing-wallet address callers can fund before forced unroll.
rpc GetExitPlan (GetExitPlanRequest) returns (GetExitPlanResponse);
// SweepWallet previews or broadcasts a normal backing-wallet sweep to a
// caller-supplied Bitcoin address. This sweeps wallet-managed funds left
// after CPFP/change/unroll proceeds and does not sweep boarding outputs.
rpc SweepWallet (SweepWalletRequest) returns (SweepWalletResponse);
// Exit queues a cooperative leave for the specified VTXO outpoint by
// default. When the caller supplies force_unroll_ack exactly, the daemon
// starts a unilateral unroll instead after checking that the outpoint is
// present in the local backing wallet's UTXO set.
rpc Exit (ExitRequest) returns (ExitResponse);
// ExitStatus reports the current phase of an unroll job for the
// specified VTXO outpoint, including recovery chain progress and
// sweep state. Proxies waverpc.GetUnrollStatus.
rpc ExitStatus (ExitStatusRequest) returns (ExitStatusResponse);
// ExitSummary reports the wallet-wide portfolio of in-progress exits:
// one row per active exit plus aggregate totals for the amount still
// being recovered, the estimated fees, and the estimated net recoverable.
rpc ExitSummary (ExitSummaryRequest) returns (ExitSummaryResponse);
// SubscribeWallet streams activity updates as they happen. The stream
// is resumable: each response carries a monotonic cursor the client can
// reconnect from to replay everything after it without gaps.
rpc SubscribeWallet (SubscribeWalletRequest)
returns (stream SubscribeWalletResponse);
}
// WalletInspectionService exposes technical drill-downs for wallet activity.
// Unlike WalletService.List, this surface may include internal correlators and
// ledger rows so operators can explain how a user-facing entry was executed.
service WalletInspectionService {
// InspectActivity returns a technical trace for one WalletEntry id.
rpc InspectActivity (InspectActivityRequest)
returns (InspectActivityResponse);
}
// EntryKind tags each WalletEntry with the user-visible category of the
// underlying operation. Internal subtypes (same-Ark p2p vs real Lightning,
// OOR session correlators, round IDs) are deliberately not surfaced.
enum EntryKind {
// ENTRY_KIND_UNSPECIFIED is the proto zero value used when the
// operation category is unknown.
ENTRY_KIND_UNSPECIFIED = 0;
// ENTRY_KIND_SEND is an outbound payment over any rail (Lightning,
// same-Ark, onchain, or credit).
ENTRY_KIND_SEND = 1;
// ENTRY_KIND_RECV is an inbound receive.
ENTRY_KIND_RECV = 2;
// ENTRY_KIND_DEPOSIT is a boarding deposit rolled into a VTXO.
ENTRY_KIND_DEPOSIT = 3;
// ENTRY_KIND_EXIT is a cooperative leave or unilateral exit to
// on-chain funds.
ENTRY_KIND_EXIT = 4;
}
// EntryStatus collapses every backing FSM into the three states user-facing
// surfaces actually need.
enum EntryStatus {
// ENTRY_STATUS_UNSPECIFIED is the proto zero value used when the
// backing state has not been mapped yet.
ENTRY_STATUS_UNSPECIFIED = 0;
// ENTRY_STATUS_PENDING means the operation is still in flight.
ENTRY_STATUS_PENDING = 1;
// ENTRY_STATUS_COMPLETE means the operation reached a durable
// success state.
ENTRY_STATUS_COMPLETE = 2;
// ENTRY_STATUS_FAILED means the operation reached a terminal
// failure state.
ENTRY_STATUS_FAILED = 3;
}
// ListView selects which slice of wallet state List returns. The default
// (LIST_VIEW_UNSPECIFIED) is treated as LIST_VIEW_ACTIVITY for backwards
// feel: callers that don't care about the new shape keep getting the
// activity stream.
enum ListView {
// LIST_VIEW_UNSPECIFIED is the proto zero value; List treats it as
// LIST_VIEW_ACTIVITY.
LIST_VIEW_UNSPECIFIED = 0;
// LIST_VIEW_ACTIVITY returns the merged WalletEntry stream (send /
// recv / deposit / exit) across the swap subsystem, OOR sessions, the
// boarding ledger, and the unroll registry.
LIST_VIEW_ACTIVITY = 1;
// LIST_VIEW_VTXOS returns the live VTXO inventory (one row per
// spendable VTXO).
LIST_VIEW_VTXOS = 2;
// LIST_VIEW_ONCHAIN returns the on-chain transaction history
// (boarding deposits, boarding sweeps, leave outputs, round
// commitment txs that confirmed against this wallet).
LIST_VIEW_ONCHAIN = 3;
}
// SendRail identifies the expected settlement rail for a prepared send.
enum SendRail {
// SEND_RAIL_UNSPECIFIED is the proto zero value used when no rail
// has been determined.
SEND_RAIL_UNSPECIFIED = 0;
// SEND_RAIL_OFFCHAIN_UNKNOWN is used when the wallet can parse the
// invoice locally but the swapserver has not supplied a quote that
// distinguishes same-Ark settlement from Lightning settlement.
SEND_RAIL_OFFCHAIN_UNKNOWN = 1;
// SEND_RAIL_IN_ARK is same-Ark peer-to-peer settlement, where the
// payment never touches Lightning.
SEND_RAIL_IN_ARK = 2;
// SEND_RAIL_LIGHTNING is settlement over the real Lightning network.
SEND_RAIL_LIGHTNING = 3;
// SEND_RAIL_ONCHAIN is an on-chain send via a cooperative leave to
// the destination address.
SEND_RAIL_ONCHAIN = 4;
// SEND_RAIL_CREDIT is settlement drawn from the wallet's
// server-side credit balance.
SEND_RAIL_CREDIT = 5;
// SEND_RAIL_MIXED is settlement that combines credit with the
// normal vHTLC path.
SEND_RAIL_MIXED = 6;
}
// SendQuoteStatus describes how complete the prepare-time quote is.
enum SendQuoteStatus {
// SEND_QUOTE_STATUS_UNSPECIFIED is the proto zero value; quote
// completeness was not reported.
SEND_QUOTE_STATUS_UNSPECIFIED = 0;
// SEND_QUOTE_STATUS_COMPLETE means every user-visible amount and fee
// field is backed by a remote quote.
SEND_QUOTE_STATUS_COMPLETE = 1;
// SEND_QUOTE_STATUS_LOCAL_ONLY means the wallet performed local
// validation and selection but one or more remote quote APIs are not
// available yet.
SEND_QUOTE_STATUS_LOCAL_ONLY = 2;
}
// ExitMode identifies whether Exit queued a cooperative leave or started a
// forced unilateral unroll.
enum ExitMode {
// EXIT_MODE_UNSPECIFIED is the proto zero value used when the exit
// path was not reported.
EXIT_MODE_UNSPECIFIED = 0;
// EXIT_MODE_COOPERATIVE means Exit queued a cooperative leave
// (VTXO-to-onchain).
EXIT_MODE_COOPERATIVE = 1;
// EXIT_MODE_UNILATERAL means Exit started a forced unilateral
// unroll.
EXIT_MODE_UNILATERAL = 2;
}
// CreateRequest carries the parameters for WalletService.Create: the
// encryption password, optional seed material, and recovery options.
message CreateRequest {
// wallet_password is the password used to encrypt the on-disk seed.
// Must be at least 8 bytes. The password is consumed and zeroed by
// the daemon after wallet initialization.
bytes wallet_password = 1;
// seed_passphrase is the optional aezeed passphrase (BIP39-style
// 25th-word) protecting the mnemonic itself. Distinct from
// wallet_password.
bytes seed_passphrase = 2;
// mnemonic is the 24-word aezeed mnemonic to import. Empty means
// "generate a fresh seed"; non-empty means "recover from this
// mnemonic". When non-empty the response echoes the same mnemonic
// back unchanged.
repeated string mnemonic = 3;
// recover_state asks the daemon to scan deterministic Ark wallet keys
// after importing mnemonic and rebuild local Ark state from chain and
// indexer data.
bool recover_state = 4;
// recovery_window is the number of key indexes to scan per recovery key
// family. Zero uses the daemon wallet.recoverywindow config value.
uint32 recovery_window = 5;
}
// CreateResponse returns the wallet mnemonic and identity, plus a summary of
// any Ark-state recovery performed during Create.
message CreateResponse {
// mnemonic is the 24-word aezeed mnemonic for the wallet. For fresh
// wallets (request mnemonic empty) this is the newly generated
// seed and the caller MUST persist it offline before any unlock
// sequence — losing it makes the wallet unrecoverable. For recovery
// flows (request mnemonic supplied) this is the same mnemonic echoed
// back for confirmation.
repeated string mnemonic = 1;
// identity_pubkey is the hex-encoded daemon wallet identity public
// key derived from the newly created wallet.
string identity_pubkey = 2;
// recovery_ran is true when Create attempted Ark-state recovery.
bool recovery_ran = 3;
// recovered_boarding_addresses is the number of boarding addresses
// rebuilt and persisted from deterministic keys.
uint32 recovered_boarding_addresses = 4;
// recovered_boarding_utxos is the number of confirmed wallet UTXOs found
// at recovered boarding addresses during the recovery scan.
uint32 recovered_boarding_utxos = 5;
// recovered_vtxos is the number of indexed VTXOs restored into local
// wallet state.
uint32 recovered_vtxos = 6;
// recovered_oor_receive_scripts is the number of registered OOR receive
// scripts matched and restored into local ownership metadata.
uint32 recovered_oor_receive_scripts = 7;
// recovered_oor_events is the number of OOR recipient events processed
// during recovery.
uint32 recovered_oor_events = 8;
}
// UnlockRequest carries the password used to decrypt the on-disk seed for
// WalletService.Unlock.
message UnlockRequest {
// wallet_password is the password used to decrypt the on-disk seed.
bytes wallet_password = 1;
}
// UnlockResponse returns the identity of the wallet unlocked by
// WalletService.Unlock.
message UnlockResponse {
// identity_pubkey is the hex-encoded daemon wallet identity public
// key of the unlocked wallet.
string identity_pubkey = 1;
}
// PrepareSendRequest describes the outbound payment to validate and preview
// via WalletService.PrepareSend, before any funds move.
message PrepareSendRequest {
// destination selects the outbound payment target. Exactly one
// variant must be set.
oneof destination {
// invoice is a BOLT-11 Lightning invoice. The daemon pays it via
// its owned swap subsystem; the swap server picks same-Ark p2p vs
// real Lightning transparently.
string invoice = 1;
// onchain_address is a bech32 onchain destination. The daemon
// submits a LeaveVTXOs request covering amt_sat plus fees.
string onchain_address = 2;
}
// amt_sat is required for onchain sends. For onchain sends amt_sat
// must be strictly positive unless sweep_all is set, in which case
// it must be zero. For invoice sends amt_sat is ignored: v1 requires
// an amount-bearing BOLT-11 invoice; amountless invoices are rejected
// at the wallet layer until plumbing for caller-supplied amounts
// lands in the swap subserver.
uint64 amt_sat = 3;
// note is an optional caller-supplied label persisted alongside the
// entry. It is never interpreted by the daemon.
string note = 4;
// max_fee_sat is the optional caller cap on routing or sweep fees.
// Zero means use daemon defaults.
uint64 max_fee_sat = 5;
// sweep_all signals an explicit wallet-emptying onchain send: every
// live VTXO is swept to the destination, less fees. The caller must
// set amt_sat = 0 when this flag is true and a strictly positive
// amt_sat otherwise. This makes "drain the wallet" structurally
// distinct from "amt_sat defaulted to zero" so a typo cannot empty
// the wallet by accident. Ignored on the invoice path.
bool sweep_all = 6;
}
// PrepareSendResponse is the preview of a prepared send: the single-use
// intent token plus the amount, fee, rail, and quote detail a caller should
// confirm before calling Send.
message PrepareSendResponse {
// send_intent_id is a short-lived, single-use token consumed by Send.
string send_intent_id = 1;
// amount_sat is the destination principal amount.
int64 amount_sat = 2;
// expected_fee_sat is meaningful only when fee_known is true.
int64 expected_fee_sat = 3;
// fee_known is false when a required remote quote API is missing.
bool fee_known = 4;
// expected_total_outflow_sat is meaningful only when
// total_outflow_known is true.
int64 expected_total_outflow_sat = 5;
// total_outflow_known is false when the final outflow depends on a
// remote quote that is not available yet.
bool total_outflow_known = 6;
// rail is the expected settlement rail for this prepared send. Onchain
// prepares always return SEND_RAIL_ONCHAIN. Invoice prepares map the
// swap quote settlement type when a remote quote is available; when
// no quote is available (LOCAL_ONLY) or the quote does not
// distinguish same-Ark from Lightning, the value is
// SEND_RAIL_OFFCHAIN_UNKNOWN until Send starts.
SendRail rail = 7;
// quote_status describes how complete the prepare-time quote is.
// Invoice sends: COMPLETE when every amount and fee is backed by a
// swap remote quote; LOCAL_ONLY when the invoice parsed locally but
// the swap quote API was unavailable. Onchain sends: COMPLETE when
// waverpc.EstimateFee returned a binding operator quote;
// LOCAL_ONLY when only a local fee floor could be computed.
SendQuoteStatus quote_status = 8;
// destination_summary is a short display string suitable for CLI and
// UI confirmation prompts.
string destination_summary = 9;
// invoice_description is the BOLT-11 description when present.
string invoice_description = 10;
// payment_hash is the invoice payment hash when available.
string payment_hash = 11;
// expires_at_unix is the unix timestamp after which Send rejects the
// prepared intent.
int64 expires_at_unix = 12;
// selected_outpoints is populated for onchain sends so Send can spend
// exactly the VTXO set previewed to the user.
repeated string selected_outpoints = 13;
// warning carries a concise human-facing caveat for local-only
// previews.
string warning = 14;
// credit_preview is populated when the invoice send will or can use
// sat-native server credits.
CreditPreview credit_preview = 15;
}
// SendRequest dispatches a previously prepared send by consuming the
// single-use intent token returned by PrepareSend.
message SendRequest {
// send_intent_id is returned by PrepareSend and may be consumed once.
string send_intent_id = 1;
}
// SendResponse returns the initial WalletEntry for a dispatched send and the
// actual amount that will leave the wallet.
message SendResponse {
// entry is the initial WalletEntry persisted for this send. The
// caller can poll List or SubscribeWallet for subsequent status
// transitions.
WalletEntry entry = 1;
// actual_amount_sat is the real amount that will leave the wallet
// for this operation. For invoice sends it matches the caller's
// amt_sat (or the invoice amount for amount-bearing invoices). For a
// bounded onchain send it matches the requested amt_sat: the
// seal-time fee handshake returns a change VTXO rather than sweeping
// whole VTXOs. For a sweep_all onchain send it reflects the SUM of
// the swept VTXOs (the whole-wallet drain). CLI and UI surfaces
// SHOULD echo this back to the user before treating the send as
// confirmed.
int64 actual_amount_sat = 2;
}
// RecvRequest describes the inbound receive to open via WalletService.Recv.
message RecvRequest {
// amt_sat is the amount the caller wants to receive in satoshis.
uint64 amt_sat = 1;
// memo is the optional human-readable memo to embed in the invoice.
string memo = 2;
}
// RecvResponse returns the BOLT-11 invoice to hand out and the initial
// WalletEntry tracking the pending receive.
message RecvResponse {
// invoice is the BOLT-11 payment request the caller hands out to
// the payer.
string invoice = 1;
// entry is the initial WalletEntry persisted for this receive.
WalletEntry entry = 2;
// credit_receive is populated when the receive is backed by server credits
// rather than a client-claimable vHTLC.
CreditReceive credit_receive = 3;
}
// CreditPreview describes how server-side sat-native credits factor into a
// prepared send. It is populated on PrepareSendResponse when the invoice
// send will or can draw on credits.
message CreditPreview {
// must_use_credit is true when the invoice amount cannot be
// represented by the normal vHTLC path and the send must be settled
// from the credit balance.
bool must_use_credit = 1;
// credit_applied_sat is the credit balance in satoshis the quote
// expects to reserve for this send.
uint64 credit_applied_sat = 2;
// credit_shortfall_sat is the additional credit in satoshis needed
// before this payment can be admitted.
uint64 credit_shortfall_sat = 3;
// credit_topup_sat is the Ark top-up amount in satoshis required to
// cover the shortfall. It is rounded up and dust-limited by the server.
uint64 credit_topup_sat = 4;
// ark_funding_sat is the amount in satoshis the client must still fund
// through the normal vHTLC path.
uint64 ark_funding_sat = 5;
}
// CreditReceive describes a receive backed by server credits rather than a
// client-claimable vHTLC. It is populated on RecvResponse for the credit
// path.
message CreditReceive {
// operation_id is the durable credit-subsystem operation id tracking
// this receive. It is the WalletEntry.id for credit RECV rows; the
// server-owned payment_hash is in payment_hash below.
string operation_id = 1;
// amount_sat is the amount in satoshis the caller asked to receive,
// credited to the wallet account once the server-owned invoice settles.
uint64 amount_sat = 2;
// payment_hash is the hex-encoded payment hash of the server-owned
// receive invoice.
string payment_hash = 3;
}
// ListRequest selects the wallet view and filters for WalletService.List.
message ListRequest {
// view selects which slice of wallet state to return. The default
// (LIST_VIEW_UNSPECIFIED) is treated as LIST_VIEW_ACTIVITY.
ListView view = 1;
// pending_only filters the returned entries to those still in
// flight. Applies to the ACTIVITY view; ignored for VTXOS and
// ONCHAIN.
bool pending_only = 2;
// kinds optionally narrows the response to specific entry
// categories. Applies to the ACTIVITY view; ignored for VTXOS and
// ONCHAIN. When empty, all kinds are returned.
repeated EntryKind kinds = 3;
// limit caps the response size. Zero means use the daemon default.
uint32 limit = 4;
// offset is the pagination offset within the chosen view. It applies
// to the VTXOS and ONCHAIN views; the ACTIVITY view paginates by the
// opaque cursor below instead and ignores offset.
uint32 offset = 5;
// cursor is the opaque pagination token for the ACTIVITY view. Empty
// starts from the newest entry; otherwise it is the next_cursor
// returned by the previous ActivityList page. It is stable across
// concurrent inserts, so paging never skips or duplicates rows.
// Ignored for the VTXOS and ONCHAIN views.
string cursor = 6;
}
// ListResponse carries the typed result of WalletService.List as a oneof
// discriminated by the requested view.
message ListResponse {
// body discriminates the typed result by view. Callers should
// switch on the populated variant; an empty body indicates an
// empty result for the requested view.
oneof body {
// activity is set when the request view is ACTIVITY (the default):
// the merged, time-sorted WalletEntry stream.
ActivityList activity = 1;
// vtxos is set when the request view is VTXOS: the live spendable
// VTXO inventory.
VTXOInventory vtxos = 2;
// onchain is set when the request view is ONCHAIN: the on-chain
// transaction history.
OnchainHistory onchain = 3;
}
}
// ActivityList is the ACTIVITY-view body of ListResponse: the merged,
// time-sorted WalletEntry stream.
message ActivityList {
// entries are the unified, time-sorted wallet operations.
repeated WalletEntry entries = 1;
// total is the number of entries in this page. It is a page count,
// not a full-feed count: the feed is paged by an opaque cursor, so
// callers use has_more, not total, to decide whether to fetch again.
uint32 total = 2;
// has_more reports whether more entries exist after this page.
bool has_more = 3;
// next_cursor is the opaque token to pass as ListRequest.cursor to
// fetch the next page. Empty when has_more is false.
string next_cursor = 4;
}
// VTXOInventory is the VTXOS-view body of ListResponse: the live spendable
// VTXO inventory.
message VTXOInventory {
// vtxos are the live spendable VTXOs in the wallet. Order is
// unspecified.
repeated WalletVTXO vtxos = 1;
// total is the count of all live VTXOs before limit/offset.
uint32 total = 2;
}
// WalletVTXO is the wallet-facing view of one VTXO. Internal lifecycle
// detail (forfeiting flow, chain depth, etc.) is hidden; power-users can
// reach the full shape via `wavecli ark vtxos list`.
message WalletVTXO {
// outpoint is the VTXO's outpoint in "txid:index" format.
string outpoint = 1;
// amount_sat is the value of the VTXO in satoshis.
int64 amount_sat = 2;
// status is a short lowercase string: "live", "pending_forfeit",
// "forfeiting", "spending", "unilateral_exit". Internal terminal
// states (forfeited / spent / failed) are filtered out of the
// wallet view.
string status = 3;
// batch_expiry is the absolute block height at which the batch-level
// timelock expires.
int32 batch_expiry = 4;
// relative_expiry is the CSV delay (in blocks) for the unilateral
// exit path.
uint32 relative_expiry = 5;
// commitment_txid is the hex-encoded txid of the on-chain commitment
// transaction anchoring this VTXO's tree.
string commitment_txid = 6;
}
// OnchainHistory is the ONCHAIN-view body of ListResponse: the on-chain
// transaction history.
message OnchainHistory {
// txs are the on-chain transaction history rows: boarding deposits,
// boarding sweeps, leave outputs, round commitment txs that touched
// this wallet. Sorted newest first.
repeated OnchainTx txs = 1;
// total is the count of matching rows before limit/offset.
uint32 total = 2;
// has_more is true when another page is available.
bool has_more = 3;
}
// OnchainTx is the wallet-facing view of one on-chain transaction. It
// flattens the daemon's richer TransactionHistoryEntry shape to the fields
// a wallet user actually needs.
message OnchainTx {
// txid is the hex-encoded transaction id, when known. Some ledger
// rows (e.g. fee_paid) do not carry a txid; those entries surface
// with txid="" and the row is still informative.
string txid = 1;
// kind is the high-level transaction type: "boarding", "sweep",
// "round", "oor", or "fee".
string kind = 2;
// amount_sat is the signed transaction amount in satoshis. Positive
// values are credits to this wallet; negative values are debits.
int64 amount_sat = 3;
// fee_sat is the absolute fee paid (or pending) for this
// transaction, when known.
int64 fee_sat = 4;
// status is a short lowercase string: "confirmed", "pending",
// "recorded", or a backing-specific lifecycle value.
string status = 5;
// confirmation_height is set when the source records a chain
// confirmation height.
int32 confirmation_height = 6;
// created_at_unix is the local creation timestamp in unix seconds.
int64 created_at_unix = 7;
// description is a human-readable local note.
string description = 8;
}
// InspectActivityRequest identifies the activity entry to inspect.
message InspectActivityRequest {
// id is the WalletEntry.id to inspect.
// InspectActivity searches the daemon's current activity window, which is
// capped by the daemon maximum list limit.
string id = 1;
// ledger_limit caps how many ledger rows are scanned for correlation.
// Zero means use the daemon's maximum list limit.
uint32 ledger_limit = 2;
}
// InspectActivityResponse contains the friendly activity row plus the
// lower-level records that explain how the daemon derived it.
message InspectActivityResponse {
// entry is the user-facing activity row being inspected.
WalletEntry entry = 1;
// swap is populated when the entry is backed by a pay or receive swap.
ActivitySwapTrace swap = 2;
// vtxos contains best-effort VTXO movements correlated to this
// activity. Rows are derived from local swap summaries and ledger
// accounting, so ids may be OOR session/output ids when a full VTXO
// outpoint is not persisted by the source row.
repeated ActivityVTXOTrace vtxos = 3;
// ledger_rows are the local accounting rows used to build the trace,
// including rows hidden from the friendly activity feed.
repeated ActivityLedgerTrace ledger_rows = 4;
// notes contains plain-English caveats about best-effort correlation.
repeated string notes = 5;
}
// ActivitySwapTrace is the swap-service snapshot correlated to one wallet
// activity entry.
message ActivitySwapTrace {
// payment_hash is the Lightning payment hash that identifies the
// swap-backed activity.
string payment_hash = 1;
// direction is the raw swapclientrpc.SwapDirection enum name, kept as a
// string so this debug surface can expose swap state without importing the
// swap service proto into the wallet proto.
string direction = 2;
// state is the raw swapclientrpc.SwapState enum name at inspection time.
string state = 3;
// pending is true while the backing swap state machine is still active.
bool pending = 4;
// amount_sat is the swap amount in satoshis using the swap service's
// unsigned amount convention.
int64 amount_sat = 5;
// fee_sat is the fee reported by the swap service for this swap.
uint64 fee_sat = 6;
// invoice is the BOLT-11 invoice associated with the swap when known.
string invoice = 7;
// vhtlc_outpoint is the Ark vHTLC output observed for the swap when known.
string vhtlc_outpoint = 8;
// vhtlc_amount_sat is the amount held by vhtlc_outpoint when known.
int64 vhtlc_amount_sat = 9;
// funding_session_id is the OOR session that funded the swap when known.
string funding_session_id = 10;
// claim_session_id is the OOR session that claimed the swap when known.
string claim_session_id = 11;
// refund_session_id is the OOR session that refunded the swap when known.
string refund_session_id = 12;
// terminal_reason is the swap service's terminal reason string when the
// swap reached a failed or intervention state.
string terminal_reason = 13;
// created_at_unix is the swap creation timestamp in unix seconds.
int64 created_at_unix = 14;
// updated_at_unix is the last swap update timestamp in unix seconds.
int64 updated_at_unix = 15;
// deadline_unix is the swap deadline in unix seconds when the swap service
// exposes one.
int64 deadline_unix = 16;
// refund_locktime is the absolute locktime after which the swap can be
// refunded.
uint32 refund_locktime = 17;
// settlement_type is the raw swapclientrpc.SwapSettlementType enum name
// when known.
string settlement_type = 18;
// sender_pubkey is the compressed SEC-encoded vHTLC sender key when known.
string sender_pubkey = 19;
// preimage is the hex-encoded Lightning payment preimage once the swap
// revealed it. For a completed pay swap this is the proof of payment for
// the paid invoice; it is empty until the preimage is durably known.
string preimage = 20;
}
// ActivityVTXOTrace describes one VTXO movement correlated to a wallet activity
// entry.
message ActivityVTXOTrace {
// id is the best available identifier. It is an outpoint when the
// source has one, otherwise an OOR session/output identifier.
string id = 1;
// amount_sat is the VTXO amount in satoshis.
int64 amount_sat = 2;
// role is a short technical label such as "spent_input",
// "change_output", "materialized_output", or "vhtlc_output".
string role = 3;
// ours is true when the row represents wallet-owned funds.
bool ours = 4;
// source names the local source used to derive the row, such as
// "ledger" or "swap".
string source = 5;
// session_id is the OOR session/correlation id when known.
string session_id = 6;
// output_index is set when the source names a specific OOR output
// index.
uint32 output_index = 7;
}
// ActivityLedgerTrace describes one local ledger row correlated to a wallet
// activity entry.
message ActivityLedgerTrace {
// source names the subsystem that produced the row, such as "ledger" or
// "boarding_sweep".
string source = 1;
// type is the broad transaction group used by the wallet history query.
string type = 2;
// subtype is the ledger event type or sweep state.
string subtype = 3;
// amount_sat is the row amount in satoshis using the ledger sign
// convention.
int64 amount_sat = 4;
// fee_sat is the row's fee contribution in satoshis when the history query
// can derive one.
int64 fee_sat = 5;
// created_at_unix is the row creation timestamp in unix seconds.
int64 created_at_unix = 6;
// confirmation_status is the best-known chain confirmation state for the
// row, for example "pending", "confirmed", or "recorded".
string confirmation_status = 7;
// description is the local ledger description persisted with the row.
string description = 8;
// entry_id is the local ledger row id when the source is the ledger.
int64 entry_id = 9;
// txid is the associated chain transaction id when known.
string txid = 10;
// debit_account is the local accounting debit account.
string debit_account = 11;
// credit_account is the local accounting credit account.
string credit_account = 12;
// round_id is the Ark round id associated with the row when known.
string round_id = 13;
// session_id is the OOR session/correlation id associated with the row when
// known.
string session_id = 14;
// confirmation_height is the confirmed block height when known.
int32 confirmation_height = 15;
// hidden_from_activity is true when WalletService.List suppresses the
// row because it is an internal execution leg.
bool hidden_from_activity = 16;
// role is the inspection role inferred for this row.
string role = 17;
// output_index is the transaction output index associated with txid.
// A negative value means the source has no output index.
int32 output_index = 18;
}
// DepositRequest asks WalletService.Deposit for a fresh boarding address.
message DepositRequest {
// amt_sat_hint is an optional caller hint about the expected deposit
// amount. The daemon may use it to size internal accounting; the
// returned boarding address is not amount-bound.
uint64 amt_sat_hint = 1;
}
// DepositResponse returns a fresh boarding address and the initial
// DEPOSIT-kind WalletEntry tracking the pending boarding operation.
message DepositResponse {
// onchain_address is a fresh boarding address the caller should
// fund. The daemon monitors it and rolls the boarding output into
// the next round.
string onchain_address = 1;
// entry is the initial DEPOSIT-kind WalletEntry persisted to track
// the pending boarding operation.
WalletEntry entry = 2;
}
// BalanceRequest is the empty request for WalletService.Balance.
message BalanceRequest {
}
// BalanceResponse is the unified balance summary returned by
// WalletService.Balance across confirmed, in-flight, and credit amounts.
message BalanceResponse {
// confirmed_sat is the total spendable VTXO amount in satoshis.
int64 confirmed_sat = 1;
// pending_in_sat is the total in-flight inbound amount (boarding
// plus receive operations).
int64 pending_in_sat = 2;
// pending_out_sat is the total in-flight outbound amount (send plus
// exit operations).
int64 pending_out_sat = 3;
// credit_available_sat is the server-authoritative available credit
// balance for the wallet identity.
uint64 credit_available_sat = 4;
// credit_reserved_sat is the server-authoritative in-flight credit
// reservation amount.
uint64 credit_reserved_sat = 5;
}
// StatusRequest is the empty request for WalletService.Status.
message StatusRequest {
}
// StatusResponse is the wallet-level readiness summary returned by
// WalletService.Status.
message StatusResponse {
// ready is true when the daemon and its dependencies are up.
bool ready = 1;
// unlocked is a legacy wallet-exists signal: true once a wallet
// seed exists on disk or is loaded in memory. Use ready to check
// whether wallet RPCs are currently usable.
bool unlocked = 2;
// network is the bitcoin network the daemon is configured for, for
// example "mainnet", "testnet", "testnet4", "signet", or
// "regtest".
string network = 3;
// balance is the unified balance summary at the time of the call.
BalanceResponse balance = 4;
// pending_count is the number of WalletEntry rows in PENDING
// status.
uint32 pending_count = 5;
}
// GetExitPlanRequest lists the VTXO outpoints to preview for unilateral exit
// via WalletService.GetExitPlan.
message GetExitPlanRequest {
// outpoints are the VTXO outpoints to preview, each "txid:index".
repeated string outpoints = 1;
// conf_target selects the fee-estimation target in blocks. Zero uses
// the daemon's default unroll confirmation target.
uint32 conf_target = 2;
}
// ExitPlanEntry is the per-outpoint unilateral-exit readiness preview: the
// backing-wallet fee requirements and, when an unroll job already exists,
// its current state.
message ExitPlanEntry {
// outpoint is the previewed VTXO outpoint, formatted as "txid:index".
string outpoint = 1;
// funding_address is a backing-wallet address the caller can fund to
// cover the fee shortfall this exit needs. It is empty when can_start
// is true (no shortfall, so no address is allocated).
string funding_address = 2;
// required_confirmations is the number of confirmations a
// backing-wallet UTXO must have before it can fund the unroll CPFP.
uint32 required_confirmations = 3;
// required_fee_utxo_count is the number of distinct confirmed wallet
// UTXOs the exit needs to fund CPFP fees, one per unroll ancestry path.
uint32 required_fee_utxo_count = 4;
// usable_fee_utxo_count is the number of confirmed wallet UTXOs large
// enough to each fund a CPFP child on their own.