lnlink-server 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/README.md +461 -0
  2. package/dist/app.js +11165 -0
  3. package/dist/binaries.json +20 -0
  4. package/dist/build-info.json +41 -0
  5. package/dist/config.default.js +19 -0
  6. package/dist/index.js +19002 -0
  7. package/dist/index.js.map +7 -0
  8. package/dist/package.json +61 -0
  9. package/dist/prisma/migrations/20250918020814_/migration.sql +188 -0
  10. package/dist/prisma/migrations/20251114105314_auto_update/migration.sql +2 -0
  11. package/dist/prisma/migrations/migration_lock.toml +3 -0
  12. package/dist/prisma/schema.prisma +181 -0
  13. package/dist/proto/chainkit.proto +74 -0
  14. package/dist/proto/lightning.proto +5411 -0
  15. package/dist/proto/lit-status.proto +36 -0
  16. package/dist/proto/looprpc/client.proto +1435 -0
  17. package/dist/proto/price_oracle.proto +243 -0
  18. package/dist/proto/rfqrpc/rfq.proto +436 -0
  19. package/dist/proto/routerrpc/router.proto +1136 -0
  20. package/dist/proto/signrpc/signer.proto +709 -0
  21. package/dist/proto/stateservice.proto +73 -0
  22. package/dist/proto/swapserverrpc/common.proto +37 -0
  23. package/dist/proto/tapchannel.proto +306 -0
  24. package/dist/proto/tapcommon.proto +36 -0
  25. package/dist/proto/taprootassets.proto +1959 -0
  26. package/dist/proto/universe.proto +1063 -0
  27. package/dist/proto/walletkit.proto +1594 -0
  28. package/dist/proto/walletunlocker.proto +338 -0
  29. package/dist/public/css/initOwner.css +553 -0
  30. package/dist/public/favicon.ico +0 -0
  31. package/dist/public/init.html +70 -0
  32. package/dist/public/js/init.js +454 -0
  33. package/dist/setting.mainnet.json +22 -0
  34. package/dist/setting.regtest.json +22 -0
  35. package/dist/setting.testnet.json +22 -0
  36. package/package.json +91 -0
@@ -0,0 +1,1063 @@
1
+ syntax = "proto3";
2
+
3
+ import "tapcommon.proto";
4
+ import "taprootassets.proto";
5
+
6
+ package universerpc;
7
+
8
+ option go_package = "github.com/lightninglabs/taproot-assets/taprpc/universerpc";
9
+
10
+ service Universe {
11
+ /* tapcli: `universe multiverse`
12
+ MultiverseRoot returns the root of the multiverse tree. This is useful to
13
+ determine the equality of two multiverse trees, since the root can directly
14
+ be compared to another multiverse root to find out if a sync is required.
15
+ */
16
+ rpc MultiverseRoot (MultiverseRootRequest) returns (MultiverseRootResponse);
17
+
18
+ /* tapcli: `universe roots`
19
+ AssetRoots queries for the known Universe roots associated with each known
20
+ asset. These roots represent the supply/audit state for each known asset.
21
+ */
22
+ rpc AssetRoots (AssetRootRequest) returns (AssetRootResponse);
23
+
24
+ /* tapcli: `universe roots`
25
+ QueryAssetRoots attempts to locate the current Universe root for a specific
26
+ asset. This asset can be identified by its asset ID or group key.
27
+ */
28
+ rpc QueryAssetRoots (AssetRootQuery) returns (QueryRootResponse);
29
+
30
+ /* tapcli: `universe delete`
31
+ DeleteAssetRoot deletes the Universe root for a specific asset, including
32
+ all asoociated universe keys, leaves, and events.
33
+ */
34
+ rpc DeleteAssetRoot (DeleteRootQuery) returns (DeleteRootResponse);
35
+
36
+ /* tapcli: `universe keys`
37
+ AssetLeafKeys queries for the set of Universe keys associated with a given
38
+ asset_id or group_key. Each key takes the form: (outpoint, script_key),
39
+ where outpoint is an outpoint in the Bitcoin blockchain that anchors a
40
+ valid Taproot Asset commitment, and script_key is the script_key of
41
+ the asset within the Taproot Asset commitment for the given asset_id or
42
+ group_key.
43
+ */
44
+ rpc AssetLeafKeys (AssetLeafKeysRequest) returns (AssetLeafKeyResponse);
45
+
46
+ /* tapcli: `universe leaves`
47
+ AssetLeaves queries for the set of asset leaves (the values in the Universe
48
+ MS-SMT tree) for a given asset_id or group_key. These represents either
49
+ asset issuance events (they have a genesis witness) or asset transfers that
50
+ took place on chain. The leaves contain a normal Taproot Asset proof, as
51
+ well as details for the asset.
52
+ */
53
+ rpc AssetLeaves (ID) returns (AssetLeafResponse);
54
+
55
+ /* tapcli: `universe proofs query`
56
+ QueryProof attempts to query for an issuance or transfer proof for a given
57
+ asset based on its UniverseKey. A UniverseKey is composed of the Universe
58
+ ID (asset_id/group_key) and also a leaf key (outpoint || script_key). If
59
+ found, then the issuance proof is returned that includes an inclusion proof
60
+ to the known Universe root, as well as a Taproot Asset state transition or
61
+ issuance proof for the said asset.
62
+ */
63
+ rpc QueryProof (UniverseKey) returns (AssetProofResponse);
64
+
65
+ // TODO(roasbeef): can make generic by being just AssetProof? ^
66
+ // * also want flag to give it in raw bytes so can sideload or import
67
+
68
+ /* tapcli: `universe proofs insert`
69
+ InsertProof attempts to insert a new issuance or transfer proof into the
70
+ Universe tree specified by the UniverseKey. If valid, then the proof is
71
+ inserted into the database, with a new Universe root returned for the
72
+ updated asset_id/group_key.
73
+ */
74
+ rpc InsertProof (AssetProof) returns (AssetProofResponse);
75
+
76
+ /* tapcli: `universe proofs push`
77
+ PushProof attempts to query the local universe for a proof specified by a
78
+ UniverseKey. If found, a connection is made to a remote Universe server to
79
+ attempt to upload the asset leaf.
80
+ */
81
+ rpc PushProof (PushProofRequest) returns (PushProofResponse);
82
+
83
+ // TODO(roasbeef): rename resp to UniverseStateUpdate? ^
84
+
85
+ /* tapcli: `universe info`
86
+ Info returns a set of information about the current state of the Universe
87
+ and allows a caller to check that a universe server is reachable and
88
+ configured correctly to allow proof courier access without macaroons.
89
+ */
90
+ rpc Info (InfoRequest) returns (InfoResponse);
91
+
92
+ /* tapcli: `universe sync`
93
+ SyncUniverse takes host information for a remote Universe server, then
94
+ attempts to synchronize either only the set of specified asset_ids, or all
95
+ assets if none are specified. The sync process will attempt to query for
96
+ the latest known root for each asset, performing tree based reconciliation
97
+ to arrive at a new shared root.
98
+ */
99
+ rpc SyncUniverse (SyncRequest) returns (SyncResponse);
100
+
101
+ // TODO(roasebeef): streaming response, so can give feedback? ^
102
+
103
+ /* tapcli: `universe federation list`
104
+ ListFederationServers lists the set of servers that make up the federation
105
+ of the local Universe server. This servers are used to push out new proofs,
106
+ and also periodically call sync new proofs from the remote server.
107
+ */
108
+ rpc ListFederationServers (ListFederationServersRequest)
109
+ returns (ListFederationServersResponse);
110
+
111
+ /* tapcli: `universe federation add`
112
+ AddFederationServer adds a new server to the federation of the local
113
+ Universe server. Once a server is added, this call can also optionally be
114
+ used to trigger a sync of the remote server.
115
+ */
116
+ rpc AddFederationServer (AddFederationServerRequest)
117
+ returns (AddFederationServerResponse);
118
+
119
+ /* tapcli: `universe federation del`
120
+ DeleteFederationServer removes a server from the federation of the local
121
+ Universe server.
122
+ */
123
+ rpc DeleteFederationServer (DeleteFederationServerRequest)
124
+ returns (DeleteFederationServerResponse);
125
+
126
+ /* tapcli: `universe stats`
127
+ UniverseStats returns a set of aggregate statistics for the current state
128
+ of the Universe. Stats returned include: total number of syncs, total
129
+ number of proofs, and total number of known assets.
130
+ */
131
+ rpc UniverseStats (StatsRequest) returns (StatsResponse);
132
+
133
+ /* tapcli `universe stats assets`
134
+ QueryAssetStats returns a set of statistics for a given set of assets.
135
+ Stats can be queried for all assets, or based on the: asset ID, name, or
136
+ asset type. Pagination is supported via the offset and limit params.
137
+ Results can also be sorted based on any of the main query params.
138
+ */
139
+ rpc QueryAssetStats (AssetStatsQuery) returns (UniverseAssetStats);
140
+
141
+ /* tapcli `universe stats events`
142
+ QueryEvents returns the number of sync and proof events for a given time
143
+ period, grouped by day.
144
+ */
145
+ rpc QueryEvents (QueryEventsRequest) returns (QueryEventsResponse);
146
+
147
+ /*
148
+ SetFederationSyncConfig sets the configuration of the universe federation
149
+ sync.
150
+ */
151
+ rpc SetFederationSyncConfig (SetFederationSyncConfigRequest)
152
+ returns (SetFederationSyncConfigResponse);
153
+
154
+ /* tapcli: `universe federation config info`
155
+ QueryFederationSyncConfig queries the universe federation sync configuration
156
+ settings.
157
+ */
158
+ rpc QueryFederationSyncConfig (QueryFederationSyncConfigRequest)
159
+ returns (QueryFederationSyncConfigResponse);
160
+
161
+ /* tapcli: `universe ignoreoutpoint`
162
+ IgnoreAssetOutPoint allows an asset issuer to mark a specific asset outpoint
163
+ as ignored. An ignored outpoint will be included in the next universe supply
164
+ commitment transaction that is published.
165
+ */
166
+ rpc IgnoreAssetOutPoint (IgnoreAssetOutPointRequest)
167
+ returns (IgnoreAssetOutPointResponse);
168
+
169
+ /* tapcli: `universe updatesupplycommit`
170
+ UpdateSupplyCommit updates the on-chain supply commitment for a specific
171
+ asset group.
172
+ */
173
+ rpc UpdateSupplyCommit (UpdateSupplyCommitRequest)
174
+ returns (UpdateSupplyCommitResponse);
175
+
176
+ /* tapcli: `universe fetchsupplycommit`
177
+ FetchSupplyCommit fetches the on-chain supply commitment for a specific
178
+ asset group.
179
+ */
180
+ rpc FetchSupplyCommit (FetchSupplyCommitRequest)
181
+ returns (FetchSupplyCommitResponse);
182
+
183
+ /* tapcli: `universe supplyleaves`
184
+ FetchSupplyLeaves fetches the supply leaves for a specific asset group
185
+ within a specified block height range. The leaves include issuance, burn,
186
+ and ignore leaves, which represent the supply changes for the asset group.
187
+ */
188
+ rpc FetchSupplyLeaves (FetchSupplyLeavesRequest)
189
+ returns (FetchSupplyLeavesResponse);
190
+
191
+ /* tapcli: `universe supplycommit insert`
192
+ InsertSupplyCommit inserts a supply commitment for a specific asset
193
+ group. This includes the commitment details, supply leaves (issuance, burn,
194
+ and ignore), and chain proof that proves the commitment has been mined.
195
+ */
196
+ rpc InsertSupplyCommit (InsertSupplyCommitRequest)
197
+ returns (InsertSupplyCommitResponse);
198
+ }
199
+
200
+ message MultiverseRootRequest {
201
+ // The proof type to calculate the multiverse root for.
202
+ ProofType proof_type = 1;
203
+
204
+ // An optional list of universe IDs to include in the multiverse root. If
205
+ // none are specified, then all known universes of the given proof type are
206
+ // included. NOTE: The proof type within the IDs must either be unspecified
207
+ // or match the proof type above.
208
+ repeated ID specific_ids = 2;
209
+ }
210
+
211
+ message MultiverseRootResponse {
212
+ // The root of the multiverse tree.
213
+ MerkleSumNode multiverse_root = 1;
214
+ }
215
+
216
+ message AssetRootRequest {
217
+ // If true, then the response will include the amounts for each asset ID
218
+ // of grouped assets.
219
+ bool with_amounts_by_id = 1;
220
+
221
+ // The offset for the page.
222
+ int32 offset = 2;
223
+
224
+ // The length limit for the page.
225
+ int32 limit = 3;
226
+
227
+ // The direction of the page.
228
+ SortDirection direction = 4;
229
+
230
+ // TODO(roasbeef): filter by asset ID, etc?
231
+ }
232
+
233
+ message MerkleSumNode {
234
+ // The MS-SMT root hash for the branch node.
235
+ bytes root_hash = 1;
236
+
237
+ // The root sum of the branch node. This is hashed to create the root_hash
238
+ // along with the left and right siblings. This value represents the total
239
+ // known supply of the asset.
240
+ int64 root_sum = 2;
241
+
242
+ // TODO(roasbeef): add left and right siblings? then can have full tree
243
+ // exposed via iterative queries
244
+ }
245
+
246
+ enum ProofType {
247
+ PROOF_TYPE_UNSPECIFIED = 0;
248
+ PROOF_TYPE_ISSUANCE = 1;
249
+ PROOF_TYPE_TRANSFER = 2;
250
+ }
251
+
252
+ message ID {
253
+ oneof id {
254
+ // The 32-byte asset ID specified as raw bytes (gRPC only).
255
+ bytes asset_id = 1;
256
+
257
+ // The 32-byte asset ID encoded as a hex string (use this for REST).
258
+ string asset_id_str = 2;
259
+
260
+ // The 32-byte asset group key specified as raw bytes (gRPC only).
261
+ bytes group_key = 3;
262
+
263
+ // The 32-byte asset group key encoded as hex string (use this for
264
+ // REST).
265
+ string group_key_str = 4;
266
+ }
267
+
268
+ ProofType proof_type = 5;
269
+ }
270
+
271
+ message UniverseRoot {
272
+ // The ID of the asset universe root.
273
+ ID id = 1;
274
+
275
+ // The merkle sum sparse merkle tree root associated with the above
276
+ // universe ID.
277
+ MerkleSumNode mssmt_root = 3;
278
+
279
+ // The name of the asset.
280
+ string asset_name = 4;
281
+
282
+ // A map of hex encoded asset IDs to the number of units minted for that
283
+ // asset. This only contains more than one entry for grouped assets and in
284
+ // that case represents the whole list of assets currently known to exist
285
+ // within the group. For single (non-grouped) assets, this is equal to the
286
+ // asset ID above and the sum in the mssmt_root. A hex encoded string is
287
+ // used as the map key because gRPC does not support using raw bytes for a
288
+ // map key.
289
+ map<string, uint64> amounts_by_asset_id = 5;
290
+ }
291
+
292
+ message AssetRootResponse {
293
+ // A map of the set of known universe roots for each asset. The key in the
294
+ // map is the 32-byte asset_id or group key hash.
295
+ map<string, UniverseRoot> universe_roots = 1;
296
+ }
297
+
298
+ message AssetRootQuery {
299
+ // An ID value to uniquely identify a Universe root.
300
+ ID id = 1;
301
+ }
302
+
303
+ message QueryRootResponse {
304
+ // The issuance universe root for the given asset ID or group key.
305
+ UniverseRoot issuance_root = 1;
306
+
307
+ // The transfer universe root for the given asset ID or group key.
308
+ UniverseRoot transfer_root = 2;
309
+ }
310
+
311
+ message DeleteRootQuery {
312
+ // An ID value to uniquely identify a Universe root.
313
+ ID id = 1;
314
+ }
315
+
316
+ message DeleteRootResponse {
317
+ }
318
+
319
+ message Outpoint {
320
+ // The output as a hex encoded (and reversed!) string.
321
+ string hash_str = 1;
322
+
323
+ // The index of the output.
324
+ int32 index = 2;
325
+ }
326
+
327
+ message AssetKey {
328
+ // The outpoint of the asset key, either as a single hex encoded string, or
329
+ // an unrolled outpoint.
330
+ oneof outpoint {
331
+ string op_str = 1;
332
+
333
+ Outpoint op = 2;
334
+ }
335
+
336
+ // The script key of the asset.
337
+ oneof script_key {
338
+ bytes script_key_bytes = 3;
339
+
340
+ string script_key_str = 4;
341
+ }
342
+ }
343
+
344
+ message AssetLeafKeysRequest {
345
+ // The ID of the asset to query for.
346
+ ID id = 1;
347
+
348
+ // The offset for the page.
349
+ int32 offset = 2;
350
+
351
+ // The length limit for the page.
352
+ int32 limit = 3;
353
+
354
+ // The direction of the page.
355
+ SortDirection direction = 4;
356
+ }
357
+
358
+ message AssetLeafKeyResponse {
359
+ // The set of asset leaf keys for the given asset ID or group key.
360
+ repeated AssetKey asset_keys = 1;
361
+ }
362
+
363
+ message AssetLeaf {
364
+ // The asset included in the leaf.
365
+ taprpc.Asset asset = 1;
366
+
367
+ // TODO(roasbeef): only needed for display? can get from proof below ^
368
+
369
+ // The asset issuance or transfer proof, which proves that the asset
370
+ // specified above was issued or transferred properly. This is always just
371
+ // an individual mint/transfer proof and never a proof file.
372
+ bytes proof = 2;
373
+ }
374
+
375
+ message AssetLeafResponse {
376
+ // The set of asset leaves for the given asset ID or group key.
377
+ repeated AssetLeaf leaves = 1;
378
+ }
379
+
380
+ message UniverseKey {
381
+ // The ID of the asset to query for.
382
+ ID id = 1;
383
+
384
+ // The asset key to query for.
385
+ AssetKey leaf_key = 2;
386
+
387
+ // TODO(roasbeef): want to be able to eventually do sparse queries? so just
388
+ // outpoint, then return rest, etc
389
+ }
390
+
391
+ message AssetProofResponse {
392
+ // The original request for the issuance proof.
393
+ UniverseKey req = 1;
394
+
395
+ // The Universe root that includes this asset leaf.
396
+ UniverseRoot universe_root = 2;
397
+
398
+ // An inclusion proof for the asset leaf included below. The value is that
399
+ // issuance proof itself, with a sum value of the amount of the asset.
400
+ bytes universe_inclusion_proof = 3;
401
+
402
+ // The asset leaf itself, which includes the asset and the issuance proof.
403
+ AssetLeaf asset_leaf = 4;
404
+
405
+ // MultiverseRoot is the root of the multiverse tree that includes this
406
+ // asset leaf.
407
+ MerkleSumNode multiverse_root = 5;
408
+
409
+ // MultiverseInclusionProof is the inclusion proof for the asset leaf in the
410
+ // multiverse.
411
+ bytes multiverse_inclusion_proof = 6;
412
+
413
+ // The issuance related data for an issuance asset leaf. This is empty for
414
+ // any other type of asset leaf.
415
+ IssuanceData issuance_data = 7;
416
+ }
417
+
418
+ message IssuanceData {
419
+ // The reveal meta data associated with the proof, if available.
420
+ taprpc.AssetMeta meta_reveal = 1;
421
+
422
+ // GenesisReveal is an optional field that is the Genesis information for
423
+ // the asset. This is required for minting proofs.
424
+ taprpc.GenesisReveal genesis_reveal = 2;
425
+
426
+ // GroupKeyReveal is an optional field that includes the information needed
427
+ // to derive the tweaked group key.
428
+ taprpc.GroupKeyReveal group_key_reveal = 3;
429
+ }
430
+
431
+ message AssetProof {
432
+ // The ID of the asset to insert the proof for.
433
+ UniverseKey key = 1;
434
+
435
+ // The asset leaf to insert into the Universe tree.
436
+ AssetLeaf asset_leaf = 4;
437
+ }
438
+
439
+ message PushProofRequest {
440
+ // The ID of the asset to push the proof for.
441
+ UniverseKey key = 1;
442
+
443
+ // The universe server to push the proof to.
444
+ UniverseFederationServer server = 2;
445
+ }
446
+
447
+ message PushProofResponse {
448
+ // The ID of the asset a push was requested for.
449
+ UniverseKey key = 1;
450
+ }
451
+
452
+ message InfoRequest {
453
+ }
454
+
455
+ message InfoResponse {
456
+ // A pseudo-random runtime ID for the current instance of the Universe
457
+ // server, changes with each restart. Mainly used to identify identical
458
+ // servers when they are exposed under different hostnames/ports.
459
+ int64 runtime_id = 1;
460
+ }
461
+
462
+ enum UniverseSyncMode {
463
+ // A sync node that indicates that only new asset creation (minting) proofs
464
+ // should be synced.
465
+ SYNC_ISSUANCE_ONLY = 0;
466
+
467
+ // A syncing mode that indicates that all asset proofs should be synced.
468
+ // This includes normal transfers as well.
469
+ SYNC_FULL = 1;
470
+ }
471
+
472
+ message SyncTarget {
473
+ // The ID of the asset to sync.
474
+ ID id = 1;
475
+ }
476
+
477
+ message SyncRequest {
478
+ // TODO(roasbeef): accept connection type? so can pass along self-signed
479
+ // cert, also brontide based RPC handshake
480
+ string universe_host = 1;
481
+
482
+ // The sync mode. This determines what type of proofs are synced.
483
+ UniverseSyncMode sync_mode = 2;
484
+
485
+ // The set of assets to sync. If none are specified, then all assets are
486
+ // synced.
487
+ repeated SyncTarget sync_targets = 3;
488
+ }
489
+
490
+ message SyncedUniverse {
491
+ // The old Universe root for the synced asset.
492
+ UniverseRoot old_asset_root = 1;
493
+
494
+ // The new Universe root for the synced asset.
495
+ UniverseRoot new_asset_root = 2;
496
+
497
+ // The set of new asset leaves that were synced.
498
+ repeated AssetLeaf new_asset_leaves = 3;
499
+ }
500
+
501
+ message StatsRequest {
502
+ }
503
+
504
+ message SyncResponse {
505
+ // The set of synced asset Universes.
506
+ repeated SyncedUniverse synced_universes = 1;
507
+ }
508
+
509
+ message UniverseFederationServer {
510
+ // The host of the federation server, which is used to connect to the
511
+ // server to push proofs and sync new proofs.
512
+ string host = 1;
513
+
514
+ // The numeric ID of the federation server. This is used to identify
515
+ // existing servers when adding or deleting them from the federation.
516
+ int32 id = 2;
517
+ }
518
+
519
+ message ListFederationServersRequest {
520
+ }
521
+
522
+ message ListFederationServersResponse {
523
+ // The list of federation servers that make up the local Universe
524
+ // federation.
525
+ repeated UniverseFederationServer servers = 1;
526
+ }
527
+
528
+ message AddFederationServerRequest {
529
+ // The federation server to add to the local Universe federation.
530
+ repeated UniverseFederationServer servers = 1;
531
+ }
532
+
533
+ message AddFederationServerResponse {
534
+ }
535
+
536
+ message DeleteFederationServerRequest {
537
+ // The federation server to delete from the local Universe federation.
538
+ repeated UniverseFederationServer servers = 1;
539
+ }
540
+
541
+ message DeleteFederationServerResponse {
542
+ }
543
+
544
+ message StatsResponse {
545
+ int64 num_total_assets = 1;
546
+ int64 num_total_groups = 2;
547
+ int64 num_total_syncs = 3;
548
+ int64 num_total_proofs = 4;
549
+ }
550
+
551
+ enum AssetQuerySort {
552
+ SORT_BY_NONE = 0;
553
+
554
+ SORT_BY_ASSET_NAME = 1;
555
+
556
+ SORT_BY_ASSET_ID = 2;
557
+
558
+ SORT_BY_ASSET_TYPE = 3;
559
+
560
+ SORT_BY_TOTAL_SYNCS = 4;
561
+
562
+ SORT_BY_TOTAL_PROOFS = 5;
563
+
564
+ SORT_BY_GENESIS_HEIGHT = 6;
565
+
566
+ SORT_BY_TOTAL_SUPPLY = 7;
567
+ }
568
+
569
+ enum SortDirection {
570
+ SORT_DIRECTION_ASC = 0;
571
+
572
+ SORT_DIRECTION_DESC = 1;
573
+ }
574
+
575
+ enum AssetTypeFilter {
576
+ FILTER_ASSET_NONE = 0;
577
+
578
+ FILTER_ASSET_NORMAL = 1;
579
+
580
+ FILTER_ASSET_COLLECTIBLE = 2;
581
+ }
582
+
583
+ message AssetStatsQuery {
584
+ // The asset name filter. If this is empty, then all assets are returned.
585
+ string asset_name_filter = 1;
586
+
587
+ // The asset ID filter. If this is empty, then all assets are returned.
588
+ bytes asset_id_filter = 2;
589
+
590
+ // The asset type filter. If this is set to FILTER_ASSET_NONE, then all
591
+ // assets are returned. If set to FILTER_ASSET_NORMAL, then only normal
592
+ // assets are returned. If set to FILTER_ASSET_COLLECTIBLE, then only
593
+ // collectible assets are returned.
594
+ AssetTypeFilter asset_type_filter = 3;
595
+
596
+ // The sort order for the query. If this is set to SORT_BY_NONE, then the
597
+ // results are not sorted.
598
+ AssetQuerySort sort_by = 4;
599
+
600
+ // The offset for the page. This is used for pagination.
601
+ int32 offset = 5;
602
+
603
+ // The length limit for the page. This is used for pagination.
604
+ int32 limit = 6;
605
+
606
+ // The direction of the sort. If this is set to SORT_DIRECTION_ASC, then
607
+ // the results are sorted in ascending order. If set to
608
+ // SORT_DIRECTION_DESC, then the results are sorted in descending order.
609
+ SortDirection direction = 7;
610
+ }
611
+
612
+ message AssetStatsSnapshot {
613
+ // The group key of the asset group. If this is empty, then the asset is
614
+ // not part of a group.
615
+ bytes group_key = 1;
616
+
617
+ // The total supply of the asset group. If the asset is not part of an asset
618
+ // group then this is always zero.
619
+ int64 group_supply = 2;
620
+
621
+ // The group anchor that was used to group assets together into an asset
622
+ // group. This is only set if the asset is part of an asset group.
623
+ AssetStatsAsset group_anchor = 3;
624
+
625
+ // If the asset is not part of an asset group, then this is the asset the
626
+ // stats below refer to.
627
+ AssetStatsAsset asset = 4;
628
+
629
+ // The total number of syncs either for the asset group or the single asset
630
+ // if it is not part of a group.
631
+ int64 total_syncs = 5;
632
+
633
+ // The total number of proofs either for the asset group or the single asset
634
+ // if it is not part of a group.
635
+ int64 total_proofs = 6;
636
+ }
637
+
638
+ message AssetStatsAsset {
639
+ // The ID of the asset.
640
+ bytes asset_id = 1;
641
+
642
+ // The asset's genesis point, which is the outpoint of the genesis
643
+ // transaction that created the asset. This is a hex encoded string.
644
+ string genesis_point = 2;
645
+
646
+ // The total supply of the asset. This is the total number of units of the
647
+ // asset that have been issued.
648
+ int64 total_supply = 3;
649
+
650
+ // The human-readable name of the asset.
651
+ string asset_name = 4;
652
+
653
+ // The type of the asset. This can be either a normal asset or a collectible
654
+ // asset.
655
+ taprpc.AssetType asset_type = 5;
656
+
657
+ // The height of the block at which the asset was created.
658
+ int32 genesis_height = 6;
659
+
660
+ // The timestamp of the block at which the asset was created, in Unix epoch
661
+ // time (seconds).
662
+ int64 genesis_timestamp = 7;
663
+
664
+ // The anchor point of the asset, which is a human-readable string that
665
+ // represents the asset's anchor point in the blockchain.
666
+ string anchor_point = 8;
667
+
668
+ // The decimal display value for the asset. This is the number of decimal
669
+ // places that the asset can be divided into.
670
+ uint32 decimal_display = 9;
671
+ }
672
+
673
+ message UniverseAssetStats {
674
+ // The asset statistics snapshot for the queried assets.
675
+ repeated AssetStatsSnapshot asset_stats = 1;
676
+ }
677
+
678
+ message QueryEventsRequest {
679
+ // The start timestamp for the query, in Unix epoch time (seconds).
680
+ int64 start_timestamp = 1;
681
+
682
+ // The end timestamp for the query, in Unix epoch time (seconds).
683
+ int64 end_timestamp = 2;
684
+ }
685
+
686
+ message QueryEventsResponse {
687
+ // The list of grouped universe events that occurred within the specified
688
+ // time range. Each entry in the list represents a day, with the number of
689
+ // sync and new proof events that occurred on that day.
690
+ repeated GroupedUniverseEvents events = 1;
691
+ }
692
+
693
+ message GroupedUniverseEvents {
694
+ // The date the events occurred on, formatted as YYYY-MM-DD.
695
+ string date = 1;
696
+
697
+ // The number of sync events that occurred on this date.
698
+ uint64 sync_events = 2;
699
+
700
+ // The number of new proof events that occurred on this date.
701
+ uint64 new_proof_events = 3;
702
+ }
703
+
704
+ message SetFederationSyncConfigRequest {
705
+ // The global federation sync configs for the given proof types.
706
+ repeated GlobalFederationSyncConfig global_sync_configs = 1;
707
+
708
+ // The asset federation sync configs for the given universe IDs.
709
+ repeated AssetFederationSyncConfig asset_sync_configs = 2;
710
+ }
711
+
712
+ message SetFederationSyncConfigResponse {
713
+ }
714
+
715
+ // GlobalFederationSyncConfig is a global proof type specific configuration
716
+ // for universe federation syncing.
717
+ message GlobalFederationSyncConfig {
718
+ // proof_type is the universe proof type which this config applies to.
719
+ ProofType proof_type = 1;
720
+
721
+ // allow_sync_insert is a boolean that indicates whether leaves from
722
+ // universes of the given proof type have may be inserted via federation
723
+ // sync.
724
+ bool allow_sync_insert = 2;
725
+
726
+ // allow_sync_export is a boolean that indicates whether leaves from
727
+ // universes of the given proof type have may be exported via federation
728
+ // sync.
729
+ bool allow_sync_export = 3;
730
+ }
731
+
732
+ // AssetFederationSyncConfig is an asset universe specific configuration for
733
+ // federation syncing.
734
+ message AssetFederationSyncConfig {
735
+ // id is the ID of the universe to configure.
736
+ ID id = 1;
737
+
738
+ // allow_sync_insert is a boolean that indicates whether leaves from
739
+ // universes of the given proof type have may be inserted via federation
740
+ // sync.
741
+ bool allow_sync_insert = 2;
742
+
743
+ // allow_sync_export is a boolean that indicates whether leaves from
744
+ // universes of the given proof type have may be exported via federation
745
+ // sync.
746
+ bool allow_sync_export = 3;
747
+ }
748
+
749
+ message QueryFederationSyncConfigRequest {
750
+ // Target universe ID(s).
751
+ repeated ID id = 1;
752
+ }
753
+
754
+ message QueryFederationSyncConfigResponse {
755
+ // The global federation sync configs for the given proof types.
756
+ repeated GlobalFederationSyncConfig global_sync_configs = 1;
757
+
758
+ // The asset federation sync configs for the given universe IDs.
759
+ repeated AssetFederationSyncConfig asset_sync_configs = 2;
760
+ }
761
+
762
+ message IgnoreAssetOutPointRequest {
763
+ // The outpoint of the asset to ignore.
764
+ taprpc.AssetOutPoint asset_out_point = 1;
765
+
766
+ // The amount of asset units at the associated asset outpoint.
767
+ uint64 amount = 2;
768
+ }
769
+
770
+ message IgnoreAssetOutPointResponse {
771
+ // The key identifying the signed ignore outpoint leaf in the ignore supply
772
+ // commitment subtree.
773
+ bytes leaf_key = 1;
774
+
775
+ // The signed ignore outpoint leaf in the ignore supply commitment tree.
776
+ MerkleSumNode leaf = 2;
777
+ }
778
+
779
+ message UpdateSupplyCommitRequest {
780
+ // The unique identifier for the target asset group whose supply commitment
781
+ // is being updated.
782
+ oneof group_key {
783
+ // The 32-byte asset group key specified as raw bytes (gRPC only).
784
+ bytes group_key_bytes = 1;
785
+
786
+ // The 32-byte asset group key encoded as hex string (use this for
787
+ // REST).
788
+ string group_key_str = 2;
789
+ }
790
+ }
791
+
792
+ message UpdateSupplyCommitResponse {
793
+ }
794
+
795
+ message FetchSupplyCommitRequest {
796
+ // The unique identifier for the target asset group whose supply commitment
797
+ // is being fetched.
798
+ oneof group_key {
799
+ // The 32-byte asset group key specified as raw bytes (gRPC only).
800
+ bytes group_key_bytes = 1;
801
+
802
+ // The 32-byte asset group key encoded as hex string (use this for
803
+ // REST).
804
+ string group_key_str = 2;
805
+ }
806
+
807
+ // Specifies which supply commit to fetch.
808
+ oneof locator {
809
+ // Fetch the the supply commitment that created this new commitment
810
+ // output on chain.
811
+ taprpc.OutPoint commit_outpoint = 3;
812
+
813
+ // Fetch the supply commitment that spent the specified commitment
814
+ // output on chain to create a new supply commitment. This can be used
815
+ // to traverse the chain of supply commitments by watching the spend of
816
+ // the commitment output.
817
+ taprpc.OutPoint spent_commit_outpoint = 4;
818
+
819
+ // Fetch the very first supply commitment for the asset group. This
820
+ // returns the initial supply commitment that spent the pre-commitment
821
+ // output of the very first asset mint of a grouped asset (also known
822
+ // as the group anchor). This is useful as the starting point to fetch
823
+ // all supply commitments for a grouped asset one by one.
824
+ bool very_first = 5;
825
+
826
+ // Fetch the latest supply commitment for the asset group. This returns
827
+ // the most recent supply commitment that is anchored on chain for the
828
+ // asset group. This is useful to always get the current supply state
829
+ // of the asset group.
830
+ bool latest = 6;
831
+ }
832
+ }
833
+
834
+ message SupplyCommitSubtreeRoot {
835
+ // The type of the supply commit subtree.
836
+ string type = 1;
837
+
838
+ // The root node of the supply commit subtree.
839
+ MerkleSumNode root_node = 2;
840
+
841
+ // The leaf key which locates the subtree leaf node in the supply commit
842
+ // tree.
843
+ bytes supply_tree_leaf_key = 3;
844
+
845
+ // The inclusion proof for the supply commit subtree root node.
846
+ bytes supply_tree_inclusion_proof = 4;
847
+ }
848
+
849
+ message FetchSupplyCommitResponse {
850
+ // The supply commitment chain data that contains both the commitment and
851
+ // chain proof information.
852
+ SupplyCommitChainData chain_data = 1;
853
+
854
+ // The total number of satoshis in on-chain fees paid by the supply
855
+ // commitment transaction.
856
+ int64 tx_chain_fees_sats = 2;
857
+
858
+ // The root of the issuance tree for the specified asset.
859
+ SupplyCommitSubtreeRoot issuance_subtree_root = 3;
860
+
861
+ // The root of the burn tree for the specified asset.
862
+ SupplyCommitSubtreeRoot burn_subtree_root = 4;
863
+
864
+ // The root of the ignore tree for the specified asset.
865
+ SupplyCommitSubtreeRoot ignore_subtree_root = 5;
866
+
867
+ // The issuance leaves that were added by this supply commitment. Does not
868
+ // include leaves that were already present in the issuance subtree before
869
+ // the block height at which this supply commitment was anchored.
870
+ repeated SupplyLeafEntry issuance_leaves = 6;
871
+
872
+ // The burn leaves that were added by this supply commitment. Does not
873
+ // include leaves that were already present in the burn subtree before
874
+ // the block height at which this supply commitment was anchored.
875
+ repeated SupplyLeafEntry burn_leaves = 7;
876
+
877
+ // The ignore leaves that were added by this supply commitment. Does not
878
+ // include leaves that were already present in the ignore subtree before
879
+ // the block height at which this supply commitment was anchored.
880
+ repeated SupplyLeafEntry ignore_leaves = 8;
881
+
882
+ // The total outstanding supply of the asset after applying all the supply
883
+ // changes (issuance, burn, ignore) included in this supply commitment.
884
+ uint64 total_outstanding_supply = 9;
885
+
886
+ // The outpoint of the previous commitment that this new commitment is
887
+ // spending. This must be set unless this is the very first supply
888
+ // commitment of a grouped asset.
889
+ taprpc.OutPoint spent_commitment_outpoint = 10;
890
+
891
+ // A map of block height to supply leaf block header for all block heights
892
+ // referenced in supply leaves.
893
+ map<uint32, SupplyLeafBlockHeader> block_headers = 11;
894
+ }
895
+
896
+ message FetchSupplyLeavesRequest {
897
+ // The unique identifier for the target asset group whose supply leaves are
898
+ // being fetched.
899
+ oneof group_key {
900
+ // The 32-byte asset group key specified as raw bytes (gRPC only).
901
+ bytes group_key_bytes = 1;
902
+
903
+ // The 32-byte asset group key encoded as hex string (use this for
904
+ // REST).
905
+ string group_key_str = 2;
906
+ }
907
+
908
+ // The start block height for the range of supply leaves to fetch.
909
+ uint32 block_height_start = 3;
910
+
911
+ // The end block height for the range of supply leaves to fetch.
912
+ uint32 block_height_end = 4;
913
+
914
+ // Optional: A list of issuance leaf keys. For each key in this list,
915
+ // the endpoint will generate and return an inclusion proof.
916
+ repeated bytes issuance_leaf_keys = 5;
917
+
918
+ // Optional: A list of burn leaf keys. For each key in this list,
919
+ // the endpoint will generate and return an inclusion proof.
920
+ repeated bytes burn_leaf_keys = 6;
921
+
922
+ // Optional: A list of ignore leaf keys. For each key in this list, the
923
+ // endpoint will generate and return an inclusion proof.
924
+ repeated bytes ignore_leaf_keys = 7;
925
+ }
926
+
927
+ // SupplyLeafKey identifies a supply leaf entry. It contains the components
928
+ // used to derive the key, which is computed as a hash of these fields.
929
+ message SupplyLeafKey {
930
+ // The outpoint associated with the supply leaf.
931
+ Outpoint outpoint = 1;
932
+
933
+ // The script key of the supply leaf. This is the script key of the asset
934
+ // point.
935
+ bytes script_key = 2;
936
+
937
+ // The asset ID associated with the supply leaf. This is only set for
938
+ // ignore type supply leaves.
939
+ bytes asset_id = 3;
940
+ }
941
+
942
+ message SupplyLeafEntry {
943
+ // The key that identifies the supply leaf in the supply commitment subtree.
944
+ SupplyLeafKey leaf_key = 1;
945
+
946
+ // The merkle sum node representing the supply leaf in the supply commitment
947
+ // subtree.
948
+ MerkleSumNode leaf_node = 2;
949
+
950
+ // The block height at which the supply leaf was created.
951
+ uint32 block_height = 3;
952
+
953
+ // The raw serialized bytes of the supply leaf.
954
+ bytes raw_leaf = 4;
955
+ }
956
+
957
+ message SupplyLeafBlockHeader {
958
+ // Block header timestamp in seconds since unix epoch.
959
+ int64 timestamp = 1;
960
+
961
+ // 32-byte block header hash.
962
+ bytes hash = 2;
963
+ }
964
+
965
+ message FetchSupplyLeavesResponse {
966
+ repeated SupplyLeafEntry issuance_leaves = 1;
967
+ repeated SupplyLeafEntry burn_leaves = 2;
968
+ repeated SupplyLeafEntry ignore_leaves = 3;
969
+
970
+ // Inclusion proofs for each issuance leaf key provided in the request.
971
+ // Each entry corresponds to the key at the same index in
972
+ // `issuance_leaf_keys`.
973
+ repeated bytes issuance_leaf_inclusion_proofs = 4;
974
+
975
+ // Inclusion proofs for each burn leaf key provided in the request.
976
+ // Each entry corresponds to the key at the same index in `burn_leaf_keys`.
977
+ repeated bytes burn_leaf_inclusion_proofs = 5;
978
+
979
+ // Inclusion proofs for each ignored leaf key provided in the request.
980
+ // Each entry corresponds to the key at the same index in
981
+ // `ignore_leaf_keys`.
982
+ repeated bytes ignore_leaf_inclusion_proofs = 6;
983
+
984
+ // A map of block height to supply leaf block header for all block heights
985
+ // referenced in supply leaves.
986
+ map<uint32, SupplyLeafBlockHeader> block_headers = 7;
987
+ }
988
+
989
+ // SupplyCommitChainData represents the on-chain artifacts for a supply
990
+ // commitment update.
991
+ message SupplyCommitChainData {
992
+ // The raw transaction that created the root commitment.
993
+ bytes txn = 1;
994
+
995
+ // The index of the output in the transaction where the commitment resides.
996
+ uint32 tx_out_idx = 2;
997
+
998
+ // The internal key used to create the commitment output.
999
+ bytes internal_key = 3;
1000
+
1001
+ // The taproot output key used to create the commitment output.
1002
+ bytes output_key = 4;
1003
+
1004
+ // The root hash of the supply tree that contains the set of
1005
+ // sub-commitments. The sum value of this tree is the outstanding supply
1006
+ // value.
1007
+ bytes supply_root_hash = 5;
1008
+
1009
+ // The sum value of the supply root tree, representing the outstanding
1010
+ // supply amount.
1011
+ uint64 supply_root_sum = 6;
1012
+
1013
+ // The block header of the block that contains the supply commitment
1014
+ // transaction.
1015
+ bytes block_header = 7;
1016
+
1017
+ // The hash of the block that contains the commitment.
1018
+ bytes block_hash = 8;
1019
+
1020
+ // The block height of the block that contains the supply commitment
1021
+ // transaction.
1022
+ uint32 block_height = 9;
1023
+
1024
+ // The merkle proof that proves that the supply commitment transaction is
1025
+ // included in the block.
1026
+ bytes tx_block_merkle_proof = 10;
1027
+
1028
+ // The index of the supply commitment transaction in the block.
1029
+ uint32 tx_index = 11;
1030
+
1031
+ // The outpoint in the transaction where the commitment resides.
1032
+ string commit_outpoint = 12;
1033
+ }
1034
+
1035
+ message InsertSupplyCommitRequest {
1036
+ // The unique identifier for the target asset group whose supply commitment
1037
+ // is being inserted.
1038
+ oneof group_key {
1039
+ // The 32-byte asset group key specified as raw bytes (gRPC only).
1040
+ bytes group_key_bytes = 1;
1041
+
1042
+ // The 32-byte asset group key encoded as hex string (use this for
1043
+ // REST).
1044
+ string group_key_str = 2;
1045
+ }
1046
+
1047
+ // The supply commitment chain data that contains both the commitment and
1048
+ // chain proof information.
1049
+ SupplyCommitChainData chain_data = 3;
1050
+
1051
+ // The outpoint of the previous commitment that this new commitment is
1052
+ // spending. This must be set unless this is the very first supply
1053
+ // commitment of a grouped asset.
1054
+ taprpc.OutPoint spent_commitment_outpoint = 4;
1055
+
1056
+ // The supply leaves that represent the supply changes for the asset group.
1057
+ repeated SupplyLeafEntry issuance_leaves = 5;
1058
+ repeated SupplyLeafEntry burn_leaves = 6;
1059
+ repeated SupplyLeafEntry ignore_leaves = 7;
1060
+ }
1061
+
1062
+ message InsertSupplyCommitResponse {
1063
+ }