pactus-grpc 1.7.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/LICENSE +21 -0
- package/README.md +23 -0
- package/blockchain_grpc_pb.js +381 -0
- package/blockchain_pb.js +6046 -0
- package/index.js +18 -0
- package/network_grpc_pb.js +80 -0
- package/network_pb.js +2829 -0
- package/package.json +35 -0
- package/transaction_grpc_pb.js +220 -0
- package/transaction_pb.js +4196 -0
- package/utils_grpc_pb.js +149 -0
- package/utils_pb.js +1412 -0
- package/wallet_grpc_pb.js +558 -0
- package/wallet_pb.js +6334 -0
package/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const modules = {};
|
|
2
|
+
|
|
3
|
+
try {
|
|
4
|
+
const fs = require('fs');
|
|
5
|
+
const path = require('path');
|
|
6
|
+
|
|
7
|
+
fs.readdirSync(__dirname)
|
|
8
|
+
.filter(file => file.endsWith('.js') && file !== 'index.js')
|
|
9
|
+
.forEach(file => {
|
|
10
|
+
const moduleName = path.basename(file, '.js');
|
|
11
|
+
modules[moduleName] = require(`./${file}`);
|
|
12
|
+
});
|
|
13
|
+
} catch (err) {
|
|
14
|
+
console.error('Error loading gRPC modules:', err);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
module.exports = modules;
|
|
18
|
+
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
// GENERATED CODE -- DO NOT EDIT!
|
|
2
|
+
|
|
3
|
+
'use strict';
|
|
4
|
+
var grpc = require('grpc');
|
|
5
|
+
var network_pb = require('./network_pb.js');
|
|
6
|
+
|
|
7
|
+
function serialize_pactus_GetNetworkInfoRequest(arg) {
|
|
8
|
+
if (!(arg instanceof network_pb.GetNetworkInfoRequest)) {
|
|
9
|
+
throw new Error('Expected argument of type pactus.GetNetworkInfoRequest');
|
|
10
|
+
}
|
|
11
|
+
return Buffer.from(arg.serializeBinary());
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function deserialize_pactus_GetNetworkInfoRequest(buffer_arg) {
|
|
15
|
+
return network_pb.GetNetworkInfoRequest.deserializeBinary(new Uint8Array(buffer_arg));
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function serialize_pactus_GetNetworkInfoResponse(arg) {
|
|
19
|
+
if (!(arg instanceof network_pb.GetNetworkInfoResponse)) {
|
|
20
|
+
throw new Error('Expected argument of type pactus.GetNetworkInfoResponse');
|
|
21
|
+
}
|
|
22
|
+
return Buffer.from(arg.serializeBinary());
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function deserialize_pactus_GetNetworkInfoResponse(buffer_arg) {
|
|
26
|
+
return network_pb.GetNetworkInfoResponse.deserializeBinary(new Uint8Array(buffer_arg));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function serialize_pactus_GetNodeInfoRequest(arg) {
|
|
30
|
+
if (!(arg instanceof network_pb.GetNodeInfoRequest)) {
|
|
31
|
+
throw new Error('Expected argument of type pactus.GetNodeInfoRequest');
|
|
32
|
+
}
|
|
33
|
+
return Buffer.from(arg.serializeBinary());
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function deserialize_pactus_GetNodeInfoRequest(buffer_arg) {
|
|
37
|
+
return network_pb.GetNodeInfoRequest.deserializeBinary(new Uint8Array(buffer_arg));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function serialize_pactus_GetNodeInfoResponse(arg) {
|
|
41
|
+
if (!(arg instanceof network_pb.GetNodeInfoResponse)) {
|
|
42
|
+
throw new Error('Expected argument of type pactus.GetNodeInfoResponse');
|
|
43
|
+
}
|
|
44
|
+
return Buffer.from(arg.serializeBinary());
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function deserialize_pactus_GetNodeInfoResponse(buffer_arg) {
|
|
48
|
+
return network_pb.GetNodeInfoResponse.deserializeBinary(new Uint8Array(buffer_arg));
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
// Network service provides RPCs for retrieving information about the network.
|
|
53
|
+
var NetworkService = exports.NetworkService = {
|
|
54
|
+
// GetNetworkInfo retrieves information about the overall network.
|
|
55
|
+
getNetworkInfo: {
|
|
56
|
+
path: '/pactus.Network/GetNetworkInfo',
|
|
57
|
+
requestStream: false,
|
|
58
|
+
responseStream: false,
|
|
59
|
+
requestType: network_pb.GetNetworkInfoRequest,
|
|
60
|
+
responseType: network_pb.GetNetworkInfoResponse,
|
|
61
|
+
requestSerialize: serialize_pactus_GetNetworkInfoRequest,
|
|
62
|
+
requestDeserialize: deserialize_pactus_GetNetworkInfoRequest,
|
|
63
|
+
responseSerialize: serialize_pactus_GetNetworkInfoResponse,
|
|
64
|
+
responseDeserialize: deserialize_pactus_GetNetworkInfoResponse,
|
|
65
|
+
},
|
|
66
|
+
// GetNodeInfo retrieves information about a specific node in the network.
|
|
67
|
+
getNodeInfo: {
|
|
68
|
+
path: '/pactus.Network/GetNodeInfo',
|
|
69
|
+
requestStream: false,
|
|
70
|
+
responseStream: false,
|
|
71
|
+
requestType: network_pb.GetNodeInfoRequest,
|
|
72
|
+
responseType: network_pb.GetNodeInfoResponse,
|
|
73
|
+
requestSerialize: serialize_pactus_GetNodeInfoRequest,
|
|
74
|
+
requestDeserialize: deserialize_pactus_GetNodeInfoRequest,
|
|
75
|
+
responseSerialize: serialize_pactus_GetNodeInfoResponse,
|
|
76
|
+
responseDeserialize: deserialize_pactus_GetNodeInfoResponse,
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
exports.NetworkClient = grpc.makeGenericClientConstructor(NetworkService);
|