diff --git a/.gitignore b/.gitignore index 68c27d79..8d19d524 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,12 @@ ./yarn.lock node_modules/ +# Redis +**/dump.rdb + +# Development +**/TODO + # TODO # Frontend # Backend diff --git a/README.md b/README.md index 43b2c05a..4c212163 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@
- + art_canvas

art/peace

***Collaborative art canvas on Starknet*** diff --git a/backend/backend.go b/backend/backend.go index dca06a25..8186585a 100644 --- a/backend/backend.go +++ b/backend/backend.go @@ -3,41 +3,141 @@ package main import ( "context" "encoding/json" + "fmt" "io" - "log" "net/http" + "os/exec" "strconv" + "github.com/gorilla/websocket" "github.com/redis/go-redis/v9" ) var client *redis.Client +// Vector of connections +var connections []*websocket.Conn + +// Message layout +/* +{ + "data": { + "cursor": { + "orderKey": 3, + "uniqueKey": "0x050d47ba775556cd86577692d31a38422af66471dcb85edaea33cde70bfc156c" + }, + "end_cursor": { + "orderKey": 4, + "uniqueKey": "0x03b2711fe29eba45f2a0250c34901d15e37b495599fac1a74960a09cc83e1234" + }, + "finality": "DATA_STATUS_ACCEPTED", + "batch": [ + { + "status": "BLOCK_STATUS_ACCEPTED_ON_L2", + "events": [ + { + "event": { + "fromAddress": "0x0474642f7f488d4b49b6e892f3e4a5407c6ad5fe065687f2ebe4e0f7c1309860", + "keys": [ + "0x02d7b50ebf415606d77c7e7842546fc13f8acfbfd16f7bcf2bc2d08f54114c23", + "0x0328ced46664355fc4b885ae7011af202313056a7e3d44827fb24c9d3206aaa0", + "0x000000000000000000000000000000000000000000000000000000000000001e" + ], + "data": [ + "0x0000000000000000000000000000000000000000000000000000000000000001" + ] + } + } + ] + } + ] + } +} +*/ func consumeIndexerMsg(w http.ResponseWriter, r *http.Request) { - log.Println("Consume indexer msg") + fmt.Println("Consume indexer msg") requestBody, err := io.ReadAll(r.Body) if err != nil { - log.Println("Error reading request body: ", err) + fmt.Println("Error reading request body: ", err) + w.WriteHeader(http.StatusInternalServerError) + return + } + + fmt.Println("Received message: ", string(requestBody)) + + // TODO: Parse message fully, check block status, number, ... + reqBody := map[string]interface{}{} + err = json.Unmarshal(requestBody, &reqBody) + if err != nil { + fmt.Println("Error unmarshalling request body: ", err) w.WriteHeader(http.StatusInternalServerError) return } + // Get the field data.batch[0].events[0].event.keys[2] + posHex := reqBody["data"].(map[string]interface{})["batch"].([]interface{})[0].(map[string]interface{})["events"].([]interface{})[0].(map[string]interface{})["event"].(map[string]interface{})["keys"].([]interface{})[2] + + // Get the field data.batch[0].events[0].event.data[0] + colorHex := reqBody["data"].(map[string]interface{})["batch"].([]interface{})[0].(map[string]interface{})["events"].([]interface{})[0].(map[string]interface{})["event"].(map[string]interface{})["data"].([]interface{})[0] - log.Println("Received message: ", string(requestBody)) + // Convert hex to int + position, err := strconv.ParseInt(posHex.(string), 0, 64) + if err != nil { + fmt.Println("Error converting position hex to int: ", err) + w.WriteHeader(http.StatusInternalServerError) + return + } + color, err := strconv.ParseInt(colorHex.(string), 0, 64) + if err != nil { + fmt.Println("Error converting color hex to int: ", err) + w.WriteHeader(http.StatusInternalServerError) + return + } + + colorBitWidth := uint(5) // TODO: Get from request || const / cmdline? + bitfieldType := "u" + strconv.Itoa(int(colorBitWidth)) + pos := uint(position) * colorBitWidth + + ctx := context.Background() + err = client.BitField(ctx, "canvas", "SET", bitfieldType, pos, color).Err() + if err != nil { + panic(err) + } + + var message = map[string]interface{}{ + "position": position, + "color": color, + } + messageBytes, err := json.Marshal(message) + if err != nil { + fmt.Println("Error marshalling message: ", err) + w.WriteHeader(http.StatusInternalServerError) + return + } + fmt.Println("Message: ", string(messageBytes), " to clients: ", len(connections)) + // Send message to all connected clients + for idx, conn := range connections { + if err := conn.WriteMessage(websocket.TextMessage, messageBytes); err != nil { + fmt.Println(err) + // Remove connection + conn.Close() + connections = append(connections[:idx], connections[idx+1:]...) + } + } } func initCanvas(w http.ResponseWriter, r *http.Request) { - log.Println("Initializing Canvas...") + fmt.Println("Initializing Canvas...") // TODO: Check if canvas already exists reqBody, err := io.ReadAll(r.Body) if err != nil { - log.Fatal(err) + panic(err) } var jsonBody map[string]uint err = json.Unmarshal(reqBody, &jsonBody) if err != nil { - log.Fatal(err) + panic(err) } // TODO: Check if width and height are valid width := jsonBody["width"] @@ -53,35 +153,37 @@ func initCanvas(w http.ResponseWriter, r *http.Request) { ctx := context.Background() err = client.Set(ctx, "canvas", canvas, 0).Err() if err != nil { - log.Fatal(err) + panic(err) } - log.Println("Canvas initialized") + fmt.Println("Canvas initialized") } func getCanvas(w http.ResponseWriter, r *http.Request) { - log.Println("Get Canvas") + fmt.Println("Get Canvas") ctx := context.Background() val, err := client.Get(ctx, "canvas").Result() if err != nil { - log.Fatal(err) + panic(err) } - log.Println("Canvas", val) + fmt.Println("Canvas", val) + w.Header().Set("Access-Control-Allow-Origin", "*") + w.Write([]byte(val)) } func placePixel(w http.ResponseWriter, r *http.Request) { - log.Println("Place Pixel") + fmt.Println("Place Pixel") reqBody, err := io.ReadAll(r.Body) if err != nil { - log.Fatal(err) + panic(err) } var jsonBody map[string]uint err = json.Unmarshal(reqBody, &jsonBody) if err != nil { - log.Fatal(err) + panic(err) } // TODO: Check if pos and color are valid // TODO: allow x, y coordinates? @@ -94,16 +196,16 @@ func placePixel(w http.ResponseWriter, r *http.Request) { ctx := context.Background() err = client.BitField(ctx, "canvas", "SET", bitfieldType, pos, color).Err() if err != nil { - log.Fatal(err) + panic(err) } } func getPixel(w http.ResponseWriter, r *http.Request) { - log.Println("Get Pixel") + fmt.Println("Get Pixel") position, err := strconv.Atoi(r.URL.Query().Get("position")) if err != nil { - log.Fatal(err) + panic(err) } colorBitWidth := uint(5) // TODO: Get from request || const / cmdline? bitfieldType := "u" + strconv.Itoa(int(colorBitWidth)) @@ -112,10 +214,87 @@ func getPixel(w http.ResponseWriter, r *http.Request) { ctx := context.Background() val, err := client.BitField(ctx, "canvas", "GET", bitfieldType, pos).Result() if err != nil { - log.Fatal(err) + panic(err) + } + + fmt.Println("Pixel", val) +} + +func placePixelDevnet(w http.ResponseWriter, r *http.Request) { + fmt.Println("Place Pixel") + + reqBody, err := io.ReadAll(r.Body) + if err != nil { + panic(err) + } + fmt.Println(reqBody) + var jsonBody map[string]string + err = json.Unmarshal(reqBody, &jsonBody) + if err != nil { + panic(err) + } + fmt.Println(jsonBody) + + x, err := strconv.Atoi(jsonBody["x"]) + if err != nil { + panic(err) + } + y, err := strconv.Atoi(jsonBody["y"]) + if err != nil { + panic(err) + } + // Use shell / bash to ls files in directory + shellCmd := "../tests/integration/local/place_pixel.sh" + position := x + y * 16 // TODO: Hardcoded for now + fmt.Println("Running shell command: ", shellCmd, jsonBody["contract"], "place_pixel", strconv.Itoa(int(position)), jsonBody["color"]) + cmd := exec.Command(shellCmd, jsonBody["contract"], "place_pixel", strconv.Itoa(int(position)), jsonBody["color"]) + out, err := cmd.Output() + if err != nil { + fmt.Println("Error executing shell command: ", err) + panic(err) + } + fmt.Println(string(out)) + + w.Header().Set("Access-Control-Allow-Origin", "*") + w.Write([]byte("Pixel placed")) +} + +var upgrader = websocket.Upgrader{ + ReadBufferSize: 1024, + WriteBufferSize: 1024, +} + +func wsReader(conn *websocket.Conn) { + for { + fmt.Println("Reading message") + messageType, p, err := conn.ReadMessage() + if err != nil { + fmt.Println(err) + return + } + fmt.Println("read", string(p), "messageType", messageType) + + //if err := conn.WriteMessage(messageType, p); err != nil { + // fmt.Println(err) + // return + //} + //fmt.Println("sent", string(p)) + } +} + +func wsEndpoint(w http.ResponseWriter, r *http.Request) { + fmt.Println("Websocket endpoint") + upgrader.CheckOrigin = func(r *http.Request) bool { return true } + + ws, err := upgrader.Upgrade(w, r, nil) + if err != nil { + fmt.Println(err) } - log.Println("Pixel", val) + fmt.Println("Client Connected") + // TODO: disconnecting / removing connections + connections = append(connections, ws) + wsReader(ws) } func main() { @@ -132,8 +311,10 @@ func main() { http.HandleFunc("/getCanvas", getCanvas) http.HandleFunc("/placePixel", placePixel) http.HandleFunc("/getPixel", getPixel) + http.HandleFunc("/placePixelDevnet", placePixelDevnet) + http.HandleFunc("/ws", wsEndpoint) // TODO: hardcode port - log.Println("Listening on port 8080") + fmt.Println("Listening on port 8080") http.ListenAndServe(":8080", nil) } diff --git a/backend/go.mod b/backend/go.mod index 207e39b5..2df08fd3 100644 --- a/backend/go.mod +++ b/backend/go.mod @@ -7,4 +7,6 @@ require github.com/redis/go-redis/v9 v9.5.1 require ( github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect + github.com/gorilla/websocket v1.5.1 // indirect + golang.org/x/net v0.17.0 // indirect ) diff --git a/backend/go.sum b/backend/go.sum index baf0d66f..be2216fb 100644 --- a/backend/go.sum +++ b/backend/go.sum @@ -2,5 +2,9 @@ github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= +github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY= +github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY= github.com/redis/go-redis/v9 v9.5.1 h1:H1X4D3yHPaYrkL5X06Wh6xNVM/pX0Ft4RV0vMGvLBh8= github.com/redis/go-redis/v9 v9.5.1/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M= +golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 5cff9d78..3177351f 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -11,10 +11,12 @@ "@testing-library/jest-dom": "^5.17.0", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", + "get-starknet": "^3.0.1", "react": "^18.2.0", "react-dom": "^18.2.0", "react-scripts": "5.0.1", - "starknetkit": "^1.1.4" + "react-use-websocket": "^4.8.1", + "starknet": "^5.24.3" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -3401,7 +3403,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.2.0.tgz", "integrity": "sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==", - "peer": true, "dependencies": { "@noble/hashes": "1.3.2" }, @@ -3413,7 +3414,6 @@ "version": "1.3.2", "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.2.tgz", "integrity": "sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==", - "peer": true, "engines": { "node": ">= 16" }, @@ -3453,291 +3453,6 @@ "node": ">= 8" } }, - "node_modules/@parcel/watcher": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.4.1.tgz", - "integrity": "sha512-HNjmfLQEVRZmHRET336f20H/8kOozUGwk7yajvsonjNxbj2wBTK1WsQuHkD5yYh9RxFGL2EyDHryOihOwUoKDA==", - "dependencies": { - "detect-libc": "^1.0.3", - "is-glob": "^4.0.3", - "micromatch": "^4.0.5", - "node-addon-api": "^7.0.0" - }, - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - }, - "optionalDependencies": { - "@parcel/watcher-android-arm64": "2.4.1", - "@parcel/watcher-darwin-arm64": "2.4.1", - "@parcel/watcher-darwin-x64": "2.4.1", - "@parcel/watcher-freebsd-x64": "2.4.1", - "@parcel/watcher-linux-arm-glibc": "2.4.1", - "@parcel/watcher-linux-arm64-glibc": "2.4.1", - "@parcel/watcher-linux-arm64-musl": "2.4.1", - "@parcel/watcher-linux-x64-glibc": "2.4.1", - "@parcel/watcher-linux-x64-musl": "2.4.1", - "@parcel/watcher-win32-arm64": "2.4.1", - "@parcel/watcher-win32-ia32": "2.4.1", - "@parcel/watcher-win32-x64": "2.4.1" - } - }, - "node_modules/@parcel/watcher-android-arm64": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@parcel/watcher-android-arm64/-/watcher-android-arm64-2.4.1.tgz", - "integrity": "sha512-LOi/WTbbh3aTn2RYddrO8pnapixAziFl6SMxHM69r3tvdSm94JtCenaKgk1GRg5FJ5wpMCpHeW+7yqPlvZv7kg==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/watcher-darwin-arm64": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-arm64/-/watcher-darwin-arm64-2.4.1.tgz", - "integrity": "sha512-ln41eihm5YXIY043vBrrHfn94SIBlqOWmoROhsMVTSXGh0QahKGy77tfEywQ7v3NywyxBBkGIfrWRHm0hsKtzA==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/watcher-darwin-x64": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-x64/-/watcher-darwin-x64-2.4.1.tgz", - "integrity": "sha512-yrw81BRLjjtHyDu7J61oPuSoeYWR3lDElcPGJyOvIXmor6DEo7/G2u1o7I38cwlcoBHQFULqF6nesIX3tsEXMg==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/watcher-freebsd-x64": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@parcel/watcher-freebsd-x64/-/watcher-freebsd-x64-2.4.1.tgz", - "integrity": "sha512-TJa3Pex/gX3CWIx/Co8k+ykNdDCLx+TuZj3f3h7eOjgpdKM+Mnix37RYsYU4LHhiYJz3DK5nFCCra81p6g050w==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/watcher-linux-arm-glibc": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm-glibc/-/watcher-linux-arm-glibc-2.4.1.tgz", - "integrity": "sha512-4rVYDlsMEYfa537BRXxJ5UF4ddNwnr2/1O4MHM5PjI9cvV2qymvhwZSFgXqbS8YoTk5i/JR0L0JDs69BUn45YA==", - "cpu": [ - "arm" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/watcher-linux-arm64-glibc": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-glibc/-/watcher-linux-arm64-glibc-2.4.1.tgz", - "integrity": "sha512-BJ7mH985OADVLpbrzCLgrJ3TOpiZggE9FMblfO65PlOCdG++xJpKUJ0Aol74ZUIYfb8WsRlUdgrZxKkz3zXWYA==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/watcher-linux-arm64-musl": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-musl/-/watcher-linux-arm64-musl-2.4.1.tgz", - "integrity": "sha512-p4Xb7JGq3MLgAfYhslU2SjoV9G0kI0Xry0kuxeG/41UfpjHGOhv7UoUDAz/jb1u2elbhazy4rRBL8PegPJFBhA==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/watcher-linux-x64-glibc": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-glibc/-/watcher-linux-x64-glibc-2.4.1.tgz", - "integrity": "sha512-s9O3fByZ/2pyYDPoLM6zt92yu6P4E39a03zvO0qCHOTjxmt3GHRMLuRZEWhWLASTMSrrnVNWdVI/+pUElJBBBg==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/watcher-linux-x64-musl": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-musl/-/watcher-linux-x64-musl-2.4.1.tgz", - "integrity": "sha512-L2nZTYR1myLNST0O632g0Dx9LyMNHrn6TOt76sYxWLdff3cB22/GZX2UPtJnaqQPdCRoszoY5rcOj4oMTtp5fQ==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/watcher-wasm": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@parcel/watcher-wasm/-/watcher-wasm-2.4.1.tgz", - "integrity": "sha512-/ZR0RxqxU/xxDGzbzosMjh4W6NdYFMqq2nvo2b8SLi7rsl/4jkL8S5stIikorNkdR50oVDvqb/3JT05WM+CRRA==", - "bundleDependencies": [ - "napi-wasm" - ], - "dependencies": { - "is-glob": "^4.0.3", - "micromatch": "^4.0.5", - "napi-wasm": "^1.1.0" - }, - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/watcher-wasm/node_modules/napi-wasm": { - "version": "1.1.0", - "inBundle": true, - "license": "MIT" - }, - "node_modules/@parcel/watcher-win32-arm64": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-arm64/-/watcher-win32-arm64-2.4.1.tgz", - "integrity": "sha512-Uq2BPp5GWhrq/lcuItCHoqxjULU1QYEcyjSO5jqqOK8RNFDBQnenMMx4gAl3v8GiWa59E9+uDM7yZ6LxwUIfRg==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/watcher-win32-ia32": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-ia32/-/watcher-win32-ia32-2.4.1.tgz", - "integrity": "sha512-maNRit5QQV2kgHFSYwftmPBxiuK5u4DXjbXx7q6eKjq5dsLXZ4FJiVvlcw35QXzk0KrUecJmuVFbj4uV9oYrcw==", - "cpu": [ - "ia32" - ], - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/watcher-win32-x64": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-x64/-/watcher-win32-x64-2.4.1.tgz", - "integrity": "sha512-+DvS92F9ezicfswqrvIRM2njcYJbd5mb9CUgtrHCHmvn7pPPa+nMDRu1o1bYYz/l5IB2NVGNJWiH7h1E58IF2A==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, "node_modules/@pkgjs/parseargs": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", @@ -3879,7 +3594,6 @@ "version": "1.1.6", "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.6.tgz", "integrity": "sha512-ok9AWwhcgYuGG3Zfhyqg+zwl+Wn5uE+dwC0NV/2qQkx4dABbb/bx96vWu8NSj+BNjjSjno+JRYRjle1jV08k3g==", - "peer": true, "funding": { "url": "https://paulmillr.com/funding/" } @@ -3894,7 +3608,6 @@ "url": "https://paulmillr.com/funding/" } ], - "peer": true, "dependencies": { "@noble/curves": "~1.2.0", "@noble/hashes": "~1.3.2" @@ -3921,152 +3634,6 @@ "@sinonjs/commons": "^1.7.0" } }, - "node_modules/@stablelib/aead": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/aead/-/aead-1.0.1.tgz", - "integrity": "sha512-q39ik6sxGHewqtO0nP4BuSe3db5G1fEJE8ukvngS2gLkBXyy6E7pLubhbYgnkDFv6V8cWaxcE4Xn0t6LWcJkyg==" - }, - "node_modules/@stablelib/binary": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/binary/-/binary-1.0.1.tgz", - "integrity": "sha512-ClJWvmL6UBM/wjkvv/7m5VP3GMr9t0osr4yVgLZsLCOz4hGN9gIAFEqnJ0TsSMAN+n840nf2cHZnA5/KFqHC7Q==", - "dependencies": { - "@stablelib/int": "^1.0.1" - } - }, - "node_modules/@stablelib/bytes": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/bytes/-/bytes-1.0.1.tgz", - "integrity": "sha512-Kre4Y4kdwuqL8BR2E9hV/R5sOrUj6NanZaZis0V6lX5yzqC3hBuVSDXUIBqQv/sCpmuWRiHLwqiT1pqqjuBXoQ==" - }, - "node_modules/@stablelib/chacha": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/chacha/-/chacha-1.0.1.tgz", - "integrity": "sha512-Pmlrswzr0pBzDofdFuVe1q7KdsHKhhU24e8gkEwnTGOmlC7PADzLVxGdn2PoNVBBabdg0l/IfLKg6sHAbTQugg==", - "dependencies": { - "@stablelib/binary": "^1.0.1", - "@stablelib/wipe": "^1.0.1" - } - }, - "node_modules/@stablelib/chacha20poly1305": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/chacha20poly1305/-/chacha20poly1305-1.0.1.tgz", - "integrity": "sha512-MmViqnqHd1ymwjOQfghRKw2R/jMIGT3wySN7cthjXCBdO+qErNPUBnRzqNpnvIwg7JBCg3LdeCZZO4de/yEhVA==", - "dependencies": { - "@stablelib/aead": "^1.0.1", - "@stablelib/binary": "^1.0.1", - "@stablelib/chacha": "^1.0.1", - "@stablelib/constant-time": "^1.0.1", - "@stablelib/poly1305": "^1.0.1", - "@stablelib/wipe": "^1.0.1" - } - }, - "node_modules/@stablelib/constant-time": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/constant-time/-/constant-time-1.0.1.tgz", - "integrity": "sha512-tNOs3uD0vSJcK6z1fvef4Y+buN7DXhzHDPqRLSXUel1UfqMB1PWNsnnAezrKfEwTLpN0cGH2p9NNjs6IqeD0eg==" - }, - "node_modules/@stablelib/ed25519": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@stablelib/ed25519/-/ed25519-1.0.3.tgz", - "integrity": "sha512-puIMWaX9QlRsbhxfDc5i+mNPMY+0TmQEskunY1rZEBPi1acBCVQAhnsk/1Hk50DGPtVsZtAWQg4NHGlVaO9Hqg==", - "dependencies": { - "@stablelib/random": "^1.0.2", - "@stablelib/sha512": "^1.0.1", - "@stablelib/wipe": "^1.0.1" - } - }, - "node_modules/@stablelib/hash": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/hash/-/hash-1.0.1.tgz", - "integrity": "sha512-eTPJc/stDkdtOcrNMZ6mcMK1e6yBbqRBaNW55XA1jU8w/7QdnCF0CmMmOD1m7VSkBR44PWrMHU2l6r8YEQHMgg==" - }, - "node_modules/@stablelib/hkdf": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/hkdf/-/hkdf-1.0.1.tgz", - "integrity": "sha512-SBEHYE16ZXlHuaW5RcGk533YlBj4grMeg5TooN80W3NpcHRtLZLLXvKyX0qcRFxf+BGDobJLnwkvgEwHIDBR6g==", - "dependencies": { - "@stablelib/hash": "^1.0.1", - "@stablelib/hmac": "^1.0.1", - "@stablelib/wipe": "^1.0.1" - } - }, - "node_modules/@stablelib/hmac": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/hmac/-/hmac-1.0.1.tgz", - "integrity": "sha512-V2APD9NSnhVpV/QMYgCVMIYKiYG6LSqw1S65wxVoirhU/51ACio6D4yDVSwMzuTJXWZoVHbDdINioBwKy5kVmA==", - "dependencies": { - "@stablelib/constant-time": "^1.0.1", - "@stablelib/hash": "^1.0.1", - "@stablelib/wipe": "^1.0.1" - } - }, - "node_modules/@stablelib/int": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/int/-/int-1.0.1.tgz", - "integrity": "sha512-byr69X/sDtDiIjIV6m4roLVWnNNlRGzsvxw+agj8CIEazqWGOQp2dTYgQhtyVXV9wpO6WyXRQUzLV/JRNumT2w==" - }, - "node_modules/@stablelib/keyagreement": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/keyagreement/-/keyagreement-1.0.1.tgz", - "integrity": "sha512-VKL6xBwgJnI6l1jKrBAfn265cspaWBPAPEc62VBQrWHLqVgNRE09gQ/AnOEyKUWrrqfD+xSQ3u42gJjLDdMDQg==", - "dependencies": { - "@stablelib/bytes": "^1.0.1" - } - }, - "node_modules/@stablelib/poly1305": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/poly1305/-/poly1305-1.0.1.tgz", - "integrity": "sha512-1HlG3oTSuQDOhSnLwJRKeTRSAdFNVB/1djy2ZbS35rBSJ/PFqx9cf9qatinWghC2UbfOYD8AcrtbUQl8WoxabA==", - "dependencies": { - "@stablelib/constant-time": "^1.0.1", - "@stablelib/wipe": "^1.0.1" - } - }, - "node_modules/@stablelib/random": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@stablelib/random/-/random-1.0.2.tgz", - "integrity": "sha512-rIsE83Xpb7clHPVRlBj8qNe5L8ISQOzjghYQm/dZ7VaM2KHYwMW5adjQjrzTZCchFnNCNhkwtnOBa9HTMJCI8w==", - "dependencies": { - "@stablelib/binary": "^1.0.1", - "@stablelib/wipe": "^1.0.1" - } - }, - "node_modules/@stablelib/sha256": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/sha256/-/sha256-1.0.1.tgz", - "integrity": "sha512-GIIH3e6KH+91FqGV42Kcj71Uefd/QEe7Dy42sBTeqppXV95ggCcxLTk39bEr+lZfJmp+ghsR07J++ORkRELsBQ==", - "dependencies": { - "@stablelib/binary": "^1.0.1", - "@stablelib/hash": "^1.0.1", - "@stablelib/wipe": "^1.0.1" - } - }, - "node_modules/@stablelib/sha512": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/sha512/-/sha512-1.0.1.tgz", - "integrity": "sha512-13gl/iawHV9zvDKciLo1fQ8Bgn2Pvf7OV6amaRVKiq3pjQ3UmEpXxWiAfV8tYjUpeZroBxtyrwtdooQT/i3hzw==", - "dependencies": { - "@stablelib/binary": "^1.0.1", - "@stablelib/hash": "^1.0.1", - "@stablelib/wipe": "^1.0.1" - } - }, - "node_modules/@stablelib/wipe": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/wipe/-/wipe-1.0.1.tgz", - "integrity": "sha512-WfqfX/eXGiAd3RJe4VU2snh/ZPwtSjLG4ynQ/vYzvghTh7dHFcI1wl+nrkWG6lGhukOxOsUHfv8dUXr58D0ayg==" - }, - "node_modules/@stablelib/x25519": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@stablelib/x25519/-/x25519-1.0.3.tgz", - "integrity": "sha512-KnTbKmUhPhHavzobclVJQG5kuivH+qDLpe84iRqX3CLrKp881cF160JvXJ+hjn1aMyCwYOKeIZefIH/P5cJoRw==", - "dependencies": { - "@stablelib/keyagreement": "^1.0.1", - "@stablelib/random": "^1.0.2", - "@stablelib/wipe": "^1.0.1" - } - }, "node_modules/@surma/rollup-plugin-off-main-thread": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/@surma/rollup-plugin-off-main-thread/-/rollup-plugin-off-main-thread-2.2.3.tgz", @@ -4395,25 +3962,6 @@ "node": ">= 6" } }, - "node_modules/@trpc/client": { - "version": "10.45.2", - "resolved": "https://registry.npmjs.org/@trpc/client/-/client-10.45.2.tgz", - "integrity": "sha512-ykALM5kYWTLn1zYuUOZ2cPWlVfrXhc18HzBDyRhoPYN0jey4iQHEFSEowfnhg1RvYnrAVjNBgHNeSAXjrDbGwg==", - "funding": [ - "https://trpc.io/sponsor" - ], - "peerDependencies": { - "@trpc/server": "10.45.2" - } - }, - "node_modules/@trpc/server": { - "version": "10.45.2", - "resolved": "https://registry.npmjs.org/@trpc/server/-/server-10.45.2.tgz", - "integrity": "sha512-wOrSThNNE4HUnuhJG6PfDRp4L2009KDVxsd+2VYH8ro6o/7/jwYZ8Uu5j+VaW+mOmc8EHerHzGcdbGNQSAUPgg==", - "funding": [ - "https://trpc.io/sponsor" - ] - }, "node_modules/@trysound/sax": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/@trysound/sax/-/sax-0.2.0.tgz", @@ -5027,301 +4575,13 @@ "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==" }, - "node_modules/@walletconnect/core": { - "version": "2.11.3", - "resolved": "https://registry.npmjs.org/@walletconnect/core/-/core-2.11.3.tgz", - "integrity": "sha512-/9m4EqiggFUwkQDv5PDWbcTI+yCVnBd/iYW5iIHEkivg2/mnBr2bQz2r/vtPjp19r/ZK62Dx0+UN3U+BWP8ulQ==", - "dependencies": { - "@walletconnect/heartbeat": "1.2.1", - "@walletconnect/jsonrpc-provider": "1.0.13", - "@walletconnect/jsonrpc-types": "1.0.3", - "@walletconnect/jsonrpc-utils": "1.0.8", - "@walletconnect/jsonrpc-ws-connection": "1.0.14", - "@walletconnect/keyvaluestorage": "^1.1.1", - "@walletconnect/logger": "^2.0.1", - "@walletconnect/relay-api": "^1.0.9", - "@walletconnect/relay-auth": "^1.0.4", - "@walletconnect/safe-json": "^1.0.2", - "@walletconnect/time": "^1.0.2", - "@walletconnect/types": "2.11.3", - "@walletconnect/utils": "2.11.3", - "events": "^3.3.0", - "isomorphic-unfetch": "3.1.0", - "lodash.isequal": "4.5.0", - "uint8arrays": "^3.1.0" - } - }, - "node_modules/@walletconnect/environment": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@walletconnect/environment/-/environment-1.0.1.tgz", - "integrity": "sha512-T426LLZtHj8e8rYnKfzsw1aG6+M0BT1ZxayMdv/p8yM0MU+eJDISqNY3/bccxRr4LrF9csq02Rhqt08Ibl0VRg==", + "node_modules/@webassemblyjs/ast": { + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.12.1.tgz", + "integrity": "sha512-EKfMUOPRRUTy5UII4qJDGPpqfwjOmZ5jeGFwid9mnoqIFK+e0vqoi1qH56JpmZSzEL53jKnNzScdmftJyG5xWg==", "dependencies": { - "tslib": "1.14.1" - } - }, - "node_modules/@walletconnect/environment/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" - }, - "node_modules/@walletconnect/events": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@walletconnect/events/-/events-1.0.1.tgz", - "integrity": "sha512-NPTqaoi0oPBVNuLv7qPaJazmGHs5JGyO8eEAk5VGKmJzDR7AHzD4k6ilox5kxk1iwiOnFopBOOMLs86Oa76HpQ==", - "dependencies": { - "keyvaluestorage-interface": "^1.0.0", - "tslib": "1.14.1" - } - }, - "node_modules/@walletconnect/events/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" - }, - "node_modules/@walletconnect/heartbeat": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@walletconnect/heartbeat/-/heartbeat-1.2.1.tgz", - "integrity": "sha512-yVzws616xsDLJxuG/28FqtZ5rzrTA4gUjdEMTbWB5Y8V1XHRmqq4efAxCw5ie7WjbXFSUyBHaWlMR+2/CpQC5Q==", - "dependencies": { - "@walletconnect/events": "^1.0.1", - "@walletconnect/time": "^1.0.2", - "tslib": "1.14.1" - } - }, - "node_modules/@walletconnect/heartbeat/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" - }, - "node_modules/@walletconnect/jsonrpc-provider": { - "version": "1.0.13", - "resolved": "https://registry.npmjs.org/@walletconnect/jsonrpc-provider/-/jsonrpc-provider-1.0.13.tgz", - "integrity": "sha512-K73EpThqHnSR26gOyNEL+acEex3P7VWZe6KE12ZwKzAt2H4e5gldZHbjsu2QR9cLeJ8AXuO7kEMOIcRv1QEc7g==", - "dependencies": { - "@walletconnect/jsonrpc-utils": "^1.0.8", - "@walletconnect/safe-json": "^1.0.2", - "tslib": "1.14.1" - } - }, - "node_modules/@walletconnect/jsonrpc-provider/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" - }, - "node_modules/@walletconnect/jsonrpc-types": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@walletconnect/jsonrpc-types/-/jsonrpc-types-1.0.3.tgz", - "integrity": "sha512-iIQ8hboBl3o5ufmJ8cuduGad0CQm3ZlsHtujv9Eu16xq89q+BG7Nh5VLxxUgmtpnrePgFkTwXirCTkwJH1v+Yw==", - "dependencies": { - "keyvaluestorage-interface": "^1.0.0", - "tslib": "1.14.1" - } - }, - "node_modules/@walletconnect/jsonrpc-types/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" - }, - "node_modules/@walletconnect/jsonrpc-utils": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@walletconnect/jsonrpc-utils/-/jsonrpc-utils-1.0.8.tgz", - "integrity": "sha512-vdeb03bD8VzJUL6ZtzRYsFMq1eZQcM3EAzT0a3st59dyLfJ0wq+tKMpmGH7HlB7waD858UWgfIcudbPFsbzVdw==", - "dependencies": { - "@walletconnect/environment": "^1.0.1", - "@walletconnect/jsonrpc-types": "^1.0.3", - "tslib": "1.14.1" - } - }, - "node_modules/@walletconnect/jsonrpc-utils/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" - }, - "node_modules/@walletconnect/jsonrpc-ws-connection": { - "version": "1.0.14", - "resolved": "https://registry.npmjs.org/@walletconnect/jsonrpc-ws-connection/-/jsonrpc-ws-connection-1.0.14.tgz", - "integrity": "sha512-Jsl6fC55AYcbkNVkwNM6Jo+ufsuCQRqViOQ8ZBPH9pRREHH9welbBiszuTLqEJiQcO/6XfFDl6bzCJIkrEi8XA==", - "dependencies": { - "@walletconnect/jsonrpc-utils": "^1.0.6", - "@walletconnect/safe-json": "^1.0.2", - "events": "^3.3.0", - "ws": "^7.5.1" - } - }, - "node_modules/@walletconnect/keyvaluestorage": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@walletconnect/keyvaluestorage/-/keyvaluestorage-1.1.1.tgz", - "integrity": "sha512-V7ZQq2+mSxAq7MrRqDxanTzu2RcElfK1PfNYiaVnJgJ7Q7G7hTVwF8voIBx92qsRyGHZihrwNPHuZd1aKkd0rA==", - "dependencies": { - "@walletconnect/safe-json": "^1.0.1", - "idb-keyval": "^6.2.1", - "unstorage": "^1.9.0" - }, - "peerDependencies": { - "@react-native-async-storage/async-storage": "1.x" - }, - "peerDependenciesMeta": { - "@react-native-async-storage/async-storage": { - "optional": true - } - } - }, - "node_modules/@walletconnect/logger": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@walletconnect/logger/-/logger-2.0.1.tgz", - "integrity": "sha512-SsTKdsgWm+oDTBeNE/zHxxr5eJfZmE9/5yp/Ku+zJtcTAjELb3DXueWkDXmE9h8uHIbJzIb5wj5lPdzyrjT6hQ==", - "dependencies": { - "pino": "7.11.0", - "tslib": "1.14.1" - } - }, - "node_modules/@walletconnect/logger/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" - }, - "node_modules/@walletconnect/relay-api": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@walletconnect/relay-api/-/relay-api-1.0.9.tgz", - "integrity": "sha512-Q3+rylJOqRkO1D9Su0DPE3mmznbAalYapJ9qmzDgK28mYF9alcP3UwG/og5V7l7CFOqzCLi7B8BvcBUrpDj0Rg==", - "dependencies": { - "@walletconnect/jsonrpc-types": "^1.0.2", - "tslib": "1.14.1" - } - }, - "node_modules/@walletconnect/relay-api/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" - }, - "node_modules/@walletconnect/relay-auth": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@walletconnect/relay-auth/-/relay-auth-1.0.4.tgz", - "integrity": "sha512-kKJcS6+WxYq5kshpPaxGHdwf5y98ZwbfuS4EE/NkQzqrDFm5Cj+dP8LofzWvjrrLkZq7Afy7WrQMXdLy8Sx7HQ==", - "dependencies": { - "@stablelib/ed25519": "^1.0.2", - "@stablelib/random": "^1.0.1", - "@walletconnect/safe-json": "^1.0.1", - "@walletconnect/time": "^1.0.2", - "tslib": "1.14.1", - "uint8arrays": "^3.0.0" - } - }, - "node_modules/@walletconnect/relay-auth/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" - }, - "node_modules/@walletconnect/safe-json": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@walletconnect/safe-json/-/safe-json-1.0.2.tgz", - "integrity": "sha512-Ogb7I27kZ3LPC3ibn8ldyUr5544t3/STow9+lzz7Sfo808YD7SBWk7SAsdBFlYgP2zDRy2hS3sKRcuSRM0OTmA==", - "dependencies": { - "tslib": "1.14.1" - } - }, - "node_modules/@walletconnect/safe-json/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" - }, - "node_modules/@walletconnect/sign-client": { - "version": "2.11.3", - "resolved": "https://registry.npmjs.org/@walletconnect/sign-client/-/sign-client-2.11.3.tgz", - "integrity": "sha512-JVjLTxN/3NjMXv5zalSGKuSYLRyU2yX6AWEdq17cInlrwODpbWZr6PS1uxMWdH4r90DXBLhdtwDbEq/pfd0BPg==", - "dependencies": { - "@walletconnect/core": "2.11.3", - "@walletconnect/events": "^1.0.1", - "@walletconnect/heartbeat": "1.2.1", - "@walletconnect/jsonrpc-utils": "1.0.8", - "@walletconnect/logger": "^2.0.1", - "@walletconnect/time": "^1.0.2", - "@walletconnect/types": "2.11.3", - "@walletconnect/utils": "2.11.3", - "events": "^3.3.0" - } - }, - "node_modules/@walletconnect/time": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@walletconnect/time/-/time-1.0.2.tgz", - "integrity": "sha512-uzdd9woDcJ1AaBZRhqy5rNC9laqWGErfc4dxA9a87mPdKOgWMD85mcFo9dIYIts/Jwocfwn07EC6EzclKubk/g==", - "dependencies": { - "tslib": "1.14.1" - } - }, - "node_modules/@walletconnect/time/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" - }, - "node_modules/@walletconnect/types": { - "version": "2.11.3", - "resolved": "https://registry.npmjs.org/@walletconnect/types/-/types-2.11.3.tgz", - "integrity": "sha512-JY4wA9MVosDW9dcJMTpnwliste0aJGJ1X6Q4ulLsQsgWRSEBRkLila0oUT01TDBW9Yq8uUp7uFOUTaKx6KWVAg==", - "dependencies": { - "@walletconnect/events": "^1.0.1", - "@walletconnect/heartbeat": "1.2.1", - "@walletconnect/jsonrpc-types": "1.0.3", - "@walletconnect/keyvaluestorage": "^1.1.1", - "@walletconnect/logger": "^2.0.1", - "events": "^3.3.0" - } - }, - "node_modules/@walletconnect/utils": { - "version": "2.11.3", - "resolved": "https://registry.npmjs.org/@walletconnect/utils/-/utils-2.11.3.tgz", - "integrity": "sha512-jsdNkrl/IcTkzWFn0S2d0urzBXg6RxVJtUYRsUx3qI3wzOGiABP9ui3yiZ3SgZOv9aRe62PaNp1qpbYZ+zPb8Q==", - "dependencies": { - "@stablelib/chacha20poly1305": "1.0.1", - "@stablelib/hkdf": "1.0.1", - "@stablelib/random": "^1.0.2", - "@stablelib/sha256": "1.0.1", - "@stablelib/x25519": "^1.0.3", - "@walletconnect/relay-api": "^1.0.9", - "@walletconnect/safe-json": "^1.0.2", - "@walletconnect/time": "^1.0.2", - "@walletconnect/types": "2.11.3", - "@walletconnect/window-getters": "^1.0.1", - "@walletconnect/window-metadata": "^1.0.1", - "detect-browser": "5.3.0", - "query-string": "7.1.3", - "uint8arrays": "^3.1.0" - } - }, - "node_modules/@walletconnect/window-getters": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@walletconnect/window-getters/-/window-getters-1.0.1.tgz", - "integrity": "sha512-vHp+HqzGxORPAN8gY03qnbTMnhqIwjeRJNOMOAzePRg4xVEEE2WvYsI9G2NMjOknA8hnuYbU3/hwLcKbjhc8+Q==", - "dependencies": { - "tslib": "1.14.1" - } - }, - "node_modules/@walletconnect/window-getters/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" - }, - "node_modules/@walletconnect/window-metadata": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@walletconnect/window-metadata/-/window-metadata-1.0.1.tgz", - "integrity": "sha512-9koTqyGrM2cqFRW517BPY/iEtUDx2r1+Pwwu5m7sJ7ka79wi3EyqhqcICk/yDmv6jAS1rjKgTKXlEhanYjijcA==", - "dependencies": { - "@walletconnect/window-getters": "^1.0.1", - "tslib": "1.14.1" - } - }, - "node_modules/@walletconnect/window-metadata/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" - }, - "node_modules/@webassemblyjs/ast": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.12.1.tgz", - "integrity": "sha512-EKfMUOPRRUTy5UII4qJDGPpqfwjOmZ5jeGFwid9mnoqIFK+e0vqoi1qH56JpmZSzEL53jKnNzScdmftJyG5xWg==", - "dependencies": { - "@webassemblyjs/helper-numbers": "1.11.6", - "@webassemblyjs/helper-wasm-bytecode": "1.11.6" + "@webassemblyjs/helper-numbers": "1.11.6", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6" } }, "node_modules/@webassemblyjs/floating-point-hex-parser": { @@ -5915,14 +5175,6 @@ "node": ">= 4.0.0" } }, - "node_modules/atomic-sleep": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/atomic-sleep/-/atomic-sleep-1.0.0.tgz", - "integrity": "sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==", - "engines": { - "node": ">=8.0.0" - } - }, "node_modules/autoprefixer": { "version": "10.4.19", "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.19.tgz", @@ -6615,14 +5867,6 @@ "node": ">=8" } }, - "node_modules/citty": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/citty/-/citty-0.1.6.tgz", - "integrity": "sha512-tskPPKEs8D2KPafUypv2gxwJP8h/OaJmC82QQGGDQcHvXX43xF2VDACcJVmZ0EuSxkpO9Kc4MlrA3q0+FG58AQ==", - "dependencies": { - "consola": "^3.2.3" - } - }, "node_modules/cjs-module-lexer": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.3.tgz", @@ -6647,160 +5891,6 @@ "node": ">=0.10.0" } }, - "node_modules/clipboardy": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/clipboardy/-/clipboardy-4.0.0.tgz", - "integrity": "sha512-5mOlNS0mhX0707P2I0aZ2V/cmHUEO/fL7VFLqszkhUsxt7RwnmrInf/eEQKlf5GzvYeHIjT+Ov1HRfNmymlG0w==", - "dependencies": { - "execa": "^8.0.1", - "is-wsl": "^3.1.0", - "is64bit": "^2.0.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/clipboardy/node_modules/execa": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", - "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", - "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^8.0.1", - "human-signals": "^5.0.0", - "is-stream": "^3.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^5.1.0", - "onetime": "^6.0.0", - "signal-exit": "^4.1.0", - "strip-final-newline": "^3.0.0" - }, - "engines": { - "node": ">=16.17" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" - } - }, - "node_modules/clipboardy/node_modules/get-stream": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", - "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", - "engines": { - "node": ">=16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/clipboardy/node_modules/human-signals": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", - "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", - "engines": { - "node": ">=16.17.0" - } - }, - "node_modules/clipboardy/node_modules/is-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", - "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/clipboardy/node_modules/is-wsl": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-3.1.0.tgz", - "integrity": "sha512-UcVfVfaK4Sc4m7X3dUSoHoozQGBEFeDC+zVo06t98xe8CzHSZZBekNXH+tu0NalHolcJ/QAGqS46Hef7QXBIMw==", - "dependencies": { - "is-inside-container": "^1.0.0" - }, - "engines": { - "node": ">=16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/clipboardy/node_modules/mimic-fn": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", - "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/clipboardy/node_modules/npm-run-path": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", - "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", - "dependencies": { - "path-key": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/clipboardy/node_modules/onetime": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", - "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", - "dependencies": { - "mimic-fn": "^4.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/clipboardy/node_modules/path-key": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", - "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/clipboardy/node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/clipboardy/node_modules/strip-final-newline": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", - "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/cliui": { "version": "7.0.4", "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", @@ -7029,14 +6119,6 @@ "node": ">=0.8" } }, - "node_modules/consola": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/consola/-/consola-3.2.3.tgz", - "integrity": "sha512-I5qxpzLv+sJhTVEoLYNcTW+bThDCPsit0vLNKShZx6rLtpilNpmmeTPaeqJb9ZE9dV3DGaeby6Vuhrw38WjeyQ==", - "engines": { - "node": "^14.18.0 || >=16.10.0" - } - }, "node_modules/content-disposition": { "version": "0.5.4", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", @@ -7069,11 +6151,6 @@ "node": ">= 0.6" } }, - "node_modules/cookie-es": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/cookie-es/-/cookie-es-1.0.0.tgz", - "integrity": "sha512-mWYvfOLrfEc996hlKcdABeIiPHUPC6DM2QYZdGGOvhOTbA3tjm2eBwqlJpoFdjC89NI4Qt6h0Pu06Mp+1Pj5OQ==" - }, "node_modules/cookie-signature": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", @@ -7144,19 +6221,6 @@ "node": ">= 8" } }, - "node_modules/crossws": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/crossws/-/crossws-0.2.4.tgz", - "integrity": "sha512-DAxroI2uSOgUKLz00NX6A8U/8EE3SZHmIND+10jkVSaypvyt57J5JEOxAQOL6lQxyzi/wZbTIwssU1uy69h5Vg==", - "peerDependencies": { - "uWebSockets.js": "*" - }, - "peerDependenciesMeta": { - "uWebSockets.js": { - "optional": true - } - } - }, "node_modules/crypto-random-string": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz", @@ -7656,14 +6720,6 @@ "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz", "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==" }, - "node_modules/decode-uri-component": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.2.tgz", - "integrity": "sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==", - "engines": { - "node": ">=0.10" - } - }, "node_modules/dedent": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", @@ -7764,11 +6820,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/defu": { - "version": "6.1.4", - "resolved": "https://registry.npmjs.org/defu/-/defu-6.1.4.tgz", - "integrity": "sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg==" - }, "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -7793,11 +6844,6 @@ "node": ">=6" } }, - "node_modules/destr": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/destr/-/destr-2.0.3.tgz", - "integrity": "sha512-2N3BOUU4gYMpTP24s5rF5iP7BDr7uNTCs4ozw3kf/eKfvWSIu93GEBi5m427YoyJoeOzQ5smuu4nNAPGb8idSQ==" - }, "node_modules/destroy": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", @@ -7807,22 +6853,6 @@ "npm": "1.2.8000 || >= 1.4.16" } }, - "node_modules/detect-browser": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/detect-browser/-/detect-browser-5.3.0.tgz", - "integrity": "sha512-53rsFbGdwMwlF7qvCt0ypLM5V5/Mbl0szB7GPN8y9NCcbknYOeVVXdrXEq+90IwAfrrzt6Hd+u2E2ntakICU8w==" - }, - "node_modules/detect-libc": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", - "integrity": "sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==", - "bin": { - "detect-libc": "bin/detect-libc.js" - }, - "engines": { - "node": ">=0.10" - } - }, "node_modules/detect-newline": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", @@ -8027,17 +7057,6 @@ "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz", "integrity": "sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==" }, - "node_modules/duplexify": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-4.1.3.tgz", - "integrity": "sha512-M3BmBhwJRZsSx38lZyhE53Csddgzl5R7xGJNk7CVddZD6CcmwMCH8J+7AprIrQKH7TonKxaCjcv27Qmf+sQ+oA==", - "dependencies": { - "end-of-stream": "^1.4.1", - "inherits": "^2.0.3", - "readable-stream": "^3.1.1", - "stream-shift": "^1.0.2" - } - }, "node_modules/eastasianwidth": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", @@ -8099,14 +7118,6 @@ "node": ">= 0.8" } }, - "node_modules/end-of-stream": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "dependencies": { - "once": "^1.4.0" - } - }, "node_modules/enhanced-resolve": { "version": "5.16.0", "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.16.0.tgz", @@ -9122,14 +8133,6 @@ "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==" }, - "node_modules/fast-redact": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/fast-redact/-/fast-redact-3.5.0.tgz", - "integrity": "sha512-dwsoQlS7h9hMeYUq1W++23NDcBLV4KqONnITDV9DjfS3q1SgDGVrBdvvTLUotWtPSD7asWDV9/CmsZPy8Hf70A==", - "engines": { - "node": ">=6" - } - }, "node_modules/fastq": { "version": "1.17.1", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", @@ -9228,17 +8231,9 @@ "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", "dependencies": { "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/filter-obj": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/filter-obj/-/filter-obj-1.1.0.tgz", - "integrity": "sha512-8rXg1ZnX7xzy2NGDVkBVaAy+lSlPNwad13BtgSlLuxfIslyt5Vg64U7tFcCt4WS1R0hvtnQybT/IyCkGZ3DpXQ==", + }, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, "node_modules/finalhandler": { @@ -9622,10 +8617,14 @@ "node": ">=8.0.0" } }, - "node_modules/get-port-please": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/get-port-please/-/get-port-please-3.1.2.tgz", - "integrity": "sha512-Gxc29eLs1fbn6LQ4jSU4vXjlwyZhF5HsGuMAa7gqBP4Rw4yxxltyDUuF5MBclFzDTXO+ACchGQoeela4DSfzdQ==" + "node_modules/get-starknet": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/get-starknet/-/get-starknet-3.0.1.tgz", + "integrity": "sha512-EyUl+DVQH5PXW2OUdY06/yaqlMizzLKRLzp3S+VhYz+l6wGvW5pmhTXHLaYI4hWfebIDfFkFvAPxVPv/TkWLyA==", + "dependencies": { + "bowser": "^2.11.0", + "get-starknet-core": "^3.0.1" + } }, "node_modules/get-starknet-core": { "version": "3.2.0", @@ -9813,23 +8812,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/h3": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/h3/-/h3-1.11.1.tgz", - "integrity": "sha512-AbaH6IDnZN6nmbnJOH72y3c5Wwh9P97soSVdGSBbcDACRdkC0FEWf25pzx4f/NuOCK6quHmW18yF2Wx+G4Zi1A==", - "dependencies": { - "cookie-es": "^1.0.0", - "crossws": "^0.2.2", - "defu": "^6.1.4", - "destr": "^2.0.3", - "iron-webcrypto": "^1.0.0", - "ohash": "^1.1.3", - "radix3": "^1.1.0", - "ufo": "^1.4.0", - "uncrypto": "^0.1.3", - "unenv": "^1.9.0" - } - }, "node_modules/handle-thing": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/handle-thing/-/handle-thing-2.0.1.tgz", @@ -10147,15 +9129,6 @@ } } }, - "node_modules/http-shutdown": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/http-shutdown/-/http-shutdown-1.2.2.tgz", - "integrity": "sha512-S9wWkJ/VSY9/k4qcjG318bqJNruzE4HySUhFYknwmu6LBP97KLLfwNf+n4V1BHurvFNkSKLFnK/RsuUnRTf9Vw==", - "engines": { - "iojs": ">= 1.0.0", - "node": ">= 0.12.0" - } - }, "node_modules/https-proxy-agent": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", @@ -10203,11 +9176,6 @@ "resolved": "https://registry.npmjs.org/idb/-/idb-7.1.1.tgz", "integrity": "sha512-gchesWBzyvGHRO9W8tzUWFDycow5gwjvFKfyV9FF32Y7F50yZMp7mP+T2mJIWFx49zicqyC4uefHM17o6xKIVQ==" }, - "node_modules/idb-keyval": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/idb-keyval/-/idb-keyval-6.2.1.tgz", - "integrity": "sha512-8Sb3veuYCyrZL+VBt9LJfZjLUPWVvqn8tG28VqYNFCo43KHcKuq+b4EiXGeuaLAQWL2YmyDgMp2aSpH9JHsEQg==" - }, "node_modules/identity-obj-proxy": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/identity-obj-proxy/-/identity-obj-proxy-3.0.0.tgz", @@ -10333,14 +9301,6 @@ "node": ">= 10" } }, - "node_modules/iron-webcrypto": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/iron-webcrypto/-/iron-webcrypto-1.1.0.tgz", - "integrity": "sha512-5vgYsCakNlaQub1orZK5QmNYhwYtcllTkZBp5sfIaCqY93Cf6l+v2rtE+E4TMbcfjxDMCdrO8wmp7+ZvhDECLA==", - "funding": { - "url": "https://github.com/sponsors/brc-dd" - } - }, "node_modules/is-arguments": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", @@ -10551,37 +9511,6 @@ "node": ">=0.10.0" } }, - "node_modules/is-inside-container": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz", - "integrity": "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==", - "dependencies": { - "is-docker": "^3.0.0" - }, - "bin": { - "is-inside-container": "cli.js" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/is-inside-container/node_modules/is-docker": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz", - "integrity": "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==", - "bin": { - "is-docker": "cli.js" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/is-map": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.3.tgz", @@ -10663,11 +9592,6 @@ "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==" }, - "node_modules/is-promise": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz", - "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==" - }, "node_modules/is-regex": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", @@ -10830,20 +9754,6 @@ "node": ">=8" } }, - "node_modules/is64bit": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is64bit/-/is64bit-2.0.0.tgz", - "integrity": "sha512-jv+8jaWCl0g2lSBkNSVXdzfBA0npK1HGC2KtWM9FumFRoGS94g3NbCCLVnCYHLjp4GrW2KZeeSTMo5ddtznmGw==", - "dependencies": { - "system-architecture": "^0.1.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/isarray": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", @@ -10858,21 +9768,11 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/isomorphic-fetch/-/isomorphic-fetch-3.0.0.tgz", "integrity": "sha512-qvUtwJ3j6qwsF3jLxkZ72qCgjMysPzDfeV240JHiGZsANBYd+EEuu35v7dfrJ9Up0Ak07D7GGSkGhCHTqg/5wA==", - "peer": true, "dependencies": { "node-fetch": "^2.6.1", "whatwg-fetch": "^3.4.1" } }, - "node_modules/isomorphic-unfetch": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/isomorphic-unfetch/-/isomorphic-unfetch-3.1.0.tgz", - "integrity": "sha512-geDJjpoZ8N0kWexiwkX8F9NkTsXhetLPVbZFQ+JTW239QNOwvB0gniuR1Wc6f0AMTn7/mFGyXvHTifrCp/GH8Q==", - "dependencies": { - "node-fetch": "^2.6.1", - "unfetch": "^4.2.0" - } - }, "node_modules/istanbul-lib-coverage": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", @@ -12967,11 +11867,6 @@ "node": ">=6" } }, - "node_modules/jsonc-parser": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.1.tgz", - "integrity": "sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==" - }, "node_modules/jsonfile": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", @@ -13035,11 +11930,6 @@ "json-buffer": "3.0.1" } }, - "node_modules/keyvaluestorage-interface": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/keyvaluestorage-interface/-/keyvaluestorage-interface-1.0.0.tgz", - "integrity": "sha512-8t6Q3TclQ4uZynJY9IGr2+SsIGwK9JHcO6ootkHCGA0CrQCRy+VkouYNO2xicET6b9al7QKzpebNow+gkpCL8g==" - }, "node_modules/kind-of": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", @@ -13122,35 +12012,6 @@ "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==" }, - "node_modules/listhen": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/listhen/-/listhen-1.7.2.tgz", - "integrity": "sha512-7/HamOm5YD9Wb7CFgAZkKgVPA96WwhcTQoqtm2VTZGVbVVn3IWKRBTgrU7cchA3Q8k9iCsG8Osoi9GX4JsGM9g==", - "dependencies": { - "@parcel/watcher": "^2.4.1", - "@parcel/watcher-wasm": "^2.4.1", - "citty": "^0.1.6", - "clipboardy": "^4.0.0", - "consola": "^3.2.3", - "crossws": "^0.2.0", - "defu": "^6.1.4", - "get-port-please": "^3.1.2", - "h3": "^1.10.2", - "http-shutdown": "^1.2.2", - "jiti": "^1.21.0", - "mlly": "^1.6.1", - "node-forge": "^1.3.1", - "pathe": "^1.1.2", - "std-env": "^3.7.0", - "ufo": "^1.4.0", - "untun": "^0.1.3", - "uqr": "^0.1.2" - }, - "bin": { - "listen": "bin/listhen.mjs", - "listhen": "bin/listhen.mjs" - } - }, "node_modules/loader-runner": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz", @@ -13191,21 +12052,11 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, - "node_modules/lodash-es": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz", - "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==" - }, "node_modules/lodash.debounce": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==" }, - "node_modules/lodash.isequal": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", - "integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==" - }, "node_modules/lodash.memoize": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", @@ -13240,8 +12091,7 @@ "node_modules/lossless-json": { "version": "2.0.11", "resolved": "https://registry.npmjs.org/lossless-json/-/lossless-json-2.0.11.tgz", - "integrity": "sha512-BP0vn+NGYvzDielvBZaFain/wgeJ1hTvURCqtKvhr1SCPePdaaTanmmcplrHfEJSJOUql7hk4FHwToNJjWRY3g==", - "peer": true + "integrity": "sha512-BP0vn+NGYvzDielvBZaFain/wgeJ1hTvURCqtKvhr1SCPePdaaTanmmcplrHfEJSJOUql7hk4FHwToNJjWRY3g==" }, "node_modules/lower-case": { "version": "2.0.2", @@ -13524,25 +12374,6 @@ "mkdirp": "bin/cmd.js" } }, - "node_modules/mlly": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.6.1.tgz", - "integrity": "sha512-vLgaHvaeunuOXHSmEbZ9izxPx3USsk8KCQ8iC+aTlp5sKRSoZvwhHh5L9VbKSaVC6sJDqbyohIS76E2VmHIPAA==", - "dependencies": { - "acorn": "^8.11.3", - "pathe": "^1.1.2", - "pkg-types": "^1.0.3", - "ufo": "^1.3.2" - } - }, - "node_modules/mri": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", - "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==", - "engines": { - "node": ">=4" - } - }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -13560,11 +12391,6 @@ "multicast-dns": "cli.js" } }, - "node_modules/multiformats": { - "version": "9.9.0", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-9.9.0.tgz", - "integrity": "sha512-HoMUjhH9T8DDBNT+6xzkrd9ga/XiBI4xLr58LJACwK6G3HTOPeMz4nB4KJs33L2BelrIJa7P0VuNaVF3hMYfjg==" - }, "node_modules/mz": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", @@ -13624,14 +12450,6 @@ "tslib": "^2.0.3" } }, - "node_modules/node-addon-api": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.0.tgz", - "integrity": "sha512-mNcltoe1R8o7STTegSOHdnJNN7s5EUvhoS7ShnTHDyOSd+8H+UdWODq6qSv67PjC8Zc5JRT8+oLAMCr0SIXw7g==", - "engines": { - "node": "^16 || ^18 || >= 20" - } - }, "node_modules/node-fetch": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", @@ -13651,11 +12469,6 @@ } } }, - "node_modules/node-fetch-native": { - "version": "1.6.4", - "resolved": "https://registry.npmjs.org/node-fetch-native/-/node-fetch-native-1.6.4.tgz", - "integrity": "sha512-IhOigYzAKHd244OC0JIMIUrjzctirCmPkaIfhDeGcEETWof5zKYUW7e7MYvChGWh/4CJeXEgsRyGzuF334rOOQ==" - }, "node_modules/node-fetch/node_modules/tr46": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", @@ -13911,26 +12724,6 @@ "resolved": "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz", "integrity": "sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==" }, - "node_modules/ofetch": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/ofetch/-/ofetch-1.3.4.tgz", - "integrity": "sha512-KLIET85ik3vhEfS+3fDlc/BAZiAp+43QEC/yCo5zkNoY2YaKvNkOaFr/6wCFgFH1kuYQM5pMNi0Tg8koiIemtw==", - "dependencies": { - "destr": "^2.0.3", - "node-fetch-native": "^1.6.3", - "ufo": "^1.5.3" - } - }, - "node_modules/ohash": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/ohash/-/ohash-1.1.3.tgz", - "integrity": "sha512-zuHHiGTYTA1sYJ/wZN+t5HKZaH23i4yI1HMwbuXm24Nid7Dv0KcuRlKoNKS9UNfAVSBlnGLcuQrnOKWOZoEGaw==" - }, - "node_modules/on-exit-leak-free": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/on-exit-leak-free/-/on-exit-leak-free-0.2.0.tgz", - "integrity": "sha512-dqaz3u44QbRXQooZLTUKU41ZrzYrcvLISVgbrzbyCMxpmSLJvZ3ZamIJIZ29P6OhZIkNIQKosdeM6t1LYbA9hg==" - }, "node_modules/on-finished": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", @@ -14055,8 +12848,7 @@ "node_modules/pako": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/pako/-/pako-2.1.0.tgz", - "integrity": "sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug==", - "peer": true + "integrity": "sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug==" }, "node_modules/param-case": { "version": "3.0.4", @@ -14182,11 +12974,6 @@ "node": ">=8" } }, - "node_modules/pathe": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", - "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==" - }, "node_modules/performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", @@ -14216,41 +13003,6 @@ "node": ">=0.10.0" } }, - "node_modules/pino": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/pino/-/pino-7.11.0.tgz", - "integrity": "sha512-dMACeu63HtRLmCG8VKdy4cShCPKaYDR4youZqoSWLxl5Gu99HUw8bw75thbPv9Nip+H+QYX8o3ZJbTdVZZ2TVg==", - "dependencies": { - "atomic-sleep": "^1.0.0", - "fast-redact": "^3.0.0", - "on-exit-leak-free": "^0.2.0", - "pino-abstract-transport": "v0.5.0", - "pino-std-serializers": "^4.0.0", - "process-warning": "^1.0.0", - "quick-format-unescaped": "^4.0.3", - "real-require": "^0.1.0", - "safe-stable-stringify": "^2.1.0", - "sonic-boom": "^2.2.1", - "thread-stream": "^0.15.1" - }, - "bin": { - "pino": "bin.js" - } - }, - "node_modules/pino-abstract-transport": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/pino-abstract-transport/-/pino-abstract-transport-0.5.0.tgz", - "integrity": "sha512-+KAgmVeqXYbTtU2FScx1XS3kNyfZ5TrXY07V96QnUSFqo2gAqlvmaxH67Lj7SWazqsMabf+58ctdTcBgnOLUOQ==", - "dependencies": { - "duplexify": "^4.1.2", - "split2": "^4.0.0" - } - }, - "node_modules/pino-std-serializers": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/pino-std-serializers/-/pino-std-serializers-4.0.0.tgz", - "integrity": "sha512-cK0pekc1Kjy5w9V2/n+8MkZwusa6EyyxfeQCB799CQRhRt/CqYKiWs5adeu8Shve2ZNffvfC/7J64A2PJo1W/Q==" - }, "node_modules/pirates": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz", @@ -14318,16 +13070,6 @@ "node": ">=8" } }, - "node_modules/pkg-types": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.0.3.tgz", - "integrity": "sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==", - "dependencies": { - "jsonc-parser": "^3.2.0", - "mlly": "^1.2.0", - "pathe": "^1.1.0" - } - }, "node_modules/pkg-up": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-3.1.0.tgz", @@ -15659,11 +14401,6 @@ "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" }, - "node_modules/process-warning": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/process-warning/-/process-warning-1.0.0.tgz", - "integrity": "sha512-du4wfLyj4yCZq1VupnVSZmRsPJsNuxoDQFdCFHLaYiEbFBD7QE0a+I4D7hOxrVnh78QE/YipFAj9lXHiXocV+Q==" - }, "node_modules/promise": { "version": "8.3.0", "resolved": "https://registry.npmjs.org/promise/-/promise-8.3.0.tgz", @@ -15755,23 +14492,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/query-string": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/query-string/-/query-string-7.1.3.tgz", - "integrity": "sha512-hh2WYhq4fi8+b+/2Kg9CEge4fDPvHS534aOOvOZeQ3+Vf2mCFsaFBYj0i+iXcAq6I9Vzp5fjMFBlONvayDC1qg==", - "dependencies": { - "decode-uri-component": "^0.2.2", - "filter-obj": "^1.1.0", - "split-on-first": "^1.0.0", - "strict-uri-encode": "^2.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/querystringify": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", @@ -15796,16 +14516,6 @@ } ] }, - "node_modules/quick-format-unescaped": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/quick-format-unescaped/-/quick-format-unescaped-4.0.4.tgz", - "integrity": "sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==" - }, - "node_modules/radix3": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/radix3/-/radix3-1.1.1.tgz", - "integrity": "sha512-yUUd5VTiFtcMEx0qFUxGAv5gbMc1un4RvEO1JZdP7ZUl/RHygZK6PknIKntmQRZxnMY3ZXD2ISaw1ij8GYW1yg==" - }, "node_modules/raf": { "version": "3.4.1", "resolved": "https://registry.npmjs.org/raf/-/raf-3.4.1.tgz", @@ -16039,6 +14749,15 @@ } } }, + "node_modules/react-use-websocket": { + "version": "4.8.1", + "resolved": "https://registry.npmjs.org/react-use-websocket/-/react-use-websocket-4.8.1.tgz", + "integrity": "sha512-FTXuG5O+LFozmu1BRfrzl7UIQngECvGJmL7BHsK4TYXuVt+mCizVA8lT0hGSIF0Z0TedF7bOo1nRzOUdginhDw==", + "peerDependencies": { + "react": ">= 18.0.0", + "react-dom": ">= 18.0.0" + } + }, "node_modules/read-cache": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", @@ -16071,14 +14790,6 @@ "node": ">=8.10.0" } }, - "node_modules/real-require": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/real-require/-/real-require-0.1.0.tgz", - "integrity": "sha512-r/H9MzAWtrv8aSVjPCMFpDMl5q66GqtmmRkRjpHTsp4zBAa+snZyiQNlMONiUmEJcsnaw0wCauJ2GWODr/aFkg==", - "engines": { - "node": ">= 12.13.0" - } - }, "node_modules/recursive-readdir": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/recursive-readdir/-/recursive-readdir-2.2.3.tgz", @@ -16508,14 +15219,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/safe-stable-stringify": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.4.3.tgz", - "integrity": "sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g==", - "engines": { - "node": ">=10" - } - }, "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -16891,14 +15594,6 @@ "websocket-driver": "^0.7.4" } }, - "node_modules/sonic-boom": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-2.8.0.tgz", - "integrity": "sha512-kuonw1YOYYNOve5iHdSahXPOK49GqwA+LZhI6Wz/l0rP57iKyXXIHaRagOBHAPmGwJC6od2Z9zgvZ5loSgMlVg==", - "dependencies": { - "atomic-sleep": "^1.0.0" - } - }, "node_modules/source-list-map": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz", @@ -16991,22 +15686,6 @@ "wbuf": "^1.7.3" } }, - "node_modules/split-on-first": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/split-on-first/-/split-on-first-1.1.0.tgz", - "integrity": "sha512-43ZssAJaMusuKWL8sKUBQXHWOpq8d6CfN/u1p4gUzfJkM05C8rxTmYrkIPTXapZpORA6LkkzcUulJ8FqA7Uudw==", - "engines": { - "node": ">=6" - } - }, - "node_modules/split2": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", - "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", - "engines": { - "node": ">= 10.x" - } - }, "node_modules/sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -17046,7 +15725,6 @@ "version": "5.24.3", "resolved": "https://registry.npmjs.org/starknet/-/starknet-5.24.3.tgz", "integrity": "sha512-v0TuaNc9iNtHdbIRzX372jfQH1vgx2rwBHQDMqK4DqjJbwFEE5dog8Go6rGiZVW750NqRSWrZ7ahqyRNc3bscg==", - "peer": true, "dependencies": { "@noble/curves": "~1.2.0", "@scure/base": "^1.1.3", @@ -17057,32 +15735,6 @@ "url-join": "^4.0.1" } }, - "node_modules/starknetkit": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/starknetkit/-/starknetkit-1.1.4.tgz", - "integrity": "sha512-KZ/OvhtGEJPyAXKS6Dht5DL6CtjUtGDfNuzaX1bsYawGgnftOOZ0DXD2SBOQ6ErYLKELbVv3RKBlHs6KonORcQ==", - "dependencies": { - "@trpc/client": "^10.38.1", - "@trpc/server": "^10.38.1", - "@walletconnect/sign-client": "^2.10.1", - "bowser": "^2.11.0", - "detect-browser": "^5.3.0", - "eventemitter3": "^5.0.1", - "events": "^3.3.0", - "get-starknet-core": "^3.1.0", - "lodash-es": "^4.17.21", - "svelte-forms": "^2.3.1", - "trpc-browser": "^1.3.2" - }, - "peerDependencies": { - "starknet": "^5.24.3" - } - }, - "node_modules/starknetkit/node_modules/eventemitter3": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", - "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==" - }, "node_modules/static-eval": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/static-eval/-/static-eval-2.0.2.tgz", @@ -17184,11 +15836,6 @@ "node": ">= 0.8" } }, - "node_modules/std-env": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.7.0.tgz", - "integrity": "sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg==" - }, "node_modules/stop-iteration-iterator": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.0.0.tgz", @@ -17200,19 +15847,6 @@ "node": ">= 0.4" } }, - "node_modules/stream-shift": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.3.tgz", - "integrity": "sha512-76ORR0DO1o1hlKwTbi/DM3EXWGf3ZJYO8cXX5RJwnul2DEg2oyoZyjLNoQM8WsvZiFKCRfC1O0J7iCvie3RZmQ==" - }, - "node_modules/strict-uri-encode": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz", - "integrity": "sha512-QwiXZgpRcKkhTj2Scnn++4PKtWsH0kpzZ62L2R6c/LUVYv7hVnZqcg2+sMuT6R7Jusu1vviK/MFsu6kNJfWlEQ==", - "engines": { - "node": ">=4" - } - }, "node_modules/string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", @@ -17564,14 +16198,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/svelte-forms": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/svelte-forms/-/svelte-forms-2.3.1.tgz", - "integrity": "sha512-ExX9PM0JgvdOWlHl2ztD7XzLNPOPt9U5hBKV8sUAisMfcYWpPRnyz+6EFmh35BOBGJJmuhTDBGm5/7seLjOTIA==", - "dependencies": { - "is-promise": "^4.0.0" - } - }, "node_modules/svg-parser": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/svg-parser/-/svg-parser-2.0.4.tgz", @@ -17726,17 +16352,6 @@ "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==" }, - "node_modules/system-architecture": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/system-architecture/-/system-architecture-0.1.0.tgz", - "integrity": "sha512-ulAk51I9UVUyJgxlv9M6lFot2WP3e7t8Kz9+IS6D4rVba1tR9kON+Ey69f+1R4Q8cd45Lod6a4IcJIxnzGc/zA==", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/tailwindcss": { "version": "3.4.1", "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.1.tgz", @@ -17924,14 +16539,6 @@ "node": ">=0.8" } }, - "node_modules/thread-stream": { - "version": "0.15.2", - "resolved": "https://registry.npmjs.org/thread-stream/-/thread-stream-0.15.2.tgz", - "integrity": "sha512-UkEhKIg2pD+fjkHQKyJO3yoIvAP3N6RlNFt2dUhcS1FGvCD1cQa1M/PGknCLFIyZdtJOWQjejp7bdNqmN7zwdA==", - "dependencies": { - "real-require": "^0.1.0" - } - }, "node_modules/throat": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/throat/-/throat-6.0.2.tgz", @@ -18007,15 +16614,6 @@ "node": ">=8" } }, - "node_modules/trpc-browser": { - "version": "1.3.7", - "resolved": "https://registry.npmjs.org/trpc-browser/-/trpc-browser-1.3.7.tgz", - "integrity": "sha512-I0oMaqBQLLm8YywvvlRlDRKXeYLlFf1PbMfWvbI4refGpjXJMESztwUaJfrGhDqY4n+AzHs/b9t6Mt5n+pg+qA==", - "peerDependencies": { - "@trpc/client": "^10.0.0", - "@trpc/server": "^10.0.0" - } - }, "node_modules/tryer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/tryer/-/tryer-1.0.1.tgz", @@ -18212,19 +16810,6 @@ "node": ">=4.2.0" } }, - "node_modules/ufo": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.5.3.tgz", - "integrity": "sha512-Y7HYmWaFwPUmkoQCUIAYpKqkOf+SbVj/2fJJZ4RJMCfZp0rTGwRbzQD+HghfnhKOjL9E01okqz+ncJskGYfBNw==" - }, - "node_modules/uint8arrays": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-3.1.1.tgz", - "integrity": "sha512-+QJa8QRnbdXVpHYjLoTpJIdCTiw9Ir62nocClWuXIq2JIh4Uta0cQsTSpFL678p2CN8B+XSApwcU+pQEqVpKWg==", - "dependencies": { - "multiformats": "^9.4.2" - } - }, "node_modules/unbox-primitive": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", @@ -18239,11 +16824,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/uncrypto": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/uncrypto/-/uncrypto-0.1.3.tgz", - "integrity": "sha512-Ql87qFHB3s/De2ClA9e0gsnS6zXG27SkTiSJwjCc9MebbfapQfuPzumMIUMi38ezPZVNFcHI9sUIepeQfw8J8Q==" - }, "node_modules/underscore": { "version": "1.12.1", "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.12.1.tgz", @@ -18254,34 +16834,6 @@ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" }, - "node_modules/unenv": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/unenv/-/unenv-1.9.0.tgz", - "integrity": "sha512-QKnFNznRxmbOF1hDgzpqrlIf6NC5sbZ2OJ+5Wl3OX8uM+LUJXbj4TXvLJCtwbPTmbMHCLIz6JLKNinNsMShK9g==", - "dependencies": { - "consola": "^3.2.3", - "defu": "^6.1.3", - "mime": "^3.0.0", - "node-fetch-native": "^1.6.1", - "pathe": "^1.1.1" - } - }, - "node_modules/unenv/node_modules/mime": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", - "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", - "bin": { - "mime": "cli.js" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/unfetch": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/unfetch/-/unfetch-4.2.0.tgz", - "integrity": "sha512-F9p7yYCn6cIW9El1zi0HI6vqpeIvBsr3dSuRO6Xuppb1u5rXpCPmMvLSyECLhybr9isec8Ohl0hPekMVrEinDA==" - }, "node_modules/unicode-canonical-property-names-ecmascript": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz", @@ -18350,100 +16902,6 @@ "resolved": "https://registry.npmjs.org/unquote/-/unquote-1.1.1.tgz", "integrity": "sha512-vRCqFv6UhXpWxZPyGDh/F3ZpNv8/qo7w6iufLpQg9aKnQ71qM4B5KiI7Mia9COcjEhrO9LueHpMYjYzsWH3OIg==" }, - "node_modules/unstorage": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/unstorage/-/unstorage-1.10.2.tgz", - "integrity": "sha512-cULBcwDqrS8UhlIysUJs2Dk0Mmt8h7B0E6mtR+relW9nZvsf/u4SkAYyNliPiPW7XtFNb5u3IUMkxGxFTTRTgQ==", - "dependencies": { - "anymatch": "^3.1.3", - "chokidar": "^3.6.0", - "destr": "^2.0.3", - "h3": "^1.11.1", - "listhen": "^1.7.2", - "lru-cache": "^10.2.0", - "mri": "^1.2.0", - "node-fetch-native": "^1.6.2", - "ofetch": "^1.3.3", - "ufo": "^1.4.0" - }, - "peerDependencies": { - "@azure/app-configuration": "^1.5.0", - "@azure/cosmos": "^4.0.0", - "@azure/data-tables": "^13.2.2", - "@azure/identity": "^4.0.1", - "@azure/keyvault-secrets": "^4.8.0", - "@azure/storage-blob": "^12.17.0", - "@capacitor/preferences": "^5.0.7", - "@netlify/blobs": "^6.5.0 || ^7.0.0", - "@planetscale/database": "^1.16.0", - "@upstash/redis": "^1.28.4", - "@vercel/kv": "^1.0.1", - "idb-keyval": "^6.2.1", - "ioredis": "^5.3.2" - }, - "peerDependenciesMeta": { - "@azure/app-configuration": { - "optional": true - }, - "@azure/cosmos": { - "optional": true - }, - "@azure/data-tables": { - "optional": true - }, - "@azure/identity": { - "optional": true - }, - "@azure/keyvault-secrets": { - "optional": true - }, - "@azure/storage-blob": { - "optional": true - }, - "@capacitor/preferences": { - "optional": true - }, - "@netlify/blobs": { - "optional": true - }, - "@planetscale/database": { - "optional": true - }, - "@upstash/redis": { - "optional": true - }, - "@vercel/kv": { - "optional": true - }, - "idb-keyval": { - "optional": true - }, - "ioredis": { - "optional": true - } - } - }, - "node_modules/unstorage/node_modules/lru-cache": { - "version": "10.2.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.0.tgz", - "integrity": "sha512-2bIM8x+VAf6JT4bKAljS1qUWgMsqZRPGJS6FSahIMPVvctcNhyVp7AJu7quxOW9jwkryBReKZY5tY5JYv2n/7Q==", - "engines": { - "node": "14 || >=16.14" - } - }, - "node_modules/untun": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/untun/-/untun-0.1.3.tgz", - "integrity": "sha512-4luGP9LMYszMRZwsvyUd9MrxgEGZdZuZgpVQHEEX0lCYFESasVRvZd0EYpCkOIbJKHMuv0LskpXc/8Un+MJzEQ==", - "dependencies": { - "citty": "^0.1.5", - "consola": "^3.2.3", - "pathe": "^1.1.1" - }, - "bin": { - "untun": "bin/untun.mjs" - } - }, "node_modules/upath": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz", @@ -18482,11 +16940,6 @@ "browserslist": ">= 4.21.0" } }, - "node_modules/uqr": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/uqr/-/uqr-0.1.2.tgz", - "integrity": "sha512-MJu7ypHq6QasgF5YRTjqscSzQp/W11zoUk6kvmlH+fmWEs63Y0Eib13hYFwAzagRJcVY8WVnlV+eBDUGMJ5IbA==" - }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", @@ -18498,8 +16951,7 @@ "node_modules/url-join": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/url-join/-/url-join-4.0.1.tgz", - "integrity": "sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA==", - "peer": true + "integrity": "sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA==" }, "node_modules/url-parse": { "version": "1.5.10", diff --git a/frontend/package.json b/frontend/package.json index 709930a3..b2f65680 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -6,10 +6,12 @@ "@testing-library/jest-dom": "^5.17.0", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", + "get-starknet": "^3.0.1", "react": "^18.2.0", "react-dom": "^18.2.0", "react-scripts": "5.0.1", - "starknetkit": "^1.1.4" + "react-use-websocket": "^4.8.1", + "starknet": "^5.24.3" }, "scripts": { "start": "react-scripts start", diff --git a/frontend/src/App.js b/frontend/src/App.js index 12caa52e..eb6beeda 100644 --- a/frontend/src/App.js +++ b/frontend/src/App.js @@ -1,10 +1,16 @@ import React, { useEffect, useState } from 'react'; -import { connect, disconnect } from 'starknetkit'; // TODO: to starknet-react/core instead? +// import { connect, disconnect } from 'starknetkit'; // TODO: to starknet-react/core instead? +import { connect } from "get-starknet"; +import { Contract } from "starknet"; import logo from './logo.svg'; import './App.css'; import Canvas from './Canvas.js'; +// TODO: Generate contract.abi.json +import contractAbi from "./contract.abi.json"; function App() { + //TODO: dynamic modal w/ next/dynamic + /* const [account, setAccount] = useState(''); const [chain, setChain] = useState(''); @@ -24,10 +30,53 @@ function App() { } else { console.log('Failed to connect to Starknet'); } +
{account ? : }
}; connectToStarknet(); }, []); + */ + const [provider, setProvider] = useState(null) + const [address, setAddress] = useState(null) + const [isConnected, setIsConnected] = useState(false) + const [chainId, setChainId] = useState(null) + //const [contract, setContract] = useState(null) + // TODO: Dynamic contract address + const contractAddress = process.env.REACT_APP_ART_PEACE_CONTRACT_ADDRESS; + + useEffect(() => { + const connectToStarknet = async () => { + try { + const starknet = await connect() + //TODO: await starknet?.enable({ starknetVersion: "v4" }) + setProvider(starknet.account) + setAddress(starknet.selectedAddress) + setIsConnected(true) + setChainId(starknet.chainId) + const contract = new Contract(contractAbi, contractAddress, starknet.account) + contract.get_width().then( + (result) => console.log("Contract called", result) + ).catch( + (error) => console.log("Contract call failed", error) + ) + //const pixel_pos = Math.floor(Math.random() * 1000) % 32 + //const pixel_color = Math.floor(Math.random() * 1000) % 10 + //console.log("Setting pixel", pixel_pos, pixel_color) + //console.log(contract.populate("place_pixel", [pixel_pos, pixel_color])) + //contract.place_pixel(pixel_pos, pixel_color).then( + // (result) => console.log("Contract called", result) + //).catch( + // (error) => console.log("Contract call failed", error) + //) + //setContract(contract) + //setContract(Contract(contractAbi, contractAddress, provider)) + } catch (error) { + alert(error.message) + } + } + + connectToStarknet() + }, []) return (
@@ -35,7 +84,17 @@ function App() { logo

art/peace

-

Acc: {account} -- {chain}

+
+ {isConnected ? ( +
+

Connected to Starknet

+

ChainId: {chainId}

+

Address: {address}

+
+ ) : ( +

Connecting to Starknet...

+ )} +
diff --git a/frontend/src/Canvas.css b/frontend/src/Canvas.css index 43237600..46949d3a 100644 --- a/frontend/src/Canvas.css +++ b/frontend/src/Canvas.css @@ -7,7 +7,8 @@ .Canvas-position { background-color: green; margin: 10px; - margin-top: calc(10px + 5vmax); + /*margin-top: calc(10px + 5vmax);*/ + margin-top: calc(10px + 65vmax); display: inline-block; } diff --git a/frontend/src/Canvas.js b/frontend/src/Canvas.js index be211f43..e818cdc6 100644 --- a/frontend/src/Canvas.js +++ b/frontend/src/Canvas.js @@ -1,29 +1,68 @@ -import React, { useRef, useEffect } from 'react' +import React, { useRef, useEffect, useState } from 'react' +import useWebSocket, { ReadyState } from 'react-use-websocket' import './Canvas.css'; const Canvas = props => { const canvasRef = useRef(null) - const width = 50 - const height = 50 - const colors = ['#556270FF', '#4ECDC4FF', '#C7F464FF', '#FF6B6BFF', '#C44D58FF'] - let idx = 0 - let imageDataArray = [] - for (let i = 0; i < width; i++) { - for (let j = 0; j < height; j++) { - const random = Math.random() - const color = colors[(idx + Math.floor(random * (colors.length - idx))) % colors.length] - const [r, g, b, a] = color.match(/\w\w/g).map(x => parseInt(x, 16)) - imageDataArray.push(r, g, b, a) - idx++ - } - } - const uint8ClampedArray = new Uint8ClampedArray(imageDataArray) - const imageData = new ImageData(uint8ClampedArray, width, height) + const width = 16 + const height = 16 + const colors = ['#FFFFFFFF', '#000000FF', '#556270FF', '#4ECDC4FF', '#C7F464FF', '#FF6B6BFF', '#C44D58FF'] + + const WS_URL = "ws://127.0.0.1:8080/ws" + const { sendJsonMessage, lastJsonMessage, readyState } = useWebSocket( + WS_URL, + { + share: false, + shouldReconnect: () => true, + }, + ) + + + //let idx = 0 + //let imageDataArray = [] + //for (let i = 0; i < width; i++) { + // for (let j = 0; j < height; j++) { + // const random = Math.random() + // const color = colors[(idx + Math.floor(random * (colors.length - idx))) % colors.length] + // const [r, g, b, a] = color.match(/\w\w/g).map(x => parseInt(x, 16)) + // imageDataArray.push(r, g, b, a) + // idx++ + // } + //} + //const uint8ClampedArray = new Uint8ClampedArray(imageDataArray) + //const imageData = new ImageData(uint8ClampedArray, width, height) + + //const socket = new WebSocket('ws://localhost:8080/ws'); + + //socket.addEventListener('open', function (event) { + // console.log("Connected to websocket") + // socket.send('Hello Server!'); + //}); + + //socket.addEventListener('message', (event) => { + // console.log('Message from server ', event.data); + // // Parse event.data as JSON + // const data = JSON.parse(event.data) + // console.log(data) + // const x = Math.floor(data.position / width) + // const y = data.position % width + // const colorIdx = data.color + // console.log(x, y, colorIdx) + // const canvas = canvasRef.current + // const context = canvas.getContext('2d') + // const color = colors[colorIdx] + // //const [r, g, b, a] = color.match(/\w\w/g).map(x => parseInt(x, 16)) + // context.fillStyle = color + // context.fillRect(x, y, 1, 1) + // console.log("Pixel colored") + //}); + + const [setup, setSetup] = useState(false) - const draw = ctx => { - ctx.fillStyle = 'green' + const draw = (ctx, imageData) => { + // ctx.fillStyle = 'green' ctx.canvas.width = width ctx.canvas.height = height ctx.putImageData(imageData, 0, 0) @@ -31,16 +70,119 @@ const Canvas = props => { } useEffect(() => { + if (setup) { + return + } const canvas = canvasRef.current const context = canvas.getContext('2d') - draw(context) - }, [draw]) + fetch('http://localhost:8080/getCanvas', {mode: 'cors'}).then(response => { + console.log("Got response") + console.log(response) + return response.arrayBuffer() + }).then(data => { + console.log("Got data") + console.log(data.byteLength) + let colorData = new Uint8Array(data, 0, data.byteLength) + let dataArray = [] + // Data encoded as list of 5 bit values, unpack into dataArray + // TODO: Think about edge cases + // 8 * 5 = 40 / 8 = 5 bytes + for (let bitPos = 0; bitPos < data.byteLength * 8; bitPos += 5) { + let bytePos = Math.floor(bitPos / 8) + let bitOffset = bitPos % 8 + //if (dataArray.length < 10) { + // console.log(dataArray.length, bytePos, bitOffset, data.charCodeAt(bytePos), data.charCodeAt(bytePos + 1)) + //} + if (bitOffset <= 3) { + //let byte = data.charCodeAt(bytePos); + let byte = colorData[bytePos] + let value = (byte >> (3 - bitOffset)) & 0b11111 + dataArray.push(value) + } else { + //let byte = data.charCodeAt(bytePos) << 8 | data.charCodeAt(bytePos + 1) + let byte = colorData[bytePos] << 8 | colorData[bytePos + 1] + let value = (byte >> (11 - bitOffset)) & 0b11111 + dataArray.push(value) + } + } + console.log(dataArray) + let imageDataArray = [] + for (let i = 0; i < dataArray.length; i++) { + const color = colors[dataArray[i]] + const [r, g, b, a] = color.match(/\w\w/g).map(x => parseInt(x, 16)) + imageDataArray.push(r, g, b, a) + } + const uint8ClampedArray = new Uint8ClampedArray(imageDataArray) + const imageData = new ImageData(uint8ClampedArray, width, height) + draw(context, imageData) + setSetup(true) + }); + //draw(context) + console.log("Connect to websocket") + if (readyState === ReadyState.OPEN) { + sendJsonMessage({ + event: "subscribe", + data: { + channel: "general", + }, + }) + } + }, [draw, readyState]) + + useEffect(() => { + console.log(`Got a new message: ${lastJsonMessage}`) + if (lastJsonMessage) { + const canvas = canvasRef.current + const context = canvas.getContext('2d') + const x = Math.floor(lastJsonMessage.position / width) + const y = lastJsonMessage.position % width + const colorIdx = lastJsonMessage.color + console.log(x, y, colorIdx) + const color = colors[colorIdx] + //const [r, g, b, a] = color.match(/\w\w/g).map(x => parseInt(x, 16)) + context.fillStyle = color + context.fillRect(x, y, 1, 1) + } + }, [lastJsonMessage]) + + const colorPixel = (e) => { + console.log("Coloring pixel") + const canvas = canvasRef.current + const context = canvas.getContext('2d') + const rect = canvas.getBoundingClientRect() + const x = Math.floor((e.clientX - rect.left) / (rect.right - rect.left) * width) + const y = Math.floor((e.clientY - rect.top) / (rect.bottom - rect.top) * height) + let colorIdx = Math.floor(Math.random() * 1000) % colors.length + console.log(x, y, colorIdx) + //const color = colors[colorIdx] + //const [r, g, b, a] = color.match(/\w\w/g).map(x => parseInt(x, 16)) + //context.fillStyle = color + //context.fillRect(x, y, 1, 1) + // Read the contract address from the environment ART_PEACE_CONTRACT_ADDRESS + const contractAddr = process.env.REACT_APP_ART_PEACE_CONTRACT_ADDRESS + console.log("Contract address: " + contractAddr) + fetch('http://localhost:8080/placePixelDevnet', { + mode: 'cors', + method: 'POST', + body: JSON.stringify({contract: contractAddr, x: x.toString(), y: y.toString(), color: colorIdx.toString()}) + }).then(response => { + console.log("Got response") + console.log(response) + return response.text() + }).then(data => { + console.log("Got data") + console.log(data) + }).catch(error => { + console.error("Error placing pixel") + console.error(error) + }); + } return (
- +
); diff --git a/frontend/src/contract.abi.json b/frontend/src/contract.abi.json new file mode 100644 index 00000000..4f6443cd --- /dev/null +++ b/frontend/src/contract.abi.json @@ -0,0 +1,273 @@ +[ + { + "type": "impl", + "name": "ArtPeaceImpl", + "interface_name": "art_peace::IArtPeace" + }, + { + "type": "interface", + "name": "art_peace::IArtPeace", + "items": [ + { + "type": "function", + "name": "place_pixel", + "inputs": [ + { + "name": "pos", + "type": "core::integer::u128" + }, + { + "name": "color", + "type": "core::integer::u8" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "place_pixel_xy", + "inputs": [ + { + "name": "x", + "type": "core::integer::u128" + }, + { + "name": "y", + "type": "core::integer::u128" + }, + { + "name": "color", + "type": "core::integer::u8" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "place_extra_pixels", + "inputs": [ + { + "name": "positions", + "type": "core::array::Array::" + }, + { + "name": "colors", + "type": "core::array::Array::" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "get_pixel", + "inputs": [ + { + "name": "pos", + "type": "core::integer::u128" + } + ], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "get_pixel_xy", + "inputs": [ + { + "name": "x", + "type": "core::integer::u128" + }, + { + "name": "y", + "type": "core::integer::u128" + } + ], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "get_total_pixels", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u128" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "get_width", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u128" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "get_height", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u128" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "get_last_placed_time", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u64" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "get_user_last_placed_time", + "inputs": [ + { + "name": "user", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::integer::u64" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "get_time_between_pixels", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u64" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "get_extra_pixels_count", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u32" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "get_user_extra_pixels_count", + "inputs": [ + { + "name": "user", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::integer::u32" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "get_color_count", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "get_colors", + "inputs": [], + "outputs": [ + { + "type": "core::array::Array::" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "constructor", + "name": "constructor", + "inputs": [ + { + "name": "canvas_width", + "type": "core::integer::u128" + }, + { + "name": "canvas_height", + "type": "core::integer::u128" + }, + { + "name": "time_between_pixels", + "type": "core::integer::u64" + } + ] + }, + { + "type": "event", + "name": "art_peace::ArtPeace::PixelPlaced", + "kind": "struct", + "members": [ + { + "name": "placed_by", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "key" + }, + { + "name": "pos", + "type": "core::integer::u128", + "kind": "key" + }, + { + "name": "color", + "type": "core::integer::u8", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "art_peace::ArtPeace::Event", + "kind": "enum", + "variants": [ + { + "name": "PixelPlaced", + "type": "art_peace::ArtPeace::PixelPlaced", + "kind": "nested" + } + ] + } +] diff --git a/tests/integration/local/docker-compose.yml b/indexer/docker-compose.yml similarity index 93% rename from tests/integration/local/docker-compose.yml rename to indexer/docker-compose.yml index 00fcad1b..1d7018fb 100644 --- a/tests/integration/local/docker-compose.yml +++ b/indexer/docker-compose.yml @@ -13,7 +13,7 @@ services: - 5050:5050 dna: - image: quay.io/apibara/starknet:1.4.0 + image: quay.io/apibara/starknet:1.5.0 command: - start - --rpc=http://devnet:5050/rpc diff --git a/indexer/script.js b/indexer/script.js index 33ceb971..72977c8c 100644 --- a/indexer/script.js +++ b/indexer/script.js @@ -6,8 +6,8 @@ export const config = { filter: { events: [ { - fromAddress: "0x1fb3c4d5aac055c8ccd645b652c7d6d92b5828d5dd580b1dc8c5f6ee7eaf003", - keys: ["0x31F8DAA2AC8DACD06AB968BAD8F97F98F63C30A86DBFCEBDD7625F589D4E7E6"], + fromAddress: Deno.env.get("ART_PEACE_CONTRACT_ADDRESS"), + keys: ["0x2D7B50EBF415606D77C7E7842546FC13F8ACFBFD16F7BCF2BC2D08F54114C23"], includeReverted: false, includeTransaction: false, includeReceipt: false, @@ -16,7 +16,7 @@ export const config = { }, sinkType: "webhook", sinkOptions: { - targetUrl: "http://localhost:7172/consume" + targetUrl: "http://localhost:8080/consume" }, }; diff --git a/resources/art-peace-logo/art-peace.jpg b/resources/art-peace-logo/art-peace.jpg new file mode 100644 index 00000000..496f8d4d Binary files /dev/null and b/resources/art-peace-logo/art-peace.jpg differ diff --git a/scripts/load-test.sh b/scripts/load-test.sh new file mode 100755 index 00000000..045c146c --- /dev/null +++ b/scripts/load-test.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# +# Continuous load test + +BOARD_CONTRACT=$1 + +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" + +# TODO: load all 10 accounts and do this with each of them +while true; do + $SCRIPT_DIR/set-board-rand.sh $BOARD_CONTRACT & + # Sleep for 100ms + sleep 0.1 +done diff --git a/scripts/run-local.sh b/scripts/run-local.sh new file mode 100755 index 00000000..0fb8de99 --- /dev/null +++ b/scripts/run-local.sh @@ -0,0 +1,8 @@ +#!/bin/bash +# +# Run the full pipeline locally. + +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +WORK_DIR=$SCRIPT_DIR/.. + +$WORK_DIR/tests/integration/local/run.sh diff --git a/scripts/set-board-rand.sh b/scripts/set-board-rand.sh new file mode 100755 index 00000000..6f91c5dd --- /dev/null +++ b/scripts/set-board-rand.sh @@ -0,0 +1,27 @@ +#!/bin/bash +# +# Print the board state + +BOARD_CONTRACT=$1 + +RPC_URL=http://localhost:5050 + +# Get the board dimensions +BOARD_WIDTH=16 #$(starkli call $BOARD_CONTRACT get_width --rpc $RPC_URL | jq -r '.[0]' | xargs printf "%d") +BOARD_HEIGHT=16 #$(starkli call $BOARD_CONTRACT get_height --rpc $RPC_URL | jq -r '.[0]' | xargs printf "%d") +echo "Board dimensions: $BOARD_WIDTH x $BOARD_HEIGHT" + +RAND_X=$(shuf -i 0-$((BOARD_WIDTH-1)) -n 1) +RAND_Y=$(shuf -i 0-$((BOARD_HEIGHT-1)) -n 1) +RAND_POS=$(($RAND_X + $RAND_Y * $BOARD_WIDTH)) +RAND_COLOR=$(shuf -i 1-5 -n 1) +echo "Placing pixel at ($RAND_X, $RAND_Y) with color $RAND_COLOR" + +# Place a pixel +# ~/.art-peace-tests/tmp/1711605675/starknet_accounts.json +ACCOUNT_FILE=$HOME/.art-peace-tests/tmp/1711605675/starknet_accounts.json #$(ls $HOME/.l2-place-test/tmp/*/madara-dev-account.json) +ACCOUNT_NAME=art_peace_acct +sncast --url $RPC_URL --accounts-file $ACCOUNT_FILE --account $ACCOUNT_NAME invoke --contract-address $BOARD_CONTRACT --function place_pixel --calldata $RAND_POS $RAND_COLOR +#echo "starkli invoke $BOARD_CONTRACT place_pixel $RAND_X $RAND_Y $RAND_COLOR --rpc $RPC_URL --account $ACCOUNT_FILE --keystore $KEYSTORE_FILE --keystore-password $KEYSTORE_PASSWORD" + +# TODO: alternate async version diff --git a/tests/integration/local/deploy.sh b/tests/integration/local/deploy.sh index feccc934..5043ed5c 100755 --- a/tests/integration/local/deploy.sh +++ b/tests/integration/local/deploy.sh @@ -9,16 +9,17 @@ RPC_PORT=5050 RPC_URL=http://$RPC_HOST:$RPC_PORT SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -WORK_DIR=$SCRIPT_DIR +WORK_DIR=$SCRIPT_DIR/../../.. -OUTPUT_DIR=$HOME/.art-peace-test +#TODO: 2 seperate directories when called from the test script +OUTPUT_DIR=$HOME/.art-peace-tests TIMESTAMP=$(date +%s) LOG_DIR=$OUTPUT_DIR/logs/$TIMESTAMP TMP_DIR=$OUTPUT_DIR/tmp/$TIMESTAMP # TODO: Clean option to remove old logs and state -rm -rf $OUTPUT_DIR/logs/* -rm -rf $OUTPUT_DIR/tmp/* +#rm -rf $OUTPUT_DIR/logs/* +#rm -rf $OUTPUT_DIR/tmp/* mkdir -p $LOG_DIR mkdir -p $TMP_DIR @@ -34,11 +35,15 @@ sncast --url $RPC_URL --accounts-file $ACCOUNT_FILE account add --name $ACCOUNT_ CONTRACT_DIR=$WORK_DIR/onchain CLASS_NAME="ArtPeace" +#TODO: Issue if no declare done CLASS_DECLARE_RESULT=$(cd $CONTRACT_DIR && sncast --url $RPC_URL --accounts-file $ACCOUNT_FILE --account $ACCOUNT_NAME --wait --json declare --contract-name $CLASS_NAME | tail -n 1) CLASS_HASH=$(echo $CLASS_DECLARE_RESULT | jq -r '.class_hash') echo "Declared class \"$CLASS_NAME\" with hash $CLASS_HASH" -CONTRACT_DEPLOY_RESULT=$(sncast --url $RPC_URL --accounts-file $ACCOUNT_FILE --account $ACCOUNT_NAME --wait --json deploy --class-hash $CLASS_HASH | tail -n 1) +# TODO: calldata passed as parameters +echo "Deploying contract \"$CLASS_NAME\"..." +echo "sncast --url $RPC_URL --accounts-file $ACCOUNT_FILE --account $ACCOUNT_NAME --wait --json deploy --class-hash $CLASS_HASH --constructor-calldata 0x10 0x10 0x00" +CONTRACT_DEPLOY_RESULT=$(sncast --url $RPC_URL --accounts-file $ACCOUNT_FILE --account $ACCOUNT_NAME --wait --json deploy --class-hash $CLASS_HASH --constructor-calldata 0x10 0x10 0x00 | tail -n 1) CONTRACT_ADDRESS=$(echo $CONTRACT_DEPLOY_RESULT | jq -r '.contract_address') echo "Deployed contract \"$CLASS_NAME\" with address $CONTRACT_ADDRESS" diff --git a/tests/integration/local/place_pixel.sh b/tests/integration/local/place_pixel.sh new file mode 100755 index 00000000..d10c1d51 --- /dev/null +++ b/tests/integration/local/place_pixel.sh @@ -0,0 +1,46 @@ +#!/bin/bash +# +# This script runs the integration tests. + +# TODO: Host? +RPC_HOST="127.0.0.1" +RPC_PORT=5050 + +RPC_URL=http://$RPC_HOST:$RPC_PORT + +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +WORK_DIR=$SCRIPT_DIR/../../.. + +#TODO: 2 seperate directories when called from the test script +OUTPUT_DIR=$HOME/.art-peace-tests +TIMESTAMP=$(date +%s) +LOG_DIR=$OUTPUT_DIR/logs/$TIMESTAMP +TMP_DIR=$OUTPUT_DIR/tmp/$TIMESTAMP + +# TODO: Clean option to remove old logs and state +#rm -rf $OUTPUT_DIR/logs/* +#rm -rf $OUTPUT_DIR/tmp/* +mkdir -p $LOG_DIR +mkdir -p $TMP_DIR + +ACCOUNT_NAME=art_peace_acct +ACCOUNT_ADDRESS=0x328ced46664355fc4b885ae7011af202313056a7e3d44827fb24c9d3206aaa0 +ACCOUNT_PRIVATE_KEY=0x856c96eaa4e7c40c715ccc5dacd8bf6e +ACCOUNT_PROFILE=starknet-devnet +ACCOUNT_FILE=$TMP_DIR/starknet_accounts.json + +sncast --url $RPC_URL --accounts-file $ACCOUNT_FILE account add --name $ACCOUNT_NAME --address $ACCOUNT_ADDRESS --private-key $ACCOUNT_PRIVATE_KEY + +#TODO: rename script and make more generic +echo "sncast --url $RPC_URL --accounts-file $ACCOUNT_FILE --account $ACCOUNT_NAME invoke --contract-address $1 --function $2 --calldata $3 $4" > $LOG_DIR/cmd.txt +sncast --url $RPC_URL --accounts-file $ACCOUNT_FILE --account $ACCOUNT_NAME --wait --json invoke --contract-address $1 --function $2 --calldata $3 $4 > $LOG_DIR/output.json + +# TODO +# MULTICALL_TEMPLATE_DIR=$CONTRACT_DIR/tests/multicalls +# +# HELLO_STARKNET_MULTI_TEMPLATE=$MULTICALL_TEMPLATE_DIR/HelloStarknet.toml +# HELLO_STARKNET_MULTI=$TMP_DIR/HelloStarknet.toml +# sed "s/\$CONTRACT_ADDRESS/$CONTRACT_ADDRESS/g" $HELLO_STARKNET_MULTI_TEMPLATE > $HELLO_STARKNET_MULTI +# sncast --url $RPC_URL --accounts-file $ACCOUNT_FILE --account $ACCOUNT_NAME --wait multicall run --path $HELLO_STARKNET_MULTI +# +# sncast --url $RPC_URL --accounts-file $ACCOUNT_FILE --account $ACCOUNT_NAME --wait call --contract-address $CONTRACT_ADDRESS --function get_balance --block-id latest diff --git a/tests/integration/local/run.sh b/tests/integration/local/run.sh new file mode 100755 index 00000000..77277324 --- /dev/null +++ b/tests/integration/local/run.sh @@ -0,0 +1,104 @@ +#!/bin/bash +# +# This script runs all parts of the stack for local development / testing. + +# TODO: Check dependencies and install them if necessary? + +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +WORK_DIR=$SCRIPT_DIR/../../.. + +OUTPUT_DIR=$HOME/.art-peace-tests +TIMESTAMP=$(date +%s) +LOG_DIR=$OUTPUT_DIR/logs/$TIMESTAMP +TMP_DIR=$OUTPUT_DIR/tmp/$TIMESTAMP + +# TODO: Clean option to remove old logs and state +rm -rf $OUTPUT_DIR/logs/* +rm -rf $OUTPUT_DIR/tmp/* +mkdir -p $LOG_DIR +mkdir -p $TMP_DIR + +echo "Running art-peace locally w/ outputs in $OUTPUT_DIR ..." + +# Start the redis server +echo "Starting redis server ..." +kill $(ps aux | grep redis | grep 6379 | grep -v grep | awk '{print $2}') +REDIS_LOG_FILE=$LOG_DIR/redis.log +touch $REDIS_LOG_FILE +redis-server 2>&1 > $REDIS_LOG_FILE & +REDIS_PID=$! +sleep 2 # Wait for redis to start; TODO: Check if redis is actually running + +# Start the art-peace backend +echo "Starting art-peace backend ..." +kill $(ps aux | grep go\ run\ backend.go | grep -v grep | awk '{print $2}') +BACKEND_LOG_FILE=$LOG_DIR/backend.log +touch $BACKEND_LOG_FILE +cd $WORK_DIR/backend +go run backend.go 2>&1 > $BACKEND_LOG_FILE & +BACKEND_PID=$! +sleep 2 # Wait for backend to start; TODO: Check if backend is actually running + +# Start the art-peace indexer & local starknet node +# TODO: Split this into two separate commands & try w/o docker +echo "Starting art-peace indexer & local starknet node ..." +kill $(ps aux | grep docker\ compose\ up | grep -v grep | awk '{print $2}') +docker system prune -f +docker volume rm indexer_devnet indexer_dna +INDEXER_LOG_FILE=$LOG_DIR/indexer.log +touch $INDEXER_LOG_FILE +cd $WORK_DIR/indexer +docker compose up 2>&1 > $INDEXER_LOG_FILE & +INDEXER_PID=$! +sleep 2 # Wait for indexer to start; TODO: Check if indexer is actually running + +# Deploy the art-peace contract(s) +echo "Deploying art-peace contracts ..." +DEPLOY_LOG_FILE=$LOG_DIR/deploy.log +touch $DEPLOY_LOG_FILE +$SCRIPT_DIR/deploy.sh 2>&1 > $DEPLOY_LOG_FILE +# Read last word of last line of deploy log +ART_PEACE_CONTRACT_ADDRESS=$(cat $DEPLOY_LOG_FILE | tail -n 1 | awk '{print $NF}') +echo "Deployed art-peace contract(s) at $ART_PEACE_CONTRACT_ADDRESS" + +# Start the art-peace place_pixel indexer script +echo "Starting art-peace place_pixel indexer script ..." +kill $(ps aux | grep apibara\ run\ script.js | grep -v grep | awk '{print $2}') +INDEXER_SCRIPT_LOG_FILE=$LOG_DIR/indexer_script.log +touch $INDEXER_SCRIPT_LOG_FILE +cd $WORK_DIR/indexer +ART_PEACE_CONTRACT_ADDRESS=$ART_PEACE_CONTRACT_ADDRESS apibara run script.js --allow-env-from-env ART_PEACE_CONTRACT_ADDRESS 2>&1 > $INDEXER_SCRIPT_LOG_FILE & +INDEXER_SCRIPT_PID=$! +sleep 2 # Wait for indexer script to start; TODO: Check if indexer script is actually running + +# Initialize the art-peace canvas in the backend/redis +echo "Initializing art-peace canvas ..." +curl http://localhost:8080/initCanvas -d '{"width": 16, "height": 16}' + +# Start the art-peace frontend +echo "Starting art-peace frontend ..." +kill $(ps aux | grep npm\ start | grep -v grep | awk '{print $2}') +FRONTEND_LOG_FILE=$LOG_DIR/frontend.log +touch $FRONTEND_LOG_FILE +cd $WORK_DIR/frontend +REACT_APP_ART_PEACE_CONTRACT_ADDRESS=$ART_PEACE_CONTRACT_ADDRESS npm start 2>&1 > $FRONTEND_LOG_FILE & +FRONTEND_PID=$! +sleep 2 # Wait for frontend to start; TODO: Check if frontend is actually running + +# Wait for user to stop the stack +echo +echo "Art-peace stack is running. Press Ctrl+C to stop." +echo +# TODO: trap SIGINT and stop the stack? +while true; do + sleep 1 +done + +# TODO: stash data on shutdown +# Shutdown +echo "Shutting down ..." +kill $REDIS_PID +kill $BACKEND_PID +kill $INDEXER_PID +kill $FRONTEND_PID +kill $INDEXER_SCRIPT_PID