forked from latticexyz/mud
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfaucet.proto
91 lines (69 loc) · 2.25 KB
/
faucet.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
syntax = "proto3";
package faucet;
option go_package = "protobuf/go/faucet";
message LinkedTwitterPair {
string username = 1;
string address = 2;
}
message FaucetStore {
map<string, string> addressToUsername = 1;
map<string, string> usernameToAddress = 2;
// User id/name/address to timestamp of latest drip.
map<string, int64> latestDrip = 3;
// Global drip counter.
double totalDripCount = 4;
}
// The Faucet Service definition.
service FaucetService {
rpc Drip (DripRequest) returns (DripResponse) {}
rpc DripDev (DripDevRequest) returns (DripResponse) {}
rpc DripVerifyTweet (DripRequest) returns (DripResponse) {}
rpc TimeUntilDrip (DripRequest) returns (TimeUntilDripResponse) {}
rpc GetLinkedTwitters (GetLinkedTwittersRequest) returns (GetLinkedTwittersResponse) {}
rpc GetLinkedTwitterForAddress (LinkedTwitterForAddressRequest) returns (LinkedTwitterForAddressResponse) {}
rpc GetLinkedAddressForTwitter (LinkedAddressForTwitterRequest) returns (LinkedAddressForTwitterResponse) {}
// Admin utility endpoints for modifying state. Requires a signature with faucet private key.
rpc SetLinkedTwitter(SetLinkedTwitterRequest) returns (SetLinkedTwitterResponse) {}
}
// Request for drip.
message DripRequest {
string username = 1;
string address = 2;
}
// Request for drip to any address when running in dev mode.
message DripDevRequest {
string address = 1;
}
// Response for drip request that contains the transaction hash of the drip tx and the ECS component set hash (if any).
message DripResponse {
string dripTxHash = 1;
string ecsTxHash = 2;
}
// Response for the time until next drip request.
message TimeUntilDripResponse {
double timeUntilDripMinutes = 1;
double timeUntilDripSeconds = 2;
}
message GetLinkedTwittersRequest {}
message GetLinkedTwittersResponse {
repeated LinkedTwitterPair linkedTwitters = 1;
}
message LinkedTwitterForAddressRequest {
string address = 1;
}
message LinkedTwitterForAddressResponse {
string username = 1;
}
message LinkedAddressForTwitterRequest {
string username = 1;
}
message LinkedAddressForTwitterResponse {
string address = 1;
}
message SetLinkedTwitterRequest {
string address = 1;
string username = 2;
string signature = 3;
}
message SetLinkedTwitterResponse {
}