@dashevo/dapi-grpc 4.2.0-dev.9 → 5.0.0-beta.2
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.
- package/Cargo.toml +1 -1
- package/README.md +32 -0
- package/build.rs +31 -2
- package/clients/drive/v0/nodejs/drive_pbjs.js +30374 -7055
- package/clients/platform/v0/nodejs/platform_pbjs.js +30374 -7055
- package/clients/platform/v0/nodejs/platform_protoc.js +29961 -6464
- package/clients/platform/v0/web/platform_pb.d.ts +3106 -49
- package/clients/platform/v0/web/platform_pb.js +29961 -6464
- package/clients/platform/v0/web/platform_pb_service.d.ts +247 -0
- package/clients/platform/v0/web/platform_pb_service.js +520 -0
- package/codegen.json +31 -0
- package/package.json +4 -3
- package/protos/platform/v0/platform.proto +769 -3
- package/scripts/build.sh +61 -247
- package/scripts/check-packed-clients.py +32 -0
- package/scripts/patch-protobuf-js.sh +11 -6
- package/scripts/setup-codegen.py +74 -0
- package/test/unit/shielded-requests.spec.js +51 -0
|
@@ -18,6 +18,8 @@ service Platform {
|
|
|
18
18
|
returns (GetIdentityNonceResponse);
|
|
19
19
|
rpc getIdentityContractNonce(GetIdentityContractNonceRequest)
|
|
20
20
|
returns (GetIdentityContractNonceResponse);
|
|
21
|
+
rpc getIdentityKeysRemainingBudgets(GetIdentityKeysRemainingBudgetsRequest)
|
|
22
|
+
returns (GetIdentityKeysRemainingBudgetsResponse);
|
|
21
23
|
rpc getIdentityBalance(GetIdentityBalanceRequest)
|
|
22
24
|
returns (GetIdentityBalanceResponse);
|
|
23
25
|
rpc getIdentitiesBalances(GetIdentitiesBalancesRequest)
|
|
@@ -33,8 +35,33 @@ service Platform {
|
|
|
33
35
|
rpc getDataContract(GetDataContractRequest) returns (GetDataContractResponse);
|
|
34
36
|
rpc getDataContractHistory(GetDataContractHistoryRequest)
|
|
35
37
|
returns (GetDataContractHistoryResponse);
|
|
38
|
+
rpc getDataContractsLatestVersions(GetDataContractsLatestVersionsRequest)
|
|
39
|
+
returns (GetDataContractsLatestVersionsResponse);
|
|
36
40
|
rpc getDataContracts(GetDataContractsRequest)
|
|
37
41
|
returns (GetDataContractsResponse);
|
|
42
|
+
rpc getDataContractsByRange(GetDataContractsByRangeRequest)
|
|
43
|
+
returns (GetDataContractsResponse);
|
|
44
|
+
rpc getContractGroupInfo(GetContractGroupInfoRequest)
|
|
45
|
+
returns (GetContractGroupInfoResponse);
|
|
46
|
+
rpc getContractGroupMembers(GetContractGroupMembersRequest)
|
|
47
|
+
returns (GetContractGroupMembersResponse);
|
|
48
|
+
rpc getContractGroupsForContract(GetContractGroupsForContractRequest)
|
|
49
|
+
returns (GetContractGroupsForContractResponse);
|
|
50
|
+
rpc getContractModerationStatus(GetContractModerationStatusRequest)
|
|
51
|
+
returns (GetContractModerationStatusResponse);
|
|
52
|
+
rpc getContractModerationEntries(GetContractModerationEntriesRequest)
|
|
53
|
+
returns (GetContractModerationEntriesResponse);
|
|
54
|
+
rpc getContractDocumentRemovals(GetContractDocumentRemovalsRequest)
|
|
55
|
+
returns (GetContractDocumentRemovalsResponse);
|
|
56
|
+
rpc getContractTeamActions(GetContractTeamActionsRequest)
|
|
57
|
+
returns (GetContractTeamActionsResponse);
|
|
58
|
+
rpc getContractTeamActionSigners(GetContractTeamActionSignersRequest)
|
|
59
|
+
returns (GetContractTeamActionSignersResponse);
|
|
60
|
+
rpc getContractModerationActionCounts(
|
|
61
|
+
GetContractModerationActionCountsRequest)
|
|
62
|
+
returns (GetContractModerationActionCountsResponse);
|
|
63
|
+
rpc getContractFeePots(GetContractFeePotsRequest)
|
|
64
|
+
returns (GetContractFeePotsResponse);
|
|
38
65
|
rpc getDocumentHistory(GetDocumentHistoryRequest)
|
|
39
66
|
returns (GetDocumentHistoryResponse);
|
|
40
67
|
rpc getDocuments(GetDocumentsRequest) returns (GetDocumentsResponse);
|
|
@@ -263,6 +290,40 @@ message GetIdentityContractNonceResponse {
|
|
|
263
290
|
oneof version { GetIdentityContractNonceResponseV0 v0 = 1; }
|
|
264
291
|
}
|
|
265
292
|
|
|
293
|
+
// What is left of the budgets of keys of one identity. A key may carry a
|
|
294
|
+
// total budget (protocol version 14); the key itself never changes, so what
|
|
295
|
+
// remains of it is tracked next to it and read with this query.
|
|
296
|
+
message GetIdentityKeysRemainingBudgetsRequest {
|
|
297
|
+
message GetIdentityKeysRemainingBudgetsRequestV0 {
|
|
298
|
+
bytes identity_id = 1; // ID of the identity
|
|
299
|
+
repeated uint32 key_ids = 2; // IDs of the keys to look up, at least one
|
|
300
|
+
bool prove = 3; // Flag to request a proof as the response
|
|
301
|
+
}
|
|
302
|
+
oneof version { GetIdentityKeysRemainingBudgetsRequestV0 v0 = 1; }
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
message GetIdentityKeysRemainingBudgetsResponse {
|
|
306
|
+
message GetIdentityKeysRemainingBudgetsResponseV0 {
|
|
307
|
+
message KeyRemainingBudgetEntry {
|
|
308
|
+
uint32 key_id = 1; // ID of the key
|
|
309
|
+
// Credits left of the key's total budget. Absent when the key has no
|
|
310
|
+
// budget (or does not exist). Zero means the key can no longer sign.
|
|
311
|
+
optional uint64 remaining_budget = 2 [ jstype = JS_STRING ];
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
message KeysRemainingBudgets {
|
|
315
|
+
repeated KeyRemainingBudgetEntry entries = 1; // One entry per requested key
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
oneof result {
|
|
319
|
+
KeysRemainingBudgets keys_remaining_budgets = 1; // The remaining budgets
|
|
320
|
+
Proof proof = 2; // Proof of the remaining budgets, if requested
|
|
321
|
+
}
|
|
322
|
+
ResponseMetadata metadata = 3; // Metadata about the blockchain state
|
|
323
|
+
}
|
|
324
|
+
oneof version { GetIdentityKeysRemainingBudgetsResponseV0 v0 = 1; }
|
|
325
|
+
}
|
|
326
|
+
|
|
266
327
|
message GetIdentityBalanceResponse {
|
|
267
328
|
|
|
268
329
|
message GetIdentityBalanceResponseV0 {
|
|
@@ -497,6 +558,584 @@ message GetDataContractResponse {
|
|
|
497
558
|
oneof version { GetDataContractResponseV0 v0 = 1; }
|
|
498
559
|
}
|
|
499
560
|
|
|
561
|
+
// Returns the current version number of each requested data contract: the
|
|
562
|
+
// cheap way for a client to check that the contracts it already holds are
|
|
563
|
+
// still current. Every distinct requested id gets an entry; an id no contract has gets
|
|
564
|
+
// an entry without `version`. Serialized contracts are added only when
|
|
565
|
+
// `include_contracts` is set.
|
|
566
|
+
//
|
|
567
|
+
// From protocol version 14 every contract carries a four-byte version item
|
|
568
|
+
// beside it in state. Without `include_contracts`, the unproved form answers
|
|
569
|
+
// from Drive's contract cache or that item without loading a contract, and
|
|
570
|
+
// the proof covers the items, a few hundred bytes of hash path per contract.
|
|
571
|
+
// With `include_contracts`, and on earlier protocol versions, the unproved
|
|
572
|
+
// form reads the contracts through the cache and the proof is the
|
|
573
|
+
// multi-contract proof `getDataContracts` returns, which carries the
|
|
574
|
+
// contracts.
|
|
575
|
+
message GetDataContractsLatestVersionsRequest {
|
|
576
|
+
message GetDataContractsLatestVersionsRequestV0 {
|
|
577
|
+
repeated bytes ids =
|
|
578
|
+
1; // The IDs of the data contracts, at least one and at most 100
|
|
579
|
+
bool include_contracts =
|
|
580
|
+
2; // When set, found entries also carry the serialized contract
|
|
581
|
+
bool prove = 3; // Flag to request a proof as the response
|
|
582
|
+
}
|
|
583
|
+
oneof version { GetDataContractsLatestVersionsRequestV0 v0 = 1; }
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
message GetDataContractsLatestVersionsResponse {
|
|
587
|
+
message DataContractLatestVersionEntry {
|
|
588
|
+
bytes identifier = 1; // The requested contract id
|
|
589
|
+
optional uint32 version =
|
|
590
|
+
2; // The contract's current version number; absent when no contract has this id
|
|
591
|
+
optional bytes data_contract =
|
|
592
|
+
3; // The serialized contract, only when `include_contracts` was set and the contract exists
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
message DataContractsLatestVersions {
|
|
596
|
+
repeated DataContractLatestVersionEntry entries =
|
|
597
|
+
1; // One entry per requested contract id
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
message GetDataContractsLatestVersionsResponseV0 {
|
|
601
|
+
oneof result {
|
|
602
|
+
DataContractsLatestVersions data_contracts_latest_versions =
|
|
603
|
+
1; // The current versions, and the contracts if requested
|
|
604
|
+
Proof proof =
|
|
605
|
+
2; // Cryptographic proof of the data contracts, if requested
|
|
606
|
+
}
|
|
607
|
+
ResponseMetadata metadata = 3; // Metadata about the blockchain state
|
|
608
|
+
}
|
|
609
|
+
oneof version { GetDataContractsLatestVersionsResponseV0 v0 = 1; }
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
// A document type that belongs to a contract group: the contract and the
|
|
613
|
+
// document type name.
|
|
614
|
+
message ContractGroupDocumentTypeMember {
|
|
615
|
+
bytes contract_id = 1; // The contract the document type belongs to
|
|
616
|
+
string document_type_name = 2; // The document type name within the contract
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
// A token that belongs to a contract group: the contract and the token's
|
|
620
|
+
// position within it.
|
|
621
|
+
message ContractGroupTokenMember {
|
|
622
|
+
bytes contract_id = 1; // The contract the token belongs to
|
|
623
|
+
uint32 token_position = 2; // The token's position in the contract (u16)
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
message GetContractGroupInfoRequest {
|
|
627
|
+
message GetContractGroupInfoRequestV0 {
|
|
628
|
+
bytes contract_group_id = 1; // The 32-byte id of the contract group
|
|
629
|
+
bool prove = 2; // Flag to request a proof as the response
|
|
630
|
+
}
|
|
631
|
+
oneof version { GetContractGroupInfoRequestV0 v0 = 1; }
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
message GetContractGroupInfoResponse {
|
|
635
|
+
message ContractGroupInfo {
|
|
636
|
+
bytes owner_id = 1; // The identity that registered the group and owns it
|
|
637
|
+
repeated bytes admin_ids =
|
|
638
|
+
2; // Identities that may add members besides the owner; empty for a
|
|
639
|
+
// single owner
|
|
640
|
+
optional string name = 3; // The group's name, when it has one
|
|
641
|
+
optional string description = 4; // The group's description, when it has one
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
message GetContractGroupInfoResponseV0 {
|
|
645
|
+
oneof result {
|
|
646
|
+
ContractGroupInfo contract_group_info =
|
|
647
|
+
1; // The group's stored information; absent when no such group exists
|
|
648
|
+
Proof proof = 2; // Cryptographic proof of the information, if requested
|
|
649
|
+
}
|
|
650
|
+
ResponseMetadata metadata = 3; // Metadata about the blockchain state
|
|
651
|
+
}
|
|
652
|
+
oneof version { GetContractGroupInfoResponseV0 v0 = 1; }
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
message GetContractGroupMembersRequest {
|
|
656
|
+
// Contracts that belong to the group as a whole, in contract id order.
|
|
657
|
+
message ContractMembersQuery {
|
|
658
|
+
optional bytes start_after =
|
|
659
|
+
1; // 32-byte contract id; the page starts after it
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
// Document types that belong to the group, in contract id then document
|
|
663
|
+
// type name order.
|
|
664
|
+
message DocumentTypeMembersQuery {
|
|
665
|
+
optional ContractGroupDocumentTypeMember start_after =
|
|
666
|
+
1; // The page starts after this document type
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
// Tokens that belong to the group, in contract id then token position order.
|
|
670
|
+
message TokenMembersQuery {
|
|
671
|
+
optional ContractGroupTokenMember start_after =
|
|
672
|
+
1; // The page starts after this token
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
message GetContractGroupMembersRequestV0 {
|
|
676
|
+
bytes contract_group_id = 1; // The 32-byte id of the contract group
|
|
677
|
+
oneof members {
|
|
678
|
+
ContractMembersQuery contracts = 2; // Read the member contracts
|
|
679
|
+
DocumentTypeMembersQuery document_types = 3; // Read the member document types
|
|
680
|
+
TokenMembersQuery tokens = 4; // Read the member tokens
|
|
681
|
+
}
|
|
682
|
+
optional uint32 limit =
|
|
683
|
+
5; // Maximum number of members to return, 1..=100; absent means 100
|
|
684
|
+
bool prove = 6; // Flag to request a proof as the response
|
|
685
|
+
}
|
|
686
|
+
oneof version { GetContractGroupMembersRequestV0 v0 = 1; }
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
message GetContractGroupMembersResponse {
|
|
690
|
+
message ContractMembers {
|
|
691
|
+
repeated bytes contract_ids = 1; // Member contracts, in contract id order
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
message DocumentTypeMembers {
|
|
695
|
+
repeated ContractGroupDocumentTypeMember document_types =
|
|
696
|
+
1; // Member document types, in contract id then name order
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
message TokenMembers {
|
|
700
|
+
repeated ContractGroupTokenMember tokens =
|
|
701
|
+
1; // Member tokens, in contract id then position order
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
message GetContractGroupMembersResponseV0 {
|
|
705
|
+
oneof result {
|
|
706
|
+
ContractMembers contracts = 1; // One page of member contracts
|
|
707
|
+
DocumentTypeMembers document_types = 2; // One page of member document types
|
|
708
|
+
TokenMembers tokens = 3; // One page of member tokens
|
|
709
|
+
Proof proof = 4; // Cryptographic proof of the page, if requested
|
|
710
|
+
}
|
|
711
|
+
ResponseMetadata metadata = 5; // Metadata about the blockchain state
|
|
712
|
+
}
|
|
713
|
+
oneof version { GetContractGroupMembersResponseV0 v0 = 1; }
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
// One of the moderation lists a moderated data contract may keep (protocol version 14).
|
|
717
|
+
enum ContractModerationList {
|
|
718
|
+
CONTRACT_MODERATION_LIST_UNSPECIFIED = 0; // Not a list: a request that leaves the field out is refused
|
|
719
|
+
CONTRACT_MODERATION_LIST_BANLIST = 1; // Identities barred until an unban
|
|
720
|
+
CONTRACT_MODERATION_LIST_SUSPENSIONS = 2; // Identities barred until a block time
|
|
721
|
+
CONTRACT_MODERATION_LIST_WARNINGS = 3; // Identities warned, barred from nothing
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
// A document a moderation reason is about.
|
|
725
|
+
message ContractModerationDocument {
|
|
726
|
+
string document_type_name = 1; // The document type, on the moderated contract
|
|
727
|
+
bytes document_id = 2; // The 32-byte id of the document
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
// Why a moderator banned, suspended or warned an identity, or deleted a
|
|
731
|
+
// document. Nothing checks what a moderator writes, and the documents cited
|
|
732
|
+
// are not looked up, except the reason document a seated elected team names.
|
|
733
|
+
message ContractModerationReason {
|
|
734
|
+
optional uint32 code =
|
|
735
|
+
1; // Reserved for the ban codes a contract may declare in a later
|
|
736
|
+
// protocol version; a u16, expected unset today, never checked
|
|
737
|
+
string text = 2; // Free text, at most 1024 bytes of UTF-8, may be empty
|
|
738
|
+
repeated ContractModerationDocument documents =
|
|
739
|
+
3; // The documents the reason is about, at most 16, none twice
|
|
740
|
+
optional bytes reason_document_id =
|
|
741
|
+
4; // The 32-byte id of the moderation charters contract's `reason`
|
|
742
|
+
// document the action is taken on; one the seated team's proposal
|
|
743
|
+
// lists for a seated elected team's action, unchecked otherwise
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
// One warning an identity carries on a contract's warning list.
|
|
747
|
+
message ContractWarning {
|
|
748
|
+
uint64 warned_at = 1; // The time of the block that issued it, in milliseconds
|
|
749
|
+
ContractModerationReason reason = 2; // Why
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
message GetContractModerationStatusRequest {
|
|
753
|
+
message GetContractModerationStatusRequestV0 {
|
|
754
|
+
bytes contract_id = 1; // The 32-byte id of the moderated contract
|
|
755
|
+
bytes identity_id = 2; // The 32-byte id of the identity
|
|
756
|
+
repeated ContractModerationList lists =
|
|
757
|
+
3; // The lists to read, which the contract's config must declare; at
|
|
758
|
+
// least one, no repeats
|
|
759
|
+
bool prove = 4; // Flag to request a proof as the response
|
|
760
|
+
}
|
|
761
|
+
oneof version { GetContractModerationStatusRequestV0 v0 = 1; }
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
message GetContractModerationStatusResponse {
|
|
765
|
+
// The identity's status on the lists the request named, and on no other: a
|
|
766
|
+
// list that was not read says nothing, so its field is left unset.
|
|
767
|
+
message ContractModerationStatus {
|
|
768
|
+
optional bool banned =
|
|
769
|
+
1; // Set only when the banlist was read: the identity is on it
|
|
770
|
+
optional uint64 suspended_until =
|
|
771
|
+
2; // The block time, in milliseconds, until which the identity is
|
|
772
|
+
// suspended; a lapsed suspension stays until it is swept. Unset
|
|
773
|
+
// when the identity is not suspended or the list was not read
|
|
774
|
+
repeated ContractModerationList lists =
|
|
775
|
+
3; // The lists this status covers, as the request named them
|
|
776
|
+
optional ContractModerationReason ban_reason =
|
|
777
|
+
4; // Set when the identity is banned: why
|
|
778
|
+
optional ContractModerationReason suspension_reason =
|
|
779
|
+
5; // Set when the identity is suspended: why
|
|
780
|
+
repeated ContractWarning warnings =
|
|
781
|
+
6; // When the warning list was read: the identity's warnings, oldest
|
|
782
|
+
// first; empty when it carries none
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
message GetContractModerationStatusResponseV0 {
|
|
786
|
+
oneof result {
|
|
787
|
+
ContractModerationStatus status = 1; // The identity's status on the lists read
|
|
788
|
+
Proof proof = 2; // Cryptographic proof of the status, if requested
|
|
789
|
+
}
|
|
790
|
+
ResponseMetadata metadata = 3; // Metadata about the blockchain state
|
|
791
|
+
}
|
|
792
|
+
oneof version { GetContractModerationStatusResponseV0 v0 = 1; }
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
message GetContractModerationEntriesRequest {
|
|
796
|
+
message GetContractModerationEntriesRequestV0 {
|
|
797
|
+
bytes contract_id = 1; // The 32-byte id of the moderated contract
|
|
798
|
+
ContractModerationList list = 2; // The list to read, which the contract's config must declare
|
|
799
|
+
optional bytes start_after =
|
|
800
|
+
3; // 32-byte identity id; the page starts after it
|
|
801
|
+
optional uint32 limit =
|
|
802
|
+
4; // Maximum number of entries to return, from 1 to the protocol's
|
|
803
|
+
// max_returned_elements (100); absent means that maximum
|
|
804
|
+
bool prove = 5; // Flag to request a proof as the response
|
|
805
|
+
}
|
|
806
|
+
oneof version { GetContractModerationEntriesRequestV0 v0 = 1; }
|
|
807
|
+
}
|
|
808
|
+
|
|
809
|
+
message GetContractModerationEntriesResponse {
|
|
810
|
+
message ContractModerationEntry {
|
|
811
|
+
bytes identity_id = 1; // The identity on the list
|
|
812
|
+
optional uint64 until =
|
|
813
|
+
2; // For a suspension list entry: the block time, in milliseconds, at
|
|
814
|
+
// which it lapses
|
|
815
|
+
ContractModerationReason reason =
|
|
816
|
+
3; // Why the identity is on the list: the ban's reason or the
|
|
817
|
+
// suspension's. Unset for a warning list entry, whose reasons
|
|
818
|
+
// are its warnings'
|
|
819
|
+
repeated ContractWarning warnings =
|
|
820
|
+
4; // For a warning list entry: every warning the identity carries,
|
|
821
|
+
// oldest first; the latest is why it is on the list
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
message ContractModerationEntries {
|
|
825
|
+
repeated ContractModerationEntry entries = 1; // The page, in identity id order
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
message GetContractModerationEntriesResponseV0 {
|
|
829
|
+
oneof result {
|
|
830
|
+
ContractModerationEntries entries = 1; // One page of the list
|
|
831
|
+
Proof proof = 2; // Cryptographic proof of the page, if requested
|
|
832
|
+
}
|
|
833
|
+
ResponseMetadata metadata = 3; // Metadata about the blockchain state
|
|
834
|
+
}
|
|
835
|
+
oneof version { GetContractModerationEntriesResponseV0 v0 = 1; }
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
// The records of the documents a contract's moderators deleted, within one
|
|
839
|
+
// document type whose documents they may delete (`moderatorAbilities.delete`):
|
|
840
|
+
// the ones of the document ids named, or one page in document id order.
|
|
841
|
+
message GetContractDocumentRemovalsRequest {
|
|
842
|
+
message DocumentIds {
|
|
843
|
+
repeated bytes document_ids =
|
|
844
|
+
1; // 32-byte document ids, from 1 to the protocol's
|
|
845
|
+
// max_returned_elements (100), none twice; an id with no record is
|
|
846
|
+
// left out of the response, and proved absent when a proof is asked
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
message Page {
|
|
850
|
+
optional bytes start_after =
|
|
851
|
+
1; // 32-byte document id; the page starts after it
|
|
852
|
+
optional uint32 limit =
|
|
853
|
+
2; // Maximum number of records to return, from 1 to the protocol's
|
|
854
|
+
// max_returned_elements (100); absent means that maximum
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
message GetContractDocumentRemovalsRequestV0 {
|
|
858
|
+
bytes contract_id = 1; // The 32-byte id of the moderated contract
|
|
859
|
+
string document_type_name =
|
|
860
|
+
2; // The document type, which must let moderators delete its documents
|
|
861
|
+
oneof selection {
|
|
862
|
+
DocumentIds document_ids = 3; // The records of these documents
|
|
863
|
+
Page page = 4; // One page of the type's records
|
|
864
|
+
}
|
|
865
|
+
bool prove = 5; // Flag to request a proof as the response
|
|
866
|
+
}
|
|
867
|
+
oneof version { GetContractDocumentRemovalsRequestV0 v0 = 1; }
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
message GetContractDocumentRemovalsResponse {
|
|
871
|
+
message ContractDocumentRestoration {
|
|
872
|
+
bytes moderator_id =
|
|
873
|
+
1; // The contract owner or moderator that restored the document
|
|
874
|
+
uint64 restored_at =
|
|
875
|
+
2; // The time of the block that restored it, in milliseconds
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
message ContractDocumentRemoval {
|
|
879
|
+
bytes document_id = 1; // The id the removed document had
|
|
880
|
+
bytes document_owner_id = 2; // The identity that owned it
|
|
881
|
+
bytes moderator_id = 3; // The contract owner or moderator that removed it
|
|
882
|
+
uint64 removed_at =
|
|
883
|
+
4; // The time of the block that removed it, in milliseconds
|
|
884
|
+
ContractModerationReason reason = 5; // Why the moderator removed it
|
|
885
|
+
bytes document_hash =
|
|
886
|
+
6; // A 32-byte double SHA-256 of the document as it was serialized
|
|
887
|
+
// under its document type when it was removed: what a restore must
|
|
888
|
+
// bring back byte for byte
|
|
889
|
+
ContractDocumentRestoration restoration =
|
|
890
|
+
7; // Set once a moderator restored the document, which is then live
|
|
891
|
+
// again as it was; absent while the removal stands
|
|
892
|
+
bytes kept_fields =
|
|
893
|
+
8; // The values the record keeps of the document, as the record stores
|
|
894
|
+
// them: for each path its document type lists under
|
|
895
|
+
// moderatorAbilities.deleteKeepsFields, in the list's order, 0 when
|
|
896
|
+
// the document held no value there, or 1 and the value encoded as
|
|
897
|
+
// the document encodes its properties. Read under the contract's
|
|
898
|
+
// document type, as a document is. Empty when the type keeps none
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
message ContractDocumentRemovals {
|
|
902
|
+
repeated ContractDocumentRemoval removals =
|
|
903
|
+
1; // The records, in document id order
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
message GetContractDocumentRemovalsResponseV0 {
|
|
907
|
+
oneof result {
|
|
908
|
+
ContractDocumentRemovals removals = 1; // The records read
|
|
909
|
+
Proof proof = 2; // Cryptographic proof of the records, if requested
|
|
910
|
+
}
|
|
911
|
+
ResponseMetadata metadata = 3; // Metadata about the blockchain state
|
|
912
|
+
}
|
|
913
|
+
oneof version { GetContractDocumentRemovalsResponseV0 v0 = 1; }
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
message GetContractTeamActionsRequest {
|
|
917
|
+
enum ActionStatus {
|
|
918
|
+
ACTIVE = 0; // Actions still gathering approvals
|
|
919
|
+
CLOSED = 1; // Actions whose approvals met their rule, which ran
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
message StartAtActionId {
|
|
923
|
+
bytes start_action_id = 1; // 32-byte action id the page starts at
|
|
924
|
+
bool start_action_id_included = 2; // Whether the page includes that action
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
message GetContractTeamActionsRequestV0 {
|
|
928
|
+
bytes contract_id =
|
|
929
|
+
1; // The 32-byte id of the elected contract whose seated moderation
|
|
930
|
+
// team votes on the actions
|
|
931
|
+
ActionStatus status = 2; // Active or closed actions
|
|
932
|
+
optional StartAtActionId start_at_action_id =
|
|
933
|
+
3; // Where the page starts, in action id order; absent means the first
|
|
934
|
+
optional uint32 count =
|
|
935
|
+
4; // Maximum number of actions to return, from 1 to the protocol's
|
|
936
|
+
// max_returned_elements (100); absent means that maximum
|
|
937
|
+
bool prove = 5; // Flag to request a proof as the response
|
|
938
|
+
}
|
|
939
|
+
oneof version { GetContractTeamActionsRequestV0 v0 = 1; }
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
message GetContractTeamActionsResponse {
|
|
943
|
+
// The deletion of a settled document: one past its type's deleteWithin
|
|
944
|
+
// window, which its type's moderatorAbilities.deleteSettled lets the team
|
|
945
|
+
// delete together
|
|
946
|
+
message DeleteSettledDocument {
|
|
947
|
+
string document_type_name = 1; // The document's type
|
|
948
|
+
bytes document_id = 2; // The 32-byte id of the document
|
|
949
|
+
uint64 document_last_modified_at =
|
|
950
|
+
3; // The document's $updatedAt (or $createdAt) when proposed: the
|
|
951
|
+
// approvals are of the document as it was then
|
|
952
|
+
optional uint64 document_revision =
|
|
953
|
+
4; // The document's $revision when proposed, absent on a type whose
|
|
954
|
+
// documents carry none: an approval of a document changed since is
|
|
955
|
+
// refused
|
|
956
|
+
ContractModerationReason reason = 5; // Why, as the proposer gave it
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
// One action the seated team votes on: proposed by one member, approved by
|
|
960
|
+
// the others by its id, run once the approvals meet its rule
|
|
961
|
+
message ContractTeamAction {
|
|
962
|
+
bytes action_id = 1; // The 32-byte id of the action
|
|
963
|
+
bytes proposer_id = 2; // The 32-byte id of the member that proposed it
|
|
964
|
+
uint64 proposed_at =
|
|
965
|
+
3; // The time of the block of the proposal, in milliseconds
|
|
966
|
+
oneof event {
|
|
967
|
+
DeleteSettledDocument delete_settled_document = 4; // What it does
|
|
968
|
+
}
|
|
969
|
+
uint32 approval_count =
|
|
970
|
+
5; // How many approvals it holds, the proposer's among them; an active
|
|
971
|
+
// action's is an upper bound, counting a member who left the team
|
|
972
|
+
// until a later approval reads the team and drops it; the exact
|
|
973
|
+
// figure is its signers still on the team
|
|
974
|
+
}
|
|
975
|
+
|
|
976
|
+
message ContractTeamActions {
|
|
977
|
+
repeated ContractTeamAction actions = 1; // The actions, in action id order
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
message GetContractTeamActionsResponseV0 {
|
|
981
|
+
oneof result {
|
|
982
|
+
ContractTeamActions actions = 1; // The actions read
|
|
983
|
+
Proof proof = 2; // Cryptographic proof of the actions, if requested
|
|
984
|
+
}
|
|
985
|
+
ResponseMetadata metadata = 3; // Metadata about the blockchain state
|
|
986
|
+
}
|
|
987
|
+
oneof version { GetContractTeamActionsResponseV0 v0 = 1; }
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
message GetContractTeamActionSignersRequest {
|
|
991
|
+
enum ActionStatus {
|
|
992
|
+
ACTIVE = 0; // An action still gathering approvals
|
|
993
|
+
CLOSED = 1; // An action whose approvals met its rule, which ran
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
message GetContractTeamActionSignersRequestV0 {
|
|
997
|
+
bytes contract_id =
|
|
998
|
+
1; // The 32-byte id of the elected contract whose seated moderation
|
|
999
|
+
// team votes on the action
|
|
1000
|
+
ActionStatus status = 2; // Whether the action is active or closed
|
|
1001
|
+
bytes action_id = 3; // The 32-byte id of the action
|
|
1002
|
+
bool prove = 4; // Flag to request a proof as the response
|
|
1003
|
+
}
|
|
1004
|
+
oneof version { GetContractTeamActionSignersRequestV0 v0 = 1; }
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
message GetContractTeamActionSignersResponse {
|
|
1008
|
+
message ContractTeamActionSigners {
|
|
1009
|
+
repeated bytes signer_ids =
|
|
1010
|
+
1; // The 32-byte ids of the members that approved, the proposer among
|
|
1011
|
+
// them unless it left the team and its approval was dropped, in id
|
|
1012
|
+
// order; none when there is no such action
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
message GetContractTeamActionSignersResponseV0 {
|
|
1016
|
+
oneof result {
|
|
1017
|
+
ContractTeamActionSigners signers = 1; // The approvals read
|
|
1018
|
+
Proof proof = 2; // Cryptographic proof of the approvals, if requested
|
|
1019
|
+
}
|
|
1020
|
+
ResponseMetadata metadata = 3; // Metadata about the blockchain state
|
|
1021
|
+
}
|
|
1022
|
+
oneof version { GetContractTeamActionSignersResponseV0 v0 = 1; }
|
|
1023
|
+
}
|
|
1024
|
+
|
|
1025
|
+
message GetContractModerationActionCountsRequest {
|
|
1026
|
+
message GetContractModerationActionCountsRequestV0 {
|
|
1027
|
+
bytes contract_id = 1; // The 32-byte id of the elected contract whose
|
|
1028
|
+
// seated moderation team's actions are counted
|
|
1029
|
+
bool prove = 2; // Flag to request a proof as the response
|
|
1030
|
+
}
|
|
1031
|
+
oneof version { GetContractModerationActionCountsRequestV0 v0 = 1; }
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
message GetContractModerationActionCountsResponse {
|
|
1035
|
+
// How many counted moderation actions (a ban, a suspension, a warning or a
|
|
1036
|
+
// document deletion) one member of the seated team signed since the
|
|
1037
|
+
// moderators pot was last paid out, which resets every count
|
|
1038
|
+
message ContractModerationActionCount {
|
|
1039
|
+
bytes identity_id = 1; // The 32-byte id of the member
|
|
1040
|
+
uint32 count = 2; // How many
|
|
1041
|
+
}
|
|
1042
|
+
message ContractModerationActionCounts {
|
|
1043
|
+
repeated ContractModerationActionCount counts =
|
|
1044
|
+
1; // The counts, in identity id order; a member that did not act since
|
|
1045
|
+
// the last payout has none
|
|
1046
|
+
}
|
|
1047
|
+
message GetContractModerationActionCountsResponseV0 {
|
|
1048
|
+
oneof result {
|
|
1049
|
+
ContractModerationActionCounts counts = 1; // The counts read
|
|
1050
|
+
Proof proof = 2; // Cryptographic proof of the counts, if requested
|
|
1051
|
+
}
|
|
1052
|
+
ResponseMetadata metadata = 3; // Metadata about the blockchain state
|
|
1053
|
+
}
|
|
1054
|
+
oneof version { GetContractModerationActionCountsResponseV0 v0 = 1; }
|
|
1055
|
+
}
|
|
1056
|
+
|
|
1057
|
+
message GetContractFeePotsRequest {
|
|
1058
|
+
message GetContractFeePotsRequestV0 {
|
|
1059
|
+
bytes contract_id = 1; // The 32-byte id of the data contract
|
|
1060
|
+
bool prove = 2; // Flag to request a proof as the response
|
|
1061
|
+
}
|
|
1062
|
+
oneof version { GetContractFeePotsRequestV0 v0 = 1; }
|
|
1063
|
+
}
|
|
1064
|
+
|
|
1065
|
+
message GetContractFeePotsResponse {
|
|
1066
|
+
// The last payout of a pot, which the claim that made it left in state
|
|
1067
|
+
message ContractFeePotLastClaim {
|
|
1068
|
+
uint32 epoch = 1; // The epoch (u16) the pot was paid out in; a pot is paid
|
|
1069
|
+
// out at most once per epoch
|
|
1070
|
+
uint64 time_ms = 2
|
|
1071
|
+
[ jstype = JS_STRING ]; // The time of the block that paid the pot out
|
|
1072
|
+
bytes claimant_id = 3; // The identity that signed the claim: the contract
|
|
1073
|
+
// owner for the owner pot, the member of the
|
|
1074
|
+
// moderation team that claimed for the moderators pot
|
|
1075
|
+
}
|
|
1076
|
+
|
|
1077
|
+
// One of the two pots a contract's document action fees collect in
|
|
1078
|
+
message ContractFeePot {
|
|
1079
|
+
uint64 credits = 1 [ jstype = JS_STRING ]; // What the pot holds
|
|
1080
|
+
ContractFeePotLastClaim last_claim =
|
|
1081
|
+
2; // Unset when the pot was never paid out
|
|
1082
|
+
}
|
|
1083
|
+
|
|
1084
|
+
message ContractFeePots {
|
|
1085
|
+
ContractFeePot owner = 1; // The pot the contract owner claims
|
|
1086
|
+
ContractFeePot moderators = 2; // The pot the moderation team shares
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1089
|
+
message GetContractFeePotsResponseV0 {
|
|
1090
|
+
oneof result {
|
|
1091
|
+
ContractFeePots pots = 1; // Both pots of the contract
|
|
1092
|
+
Proof proof = 2; // Cryptographic proof of the pots, if requested
|
|
1093
|
+
}
|
|
1094
|
+
ResponseMetadata metadata = 3; // Metadata about the blockchain state
|
|
1095
|
+
}
|
|
1096
|
+
oneof version { GetContractFeePotsResponseV0 v0 = 1; }
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
message GetContractGroupsForContractRequest {
|
|
1100
|
+
message GetContractGroupsForContractRequestV0 {
|
|
1101
|
+
bytes contract_id = 1; // The 32-byte id of the contract
|
|
1102
|
+
bool prove = 2; // Flag to request a proof as the response
|
|
1103
|
+
}
|
|
1104
|
+
oneof version { GetContractGroupsForContractRequestV0 v0 = 1; }
|
|
1105
|
+
}
|
|
1106
|
+
|
|
1107
|
+
message GetContractGroupsForContractResponse {
|
|
1108
|
+
message DocumentTypeMemberships {
|
|
1109
|
+
string document_type_name = 1; // The document type within the contract
|
|
1110
|
+
repeated bytes contract_group_ids =
|
|
1111
|
+
2; // The groups the document type belongs to
|
|
1112
|
+
}
|
|
1113
|
+
|
|
1114
|
+
message TokenMemberships {
|
|
1115
|
+
uint32 token_position = 1; // The token's position in the contract (u16)
|
|
1116
|
+
repeated bytes contract_group_ids = 2; // The groups the token belongs to
|
|
1117
|
+
}
|
|
1118
|
+
|
|
1119
|
+
message ContractGroupMemberships {
|
|
1120
|
+
repeated bytes contract_group_ids =
|
|
1121
|
+
1; // The groups the whole contract belongs to
|
|
1122
|
+
repeated DocumentTypeMemberships document_types =
|
|
1123
|
+
2; // The groups each document type belongs to
|
|
1124
|
+
repeated TokenMemberships tokens = 3; // The groups each token belongs to
|
|
1125
|
+
}
|
|
1126
|
+
|
|
1127
|
+
message GetContractGroupsForContractResponseV0 {
|
|
1128
|
+
oneof result {
|
|
1129
|
+
ContractGroupMemberships contract_group_memberships =
|
|
1130
|
+
1; // The memberships; every list is empty when the contract belongs
|
|
1131
|
+
// to no group
|
|
1132
|
+
Proof proof = 2; // Cryptographic proof of the memberships, if requested
|
|
1133
|
+
}
|
|
1134
|
+
ResponseMetadata metadata = 3; // Metadata about the blockchain state
|
|
1135
|
+
}
|
|
1136
|
+
oneof version { GetContractGroupsForContractResponseV0 v0 = 1; }
|
|
1137
|
+
}
|
|
1138
|
+
|
|
500
1139
|
message GetDataContractsRequest {
|
|
501
1140
|
message GetDataContractsRequestV0 {
|
|
502
1141
|
repeated bytes ids =
|
|
@@ -506,6 +1145,28 @@ message GetDataContractsRequest {
|
|
|
506
1145
|
oneof version { GetDataContractsRequestV0 v0 = 1; }
|
|
507
1146
|
}
|
|
508
1147
|
|
|
1148
|
+
// Enumerates every data contract on Platform, one page at a time, in
|
|
1149
|
+
// ascending contract id order. Answered with `GetDataContractsResponse`:
|
|
1150
|
+
// each `DataContractEntry` carries the contract id and, unless `ids_only`
|
|
1151
|
+
// is set, the serialized contract. An empty page (no more contracts) is an
|
|
1152
|
+
// empty `data_contract_entries` list, never NotFound. A page shorter than
|
|
1153
|
+
// `limit` is the last page; otherwise pass the last entry's identifier as
|
|
1154
|
+
// `start_after` to fetch the next one.
|
|
1155
|
+
message GetDataContractsByRangeRequest {
|
|
1156
|
+
message GetDataContractsByRangeRequestV0 {
|
|
1157
|
+
optional uint32 limit =
|
|
1158
|
+
1; // Maximum number of contracts to return, 1..=100; absent means 100
|
|
1159
|
+
oneof start {
|
|
1160
|
+
bytes start_after = 2; // 32-byte contract id; the page starts after it
|
|
1161
|
+
bytes start_at = 3; // 32-byte contract id; the page starts at it
|
|
1162
|
+
}
|
|
1163
|
+
bool ids_only =
|
|
1164
|
+
4; // When set, entries carry only `identifier`; `data_contract` is unset
|
|
1165
|
+
bool prove = 5; // Flag to request a proof as the response
|
|
1166
|
+
}
|
|
1167
|
+
oneof version { GetDataContractsByRangeRequestV0 v0 = 1; }
|
|
1168
|
+
}
|
|
1169
|
+
|
|
509
1170
|
message GetDataContractsResponse {
|
|
510
1171
|
message DataContractEntry {
|
|
511
1172
|
bytes identifier = 1; // The unique identifier of the data contract
|
|
@@ -606,6 +1267,15 @@ message GetDocumentsRequest {
|
|
|
606
1267
|
// index/count proof either way. See `timeRange` in the document
|
|
607
1268
|
// meta-schema and `drive::query::resolve_time_range_bucket_clause`.
|
|
608
1269
|
IN_TIME_RANGE = 11;
|
|
1270
|
+
// Integer-range window selection (v1 only). `field` names an integer
|
|
1271
|
+
// property covered by an `integerRange` index. The operand is
|
|
1272
|
+
// `WhereClause.integer_range` (an `IntegerRangeSelection`);
|
|
1273
|
+
// `WhereClause.value` must be unset. The window is named by its
|
|
1274
|
+
// start, so the server and the verifier both resolve it from the
|
|
1275
|
+
// query alone to a window-start equality — an ordinary index/count
|
|
1276
|
+
// proof. See `integerRange` in the document meta-schema and
|
|
1277
|
+
// `drive::query::resolve_integer_range_bucket_clause`.
|
|
1278
|
+
IN_INTEGER_RANGE = 12;
|
|
609
1279
|
}
|
|
610
1280
|
|
|
611
1281
|
// Tagged scalar (or list) operand for a `WhereClause`. The
|
|
@@ -706,6 +1376,32 @@ message GetDocumentsRequest {
|
|
|
706
1376
|
Grid grid = 3;
|
|
707
1377
|
}
|
|
708
1378
|
|
|
1379
|
+
// Operand of an `IN_INTEGER_RANGE` where clause: which window of an
|
|
1380
|
+
// `integerRange` grid the query selects, named by its start.
|
|
1381
|
+
//
|
|
1382
|
+
// `start` is required and must be a window start of the grid:
|
|
1383
|
+
// `phase + k * step` within the property's integer type, or the
|
|
1384
|
+
// type's minimum (0 for a property with a non-negative minimum), which
|
|
1385
|
+
// starts the bottom window when the grid clamps it. An unaligned start
|
|
1386
|
+
// is rejected rather than snapped. It rides as a `DocumentFieldValue`
|
|
1387
|
+
// (`int64_value` or `uint64_value`) and is coerced through the schema
|
|
1388
|
+
// like any value of the field. A window with no documents is a
|
|
1389
|
+
// provable empty answer, not an error.
|
|
1390
|
+
message IntegerRangeSelection {
|
|
1391
|
+
// Names one of the field's declared grids, verbatim from the
|
|
1392
|
+
// contract's `integerRange` declaration. Required when more than one
|
|
1393
|
+
// grid buckets the field; optional while exactly one does. A zero
|
|
1394
|
+
// `phase` is the proto3 default, matching the contract grammar where
|
|
1395
|
+
// `phase` is an omittable key.
|
|
1396
|
+
message Grid {
|
|
1397
|
+
uint64 range = 1 [jstype = JS_STRING];
|
|
1398
|
+
uint64 step = 2 [jstype = JS_STRING];
|
|
1399
|
+
uint64 phase = 3 [jstype = JS_STRING];
|
|
1400
|
+
}
|
|
1401
|
+
DocumentFieldValue start = 1;
|
|
1402
|
+
Grid grid = 2;
|
|
1403
|
+
}
|
|
1404
|
+
|
|
709
1405
|
// Single `field <op> value` clause. The server reassembles a
|
|
710
1406
|
// `Vec<WhereClause>` from the request's `where_clauses` field,
|
|
711
1407
|
// runs the same `WhereClause::group_clauses` validator (rejects
|
|
@@ -716,14 +1412,16 @@ message GetDocumentsRequest {
|
|
|
716
1412
|
// triples — only the envelope differs.
|
|
717
1413
|
//
|
|
718
1414
|
// Exactly one operand field is set, keyed by the operator:
|
|
719
|
-
// `operator = IN_TIME_RANGE` carries its operand in `time_range
|
|
720
|
-
//
|
|
721
|
-
//
|
|
1415
|
+
// `operator = IN_TIME_RANGE` carries its operand in `time_range`,
|
|
1416
|
+
// `operator = IN_INTEGER_RANGE` in `integer_range` (`value` unset in
|
|
1417
|
+
// both); every other operator carries `value` (`time_range` and
|
|
1418
|
+
// `integer_range` unset). Any mismatch is rejected.
|
|
722
1419
|
message WhereClause {
|
|
723
1420
|
string field = 1;
|
|
724
1421
|
WhereOperator operator = 2;
|
|
725
1422
|
DocumentFieldValue value = 3;
|
|
726
1423
|
TimeRangeSelection time_range = 4;
|
|
1424
|
+
IntegerRangeSelection integer_range = 5;
|
|
727
1425
|
}
|
|
728
1426
|
|
|
729
1427
|
// Per-group aggregate operand for the left side of a
|
|
@@ -1697,6 +2395,20 @@ message GetDocumentsResponse {
|
|
|
1697
2395
|
message ChainedDocuments {
|
|
1698
2396
|
repeated bytes inner_documents = 1;
|
|
1699
2397
|
repeated bytes outer_documents = 2;
|
|
2398
|
+
// The join values that have NO outer document, in first
|
|
2399
|
+
// appearance order: referenced documents deleted after the
|
|
2400
|
+
// inner document was written. Only a join property declaring
|
|
2401
|
+
// `refersTo: deletableDocument` can report any; under
|
|
2402
|
+
// `refersTo: permanentDocument` a missing document fails the
|
|
2403
|
+
// query instead.
|
|
2404
|
+
repeated bytes missing_outer_ids = 3;
|
|
2405
|
+
// The join values whose outer document the contract's
|
|
2406
|
+
// moderators removed, each with its removal record, in first
|
|
2407
|
+
// appearance order. Only a join property declaring `refersTo:
|
|
2408
|
+
// moderatedDocument` can report any; there a join value with
|
|
2409
|
+
// neither a document nor a record fails the query.
|
|
2410
|
+
repeated GetContractDocumentRemovalsResponse.ContractDocumentRemoval
|
|
2411
|
+
removed_outer_documents = 4;
|
|
1700
2412
|
}
|
|
1701
2413
|
|
|
1702
2414
|
// A composite query's page and per-sub-query results, documents
|
|
@@ -1714,6 +2426,19 @@ message GetDocumentsResponse {
|
|
|
1714
2426
|
// value's index-key bytes.
|
|
1715
2427
|
CountEntries counts = 2;
|
|
1716
2428
|
}
|
|
2429
|
+
// DOCUMENTS by-id join only: the derived ids that have NO
|
|
2430
|
+
// document, in first appearance order (referenced documents
|
|
2431
|
+
// deleted since). Only a source property declaring
|
|
2432
|
+
// `refersTo: deletableDocument` can report any.
|
|
2433
|
+
repeated bytes missing_ids = 3;
|
|
2434
|
+
// DOCUMENTS by-id join only: the derived ids whose document
|
|
2435
|
+
// the contract's moderators removed, each with its removal
|
|
2436
|
+
// record, in first appearance order. Only a source property
|
|
2437
|
+
// declaring `refersTo: moderatedDocument` can report any; there
|
|
2438
|
+
// a derived id with neither a document nor a record fails the
|
|
2439
|
+
// query.
|
|
2440
|
+
repeated GetContractDocumentRemovalsResponse.ContractDocumentRemoval
|
|
2441
|
+
removed = 4;
|
|
1717
2442
|
}
|
|
1718
2443
|
repeated SubQueryResult sub_results = 2;
|
|
1719
2444
|
}
|
|
@@ -1829,17 +2554,33 @@ message WaitForStateTransitionResultRequest {
|
|
|
1829
2554
|
bytes state_transition_hash =
|
|
1830
2555
|
1; // The hash of the state transition to wait for
|
|
1831
2556
|
bool prove = 2; // Flag to request a proof as the response
|
|
2557
|
+
// Flag to request, without a proof, the credit balance of the identity
|
|
2558
|
+
// that owns the transition after it executed. Ignored when a proof is
|
|
2559
|
+
// requested: from protocol version 14 the proof of an owned, fee-paying
|
|
2560
|
+
// transition (document and token batches, contract creates and updates,
|
|
2561
|
+
// identity updates and key limit updates, contract moderation) carries
|
|
2562
|
+
// the owner's balance itself.
|
|
2563
|
+
bool request_user_balance = 3;
|
|
1832
2564
|
}
|
|
1833
2565
|
oneof version { WaitForStateTransitionResultRequestV0 v0 = 1; }
|
|
1834
2566
|
}
|
|
1835
2567
|
|
|
1836
2568
|
message WaitForStateTransitionResultResponse {
|
|
2569
|
+
// The result of a successful wait that asked for the owner's balance and for no proof
|
|
2570
|
+
message SuccessWithOwnerBalance {
|
|
2571
|
+
// The credit balance of the identity that owns the transition after it
|
|
2572
|
+
// executed, read from a Drive state at or past the block that executed it
|
|
2573
|
+
uint64 owner_balance = 1 [ jstype = JS_STRING ];
|
|
2574
|
+
}
|
|
1837
2575
|
message WaitForStateTransitionResultResponseV0 {
|
|
1838
2576
|
oneof result {
|
|
1839
2577
|
StateTransitionBroadcastError error =
|
|
1840
2578
|
1; // Any error that occurred during the state transition broadcast
|
|
1841
2579
|
Proof proof =
|
|
1842
2580
|
2; // Cryptographic proof for the state transition, if requested
|
|
2581
|
+
// Success with the owner's balance, unproved, when the request asked
|
|
2582
|
+
// for it and for no proof
|
|
2583
|
+
SuccessWithOwnerBalance success_with_owner_balance = 4;
|
|
1843
2584
|
}
|
|
1844
2585
|
ResponseMetadata metadata = 3; // Metadata about the blockchain state
|
|
1845
2586
|
}
|
|
@@ -3044,6 +3785,20 @@ message GetGroupActionsResponse {
|
|
|
3044
3785
|
optional string public_note = 3; // Public note
|
|
3045
3786
|
}
|
|
3046
3787
|
|
|
3788
|
+
// Mint straight into the token's shielded pool (protocol version 14+)
|
|
3789
|
+
message MintToPoolEvent {
|
|
3790
|
+
uint64 amount = 1; // Amount minted into the pool
|
|
3791
|
+
bytes actions_digest = 2; // Digest of the Orchard actions every signer commits to
|
|
3792
|
+
optional string public_note = 3; // Public note
|
|
3793
|
+
}
|
|
3794
|
+
|
|
3795
|
+
// Burn of notes held in the token's shielded pool (protocol version 14+)
|
|
3796
|
+
message BurnFromPoolEvent {
|
|
3797
|
+
uint64 amount = 1; // Amount destroyed
|
|
3798
|
+
bytes actions_digest = 2; // Digest of the Orchard actions every signer commits to
|
|
3799
|
+
optional string public_note = 3; // Public note
|
|
3800
|
+
}
|
|
3801
|
+
|
|
3047
3802
|
// Event associated with this action
|
|
3048
3803
|
message GroupActionEvent {
|
|
3049
3804
|
oneof event_type {
|
|
@@ -3083,6 +3838,8 @@ message GetGroupActionsResponse {
|
|
|
3083
3838
|
7; // Token configuration update details
|
|
3084
3839
|
UpdateDirectPurchasePriceEvent update_price =
|
|
3085
3840
|
8; // Updating the token direct selling price
|
|
3841
|
+
MintToPoolEvent mint_to_pool = 9; // Mint into the token shielded pool
|
|
3842
|
+
BurnFromPoolEvent burn_from_pool = 10; // Burn from the token shielded pool
|
|
3086
3843
|
}
|
|
3087
3844
|
}
|
|
3088
3845
|
|
|
@@ -3316,11 +4073,15 @@ message GetRecentCompactedAddressBalanceChangesResponse {
|
|
|
3316
4073
|
|
|
3317
4074
|
// --- Shielded Pool Queries ---
|
|
3318
4075
|
|
|
4076
|
+
// Every shielded pool query below targets the credit shielded pool unless `token_id` is set,
|
|
4077
|
+
// in which case it targets that token's own shielded pool (protocol version 14+; the 32-byte
|
|
4078
|
+
// token id). Responses have the same shape for both pools.
|
|
3319
4079
|
message GetShieldedEncryptedNotesRequest {
|
|
3320
4080
|
message GetShieldedEncryptedNotesRequestV0 {
|
|
3321
4081
|
uint64 start_index = 1;
|
|
3322
4082
|
uint32 count = 2;
|
|
3323
4083
|
bool prove = 3;
|
|
4084
|
+
optional bytes token_id = 4; // target a token's shielded pool instead of the credit pool
|
|
3324
4085
|
}
|
|
3325
4086
|
oneof version { GetShieldedEncryptedNotesRequestV0 v0 = 1; }
|
|
3326
4087
|
}
|
|
@@ -3348,6 +4109,7 @@ message GetShieldedEncryptedNotesResponse {
|
|
|
3348
4109
|
message GetShieldedAnchorsRequest {
|
|
3349
4110
|
message GetShieldedAnchorsRequestV0 {
|
|
3350
4111
|
bool prove = 1;
|
|
4112
|
+
optional bytes token_id = 2; // target a token's shielded pool instead of the credit pool
|
|
3351
4113
|
}
|
|
3352
4114
|
oneof version { GetShieldedAnchorsRequestV0 v0 = 1; }
|
|
3353
4115
|
}
|
|
@@ -3369,6 +4131,7 @@ message GetShieldedAnchorsResponse {
|
|
|
3369
4131
|
message GetMostRecentShieldedAnchorRequest {
|
|
3370
4132
|
message GetMostRecentShieldedAnchorRequestV0 {
|
|
3371
4133
|
bool prove = 1;
|
|
4134
|
+
optional bytes token_id = 2; // target a token's shielded pool instead of the credit pool
|
|
3372
4135
|
}
|
|
3373
4136
|
oneof version { GetMostRecentShieldedAnchorRequestV0 v0 = 1; }
|
|
3374
4137
|
}
|
|
@@ -3387,6 +4150,7 @@ message GetMostRecentShieldedAnchorResponse {
|
|
|
3387
4150
|
message GetShieldedPoolStateRequest {
|
|
3388
4151
|
message GetShieldedPoolStateRequestV0 {
|
|
3389
4152
|
bool prove = 1;
|
|
4153
|
+
optional bytes token_id = 2; // target a token's shielded pool instead of the credit pool
|
|
3390
4154
|
}
|
|
3391
4155
|
oneof version { GetShieldedPoolStateRequestV0 v0 = 1; }
|
|
3392
4156
|
}
|
|
@@ -3412,6 +4176,7 @@ message GetShieldedPoolStateResponse {
|
|
|
3412
4176
|
message GetShieldedNotesCountRequest {
|
|
3413
4177
|
message GetShieldedNotesCountRequestV0 {
|
|
3414
4178
|
bool prove = 1;
|
|
4179
|
+
optional bytes token_id = 2; // target a token's shielded pool instead of the credit pool
|
|
3415
4180
|
}
|
|
3416
4181
|
oneof version { GetShieldedNotesCountRequestV0 v0 = 1; }
|
|
3417
4182
|
}
|
|
@@ -3431,6 +4196,7 @@ message GetShieldedNullifiersRequest {
|
|
|
3431
4196
|
message GetShieldedNullifiersRequestV0 {
|
|
3432
4197
|
repeated bytes nullifiers = 1;
|
|
3433
4198
|
bool prove = 2;
|
|
4199
|
+
optional bytes token_id = 3; // target a token's shielded pool instead of the credit pool
|
|
3434
4200
|
}
|
|
3435
4201
|
oneof version { GetShieldedNullifiersRequestV0 v0 = 1; }
|
|
3436
4202
|
}
|