@thru/thru-sdk 0.1.19 → 0.1.21

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 (88) hide show
  1. package/README.md +19 -0
  2. package/dist/{chunk-PH7P5EEU.js → chunk-SHMREHP5.js} +13 -9
  3. package/dist/chunk-SHMREHP5.js.map +1 -0
  4. package/dist/client.d.ts +2 -1
  5. package/dist/client.js +3 -2
  6. package/dist/client.js.map +1 -1
  7. package/dist/metafile-esm.json +1 -1
  8. package/dist/sdk.d.ts +3 -3
  9. package/dist/sdk.js +1 -1
  10. package/dist/{transactions-BzD9hYlc.d.ts → transactions-CLezIeXO.d.ts} +20 -18
  11. package/package.json +7 -3
  12. package/buf.gen.yaml +0 -12
  13. package/buf.lock +0 -9
  14. package/buf.yaml +0 -15
  15. package/dist/chunk-PH7P5EEU.js.map +0 -1
  16. package/proto/thru/common/v1/consensus.proto +0 -73
  17. package/proto/thru/common/v1/errors.proto +0 -65
  18. package/proto/thru/common/v1/filters.proto +0 -60
  19. package/proto/thru/common/v1/pagination.proto +0 -45
  20. package/proto/thru/core/v1/account.proto +0 -137
  21. package/proto/thru/core/v1/block.proto +0 -80
  22. package/proto/thru/core/v1/state.proto +0 -35
  23. package/proto/thru/core/v1/transaction.proto +0 -136
  24. package/proto/thru/core/v1/types.proto +0 -50
  25. package/proto/thru/services/v1/command_service.proto +0 -70
  26. package/proto/thru/services/v1/query_service.proto +0 -344
  27. package/proto/thru/services/v1/streaming_service.proto +0 -126
  28. package/thru-ts-client-sdk/__tests__/helpers/test-utils.ts +0 -228
  29. package/thru-ts-client-sdk/client.ts +0 -10
  30. package/thru-ts-client-sdk/core/__tests__/bound-client.test.ts +0 -354
  31. package/thru-ts-client-sdk/core/__tests__/client.test.ts +0 -53
  32. package/thru-ts-client-sdk/core/bound-client.ts +0 -156
  33. package/thru-ts-client-sdk/core/client.ts +0 -38
  34. package/thru-ts-client-sdk/defaults.ts +0 -26
  35. package/thru-ts-client-sdk/modules/__tests__/accounts.test.ts +0 -406
  36. package/thru-ts-client-sdk/modules/__tests__/blocks.test.ts +0 -199
  37. package/thru-ts-client-sdk/modules/__tests__/events.test.ts +0 -74
  38. package/thru-ts-client-sdk/modules/__tests__/height.test.ts +0 -39
  39. package/thru-ts-client-sdk/modules/__tests__/helpers.test.ts +0 -288
  40. package/thru-ts-client-sdk/modules/__tests__/keys.test.ts +0 -55
  41. package/thru-ts-client-sdk/modules/__tests__/proofs.test.ts +0 -119
  42. package/thru-ts-client-sdk/modules/__tests__/streaming.test.ts +0 -152
  43. package/thru-ts-client-sdk/modules/__tests__/transactions.test.ts +0 -730
  44. package/thru-ts-client-sdk/modules/__tests__/version.test.ts +0 -40
  45. package/thru-ts-client-sdk/modules/accounts.ts +0 -141
  46. package/thru-ts-client-sdk/modules/blocks.ts +0 -75
  47. package/thru-ts-client-sdk/modules/events.ts +0 -20
  48. package/thru-ts-client-sdk/modules/height.ts +0 -9
  49. package/thru-ts-client-sdk/modules/helpers.ts +0 -131
  50. package/thru-ts-client-sdk/modules/keys.ts +0 -29
  51. package/thru-ts-client-sdk/modules/proofs.ts +0 -20
  52. package/thru-ts-client-sdk/modules/streaming.ts +0 -133
  53. package/thru-ts-client-sdk/modules/transactions.ts +0 -374
  54. package/thru-ts-client-sdk/modules/version.ts +0 -10
  55. package/thru-ts-client-sdk/proto/buf/validate/validate_pb.ts +0 -4761
  56. package/thru-ts-client-sdk/proto/google/api/annotations_pb.ts +0 -39
  57. package/thru-ts-client-sdk/proto/google/api/client_pb.ts +0 -953
  58. package/thru-ts-client-sdk/proto/google/api/field_behavior_pb.ts +0 -157
  59. package/thru-ts-client-sdk/proto/google/api/http_pb.ts +0 -474
  60. package/thru-ts-client-sdk/proto/google/api/launch_stage_pb.ts +0 -118
  61. package/thru-ts-client-sdk/proto/thru/common/v1/consensus_pb.ts +0 -162
  62. package/thru-ts-client-sdk/proto/thru/common/v1/errors_pb.ts +0 -129
  63. package/thru-ts-client-sdk/proto/thru/common/v1/filters_pb.ts +0 -129
  64. package/thru-ts-client-sdk/proto/thru/common/v1/pagination_pb.ts +0 -79
  65. package/thru-ts-client-sdk/proto/thru/core/v1/account_pb.ts +0 -359
  66. package/thru-ts-client-sdk/proto/thru/core/v1/block_pb.ts +0 -259
  67. package/thru-ts-client-sdk/proto/thru/core/v1/state_pb.ts +0 -103
  68. package/thru-ts-client-sdk/proto/thru/core/v1/transaction_pb.ts +0 -528
  69. package/thru-ts-client-sdk/proto/thru/core/v1/types_pb.ts +0 -100
  70. package/thru-ts-client-sdk/proto/thru/services/v1/command_service_pb.ts +0 -146
  71. package/thru-ts-client-sdk/proto/thru/services/v1/query_service_pb.ts +0 -819
  72. package/thru-ts-client-sdk/proto/thru/services/v1/streaming_service_pb.ts +0 -390
  73. package/thru-ts-client-sdk/sdk.ts +0 -42
  74. package/thru-ts-client-sdk/test-scripts/counter.ts +0 -469
  75. package/thru-ts-client-sdk/test-scripts/create-account.ts +0 -74
  76. package/thru-ts-client-sdk/test-scripts/get-height.ts +0 -52
  77. package/thru-ts-client-sdk/transactions/Transaction.ts +0 -240
  78. package/thru-ts-client-sdk/transactions/TransactionBuilder.ts +0 -53
  79. package/thru-ts-client-sdk/transactions/__tests__/TransactionBuilder.test.ts +0 -411
  80. package/thru-ts-client-sdk/transactions/__tests__/utils.test.ts +0 -214
  81. package/thru-ts-client-sdk/transactions/index.ts +0 -3
  82. package/thru-ts-client-sdk/transactions/types.ts +0 -74
  83. package/thru-ts-client-sdk/transactions/utils.ts +0 -132
  84. package/thru-ts-client-sdk/types/types.ts +0 -8
  85. package/thru-ts-client-sdk/utils/utils.ts +0 -27
  86. package/tsconfig.json +0 -9
  87. package/tsup.config.ts +0 -14
  88. package/vitest.config.ts +0 -31
@@ -1,73 +0,0 @@
1
- syntax = "proto3";
2
-
3
- package thru.common.v1;
4
-
5
- import "buf/validate/validate.proto";
6
- import "google/api/field_behavior.proto";
7
- import "google/protobuf/timestamp.proto";
8
-
9
- option go_package = "github.com/Unto-Labs/thru-net/grpc/pkg/proto/thru/common/v1;commonv1";
10
- option java_multiple_files = true;
11
- option java_package = "network.thru.common.v1";
12
- option csharp_namespace = "Thru.Common.V1";
13
- option ruby_package = "Thru::Common::V1";
14
- option objc_class_prefix = "THU";
15
- option swift_prefix = "THU";
16
-
17
- // ConsensusStatus represents the minimum consensus level a resource has
18
- // achieved when returned by the service.
19
- enum ConsensusStatus {
20
- // CONSENSUS_STATUS_UNSPECIFIED indicates the consensus status is unknown.
21
- CONSENSUS_STATUS_UNSPECIFIED = 0;
22
-
23
- // CONSENSUS_STATUS_OBSERVED indicates the resource has been observed but
24
- // not yet confirmed in a finalized block.
25
- CONSENSUS_STATUS_OBSERVED = 1;
26
-
27
- // CONSENSUS_STATUS_INCLUDED indicates the resource has been included in the
28
- // ledger but may not be finalized.
29
- CONSENSUS_STATUS_INCLUDED = 2;
30
-
31
- // CONSENSUS_STATUS_FINALIZED indicates the resource is finalized for a slot.
32
- CONSENSUS_STATUS_FINALIZED = 3;
33
-
34
- // CONSENSUS_STATUS_LOCALLY_EXECUTED indicates the local node executed the
35
- // resource but broader cluster finality may not have been achieved.
36
- CONSENSUS_STATUS_LOCALLY_EXECUTED = 4;
37
-
38
- // CONSENSUS_STATUS_CLUSTER_EXECUTED indicates the entire cluster has
39
- // executed and agreed on the resource.
40
- CONSENSUS_STATUS_CLUSTER_EXECUTED = 5;
41
- }
42
-
43
- // VersionContext selects which logical version of a resource should be
44
- // returned. At least one field must be set.
45
- message VersionContext {
46
- option (buf.validate.message).cel = {
47
- id: "version_context_has_selector"
48
- message: "one of current, slot, or timestamp must be set"
49
- expression: "has(this.current) || has(this.slot) || has(this.timestamp)"
50
- };
51
-
52
- // Specifies the desired version semantics.
53
- oneof version {
54
- // Request the latest version available at request time.
55
- CurrentVersion current = 1 [(google.api.field_behavior) = OPTIONAL];
56
-
57
- // Request the latest version, or historical on.
58
- CurrentOrHistoricalVersion currentOrHistorical = 2 [(google.api.field_behavior) = OPTIONAL];
59
-
60
- // Request the version for a specific slot number.
61
- uint64 slot = 3 [(google.api.field_behavior) = OPTIONAL];
62
-
63
- // Request the version nearest to the provided block timestamp.
64
- google.protobuf.Timestamp timestamp = 4
65
- [(google.api.field_behavior) = OPTIONAL];
66
- }
67
- }
68
-
69
- // CurrentVersion is an empty marker message for VersionContext.current.
70
- message CurrentVersion {}
71
-
72
- // CurrentOrHistoricalVersion is an empty marker message for VersionContext.current.
73
- message CurrentOrHistoricalVersion {}
@@ -1,65 +0,0 @@
1
- syntax = "proto3";
2
-
3
- package thru.common.v1;
4
-
5
- import "buf/validate/validate.proto";
6
- import "google/api/field_behavior.proto";
7
- import "google/protobuf/timestamp.proto";
8
-
9
- option go_package = "github.com/Unto-Labs/thru-net/grpc/pkg/proto/thru/common/v1;commonv1";
10
- option java_multiple_files = true;
11
- option java_package = "network.thru.common.v1";
12
- option csharp_namespace = "Thru.Common.V1";
13
- option ruby_package = "Thru::Common::V1";
14
- option objc_class_prefix = "THU";
15
- option swift_prefix = "THU";
16
-
17
- // ErrorType captures structured error categories returned by the services.
18
- enum ErrorType {
19
- // ERROR_TYPE_UNSPECIFIED is an unknown error condition.
20
- ERROR_TYPE_UNSPECIFIED = 0;
21
-
22
- // ERROR_TYPE_NOT_FOUND indicates requested data does not exist.
23
- ERROR_TYPE_NOT_FOUND = 1;
24
-
25
- // ERROR_TYPE_NOT_RETAINED indicates requested data was not retained under TTL.
26
- ERROR_TYPE_NOT_RETAINED = 2;
27
-
28
- // ERROR_TYPE_NOT_FOUND_OR_NOT_RETAINED indicates an ambiguous not found vs TTL case.
29
- ERROR_TYPE_NOT_FOUND_OR_NOT_RETAINED = 3;
30
-
31
- // ERROR_TYPE_INVALID_REQUEST indicates the request failed validation.
32
- ERROR_TYPE_INVALID_REQUEST = 4;
33
-
34
- // ERROR_TYPE_CEL_VALIDATION_FAILED indicates a CEL filter failed validation.
35
- ERROR_TYPE_CEL_VALIDATION_FAILED = 5;
36
-
37
- // ERROR_TYPE_INTERNAL_ERROR indicates an internal server error occurred.
38
- ERROR_TYPE_INTERNAL_ERROR = 6;
39
- }
40
-
41
- // ErrorDetail provides structured error metadata attached to gRPC errors.
42
- message ErrorDetail {
43
- // High-level error category.
44
- ErrorType error_type = 1 [(google.api.field_behavior) = REQUIRED];
45
-
46
- // Human-readable error summary.
47
- string message = 2 [
48
- (google.api.field_behavior) = REQUIRED,
49
- (buf.validate.field).string.max_len = 1024
50
- ];
51
-
52
- // Optional retention window expressed in slots when applicable.
53
- optional uint64 retention_window_slots = 3
54
- [(google.api.field_behavior) = OPTIONAL];
55
-
56
- // Optional retention cutoff timestamp when applicable.
57
- optional google.protobuf.Timestamp retention_cutoff = 4
58
- [(google.api.field_behavior) = OPTIONAL];
59
-
60
- // Optional name of the field associated with the error.
61
- optional string field_name = 5 [
62
- (google.api.field_behavior) = OPTIONAL,
63
- (buf.validate.field).string.max_len = 128
64
- ];
65
- }
@@ -1,60 +0,0 @@
1
- syntax = "proto3";
2
-
3
- package thru.common.v1;
4
-
5
- import "buf/validate/validate.proto";
6
- import "google/api/field_behavior.proto";
7
-
8
- option go_package = "github.com/Unto-Labs/thru-net/grpc/pkg/proto/thru/common/v1;commonv1";
9
- option java_multiple_files = true;
10
- option java_package = "network.thru.common.v1";
11
- option csharp_namespace = "Thru.Common.V1";
12
- option ruby_package = "Thru::Common::V1";
13
- option objc_class_prefix = "THU";
14
- option swift_prefix = "THU";
15
-
16
- // Filter represents a CEL-based expression applied to query or stream results.
17
- message Filter {
18
- // CEL expression applied server-side. Empty expressions are treated as no-op.
19
- optional string expression = 1 [
20
- (google.api.field_behavior) = OPTIONAL,
21
- (buf.validate.field).string.max_len = 4096
22
- ];
23
-
24
- // Named parameter bindings for expression parameterization.
25
- map<string, FilterParamValue> params = 2
26
- [(google.api.field_behavior) = OPTIONAL];
27
- }
28
-
29
- // FilterParamValue carries strongly-typed CEL parameter bindings.
30
- message FilterParamValue {
31
- oneof kind {
32
- string string_value = 1 [(google.api.field_behavior) = OPTIONAL];
33
- bytes bytes_value = 2 [(google.api.field_behavior) = OPTIONAL];
34
- bool bool_value = 3 [(google.api.field_behavior) = OPTIONAL];
35
- sint64 int_value = 4 [(google.api.field_behavior) = OPTIONAL];
36
- double double_value = 5 [(google.api.field_behavior) = OPTIONAL];
37
- }
38
- }
39
-
40
- // CelFilterValidation describes the validation configuration returned to
41
- // clients to help them build safe filter expressions.
42
- message CelFilterValidation {
43
- // List of allowed CEL function names for a specific request type.
44
- repeated string allowed_functions = 1 [
45
- (google.api.field_behavior) = OPTIONAL,
46
- (buf.validate.field).repeated.max_items = 128
47
- ];
48
-
49
- // List of allowed field names accessible to the CEL expression.
50
- repeated string allowed_fields = 2 [
51
- (google.api.field_behavior) = OPTIONAL,
52
- (buf.validate.field).repeated.max_items = 256
53
- ];
54
-
55
- // Maximum AST node count permitted for a CEL expression.
56
- optional uint32 max_complexity = 3 [
57
- (google.api.field_behavior) = OPTIONAL,
58
- (buf.validate.field).uint32.lte = 1000
59
- ];
60
- }
@@ -1,45 +0,0 @@
1
- syntax = "proto3";
2
-
3
- package thru.common.v1;
4
-
5
- import "buf/validate/validate.proto";
6
- import "google/api/field_behavior.proto";
7
-
8
- option go_package = "github.com/Unto-Labs/thru-net/grpc/pkg/proto/thru/common/v1;commonv1";
9
- option java_multiple_files = true;
10
- option java_package = "network.thru.common.v1";
11
- option csharp_namespace = "Thru.Common.V1";
12
- option ruby_package = "Thru::Common::V1";
13
- option objc_class_prefix = "THU";
14
- option swift_prefix = "THU";
15
-
16
- // PageRequest contains pagination parameters for listing RPCs.
17
- message PageRequest {
18
- // Maximum number of items to return in a single response.
19
- optional uint32 page_size = 1 [
20
- (google.api.field_behavior) = OPTIONAL,
21
- (buf.validate.field).uint32.gte = 1,
22
- (buf.validate.field).uint32.lte = 1000
23
- ];
24
-
25
- // Token identifying the position to resume from.
26
- optional string page_token = 2 [
27
- (google.api.field_behavior) = OPTIONAL,
28
- (buf.validate.field).string.max_len = 512
29
- ];
30
-
31
- // Optional ordering specification in "field [asc|desc]" form.
32
- optional string order_by = 3 [
33
- (google.api.field_behavior) = OPTIONAL,
34
- (buf.validate.field).string.max_len = 256
35
- ];
36
- }
37
-
38
- // PageResponse captures pagination metadata returned with list results.
39
- message PageResponse {
40
- // Token to retrieve the next page of results, if any.
41
- optional string next_page_token = 1 [(google.api.field_behavior) = OPTIONAL];
42
-
43
- // Total number of items available when known.
44
- optional uint64 total_size = 2 [(google.api.field_behavior) = OPTIONAL];
45
- }
@@ -1,137 +0,0 @@
1
- syntax = "proto3";
2
-
3
- package thru.core.v1;
4
-
5
- import "buf/validate/validate.proto";
6
- import "google/api/field_behavior.proto";
7
- import "google/protobuf/timestamp.proto";
8
- import "thru/common/v1/consensus.proto";
9
- import "thru/core/v1/types.proto";
10
-
11
- option go_package = "github.com/Unto-Labs/thru-net/grpc/pkg/proto/thru/core/v1;corev1";
12
- option java_multiple_files = true;
13
- option java_package = "network.thru.core.v1";
14
- option csharp_namespace = "Thru.Core.V1";
15
- option ruby_package = "Thru::Core::V1";
16
- option objc_class_prefix = "THUC";
17
- option swift_prefix = "THUC";
18
-
19
- // AccountView controls which sections of account resources are returned.
20
- enum AccountView {
21
- // ACCOUNT_VIEW_UNSPECIFIED uses service defaults.
22
- ACCOUNT_VIEW_UNSPECIFIED = 0;
23
-
24
- // ACCOUNT_VIEW_PUBKEY_ONLY returns only the account address.
25
- ACCOUNT_VIEW_PUBKEY_ONLY = 1;
26
-
27
- // ACCOUNT_VIEW_META_ONLY returns only account metadata.
28
- ACCOUNT_VIEW_META_ONLY = 2;
29
-
30
- // ACCOUNT_VIEW_DATA_ONLY returns only account data.
31
- ACCOUNT_VIEW_DATA_ONLY = 3;
32
-
33
- // ACCOUNT_VIEW_FULL returns address, metadata, and data.
34
- ACCOUNT_VIEW_FULL = 4;
35
- }
36
-
37
- // AccountFlags enumerates boolean account capability flags.
38
- message AccountFlags {
39
- bool is_program = 1 [(google.api.field_behavior) = REQUIRED];
40
- bool is_privileged = 2 [(google.api.field_behavior) = REQUIRED];
41
- bool is_uncompressable = 3 [(google.api.field_behavior) = REQUIRED];
42
- bool is_ephemeral = 4 [(google.api.field_behavior) = REQUIRED];
43
- bool is_deleted = 5 [(google.api.field_behavior) = REQUIRED];
44
- bool is_new = 6 [(google.api.field_behavior) = REQUIRED];
45
- bool is_compressed = 7 [(google.api.field_behavior) = REQUIRED];
46
- }
47
-
48
- // AccountMeta captures metadata associated with an account.
49
- message AccountMeta {
50
- uint32 version = 1 [
51
- (google.api.field_behavior) = REQUIRED,
52
- (buf.validate.field).uint32.gte = 1
53
- ];
54
- AccountFlags flags = 2 [(google.api.field_behavior) = REQUIRED];
55
- uint32 data_size = 3 [(google.api.field_behavior) = REQUIRED];
56
- // Account sequence number
57
- uint64 seq = 4 [(google.api.field_behavior) = REQUIRED];
58
- Pubkey owner = 5 [(google.api.field_behavior) = REQUIRED];
59
- uint64 balance = 6 [(google.api.field_behavior) = REQUIRED];
60
- uint64 nonce = 7 [(google.api.field_behavior) = REQUIRED];
61
- }
62
-
63
- // AccountData contains account data payloads.
64
- message AccountData {
65
- optional bytes data = 1 [
66
- (google.api.field_behavior) = OPTIONAL,
67
- (buf.validate.field).bytes.max_len = 16777216
68
- ];
69
- optional bool compressed = 2 [(google.api.field_behavior) = OPTIONAL];
70
- optional string compression_algorithm = 3 [
71
- (google.api.field_behavior) = OPTIONAL,
72
- (buf.validate.field).string.max_len = 64
73
- ];
74
- }
75
-
76
- // DataSlice describes a contiguous range of account data to return.
77
- message DataSlice {
78
- uint32 offset = 1 [
79
- (google.api.field_behavior) = REQUIRED,
80
- (buf.validate.field).uint64.lte = 16777216
81
- ];
82
- uint32 length = 2 [
83
- (google.api.field_behavior) = REQUIRED,
84
- (buf.validate.field).uint64.lte = 16777216
85
- ];
86
- }
87
-
88
- // AccountPage represents a 4KB chunk for streaming account data.
89
- message AccountPage {
90
- uint32 page_idx = 1 [(google.api.field_behavior) = REQUIRED];
91
- uint32 page_size = 2 [
92
- (google.api.field_behavior) = REQUIRED,
93
- (buf.validate.field).uint32.lte = 4096
94
- ];
95
- bytes page_data = 3 [
96
- (google.api.field_behavior) = REQUIRED,
97
- (buf.validate.field).bytes.max_len = 4096
98
- ];
99
- optional bool compressed = 4 [(google.api.field_behavior) = OPTIONAL];
100
- optional string compression_algorithm = 5 [
101
- (google.api.field_behavior) = OPTIONAL,
102
- (buf.validate.field).string.max_len = 64
103
- ];
104
- }
105
-
106
- // VersionContextMetadata captures context for a returned account state.
107
- message VersionContextMetadata {
108
- optional uint64 slot = 1 [(google.api.field_behavior) = OPTIONAL];
109
- optional google.protobuf.Timestamp block_timestamp = 2
110
- [(google.api.field_behavior) = OPTIONAL];
111
- }
112
-
113
- // Account models a fully decoded account resource.
114
- message Account {
115
- Pubkey address = 1 [(google.api.field_behavior) = REQUIRED];
116
- optional AccountMeta meta = 2 [(google.api.field_behavior) = OPTIONAL];
117
- optional AccountData data = 3 [(google.api.field_behavior) = OPTIONAL];
118
- optional VersionContextMetadata version_context = 4
119
- [(google.api.field_behavior) = OPTIONAL];
120
- optional thru.common.v1.ConsensusStatus consensus_status = 5
121
- [(google.api.field_behavior) = OPTIONAL];
122
- }
123
-
124
- // RawAccount captures raw serialized account bytes.
125
- message RawAccount {
126
- Pubkey address = 1 [(google.api.field_behavior) = REQUIRED];
127
- bytes raw_meta = 2 [
128
- (google.api.field_behavior) = REQUIRED,
129
- (buf.validate.field).bytes.max_len = 4096
130
- ];
131
- optional bytes raw_data = 3 [
132
- (google.api.field_behavior) = OPTIONAL,
133
- (buf.validate.field).bytes.max_len = 16777216
134
- ];
135
- optional VersionContextMetadata version_context = 4
136
- [(google.api.field_behavior) = OPTIONAL];
137
- }
@@ -1,80 +0,0 @@
1
- syntax = "proto3";
2
-
3
- package thru.core.v1;
4
-
5
- import "buf/validate/validate.proto";
6
- import "google/api/field_behavior.proto";
7
- import "google/protobuf/timestamp.proto";
8
- import "thru/common/v1/consensus.proto";
9
- import "thru/core/v1/types.proto";
10
-
11
- option go_package = "github.com/Unto-Labs/thru-net/grpc/pkg/proto/thru/core/v1;corev1";
12
- option java_multiple_files = true;
13
- option java_package = "network.thru.core.v1";
14
- option csharp_namespace = "Thru.Core.V1";
15
- option ruby_package = "Thru::Core::V1";
16
- option objc_class_prefix = "THUC";
17
- option swift_prefix = "THUC";
18
-
19
- // BlockView controls how much of a block resource is returned.
20
- enum BlockView {
21
- BLOCK_VIEW_UNSPECIFIED = 0;
22
- BLOCK_VIEW_HEADER_ONLY = 1;
23
- BLOCK_VIEW_HEADER_AND_FOOTER = 2;
24
- BLOCK_VIEW_BODY_ONLY = 3;
25
- BLOCK_VIEW_FULL = 4;
26
- }
27
-
28
- // BlockHeader describes metadata about a block.
29
- message BlockHeader {
30
- uint64 slot = 1 [(google.api.field_behavior) = REQUIRED];
31
- BlockHash block_hash = 2 [(google.api.field_behavior) = REQUIRED];
32
- Signature header_signature = 3 [(google.api.field_behavior) = REQUIRED];
33
- uint32 version = 4 [(google.api.field_behavior) = REQUIRED];
34
- Pubkey producer = 5 [(google.api.field_behavior) = REQUIRED];
35
- google.protobuf.Timestamp expiry_timestamp = 6
36
- [(google.api.field_behavior) = REQUIRED];
37
- uint64 start_slot = 7 [(google.api.field_behavior) = REQUIRED];
38
- uint32 expiry_after = 8 [(google.api.field_behavior) = REQUIRED];
39
- uint32 max_block_size = 9 [(google.api.field_behavior) = REQUIRED];
40
- uint64 max_compute_units = 10 [(google.api.field_behavior) = REQUIRED];
41
- uint32 max_state_units = 11 [(google.api.field_behavior) = REQUIRED];
42
- uint64 price = 12 [(google.api.field_behavior) = REQUIRED];
43
- }
44
-
45
- // ExecutionStatus enumerates block execution results.
46
- enum ExecutionStatus {
47
- EXECUTION_STATUS_UNSPECIFIED = 0;
48
- EXECUTION_STATUS_PENDING = 1;
49
- EXECUTION_STATUS_EXECUTED = 2;
50
- EXECUTION_STATUS_FAILED = 3;
51
- }
52
-
53
- // BlockFooter captures execution result metadata for a block.
54
- message BlockFooter {
55
- Signature signature = 1 [(google.api.field_behavior) = REQUIRED];
56
- ExecutionStatus status = 2 [(google.api.field_behavior) = REQUIRED];
57
- uint64 consumed_compute_units = 3 [(google.api.field_behavior) = REQUIRED];
58
- uint32 consumed_state_units = 4 [(google.api.field_behavior) = REQUIRED];
59
- }
60
-
61
- // Block represents a fully decoded block resource.
62
- message Block {
63
- BlockHeader header = 1 [(google.api.field_behavior) = REQUIRED];
64
- optional BlockFooter footer = 2 [(google.api.field_behavior) = OPTIONAL];
65
- optional bytes body = 3 [
66
- (google.api.field_behavior) = OPTIONAL,
67
- (buf.validate.field).bytes.max_len = 33554432
68
- ];
69
- optional thru.common.v1.ConsensusStatus consensus_status = 4
70
- [(google.api.field_behavior) = OPTIONAL];
71
- }
72
-
73
- // RawBlock captures raw block bytes for direct access.
74
- message RawBlock {
75
- uint64 slot = 1 [(google.api.field_behavior) = REQUIRED];
76
- bytes raw_block = 2 [
77
- (google.api.field_behavior) = REQUIRED,
78
- (buf.validate.field).bytes.max_len = 33554432
79
- ];
80
- }
@@ -1,35 +0,0 @@
1
- syntax = "proto3";
2
-
3
- package thru.core.v1;
4
-
5
- import "google/api/field_behavior.proto";
6
- import "thru/core/v1/types.proto";
7
-
8
- option go_package = "github.com/Unto-Labs/thru-net/grpc/pkg/proto/thru/core/v1;corev1";
9
- option java_multiple_files = true;
10
- option java_package = "network.thru.core.v1";
11
- option csharp_namespace = "Thru.Core.V1";
12
- option ruby_package = "Thru::Core::V1";
13
- option objc_class_prefix = "THUC";
14
- option swift_prefix = "THUC";
15
-
16
- // StateProofType selects the type of state proof to generate.
17
- enum StateProofType {
18
- STATE_PROOF_TYPE_UNSPECIFIED = 0;
19
- STATE_PROOF_TYPE_CREATING = 1;
20
- STATE_PROOF_TYPE_UPDATING = 2;
21
- STATE_PROOF_TYPE_EXISTING = 3;
22
- }
23
-
24
- // StateProofRequest describes a request to generate an account state proof.
25
- message StateProofRequest {
26
- Pubkey address = 1 [(google.api.field_behavior) = REQUIRED];
27
- StateProofType proof_type = 2 [(google.api.field_behavior) = REQUIRED];
28
- optional uint64 target_slot = 3 [(google.api.field_behavior) = OPTIONAL];
29
- }
30
-
31
- // StateProof returns binary proof data along with context.
32
- message StateProof {
33
- bytes proof = 1 [(google.api.field_behavior) = REQUIRED];
34
- uint64 slot = 2 [(google.api.field_behavior) = REQUIRED];
35
- }
@@ -1,136 +0,0 @@
1
- syntax = "proto3";
2
-
3
- package thru.core.v1;
4
-
5
- import "buf/validate/validate.proto";
6
- import "google/api/field_behavior.proto";
7
- import "thru/core/v1/types.proto";
8
-
9
- option go_package = "github.com/Unto-Labs/thru-net/grpc/pkg/proto/thru/core/v1;corev1";
10
- option java_multiple_files = true;
11
- option java_package = "network.thru.core.v1";
12
- option csharp_namespace = "Thru.Core.V1";
13
- option ruby_package = "Thru::Core::V1";
14
- option objc_class_prefix = "THUC";
15
- option swift_prefix = "THUC";
16
-
17
- // TransactionView controls how transactions are materialized in responses.
18
- enum TransactionView {
19
- TRANSACTION_VIEW_UNSPECIFIED = 0;
20
- TRANSACTION_VIEW_SIGNATURE_ONLY = 1;
21
- TRANSACTION_VIEW_HEADER_ONLY = 2;
22
- TRANSACTION_VIEW_HEADER_AND_BODY = 3;
23
- TRANSACTION_VIEW_FULL = 4;
24
- }
25
-
26
- // TransactionVmError enumerates runtime error codes returned by the executor.
27
- enum TransactionVmError {
28
- TRANSACTION_VM_EXECUTE_SUCCESS = 0; // TN_RUNTIME_TXN_EXECUTE_SUCCESS
29
- TRANSACTION_VM_ERROR_INVALID_FORMAT = -255; // TN_RUNTIME_TXN_ERR_INVALID_FORMAT
30
- TRANSACTION_VM_ERROR_INVALID_VERSION = -254; // TN_RUNTIME_TXN_ERR_INVALID_VERSION
31
- TRANSACTION_VM_ERROR_INVALID_FLAGS = -253; // TN_RUNTIME_TXN_ERR_INVALID_FLAGS
32
- TRANSACTION_VM_ERROR_INVALID_SIGNATURE = -252; // TN_RUNTIME_TXN_ERR_INVALID_SIGNATURE
33
- TRANSACTION_VM_ERROR_DUPLICATE_ACCOUNT = -251; // TN_RUNTIME_TXN_ERR_DUPLICATE_ACCOUNT
34
- TRANSACTION_VM_ERROR_UNSORTED_ACCOUNTS = -250; // TN_RUNTIME_TXN_ERR_UNSORTED_ACCOUNTS
35
- TRANSACTION_VM_ERROR_UNSORTED_READWRITE_ACCOUNTS =
36
- -249; // TN_RUNTIME_TXN_ERR_UNSORTED_READWRITE_ACCOUNTS
37
- TRANSACTION_VM_ERROR_UNSORTED_READONLY_ACCOUNTS =
38
- -248; // TN_RUNTIME_TXN_ERR_UNSORTED_READONLY_ACCOUNTS
39
- TRANSACTION_VM_ERROR_ACCOUNT_COUNT_LIMIT_EXCEEDED =
40
- -247; // TN_RUNTIME_TXN_ERR_ACCOUNT_COUNT_LIMIT_EXCEEDED
41
- TRANSACTION_VM_ERROR_NONCE_TOO_LOW = -511; // TN_RUNTIME_TXN_ERR_NONCE_TOO_LOW
42
- TRANSACTION_VM_ERROR_NONCE_TOO_HIGH = -510; // TN_RUNTIME_TXN_ERR_NONCE_TOO_HIGH
43
- TRANSACTION_VM_ERROR_INSUFFICIENT_FEE_PAYER_BALANCE =
44
- -509; // TN_RUNTIME_TXN_ERR_INSUFFICIENT_FEE_PAYER_BALANCE
45
- TRANSACTION_VM_ERROR_FEE_PAYER_ACCOUNT_DOES_NOT_EXIST =
46
- -508; // TN_RUNTIME_TXN_ERR_FEE_PAYER_ACCOUNT_DOES_NOT_EXIST
47
- TRANSACTION_VM_ERROR_NOT_LIVE_YET = -507; // TN_RUNTIME_TXN_ERR_NOT_LIVE_YET
48
- TRANSACTION_VM_ERROR_EXPIRED = -506; // TN_RUNTIME_TXN_ERR_EXPIRED
49
- TRANSACTION_VM_ERROR_INVALID_FEE_PAYER_STATE_PROOF =
50
- -505; // TN_RUNTIME_TXN_ERR_INVALID_FEE_PAYER_STATE_PROOF
51
- TRANSACTION_VM_ERROR_INVALID_FEE_PAYER_STATE_PROOF_TYPE =
52
- -504; // TN_RUNTIME_TXN_ERR_INVALID_FEE_PAYER_STATE_PROOF_TYPE
53
- TRANSACTION_VM_ERROR_INVALID_FEE_PAYER_STATE_PROOF_SLOT =
54
- -503; // TN_RUNTIME_TXN_ERR_INVALID_FEE_PAYER_STATE_PROOF_SLOT
55
- TRANSACTION_VM_ERROR_INVALID_FEE_PAYER_ACCOUNT_OWNER =
56
- -502; // TN_RUNTIME_TXN_ERR_INVALID_FEE_PAYER_ACCOUNT_OWNER
57
- TRANSACTION_VM_ERROR_INVALID_FEE_PAYER_STATE_PROOF_ACCOUNT_OWNER =
58
- -501; // TN_RUNTIME_TXN_ERR_INVALID_FEE_PAYER_STATE_PROOF_ACCOUNT_OWNER
59
- TRANSACTION_VM_ERROR_INVALID_FEE_PAYER_STATE_PROOF_ACCOUNT_META_DATA_SZ =
60
- -500; // TN_RUNTIME_TXN_ERR_INVALID_FEE_PAYER_STATE_PROOF_ACCOUNT_META_DATA_SZ
61
- TRANSACTION_VM_ERROR_VM_FAILED = -767; // TN_RUNTIME_TXN_ERR_VM_FAILED
62
- TRANSACTION_VM_ERROR_INVALID_PROGRAM_ACCOUNT =
63
- -766; // TN_RUNTIME_TXN_ERR_INVALID_PROGRAM_ACCOUNT
64
- TRANSACTION_VM_ERROR_VM_REVERT = -765; // TN_RUNTIME_TXN_ERR_VM_REVERT
65
- TRANSACTION_VM_ERROR_CU_EXHAUSTED = -764; // TN_RUNTIME_TXN_ERR_CU_EXHAUSTED
66
- TRANSACTION_VM_ERROR_SU_EXHAUSTED = -763; // TN_RUNTIME_TXN_ERR_SU_EXHAUSTED
67
- }
68
-
69
- // TransactionHeader carries structured metadata for a transaction.
70
- message TransactionHeader {
71
- Signature fee_payer_signature = 1 [(google.api.field_behavior) = REQUIRED];
72
- uint32 version = 2 [(google.api.field_behavior) = REQUIRED];
73
- uint32 flags = 3 [(google.api.field_behavior) = REQUIRED];
74
- uint32 readwrite_accounts_count = 4 [(google.api.field_behavior) = REQUIRED];
75
- uint32 readonly_accounts_count = 5 [(google.api.field_behavior) = REQUIRED];
76
- uint32 instruction_data_size = 6 [(google.api.field_behavior) = REQUIRED];
77
- uint32 requested_compute_units = 7 [(google.api.field_behavior) = REQUIRED];
78
- uint32 requested_state_units = 8 [(google.api.field_behavior) = REQUIRED];
79
- uint32 requested_memory_units = 9 [(google.api.field_behavior) = REQUIRED];
80
- uint32 expiry_after = 10 [(google.api.field_behavior) = REQUIRED];
81
- uint64 fee = 11 [(google.api.field_behavior) = REQUIRED];
82
- uint64 nonce = 12 [(google.api.field_behavior) = REQUIRED];
83
- uint64 start_slot = 13 [(google.api.field_behavior) = REQUIRED];
84
- Pubkey fee_payer_pubkey = 14 [(google.api.field_behavior) = REQUIRED];
85
- Pubkey program_pubkey = 15 [(google.api.field_behavior) = REQUIRED];
86
- }
87
-
88
- // TransactionExecutionResult captures execution outcomes.
89
- message TransactionExecutionResult {
90
- uint32 consumed_compute_units = 1 [(google.api.field_behavior) = REQUIRED];
91
- uint32 consumed_memory_units = 2 [(google.api.field_behavior) = REQUIRED];
92
- uint32 consumed_state_units = 3 [(google.api.field_behavior) = REQUIRED];
93
- uint64 user_error_code = 4 [(google.api.field_behavior) = REQUIRED];
94
- TransactionVmError vm_error = 5 [(google.api.field_behavior) = REQUIRED];
95
- uint64 execution_result = 6 [(google.api.field_behavior) = REQUIRED];
96
- uint32 pages_used = 7 [(google.api.field_behavior) = REQUIRED];
97
- uint32 events_count = 8 [(google.api.field_behavior) = REQUIRED];
98
- uint32 events_size = 9 [(google.api.field_behavior) = REQUIRED];
99
- repeated Pubkey readwrite_accounts = 10
100
- [(google.api.field_behavior) = OPTIONAL];
101
- repeated Pubkey readonly_accounts = 11
102
- [(google.api.field_behavior) = OPTIONAL];
103
- repeated TransactionEvent events = 12
104
- [(google.api.field_behavior) = OPTIONAL];
105
- }
106
- // TransactionEvent describes an event emitted during transaction execution.
107
- message TransactionEvent {
108
- string event_id = 1 [(google.api.field_behavior) = REQUIRED];
109
- uint32 call_idx = 2 [(google.api.field_behavior) = REQUIRED];
110
- uint32 program_idx = 3 [(google.api.field_behavior) = REQUIRED];
111
- Pubkey program = 4 [(google.api.field_behavior) = REQUIRED];
112
- bytes payload = 5 [(google.api.field_behavior) = REQUIRED];
113
- }
114
-
115
- // Transaction describes a fully decoded transaction resource.
116
- message Transaction {
117
- Signature signature = 1 [(google.api.field_behavior) = REQUIRED];
118
- TransactionHeader header = 2 [(google.api.field_behavior) = REQUIRED];
119
- optional bytes body = 3 [
120
- (google.api.field_behavior) = OPTIONAL,
121
- (buf.validate.field).bytes.max_len = 16777216
122
- ];
123
- optional TransactionExecutionResult execution_result = 4
124
- [(google.api.field_behavior) = OPTIONAL];
125
- optional uint64 slot = 5 [(google.api.field_behavior) = OPTIONAL];
126
- optional uint32 block_offset = 6 [(google.api.field_behavior) = OPTIONAL];
127
- }
128
-
129
- // RawTransaction provides direct access to serialized transaction bytes.
130
- message RawTransaction {
131
- Signature signature = 1 [(google.api.field_behavior) = REQUIRED];
132
- bytes raw_transaction = 2 [
133
- (google.api.field_behavior) = REQUIRED,
134
- (buf.validate.field).bytes.max_len = 16777216
135
- ];
136
- }
@@ -1,50 +0,0 @@
1
- syntax = "proto3";
2
-
3
- package thru.core.v1;
4
-
5
- import "buf/validate/validate.proto";
6
- import "google/api/field_behavior.proto";
7
-
8
- option go_package = "github.com/Unto-Labs/thru-net/grpc/pkg/proto/thru/core/v1;corev1";
9
- option java_multiple_files = true;
10
- option java_package = "network.thru.core.v1";
11
- option csharp_namespace = "Thru.Core.V1";
12
- option ruby_package = "Thru::Core::V1";
13
- option objc_class_prefix = "THUC";
14
- option swift_prefix = "THUC";
15
-
16
- // Pubkey represents a 32-byte public key value.
17
- message Pubkey {
18
- // 32-byte public key buffer.
19
- bytes value = 1 [
20
- (google.api.field_behavior) = REQUIRED,
21
- (buf.validate.field).bytes.len = 32
22
- ];
23
- }
24
-
25
- // Hash represents a 32-byte hash value.
26
- message Hash {
27
- // 32-byte hash buffer.
28
- bytes value = 1 [
29
- (google.api.field_behavior) = REQUIRED,
30
- (buf.validate.field).bytes.len = 32
31
- ];
32
- }
33
-
34
- // BlockHash represents a 64-byte hash for block identifiers.
35
- message BlockHash {
36
- // 64-byte block hash buffer.
37
- bytes value = 1 [
38
- (google.api.field_behavior) = REQUIRED,
39
- (buf.validate.field).bytes.len = 64
40
- ];
41
- }
42
-
43
- // Signature represents a 64-byte signature value.
44
- message Signature {
45
- // 64-byte signature buffer.
46
- bytes value = 1 [
47
- (google.api.field_behavior) = REQUIRED,
48
- (buf.validate.field).bytes.len = 64
49
- ];
50
- }