@thru/thru-sdk 0.1.11 → 0.1.12
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/package.json +3 -3
- package/proto/thru/common/v1/consensus.proto +1 -3
- package/proto/thru/common/v1/errors.proto +4 -6
- package/proto/thru/common/v1/filters.proto +16 -6
- package/proto/thru/common/v1/pagination.proto +6 -8
- package/proto/thru/core/v1/account.proto +26 -27
- package/proto/thru/core/v1/block.proto +13 -15
- package/proto/thru/core/v1/state.proto +2 -4
- package/proto/thru/core/v1/transaction.proto +76 -35
- package/proto/thru/core/v1/types.proto +1 -3
- package/proto/thru/services/v1/command_service.proto +28 -3
- package/proto/thru/services/v1/query_service.proto +47 -47
- package/proto/thru/services/v1/streaming_service.proto +16 -18
- package/thru-ts-client-sdk/test-scripts/create-account.ts +6 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thru/thru-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.12",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/sdk.js",
|
|
6
6
|
"types": "./dist/sdk.d.ts",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"@connectrpc/connect-web": "^2.1.0",
|
|
22
22
|
"@noble/ed25519": "^2.3.0",
|
|
23
23
|
"@noble/hashes": "^1.4.0",
|
|
24
|
-
"@thru/crypto": "0.1.
|
|
25
|
-
"@thru/helpers": "0.1.
|
|
24
|
+
"@thru/crypto": "0.1.12",
|
|
25
|
+
"@thru/helpers": "0.1.12"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@bufbuild/buf": "^1.58.0",
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
syntax = "proto3";
|
|
2
2
|
|
|
3
3
|
package thru.common.v1;
|
|
4
4
|
|
|
5
|
-
option features.field_presence = EXPLICIT;
|
|
6
|
-
|
|
7
5
|
import "buf/validate/validate.proto";
|
|
8
6
|
import "google/api/field_behavior.proto";
|
|
9
7
|
import "google/protobuf/timestamp.proto";
|
|
@@ -52,15 +50,15 @@ message ErrorDetail {
|
|
|
52
50
|
];
|
|
53
51
|
|
|
54
52
|
// Optional retention window expressed in slots when applicable.
|
|
55
|
-
uint64 retention_window_slots = 3
|
|
53
|
+
optional uint64 retention_window_slots = 3
|
|
56
54
|
[(google.api.field_behavior) = OPTIONAL];
|
|
57
55
|
|
|
58
56
|
// Optional retention cutoff timestamp when applicable.
|
|
59
|
-
google.protobuf.Timestamp retention_cutoff = 4
|
|
57
|
+
optional google.protobuf.Timestamp retention_cutoff = 4
|
|
60
58
|
[(google.api.field_behavior) = OPTIONAL];
|
|
61
59
|
|
|
62
60
|
// Optional name of the field associated with the error.
|
|
63
|
-
string field_name = 5 [
|
|
61
|
+
optional string field_name = 5 [
|
|
64
62
|
(google.api.field_behavior) = OPTIONAL,
|
|
65
63
|
(buf.validate.field).string.max_len = 128
|
|
66
64
|
];
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
syntax = "proto3";
|
|
2
2
|
|
|
3
3
|
package thru.common.v1;
|
|
4
4
|
|
|
5
|
-
option features.field_presence = EXPLICIT;
|
|
6
|
-
|
|
7
5
|
import "buf/validate/validate.proto";
|
|
8
6
|
import "google/api/field_behavior.proto";
|
|
9
7
|
|
|
@@ -18,13 +16,25 @@ option swift_prefix = "THU";
|
|
|
18
16
|
// Filter represents a CEL-based expression applied to query or stream results.
|
|
19
17
|
message Filter {
|
|
20
18
|
// CEL expression applied server-side. Empty expressions are treated as no-op.
|
|
21
|
-
string expression = 1 [
|
|
19
|
+
optional string expression = 1 [
|
|
22
20
|
(google.api.field_behavior) = OPTIONAL,
|
|
23
21
|
(buf.validate.field).string.max_len = 4096
|
|
24
22
|
];
|
|
25
23
|
|
|
26
24
|
// Named parameter bindings for expression parameterization.
|
|
27
|
-
map<string,
|
|
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
|
+
}
|
|
28
38
|
}
|
|
29
39
|
|
|
30
40
|
// CelFilterValidation describes the validation configuration returned to
|
|
@@ -43,7 +53,7 @@ message CelFilterValidation {
|
|
|
43
53
|
];
|
|
44
54
|
|
|
45
55
|
// Maximum AST node count permitted for a CEL expression.
|
|
46
|
-
uint32 max_complexity = 3 [
|
|
56
|
+
optional uint32 max_complexity = 3 [
|
|
47
57
|
(google.api.field_behavior) = OPTIONAL,
|
|
48
58
|
(buf.validate.field).uint32.lte = 1000
|
|
49
59
|
];
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
syntax = "proto3";
|
|
2
2
|
|
|
3
3
|
package thru.common.v1;
|
|
4
4
|
|
|
5
|
-
option features.field_presence = EXPLICIT;
|
|
6
|
-
|
|
7
5
|
import "buf/validate/validate.proto";
|
|
8
6
|
import "google/api/field_behavior.proto";
|
|
9
7
|
|
|
@@ -18,20 +16,20 @@ option swift_prefix = "THU";
|
|
|
18
16
|
// PageRequest contains pagination parameters for listing RPCs.
|
|
19
17
|
message PageRequest {
|
|
20
18
|
// Maximum number of items to return in a single response.
|
|
21
|
-
uint32 page_size = 1 [
|
|
19
|
+
optional uint32 page_size = 1 [
|
|
22
20
|
(google.api.field_behavior) = OPTIONAL,
|
|
23
21
|
(buf.validate.field).uint32.gte = 1,
|
|
24
22
|
(buf.validate.field).uint32.lte = 1000
|
|
25
23
|
];
|
|
26
24
|
|
|
27
25
|
// Token identifying the position to resume from.
|
|
28
|
-
string page_token = 2 [
|
|
26
|
+
optional string page_token = 2 [
|
|
29
27
|
(google.api.field_behavior) = OPTIONAL,
|
|
30
28
|
(buf.validate.field).string.max_len = 512
|
|
31
29
|
];
|
|
32
30
|
|
|
33
31
|
// Optional ordering specification in "field [asc|desc]" form.
|
|
34
|
-
string order_by = 3 [
|
|
32
|
+
optional string order_by = 3 [
|
|
35
33
|
(google.api.field_behavior) = OPTIONAL,
|
|
36
34
|
(buf.validate.field).string.max_len = 256
|
|
37
35
|
];
|
|
@@ -40,8 +38,8 @@ message PageRequest {
|
|
|
40
38
|
// PageResponse captures pagination metadata returned with list results.
|
|
41
39
|
message PageResponse {
|
|
42
40
|
// Token to retrieve the next page of results, if any.
|
|
43
|
-
string next_page_token = 1 [(google.api.field_behavior) = OPTIONAL];
|
|
41
|
+
optional string next_page_token = 1 [(google.api.field_behavior) = OPTIONAL];
|
|
44
42
|
|
|
45
43
|
// Total number of items available when known.
|
|
46
|
-
uint64 total_size = 2 [(google.api.field_behavior) = OPTIONAL];
|
|
44
|
+
optional uint64 total_size = 2 [(google.api.field_behavior) = OPTIONAL];
|
|
47
45
|
}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
syntax = "proto3";
|
|
2
2
|
|
|
3
3
|
package thru.core.v1;
|
|
4
4
|
|
|
5
|
-
option features.field_presence = EXPLICIT;
|
|
6
|
-
|
|
7
5
|
import "buf/validate/validate.proto";
|
|
8
6
|
import "google/api/field_behavior.proto";
|
|
9
7
|
import "google/protobuf/timestamp.proto";
|
|
@@ -38,13 +36,13 @@ enum AccountView {
|
|
|
38
36
|
|
|
39
37
|
// AccountFlags enumerates boolean account capability flags.
|
|
40
38
|
message AccountFlags {
|
|
41
|
-
bool is_program = 1 [(google.api.field_behavior) =
|
|
42
|
-
bool is_privileged = 2 [(google.api.field_behavior) =
|
|
43
|
-
bool is_uncompressable = 3 [(google.api.field_behavior) =
|
|
44
|
-
bool is_ephemeral = 4 [(google.api.field_behavior) =
|
|
45
|
-
bool is_deleted = 5 [(google.api.field_behavior) =
|
|
46
|
-
bool is_new = 6 [(google.api.field_behavior) =
|
|
47
|
-
bool is_compressed = 7 [(google.api.field_behavior) =
|
|
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];
|
|
48
46
|
}
|
|
49
47
|
|
|
50
48
|
// AccountMeta captures metadata associated with an account.
|
|
@@ -53,22 +51,23 @@ message AccountMeta {
|
|
|
53
51
|
(google.api.field_behavior) = REQUIRED,
|
|
54
52
|
(buf.validate.field).uint32.gte = 1
|
|
55
53
|
];
|
|
56
|
-
AccountFlags flags = 2 [(google.api.field_behavior) =
|
|
54
|
+
AccountFlags flags = 2 [(google.api.field_behavior) = REQUIRED];
|
|
57
55
|
uint32 data_size = 3 [(google.api.field_behavior) = REQUIRED];
|
|
58
|
-
|
|
56
|
+
// Account sequence number
|
|
57
|
+
uint64 seq = 4 [(google.api.field_behavior) = REQUIRED];
|
|
59
58
|
Pubkey owner = 5 [(google.api.field_behavior) = REQUIRED];
|
|
60
|
-
uint64 balance = 6 [(google.api.field_behavior) =
|
|
61
|
-
uint64 nonce = 7 [(google.api.field_behavior) =
|
|
59
|
+
uint64 balance = 6 [(google.api.field_behavior) = REQUIRED];
|
|
60
|
+
uint64 nonce = 7 [(google.api.field_behavior) = REQUIRED];
|
|
62
61
|
}
|
|
63
62
|
|
|
64
63
|
// AccountData contains account data payloads.
|
|
65
64
|
message AccountData {
|
|
66
|
-
bytes data = 1 [
|
|
65
|
+
optional bytes data = 1 [
|
|
67
66
|
(google.api.field_behavior) = OPTIONAL,
|
|
68
67
|
(buf.validate.field).bytes.max_len = 16777216
|
|
69
68
|
];
|
|
70
|
-
bool compressed = 2 [(google.api.field_behavior) = OPTIONAL];
|
|
71
|
-
string compression_algorithm = 3 [
|
|
69
|
+
optional bool compressed = 2 [(google.api.field_behavior) = OPTIONAL];
|
|
70
|
+
optional string compression_algorithm = 3 [
|
|
72
71
|
(google.api.field_behavior) = OPTIONAL,
|
|
73
72
|
(buf.validate.field).string.max_len = 64
|
|
74
73
|
];
|
|
@@ -97,8 +96,8 @@ message AccountPage {
|
|
|
97
96
|
(google.api.field_behavior) = REQUIRED,
|
|
98
97
|
(buf.validate.field).bytes.max_len = 4096
|
|
99
98
|
];
|
|
100
|
-
bool compressed = 4 [(google.api.field_behavior) = OPTIONAL];
|
|
101
|
-
string compression_algorithm = 5 [
|
|
99
|
+
optional bool compressed = 4 [(google.api.field_behavior) = OPTIONAL];
|
|
100
|
+
optional string compression_algorithm = 5 [
|
|
102
101
|
(google.api.field_behavior) = OPTIONAL,
|
|
103
102
|
(buf.validate.field).string.max_len = 64
|
|
104
103
|
];
|
|
@@ -106,19 +105,19 @@ message AccountPage {
|
|
|
106
105
|
|
|
107
106
|
// VersionContextMetadata captures context for a returned account state.
|
|
108
107
|
message VersionContextMetadata {
|
|
109
|
-
uint64 slot = 1 [(google.api.field_behavior) = OPTIONAL];
|
|
110
|
-
google.protobuf.Timestamp block_timestamp = 2
|
|
108
|
+
optional uint64 slot = 1 [(google.api.field_behavior) = OPTIONAL];
|
|
109
|
+
optional google.protobuf.Timestamp block_timestamp = 2
|
|
111
110
|
[(google.api.field_behavior) = OPTIONAL];
|
|
112
111
|
}
|
|
113
112
|
|
|
114
113
|
// Account models a fully decoded account resource.
|
|
115
114
|
message Account {
|
|
116
115
|
Pubkey address = 1 [(google.api.field_behavior) = REQUIRED];
|
|
117
|
-
AccountMeta meta = 2 [(google.api.field_behavior) = OPTIONAL];
|
|
118
|
-
AccountData data = 3 [(google.api.field_behavior) = OPTIONAL];
|
|
119
|
-
VersionContextMetadata version_context = 4
|
|
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
|
|
120
119
|
[(google.api.field_behavior) = OPTIONAL];
|
|
121
|
-
thru.common.v1.ConsensusStatus consensus_status = 5
|
|
120
|
+
optional thru.common.v1.ConsensusStatus consensus_status = 5
|
|
122
121
|
[(google.api.field_behavior) = OPTIONAL];
|
|
123
122
|
}
|
|
124
123
|
|
|
@@ -129,10 +128,10 @@ message RawAccount {
|
|
|
129
128
|
(google.api.field_behavior) = REQUIRED,
|
|
130
129
|
(buf.validate.field).bytes.max_len = 4096
|
|
131
130
|
];
|
|
132
|
-
bytes raw_data = 3 [
|
|
131
|
+
optional bytes raw_data = 3 [
|
|
133
132
|
(google.api.field_behavior) = OPTIONAL,
|
|
134
133
|
(buf.validate.field).bytes.max_len = 16777216
|
|
135
134
|
];
|
|
136
|
-
VersionContextMetadata version_context = 4
|
|
135
|
+
optional VersionContextMetadata version_context = 4
|
|
137
136
|
[(google.api.field_behavior) = OPTIONAL];
|
|
138
137
|
}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
syntax = "proto3";
|
|
2
2
|
|
|
3
3
|
package thru.core.v1;
|
|
4
4
|
|
|
5
|
-
option features.field_presence = EXPLICIT;
|
|
6
|
-
|
|
7
5
|
import "buf/validate/validate.proto";
|
|
8
6
|
import "google/api/field_behavior.proto";
|
|
9
7
|
import "google/protobuf/timestamp.proto";
|
|
@@ -35,13 +33,13 @@ message BlockHeader {
|
|
|
35
33
|
uint32 version = 4 [(google.api.field_behavior) = REQUIRED];
|
|
36
34
|
Pubkey producer = 5 [(google.api.field_behavior) = REQUIRED];
|
|
37
35
|
google.protobuf.Timestamp expiry_timestamp = 6
|
|
38
|
-
[(google.api.field_behavior) =
|
|
39
|
-
uint64 start_slot = 7 [(google.api.field_behavior) =
|
|
40
|
-
uint32 expiry_after = 8 [(google.api.field_behavior) =
|
|
41
|
-
uint32 max_block_size = 9 [(google.api.field_behavior) =
|
|
42
|
-
uint64 max_compute_units = 10 [(google.api.field_behavior) =
|
|
43
|
-
uint32 max_state_units = 11 [(google.api.field_behavior) =
|
|
44
|
-
uint64 price = 12 [(google.api.field_behavior) =
|
|
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];
|
|
45
43
|
}
|
|
46
44
|
|
|
47
45
|
// ExecutionStatus enumerates block execution results.
|
|
@@ -56,19 +54,19 @@ enum ExecutionStatus {
|
|
|
56
54
|
message BlockFooter {
|
|
57
55
|
Signature signature = 1 [(google.api.field_behavior) = REQUIRED];
|
|
58
56
|
ExecutionStatus status = 2 [(google.api.field_behavior) = REQUIRED];
|
|
59
|
-
uint64 consumed_compute_units = 3 [(google.api.field_behavior) =
|
|
60
|
-
uint32 consumed_state_units = 4 [(google.api.field_behavior) =
|
|
57
|
+
uint64 consumed_compute_units = 3 [(google.api.field_behavior) = REQUIRED];
|
|
58
|
+
uint32 consumed_state_units = 4 [(google.api.field_behavior) = REQUIRED];
|
|
61
59
|
}
|
|
62
60
|
|
|
63
61
|
// Block represents a fully decoded block resource.
|
|
64
62
|
message Block {
|
|
65
63
|
BlockHeader header = 1 [(google.api.field_behavior) = REQUIRED];
|
|
66
|
-
BlockFooter footer = 2 [(google.api.field_behavior) = OPTIONAL];
|
|
67
|
-
bytes body = 3 [
|
|
64
|
+
optional BlockFooter footer = 2 [(google.api.field_behavior) = OPTIONAL];
|
|
65
|
+
optional bytes body = 3 [
|
|
68
66
|
(google.api.field_behavior) = OPTIONAL,
|
|
69
67
|
(buf.validate.field).bytes.max_len = 33554432
|
|
70
68
|
];
|
|
71
|
-
thru.common.v1.ConsensusStatus consensus_status = 4
|
|
69
|
+
optional thru.common.v1.ConsensusStatus consensus_status = 4
|
|
72
70
|
[(google.api.field_behavior) = OPTIONAL];
|
|
73
71
|
}
|
|
74
72
|
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
syntax = "proto3";
|
|
2
2
|
|
|
3
3
|
package thru.core.v1;
|
|
4
4
|
|
|
5
|
-
option features.field_presence = EXPLICIT;
|
|
6
|
-
|
|
7
5
|
import "google/api/field_behavior.proto";
|
|
8
6
|
import "thru/core/v1/types.proto";
|
|
9
7
|
|
|
@@ -27,7 +25,7 @@ enum StateProofType {
|
|
|
27
25
|
message StateProofRequest {
|
|
28
26
|
Pubkey address = 1 [(google.api.field_behavior) = REQUIRED];
|
|
29
27
|
StateProofType proof_type = 2 [(google.api.field_behavior) = REQUIRED];
|
|
30
|
-
uint64 target_slot = 3 [(google.api.field_behavior) = OPTIONAL];
|
|
28
|
+
optional uint64 target_slot = 3 [(google.api.field_behavior) = OPTIONAL];
|
|
31
29
|
}
|
|
32
30
|
|
|
33
31
|
// StateProof returns binary proof data along with context.
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
syntax = "proto3";
|
|
2
2
|
|
|
3
3
|
package thru.core.v1;
|
|
4
4
|
|
|
5
|
-
option features.field_presence = EXPLICIT;
|
|
6
|
-
|
|
7
5
|
import "buf/validate/validate.proto";
|
|
8
6
|
import "google/api/field_behavior.proto";
|
|
9
7
|
import "thru/core/v1/types.proto";
|
|
@@ -25,36 +23,79 @@ enum TransactionView {
|
|
|
25
23
|
TRANSACTION_VIEW_FULL = 4;
|
|
26
24
|
}
|
|
27
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
|
+
|
|
28
69
|
// TransactionHeader carries structured metadata for a transaction.
|
|
29
70
|
message TransactionHeader {
|
|
30
71
|
Signature fee_payer_signature = 1 [(google.api.field_behavior) = REQUIRED];
|
|
31
72
|
uint32 version = 2 [(google.api.field_behavior) = REQUIRED];
|
|
32
|
-
uint32 flags = 3 [(google.api.field_behavior) =
|
|
33
|
-
uint32 readwrite_accounts_count = 4 [(google.api.field_behavior) =
|
|
34
|
-
uint32 readonly_accounts_count = 5 [(google.api.field_behavior) =
|
|
35
|
-
uint32 instruction_data_size = 6 [(google.api.field_behavior) =
|
|
36
|
-
uint32 requested_compute_units = 7 [(google.api.field_behavior) =
|
|
37
|
-
uint32 requested_state_units = 8 [(google.api.field_behavior) =
|
|
38
|
-
uint32 requested_memory_units = 9 [(google.api.field_behavior) =
|
|
39
|
-
uint32 expiry_after = 10 [(google.api.field_behavior) =
|
|
40
|
-
uint64 fee = 11 [(google.api.field_behavior) =
|
|
41
|
-
uint64 nonce = 12 [(google.api.field_behavior) =
|
|
42
|
-
uint64 start_slot = 13 [(google.api.field_behavior) =
|
|
43
|
-
Pubkey fee_payer_pubkey = 14 [(google.api.field_behavior) =
|
|
44
|
-
Pubkey program_pubkey = 15 [(google.api.field_behavior) =
|
|
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];
|
|
45
86
|
}
|
|
46
87
|
|
|
47
88
|
// TransactionExecutionResult captures execution outcomes.
|
|
48
89
|
message TransactionExecutionResult {
|
|
49
|
-
uint32 consumed_compute_units = 1 [(google.api.field_behavior) =
|
|
50
|
-
uint32 consumed_memory_units = 2 [(google.api.field_behavior) =
|
|
51
|
-
uint32 consumed_state_units = 3 [(google.api.field_behavior) =
|
|
52
|
-
uint64 user_error_code = 4 [(google.api.field_behavior) =
|
|
53
|
-
|
|
54
|
-
uint64 execution_result = 6 [(google.api.field_behavior) =
|
|
55
|
-
uint32 pages_used = 7 [(google.api.field_behavior) =
|
|
56
|
-
uint32 events_count = 8 [(google.api.field_behavior) =
|
|
57
|
-
uint32 events_size = 9 [(google.api.field_behavior) =
|
|
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];
|
|
58
99
|
repeated Pubkey readwrite_accounts = 10
|
|
59
100
|
[(google.api.field_behavior) = OPTIONAL];
|
|
60
101
|
repeated Pubkey readonly_accounts = 11
|
|
@@ -64,25 +105,25 @@ message TransactionExecutionResult {
|
|
|
64
105
|
}
|
|
65
106
|
// TransactionEvent describes an event emitted during transaction execution.
|
|
66
107
|
message TransactionEvent {
|
|
67
|
-
string event_id = 1 [(google.api.field_behavior) =
|
|
68
|
-
uint32 call_idx = 2 [(google.api.field_behavior) =
|
|
69
|
-
uint32 program_idx = 3 [(google.api.field_behavior) =
|
|
70
|
-
Pubkey program = 4 [(google.api.field_behavior) =
|
|
71
|
-
bytes payload = 5 [(google.api.field_behavior) =
|
|
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];
|
|
72
113
|
}
|
|
73
114
|
|
|
74
115
|
// Transaction describes a fully decoded transaction resource.
|
|
75
116
|
message Transaction {
|
|
76
117
|
Signature signature = 1 [(google.api.field_behavior) = REQUIRED];
|
|
77
|
-
TransactionHeader header = 2 [(google.api.field_behavior) =
|
|
78
|
-
bytes body = 3 [
|
|
118
|
+
TransactionHeader header = 2 [(google.api.field_behavior) = REQUIRED];
|
|
119
|
+
optional bytes body = 3 [
|
|
79
120
|
(google.api.field_behavior) = OPTIONAL,
|
|
80
121
|
(buf.validate.field).bytes.max_len = 16777216
|
|
81
122
|
];
|
|
82
|
-
TransactionExecutionResult execution_result = 4
|
|
123
|
+
optional TransactionExecutionResult execution_result = 4
|
|
83
124
|
[(google.api.field_behavior) = OPTIONAL];
|
|
84
|
-
uint64 slot = 5 [(google.api.field_behavior) = OPTIONAL];
|
|
85
|
-
uint32 block_offset = 6 [(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];
|
|
86
127
|
}
|
|
87
128
|
|
|
88
129
|
// RawTransaction provides direct access to serialized transaction bytes.
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
syntax = "proto3";
|
|
2
2
|
|
|
3
3
|
package thru.services.v1;
|
|
4
4
|
|
|
5
|
-
option features.field_presence = EXPLICIT;
|
|
6
|
-
|
|
7
5
|
import "google/api/annotations.proto";
|
|
8
6
|
import "google/api/client.proto";
|
|
9
7
|
import "google/api/field_behavior.proto";
|
|
@@ -29,6 +27,24 @@ message SendTransactionResponse {
|
|
|
29
27
|
thru.core.v1.Signature signature = 1 [(google.api.field_behavior) = REQUIRED];
|
|
30
28
|
}
|
|
31
29
|
|
|
30
|
+
// BatchSendTransactionsRequest submits multiple transactions to the cluster.
|
|
31
|
+
message BatchSendTransactionsRequest {
|
|
32
|
+
// List of raw transaction bytes encoded according to chain specification.
|
|
33
|
+
repeated bytes raw_transactions = 1 [(google.api.field_behavior) = REQUIRED];
|
|
34
|
+
|
|
35
|
+
// Number of retries for each transaction if not accepted by UDS (defaults to 0).
|
|
36
|
+
int32 num_retries = 2;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// BatchSendTransactionsResponse returns submission results for each transaction.
|
|
40
|
+
message BatchSendTransactionsResponse {
|
|
41
|
+
// Signatures for each transaction (in same order as request).
|
|
42
|
+
repeated thru.core.v1.Signature signatures = 1 [(google.api.field_behavior) = REQUIRED];
|
|
43
|
+
|
|
44
|
+
// Acceptance status for each transaction (true if accepted, false if not).
|
|
45
|
+
repeated bool accepted = 2 [(google.api.field_behavior) = REQUIRED];
|
|
46
|
+
}
|
|
47
|
+
|
|
32
48
|
// CommandService defines transactional RPCs that mutate state or perform
|
|
33
49
|
// expensive computations.
|
|
34
50
|
service CommandService {
|
|
@@ -42,4 +58,13 @@ service CommandService {
|
|
|
42
58
|
body: "*"
|
|
43
59
|
};
|
|
44
60
|
}
|
|
61
|
+
|
|
62
|
+
// Submit multiple transactions to the cluster in batch.
|
|
63
|
+
rpc BatchSendTransactions(BatchSendTransactionsRequest)
|
|
64
|
+
returns (BatchSendTransactionsResponse) {
|
|
65
|
+
option (google.api.http) = {
|
|
66
|
+
post: "/v1/transactions/batch"
|
|
67
|
+
body: "*"
|
|
68
|
+
};
|
|
69
|
+
}
|
|
45
70
|
}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
syntax = "proto3";
|
|
2
2
|
|
|
3
3
|
package thru.services.v1;
|
|
4
4
|
|
|
5
|
-
option features.field_presence = EXPLICIT;
|
|
6
|
-
|
|
7
5
|
import "buf/validate/validate.proto";
|
|
8
6
|
import "google/api/annotations.proto";
|
|
9
7
|
import "google/api/client.proto";
|
|
@@ -28,35 +26,32 @@ option swift_prefix = "THUS";
|
|
|
28
26
|
// GetAccountRequest retrieves a decoded account by public key.
|
|
29
27
|
message GetAccountRequest {
|
|
30
28
|
thru.core.v1.Pubkey address = 1 [(google.api.field_behavior) = REQUIRED];
|
|
31
|
-
thru.core.v1.AccountView view = 2 [(google.api.field_behavior) = OPTIONAL];
|
|
29
|
+
optional thru.core.v1.AccountView view = 2 [(google.api.field_behavior) = OPTIONAL];
|
|
32
30
|
thru.common.v1.VersionContext version_context = 3
|
|
33
31
|
[(google.api.field_behavior) = REQUIRED];
|
|
34
|
-
thru.common.v1.ConsensusStatus min_consensus = 4
|
|
32
|
+
optional thru.common.v1.ConsensusStatus min_consensus = 4
|
|
35
33
|
[(google.api.field_behavior) = OPTIONAL];
|
|
36
|
-
thru.core.v1.DataSlice data_slice =
|
|
34
|
+
optional thru.core.v1.DataSlice data_slice = 5
|
|
37
35
|
[(google.api.field_behavior) = OPTIONAL];
|
|
38
|
-
|
|
39
|
-
reserved 5;
|
|
40
|
-
reserved skip_data;
|
|
41
36
|
}
|
|
42
37
|
|
|
43
38
|
// GetRawAccountRequest retrieves raw account bytes by public key.
|
|
44
39
|
message GetRawAccountRequest {
|
|
45
40
|
thru.core.v1.Pubkey address = 1 [(google.api.field_behavior) = REQUIRED];
|
|
46
|
-
thru.core.v1.AccountView view = 2 [(google.api.field_behavior) = OPTIONAL];
|
|
41
|
+
optional thru.core.v1.AccountView view = 2 [(google.api.field_behavior) = OPTIONAL];
|
|
47
42
|
thru.common.v1.VersionContext version_context = 3
|
|
48
43
|
[(google.api.field_behavior) = REQUIRED];
|
|
49
|
-
thru.common.v1.ConsensusStatus min_consensus = 4
|
|
44
|
+
optional thru.common.v1.ConsensusStatus min_consensus = 4
|
|
50
45
|
[(google.api.field_behavior) = OPTIONAL];
|
|
51
46
|
}
|
|
52
47
|
|
|
53
48
|
// GetTransactionRequest retrieves a decoded transaction by signature.
|
|
54
49
|
message GetTransactionRequest {
|
|
55
50
|
thru.core.v1.Signature signature = 1 [(google.api.field_behavior) = REQUIRED];
|
|
56
|
-
thru.core.v1.TransactionView view = 2 [(google.api.field_behavior) = OPTIONAL];
|
|
51
|
+
optional thru.core.v1.TransactionView view = 2 [(google.api.field_behavior) = OPTIONAL];
|
|
57
52
|
thru.common.v1.VersionContext version_context = 3
|
|
58
53
|
[(google.api.field_behavior) = REQUIRED];
|
|
59
|
-
thru.common.v1.ConsensusStatus min_consensus = 4
|
|
54
|
+
optional thru.common.v1.ConsensusStatus min_consensus = 4
|
|
60
55
|
[(google.api.field_behavior) = OPTIONAL];
|
|
61
56
|
}
|
|
62
57
|
|
|
@@ -65,7 +60,7 @@ message GetRawTransactionRequest {
|
|
|
65
60
|
thru.core.v1.Signature signature = 1 [(google.api.field_behavior) = REQUIRED];
|
|
66
61
|
thru.common.v1.VersionContext version_context = 2
|
|
67
62
|
[(google.api.field_behavior) = REQUIRED];
|
|
68
|
-
thru.common.v1.ConsensusStatus min_consensus = 3
|
|
63
|
+
optional thru.common.v1.ConsensusStatus min_consensus = 3
|
|
69
64
|
[(google.api.field_behavior) = OPTIONAL];
|
|
70
65
|
}
|
|
71
66
|
|
|
@@ -92,8 +87,8 @@ message GetBlockRequest {
|
|
|
92
87
|
uint64 slot = 1 [(google.api.field_behavior) = OPTIONAL];
|
|
93
88
|
thru.core.v1.BlockHash block_hash = 2 [(google.api.field_behavior) = OPTIONAL];
|
|
94
89
|
}
|
|
95
|
-
thru.core.v1.BlockView view = 3 [(google.api.field_behavior) = OPTIONAL];
|
|
96
|
-
thru.common.v1.ConsensusStatus min_consensus = 4
|
|
90
|
+
optional thru.core.v1.BlockView view = 3 [(google.api.field_behavior) = OPTIONAL];
|
|
91
|
+
optional thru.common.v1.ConsensusStatus min_consensus = 4
|
|
97
92
|
[(google.api.field_behavior) = OPTIONAL];
|
|
98
93
|
}
|
|
99
94
|
|
|
@@ -109,36 +104,40 @@ message GetRawBlockRequest {
|
|
|
109
104
|
uint64 slot = 1 [(google.api.field_behavior) = OPTIONAL];
|
|
110
105
|
thru.core.v1.BlockHash block_hash = 2 [(google.api.field_behavior) = OPTIONAL];
|
|
111
106
|
}
|
|
112
|
-
thru.common.v1.ConsensusStatus min_consensus = 3
|
|
107
|
+
optional thru.common.v1.ConsensusStatus min_consensus = 3
|
|
113
108
|
[(google.api.field_behavior) = OPTIONAL];
|
|
114
109
|
}
|
|
115
110
|
|
|
116
|
-
//
|
|
117
|
-
message
|
|
118
|
-
thru.core.v1.
|
|
119
|
-
thru.
|
|
120
|
-
thru.common.v1.VersionContext version_context = 3
|
|
111
|
+
// ListAccountsRequest lists accounts using CEL filters.
|
|
112
|
+
message ListAccountsRequest {
|
|
113
|
+
optional thru.core.v1.AccountView view = 1 [(google.api.field_behavior) = OPTIONAL];
|
|
114
|
+
optional thru.common.v1.VersionContext version_context = 2
|
|
121
115
|
[(google.api.field_behavior) = OPTIONAL];
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
116
|
+
|
|
117
|
+
// Optional CEL filter applied server-side. To emulate the legacy
|
|
118
|
+
// ListOwnedAccounts RPC, set:
|
|
119
|
+
// filter.expression = "meta.owner.value == params.owner_bytes"
|
|
120
|
+
// filter.params["owner_bytes"].bytes_value = <32-byte owner pubkey>
|
|
121
|
+
optional thru.common.v1.Filter filter = 3 [(google.api.field_behavior) = OPTIONAL];
|
|
122
|
+
optional thru.common.v1.PageRequest page = 4 [(google.api.field_behavior) = OPTIONAL];
|
|
123
|
+
optional thru.common.v1.ConsensusStatus min_consensus = 5
|
|
125
124
|
[(google.api.field_behavior) = OPTIONAL];
|
|
126
125
|
}
|
|
127
126
|
|
|
128
|
-
//
|
|
129
|
-
message
|
|
127
|
+
// ListAccountsResponse contains paginated accounts.
|
|
128
|
+
message ListAccountsResponse {
|
|
130
129
|
repeated thru.core.v1.Account accounts = 1
|
|
131
130
|
[(google.api.field_behavior) = OPTIONAL];
|
|
132
|
-
thru.common.v1.PageResponse page = 2
|
|
131
|
+
optional thru.common.v1.PageResponse page = 2
|
|
133
132
|
[(google.api.field_behavior) = OPTIONAL];
|
|
134
133
|
}
|
|
135
134
|
|
|
136
135
|
// ListBlocksRequest lists blocks with pagination and filtering.
|
|
137
136
|
message ListBlocksRequest {
|
|
138
|
-
thru.common.v1.Filter filter = 1 [(google.api.field_behavior) = OPTIONAL];
|
|
139
|
-
thru.common.v1.PageRequest page = 2 [(google.api.field_behavior) = OPTIONAL];
|
|
140
|
-
thru.core.v1.BlockView view = 3 [(google.api.field_behavior) = OPTIONAL];
|
|
141
|
-
thru.common.v1.ConsensusStatus min_consensus = 4
|
|
137
|
+
optional thru.common.v1.Filter filter = 1 [(google.api.field_behavior) = OPTIONAL];
|
|
138
|
+
optional thru.common.v1.PageRequest page = 2 [(google.api.field_behavior) = OPTIONAL];
|
|
139
|
+
optional thru.core.v1.BlockView view = 3 [(google.api.field_behavior) = OPTIONAL];
|
|
140
|
+
optional thru.common.v1.ConsensusStatus min_consensus = 4
|
|
142
141
|
[(google.api.field_behavior) = OPTIONAL];
|
|
143
142
|
}
|
|
144
143
|
|
|
@@ -146,21 +145,23 @@ message ListBlocksRequest {
|
|
|
146
145
|
message ListBlocksResponse {
|
|
147
146
|
repeated thru.core.v1.Block blocks = 1
|
|
148
147
|
[(google.api.field_behavior) = OPTIONAL];
|
|
149
|
-
thru.common.v1.PageResponse page = 2
|
|
148
|
+
optional thru.common.v1.PageResponse page = 2
|
|
150
149
|
[(google.api.field_behavior) = OPTIONAL];
|
|
151
150
|
}
|
|
152
151
|
|
|
153
152
|
// ListTransactionsForAccountRequest lists transaction signatures involving an account.
|
|
154
153
|
message ListTransactionsForAccountRequest {
|
|
155
154
|
thru.core.v1.Pubkey account = 1 [(google.api.field_behavior) = REQUIRED];
|
|
156
|
-
thru.common.v1.PageRequest page = 2 [(google.api.field_behavior) = OPTIONAL];
|
|
155
|
+
optional thru.common.v1.PageRequest page = 2 [(google.api.field_behavior) = OPTIONAL];
|
|
156
|
+
// Optional CEL filter applied after the account constraint.
|
|
157
|
+
optional thru.common.v1.Filter filter = 3 [(google.api.field_behavior) = OPTIONAL];
|
|
157
158
|
}
|
|
158
159
|
|
|
159
160
|
// ListTransactionsForAccountResponse contains transaction signatures.
|
|
160
161
|
message ListTransactionsForAccountResponse {
|
|
161
162
|
repeated thru.core.v1.Signature signatures = 1
|
|
162
163
|
[(google.api.field_behavior) = OPTIONAL];
|
|
163
|
-
thru.common.v1.PageResponse page = 2
|
|
164
|
+
optional thru.common.v1.PageResponse page = 2
|
|
164
165
|
[(google.api.field_behavior) = OPTIONAL];
|
|
165
166
|
}
|
|
166
167
|
|
|
@@ -179,7 +180,7 @@ message GetEventRequest {
|
|
|
179
180
|
(google.api.field_behavior) = REQUIRED,
|
|
180
181
|
(buf.validate.field).string.max_len = 128
|
|
181
182
|
];
|
|
182
|
-
thru.common.v1.VersionContext version_context = 2
|
|
183
|
+
optional thru.common.v1.VersionContext version_context = 2
|
|
183
184
|
[(google.api.field_behavior) = OPTIONAL];
|
|
184
185
|
}
|
|
185
186
|
|
|
@@ -188,12 +189,12 @@ message Event {
|
|
|
188
189
|
string event_id = 1 [(google.api.field_behavior) = REQUIRED];
|
|
189
190
|
thru.core.v1.Signature transaction_signature = 2
|
|
190
191
|
[(google.api.field_behavior) = REQUIRED];
|
|
191
|
-
thru.core.v1.Pubkey program = 3 [(google.api.field_behavior) = OPTIONAL];
|
|
192
|
-
bytes payload = 4 [(google.api.field_behavior) = OPTIONAL];
|
|
193
|
-
uint64 slot = 5 [(google.api.field_behavior) = OPTIONAL];
|
|
194
|
-
uint32 call_idx = 6 [(google.api.field_behavior) = OPTIONAL];
|
|
195
|
-
uint32 program_idx = 7 [(google.api.field_behavior) = OPTIONAL];
|
|
196
|
-
uint32 payload_size = 8 [(google.api.field_behavior) = OPTIONAL];
|
|
192
|
+
optional thru.core.v1.Pubkey program = 3 [(google.api.field_behavior) = OPTIONAL];
|
|
193
|
+
optional bytes payload = 4 [(google.api.field_behavior) = OPTIONAL];
|
|
194
|
+
optional uint64 slot = 5 [(google.api.field_behavior) = OPTIONAL];
|
|
195
|
+
optional uint32 call_idx = 6 [(google.api.field_behavior) = OPTIONAL];
|
|
196
|
+
optional uint32 program_idx = 7 [(google.api.field_behavior) = OPTIONAL];
|
|
197
|
+
optional uint32 payload_size = 8 [(google.api.field_behavior) = OPTIONAL];
|
|
197
198
|
}
|
|
198
199
|
|
|
199
200
|
// GetTransactionStatusRequest fetches execution status for a transaction.
|
|
@@ -204,9 +205,9 @@ message GetTransactionStatusRequest {
|
|
|
204
205
|
// TransactionStatus captures status metadata for a transaction.
|
|
205
206
|
message TransactionStatus {
|
|
206
207
|
thru.core.v1.Signature signature = 1 [(google.api.field_behavior) = REQUIRED];
|
|
207
|
-
thru.common.v1.ConsensusStatus consensus_status = 2
|
|
208
|
+
optional thru.common.v1.ConsensusStatus consensus_status = 2
|
|
208
209
|
[(google.api.field_behavior) = OPTIONAL];
|
|
209
|
-
thru.core.v1.TransactionExecutionResult execution_result = 3
|
|
210
|
+
optional thru.core.v1.TransactionExecutionResult execution_result = 3
|
|
210
211
|
[(google.api.field_behavior) = OPTIONAL];
|
|
211
212
|
}
|
|
212
213
|
|
|
@@ -285,9 +286,8 @@ service QueryService {
|
|
|
285
286
|
};
|
|
286
287
|
}
|
|
287
288
|
|
|
288
|
-
// List accounts
|
|
289
|
-
rpc
|
|
290
|
-
returns (ListOwnedAccountsResponse) {
|
|
289
|
+
// List accounts using CEL-based filtering.
|
|
290
|
+
rpc ListAccounts(ListAccountsRequest) returns (ListAccountsResponse) {
|
|
291
291
|
option (google.api.http) = {
|
|
292
292
|
get: "/v1/accounts"
|
|
293
293
|
};
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
syntax = "proto3";
|
|
2
2
|
|
|
3
3
|
package thru.services.v1;
|
|
4
4
|
|
|
5
|
-
option features.field_presence = EXPLICIT;
|
|
6
|
-
|
|
7
5
|
import "buf/validate/validate.proto";
|
|
8
6
|
import "google/api/field_behavior.proto";
|
|
9
7
|
import "google/protobuf/duration.proto";
|
|
@@ -25,10 +23,10 @@ option swift_prefix = "THUS";
|
|
|
25
23
|
|
|
26
24
|
// StreamBlocksRequest subscribes to real-time block updates.
|
|
27
25
|
message StreamBlocksRequest {
|
|
28
|
-
uint64 start_slot = 1 [(google.api.field_behavior) = OPTIONAL];
|
|
29
|
-
thru.common.v1.Filter filter = 2 [(google.api.field_behavior) = OPTIONAL];
|
|
30
|
-
thru.core.v1.BlockView view = 3 [(google.api.field_behavior) = OPTIONAL];
|
|
31
|
-
thru.common.v1.ConsensusStatus min_consensus = 4
|
|
26
|
+
optional uint64 start_slot = 1 [(google.api.field_behavior) = OPTIONAL];
|
|
27
|
+
optional thru.common.v1.Filter filter = 2 [(google.api.field_behavior) = OPTIONAL];
|
|
28
|
+
optional thru.core.v1.BlockView view = 3 [(google.api.field_behavior) = OPTIONAL];
|
|
29
|
+
optional thru.common.v1.ConsensusStatus min_consensus = 4
|
|
32
30
|
[(google.api.field_behavior) = OPTIONAL];
|
|
33
31
|
}
|
|
34
32
|
|
|
@@ -40,18 +38,18 @@ message StreamBlocksResponse {
|
|
|
40
38
|
// StreamAccountUpdatesRequest subscribes to account delta events.
|
|
41
39
|
message StreamAccountUpdatesRequest {
|
|
42
40
|
thru.core.v1.Pubkey address = 1 [(google.api.field_behavior) = REQUIRED];
|
|
43
|
-
thru.core.v1.AccountView view = 2 [(google.api.field_behavior) = OPTIONAL];
|
|
44
|
-
thru.common.v1.Filter filter = 4 [(google.api.field_behavior) = OPTIONAL];
|
|
41
|
+
optional thru.core.v1.AccountView view = 2 [(google.api.field_behavior) = OPTIONAL];
|
|
42
|
+
optional thru.common.v1.Filter filter = 4 [(google.api.field_behavior) = OPTIONAL];
|
|
45
43
|
}
|
|
46
44
|
|
|
47
45
|
// AccountUpdate describes a delta for an account.
|
|
48
46
|
message AccountUpdate {
|
|
49
47
|
uint64 slot = 1 [(google.api.field_behavior) = REQUIRED];
|
|
50
|
-
thru.core.v1.AccountPage page = 2
|
|
48
|
+
optional thru.core.v1.AccountPage page = 2
|
|
51
49
|
[(google.api.field_behavior) = OPTIONAL];
|
|
52
|
-
thru.core.v1.AccountMeta meta = 3
|
|
50
|
+
optional thru.core.v1.AccountMeta meta = 3
|
|
53
51
|
[(google.api.field_behavior) = OPTIONAL];
|
|
54
|
-
bool delete = 4 [(google.api.field_behavior) = OPTIONAL];
|
|
52
|
+
optional bool delete = 4 [(google.api.field_behavior) = OPTIONAL];
|
|
55
53
|
}
|
|
56
54
|
|
|
57
55
|
// StreamAccountUpdatesResponse contains either an initial snapshot or a delta.
|
|
@@ -64,8 +62,8 @@ message StreamAccountUpdatesResponse {
|
|
|
64
62
|
|
|
65
63
|
// StreamTransactionsRequest subscribes to transaction confirmations.
|
|
66
64
|
message StreamTransactionsRequest {
|
|
67
|
-
thru.common.v1.Filter filter = 1 [(google.api.field_behavior) = OPTIONAL];
|
|
68
|
-
thru.common.v1.ConsensusStatus min_consensus = 2
|
|
65
|
+
optional thru.common.v1.Filter filter = 1 [(google.api.field_behavior) = OPTIONAL];
|
|
66
|
+
optional thru.common.v1.ConsensusStatus min_consensus = 2
|
|
69
67
|
[(google.api.field_behavior) = OPTIONAL];
|
|
70
68
|
}
|
|
71
69
|
|
|
@@ -77,14 +75,14 @@ message StreamTransactionsResponse {
|
|
|
77
75
|
|
|
78
76
|
// StreamEventsRequest subscribes to chain events.
|
|
79
77
|
message StreamEventsRequest {
|
|
80
|
-
thru.common.v1.Filter filter = 1 [(google.api.field_behavior) = OPTIONAL];
|
|
78
|
+
optional thru.common.v1.Filter filter = 1 [(google.api.field_behavior) = OPTIONAL];
|
|
81
79
|
}
|
|
82
80
|
|
|
83
81
|
// StreamEventsResponse delivers event payloads.
|
|
84
82
|
message StreamEventsResponse {
|
|
85
83
|
string event_id = 1 [(google.api.field_behavior) = REQUIRED];
|
|
86
|
-
bytes payload = 2 [(google.api.field_behavior) = OPTIONAL];
|
|
87
|
-
google.protobuf.Timestamp timestamp = 3
|
|
84
|
+
optional bytes payload = 2 [(google.api.field_behavior) = OPTIONAL];
|
|
85
|
+
optional google.protobuf.Timestamp timestamp = 3
|
|
88
86
|
[(google.api.field_behavior) = OPTIONAL];
|
|
89
87
|
thru.core.v1.Pubkey program = 4 [(google.api.field_behavior) = REQUIRED];
|
|
90
88
|
uint32 call_idx = 5 [(google.api.field_behavior) = REQUIRED];
|
|
@@ -96,7 +94,7 @@ message StreamEventsResponse {
|
|
|
96
94
|
// TrackTransactionRequest subscribes to status updates for a transaction.
|
|
97
95
|
message TrackTransactionRequest {
|
|
98
96
|
thru.core.v1.Signature signature = 1 [(google.api.field_behavior) = REQUIRED];
|
|
99
|
-
google.protobuf.Duration timeout = 2
|
|
97
|
+
optional google.protobuf.Duration timeout = 2
|
|
100
98
|
[(google.api.field_behavior) = OPTIONAL];
|
|
101
99
|
}
|
|
102
100
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { bytesToHex } from "@noble/hashes/utils";
|
|
1
2
|
import { createThruClient } from "../client";
|
|
2
3
|
import { ConsensusStatus } from "../proto/thru/common/v1/consensus_pb";
|
|
3
4
|
|
|
@@ -12,6 +13,11 @@ const keypair = await sdk.keys.generateKeyPair()
|
|
|
12
13
|
const targetAccountAddress = keypair.address
|
|
13
14
|
const targetAccountPrivateKey = keypair.privateKey
|
|
14
15
|
|
|
16
|
+
console.log("Target account address:", targetAccountAddress);
|
|
17
|
+
console.log("Target account private key:", targetAccountPrivateKey);
|
|
18
|
+
const targetAccountPrivateKeyHex = bytesToHex(targetAccountPrivateKey);
|
|
19
|
+
console.log("Target account private key hex:", targetAccountPrivateKeyHex);
|
|
20
|
+
|
|
15
21
|
async function fetchAccountSnapshot(label: string, address: string): Promise<void> {
|
|
16
22
|
try {
|
|
17
23
|
const account = await sdk.accounts.get(address);
|