@latticexyz/services 2.0.0-skystrife-playtest-9e9511d4 → 2.0.0-transaction-context-324984c5

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/README.md CHANGED
@@ -1,241 +1 @@
1
- # Services
2
-
3
- This package contains MUD services -- complimentary software components for enhanced interactions with on-chain state when building with MUD. Services work out-of-the-box with any project built with MUD.
4
-
5
- ## V2 Services
6
-
7
- ### [📄 Docs](#)
8
-
9
- The following services are available for use with MUD V2. For more details on each service, see the linked docs page.
10
-
11
- | Service | Description | Proto / Spec | Default Port |
12
- | ------- | :------------------------------------------------------------------------------------ | :------------------------------- | -----------: |
13
- | mode | A node for MUD. PostgresDB-based indexer of MUD V2 events across chains + MUD worlds. | [mode.proto](./proto/mode.proto) | 50091 |
14
-
15
- ### 🏃 Quickstart
16
-
17
- #### Running MODE with Docker Compose
18
-
19
- (Only tested on MacOS for now.)
20
-
21
- 1. Install Docker for Mac (https://docs.docker.com/docker-for-mac/install/)
22
- 2. Install Docker Compose (https://docs.docker.com/compose/install/)
23
- 3. Run `docker-compose -f docker-compose.mode.yaml up`. This will start services for both MODE and PostgresDB.
24
- 4. By default it will connect to a local anvil node at `localhost:8545`. If you want to connect to a different node, you can change the `rpc.http` and `rpc.ws` fields in the `config.mode-docker.yaml` file.
25
-
26
- #### Running the MODE service
27
-
28
- 1. Install Go
29
- 2. Install Postgres
30
- 3. Deside which database you want to use, e.g. `mode` and create the database
31
- 4. Set up logical replication on the database of your choice, e.g. `mode`. Logical replication is used to enable fast MUD state change streaming using the WAL (Write-Ahead Log) of the database. For more infromation on logical replication, see the [Postgres documentation](https://www.postgresql.org/docs/current/logical-replication.html). For this you need to
32
- 1. Modify the DB config to use logical replication. This is done by adding the following to the `postgresql.conf` file:
33
- ```
34
- wal_level = logical
35
- max_replication_slots = 1
36
- max_wal_senders = 1
37
- ```
38
- alternatively you can use the following SQL commands:
39
- ```sql
40
- ALTER SYSTEM SET wal_level = logical;
41
- ALTER SYSTEM SET max_replication_slots = 1;
42
- ALTER SYSTEM SET max_wal_senders = 1;
43
- ```
44
- 2. Restart the DB
45
- 5. Build the source. This will build the MODE service
46
-
47
- ```bash
48
- make mode
49
- ```
50
-
51
- 6. Modify `config.mode.yaml` MODE config file to match your preferences. MODE can be configured either with a config file or via command line arguments (both will do the same thing). In this step you should probably change the `dsn` section to match your database name created in step (3): this is what MODE uses to connect to Postgres. Additionally change the `chains` section in case you'd like to connect and have MODE index a different chain other than a local node. You can also change the `port`s to match your preferences. Example config file:
52
-
53
- ```yaml
54
- chains:
55
- - name: "localhost"
56
- id: "31337"
57
- rpc:
58
- http: "http://localhost:8545"
59
- ws: "ws://localhost:8545"
60
- db:
61
- dsn: "postgresql://localhost:5432/mode_ephemeral?sslmode=disable&replication=database"
62
- wipe: false
63
- sync:
64
- enabled: true
65
- startBlock: 0
66
- blockBatchCount: 10000
67
- ql:
68
- port: 50091
69
- metrics:
70
- port: 6060
71
- ```
72
-
73
- 7. If you're running with the default localhost / `31337` chain, make sure there is a local node running for the chain you want to connect to. For example, a hardhat node or an anvil node.
74
- 8. Run the MODE service
75
-
76
- ```bash
77
- ./bin/mode -config config.mode.yaml
78
- ```
79
-
80
- or
81
-
82
- ```bash
83
- make run-mode
84
- ```
85
-
86
- 9. Optionally, install `grpcurl` to interact with the MODE service API from the command line. For example, on MacOS you can use `brew` to install `grpcurl`:
87
-
88
- ```bash
89
- brew install grpcurl
90
- ```
91
-
92
- 10. MODE exposes a `QueryLayer` gRPC server on port `50091` by default. You can use a gRPC client to interact with the service API. For example, to query for the current state of an indexed MUD world deployed at address `0xff738496c8cd898dC31b670D067162200C5c20A1` and on local chain with ID `31337`, you can use the `GetState` RPC endpoint:
93
-
94
- ```bash
95
- grpcurl -plaintext -d '{"chainTables": [], "worldTables": [], "namespace": {"chainId":"31337", "worldAddress": "0xff738496c8cd898dC31b670D067162200C5c20A1"}}' localhost:50091 mode.QueryLayer/GetState
96
- ```
97
-
98
- After the initial setup, to quickly re-build and run the MODE service, you can use
99
-
100
- ```bash
101
- make mode run-mode
102
- ```
103
-
104
- #### MODE and MUD
105
-
106
- Certain parts of MODE depend on MUD, specifically the `storecore` package of MODE which allows us to work with data coming from MUD and perfom encoding/decodings between MUD SchemaTypes, Go types, and Postgres types when the data is store in the DB. If modifications are made to MUD StoreCore, MODE `storecore.go` needs to be re-generated. To do this, perform these steps:
107
-
108
- 1. Get the latest MUD StoreCore abi and save it to a file, e.g. `storecore.json` or `storecore.abi`. It should look something like this
109
-
110
- ```json
111
- [
112
- {
113
- "anonymous": false,
114
- "inputs": [
115
- {
116
- "indexed": false,
117
- "internalType": "bytes32",
118
- "name": "tableId",
119
- "type": "bytes32"
120
- },
121
- {
122
- "indexed": false,
123
- "internalType": "bytes32[]",
124
- "name": "key",
125
- "type": "bytes32[]"
126
- }
127
- ],
128
- "name": "StoreDeleteRecord",
129
- "type": "event"
130
- },
131
- {
132
- "anonymous": false,
133
- "inputs": [
134
- {
135
- "indexed": false,
136
- "internalType": "bytes32",
137
- "name": "tableId",
138
- "type": "bytes32"
139
- },
140
- {
141
- "indexed": false,
142
- "internalType": "bytes32[]",
143
- "name": "key",
144
- "type": "bytes32[]"
145
- },
146
- {
147
- "indexed": false,
148
- "internalType": "uint8",
149
- "name": "schemaIndex",
150
- "type": "uint8"
151
- },
152
- {
153
- "indexed": false,
154
- "internalType": "bytes",
155
- "name": "data",
156
- "type": "bytes"
157
- }
158
- ],
159
- "name": "StoreSetField",
160
- "type": "event"
161
- },
162
- {
163
- "anonymous": false,
164
- "inputs": [
165
- {
166
- "indexed": false,
167
- "internalType": "bytes32",
168
- "name": "tableId",
169
- "type": "bytes32"
170
- },
171
- {
172
- "indexed": false,
173
- "internalType": "bytes32[]",
174
- "name": "key",
175
- "type": "bytes32[]"
176
- },
177
- {
178
- "indexed": false,
179
- "internalType": "bytes",
180
- "name": "data",
181
- "type": "bytes"
182
- }
183
- ],
184
- "name": "StoreSetRecord",
185
- "type": "event"
186
- }
187
- ]
188
- ```
189
-
190
- 2. Run the following command to generate the MODE `storecore.go` file:
191
-
192
- ```bash
193
- abigen --abi storecore.abi --pkg storecore --out storecore.go
194
- ```
195
-
196
- 3. Copy the generated `storecore.go` file to the MODE `storecore` package. Alternatively, run the command in the storecore package directory and the file will overwrite the existing one.
197
-
198
- ## V1 Services
199
-
200
- ### [📄 Docs](./README.v1.md)
201
-
202
- The following services are available for use with MUD V1. For more details on each service, see the linked docs page.
203
-
204
- | Service | Description | Proto / Spec | Default Port |
205
- | ------------ | :--------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------- | -----------: |
206
- | ecs-snapshot | Indexer reducing ECS events into a single "current" state for fast snapshot client syncs | [ecs-snapshot.proto](./proto/ecs-snapshot.proto) | 50061 |
207
- | ecs-stream | Multiplexer for subscriptions to receive current block data, ECS events per block, and transaction origination data | [ecs-stream.proto](./proto/ecs-stream.proto) | 50051 |
208
- | ecs-relay | Generic message relayer, supporting signed messages, service-side signature verification, relay conditions for DDoS prevention, and more | [ecs-relay.proto](./proto/ecs-relay.proto) | 50071 |
209
- | faucet | Faucet supporting custom drip amounts, global limits, twitter verification, and integrations with MUD components | [faucet.proto](./proto/faucet.proto) | 50081 |
210
-
211
- ### 🏃 Quickstart
212
-
213
- #### Running the ECS Snapshot, Stream, Relay, and Faucet services
214
-
215
- 1. Install Go
216
- 2. Build the source. This will build all the services
217
-
218
- ```bash
219
- make build
220
- ```
221
-
222
- or to build only specific services
223
-
224
- ```bash
225
- make ecs-snapshot ecs-stream ecs-relay faucet
226
- ```
227
-
228
- 3. If you're running with the default chain, make sure there is a local node running for the chain you want to connect to. For example, a hardhat node or an anvil node.
229
- 4. Run whichever binary via [`Makefile`](./Makefile). For example, to run the snapshot service
230
-
231
- ```bash
232
- make run-ecs-snapshot
233
- ```
234
-
235
- ## Protobuf
236
-
237
- MUD services use [Protocol Buffers](https://developers.google.com/protocol-buffers) to define the data structures and message schemas. The `.proto` files are available in the `/proto` directory at the root of this repo. For more details about `.proto` files and a language guide, see the [Language Guide (proto3)](https://developers.google.com/protocol-buffers/docs/proto3). The package has the protobuf files checked in, but in case you want to regenerate those (based on an updated `.proto` file for instance), run
238
-
239
- ```bash
240
- make protoc
241
- ```
1
+ # DEPRECATED
@@ -0,0 +1,369 @@
1
+ import { CallContext, CallOptions } from 'nice-grpc-common';
2
+ import _m0 from 'protobufjs/minimal.js';
3
+ import { RawClient } from 'nice-grpc-web';
4
+ import { FromTsProtoServiceDefinition } from 'nice-grpc-web/lib/service-definitions/ts-proto';
5
+
6
+ declare const protobufPackage = "faucet";
7
+ interface LinkedTwitterPair {
8
+ username: string;
9
+ address: string;
10
+ }
11
+ declare const LinkedTwitterPair: {
12
+ encode(message: LinkedTwitterPair, writer?: _m0.Writer): _m0.Writer;
13
+ decode(input: _m0.Reader | Uint8Array, length?: number): LinkedTwitterPair;
14
+ create(base?: DeepPartial<LinkedTwitterPair>): LinkedTwitterPair;
15
+ fromPartial(object: DeepPartial<LinkedTwitterPair>): LinkedTwitterPair;
16
+ };
17
+ interface FaucetStore {
18
+ addressToUsername: {
19
+ [key: string]: string;
20
+ };
21
+ usernameToAddress: {
22
+ [key: string]: string;
23
+ };
24
+ /** User id/name/address to timestamp of latest drip. */
25
+ latestDrip: {
26
+ [key: string]: number;
27
+ };
28
+ /** Global drip counter. */
29
+ totalDripCount: number;
30
+ }
31
+ declare const FaucetStore: {
32
+ encode(message: FaucetStore, writer?: _m0.Writer): _m0.Writer;
33
+ decode(input: _m0.Reader | Uint8Array, length?: number): FaucetStore;
34
+ create(base?: DeepPartial<FaucetStore>): FaucetStore;
35
+ fromPartial(object: DeepPartial<FaucetStore>): FaucetStore;
36
+ };
37
+ interface FaucetStore_AddressToUsernameEntry {
38
+ key: string;
39
+ value: string;
40
+ }
41
+ declare const FaucetStore_AddressToUsernameEntry: {
42
+ encode(message: FaucetStore_AddressToUsernameEntry, writer?: _m0.Writer): _m0.Writer;
43
+ decode(input: _m0.Reader | Uint8Array, length?: number): FaucetStore_AddressToUsernameEntry;
44
+ create(base?: DeepPartial<FaucetStore_AddressToUsernameEntry>): FaucetStore_AddressToUsernameEntry;
45
+ fromPartial(object: DeepPartial<FaucetStore_AddressToUsernameEntry>): FaucetStore_AddressToUsernameEntry;
46
+ };
47
+ interface FaucetStore_UsernameToAddressEntry {
48
+ key: string;
49
+ value: string;
50
+ }
51
+ declare const FaucetStore_UsernameToAddressEntry: {
52
+ encode(message: FaucetStore_UsernameToAddressEntry, writer?: _m0.Writer): _m0.Writer;
53
+ decode(input: _m0.Reader | Uint8Array, length?: number): FaucetStore_UsernameToAddressEntry;
54
+ create(base?: DeepPartial<FaucetStore_UsernameToAddressEntry>): FaucetStore_UsernameToAddressEntry;
55
+ fromPartial(object: DeepPartial<FaucetStore_UsernameToAddressEntry>): FaucetStore_UsernameToAddressEntry;
56
+ };
57
+ interface FaucetStore_LatestDripEntry {
58
+ key: string;
59
+ value: number;
60
+ }
61
+ declare const FaucetStore_LatestDripEntry: {
62
+ encode(message: FaucetStore_LatestDripEntry, writer?: _m0.Writer): _m0.Writer;
63
+ decode(input: _m0.Reader | Uint8Array, length?: number): FaucetStore_LatestDripEntry;
64
+ create(base?: DeepPartial<FaucetStore_LatestDripEntry>): FaucetStore_LatestDripEntry;
65
+ fromPartial(object: DeepPartial<FaucetStore_LatestDripEntry>): FaucetStore_LatestDripEntry;
66
+ };
67
+ /** Request for drip. */
68
+ interface DripRequest {
69
+ username: string;
70
+ address: string;
71
+ }
72
+ declare const DripRequest: {
73
+ encode(message: DripRequest, writer?: _m0.Writer): _m0.Writer;
74
+ decode(input: _m0.Reader | Uint8Array, length?: number): DripRequest;
75
+ create(base?: DeepPartial<DripRequest>): DripRequest;
76
+ fromPartial(object: DeepPartial<DripRequest>): DripRequest;
77
+ };
78
+ /** Request for drip to any address when running in dev mode. */
79
+ interface DripDevRequest {
80
+ address: string;
81
+ }
82
+ declare const DripDevRequest: {
83
+ encode(message: DripDevRequest, writer?: _m0.Writer): _m0.Writer;
84
+ decode(input: _m0.Reader | Uint8Array, length?: number): DripDevRequest;
85
+ create(base?: DeepPartial<DripDevRequest>): DripDevRequest;
86
+ fromPartial(object: DeepPartial<DripDevRequest>): DripDevRequest;
87
+ };
88
+ /** Response for drip request that contains the transaction hash of the drip tx and the ECS component set hash (if any). */
89
+ interface DripResponse {
90
+ dripTxHash: string;
91
+ ecsTxHash: string;
92
+ }
93
+ declare const DripResponse: {
94
+ encode(message: DripResponse, writer?: _m0.Writer): _m0.Writer;
95
+ decode(input: _m0.Reader | Uint8Array, length?: number): DripResponse;
96
+ create(base?: DeepPartial<DripResponse>): DripResponse;
97
+ fromPartial(object: DeepPartial<DripResponse>): DripResponse;
98
+ };
99
+ /** Response for the time until next drip request. */
100
+ interface TimeUntilDripResponse {
101
+ timeUntilDripMinutes: number;
102
+ timeUntilDripSeconds: number;
103
+ }
104
+ declare const TimeUntilDripResponse: {
105
+ encode(message: TimeUntilDripResponse, writer?: _m0.Writer): _m0.Writer;
106
+ decode(input: _m0.Reader | Uint8Array, length?: number): TimeUntilDripResponse;
107
+ create(base?: DeepPartial<TimeUntilDripResponse>): TimeUntilDripResponse;
108
+ fromPartial(object: DeepPartial<TimeUntilDripResponse>): TimeUntilDripResponse;
109
+ };
110
+ interface GetLinkedTwittersRequest {
111
+ }
112
+ declare const GetLinkedTwittersRequest: {
113
+ encode(_: GetLinkedTwittersRequest, writer?: _m0.Writer): _m0.Writer;
114
+ decode(input: _m0.Reader | Uint8Array, length?: number): GetLinkedTwittersRequest;
115
+ create(base?: DeepPartial<GetLinkedTwittersRequest>): GetLinkedTwittersRequest;
116
+ fromPartial(_: DeepPartial<GetLinkedTwittersRequest>): GetLinkedTwittersRequest;
117
+ };
118
+ interface GetLinkedTwittersResponse {
119
+ linkedTwitters: LinkedTwitterPair[];
120
+ }
121
+ declare const GetLinkedTwittersResponse: {
122
+ encode(message: GetLinkedTwittersResponse, writer?: _m0.Writer): _m0.Writer;
123
+ decode(input: _m0.Reader | Uint8Array, length?: number): GetLinkedTwittersResponse;
124
+ create(base?: DeepPartial<GetLinkedTwittersResponse>): GetLinkedTwittersResponse;
125
+ fromPartial(object: DeepPartial<GetLinkedTwittersResponse>): GetLinkedTwittersResponse;
126
+ };
127
+ interface LinkedTwitterForAddressRequest {
128
+ address: string;
129
+ }
130
+ declare const LinkedTwitterForAddressRequest: {
131
+ encode(message: LinkedTwitterForAddressRequest, writer?: _m0.Writer): _m0.Writer;
132
+ decode(input: _m0.Reader | Uint8Array, length?: number): LinkedTwitterForAddressRequest;
133
+ create(base?: DeepPartial<LinkedTwitterForAddressRequest>): LinkedTwitterForAddressRequest;
134
+ fromPartial(object: DeepPartial<LinkedTwitterForAddressRequest>): LinkedTwitterForAddressRequest;
135
+ };
136
+ interface LinkedTwitterForAddressResponse {
137
+ username: string;
138
+ }
139
+ declare const LinkedTwitterForAddressResponse: {
140
+ encode(message: LinkedTwitterForAddressResponse, writer?: _m0.Writer): _m0.Writer;
141
+ decode(input: _m0.Reader | Uint8Array, length?: number): LinkedTwitterForAddressResponse;
142
+ create(base?: DeepPartial<LinkedTwitterForAddressResponse>): LinkedTwitterForAddressResponse;
143
+ fromPartial(object: DeepPartial<LinkedTwitterForAddressResponse>): LinkedTwitterForAddressResponse;
144
+ };
145
+ interface LinkedAddressForTwitterRequest {
146
+ username: string;
147
+ }
148
+ declare const LinkedAddressForTwitterRequest: {
149
+ encode(message: LinkedAddressForTwitterRequest, writer?: _m0.Writer): _m0.Writer;
150
+ decode(input: _m0.Reader | Uint8Array, length?: number): LinkedAddressForTwitterRequest;
151
+ create(base?: DeepPartial<LinkedAddressForTwitterRequest>): LinkedAddressForTwitterRequest;
152
+ fromPartial(object: DeepPartial<LinkedAddressForTwitterRequest>): LinkedAddressForTwitterRequest;
153
+ };
154
+ interface LinkedAddressForTwitterResponse {
155
+ address: string;
156
+ }
157
+ declare const LinkedAddressForTwitterResponse: {
158
+ encode(message: LinkedAddressForTwitterResponse, writer?: _m0.Writer): _m0.Writer;
159
+ decode(input: _m0.Reader | Uint8Array, length?: number): LinkedAddressForTwitterResponse;
160
+ create(base?: DeepPartial<LinkedAddressForTwitterResponse>): LinkedAddressForTwitterResponse;
161
+ fromPartial(object: DeepPartial<LinkedAddressForTwitterResponse>): LinkedAddressForTwitterResponse;
162
+ };
163
+ interface SetLinkedTwitterRequest {
164
+ address: string;
165
+ username: string;
166
+ signature: string;
167
+ }
168
+ declare const SetLinkedTwitterRequest: {
169
+ encode(message: SetLinkedTwitterRequest, writer?: _m0.Writer): _m0.Writer;
170
+ decode(input: _m0.Reader | Uint8Array, length?: number): SetLinkedTwitterRequest;
171
+ create(base?: DeepPartial<SetLinkedTwitterRequest>): SetLinkedTwitterRequest;
172
+ fromPartial(object: DeepPartial<SetLinkedTwitterRequest>): SetLinkedTwitterRequest;
173
+ };
174
+ interface SetLinkedTwitterResponse {
175
+ }
176
+ declare const SetLinkedTwitterResponse: {
177
+ encode(_: SetLinkedTwitterResponse, writer?: _m0.Writer): _m0.Writer;
178
+ decode(input: _m0.Reader | Uint8Array, length?: number): SetLinkedTwitterResponse;
179
+ create(base?: DeepPartial<SetLinkedTwitterResponse>): SetLinkedTwitterResponse;
180
+ fromPartial(_: DeepPartial<SetLinkedTwitterResponse>): SetLinkedTwitterResponse;
181
+ };
182
+ /** The Faucet Service definition. */
183
+ type FaucetServiceDefinition = typeof FaucetServiceDefinition;
184
+ declare const FaucetServiceDefinition: {
185
+ readonly name: "FaucetService";
186
+ readonly fullName: "faucet.FaucetService";
187
+ readonly methods: {
188
+ readonly drip: {
189
+ readonly name: "Drip";
190
+ readonly requestType: {
191
+ encode(message: DripRequest, writer?: _m0.Writer): _m0.Writer;
192
+ decode(input: _m0.Reader | Uint8Array, length?: number): DripRequest;
193
+ create(base?: DeepPartial<DripRequest>): DripRequest;
194
+ fromPartial(object: DeepPartial<DripRequest>): DripRequest;
195
+ };
196
+ readonly requestStream: false;
197
+ readonly responseType: {
198
+ encode(message: DripResponse, writer?: _m0.Writer): _m0.Writer;
199
+ decode(input: _m0.Reader | Uint8Array, length?: number): DripResponse;
200
+ create(base?: DeepPartial<DripResponse>): DripResponse;
201
+ fromPartial(object: DeepPartial<DripResponse>): DripResponse;
202
+ };
203
+ readonly responseStream: false;
204
+ readonly options: {};
205
+ };
206
+ readonly dripDev: {
207
+ readonly name: "DripDev";
208
+ readonly requestType: {
209
+ encode(message: DripDevRequest, writer?: _m0.Writer): _m0.Writer;
210
+ decode(input: _m0.Reader | Uint8Array, length?: number): DripDevRequest;
211
+ create(base?: DeepPartial<DripDevRequest>): DripDevRequest;
212
+ fromPartial(object: DeepPartial<DripDevRequest>): DripDevRequest;
213
+ };
214
+ readonly requestStream: false;
215
+ readonly responseType: {
216
+ encode(message: DripResponse, writer?: _m0.Writer): _m0.Writer;
217
+ decode(input: _m0.Reader | Uint8Array, length?: number): DripResponse;
218
+ create(base?: DeepPartial<DripResponse>): DripResponse;
219
+ fromPartial(object: DeepPartial<DripResponse>): DripResponse;
220
+ };
221
+ readonly responseStream: false;
222
+ readonly options: {};
223
+ };
224
+ readonly dripVerifyTweet: {
225
+ readonly name: "DripVerifyTweet";
226
+ readonly requestType: {
227
+ encode(message: DripRequest, writer?: _m0.Writer): _m0.Writer;
228
+ decode(input: _m0.Reader | Uint8Array, length?: number): DripRequest;
229
+ create(base?: DeepPartial<DripRequest>): DripRequest;
230
+ fromPartial(object: DeepPartial<DripRequest>): DripRequest;
231
+ };
232
+ readonly requestStream: false;
233
+ readonly responseType: {
234
+ encode(message: DripResponse, writer?: _m0.Writer): _m0.Writer;
235
+ decode(input: _m0.Reader | Uint8Array, length?: number): DripResponse;
236
+ create(base?: DeepPartial<DripResponse>): DripResponse;
237
+ fromPartial(object: DeepPartial<DripResponse>): DripResponse;
238
+ };
239
+ readonly responseStream: false;
240
+ readonly options: {};
241
+ };
242
+ readonly timeUntilDrip: {
243
+ readonly name: "TimeUntilDrip";
244
+ readonly requestType: {
245
+ encode(message: DripRequest, writer?: _m0.Writer): _m0.Writer;
246
+ decode(input: _m0.Reader | Uint8Array, length?: number): DripRequest;
247
+ create(base?: DeepPartial<DripRequest>): DripRequest;
248
+ fromPartial(object: DeepPartial<DripRequest>): DripRequest;
249
+ };
250
+ readonly requestStream: false;
251
+ readonly responseType: {
252
+ encode(message: TimeUntilDripResponse, writer?: _m0.Writer): _m0.Writer;
253
+ decode(input: _m0.Reader | Uint8Array, length?: number): TimeUntilDripResponse;
254
+ create(base?: DeepPartial<TimeUntilDripResponse>): TimeUntilDripResponse;
255
+ fromPartial(object: DeepPartial<TimeUntilDripResponse>): TimeUntilDripResponse;
256
+ };
257
+ readonly responseStream: false;
258
+ readonly options: {};
259
+ };
260
+ readonly getLinkedTwitters: {
261
+ readonly name: "GetLinkedTwitters";
262
+ readonly requestType: {
263
+ encode(_: GetLinkedTwittersRequest, writer?: _m0.Writer): _m0.Writer;
264
+ decode(input: _m0.Reader | Uint8Array, length?: number): GetLinkedTwittersRequest;
265
+ create(base?: DeepPartial<GetLinkedTwittersRequest>): GetLinkedTwittersRequest;
266
+ fromPartial(_: DeepPartial<GetLinkedTwittersRequest>): GetLinkedTwittersRequest;
267
+ };
268
+ readonly requestStream: false;
269
+ readonly responseType: {
270
+ encode(message: GetLinkedTwittersResponse, writer?: _m0.Writer): _m0.Writer;
271
+ decode(input: _m0.Reader | Uint8Array, length?: number): GetLinkedTwittersResponse;
272
+ create(base?: DeepPartial<GetLinkedTwittersResponse>): GetLinkedTwittersResponse;
273
+ fromPartial(object: DeepPartial<GetLinkedTwittersResponse>): GetLinkedTwittersResponse;
274
+ };
275
+ readonly responseStream: false;
276
+ readonly options: {};
277
+ };
278
+ readonly getLinkedTwitterForAddress: {
279
+ readonly name: "GetLinkedTwitterForAddress";
280
+ readonly requestType: {
281
+ encode(message: LinkedTwitterForAddressRequest, writer?: _m0.Writer): _m0.Writer;
282
+ decode(input: _m0.Reader | Uint8Array, length?: number): LinkedTwitterForAddressRequest;
283
+ create(base?: DeepPartial<LinkedTwitterForAddressRequest>): LinkedTwitterForAddressRequest;
284
+ fromPartial(object: DeepPartial<LinkedTwitterForAddressRequest>): LinkedTwitterForAddressRequest;
285
+ };
286
+ readonly requestStream: false;
287
+ readonly responseType: {
288
+ encode(message: LinkedTwitterForAddressResponse, writer?: _m0.Writer): _m0.Writer;
289
+ decode(input: _m0.Reader | Uint8Array, length?: number): LinkedTwitterForAddressResponse;
290
+ create(base?: DeepPartial<LinkedTwitterForAddressResponse>): LinkedTwitterForAddressResponse;
291
+ fromPartial(object: DeepPartial<LinkedTwitterForAddressResponse>): LinkedTwitterForAddressResponse;
292
+ };
293
+ readonly responseStream: false;
294
+ readonly options: {};
295
+ };
296
+ readonly getLinkedAddressForTwitter: {
297
+ readonly name: "GetLinkedAddressForTwitter";
298
+ readonly requestType: {
299
+ encode(message: LinkedAddressForTwitterRequest, writer?: _m0.Writer): _m0.Writer;
300
+ decode(input: _m0.Reader | Uint8Array, length?: number): LinkedAddressForTwitterRequest;
301
+ create(base?: DeepPartial<LinkedAddressForTwitterRequest>): LinkedAddressForTwitterRequest;
302
+ fromPartial(object: DeepPartial<LinkedAddressForTwitterRequest>): LinkedAddressForTwitterRequest;
303
+ };
304
+ readonly requestStream: false;
305
+ readonly responseType: {
306
+ encode(message: LinkedAddressForTwitterResponse, writer?: _m0.Writer): _m0.Writer;
307
+ decode(input: _m0.Reader | Uint8Array, length?: number): LinkedAddressForTwitterResponse;
308
+ create(base?: DeepPartial<LinkedAddressForTwitterResponse>): LinkedAddressForTwitterResponse;
309
+ fromPartial(object: DeepPartial<LinkedAddressForTwitterResponse>): LinkedAddressForTwitterResponse;
310
+ };
311
+ readonly responseStream: false;
312
+ readonly options: {};
313
+ };
314
+ /** Admin utility endpoints for modifying state. Requires a signature with faucet private key. */
315
+ readonly setLinkedTwitter: {
316
+ readonly name: "SetLinkedTwitter";
317
+ readonly requestType: {
318
+ encode(message: SetLinkedTwitterRequest, writer?: _m0.Writer): _m0.Writer;
319
+ decode(input: _m0.Reader | Uint8Array, length?: number): SetLinkedTwitterRequest;
320
+ create(base?: DeepPartial<SetLinkedTwitterRequest>): SetLinkedTwitterRequest;
321
+ fromPartial(object: DeepPartial<SetLinkedTwitterRequest>): SetLinkedTwitterRequest;
322
+ };
323
+ readonly requestStream: false;
324
+ readonly responseType: {
325
+ encode(_: SetLinkedTwitterResponse, writer?: _m0.Writer): _m0.Writer;
326
+ decode(input: _m0.Reader | Uint8Array, length?: number): SetLinkedTwitterResponse;
327
+ create(base?: DeepPartial<SetLinkedTwitterResponse>): SetLinkedTwitterResponse;
328
+ fromPartial(_: DeepPartial<SetLinkedTwitterResponse>): SetLinkedTwitterResponse;
329
+ };
330
+ readonly responseStream: false;
331
+ readonly options: {};
332
+ };
333
+ };
334
+ };
335
+ interface FaucetServiceImplementation<CallContextExt = {}> {
336
+ drip(request: DripRequest, context: CallContext & CallContextExt): Promise<DeepPartial<DripResponse>>;
337
+ dripDev(request: DripDevRequest, context: CallContext & CallContextExt): Promise<DeepPartial<DripResponse>>;
338
+ dripVerifyTweet(request: DripRequest, context: CallContext & CallContextExt): Promise<DeepPartial<DripResponse>>;
339
+ timeUntilDrip(request: DripRequest, context: CallContext & CallContextExt): Promise<DeepPartial<TimeUntilDripResponse>>;
340
+ getLinkedTwitters(request: GetLinkedTwittersRequest, context: CallContext & CallContextExt): Promise<DeepPartial<GetLinkedTwittersResponse>>;
341
+ getLinkedTwitterForAddress(request: LinkedTwitterForAddressRequest, context: CallContext & CallContextExt): Promise<DeepPartial<LinkedTwitterForAddressResponse>>;
342
+ getLinkedAddressForTwitter(request: LinkedAddressForTwitterRequest, context: CallContext & CallContextExt): Promise<DeepPartial<LinkedAddressForTwitterResponse>>;
343
+ /** Admin utility endpoints for modifying state. Requires a signature with faucet private key. */
344
+ setLinkedTwitter(request: SetLinkedTwitterRequest, context: CallContext & CallContextExt): Promise<DeepPartial<SetLinkedTwitterResponse>>;
345
+ }
346
+ interface FaucetServiceClient<CallOptionsExt = {}> {
347
+ drip(request: DeepPartial<DripRequest>, options?: CallOptions & CallOptionsExt): Promise<DripResponse>;
348
+ dripDev(request: DeepPartial<DripDevRequest>, options?: CallOptions & CallOptionsExt): Promise<DripResponse>;
349
+ dripVerifyTweet(request: DeepPartial<DripRequest>, options?: CallOptions & CallOptionsExt): Promise<DripResponse>;
350
+ timeUntilDrip(request: DeepPartial<DripRequest>, options?: CallOptions & CallOptionsExt): Promise<TimeUntilDripResponse>;
351
+ getLinkedTwitters(request: DeepPartial<GetLinkedTwittersRequest>, options?: CallOptions & CallOptionsExt): Promise<GetLinkedTwittersResponse>;
352
+ getLinkedTwitterForAddress(request: DeepPartial<LinkedTwitterForAddressRequest>, options?: CallOptions & CallOptionsExt): Promise<LinkedTwitterForAddressResponse>;
353
+ getLinkedAddressForTwitter(request: DeepPartial<LinkedAddressForTwitterRequest>, options?: CallOptions & CallOptionsExt): Promise<LinkedAddressForTwitterResponse>;
354
+ /** Admin utility endpoints for modifying state. Requires a signature with faucet private key. */
355
+ setLinkedTwitter(request: DeepPartial<SetLinkedTwitterRequest>, options?: CallOptions & CallOptionsExt): Promise<SetLinkedTwitterResponse>;
356
+ }
357
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
358
+ type DeepPartial<T> = T extends Builtin ? T : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
359
+ [K in keyof T]?: DeepPartial<T[K]>;
360
+ } : Partial<T>;
361
+
362
+ /**
363
+ * Create a FaucetServiceClient
364
+ * @param url FaucetService URL
365
+ * @returns FaucetServiceClient
366
+ */
367
+ declare function createFaucetService(url: string): RawClient<FromTsProtoServiceDefinition<typeof FaucetServiceDefinition>>;
368
+
369
+ export { DeepPartial, DripDevRequest, DripRequest, DripResponse, FaucetServiceClient, FaucetServiceDefinition, FaucetServiceImplementation, FaucetStore, FaucetStore_AddressToUsernameEntry, FaucetStore_LatestDripEntry, FaucetStore_UsernameToAddressEntry, GetLinkedTwittersRequest, GetLinkedTwittersResponse, LinkedAddressForTwitterRequest, LinkedAddressForTwitterResponse, LinkedTwitterForAddressRequest, LinkedTwitterForAddressResponse, LinkedTwitterPair, SetLinkedTwitterRequest, SetLinkedTwitterResponse, TimeUntilDripResponse, createFaucetService, protobufPackage };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@latticexyz/services",
3
- "version": "2.0.0-skystrife-playtest-9e9511d4",
3
+ "version": "2.0.0-transaction-context-324984c5",
4
4
  "description": "MUD services for enhanced interactions with on-chain ECS state",
5
5
  "repository": {
6
6
  "type": "git",
@@ -10,28 +10,12 @@
10
10
  "license": "MIT",
11
11
  "type": "module",
12
12
  "exports": {
13
- "./ecs-relay": "./dist/ecs-relay.js",
14
- "./ecs-snapshot": "./dist/ecs-snapshot.js",
15
- "./ecs-stream": "./dist/ecs-stream.js",
16
- "./faucet": "./dist/faucet.js",
17
- "./mode": "./dist/mode.js"
13
+ "./faucet": "./dist/faucet.js"
18
14
  },
19
15
  "typesVersions": {
20
16
  "*": {
21
- "ecs-relay": [
22
- "./protobuf/ts/ecs-relay/ecs-relay.ts"
23
- ],
24
- "ecs-snapshot": [
25
- "./protobuf/ts/ecs-snapshot/ecs-snapshot.ts"
26
- ],
27
- "ecs-stream": [
28
- "./protobuf/ts/ecs-stream/ecs-stream.ts"
29
- ],
30
17
  "faucet": [
31
18
  "./ts/faucet/index.ts"
32
- ],
33
- "mode": [
34
- "./protobuf/ts/mode/mode.ts"
35
19
  ]
36
20
  }
37
21
  },
@@ -47,13 +31,10 @@
47
31
  },
48
32
  "gitHead": "914a1e0ae4a573d685841ca2ea921435057deb8f",
49
33
  "scripts": {
50
- "build": "pnpm run build:go && pnpm run build:protobuf && pnpm run build:js",
51
- "build:go": "make build",
34
+ "build": "pnpm run build:js",
52
35
  "build:js": "tsup",
53
- "build:protobuf": "make protoc-ts && prettier --write protobuf/ts/**/*.ts",
54
36
  "dev": "tsup --watch",
55
- "test": "pnpm run test:go",
56
- "test:ci": "pnpm run test",
57
- "test:go": "go test -v ./..."
37
+ "test": "echo 'no tests'",
38
+ "test:ci": "pnpm run test"
58
39
  }
59
40
  }
@@ -1,4 +1 @@
1
- export * as ECSSnapshot from "./ecs-snapshot/ecs-snapshot";
2
- export * as ECSStream from "./ecs-stream/ecs-stream";
3
- export * as ECSRelay from "./ecs-relay/ecs-relay";
4
1
  export * as Faucet from "./faucet/faucet";